From 9729258a45250ca2f09c8a243809f488d1446779 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 15 Jan 2026 14:01:56 +0100 Subject: [PATCH] FIX handlign a dynamic render.php to avoid wp kses problem when injecting svg background --- .../carhop-blocks/build/blocks-manifest.php | 1 + .../build/narrative-card/block.json | 1 + .../build/narrative-card/index.asset.php | 2 +- .../build/narrative-card/index.js | 37 +---------- .../build/narrative-card/index.js.map | 2 +- .../build/narrative-card/render.php | 50 +++++++++++++++ .../carhop-blocks/build/variations.asset.php | 2 +- plugins/carhop-blocks/build/variations.js | 2 +- plugins/carhop-blocks/build/variations.js.map | 2 +- .../core-variants/core-list-variant/editor.js | 2 +- .../src/narrative-card/block.json | 1 + .../src/narrative-card/render.php | 50 +++++++++++++++ .../carhop-blocks/src/narrative-card/save.js | 64 +------------------ 13 files changed, 112 insertions(+), 104 deletions(-) create mode 100644 plugins/carhop-blocks/build/narrative-card/render.php create mode 100644 plugins/carhop-blocks/src/narrative-card/render.php diff --git a/plugins/carhop-blocks/build/blocks-manifest.php b/plugins/carhop-blocks/build/blocks-manifest.php index 653da7b..b04669a 100644 --- a/plugins/carhop-blocks/build/blocks-manifest.php +++ b/plugins/carhop-blocks/build/blocks-manifest.php @@ -782,6 +782,7 @@ return array( 'editorStyle' => 'file:./index.css', 'style' => 'file:./style-index.css', 'viewScript' => 'file:./view.js', + 'render' => 'file:./render.php', 'attributes' => array( 'hasCover' => array( 'type' => 'boolean', diff --git a/plugins/carhop-blocks/build/narrative-card/block.json b/plugins/carhop-blocks/build/narrative-card/block.json index 61f238a..841671f 100644 --- a/plugins/carhop-blocks/build/narrative-card/block.json +++ b/plugins/carhop-blocks/build/narrative-card/block.json @@ -16,6 +16,7 @@ "editorStyle": "file:./index.css", "style": "file:./style-index.css", "viewScript": "file:./view.js", + "render": "file:./render.php", "attributes": { "hasCover": { "type": "boolean", diff --git a/plugins/carhop-blocks/build/narrative-card/index.asset.php b/plugins/carhop-blocks/build/narrative-card/index.asset.php index 3d468ef..d78130c 100644 --- a/plugins/carhop-blocks/build/narrative-card/index.asset.php +++ b/plugins/carhop-blocks/build/narrative-card/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => 'a24dbfb47009d67e742b'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '6ebaef11b3d9c28c17cc'); diff --git a/plugins/carhop-blocks/build/narrative-card/index.js b/plugins/carhop-blocks/build/narrative-card/index.js index 803afed..e47af7b 100644 --- a/plugins/carhop-blocks/build/narrative-card/index.js +++ b/plugins/carhop-blocks/build/narrative-card/index.js @@ -79,7 +79,7 @@ function Cover({ \***************************************/ /***/ ((module) => { -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/narrative-card","version":"0.1.0","title":"Carte narrative","category":"carhop-blocks","icon":"smiley","description":"Une carte narrative","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasCover":{"type":"boolean","default":true},"aspectRatio":{"type":"string","default":"auto","enum":["auto","1/1","4/3","3/4","3/2","2/3","16/9","21/9","9/16","9/21"]},"coverPosition":{"type":"string","default":"right","enum":["left","right"]},"coverId":{"type":"number"},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"blackWhiteCoverFilter":{"type":"boolean","default":true}}}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/narrative-card","version":"0.1.0","title":"Carte narrative","category":"carhop-blocks","icon":"smiley","description":"Une carte narrative","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"hasCover":{"type":"boolean","default":true},"aspectRatio":{"type":"string","default":"auto","enum":["auto","1/1","4/3","3/4","3/2","2/3","16/9","21/9","9/16","9/21"]},"coverPosition":{"type":"string","default":"right","enum":["left","right"]},"coverId":{"type":"number"},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"blackWhiteCoverFilter":{"type":"boolean","default":true}}}'); /***/ }), @@ -369,40 +369,7 @@ function save({ blackWhiteCoverFilter, aspectRatio } = attributes; - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", { - ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({ - className: `narrative-card ${hasCover ? `narrative-card--has-cover narrative-card--has-cover--${coverPosition} ${blackWhiteCoverFilter ? "narrative-card--black-white-cover-filter" : ""}` : ""}` - }), - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", { - viewBox: "0 0 1216 407", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - preserveAspectRatio: "none", - className: "narrative-card__background", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", { - d: "M1 11V406H1205L1215 1L1 11Z", - fill: "white", - stroke: "#136F63", - strokeWidth: "2", - vectorEffect: "non-scaling-stroke" - }) - }), hasCover && coverPosition === "left" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { - className: `narrative-card__cover${aspectRatio && aspectRatio !== "auto" ? ` narrative-card__cover--ratio-${String(aspectRatio).replace(/[/:]/g, "-")}` : ""}`, - children: hasCover && coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("img", { - src: coverUrl, - alt: coverAlt - }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { - className: "narrative-card__content", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {}) - }), hasCover && coverPosition === "right" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { - className: `narrative-card__cover${aspectRatio && aspectRatio !== "auto" ? ` narrative-card__cover--ratio-${String(aspectRatio).replace(/[/:]/g, "-")}` : ""}`, - children: hasCover && coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("img", { - src: coverUrl, - alt: coverAlt - }) - })] - }); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {}); } /***/ }), diff --git a/plugins/carhop-blocks/build/narrative-card/index.js.map b/plugins/carhop-blocks/build/narrative-card/index.js.map index 1c681cf..1046c7c 100644 --- a/plugins/carhop-blocks/build/narrative-card/index.js.map +++ b/plugins/carhop-blocks/build/narrative-card/index.js.map @@ -1 +1 @@ -{"version":3,"file":"narrative-card/index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACkD;AACV;AACxC,oCAAoC,sDAAG,CAAC,sDAAG,IAAI,qFAAqF,sDAAG;AACvI,EAAE,uDAAI;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AAGD;AACF;;;;;;;;;;;;;;;;;;;ACd2D;AAAA;AAE5C,SAASK,KAAKA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAE;EAC5E,MAAMC,UAAU,GACfD,WAAW,IAAIA,WAAW,KAAK,MAAM,GAClC,iCAAiCE,MAAM,CAACF,WAAW,CAAC,CAACG,OAAO,CAC5D,OAAO,EACP,GACA,CAAC,EAAE,GACH,EAAE;EACN,oBACCR,uDAAA;IAAKS,SAAS,EAAE,wBAAwBH,UAAU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Q,IAAI1C,QAAQ,iBAAIJ,sDAAA;QAAKa,GAAG,EAAET,QAAS;QAACU,GAAG,EAAET;MAAS,CAAE;IAAC,CAC1D,CACL;EAAA,CACG,CAAC;AAER,C;;;;;;;;;;;AC5EA;;;;;;;;;;;ACAA,6C;;;;;;;;;;ACAA,wC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,2C;;;;;;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,E;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;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,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://carhop-blocks/./node_modules/.pnpm/@wordpress+icons@11.2.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/trash.js","webpack://carhop-blocks/./src/narrative-card/Cover.jsx","webpack://carhop-blocks/./src/narrative-card/edit.js","webpack://carhop-blocks/./src/narrative-card/editor.scss?240b","webpack://carhop-blocks/./src/narrative-card/index.js","webpack://carhop-blocks/./src/narrative-card/save.js","webpack://carhop-blocks/./src/narrative-card/style.scss?7d5f","webpack://carhop-blocks/external window [\"wp\",\"blockEditor\"]","webpack://carhop-blocks/external window [\"wp\",\"blocks\"]","webpack://carhop-blocks/external window [\"wp\",\"components\"]","webpack://carhop-blocks/external window [\"wp\",\"i18n\"]","webpack://carhop-blocks/external window [\"wp\",\"primitives\"]","webpack://carhop-blocks/external window \"ReactJSXRuntime\"","webpack://carhop-blocks/webpack/bootstrap","webpack://carhop-blocks/webpack/runtime/chunk loaded","webpack://carhop-blocks/webpack/runtime/compat get default export","webpack://carhop-blocks/webpack/runtime/define property getters","webpack://carhop-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://carhop-blocks/webpack/runtime/make namespace object","webpack://carhop-blocks/webpack/runtime/jsonp chunk loading","webpack://carhop-blocks/webpack/before-startup","webpack://carhop-blocks/webpack/startup","webpack://carhop-blocks/webpack/after-startup"],"sourcesContent":["// packages/icons/src/library/trash.tsx\nimport { Path, SVG } from \"@wordpress/primitives\";\nimport { jsx } from \"react/jsx-runtime\";\nvar trash_default = /* @__PURE__ */ jsx(SVG, { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", children: /* @__PURE__ */ jsx(\n Path,\n {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z\"\n }\n) });\nexport {\n trash_default as default\n};\n//# sourceMappingURL=trash.js.map\n","import { MediaPlaceholder } from \"@wordpress/block-editor\";\r\n\r\nexport default function Cover({ coverUrl, coverAlt, onSelect, aspectRatio }) {\r\n\tconst ratioClass =\r\n\t\taspectRatio && aspectRatio !== \"auto\"\r\n\t\t\t? ` narrative-card__cover--ratio-${String(aspectRatio).replace(\r\n\t\t\t\t\t/[/:]/g,\r\n\t\t\t\t\t\"-\"\r\n\t\t\t )}`\r\n\t\t\t: \"\";\r\n\treturn (\r\n\t\t
\r\n\t\t\t{coverUrl && {coverAlt}}\r\n\t\t\t{!coverUrl && (\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 {\n\tuseBlockProps,\n\tRichText,\n\tMediaReplaceFlow,\n\tInspectorControls,\n\t__experimentalLinkControl as LinkControl,\n\tuseSetting,\n\tInnerBlocks,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n\tCheckboxControl,\n\tSelectControl,\n} from \"@wordpress/components\";\nimport \"./editor.scss\";\nimport { lock, trash } from \"@wordpress/icons\";\nimport CoverImage from \"./Cover\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst {\n\t\tcoverId,\n\t\tcoverUrl,\n\t\tcoverAlt,\n\t\tcoverPosition,\n\t\thasCover,\n\t\tblackWhiteCoverFilter,\n\t\taspectRatio,\n\t} = attributes;\n\tconst colors = useSetting(\"color.palette.theme\");\n\n\tfunction setCoverAttributes(cover) {\n\t\tsetAttributes({\n\t\t\tcoverId: cover.id,\n\t\t\tcoverAlt: cover.alt,\n\t\t\tcoverUrl: cover.url,\n\t\t});\n\t}\n\tfunction removeCoverAttributes() {\n\t\tsetAttributes({\n\t\t\tcoverId: null,\n\t\t\tcoverAlt: null,\n\t\t\tcoverUrl: null,\n\t\t});\n\t}\n\n\t// Déterminer l'ordre des éléments basé sur la position\n\tconst shouldShowCoverLeft = hasCover && coverPosition === \"left\";\n\tconst shouldShowCoverRight = hasCover && coverPosition === \"right\";\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes({ hasCover: value })}\n\t\t\t\t\t/>\n\t\t\t\t\t{coverUrl && {coverAlt}}\n\n\t\t\t\t\t{hasCover && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{coverUrl && (\n\t\t\t\t\t\t\t\t<>\n\t\t\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\n\t\t\t\t\t\t\t setAttributes({ coverPosition: value })}\n\t\t\t\t\t\t\t\tvalue={coverPosition}\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\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t setAttributes({ aspectRatio: value })}\n\t\t\t\t\t\t\t\thelp={__(\n\t\t\t\t\t\t\t\t\t\"Sélectionnez la proportion d'affichage de la carte.\",\n\t\t\t\t\t\t\t\t\t\"carhop-blocks\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tsetAttributes({ blackWhiteCoverFilter: value === \"true\" });\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={blackWhiteCoverFilter ? \"true\" : \"false\"}\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\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\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t{shouldShowCoverLeft && (\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t{shouldShowCoverRight && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\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\n\t\t),\n\t\tforeground: \"#136f63\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { InnerBlocks } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst {\n\t\thasCover,\n\t\tcoverUrl,\n\t\tcoverAlt,\n\t\tcoverPosition,\n\t\tblackWhiteCoverFilter,\n\t\taspectRatio,\n\t} = attributes;\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t{hasCover && coverPosition === \"left\" && (\n\t\t\t\t\n\t\t\t\t\t{hasCover && coverUrl && {coverAlt}}\n\t\t\t\t\n\t\t\t)}\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t{hasCover && coverPosition === \"right\" && (\n\t\t\t\t\n\t\t\t\t\t{hasCover && coverUrl && {coverAlt}}\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"ReactJSXRuntime\"];","// 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\"narrative-card/index\": 0,\n\t\"narrative-card/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[\"webpackChunkcarhop_blocks\"] = globalThis[\"webpackChunkcarhop_blocks\"] || [];\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, [\"narrative-card/style-index\"], () => (__webpack_require__(\"./src/narrative-card/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["MediaPlaceholder","jsx","_jsx","jsxs","_jsxs","Cover","coverUrl","coverAlt","onSelect","aspectRatio","ratioClass","String","replace","className","children","src","alt","accept","allowedTypes","multiple","handleUpload","__","useBlockProps","RichText","MediaReplaceFlow","InspectorControls","__experimentalLinkControl","LinkControl","useSetting","InnerBlocks","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","CheckboxControl","SelectControl","lock","trash","CoverImage","Fragment","_Fragment","Edit","attributes","setAttributes","coverId","coverPosition","hasCover","blackWhiteCoverFilter","colors","setCoverAttributes","cover","id","url","removeCoverAttributes","shouldShowCoverLeft","shouldShowCoverRight","title","label","checked","onChange","value","mediaId","mediaUrl","name","variant","icon","onClick","isBlock","options","help","viewBox","fill","xmlns","preserveAspectRatio","d","stroke","strokeWidth","vectorEffect","allowedBlocks","template","content","registerBlockType","save","metadata","foreground","edit","Content"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"narrative-card/index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACkD;AACV;AACxC,oCAAoC,sDAAG,CAAC,sDAAG,IAAI,qFAAqF,sDAAG;AACvI,EAAE,uDAAI;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AAGD;AACF;;;;;;;;;;;;;;;;;;;ACd2D;AAAA;AAE5C,SAASK,KAAKA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EA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ClBsD;AACF;AAAA;AAEvC,SAASA,IAAIA,CAAC;EAAExC;AAAW,CAAC,EAAE;EAC5C,MAAM;IACLI,QAAQ;IACR1C,QAAQ;IACRC,QAAQ;IACRwC,aAAa;IACbE,qBAAqB;IACrBxC;EACD,CAAC,GAAGmC,UAAU;EAEd,oBAAO1C,sDAAA,CAAC2B,gEAAW,CAAC2D,OAAO,IAAE,CAAC;AAC/B,C;;;;;;;;;;;ACdA;;;;;;;;;;;ACAA,6C;;;;;;;;;;ACAA,wC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,2C;;;;;;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,E;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;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,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://carhop-blocks/./node_modules/.pnpm/@wordpress+icons@11.2.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/trash.js","webpack://carhop-blocks/./src/narrative-card/Cover.jsx","webpack://carhop-blocks/./src/narrative-card/edit.js","webpack://carhop-blocks/./src/narrative-card/editor.scss","webpack://carhop-blocks/./src/narrative-card/index.js","webpack://carhop-blocks/./src/narrative-card/save.js","webpack://carhop-blocks/./src/narrative-card/style.scss","webpack://carhop-blocks/external window [\"wp\",\"blockEditor\"]","webpack://carhop-blocks/external window [\"wp\",\"blocks\"]","webpack://carhop-blocks/external window [\"wp\",\"components\"]","webpack://carhop-blocks/external window [\"wp\",\"i18n\"]","webpack://carhop-blocks/external window [\"wp\",\"primitives\"]","webpack://carhop-blocks/external window \"ReactJSXRuntime\"","webpack://carhop-blocks/webpack/bootstrap","webpack://carhop-blocks/webpack/runtime/chunk loaded","webpack://carhop-blocks/webpack/runtime/compat get default export","webpack://carhop-blocks/webpack/runtime/define property getters","webpack://carhop-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://carhop-blocks/webpack/runtime/make namespace object","webpack://carhop-blocks/webpack/runtime/jsonp chunk loading","webpack://carhop-blocks/webpack/before-startup","webpack://carhop-blocks/webpack/startup","webpack://carhop-blocks/webpack/after-startup"],"sourcesContent":["// packages/icons/src/library/trash.tsx\nimport { Path, SVG } from \"@wordpress/primitives\";\nimport { jsx } from \"react/jsx-runtime\";\nvar trash_default = /* @__PURE__ */ jsx(SVG, { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", children: /* @__PURE__ */ jsx(\n Path,\n {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z\"\n }\n) });\nexport {\n trash_default as default\n};\n//# sourceMappingURL=trash.js.map\n","import { MediaPlaceholder } from \"@wordpress/block-editor\";\r\n\r\nexport default function Cover({ coverUrl, coverAlt, onSelect, aspectRatio }) {\r\n\tconst ratioClass =\r\n\t\taspectRatio && aspectRatio !== \"auto\"\r\n\t\t\t? ` narrative-card__cover--ratio-${String(aspectRatio).replace(\r\n\t\t\t\t\t/[/:]/g,\r\n\t\t\t\t\t\"-\"\r\n\t\t\t )}`\r\n\t\t\t: \"\";\r\n\treturn (\r\n\t\t
\r\n\t\t\t{coverUrl && {coverAlt}}\r\n\t\t\t{!coverUrl && (\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 {\n\tuseBlockProps,\n\tRichText,\n\tMediaReplaceFlow,\n\tInspectorControls,\n\t__experimentalLinkControl as LinkControl,\n\tuseSetting,\n\tInnerBlocks,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n\tCheckboxControl,\n\tSelectControl,\n} from \"@wordpress/components\";\nimport \"./editor.scss\";\nimport { lock, trash } from \"@wordpress/icons\";\nimport CoverImage from \"./Cover\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst {\n\t\tcoverId,\n\t\tcoverUrl,\n\t\tcoverAlt,\n\t\tcoverPosition,\n\t\thasCover,\n\t\tblackWhiteCoverFilter,\n\t\taspectRatio,\n\t} = attributes;\n\tconst colors = useSetting(\"color.palette.theme\");\n\n\tfunction setCoverAttributes(cover) {\n\t\tsetAttributes({\n\t\t\tcoverId: cover.id,\n\t\t\tcoverAlt: cover.alt,\n\t\t\tcoverUrl: cover.url,\n\t\t});\n\t}\n\tfunction removeCoverAttributes() {\n\t\tsetAttributes({\n\t\t\tcoverId: null,\n\t\t\tcoverAlt: null,\n\t\t\tcoverUrl: null,\n\t\t});\n\t}\n\n\t// Déterminer l'ordre des éléments basé sur la position\n\tconst shouldShowCoverLeft = hasCover && coverPosition === \"left\";\n\tconst shouldShowCoverRight = hasCover && coverPosition === \"right\";\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes({ hasCover: value })}\n\t\t\t\t\t/>\n\t\t\t\t\t{coverUrl && {coverAlt}}\n\n\t\t\t\t\t{hasCover && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{coverUrl && (\n\t\t\t\t\t\t\t\t<>\n\t\t\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\n\t\t\t\t\t\t\t setAttributes({ coverPosition: value })}\n\t\t\t\t\t\t\t\tvalue={coverPosition}\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\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t setAttributes({ aspectRatio: value })}\n\t\t\t\t\t\t\t\thelp={__(\n\t\t\t\t\t\t\t\t\t\"Sélectionnez la proportion d'affichage de la carte.\",\n\t\t\t\t\t\t\t\t\t\"carhop-blocks\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tsetAttributes({ blackWhiteCoverFilter: value === \"true\" });\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={blackWhiteCoverFilter ? \"true\" : \"false\"}\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\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\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t{shouldShowCoverLeft && (\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t{shouldShowCoverRight && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\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\n\t\t),\n\t\tforeground: \"#136f63\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { InnerBlocks } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst {\n\t\thasCover,\n\t\tcoverUrl,\n\t\tcoverAlt,\n\t\tcoverPosition,\n\t\tblackWhiteCoverFilter,\n\t\taspectRatio,\n\t} = attributes;\n\n\treturn ;\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"ReactJSXRuntime\"];","// 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\"narrative-card/index\": 0,\n\t\"narrative-card/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[\"webpackChunkcarhop_blocks\"] = globalThis[\"webpackChunkcarhop_blocks\"] || [];\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, [\"narrative-card/style-index\"], () => (__webpack_require__(\"./src/narrative-card/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["MediaPlaceholder","jsx","_jsx","jsxs","_jsxs","Cover","coverUrl","coverAlt","onSelect","aspectRatio","ratioClass","String","replace","className","children","src","alt","accept","allowedTypes","multiple","handleUpload","__","useBlockProps","RichText","MediaReplaceFlow","InspectorControls","__experimentalLinkControl","LinkControl","useSetting","InnerBlocks","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","CheckboxControl","SelectControl","lock","trash","CoverImage","Fragment","_Fragment","Edit","attributes","setAttributes","coverId","coverPosition","hasCover","blackWhiteCoverFilter","colors","setCoverAttributes","cover","id","url","removeCoverAttributes","shouldShowCoverLeft","shouldShowCoverRight","title","label","checked","onChange","value","mediaId","mediaUrl","name","variant","icon","onClick","isBlock","options","help","viewBox","fill","xmlns","preserveAspectRatio","d","stroke","strokeWidth","vectorEffect","allowedBlocks","template","content","registerBlockType","save","metadata","foreground","edit","Content"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/build/narrative-card/render.php b/plugins/carhop-blocks/build/narrative-card/render.php new file mode 100644 index 0000000..b78120a --- /dev/null +++ b/plugins/carhop-blocks/build/narrative-card/render.php @@ -0,0 +1,50 @@ +inner_blocks) ? $block->inner_blocks : []; +$hasCover = $attributes['hasCover']; +$coverPosition = $attributes['coverPosition']; +$blackWhiteCoverFilter = $attributes['blackWhiteCoverFilter']; +$aspectRatio = $attributes['aspectRatio']; +$coverUrl = $attributes['coverUrl']; +$coverAlt = $attributes['coverAlt']; +?> + + +
'narrative-card ' . ($hasCover ? 'narrative-card--has-cover narrative-card--has-cover--' . $coverPosition . ' ' . ($blackWhiteCoverFilter ? 'narrative-card--black-white-cover-filter' : '') : ''))); ?>> + + + + + + +
"> + + <?php echo $coverAlt; ?> + +
+ + +
+ render(); + } ?> +
+ +
"> + + <?php echo $coverAlt; ?> + +
+ + +
\ No newline at end of file diff --git a/plugins/carhop-blocks/build/variations.asset.php b/plugins/carhop-blocks/build/variations.asset.php index a2f5784..18c4158 100644 --- a/plugins/carhop-blocks/build/variations.asset.php +++ b/plugins/carhop-blocks/build/variations.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '4084d7e87e3b70c01e93'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'cb68829c713b83a15dea'); diff --git a/plugins/carhop-blocks/build/variations.js b/plugins/carhop-blocks/build/variations.js index fc7d5b7..2cce989 100644 --- a/plugins/carhop-blocks/build/variations.js +++ b/plugins/carhop-blocks/build/variations.js @@ -190,7 +190,7 @@ __webpack_require__.r(__webpack_exports__); // 3. On ajoute des props au HTML sauvegardé pour chaque
  • // ----------------------------- (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_5__.addFilter)("blocks.getSaveContent.extraProps", "carhop/iconed-list-item-save-props", (extraProps, blockType, attributes) => { - if (blockType.name !== "core/list-item") { + if (blockType.name !== "core/list-item" || !attributes.icon) { return extraProps; } if (attributes.icon) { diff --git a/plugins/carhop-blocks/build/variations.js.map b/plugins/carhop-blocks/build/variations.js.map index 1cfb7ad..6f61bcb 100644 --- a/plugins/carhop-blocks/build/variations.js.map +++ b/plugins/carhop-blocks/build/variations.js.map @@ -1 +1 @@ -{"version":3,"file":"variations.js","mappings":";;;;;;;;;AAAAA,EAAE,CAACC,MAAM,CAACC,kBAAkB,CAAC,YAAY,EAAE;EAC1CC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE;AACR,CAAC,CAAC,C;;;;;;;;;;ACHFJ,EAAE,CAACC,MAAM,CAACC,kBAAkB,CAAC,cAAc,EAAE;E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AAKZ;MAAK,CAAG,CAAC;IACrC;IACA,MAAMa,IAAI,GAAGb,KAAK,CAACb,UAAU,EAAES,IAAI,IAAI,EAAE;IACzC,MAAMR,SAAS,GAAG,CACjBY,KAAK,CAACZ,SAAS,IAAI,EAAE,EACrByB,IAAI,GAAG,iBAAiB,GAAG,EAAE,EAC7BA,IAAI,GAAG,oBAAoBA,IAAI,EAAE,GAAG,EAAE,CACtC,CACCC,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC;IAEX,oBAAOlC,sDAAA,CAAC8B,cAAc;MAAA,GAAKZ,KAAK;MAAEZ,SAAS,EAAEA;IAAU,CAAE,CAAC;EAC3D,CAAC;AACF,CAAC,EAAE,iCAAiC,CACrC,CAAC,C;;;;;;;;;;;;ACvKD;;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,4C;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,uC;;;;;;;;;;;ACAA,sC;;;;;;;;;;;ACAA,2C;;;;;;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,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;;;;;;;;;;;;;ACN0C;AACF;AACA;AACD","sources":["webpack://carhop-blocks/./src/core-variants/core-embed-variant/editor.js","webpack://carhop-blocks/./src/core-variants/core-heading-variant/editor.js","webpack://carhop-blocks/./src/core-variants/core-image-variant/editor.js","webpack://carhop-blocks/./src/core-variants/core-list-variant/editor.js","webpack://carhop-blocks/./src/core-variants/variants.scss","webpack://carhop-blocks/external window [\"wp\",\"blockEditor\"]","webpack://carhop-blocks/external window [\"wp\",\"blocks\"]","webpack://carhop-blocks/external window [\"wp\",\"components\"]","webpack://carhop-blocks/external window [\"wp\",\"compose\"]","webpack://carhop-blocks/external window [\"wp\",\"element\"]","webpack://carhop-blocks/external window [\"wp\",\"hooks\"]","webpack://carhop-blocks/external window [\"wp\",\"i18n\"]","webpack://carhop-blocks/external window \"ReactJSXRuntime\"","webpack://carhop-blocks/webpack/bootstrap","webpack://carhop-blocks/webpack/runtime/compat get default export","webpack://carhop-blocks/webpack/runtime/define property getters","webpack://carhop-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://carhop-blocks/webpack/runtime/make namespace object","webpack://carhop-blocks/./src/core-variants/variants.js"],"sourcesContent":["wp.blocks.registerBlockStyle(\"core/embed\", {\r\n\tname: \"stacked-background\",\r\n\tlabel: \"Fond empilé\",\r\n});\r\n","wp.blocks.registerBlockStyle(\"core/heading\", {\r\n\tname: \"stroked-after\",\r\n\tlabel: \"Titre + trait \",\r\n});\r\n","wp.blocks.registerBlockStyle(\"core/image\", {\r\n\tname: \"framed\",\r\n\tlabel: \"Encadré\",\r\n\tisDefault: true,\r\n});\r\nwp.blocks.registerBlockStyle(\"core/image\", {\r\n\tname: \"stacked\",\r\n\tlabel: \"Empilé\",\r\n\tisDefault: false,\r\n});\r\n","import { registerBlockVariation } from \"@wordpress/blocks\";\r\nimport { __ } from \"@wordpress/i18n\";\r\nimport {\r\n\tInspectorControls,\r\n\tBlockControls,\r\n\tAlignmentToolbar,\r\n} from \"@wordpress/block-editor\";\r\nimport { ToolbarGroup, ToolbarDropdownMenu } from \"@wordpress/components\";\r\nimport { Fragment } from \"@wordpress/element\";\r\nimport { addFilter } from \"@wordpress/hooks\";\r\nimport { createHigherOrderComponent } from \"@wordpress/compose\";\r\n\r\nimport { check, arrowRight, starFilled } from \"@wordpress/icons\";\r\n\r\n// Variation du bloc \"Liste\" pour ajouter une classe spéciale\r\nregisterBlockVariation(\"core/list\", {\r\n\tname: \"iconed-list\",\r\n\ttitle: \"Liste avec icônes\",\r\n\tdescription: \"Liste dont chaque élément peut avoir une icône personnalisée.\",\r\n\tattributes: {\r\n\t\tclassName: \"is-iconed-list\",\r\n\t},\r\n\tscope: [\"inserter\", \"transform\"],\r\n\tisActive: (blockAttributes) => {\r\n\t\tconst cls = (blockAttributes && blockAttributes.className) || \"\";\r\n\t\treturn cls.split(\" \").includes(\"is-iconed-list\");\r\n\t},\r\n});\r\n\r\n// -----------------------------\r\n// 1. On étend les attributs de core/list-item\r\n// -----------------------------\r\n\r\naddFilter(\r\n\t\"blocks.registerBlockType\",\r\n\t\"am/iconed-list-item-attributes\",\r\n\t(settings, name) => {\r\n\t\tif (name !== \"core/list-item\") {\r\n\t\t\treturn settings;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\t...settings,\r\n\t\t\tattributes: {\r\n\t\t\t\t...settings.attributes,\r\n\t\t\t\ticon: {\r\n\t\t\t\t\ttype: \"string\",\r\n\t\t\t\t\tdefault: \"\",\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t};\r\n\t}\r\n);\r\n\r\n// -----------------------------\r\n// 2. On ajoute un panneau de réglages pour choisir l'icône\r\n// -----------------------------\r\n\r\naddFilter(\r\n\t\"editor.BlockEdit\",\r\n\t\"am/iconed-list-item-controls\",\r\n\t(BlockEdit) => (props) => {\r\n\t\tif (props.name !== \"core/list-item\") {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tconst { attributes, setAttributes } = props;\r\n\t\tconst { icon } = attributes;\r\n\r\n\t\tconst ICONS = [\r\n\t\t\t{\r\n\t\t\t\ttitle: __(\"Loupe\"),\r\n\t\t\t\tvalue: \"loupe\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\ttitle: __(\"Sablier\"),\r\n\t\t\t\tvalue: \"sablier\",\r\n\t\t\t},\r\n\t\t\t{ title: __(\"Cadenas\"), value: \"cadenas\" },\r\n\t\t\t{ title: __(\"Check\"), value: \"check\" },\r\n\t\t\t{ title: __(\"Loupe Alt\"), value: \"loupe-alt\" },\r\n\t\t\t{ title: __(\"Pendule\"), value: \"pendule\" },\r\n\t\t];\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcontrols={ICONS.map(({ title, value }) => ({\r\n\t\t\t\t\t\t\t\ttitle,\r\n\t\t\t\t\t\t\t\ticon: (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t),\r\n\r\n\t\t\t\t\t\t\t\tisActive: icon === value,\r\n\t\t\t\t\t\t\t\tonClick: () => setAttributes({ icon: 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\r\n\t\t\t\t\t setAttributes({ align: value })}\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\n// -----------------------------\r\n// 3. On ajoute des props au HTML sauvegardé pour chaque
  • \r\n// -----------------------------\r\naddFilter(\r\n\t\"blocks.getSaveContent.extraProps\",\r\n\t\"carhop/iconed-list-item-save-props\",\r\n\t(extraProps, blockType, attributes) => {\r\n\t\tif (blockType.name !== \"core/list-item\") {\r\n\t\t\treturn extraProps;\r\n\t\t}\r\n\r\n\t\tif (attributes.icon) {\r\n\t\t\textraProps = {\r\n\t\t\t\t...extraProps,\r\n\t\t\t\tclassName:\r\n\t\t\t\t\t(extraProps.className || \"\") +\r\n\t\t\t\t\t\" has-custom-icon has-custom-icon--\" +\r\n\t\t\t\t\tattributes.icon,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn extraProps;\r\n\t}\r\n);\r\n\r\n// -----------------------------\r\n// 4. Applique les mêmes classes en mode éditeur (BlockListBlock)\r\n// -----------------------------\r\naddFilter(\r\n\t\"editor.BlockListBlock\",\r\n\t\"carhop/iconed-list-item-editor-classes\",\r\n\tcreateHigherOrderComponent((BlockListBlock) => {\r\n\t\treturn (props) => {\r\n\t\t\tif (props.name !== \"core/list-item\") {\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\tconst slug = props.attributes?.icon || \"\";\r\n\t\t\tconst className = [\r\n\t\t\t\tprops.className || \"\",\r\n\t\t\t\tslug ? \"has-custom-icon\" : \"\",\r\n\t\t\t\tslug ? `has-custom-icon--${slug}` : \"\",\r\n\t\t\t]\r\n\t\t\t\t.filter(Boolean)\r\n\t\t\t\t.join(\" \");\r\n\r\n\t\t\treturn ;\r\n\t\t};\r\n\t}, \"withIconedListItemEditorClasses\")\r\n);\r\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"compose\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"hooks\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// 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 \"./core-heading-variant/editor.js\";\r\nimport \"./core-image-variant/editor.js\";\r\nimport \"./core-embed-variant/editor.js\";\r\nimport \"./core-list-variant/editor.js\";\r\n\r\nimport \"./variants.scss\";\r\n"],"names":["wp","blocks","registerBlockStyle","name","label","isDefault","registerBlockVariation","__","InspectorControls","BlockControls","AlignmentToolbar","ToolbarGroup","ToolbarDropdownMenu","Fragment","addFilter","createHigherOrderComponent","check","arrowRight","starFilled","jsx","_jsx","jsxs","_jsxs","title","description","attributes","className","scope","isActive","blockAttributes","cls","split","includes","settings","icon","type","default","BlockEdit","props","setAttributes","ICONS","value","children","controls","map","onClick","align","onChange","extraProps","blockType","BlockListBlock","slug","filter","Boolean","join"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"variations.js","mappings":";;;;;;;;;AAAAA,EAAE,CAACC,MAAM,CAACC,kBAAkB,CAAC,YAAY,EAAE;EAC1CC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE;AACR,CAAC,CAAC,C;;;;;;;;;;ACHFJ,EAAE,CAACC,MAAM,CAACC,kBAAkB,CAAC,cAAc,EAAE;EAC5CC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE;AACR,CAAC,CAAC,C;;;;;;;;;;ACHFJ,EAAE,CAACC,MAAM,CAACC,kBAAkB,CAAC,YAAY,EAAE;EAC1CC,IAAI,EAAE,QAAQ;EACdC,KA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AACZ,SAAS,IAAI,EAAE,EACrByB,IAAI,GAAG,iBAAiB,GAAG,EAAE,EAC7BA,IAAI,GAAG,oBAAoBA,IAAI,EAAE,GAAG,EAAE,CACtC,CACCC,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC;IAEX,oBAAOlC,sDAAA,CAAC8B,cAAc;MAAA,GAAKZ,KAAK;MAAEZ,SAAS,EAAEA;IAAU,CAAE,CAAC;EAC3D,CAAC;AACF,CAAC,EAAE,iCAAiC,CACrC,CAAC,C;;;;;;;;;;;;ACvKD;;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,4C;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,uC;;;;;;;;;;;ACAA,sC;;;;;;;;;;;ACAA,2C;;;;;;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,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;;;;;;;;;;;;;;;;ACN0C;AACF;AACA;AACD","sources":["webpack://carhop-blocks/./src/core-variants/core-embed-variant/editor.js","webpack://carhop-blocks/./src/core-variants/core-heading-variant/editor.js","webpack://carhop-blocks/./src/core-variants/core-image-variant/editor.js","webpack://carhop-blocks/./src/core-variants/core-list-variant/editor.js","webpack://carhop-blocks/./src/core-variants/variants.scss?f090","webpack://carhop-blocks/external window [\"wp\",\"blockEditor\"]","webpack://carhop-blocks/external window [\"wp\",\"blocks\"]","webpack://carhop-blocks/external window [\"wp\",\"components\"]","webpack://carhop-blocks/external window [\"wp\",\"compose\"]","webpack://carhop-blocks/external window [\"wp\",\"element\"]","webpack://carhop-blocks/external window [\"wp\",\"hooks\"]","webpack://carhop-blocks/external window [\"wp\",\"i18n\"]","webpack://carhop-blocks/external window \"ReactJSXRuntime\"","webpack://carhop-blocks/webpack/bootstrap","webpack://carhop-blocks/webpack/runtime/compat get default export","webpack://carhop-blocks/webpack/runtime/define property getters","webpack://carhop-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://carhop-blocks/webpack/runtime/make namespace object","webpack://carhop-blocks/./src/core-variants/variants.js"],"sourcesContent":["wp.blocks.registerBlockStyle(\"core/embed\", {\r\n\tname: \"stacked-background\",\r\n\tlabel: \"Fond empilé\",\r\n});\r\n","wp.blocks.registerBlockStyle(\"core/heading\", {\r\n\tname: \"stroked-after\",\r\n\tlabel: \"Titre + trait \",\r\n});\r\n","wp.blocks.registerBlockStyle(\"core/image\", {\r\n\tname: \"framed\",\r\n\tlabel: \"Encadré\",\r\n\tisDefault: true,\r\n});\r\nwp.blocks.registerBlockStyle(\"core/image\", {\r\n\tname: \"stacked\",\r\n\tlabel: \"Empilé\",\r\n\tisDefault: false,\r\n});\r\n","import { registerBlockVariation } from \"@wordpress/blocks\";\r\nimport { __ } from \"@wordpress/i18n\";\r\nimport {\r\n\tInspectorControls,\r\n\tBlockControls,\r\n\tAlignmentToolbar,\r\n} from \"@wordpress/block-editor\";\r\nimport { ToolbarGroup, ToolbarDropdownMenu } from \"@wordpress/components\";\r\nimport { Fragment } from \"@wordpress/element\";\r\nimport { addFilter } from \"@wordpress/hooks\";\r\nimport { createHigherOrderComponent } from \"@wordpress/compose\";\r\n\r\nimport { check, arrowRight, starFilled } from \"@wordpress/icons\";\r\n\r\n// Variation du bloc \"Liste\" pour ajouter une classe spéciale\r\nregisterBlockVariation(\"core/list\", {\r\n\tname: \"iconed-list\",\r\n\ttitle: \"Liste avec icônes\",\r\n\tdescription: \"Liste dont chaque élément peut avoir une icône personnalisée.\",\r\n\tattributes: {\r\n\t\tclassName: \"is-iconed-list\",\r\n\t},\r\n\tscope: [\"inserter\", \"transform\"],\r\n\tisActive: (blockAttributes) => {\r\n\t\tconst cls = (blockAttributes && blockAttributes.className) || \"\";\r\n\t\treturn cls.split(\" \").includes(\"is-iconed-list\");\r\n\t},\r\n});\r\n\r\n// -----------------------------\r\n// 1. On étend les attributs de core/list-item\r\n// -----------------------------\r\n\r\naddFilter(\r\n\t\"blocks.registerBlockType\",\r\n\t\"am/iconed-list-item-attributes\",\r\n\t(settings, name) => {\r\n\t\tif (name !== \"core/list-item\") {\r\n\t\t\treturn settings;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\t...settings,\r\n\t\t\tattributes: {\r\n\t\t\t\t...settings.attributes,\r\n\t\t\t\ticon: {\r\n\t\t\t\t\ttype: \"string\",\r\n\t\t\t\t\tdefault: \"\",\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t};\r\n\t}\r\n);\r\n\r\n// -----------------------------\r\n// 2. On ajoute un panneau de réglages pour choisir l'icône\r\n// -----------------------------\r\n\r\naddFilter(\r\n\t\"editor.BlockEdit\",\r\n\t\"am/iconed-list-item-controls\",\r\n\t(BlockEdit) => (props) => {\r\n\t\tif (props.name !== \"core/list-item\") {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tconst { attributes, setAttributes } = props;\r\n\t\tconst { icon } = attributes;\r\n\r\n\t\tconst ICONS = [\r\n\t\t\t{\r\n\t\t\t\ttitle: __(\"Loupe\"),\r\n\t\t\t\tvalue: \"loupe\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\ttitle: __(\"Sablier\"),\r\n\t\t\t\tvalue: \"sablier\",\r\n\t\t\t},\r\n\t\t\t{ title: __(\"Cadenas\"), value: \"cadenas\" },\r\n\t\t\t{ title: __(\"Check\"), value: \"check\" },\r\n\t\t\t{ title: __(\"Loupe Alt\"), value: \"loupe-alt\" },\r\n\t\t\t{ title: __(\"Pendule\"), value: \"pendule\" },\r\n\t\t];\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcontrols={ICONS.map(({ title, value }) => ({\r\n\t\t\t\t\t\t\t\ttitle,\r\n\t\t\t\t\t\t\t\ticon: (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t),\r\n\r\n\t\t\t\t\t\t\t\tisActive: icon === value,\r\n\t\t\t\t\t\t\t\tonClick: () => setAttributes({ icon: 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\r\n\t\t\t\t\t setAttributes({ align: value })}\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\n// -----------------------------\r\n// 3. On ajoute des props au HTML sauvegardé pour chaque
  • \r\n// -----------------------------\r\naddFilter(\r\n\t\"blocks.getSaveContent.extraProps\",\r\n\t\"carhop/iconed-list-item-save-props\",\r\n\t(extraProps, blockType, attributes) => {\r\n\t\tif (blockType.name !== \"core/list-item\" || !attributes.icon) {\r\n\t\t\treturn extraProps;\r\n\t\t}\r\n\r\n\t\tif (attributes.icon) {\r\n\t\t\textraProps = {\r\n\t\t\t\t...extraProps,\r\n\t\t\t\tclassName:\r\n\t\t\t\t\t(extraProps.className || \"\") +\r\n\t\t\t\t\t\" has-custom-icon has-custom-icon--\" +\r\n\t\t\t\t\tattributes.icon,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn extraProps;\r\n\t}\r\n);\r\n\r\n// -----------------------------\r\n// 4. Applique les mêmes classes en mode éditeur (BlockListBlock)\r\n// -----------------------------\r\naddFilter(\r\n\t\"editor.BlockListBlock\",\r\n\t\"carhop/iconed-list-item-editor-classes\",\r\n\tcreateHigherOrderComponent((BlockListBlock) => {\r\n\t\treturn (props) => {\r\n\t\t\tif (props.name !== \"core/list-item\") {\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\tconst slug = props.attributes?.icon || \"\";\r\n\t\t\tconst className = [\r\n\t\t\t\tprops.className || \"\",\r\n\t\t\t\tslug ? \"has-custom-icon\" : \"\",\r\n\t\t\t\tslug ? `has-custom-icon--${slug}` : \"\",\r\n\t\t\t]\r\n\t\t\t\t.filter(Boolean)\r\n\t\t\t\t.join(\" \");\r\n\r\n\t\t\treturn ;\r\n\t\t};\r\n\t}, \"withIconedListItemEditorClasses\")\r\n);\r\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"compose\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"hooks\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// 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 \"./core-heading-variant/editor.js\";\r\nimport \"./core-image-variant/editor.js\";\r\nimport \"./core-embed-variant/editor.js\";\r\nimport \"./core-list-variant/editor.js\";\r\n\r\nimport \"./variants.scss\";\r\n"],"names":["wp","blocks","registerBlockStyle","name","label","isDefault","registerBlockVariation","__","InspectorControls","BlockControls","AlignmentToolbar","ToolbarGroup","ToolbarDropdownMenu","Fragment","addFilter","createHigherOrderComponent","check","arrowRight","starFilled","jsx","_jsx","jsxs","_jsxs","title","description","attributes","className","scope","isActive","blockAttributes","cls","split","includes","settings","icon","type","default","BlockEdit","props","setAttributes","ICONS","value","children","controls","map","onClick","align","onChange","extraProps","blockType","BlockListBlock","slug","filter","Boolean","join"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/src/core-variants/core-list-variant/editor.js b/plugins/carhop-blocks/src/core-variants/core-list-variant/editor.js index 0619c43..0d237ea 100644 --- a/plugins/carhop-blocks/src/core-variants/core-list-variant/editor.js +++ b/plugins/carhop-blocks/src/core-variants/core-list-variant/editor.js @@ -124,7 +124,7 @@ addFilter( "blocks.getSaveContent.extraProps", "carhop/iconed-list-item-save-props", (extraProps, blockType, attributes) => { - if (blockType.name !== "core/list-item") { + if (blockType.name !== "core/list-item" || !attributes.icon) { return extraProps; } diff --git a/plugins/carhop-blocks/src/narrative-card/block.json b/plugins/carhop-blocks/src/narrative-card/block.json index 94cbc60..81cb9cf 100644 --- a/plugins/carhop-blocks/src/narrative-card/block.json +++ b/plugins/carhop-blocks/src/narrative-card/block.json @@ -16,6 +16,7 @@ "editorStyle": "file:./index.css", "style": "file:./style-index.css", "viewScript": "file:./view.js", + "render": "file:./render.php", "attributes": { "hasCover": { "type": "boolean", diff --git a/plugins/carhop-blocks/src/narrative-card/render.php b/plugins/carhop-blocks/src/narrative-card/render.php new file mode 100644 index 0000000..b78120a --- /dev/null +++ b/plugins/carhop-blocks/src/narrative-card/render.php @@ -0,0 +1,50 @@ +inner_blocks) ? $block->inner_blocks : []; +$hasCover = $attributes['hasCover']; +$coverPosition = $attributes['coverPosition']; +$blackWhiteCoverFilter = $attributes['blackWhiteCoverFilter']; +$aspectRatio = $attributes['aspectRatio']; +$coverUrl = $attributes['coverUrl']; +$coverAlt = $attributes['coverAlt']; +?> + + +
    'narrative-card ' . ($hasCover ? 'narrative-card--has-cover narrative-card--has-cover--' . $coverPosition . ' ' . ($blackWhiteCoverFilter ? 'narrative-card--black-white-cover-filter' : '') : ''))); ?>> + + + + + + +
    "> + + <?php echo $coverAlt; ?> + +
    + + +
    + render(); + } ?> +
    + +
    "> + + <?php echo $coverAlt; ?> + +
    + + +
    \ No newline at end of file diff --git a/plugins/carhop-blocks/src/narrative-card/save.js b/plugins/carhop-blocks/src/narrative-card/save.js index 657f0b7..6f2d845 100644 --- a/plugins/carhop-blocks/src/narrative-card/save.js +++ b/plugins/carhop-blocks/src/narrative-card/save.js @@ -11,67 +11,5 @@ export default function save({ attributes }) { aspectRatio, } = attributes; - return ( -
    - - - - - {hasCover && coverPosition === "left" && ( -
    - {hasCover && coverUrl && {coverAlt}} -
    - )} -
    - -
    - {hasCover && coverPosition === "right" && ( -
    - {hasCover && coverUrl && {coverAlt}} -
    - )} -
    - ); + return ; }