diff --git a/build/index.asset.php b/build/index.asset.php
index 0bb8721..a0ded77 100644
--- a/build/index.asset.php
+++ b/build/index.asset.php
@@ -1 +1 @@
- array('wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-rich-text'), 'version' => 'cb157be43098e220ac58');
+ array('wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-rich-text'), 'version' => '6b99bf41aa6ae29bed43');
diff --git a/build/index.js b/build/index.js
index c9cf494..967c114 100644
--- a/build/index.js
+++ b/build/index.js
@@ -157,13 +157,13 @@ const BrochureLinkFormatButton = props => {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.BlockControls, null, isPopoverOpen && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Popover, {
onClose: () => setIsPopoverOpen(false),
className: "popover_tooltip_field"
- }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.__experimentalLinkControl
- // prefetch pdf attachment
- , {
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.__experimentalLinkControl, {
suggestionsQuery: {
- type: "attachment",
- subtype: "pdf"
+ type: "attachment"
+ // subtype: "application/pdf", // Not working
+ // mime_type: "application/pdf", // Not working
},
+
value: linkValue,
onChange: value => {
setLinkValue(value);
diff --git a/build/index.js.map b/build/index.js.map
index a0dd60f..b123f6c 100644
--- a/build/index.js.map
+++ b/build/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAA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AAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACN4C;AACD;AAEX;AACc","sources":["webpack://multi-blocks/./node_modules/@wordpress/icons/build-module/library/check.js","webpack://multi-blocks/./node_modules/@wordpress/icons/build-module/library/trash.js","webpack://multi-blocks/./blocks/utilities.js","webpack://multi-blocks/./src/format-types/brochure/brochure.js","webpack://multi-blocks/./src/format-types/tooltip/tooltip.js","webpack://multi-blocks/./src/format-types/brochure/brochure.css","webpack://multi-blocks/./src/format-types/tooltip/tooltip.css","webpack://multi-blocks/external window [\"wp\",\"blockEditor\"]","webpack://multi-blocks/external window [\"wp\",\"components\"]","webpack://multi-blocks/external window [\"wp\",\"data\"]","webpack://multi-blocks/external window [\"wp\",\"element\"]","webpack://multi-blocks/external window [\"wp\",\"i18n\"]","webpack://multi-blocks/external window [\"wp\",\"primitives\"]","webpack://multi-blocks/external window [\"wp\",\"richText\"]","webpack://multi-blocks/webpack/bootstrap","webpack://multi-blocks/webpack/runtime/compat get default export","webpack://multi-blocks/webpack/runtime/define property getters","webpack://multi-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://multi-blocks/webpack/runtime/make namespace object","webpack://multi-blocks/./src/index.js"],"sourcesContent":["import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst check = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z\"\n}));\nexport default check;\n//# sourceMappingURL=check.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","export function getThematiqueFamilySlug(thematique_slug) {\r\n\tswitch (thematique_slug) {\r\n\t\tcase \"energie\":\r\n\t\tcase \"urbanisme\":\r\n\t\t\treturn \"energies-urbanisme\";\r\n\r\n\t\tcase \"acoustique\":\r\n\t\tcase \"petites-coproprietes\":\r\n\t\t\treturn \"acoustique-coproprietes\";\r\n\r\n\t\tcase \"isolation\":\r\n\t\tcase \"au-quotidien\":\r\n\t\t\treturn \"isolation-quotidien\";\r\n\r\n\t\tcase \"energies\":\r\n\t\tcase \"urbanisme\":\r\n\t\t\treturn \"energies-urbanisme\";\r\n\r\n\t\tcase \"patrimoine\":\r\n\t\tcase \"renovation\":\r\n\t\t\treturn \"patrimoine-renovation\";\r\n\r\n\t\tcase \"location\":\r\n\t\t\treturn \"location\";\r\n\t}\r\n}\r\n","import { registerFormatType, toggleFormat, applyFormat, getActiveFormats } from \"@wordpress/rich-text\";\r\nimport { __ } from \"@wordpress/i18n\";\r\nimport { BlockControls, __experimentalLinkControl as LinkControl } from \"@wordpress/block-editor\";\r\nimport { Popover, Button } from \"@wordpress/components\";\r\n\r\nimport { ToolbarGroup, ToolbarButton, TextareaControl } from \"@wordpress/components\";\r\nimport { check, trash } from \"@wordpress/icons\";\r\n\r\nimport { useState } from \"@wordpress/element\";\r\n\r\nconst formatName = \"homegrade-format/brochure-format\";\r\n\r\nconst BrochureLinkFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\tconst [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n\tconst [linkValue, setLinkValue] = useState(\"\");\r\n\r\n\tconst activeFormat = getActiveFormats(value).filter((format) => format.type === formatName)[0];\r\n\r\n\tfunction setFormat() {\r\n\t\tsetIsPopoverOpen(!isPopoverOpen);\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\thref: linkValue.url,\r\n\t\t\t\t\ttarget: \"_blank\",\r\n\t\t\t\t\tdataId: linkValue.id.toString(),\r\n\t\t\t\t\tstyle: \"text-decoration: underline;\",\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction removeFormat() {\r\n\t\tsetIsPopoverOpen(false);\r\n\t\tsetLinkValue(\"\");\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{isPopoverOpen && (\r\n\t\t\t\t\t setIsPopoverOpen(false)}\r\n\t\t\t\t\t\tclassName='popover_tooltip_field'>\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tsetLinkValue(value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t!isActive ? setIsPopoverOpen(!isPopoverOpen) : removeFormat()\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t>\r\n\t);\r\n};\r\n\r\nregisterFormatType(\"homegrade-format/brochure-format\", {\r\n\ttitle: \"Lien Brochure\",\r\n\ttagName: \"a\",\r\n\tclassName: \"brochure-link-format\",\r\n\tedit: BrochureLinkFormatButton,\r\n});\r\n","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat, applyFormat, getActiveFormats } from \"@wordpress/rich-text\";\r\n\r\nimport { BlockControls, __experimentalLinkControl as LinkControl } from \"@wordpress/block-editor\";\r\nimport { Popover, ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\r\nimport { trash } from \"@wordpress/icons\";\r\nimport { useState } from \"@wordpress/element\";\r\nimport { useSelect } from \"@wordpress/data\"; // pour les querry\r\n\r\nconst formatName = \"homegrade-format/tooltip\";\r\n\r\nconst Edit = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\tconst [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n\tconst [pendingDefinition, setPendingDefinition] = useState(false);\r\n\r\n\tconst activeFormat = getActiveFormats(value).filter((format) => format.type === formatName)[0];\r\n\tconst lang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\r\n\tfunction getAdminLanguageFromCookie(c_name) {\r\n\t\tvar c_value = document.cookie,\r\n\t\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\r\n\t\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\r\n\t\tif (c_start == -1) {\r\n\t\t\tc_value = null;\r\n\t\t} else {\r\n\t\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\r\n\t\t\tvar c_end = c_value.indexOf(\";\", c_start);\r\n\t\t\tif (c_end == -1) {\r\n\t\t\t\tc_end = c_value.length;\r\n\t\t\t}\r\n\t\t\tc_value = unescape(c_value.substring(c_start, c_end));\r\n\t\t}\r\n\t\treturn c_value;\r\n\t}\r\n\tfunction removeFormat() {\r\n\t\tsetIsPopoverOpen(false);\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction setFormat(postDatas) {\r\n\t\tsetPendingDefinition(true);\r\n\t\tsetIsPopoverOpen(false);\r\n\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\tdefinitionId: postDatas.id.toString(),\r\n\t\t\t\t\tdataTooltipWord: postDatas.title,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\tconst post = useSelect((select) => {\r\n\t\tif (activeFormat && activeFormat.attributes.definitionId) {\r\n\t\t\treturn select(\"core\").getEntityRecord(\r\n\t\t\t\t\"postType\",\r\n\t\t\t\t\"vocabulaire\",\r\n\t\t\t\tactiveFormat.attributes.definitionId\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n\r\n\tif (post && pendingDefinition) {\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\tdataTooltipDefinition: post.acf.definition,\r\n\t\t\t\t\tdefinitionId: activeFormat.attributes.definitionId,\r\n\t\t\t\t\tdataTooltipWord: activeFormat.attributes.dataTooltipWord,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t\tsetPendingDefinition(false);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{isPopoverOpen && (\r\n\t\t\t\t\t setIsPopoverOpen(false)}\r\n\t\t\t\t\t\tclassName='popover_tooltip_field'>\r\n\t\t\t\t\t\t setFormat(postDatas)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tsetIsPopoverOpen(true);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{isActive && (\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tremoveFormat();\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t>\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Tooltip\", \"homegrade-format\"),\r\n\ttagName: \"span\",\r\n\tattributes: {\r\n\t\tdefinitionId: \"data-definition-id\",\r\n\t\tdataTooltipDefinition: \"data-tooltip-definition\",\r\n\t\tdataTooltipWord: \"data-tooltip-word\",\r\n\t},\r\n\tclassName: \"tooltip-word\",\r\n\tedit: Edit,\r\n});\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"wp\"][\"richText\"];","// 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","// 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};","import \"./format-types/tooltip/tooltip.css\";\r\nimport \"./format-types/tooltip/tooltip.js\";\r\n\r\nimport \"../blocks/utilities.js\";\r\nimport \"./format-types/brochure/brochure.css\";\r\nimport \"./format-types/brochure/brochure.js\";\r\n"],"names":["getThematiqueFamilySlug","thematique_slug","registerFormatType","toggleFormat","applyFormat","getActiveFormats","__","BlockControls","__experimentalLinkControl","LinkControl","Popover","Button","ToolbarGroup","ToolbarButton","TextareaControl","check","trash","useState","formatName","BrochureLinkFormatButton","props","isActive","value","onChange","isPopoverOpen","setIsPopoverOpen","linkValue","setLinkValue","activeFormat","filter","format","type","setFormat","attributes","href","url","target","dataId","id","toString","style","removeFormat","createElement","Fragment","onClose","className","suggestionsQuery","subtype","icon","variant","onClick","label","title","tagName","edit","useSelect","Edit","pendingDefinition","setPendingDefinition","lang","getAdminLanguageFromCookie","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring","postDatas","definitionId","dataTooltipWord","post","select","getEntityRecord","dataTooltipDefinition","acf","definition","link","tile","kind","isCollapsed"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAmD;;AAEnD;AACA;AACA;AACkD;AAClD,cAAc,iEAAa,CAAC,sDAAG;AAC/B;AACA;AACA,CAAC,EAAE,iEAAa,CAAC,uDAAI;AACrB;AACA,CAAC;AACD,iEAAe,KAAK,EAAC;AACrB;;;;;;;;;;;;;;;;;;ACbmD;;AAEnD;AACA;AACA;AACkD;AAClD,cAAc,iEAAa,CAAC,sDAAG;AAC/B;AACA;AACA,CAAC,EAAE,iEAAa,CAAC,uDAAI;AACrB;AACA,CAAC;AACD,iEAAe,KAAK,EAAC;AACrB;;;;;;;;;;;;;;ACbO,SAASA,uBAAuBA,CAACC,eAAe,EAAE;EACxD,QAAQA,eAAe;IACtB,KAAK,SAAS;IACd,KAAK,WAAW;MACf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AAEL,CAAC;AAEDvC,wEAAkB,CAACgB,UAAU,EAAE;EAC9BiC,KAAK,EAAE7C,mDAAE,CAAC,SAAS,EAAE,kBAAkB,CAAC;EACxC8C,OAAO,EAAE,MAAM;EACfnB,UAAU,EAAE;IACXsC,YAAY,EAAE,oBAAoB;IAClCK,qBAAqB,EAAE,yBAAyB;IAChDJ,eAAe,EAAE;EAClB,CAAC;EACD3B,SAAS,EAAE,cAAc;EACzBQ,IAAI,EAAEE;AACP,CAAC,CAAC;;;;;;;;;;;ACnJF;;;;;;;;;;;;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;;;;;WCtBA;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;;;;;;;;;;;;;;;;ACN4C;AACD;AAEX;AACc","sources":["webpack://multi-blocks/./node_modules/@wordpress/icons/build-module/library/check.js","webpack://multi-blocks/./node_modules/@wordpress/icons/build-module/library/trash.js","webpack://multi-blocks/./blocks/utilities.js","webpack://multi-blocks/./src/format-types/brochure/brochure.js","webpack://multi-blocks/./src/format-types/tooltip/tooltip.js","webpack://multi-blocks/./src/format-types/brochure/brochure.css","webpack://multi-blocks/./src/format-types/tooltip/tooltip.css","webpack://multi-blocks/external window [\"wp\",\"blockEditor\"]","webpack://multi-blocks/external window [\"wp\",\"components\"]","webpack://multi-blocks/external window [\"wp\",\"data\"]","webpack://multi-blocks/external window [\"wp\",\"element\"]","webpack://multi-blocks/external window [\"wp\",\"i18n\"]","webpack://multi-blocks/external window [\"wp\",\"primitives\"]","webpack://multi-blocks/external window [\"wp\",\"richText\"]","webpack://multi-blocks/webpack/bootstrap","webpack://multi-blocks/webpack/runtime/compat get default export","webpack://multi-blocks/webpack/runtime/define property getters","webpack://multi-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://multi-blocks/webpack/runtime/make namespace object","webpack://multi-blocks/./src/index.js"],"sourcesContent":["import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst check = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z\"\n}));\nexport default check;\n//# sourceMappingURL=check.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","export function getThematiqueFamilySlug(thematique_slug) {\r\n\tswitch (thematique_slug) {\r\n\t\tcase \"energie\":\r\n\t\tcase \"urbanisme\":\r\n\t\t\treturn \"energies-urbanisme\";\r\n\r\n\t\tcase \"acoustique\":\r\n\t\tcase \"petites-coproprietes\":\r\n\t\t\treturn \"acoustique-coproprietes\";\r\n\r\n\t\tcase \"isolation\":\r\n\t\tcase \"au-quotidien\":\r\n\t\t\treturn \"isolation-quotidien\";\r\n\r\n\t\tcase \"energies\":\r\n\t\tcase \"urbanisme\":\r\n\t\t\treturn \"energies-urbanisme\";\r\n\r\n\t\tcase \"patrimoine\":\r\n\t\tcase \"renovation\":\r\n\t\t\treturn \"patrimoine-renovation\";\r\n\r\n\t\tcase \"location\":\r\n\t\t\treturn \"location\";\r\n\t}\r\n}\r\n","import { registerFormatType, toggleFormat, applyFormat, getActiveFormats } from \"@wordpress/rich-text\";\r\nimport { __ } from \"@wordpress/i18n\";\r\nimport { BlockControls, __experimentalLinkControl as LinkControl } from \"@wordpress/block-editor\";\r\nimport { Popover, Button } from \"@wordpress/components\";\r\n\r\nimport { ToolbarGroup, ToolbarButton, TextareaControl } from \"@wordpress/components\";\r\nimport { check, trash } from \"@wordpress/icons\";\r\n\r\nimport { useState } from \"@wordpress/element\";\r\n\r\nconst formatName = \"homegrade-format/brochure-format\";\r\n\r\nconst BrochureLinkFormatButton = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\tconst [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n\tconst [linkValue, setLinkValue] = useState(\"\");\r\n\r\n\tconst activeFormat = getActiveFormats(value).filter((format) => format.type === formatName)[0];\r\n\r\n\tfunction setFormat() {\r\n\t\tsetIsPopoverOpen(!isPopoverOpen);\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\thref: linkValue.url,\r\n\t\t\t\t\ttarget: \"_blank\",\r\n\t\t\t\t\tdataId: linkValue.id.toString(),\r\n\t\t\t\t\tstyle: \"text-decoration: underline;\",\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction removeFormat() {\r\n\t\tsetIsPopoverOpen(false);\r\n\t\tsetLinkValue(\"\");\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{isPopoverOpen && (\r\n\t\t\t\t\t setIsPopoverOpen(false)}\r\n\t\t\t\t\t\tclassName='popover_tooltip_field'>\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tsetLinkValue(value);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t!isActive ? setIsPopoverOpen(!isPopoverOpen) : removeFormat()\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t>\r\n\t);\r\n};\r\n\r\nregisterFormatType(\"homegrade-format/brochure-format\", {\r\n\ttitle: \"Lien Brochure\",\r\n\ttagName: \"a\",\r\n\tclassName: \"brochure-link-format\",\r\n\tedit: BrochureLinkFormatButton,\r\n});\r\n","import { __ } from \"@wordpress/i18n\";\r\nimport { registerFormatType, toggleFormat, applyFormat, getActiveFormats } from \"@wordpress/rich-text\";\r\n\r\nimport { BlockControls, __experimentalLinkControl as LinkControl } from \"@wordpress/block-editor\";\r\nimport { Popover, ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\r\nimport { trash } from \"@wordpress/icons\";\r\nimport { useState } from \"@wordpress/element\";\r\nimport { useSelect } from \"@wordpress/data\"; // pour les querry\r\n\r\nconst formatName = \"homegrade-format/tooltip\";\r\n\r\nconst Edit = (props) => {\r\n\tconst { isActive, value, onChange } = props;\r\n\tconst [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n\tconst [pendingDefinition, setPendingDefinition] = useState(false);\r\n\r\n\tconst activeFormat = getActiveFormats(value).filter((format) => format.type === formatName)[0];\r\n\tconst lang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\r\n\tfunction getAdminLanguageFromCookie(c_name) {\r\n\t\tvar c_value = document.cookie,\r\n\t\t\tc_start = c_value.indexOf(\" \" + c_name + \"=\");\r\n\t\tif (c_start == -1) c_start = c_value.indexOf(c_name + \"=\");\r\n\t\tif (c_start == -1) {\r\n\t\t\tc_value = null;\r\n\t\t} else {\r\n\t\t\tc_start = c_value.indexOf(\"=\", c_start) + 1;\r\n\t\t\tvar c_end = c_value.indexOf(\";\", c_start);\r\n\t\t\tif (c_end == -1) {\r\n\t\t\t\tc_end = c_value.length;\r\n\t\t\t}\r\n\t\t\tc_value = unescape(c_value.substring(c_start, c_end));\r\n\t\t}\r\n\t\treturn c_value;\r\n\t}\r\n\tfunction removeFormat() {\r\n\t\tsetIsPopoverOpen(false);\r\n\t\tonChange(\r\n\t\t\ttoggleFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\tfunction setFormat(postDatas) {\r\n\t\tsetPendingDefinition(true);\r\n\t\tsetIsPopoverOpen(false);\r\n\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\tdefinitionId: postDatas.id.toString(),\r\n\t\t\t\t\tdataTooltipWord: postDatas.title,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t}\r\n\r\n\tconst post = useSelect((select) => {\r\n\t\tif (activeFormat && activeFormat.attributes.definitionId) {\r\n\t\t\treturn select(\"core\").getEntityRecord(\r\n\t\t\t\t\"postType\",\r\n\t\t\t\t\"vocabulaire\",\r\n\t\t\t\tactiveFormat.attributes.definitionId\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n\r\n\tif (post && pendingDefinition) {\r\n\t\tonChange(\r\n\t\t\tapplyFormat(value, {\r\n\t\t\t\ttype: formatName,\r\n\t\t\t\tattributes: {\r\n\t\t\t\t\tdataTooltipDefinition: post.acf.definition,\r\n\t\t\t\t\tdefinitionId: activeFormat.attributes.definitionId,\r\n\t\t\t\t\tdataTooltipWord: activeFormat.attributes.dataTooltipWord,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t);\r\n\t\tsetPendingDefinition(false);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{isPopoverOpen && (\r\n\t\t\t\t\t setIsPopoverOpen(false)}\r\n\t\t\t\t\t\tclassName='popover_tooltip_field'>\r\n\t\t\t\t\t\t setFormat(postDatas)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tsetIsPopoverOpen(true);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{isActive && (\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tremoveFormat();\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t>\r\n\t);\r\n};\r\n\r\nregisterFormatType(formatName, {\r\n\ttitle: __(\"Tooltip\", \"homegrade-format\"),\r\n\ttagName: \"span\",\r\n\tattributes: {\r\n\t\tdefinitionId: \"data-definition-id\",\r\n\t\tdataTooltipDefinition: \"data-tooltip-definition\",\r\n\t\tdataTooltipWord: \"data-tooltip-word\",\r\n\t},\r\n\tclassName: \"tooltip-word\",\r\n\tedit: Edit,\r\n});\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"wp\"][\"richText\"];","// 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","// 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};","import \"./format-types/tooltip/tooltip.css\";\r\nimport \"./format-types/tooltip/tooltip.js\";\r\n\r\nimport \"../blocks/utilities.js\";\r\nimport \"./format-types/brochure/brochure.css\";\r\nimport \"./format-types/brochure/brochure.js\";\r\n"],"names":["getThematiqueFamilySlug","thematique_slug","registerFormatType","toggleFormat","applyFormat","getActiveFormats","__","BlockControls","__experimentalLinkControl","LinkControl","Popover","Button","ToolbarGroup","ToolbarButton","TextareaControl","check","trash","useState","formatName","BrochureLinkFormatButton","props","isActive","value","onChange","isPopoverOpen","setIsPopoverOpen","linkValue","setLinkValue","activeFormat","filter","format","type","setFormat","attributes","href","url","target","dataId","id","toString","style","removeFormat","createElement","Fragment","onClose","className","suggestionsQuery","icon","variant","onClick","label","title","tagName","edit","useSelect","Edit","pendingDefinition","setPendingDefinition","lang","getAdminLanguageFromCookie","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring","postDatas","definitionId","dataTooltipWord","post","select","getEntityRecord","dataTooltipDefinition","acf","definition","link","tile","kind","subtype","isCollapsed"],"sourceRoot":""}
\ No newline at end of file
diff --git a/index.php b/index.php
index a4c63d9..20addbf 100644
--- a/index.php
+++ b/index.php
@@ -43,16 +43,18 @@ function create_block_multiblocks_block_init()
// Dynamics
register_block_type(__DIR__ . '/blocks/questions-container/build');
register_block_type(__DIR__ . '/blocks/vocabulaire-summary/build');
- register_block_type(__DIR__ . '/blocks/illustration-thematique/build');
register_block_type(__DIR__ . '/blocks/focused-schema/build');
register_block_type(__DIR__ . '/blocks/focused-thematique/build');
+ // register_block_type(__DIR__ . '/blocks/chapitrage-thematique/build');
+
+ // register_block_type(__DIR__ . '/blocks/illustration-thematique/build');
// Statics
- register_block_type(__DIR__ . '/blocks/content-heading/build');
register_block_type(__DIR__ . '/blocks/points-cles/build');
+ register_block_type(__DIR__ . '/blocks/content-heading/build');
register_block_type(__DIR__ . '/blocks/picture-banner/build');
register_block_type(__DIR__ . '/blocks/highlight/build');
- register_block_type(__DIR__ . '/blocks/dynamicTest/build');
+ register_block_type(__DIR__ . '/blocks/aside/build');
}
add_action('init', 'create_block_multiblocks_block_init');
diff --git a/src/format-types/brochure/brochure.js b/src/format-types/brochure/brochure.js
index eca9b95..1a3775b 100644
--- a/src/format-types/brochure/brochure.js
+++ b/src/format-types/brochure/brochure.js
@@ -49,20 +49,15 @@ const BrochureLinkFormatButton = (props) => {
onClose={() => setIsPopoverOpen(false)}
className='popover_tooltip_field'>
{
setLinkValue(value);
}}
-
/>