diff --git a/blocks/post-card/build/index.js.map b/blocks/post-card/build/index.js.map index b5fd507..fde49be 100644 --- a/blocks/post-card/build/index.js.map +++ b/blocks/post-card/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACuB;AAK7B;AACR;AACsC;AAEjB;AACa;AACC;AAE3C,SAASW,oBAAoBA,CAAC;EAC5CC,aAAa;EACbC,aAAa;EACbC,eAAe;EACfC,cAAc;EACdC;AACD,CAAC,EAAE;EACF,IAAI,CAACA,QAAQ,IAAI,CAACJ,aAAa,EAAE,OAAOK,oDAAA,YAAG,SAAU,CAAC;EAEtD,IAAI,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGV,4DAAQ,CAAC,IAAI,CAAC;EAElD,MAAMW,IAAI,GAAGC,0BAA0B,CAAC,0BAA0B,CAAC;EACnE,MAAMC,WAAW,GAAGf,0DAAS,CAC3BgB,MAAM,IAAK;IACX,IAAI,CAACP,QAAQ,EAAE,OAAO,IAAI;IAC1B,IAAIQ,KAAK,GAAG;MACXC,MAAM,EAAE,SAAS;MACjBC,QAAQ,EAAE,CAAC,CAAC;MACZN,IAAI,EAAEA;IACP,CAAC;IACD,OAAOG,MAAM,CAAC,MAAM,CAAC,CAACI,gBAAgB,CAAC,UAAU,EAAEX,QAAQ,EAAEQ,KAAK,CAAC;EACpE,CAAC,EACD,CAACR,QAAQ,EAAEI,IAAI,CAChB,CAAC;EACD,MAAMQ,OAAO,GAAGf,aAAa,GACzB,GAAEgB,MAAM,CAACC,QAAQ,CAACC,MAAO,2BAA0BlB,aAAc,cAAa,GAC/E,IAAI;EACP,SAASQ,0BAA0BA,CAACW,MAAM,EAAE;IAC3C,IAAIC,OAAO,GAAGC,QAAQ,CAACC,MAAM;MAC5BC,OAAO,GAAGH,OAAO,CAACI,OAAO,CAAC,GAAG,GAAGL,MAAM,GAAG,GAAG,CAAC;IAC9C,IAAII,OAAO,IAAI,CAAC,CA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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://multiblocks/./src/OptionsSelectControl.js","webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"coreData\"]","webpack://multiblocks/external window [\"wp\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"htmlEntities\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\r\nimport { InspectorControls } from \"@wordpress/block-editor\";\r\nimport {\r\n\tPanelBody,\r\n\tSelectControl,\r\n\tComboboxControl,\r\n} from \"@wordpress/components\";\r\nimport \"./editor.scss\";\r\nimport { Tip, CheckboxControl } from \"@wordpress/components\";\r\n\r\nimport { useSelect } from \"@wordpress/data\";\r\nimport { useEffect, useState } from \"@wordpress/element\";\r\nimport { decodeEntities } from \"@wordpress/html-entities\";\r\n\r\nexport default function OptionsSelectControl({\r\n\tsetAttributes,\r\n\trelatedPostId,\r\n\tpostDescription,\r\n\thasDescription,\r\n\tpostType,\r\n}) {\r\n\tif (!postType || !setAttributes) return

Loading

