From 065dc01b3d0f431b28f316a144876044f4d57c85 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 23 May 2024 16:25:08 +0200 Subject: [PATCH] removing unecessary console log --- .../vocabulaire-summary/build/index.asset.php | 2 +- blocks/vocabulaire-summary/build/index.css | 6 +- blocks/vocabulaire-summary/build/index.js | 127 +++++++++--------- blocks/vocabulaire-summary/build/index.js.map | 2 +- .../vocabulaire-summary/build/style-index.css | 6 +- blocks/vocabulaire-summary/src/edit.js | 1 - 6 files changed, 70 insertions(+), 74 deletions(-) diff --git a/blocks/vocabulaire-summary/build/index.asset.php b/blocks/vocabulaire-summary/build/index.asset.php index f01ab24..41fa4ef 100644 --- a/blocks/vocabulaire-summary/build/index.asset.php +++ b/blocks/vocabulaire-summary/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '7dbd2ffcc4b8c84acf7f'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'ae650f260e754cce11e3'); diff --git a/blocks/vocabulaire-summary/build/index.css b/blocks/vocabulaire-summary/build/index.css index d6689e0..1793cd7 100644 --- a/blocks/vocabulaire-summary/build/index.css +++ b/blocks/vocabulaire-summary/build/index.css @@ -1,4 +1,4 @@ -/*!****************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! - \****************************************************************************************************************************************************************************************************************************************/ +/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! + \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ diff --git a/blocks/vocabulaire-summary/build/index.js b/blocks/vocabulaire-summary/build/index.js index 92ee839..4cb089f 100644 --- a/blocks/vocabulaire-summary/build/index.js +++ b/blocks/vocabulaire-summary/build/index.js @@ -2,42 +2,6 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ -/***/ "./src/img/chevron_down.svg": -/*!**********************************!*\ - !*** ./src/img/chevron_down.svg ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: () => (/* binding */ SvgChevronDown), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgChevronDown = function SvgChevronDown(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - xmlns: "http://www.w3.org/2000/svg", - width: 11.668, - height: 7.885 - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - "data-name": "Trac\\xE9 3614", - d: "m1.406 1.406 4.428 5.478 4.427-5.478", - fill: "none", - stroke: "#000", - strokeLinecap: "round", - strokeLinejoin: "round", - strokeWidth: 2 - }))); -}; - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMS42NjgiIGhlaWdodD0iNy44ODUiIHZpZXdCb3g9IjAgMCAxMS42NjggNy44ODUiPgogIDxwYXRoIGlkPSJUcmFjw6lfMzYxNCIgZGF0YS1uYW1lPSJUcmFjw6kgMzYxNCIgZD0iTTAsOC44NTUsNS40NzgsNC40MjcsMCwwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMC4yNjEgMS40MDYpIHJvdGF0ZSg5MCkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg=="); - -/***/ }), - /***/ "./src/edit.js": /*!*********************!*\ !*** ./src/edit.js ***! @@ -48,8 +12,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ Edit) /* harmony export */ }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); @@ -57,9 +21,11 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _img_chevron_down_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./img/chevron_down.svg */ "./src/img/chevron_down.svg"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _img_chevron_down_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./img/chevron_down.svg */ "./src/img/chevron_down.svg"); @@ -77,7 +43,7 @@ function Edit({ let { tooltipWords } = attributes; - let [hasFetchedDatas, setHasFetchedDatas] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + let [hasFetchedDatas, setHasFetchedDatas] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(false); function CurrentThematiqueDisplay({ id }) { @@ -156,10 +122,10 @@ function Edit({ function compareHasNewVocabularyWord(previousWords, newWords) { return !(JSON.stringify(previousWords) === JSON.stringify(newWords)); } - const currentPost = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select("core/editor").getCurrentPost()); - const currentBlocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select("core/block-editor").getBlocks()); - const currentTaxonomies = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select("core/editor").getCurrentPostAttribute("thematiques")); - let currentThematique = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select("core").getEntityRecord("taxonomy", "thematiques", currentTaxonomies[0] // or currentPost.thematiques[0] works as well + const currentPost = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select("core/editor").getCurrentPost()); + const currentBlocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select("core/block-editor").getBlocks()); + const currentTaxonomies = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select("core/editor").getCurrentPostAttribute("thematiques")); + let currentThematique = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select("core").getEntityRecord("taxonomy", "thematiques", currentTaxonomies[0] // or currentPost.thematiques[0] works as well ), [currentTaxonomies]); function getAdminLanguageFromCookie(c_name) { var c_value = document.cookie, @@ -179,7 +145,7 @@ function Edit({ } const currentLang = getAdminLanguageFromCookie("wp-wpml_current_language"); const localBlockName = currentLang === "fr" ? "Vocabulaire" : "Woordenschat"; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => { if (currentPost.content && currentBlocks) { const newTooltipWords = buildTooltipWords(); if (compareHasNewVocabularyWord(tooltipWords, newTooltipWords)) { @@ -189,26 +155,25 @@ function Edit({ } } }, [currentPost, currentBlocks]); - console.log((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("bonjour", "homegrade-blocks")); - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", { ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({ className: `homegrade-blocks-vocabulaire-summary` }) - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", { className: "homegrade-blocks-vocabulaire-summary__title" - }, localBlockName + " — ", currentThematique && currentThematique.name ? currentThematique.name : "...pas de thématique"), tooltipWords && tooltipWords.map(elem => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("details", { + }, localBlockName + " — ", currentThematique && currentThematique.name ? currentThematique.name : "...pas de thématique"), tooltipWords && tooltipWords.map(elem => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("details", { className: "question" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("summary", null, elem.tooltipText, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("summary", null, elem.tooltipText, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { className: "open-close-icon" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { - src: _img_chevron_down_svg__WEBPACK_IMPORTED_MODULE_6__["default"], + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { + src: _img_chevron_down_svg__WEBPACK_IMPORTED_MODULE_7__["default"], className: "open-close-cta", alt: "" - }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { className: "homegrade-blocks-vocabulaire-summary__content-wrapper homegrade-dynamic-accordeon__content-wrapper" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { class: " homegrade-dynamic-accordeon__content" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { className: "homegrade-blocks-vocabulaire-summary__content" }, elem.tooltipDefinition)))))); } @@ -260,6 +225,42 @@ __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin +/***/ }), + +/***/ "./src/img/chevron_down.svg": +/*!**********************************!*\ + !*** ./src/img/chevron_down.svg ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ReactComponent: () => (/* binding */ SvgChevronDown), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +var _path; +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +var SvgChevronDown = function SvgChevronDown(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ + xmlns: "http://www.w3.org/2000/svg", + width: 11.668, + height: 7.885 + }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { + "data-name": "Trac\\xE9 3614", + d: "m1.406 1.406 4.428 5.478 4.427-5.478", + fill: "none", + stroke: "#000", + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2 + }))); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMS42NjgiIGhlaWdodD0iNy44ODUiIHZpZXdCb3g9IjAgMCAxMS42NjggNy44ODUiPgogIDxwYXRoIGlkPSJUcmFjw6lfMzYxNCIgZGF0YS1uYW1lPSJUcmFjw6kgMzYxNCIgZD0iTTAsOC44NTUsNS40NzgsNC40MjcsMCwwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMC4yNjEgMS40MDYpIHJvdGF0ZSg5MCkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg=="); + /***/ }), /***/ "react": @@ -338,7 +339,7 @@ module.exports = window["wp"]["i18n"]; \************************/ /***/ ((module) => { -module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/vocabulaire-summary","version":"0.1.0","title":"Vocabulaire de la fiche","category":"homegrade-blocks","icon":{"foreground":"#DF1E1E","src":"testimonial"},"description":"Pour afficher tout le vocabulaire contenu dans la fiche","supports":{"html":false,"multiple":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"tooltipWords":{"type":"array","default":[]}}}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/vocabulaire-summary","version":"0.1.0","title":"Vocabulaire de la fiche","category":"homegrade-blocks","icon":{"foreground":"#DF1E1E","src":"testimonial"},"description":"Pour afficher tout le vocabulaire contenu dans la fiche","supports":{"html":false,"multiple":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"tooltipWords":{"type":"array","default":[]}}}'); /***/ }) @@ -384,9 +385,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ } /******/ var notFulfilled = Infinity; /******/ for (var i = 0; i < deferred.length; i++) { -/******/ var chunkIds = deferred[i][0]; -/******/ var fn = deferred[i][1]; -/******/ var priority = deferred[i][2]; +/******/ var [chunkIds, fn, priority] = deferred[i]; /******/ var fulfilled = true; /******/ for (var j = 0; j < chunkIds.length; j++) { /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { @@ -472,9 +471,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var runtime = data[2]; +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; @@ -497,7 +494,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ return __webpack_require__.O(result); /******/ } /******/ -/******/ var chunkLoadingGlobal = self["webpackChunkvocabulaire_summary"] = self["webpackChunkvocabulaire_summary"] || []; +/******/ var chunkLoadingGlobal = globalThis["webpackChunkvocabulaire_summary"] = globalThis["webpackChunkvocabulaire_summary"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); diff --git a/blocks/vocabulaire-summary/build/index.js.map b/blocks/vocabulaire-summary/build/index.js.map index 6b08456..83aecb7 100644 --- a/blocks/vocabulaire-summary/build/index.js.map +++ b/blocks/vocabulaire-summary/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA,sBAAsB,sEAAsE,gBAAgB,sBAAsB,OAAO,2BAA2B,0BAA0B,yDAAyD,iCAAiC,kBAAkB;AAC3Q;AAC/B;AACA,sBAAsB,gDAAmB;AACzC;AACA;AACA;AACA,GAAG,yCAAyC,gDAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAC4C;AAC5C,iEAAe,oBAAoB,wbAAwb;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnBtb;AACmB;AACjC;AACgC;AACT;AACW;AACV;AACM;AACJ;AAElC,SAASS,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EAC3D,IAAI;IAAEC;EAAa,CAAC,GAAGF,UAAU;EACjC,IAAI,CAACG,eAAe,EAAEC,kBAAkB,CAAC,GAAGX,4DAAQ,CAAC,KAAK,CAAC;EAE3D,SAASY,wBAAwBA,CAAC;IAAEC;EAAG,CAAC,EAAE;IACzC,MAAM;MAAEC,MAAM;MAAEC;IAAY,CAAC,GAAGhB,qEAAe,CAC9C,UAAU,EACV,aAAa,EACbc,EACD,CAAC;IAED,IAAIE,WAAW,EAAE;MAChB,OAAO,Y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;AAEZ;;;;;;;;;;;;;;;;ACnMsD;AAChC;AAEI;AAC1B;AACoC;AAEpC+C,oEAAiB,CAACC,6CAAa,EAAE;EAChCC,IAAI,EAAElF,6CAAIA;AACX,CAAC,CAAC;;;;;;;;;;;ACTF;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEnDA;UACA;UACA;UACA;UACA","sources":["webpack://vocabulaire-summary/./src/img/chevron_down.svg","webpack://vocabulaire-summary/./src/edit.js","webpack://vocabulaire-summary/./src/index.js","webpack://vocabulaire-summary/./src/editor.scss","webpack://vocabulaire-summary/./src/style.scss","webpack://vocabulaire-summary/external window \"React\"","webpack://vocabulaire-summary/external window [\"wp\",\"blockEditor\"]","webpack://vocabulaire-summary/external window [\"wp\",\"blocks\"]","webpack://vocabulaire-summary/external window [\"wp\",\"coreData\"]","webpack://vocabulaire-summary/external window [\"wp\",\"data\"]","webpack://vocabulaire-summary/external window [\"wp\",\"element\"]","webpack://vocabulaire-summary/external window [\"wp\",\"i18n\"]","webpack://vocabulaire-summary/webpack/bootstrap","webpack://vocabulaire-summary/webpack/runtime/chunk loaded","webpack://vocabulaire-summary/webpack/runtime/compat get default export","webpack://vocabulaire-summary/webpack/runtime/define property getters","webpack://vocabulaire-summary/webpack/runtime/hasOwnProperty shorthand","webpack://vocabulaire-summary/webpack/runtime/make namespace object","webpack://vocabulaire-summary/webpack/runtime/jsonp chunk loading","webpack://vocabulaire-summary/webpack/before-startup","webpack://vocabulaire-summary/webpack/startup","webpack://vocabulaire-summary/webpack/after-startup"],"sourcesContent":["var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nvar SvgChevronDown = function SvgChevronDown(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 11.668,\n height: 7.885\n }, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n \"data-name\": \"Trac\\\\xE9 3614\",\n d: \"m1.406 1.406 4.428 5.478 4.427-5.478\",\n fill: \"none\",\n stroke: \"#000\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n })));\n};\nexport { SvgChevronDown as ReactComponent };\nexport default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMS42NjgiIGhlaWdodD0iNy44ODUiIHZpZXdCb3g9IjAgMCAxMS42NjggNy44ODUiPgogIDxwYXRoIGlkPSJUcmFjw6lfMzYxNCIgZGF0YS1uYW1lPSJUcmFjw6kgMzYxNCIgZD0iTTAsOC44NTUsNS40NzgsNC40MjcsMCwwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMC4yNjEgMS40MDYpIHJvdGF0ZSg5MCkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg==\";","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps } from \"@wordpress/block-editor\";\nimport \"./editor.scss\";\nimport { useEntityRecord } from \"@wordpress/core-data\";\nimport { useState } from \"@wordpress/element\";\nimport { useSelect, useDispatch } from \"@wordpress/data\";\nimport { useEffect } from \"@wordpress/element\";\nimport { useEntityProp } from \"@wordpress/core-data\";\nimport chevronDown from \"./img/chevron_down.svg\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tlet { tooltipWords } = attributes;\n\tlet [hasFetchedDatas, setHasFetchedDatas] = useState(false);\n\n\tfunction CurrentThematiqueDisplay({ id }) {\n\t\tconst { record, isResolving } = useEntityRecord(\n\t\t\t\"taxonomy\",\n\t\t\t\"thematiques\",\n\t\t\tid\n\t\t);\n\n\t\tif (isResolving) {\n\t\t\treturn \"Loading...\";\n\t\t}\n\t\tif (!record) {\n\t\t\treturn \"no post...\";\n\t\t}\n\t\treturn record.name;\n\t}\n\tfunction getCurrentThematique(id) {\n\t\tconst { record, isResolving } = useEntityRecord(\n\t\t\t\"taxonomy\",\n\t\t\t\"thematiques\",\n\t\t\tid\n\t\t);\n\n\t\tif (isResolving) {\n\t\t\treturn \"Loading...\";\n\t\t}\n\t\tif (!record) {\n\t\t\treturn \"no post...\";\n\t\t}\n\t\treturn record;\n\t}\n\n\tfunction filterToolTipsArray(tooltipWords) {\n\t\tconst filteredTooltipWords = [];\n\n\t\ttooltipWords.forEach((tooltipWord) => {\n\t\t\tconst existingTooltip = filteredTooltipWords.find(\n\t\t\t\t(item) => item.tooltipID === tooltipWord.tooltipID\n\t\t\t);\n\n\t\t\tif (!existingTooltip) {\n\t\t\t\tfilteredTooltipWords.push(tooltipWord);\n\t\t\t}\n\t\t});\n\n\t\treturn filteredTooltipWords;\n\t}\n\tfunction parseContentTooltips(editorContent) {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(editorContent, \"text/html\");\n\t\tconst domTooltipWords = doc.querySelectorAll(\".tooltip-word\");\n\n\t\tconst tooltipWords = [];\n\n\t\t// Looping over tooltip words and filtering duplicates\n\t\tArray.from(domTooltipWords).forEach((tooltipWord) => {\n\t\t\tconst tooltipID = tooltipWord.getAttribute(\"data-definition-id\");\n\t\t\tconst tooltipText = tooltipWord.getAttribute(\"data-tooltip-word\");\n\t\t\tconst tooltipDefinition = tooltipWord.getAttribute(\n\t\t\t\t\"data-tooltip-definition\"\n\t\t\t);\n\n\t\t\ttooltipWords.push({\n\t\t\t\ttooltipID,\n\t\t\t\ttooltipText,\n\t\t\t\ttooltipDefinition,\n\t\t\t});\n\t\t});\n\t\treturn tooltipWords;\n\t}\n\tfunction parseBlocksTooltips(currentBlocks) {\n\t\tconst blocksTooltipWords = [];\n\t\tcurrentBlocks.forEach((block) => {\n\t\t\tif (\n\t\t\t\tblock.name === \"homegrade-content-blocks/questions-container\" &&\n\t\t\t\tblock.attributes &&\n\t\t\t\tblock.attributes.tooltipsWordsUsed &&\n\t\t\t\tblock.attributes.tooltipsWordsUsed.length > 0\n\t\t\t) {\n\t\t\t\tblock.attributes.tooltipsWordsUsed.forEach((tooltipWord) => {\n\t\t\t\t\tblocksTooltipWords.push(tooltipWord);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn blocksTooltipWords;\n\t}\n\tfunction buildTooltipWords() {\n\t\tlet newParsedTooltipWords = parseContentTooltips(currentPost.content);\n\t\tlet newBlocksTooltipWords = parseBlocksTooltips(currentBlocks);\n\t\tlet allTooltipWords = [...newParsedTooltipWords, ...newBlocksTooltipWords];\n\t\tconst filteredTooltipWords = filterToolTipsArray(allTooltipWords);\n\n\t\treturn filteredTooltipWords;\n\t}\n\n\tfunction compareHasNewVocabularyWord(previousWords, newWords) {\n\t\treturn !(JSON.stringify(previousWords) === JSON.stringify(newWords));\n\t}\n\n\tconst currentPost = useSelect((select) =>\n\t\tselect(\"core/editor\").getCurrentPost()\n\t);\n\n\tconst currentBlocks = useSelect((select) =>\n\t\tselect(\"core/block-editor\").getBlocks()\n\t);\n\n\tconst currentTaxonomies = useSelect((select) =>\n\t\tselect(\"core/editor\").getCurrentPostAttribute(\"thematiques\")\n\t);\n\n\tlet currentThematique = useSelect(\n\t\t(select) =>\n\t\t\tselect(\"core\").getEntityRecord(\n\t\t\t\t\"taxonomy\",\n\t\t\t\t\"thematiques\",\n\t\t\t\tcurrentTaxonomies[0] // or currentPost.thematiques[0] works as well\n\t\t\t),\n\t\t[currentTaxonomies]\n\t);\n\tfunction getAdminLanguageFromCookie(c_name) {\n\t\tvar c_value = document.cookie,\n\t\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\n\t\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\n\t\tif (c_start == -1) {\n\t\t\tc_value = null;\n\t\t} else {\n\t\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\n\t\t\tvar c_end = c_value.indexOf(\";\", c_start);\n\t\t\tif (c_end == -1) {\n\t\t\t\tc_end = c_value.length;\n\t\t\t}\n\t\t\tc_value = unescape(c_value.substring(c_start, c_end));\n\t\t}\n\t\treturn c_value;\n\t}\n\tconst currentLang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\n\tconst localBlockName = currentLang === \"fr\" ? \"Vocabulaire\" : \"Woordenschat\";\n\tuseEffect(() => {\n\t\tif (currentPost.content && currentBlocks) {\n\t\t\tconst newTooltipWords = buildTooltipWords();\n\n\t\t\tif (compareHasNewVocabularyWord(tooltipWords, newTooltipWords)) {\n\t\t\t\tsetAttributes({ tooltipWords: newTooltipWords });\n\t\t\t}\n\t\t}\n\t}, [currentPost, currentBlocks]);\n\n\tconsole.log(__(\"bonjour\", \"homegrade-blocks\"));\n\treturn (\n\t\t\n\t\t\t

\n\t\t\t\t{localBlockName + \" — \"}\n\t\t\t\t{currentThematique && currentThematique.name\n\t\t\t\t\t? currentThematique.name\n\t\t\t\t\t: \"...pas de thématique\"}\n\t\t\t

\n\t\t\t{tooltipWords &&\n\t\t\t\ttooltipWords.map((elem) => (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{elem.tooltipText}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t{elem.tooltipDefinition}\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t))}\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\n// import save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\tedit: Edit,\n});\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkvocabulaire_summary\"] = self[\"webpackChunkvocabulaire_summary\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","useEntityRecord","useState","useSelect","useDispatch","useEffect","useEntityProp","chevronDown","Edit","attributes","setAttributes","tooltipWords","hasFetchedDatas","setHasFetchedDatas","CurrentThematiqueDisplay","id","record","isResolving","name","getCurrentThematique","filterToolTipsArray","filteredTooltipWords","forEach","tooltipWord","existingTooltip","find","item","tooltipID","push","parseContentTooltips","editorContent","parser","DOMParser","doc","parseFromString","domTooltipWords","querySelectorAll","Array","from","getAttribute","tooltipText","tooltipDefinition","parseBlocksTooltips","currentBlocks","blocksTooltipWords","block","tooltipsWordsUsed","length","buildTooltipWords","newParsedTooltipWords","currentPost","content","newBlocksTooltipWords","allTooltipWords","compareHasNewVocabularyWord","previousWords","newWords","JSON","stringify","select","getCurrentPost","getBlocks","currentTaxonomies","getCurrentPostAttribute","currentThematique","getEntityRecord","getAdminLanguageFromCookie","c_name","c_value","document","cookie","c_start","indexOf","c_end","unescape","substring","currentLang","localBlockName","newTooltipWords","console","log","createElement","className","map","elem","src","alt","class","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACmB;AACjC;AACgC;AACT;AACW;AACV;AACM;AACJ;AAElC,SAASS,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE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WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://vocabulaire-summary/./src/edit.js","webpack://vocabulaire-summary/./src/index.js","webpack://vocabulaire-summary/./src/editor.scss","webpack://vocabulaire-summary/./src/style.scss","webpack://vocabulaire-summary/./src/img/chevron_down.svg","webpack://vocabulaire-summary/external window \"React\"","webpack://vocabulaire-summary/external window [\"wp\",\"blockEditor\"]","webpack://vocabulaire-summary/external window [\"wp\",\"blocks\"]","webpack://vocabulaire-summary/external window [\"wp\",\"coreData\"]","webpack://vocabulaire-summary/external window [\"wp\",\"data\"]","webpack://vocabulaire-summary/external window [\"wp\",\"element\"]","webpack://vocabulaire-summary/external window [\"wp\",\"i18n\"]","webpack://vocabulaire-summary/webpack/bootstrap","webpack://vocabulaire-summary/webpack/runtime/chunk loaded","webpack://vocabulaire-summary/webpack/runtime/compat get default export","webpack://vocabulaire-summary/webpack/runtime/define property getters","webpack://vocabulaire-summary/webpack/runtime/hasOwnProperty shorthand","webpack://vocabulaire-summary/webpack/runtime/make namespace object","webpack://vocabulaire-summary/webpack/runtime/jsonp chunk loading","webpack://vocabulaire-summary/webpack/before-startup","webpack://vocabulaire-summary/webpack/startup","webpack://vocabulaire-summary/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps } from \"@wordpress/block-editor\";\nimport \"./editor.scss\";\nimport { useEntityRecord } from \"@wordpress/core-data\";\nimport { useState } from \"@wordpress/element\";\nimport { useSelect, useDispatch } from \"@wordpress/data\";\nimport { useEffect } from \"@wordpress/element\";\nimport { useEntityProp } from \"@wordpress/core-data\";\nimport chevronDown from \"./img/chevron_down.svg\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tlet { tooltipWords } = attributes;\n\tlet [hasFetchedDatas, setHasFetchedDatas] = useState(false);\n\n\tfunction CurrentThematiqueDisplay({ id }) {\n\t\tconst { record, isResolving } = useEntityRecord(\n\t\t\t\"taxonomy\",\n\t\t\t\"thematiques\",\n\t\t\tid\n\t\t);\n\n\t\tif (isResolving) {\n\t\t\treturn \"Loading...\";\n\t\t}\n\t\tif (!record) {\n\t\t\treturn \"no post...\";\n\t\t}\n\t\treturn record.name;\n\t}\n\tfunction getCurrentThematique(id) {\n\t\tconst { record, isResolving } = useEntityRecord(\n\t\t\t\"taxonomy\",\n\t\t\t\"thematiques\",\n\t\t\tid\n\t\t);\n\n\t\tif (isResolving) {\n\t\t\treturn \"Loading...\";\n\t\t}\n\t\tif (!record) {\n\t\t\treturn \"no post...\";\n\t\t}\n\t\treturn record;\n\t}\n\n\tfunction filterToolTipsArray(tooltipWords) {\n\t\tconst filteredTooltipWords = [];\n\n\t\ttooltipWords.forEach((tooltipWord) => {\n\t\t\tconst existingTooltip = filteredTooltipWords.find(\n\t\t\t\t(item) => item.tooltipID === tooltipWord.tooltipID\n\t\t\t);\n\n\t\t\tif (!existingTooltip) {\n\t\t\t\tfilteredTooltipWords.push(tooltipWord);\n\t\t\t}\n\t\t});\n\n\t\treturn filteredTooltipWords;\n\t}\n\tfunction parseContentTooltips(editorContent) {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(editorContent, \"text/html\");\n\t\tconst domTooltipWords = doc.querySelectorAll(\".tooltip-word\");\n\n\t\tconst tooltipWords = [];\n\n\t\t// Looping over tooltip words and filtering duplicates\n\t\tArray.from(domTooltipWords).forEach((tooltipWord) => {\n\t\t\tconst tooltipID = tooltipWord.getAttribute(\"data-definition-id\");\n\t\t\tconst tooltipText = tooltipWord.getAttribute(\"data-tooltip-word\");\n\t\t\tconst tooltipDefinition = tooltipWord.getAttribute(\n\t\t\t\t\"data-tooltip-definition\"\n\t\t\t);\n\n\t\t\ttooltipWords.push({\n\t\t\t\ttooltipID,\n\t\t\t\ttooltipText,\n\t\t\t\ttooltipDefinition,\n\t\t\t});\n\t\t});\n\t\treturn tooltipWords;\n\t}\n\tfunction parseBlocksTooltips(currentBlocks) {\n\t\tconst blocksTooltipWords = [];\n\t\tcurrentBlocks.forEach((block) => {\n\t\t\tif (\n\t\t\t\tblock.name === \"homegrade-content-blocks/questions-container\" &&\n\t\t\t\tblock.attributes &&\n\t\t\t\tblock.attributes.tooltipsWordsUsed &&\n\t\t\t\tblock.attributes.tooltipsWordsUsed.length > 0\n\t\t\t) {\n\t\t\t\tblock.attributes.tooltipsWordsUsed.forEach((tooltipWord) => {\n\t\t\t\t\tblocksTooltipWords.push(tooltipWord);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn blocksTooltipWords;\n\t}\n\tfunction buildTooltipWords() {\n\t\tlet newParsedTooltipWords = parseContentTooltips(currentPost.content);\n\t\tlet newBlocksTooltipWords = parseBlocksTooltips(currentBlocks);\n\t\tlet allTooltipWords = [...newParsedTooltipWords, ...newBlocksTooltipWords];\n\t\tconst filteredTooltipWords = filterToolTipsArray(allTooltipWords);\n\n\t\treturn filteredTooltipWords;\n\t}\n\n\tfunction compareHasNewVocabularyWord(previousWords, newWords) {\n\t\treturn !(JSON.stringify(previousWords) === JSON.stringify(newWords));\n\t}\n\n\tconst currentPost = useSelect((select) =>\n\t\tselect(\"core/editor\").getCurrentPost()\n\t);\n\n\tconst currentBlocks = useSelect((select) =>\n\t\tselect(\"core/block-editor\").getBlocks()\n\t);\n\n\tconst currentTaxonomies = useSelect((select) =>\n\t\tselect(\"core/editor\").getCurrentPostAttribute(\"thematiques\")\n\t);\n\n\tlet currentThematique = useSelect(\n\t\t(select) =>\n\t\t\tselect(\"core\").getEntityRecord(\n\t\t\t\t\"taxonomy\",\n\t\t\t\t\"thematiques\",\n\t\t\t\tcurrentTaxonomies[0] // or currentPost.thematiques[0] works as well\n\t\t\t),\n\t\t[currentTaxonomies]\n\t);\n\tfunction getAdminLanguageFromCookie(c_name) {\n\t\tvar c_value = document.cookie,\n\t\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\n\t\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\n\t\tif (c_start == -1) {\n\t\t\tc_value = null;\n\t\t} else {\n\t\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\n\t\t\tvar c_end = c_value.indexOf(\";\", c_start);\n\t\t\tif (c_end == -1) {\n\t\t\t\tc_end = c_value.length;\n\t\t\t}\n\t\t\tc_value = unescape(c_value.substring(c_start, c_end));\n\t\t}\n\t\treturn c_value;\n\t}\n\tconst currentLang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\n\tconst localBlockName = currentLang === \"fr\" ? \"Vocabulaire\" : \"Woordenschat\";\n\tuseEffect(() => {\n\t\tif (currentPost.content && currentBlocks) {\n\t\t\tconst newTooltipWords = buildTooltipWords();\n\n\t\t\tif (compareHasNewVocabularyWord(tooltipWords, newTooltipWords)) {\n\t\t\t\tsetAttributes({ tooltipWords: newTooltipWords });\n\t\t\t}\n\t\t}\n\t}, [currentPost, currentBlocks]);\n\n\treturn (\n\t\t\n\t\t\t

\n\t\t\t\t{localBlockName + \" — \"}\n\t\t\t\t{currentThematique && currentThematique.name\n\t\t\t\t\t? currentThematique.name\n\t\t\t\t\t: \"...pas de thématique\"}\n\t\t\t

\n\t\t\t{tooltipWords &&\n\t\t\t\ttooltipWords.map((elem) => (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{elem.tooltipText}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t{elem.tooltipDefinition}\n\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t))}\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\n// import save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\tedit: Edit,\n});\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","var _path;\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from \"react\";\nvar SvgChevronDown = function SvgChevronDown(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 11.668,\n height: 7.885\n }, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n \"data-name\": \"Trac\\\\xE9 3614\",\n d: \"m1.406 1.406 4.428 5.478 4.427-5.478\",\n fill: \"none\",\n stroke: \"#000\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n })));\n};\nexport { SvgChevronDown as ReactComponent };\nexport default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMS42NjgiIGhlaWdodD0iNy44ODUiIHZpZXdCb3g9IjAgMCAxMS42NjggNy44ODUiPgogIDxwYXRoIGlkPSJUcmFjw6lfMzYxNCIgZGF0YS1uYW1lPSJUcmFjw6kgMzYxNCIgZD0iTTAsOC44NTUsNS40NzgsNC40MjcsMCwwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMC4yNjEgMS40MDYpIHJvdGF0ZSg5MCkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg==\";","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkvocabulaire_summary\"] = globalThis[\"webpackChunkvocabulaire_summary\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","useEntityRecord","useState","useSelect","useDispatch","useEffect","useEntityProp","chevronDown","Edit","attributes","setAttributes","tooltipWords","hasFetchedDatas","setHasFetchedDatas","CurrentThematiqueDisplay","id","record","isResolving","name","getCurrentThematique","filterToolTipsArray","filteredTooltipWords","forEach","tooltipWord","existingTooltip","find","item","tooltipID","push","parseContentTooltips","editorContent","parser","DOMParser","doc","parseFromString","domTooltipWords","querySelectorAll","Array","from","getAttribute","tooltipText","tooltipDefinition","parseBlocksTooltips","currentBlocks","blocksTooltipWords","block","tooltipsWordsUsed","length","buildTooltipWords","newParsedTooltipWords","currentPost","content","newBlocksTooltipWords","allTooltipWords","compareHasNewVocabularyWord","previousWords","newWords","JSON","stringify","select","getCurrentPost","getBlocks","currentTaxonomies","getCurrentPostAttribute","currentThematique","getEntityRecord","getAdminLanguageFromCookie","c_name","c_value","document","cookie","c_start","indexOf","c_end","unescape","substring","currentLang","localBlockName","newTooltipWords","createElement","className","map","elem","src","alt","class","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/vocabulaire-summary/build/style-index.css b/blocks/vocabulaire-summary/build/style-index.css index 2488c9e..95046e2 100644 --- a/blocks/vocabulaire-summary/build/style-index.css +++ b/blocks/vocabulaire-summary/build/style-index.css @@ -1,4 +1,4 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ diff --git a/blocks/vocabulaire-summary/src/edit.js b/blocks/vocabulaire-summary/src/edit.js index 3a64228..eae509c 100644 --- a/blocks/vocabulaire-summary/src/edit.js +++ b/blocks/vocabulaire-summary/src/edit.js @@ -160,7 +160,6 @@ export default function Edit({ attributes, setAttributes }) { } }, [currentPost, currentBlocks]); - console.log(__("bonjour", "homegrade-blocks")); return (