;\r\n\r\n\tlet [postOptions, setPostOptions] = useState(null);\r\n\r\n\tconst lang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\r\n\tconst optionPages = useSelect(\r\n\t\t(select) => {\r\n\t\t\tif (!postType) return null;\r\n\t\t\tlet query = {\r\n\t\t\t\tstatus: \"publish\",\r\n\t\t\t\tper_page: -1,\r\n\t\t\t\tlang: lang,\r\n\t\t\t};\r\n\t\t\treturn select(\"core\").getEntityRecords(\"postType\", postType, query);\r\n\t\t},\r\n\t\t[postType, lang],\r\n\t);\r\n\tconst editUrl = relatedPostId\r\n\t\t? `${window.location.origin}/wp-admin/post.php?post=${relatedPostId}&action=edit`\r\n\t\t: null;\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\r\n\tfunction handleHasDescriptionChange(hasDescription) {\r\n\t\tsetAttributes({ hasDescription });\r\n\t}\r\n\r\n\tfunction handleRelatedPostChange(postId) {\r\n\t\tsetAttributes({ relatedPostId: Number(postId) });\r\n\t}\r\n\tfunction handlePostTypeChange(postType) {\r\n\t\tsetAttributes({ postType: postType, relatedPostId: null });\r\n\t}\r\n\r\n\tfunction buildSelectOptions(optionPages) {\r\n\t\tlet options = [];\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\toptions.push({ value: 0, label: \"Selectionnez une page\" });\r\n\t\t\toptionPages.forEach((page) => {\r\n\t\t\t\toptions.push({\r\n\t\t\t\t\tvalue: page.id,\r\n\t\t\t\t\tlabel: decodeEntities(page.title.rendered),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\toptions.push({ value: 0, label: \"Pas encore de questions...\" });\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!optionPages || !postType) return;\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\tsetPostOptions(buildSelectOptions(optionPages));\r\n\t\t}\r\n\t}, [optionPages, postType]);\r\n\r\n\tlet panelTitle = \"Post Reliée\";\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\t{postOptions && (\r\n\t\t\t\t\t handleRelatedPostChange(e)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t\t{relatedPostId && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{__(\r\n\t\t\t\t\t\t\t\"Pourrrrrr modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.\",\r\n\t\t\t\t\t\t\t\"homegrade-blocks\",\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\t{relatedPostId && editUrl && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tÉditer le post\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\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","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps } from \"@wordpress/block-editor\";\n\nimport { useSelect } from \"@wordpress/data\"; // pour les querry\nimport \"./editor.scss\";\nimport { decodeEntities } from \"@wordpress/html-entities\";\nimport OptionsSelectControl from \"./OptionsSelectControl\";\nimport { RichText } from \"@wordpress/block-editor\";\n\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { relatedPostId, postType, hasDescription, postDescription } =\n\t\tattributes;\n\n\tconst currentRelatedPost = useSelect(\n\t\t(select) =>\n\t\t\trelatedPostId && postType\n\t\t\t\t? select(\"core\").getEntityRecord(\"postType\", postType, relatedPostId)\n\t\t\t\t: null,\n\t\t[relatedPostId, postType],\n\t);\n\n\tconst post = useSelect((select) =>\n\t\tselect(\"core\").getEntityRecord(\"postType\", postType, relatedPostId),\n\t);\n\n\tconst postMainTaxonomy = useSelect(\n\t\t(select) => {\n\t\t\treturn select(\"core\").getEntityRecord(\n\t\t\t\t\"taxonomy\",\n\t\t\t\t\"thematiques\",\n\t\t\t\tpost?.thematiques ?? null,\n\t\t\t);\n\t\t},\n\t\t[post],\n\t);\n\n\tconst postParentTaxonomy = useSelect(\n\t\t(select) => {\n\t\t\tif (!postMainTaxonomy) return null;\n\t\t\tif (postMainTaxonomy && !postMainTaxonomy.parent) return postMainTaxonomy;\n\t\t\treturn select(\"core\").getEntityRecord(\n\t\t\t\t\"taxonomy\",\n\t\t\t\t\"thematiques\",\n\t\t\t\tpostMainTaxonomy?.parent ?? null,\n\t\t\t);\n\t\t},\n\t\t[postMainTaxonomy],\n\t);\n\n\tconst thematiqueCoverUrl = useSelect(\n\t\t(select) => {\n\t\t\tlet thematiqueMediaId = postParentTaxonomy?.acf?.taxonomy_pictures?.icon;\n\t\t\tconst media = select(\"core\").getMedia(thematiqueMediaId);\n\t\t\treturn media?.source_url ?? null;\n\t\t},\n\t\t[postParentTaxonomy],\n\t);\n\n\tconst postTypeDatas = useSelect((select) =>\n\t\tselect(\"core\").getEntityConfig(\"postType\", postType),\n\t);\n\tfunction handlePostDescriptionChange(description) {\n\t\tsetAttributes({ postDescription: description });\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\n\t\t\t\n\t\t\t\t\"\"\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{postParentTaxonomy && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{postParentTaxonomy.name}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{postTypeDatas && (\n\t\t\t\t\t\t\t
{postTypeDatas.label}
\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t{currentRelatedPost && currentRelatedPost.title && (\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{decodeEntities(currentRelatedPost.title.rendered)}\n\t\t\t\t\t\t

\n\t\t\t\t\t)}\n\t\t\t\t\t{hasDescription && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t{!relatedPostId && (\n\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\"Ce bloc n'est relié à aucun post. Rattachez-le à un post dans la barre latérale.\",\n\t\t\t\t\t\t\t\t\"homegrade-blocks__texte-backoffice\",\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\t\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\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\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"htmlEntities\"];","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[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\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":["__","InspectorControls","PanelBody","SelectControl","ComboboxControl","Tip","CheckboxControl","useSelect","useEffect","useState","decodeEntities","OptionsSelectControl","setAttributes","relatedPostId","postDescription","hasDescription","postType","createElement","postOptions","setPostOptions","lang","getAdminLanguageFromCookie","optionPages","select","query","status","per_page","getEntityRecords","editUrl","window","location","origin","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring","handleHasDescriptionChange","handleRelatedPostChange","postId","Number","handlePostTypeChange","buildSelectOptions","options","push","value","label","forEach","page","id","title","rendered","panelTitle","onChange","e","href","className","initialOpen","help","checked","useBlockProps","RichText","useEntityProp","Edit","attributes","currentRelatedPost","getEntityRecord","post","postMainTaxonomy","_post$thematiques","thematiques","postParentTaxonomy","_postMainTaxonomy$par","parent","thematiqueCoverUrl","_media$source_url","thematiqueMediaId","acf","taxonomy_pictures","icon","media","getMedia","source_url","postTypeDatas","getEntityConfig","handlePostDescriptionChange","description","Fragment","class","alt","src","slug","name","tagName","placeholder","registerBlockType","metadata","xmlns","width","height","viewBox","d","foreground","edit"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACuB;AAK7B;AACR;A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;MACbC,MAAM,EAAC,OAAO;MACdC,OAAO,EAAC;IAAiB,GAEzBxF,oDAAA,YACCA,oDAAA;MACC4E,KAAK,EAAC,OAAO;MACba,CAAC,EAAC;IAA+uB,CACjvB,CACC,CACC,CACL;IACDC,UAAU,EAAE;EACb,CAAC;EAEDC,IAAI,EAAExC,6CAAIA;AACX,CAAC,CAAC;;;;;;;;;;;AC5BF;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;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,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;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,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/OptionsSelectControl.js","webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/editor.scss?d446","webpack://multiblocks/./src/style.scss?d1e4","webpack://multiblocks/external window \"React\"","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"coreData\"]","webpack://multiblocks/external window [\"wp\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"htmlEntities\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\r\nimport { InspectorControls } from \"@wordpress/block-editor\";\r\nimport {\r\n\tPanelBody,\r\n\tSelectControl,\r\n\tComboboxControl,\r\n} from \"@wordpress/components\";\r\nimport \"./editor.scss\";\r\nimport { Tip, CheckboxControl } from \"@wordpress/components\";\r\n\r\nimport { useSelect } from \"@wordpress/data\";\r\nimport { useEffect, useState } from \"@wordpress/element\";\r\nimport { decodeEntities } from \"@wordpress/html-entities\";\r\n\r\nexport default function OptionsSelectControl({\r\n\tsetAttributes,\r\n\trelatedPostId,\r\n\tpostDescription,\r\n\thasDescription,\r\n\tpostType,\r\n}) {\r\n\tif (!postType || !setAttributes) return

Loading

;\r\n\r\n\tlet [postOptions, setPostOptions] = useState(null);\r\n\r\n\tconst lang = getAdminLanguageFromCookie(\"wp-wpml_current_language\");\r\n\tconst optionPages = useSelect(\r\n\t\t(select) => {\r\n\t\t\tif (!postType) return null;\r\n\t\t\tlet query = {\r\n\t\t\t\tstatus: \"publish\",\r\n\t\t\t\tper_page: -1,\r\n\t\t\t\tlang: lang,\r\n\t\t\t};\r\n\t\t\treturn select(\"core\").getEntityRecords(\"postType\", postType, query);\r\n\t\t},\r\n\t\t[postType, lang],\r\n\t);\r\n\tconst editUrl = relatedPostId\r\n\t\t? `${window.location.origin}/wp-admin/post.php?post=${relatedPostId}&action=edit`\r\n\t\t: null;\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\r\n\tfunction handleHasDescriptionChange(hasDescription) {\r\n\t\tsetAttributes({ hasDescription });\r\n\t}\r\n\r\n\tfunction handleRelatedPostChange(postId) {\r\n\t\tsetAttributes({ relatedPostId: Number(postId) });\r\n\t}\r\n\tfunction handlePostTypeChange(postType) {\r\n\t\tsetAttributes({ postType: postType, relatedPostId: null });\r\n\t}\r\n\r\n\tfunction buildSelectOptions(optionPages) {\r\n\t\tlet options = [];\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\toptions.push({ value: 0, label: \"Selectionnez une page\" });\r\n\t\t\toptionPages.forEach((page) => {\r\n\t\t\t\toptions.push({\r\n\t\t\t\t\tvalue: page.id,\r\n\t\t\t\t\tlabel: decodeEntities(page.title.rendered),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\toptions.push({ value: 0, label: \"Pas encore de questions...\" });\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!optionPages || !postType) return;\r\n\t\tif (optionPages && optionPages.length > 0) {\r\n\t\t\tsetPostOptions(buildSelectOptions(optionPages));\r\n\t\t}\r\n\t}, [optionPages, postType]);\r\n\r\n\tlet panelTitle = \"Post Reliée\";\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\t{postOptions && (\r\n\t\t\t\t\t handleRelatedPostChange(e)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t\t{relatedPostId && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{__(\r\n\t\t\t\t\t\t\t\"Pourrrrrr modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.\",\r\n\t\t\t\t\t\t\t\"homegrade-blocks\",\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\t{relatedPostId && editUrl && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tÉditer le post\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\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","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps } from \"@wordpress/block-editor\";\n\nimport { useSelect } from \"@wordpress/data\"; // pour les querry\nimport \"./editor.scss\";\nimport { decodeEntities } from \"@wordpress/html-entities\";\nimport OptionsSelectControl from \"./OptionsSelectControl\";\nimport { RichText } from \"@wordpress/block-editor\";\n\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { relatedPostId, postType, hasDescription, postDescription } =\n\t\tattributes;\n\n\tconst currentRelatedPost = useSelect(\n\t\t(select) =>\n\t\t\trelatedPostId && postType\n\t\t\t\t? select(\"core\").getEntityRecord(\"postType\", postType, relatedPostId)\n\t\t\t\t: null,\n\t\t[relatedPostId, postType],\n\t);\n\n\tconst post = useSelect((select) =>\n\t\tselect(\"core\").getEntityRecord(\"postType\", postType, relatedPostId),\n\t);\n\n\tconst postMainTaxonomy = useSelect(\n\t\t(select) => {\n\t\t\treturn select(\"core\").getEntityRecord(\n\t\t\t\t\"taxonomy\",\n\t\t\t\t\"thematiques\",\n\t\t\t\tpost?.thematiques ?? null,\n\t\t\t);\n\t\t},\n\t\t[post],\n\t);\n\n\tconst postParentTaxonomy = useSelect(\n\t\t(select) => {\n\t\t\tif (!postMainTaxonomy) return null;\n\t\t\tif (postMainTaxonomy && !postMainTaxonomy.parent) return postMainTaxonomy;\n\t\t\treturn select(\"core\").getEntityRecord(\n\t\t\t\t\"taxonomy\",\n\t\t\t\t\"thematiques\",\n\t\t\t\tpostMainTaxonomy?.parent ?? null,\n\t\t\t);\n\t\t},\n\t\t[postMainTaxonomy],\n\t);\n\n\tconst thematiqueCoverUrl = useSelect(\n\t\t(select) => {\n\t\t\tlet thematiqueMediaId = postParentTaxonomy?.acf?.taxonomy_pictures?.icon;\n\t\t\tconst media = select(\"core\").getMedia(thematiqueMediaId);\n\t\t\treturn media?.source_url ?? null;\n\t\t},\n\t\t[postParentTaxonomy],\n\t);\n\n\tconst postTypeDatas = useSelect((select) =>\n\t\tselect(\"core\").getEntityConfig(\"postType\", postType),\n\t);\n\tfunction handlePostDescriptionChange(description) {\n\t\tsetAttributes({ postDescription: description });\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\n\t\t\t\n\t\t\t\t\"\"\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{postParentTaxonomy && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{postParentTaxonomy.name}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{postTypeDatas && (\n\t\t\t\t\t\t\t
{postTypeDatas.label}
\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t{currentRelatedPost && currentRelatedPost.title && (\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{decodeEntities(currentRelatedPost.title.rendered)}\n\t\t\t\t\t\t

\n\t\t\t\t\t)}\n\t\t\t\t\t{hasDescription && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t{!relatedPostId && (\n\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\"Ce bloc n'est relié à aucun post. Rattachez-le à un post dans la barre latérale.\",\n\t\t\t\t\t\t\t\t\"homegrade-blocks__texte-backoffice\",\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\t\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\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\"][\"components\"];","module.exports = window[\"wp\"][\"coreData\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"htmlEntities\"];","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[\"webpackChunkmultiblocks\"] = globalThis[\"webpackChunkmultiblocks\"] || [];\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":["__","InspectorControls","PanelBody","SelectControl","ComboboxControl","Tip","CheckboxControl","useSelect","useEffect","useState","decodeEntities","OptionsSelectControl","setAttributes","relatedPostId","postDescription","hasDescription","postType","createElement","postOptions","setPostOptions","lang","getAdminLanguageFromCookie","optionPages","select","query","status","per_page","getEntityRecords","editUrl","window","location","origin","c_name","c_value","document","cookie","c_start","indexOf","c_end","length","unescape","substring","handleHasDescriptionChange","handleRelatedPostChange","postId","Number","handlePostTypeChange","buildSelectOptions","options","push","value","label","forEach","page","id","title","rendered","panelTitle","onChange","e","href","className","initialOpen","help","checked","useBlockProps","RichText","useEntityProp","Edit","attributes","currentRelatedPost","getEntityRecord","post","postMainTaxonomy","_post$thematiques","thematiques","postParentTaxonomy","_postMainTaxonomy$par","parent","thematiqueCoverUrl","_media$source_url","thematiqueMediaId","acf","taxonomy_pictures","icon","media","getMedia","source_url","postTypeDatas","getEntityConfig","handlePostDescriptionChange","description","Fragment","class","alt","src","slug","name","tagName","placeholder","registerBlockType","metadata","xmlns","width","height","viewBox","d","foreground","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/post-card/build/render.php b/blocks/post-card/build/render.php index cd7dd4f..33be0a0 100644 --- a/blocks/post-card/build/render.php +++ b/blocks/post-card/build/render.php @@ -16,8 +16,10 @@ $postDescription = $attributes['postDescription']; $coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null); +$thematiqueColorSlug = getThematiqueFamilySlug($mainThematique->slug); + ?> - + diff --git a/blocks/post-card/src/render.php b/blocks/post-card/src/render.php index cd7dd4f..33be0a0 100644 --- a/blocks/post-card/src/render.php +++ b/blocks/post-card/src/render.php @@ -16,8 +16,10 @@ $postDescription = $attributes['postDescription']; $coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null); +$thematiqueColorSlug = getThematiqueFamilySlug($mainThematique->slug); + ?> - +