From 5d8b790ac5a6ddddd56e19763bad5e9c4d02ed8d Mon Sep 17 00:00:00 2001 From: Antoine M Date: Mon, 8 Apr 2024 14:39:10 +0200 Subject: [PATCH] handling block depreacation --- blocks/content-page-header/build/block.json | 3 - .../content-page-header/build/index.asset.php | 2 +- blocks/content-page-header/build/index.js | 161 +++++++++++++----- blocks/content-page-header/build/index.js.map | 2 +- blocks/content-page-header/build/render.php | 12 -- .../content-page-header/build/style-index.css | 7 - .../build/style-index.css.map | 1 - blocks/content-page-header/src/block.json | 3 - blocks/content-page-header/src/deprecated.js | 101 +++++++++++ blocks/content-page-header/src/edit.js | 49 +----- blocks/content-page-header/src/index.js | 2 + blocks/content-page-header/src/render.php | 12 -- blocks/content-page-header/src/save.js | 8 +- blocks/content-page-header/src/style.scss | 16 +- 14 files changed, 234 insertions(+), 145 deletions(-) delete mode 100644 blocks/content-page-header/build/style-index.css.map create mode 100644 blocks/content-page-header/src/deprecated.js diff --git a/blocks/content-page-header/build/block.json b/blocks/content-page-header/build/block.json index 2e9b106..0851239 100644 --- a/blocks/content-page-header/build/block.json +++ b/blocks/content-page-header/build/block.json @@ -21,9 +21,6 @@ "type": "boolean", "default": false }, - "blockCustomTitle": { - "type": "string" - }, "pageHeaderTitle": { "type": "string" }, diff --git a/blocks/content-page-header/build/index.asset.php b/blocks/content-page-header/build/index.asset.php index a4badf8..ff8d992 100644 --- a/blocks/content-page-header/build/index.asset.php +++ b/blocks/content-page-header/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'c79b0c0a1da145209afe'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '33d8b36cf2904cb62a91'); diff --git a/blocks/content-page-header/build/index.js b/blocks/content-page-header/build/index.js index 64f4be2..d0597c0 100644 --- a/blocks/content-page-header/build/index.js +++ b/blocks/content-page-header/build/index.js @@ -2,6 +2,112 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ +/***/ "./src/deprecated.js": +/*!***************************!*\ + !*** ./src/deprecated.js ***! + \***************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); + + + + +const v1 = { + attributes: { + hasCustomTitle: { + type: "boolean", + default: false + }, + blockCustomTitle: { + type: "string" + }, + pageHeaderTitle: { + type: "string" + }, + hasCta: { + type: "boolean", + default: false + }, + cta: { + type: "object" + }, + hasCustomImage: { + type: "boolean", + default: false + }, + imageUrl: { + type: "string" + }, + imageAlt: { + type: "string" + }, + imageId: { + type: "number" + }, + imageProportion: { + type: "string", + default: "original" + }, + anchor: { + type: "string" + }, + coverSize: { + type: "string", + default: "medium" + } + }, + save({ + attributes + }) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps.save({ + className: `innerblocks` + }) + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks.Content, null)); + }, + migrate(attributes, innerBlocks) { + const { + blockCustomTitle, + pageHeaderTitle, + ...restAttributes + } = attributes; + + // const pageTitle = useSelect((select) => { + // const { getEditedPostAttribute } = select("core/editor"); + // return getEditedPostAttribute("title"); + // }); + + return [restAttributes, [(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)("homegrade-content-blocks/section-titling", { + content: attributes.sectionTitle, + level: 3 + }, [(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)("core/heading", { + placeholder: "Titre de section", + content: attributes.hasCustomTitle ? blockCustomTitle : "", + level: 1, + className: "section_titling__title" + }), (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)("core/paragraph", { + content: attributes.pageHeaderTitle, + placeholder: "Tapez votre sous-titre...", + className: "section_titling__subtitle" + })]), ...innerBlocks]]; + } +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v1]); + +/***/ }), + /***/ "./src/edit.js": /*!*********************!*\ !*** ./src/edit.js ***! @@ -36,10 +142,7 @@ function Edit({ setAttributes }) { const { - anchor, - blockCustomTitle, hasCustomTitle, - pageHeaderTitle, hasCta, cta, hasCustomImage, @@ -48,12 +151,6 @@ function Edit({ imageUrl, coverSize } = attributes; - const pageTitle = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { - const { - getEditedPostAttribute - } = select("core/editor"); - return getEditedPostAttribute("title"); - }); const pageIllustration = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { const currentPost = select("core/editor").getCurrentPost(); if (currentPost && currentPost.acf && currentPost.acf.page_illustration) { @@ -61,16 +158,6 @@ function Edit({ return Image; } }); - function onChangeBlockCustomTitle(blockCustomTitle) { - setAttributes({ - blockCustomTitle - }); - } - function onChangeTitle(newTitle) { - setAttributes({ - pageHeaderTitle: newTitle - }); - } function onChangeHasCustomTitle(newHasAutoTitle) { setAttributes({ hasCustomTitle: !hasCustomTitle @@ -206,25 +293,10 @@ function Edit({ }) }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { class: "block-content-page-header__content" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "section_titling section_titling--left" - }, !hasCustomTitle && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", { - className: "section_titling__title" - }, pageTitle), hasCustomTitle && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.RichText, { - className: "section_titling__title", - tagName: "h1", - placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter ici le Titre du Bloc Header", "homegrade"), - value: blockCustomTitle, - onChange: onChangeBlockCustomTitle - }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.RichText, { - className: "section_titling__subtitle", - tagName: "h2", - placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter ici le Titre du Bloc Header", "homegrade"), - value: pageHeaderTitle, - onChange: onChangeTitle - // style={{ textAlign: props.attributes.alignment }} - })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InnerBlocks, { - template: [["core/paragraph", { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InnerBlocks, { + template: [["homegrade-content-blocks/section-titling", { + lock: true + }], ["core/paragraph", { placeholder: "Ajouter ici le texte" }]], allowedBlocks: ["core/paragraph", "core/list", "core/button", "core/buttons", "gravityforms/form", "homegrade-content-blocks/section-titling"] @@ -264,6 +336,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js"); /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); +/* harmony import */ var _deprecated__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./deprecated */ "./src/deprecated.js"); + @@ -287,7 +361,8 @@ __webpack_require__.r(__webpack_exports__); }))) }, edit: _edit__WEBPACK_IMPORTED_MODULE_4__["default"], - save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] + save: _save__WEBPACK_IMPORTED_MODULE_3__["default"], + deprecated: _deprecated__WEBPACK_IMPORTED_MODULE_6__["default"] }); /***/ }), @@ -315,11 +390,7 @@ function save({ attributes, setAttributes }) { - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ - className: `innerblocks` - }) - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)); } /***/ }), @@ -465,7 +536,7 @@ module.exports = window["wp"]["primitives"]; \************************/ /***/ ((module) => { -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-page-header","version":"0.1.0","title":"Content page header","category":"homegrade-blocks","icon":"smiley","description":"Bloc bannière/header de contenu de premier niveau pour les pages de contenu","supports":{"html":false,"anchor":true},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"hasCustomTitle":{"type":"boolean","default":false},"blockCustomTitle":{"type":"string"},"pageHeaderTitle":{"type":"string"},"hasCta":{"type":"boolean","default":false},"cta":{"type":"object"},"hasCustomImage":{"type":"boolean","default":false},"imageUrl":{"type":"string"},"imageAlt":{"type":"string"},"imageId":{"type":"number"},"imageProportion":{"type":"string","default":"original"},"anchor":{"type":"string"},"coverSize":{"type":"string","default":"medium"}}}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-page-header","version":"0.1.0","title":"Content page header","category":"homegrade-blocks","icon":"smiley","description":"Bloc bannière/header de contenu de premier niveau pour les pages de contenu","supports":{"html":false,"anchor":true},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"hasCustomTitle":{"type":"boolean","default":false},"pageHeaderTitle":{"type":"string"},"hasCta":{"type":"boolean","default":false},"cta":{"type":"object"},"hasCustomImage":{"type":"boolean","default":false},"imageUrl":{"type":"string"},"imageAlt":{"type":"string"},"imageId":{"type":"number"},"imageProportion":{"type":"string","default":"original"},"anchor":{"type":"string"},"coverSize":{"type":"string","default":"medium"}}}'); /***/ }) diff --git a/blocks/content-page-header/build/index.js.map b/blocks/content-page-header/build/index.js.map index e657cd1..b29acba 100644 --- a/blocks/content-page-header/build/index.js.map +++ b/blocks/content-page-header/build/index.js.map @@ -1 +1 @@ -{"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ACA;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/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss?d446","webpack://multiblocks/./src/style.scss?d1e4","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/trash.js","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\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/external window [\"wp\",\"primitives\"]","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\";\nimport \"./editor.scss\";\nimport { useSelect } from \"@wordpress/data\";\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tRichText,\n\tMediaReplaceFlow,\n\tInspectorControls,\n\t__experimentalLinkControl as LinkControl,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\n\nimport {\n\tPanelBody,\n\tTextControl,\n\tButton,\n\tTip,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from \"@wordpress/components\";\n\nimport { trash } from \"@wordpress/icons\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst {\n\t\tanchor,\n\t\tblockCustomTitle,\n\t\thasCustomTitle,\n\t\tpageHeaderTitle,\n\t\thasCta,\n\t\tcta,\n\t\thasCustomImage,\n\t\timageId,\n\t\timageAlt,\n\t\timageUrl,\n\t\tcoverSize,\n\t} = attributes;\n\n\tconst pageTitle = useSelect((select) => {\n\t\tconst { getEditedPostAttribute } = select(\"core/editor\");\n\t\treturn getEditedPostAttribute(\"title\");\n\t});\n\n\tconst pageIllustration = useSelect((select) => {\n\t\tconst currentPost = select(\"core/editor\").getCurrentPost();\n\t\tif (currentPost && currentPost.acf && currentPost.acf.page_illustration) {\n\t\t\tlet Image = select(\"core\").getMedia(currentPost.acf.page_illustration);\n\t\t\treturn Image;\n\t\t}\n\t});\n\n\tfunction onChangeBlockCustomTitle(blockCustomTitle) {\n\t\tsetAttributes({ blockCustomTitle });\n\t}\n\tfunction onChangeTitle(newTitle) {\n\t\tsetAttributes({ pageHeaderTitle: newTitle });\n\t}\n\tfunction onChangeHasCustomTitle(newHasAutoTitle) {\n\t\tsetAttributes({ hasCustomTitle: !hasCustomTitle });\n\t\tif (newHasAutoTitle) {\n\t\t\tsetAttributes({ blockCustomTitle: undefined });\n\t\t}\n\t}\n\tfunction onChangeHasCustomImage(newHasAutoImage) {\n\t\tsetAttributes({ hasCustomImage: !hasCustomImage });\n\t\tif (!newHasAutoImage) {\n\t\t\tremoveImageAttributes();\n\t\t}\n\t}\n\tfunction setImageAttributes(image) {\n\t\tsetAttributes({\n\t\t\timageId: image.id,\n\t\t\timageAlt: image.alt,\n\t\t\timageUrl: image.url,\n\t\t});\n\t}\n\tfunction removeImageAttributes() {\n\t\tsetAttributes({\n\t\t\timageId: null,\n\t\t\timageAlt: null,\n\t\t\timageUrl: null,\n\t\t});\n\t}\n\tfunction onChangeHasCta(newHasCta) {\n\t\tsetAttributes({ hasCta: !hasCta });\n\t\tif (!newHasCta) {\n\t\t\tsetAttributes({ cta: undefined });\n\t\t}\n\t}\n\tfunction onChangeCTA(newCtaValue) {\n\t\tsetAttributes({\n\t\t\tcta: {\n\t\t\t\ttitle: !cta || !cta.title ? newCtaValue.title : cta.title,\n\t\t\t\tid: newCtaValue.id,\n\t\t\t\tkind: newCtaValue.kind,\n\t\t\t\ttype: newCtaValue.type,\n\t\t\t\turl: newCtaValue.url,\n\t\t\t},\n\t\t});\n\t}\n\tfunction onChangeTextControl(newCtaTitle) {\n\t\tsetAttributes({\n\t\t\tcta: {\n\t\t\t\t...cta,\n\t\t\t\ttitle: newCtaTitle,\n\t\t\t},\n\t\t});\n\t}\n\tfunction onCoverSizeChange(coverSize) {\n\t\tsetAttributes({ coverSize });\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{!hasCustomTitle && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tLe titre est automatiquement généré à partir du titre de la page\n\t\t\t\t\t\t\n\t\t\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{!hasCustomImage && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tLa couverture est automatiquement généré à partir de\n\t\t\t\t\t\t\tl'illustration de couverture de la page.\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t{hasCustomImage && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{imageUrl && {imageAlt}}\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{imageUrl && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\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\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{hasCta && (\n\t\t\t\t\t\t<>\n\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\t\t{!hasCustomTitle && (\n\t\t\t\t\t\t\t

{pageTitle}

\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{hasCustomTitle && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t{cta && cta.title && cta.url && {cta.title}}\n\t\t\t\t
\n\t\t\t\t{pageIllustration && !hasCustomImage && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{hasCustomImage && imageUrl && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{hasCustomImage && !imageUrl && (\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\";\nimport \"./style.scss\";\nimport save from \"./save\";\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tforeground: \"#f03\",\n\t\tsrc: (\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\n\t\t\t\n\t\t),\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\r\nimport { __ } from \"@wordpress/i18n\";\r\n\r\nexport default function save({ attributes, setAttributes }) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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":["__","useSelect","InnerBlocks","useBlockProps","RichText","MediaReplaceFlow","InspectorControls","__experimentalLinkControl","LinkControl","MediaPlaceholder","PanelBody","TextControl","Button","Tip","ToggleControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","trash","Edit","attributes","setAttributes","anchor","blockCustomTitle","hasCustomTitle","pageHeaderTitle","hasCta","cta","hasCustomImage","imageId","imageAlt","imageUrl","coverSize","pageTitle","select","getEditedPostAttribute","pageIllustration","currentPost","getCurrentPost","acf","page_illustration","Image","getMedia","onChangeBlockCustomTitle","onChangeTitle","newTitle","onChangeHasCustomTitle","newHasAutoTitle","undefined","onChangeHasCustomImage","newHasAutoImage","removeImageAttributes","setImageAttributes","image","id","alt","url","onChangeHasCta","newHasCta","onChangeCTA","newCtaValue","title","kind","type","onChangeTextControl","newCtaTitle","onCoverSizeChange","createElement","Fragment","className","label","checked","onChange","src","mediaId","mediaUrl","allowedTypes","accept","onSelect","name","variant","icon","onClick","isBlock","value","class","tagName","placeholder","template","allowedBlocks","href","source_url","multiple","handleUpload","registerBlockType","save","metadata","foreground","xmlns","viewBox","d","edit","Content"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAgD;AAC+B;AACnC;AAE5C,MAAMK,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,cAAc,EAAE;MACfC,IAAI,EAAE,SAAS;MACfC,OAAO,EAAE;IACV,CAAC;IACDC,gBAAgB,EAAE;MACjBF,IAAI,EAAE;IACP,CAAC;IACDG,eAAe,EAAE;MAChBH,IAAI,EAAE;IACP,CAAC;IACDI,MAAM,EAAE;MACPJ,IAAI,EAAE,SAAS;MACfC,OAAO,EAAE;IACV,CAAC;IACDI,GAAG,EAAE;MACJL,IAAI,EAAE;IACP,CAAC;IACDM,cAAc,EAAE;MACfN,IAAI,EAAE,SAAS;MACfC,OAAO,EAAE;IACV,CAAC;IACDM,QAAQ,EAAE;MACTP,IAAI,EAAE;IACP,CAAC;IACDQ,QAAQ,EAAE;MACTR,IAAI,EAAE;IACP,CAAC;IACDS,OAAO,EAAE;MACRT,IAAI,EAAE;IACP,CAAC;IACDU,eAAe,EAAE;MAChBV,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;IACV,CAAC;IACDU,MAAM,EAAE;MACPX,IAAI,EAAE;IACP,CAAC;IACDY,SAAS,EAAE;MACVZ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;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/deprecated.js","webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/trash.js","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\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/external window [\"wp\",\"primitives\"]","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 { createBlock } from \"@wordpress/blocks\";\r\nimport { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\r\nimport { useSelect } from \"@wordpress/data\";\r\n\r\nconst v1 = {\r\n\tattributes: {\r\n\t\thasCustomTitle: {\r\n\t\t\ttype: \"boolean\",\r\n\t\t\tdefault: false,\r\n\t\t},\r\n\t\tblockCustomTitle: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\tpageHeaderTitle: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\thasCta: {\r\n\t\t\ttype: \"boolean\",\r\n\t\t\tdefault: false,\r\n\t\t},\r\n\t\tcta: {\r\n\t\t\ttype: \"object\",\r\n\t\t},\r\n\t\thasCustomImage: {\r\n\t\t\ttype: \"boolean\",\r\n\t\t\tdefault: false,\r\n\t\t},\r\n\t\timageUrl: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\timageAlt: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\timageId: {\r\n\t\t\ttype: \"number\",\r\n\t\t},\r\n\t\timageProportion: {\r\n\t\t\ttype: \"string\",\r\n\t\t\tdefault: \"original\",\r\n\t\t},\r\n\t\tanchor: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\tcoverSize: {\r\n\t\t\ttype: \"string\",\r\n\t\t\tdefault: \"medium\",\r\n\t\t},\r\n\t},\r\n\r\n\tsave({ attributes }) {\r\n\t\treturn (\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\tmigrate(attributes, innerBlocks) {\r\n\t\tconst { blockCustomTitle, pageHeaderTitle, ...restAttributes } = attributes;\r\n\r\n\t\t// const pageTitle = useSelect((select) => {\r\n\t\t// \tconst { getEditedPostAttribute } = select(\"core/editor\");\r\n\t\t// \treturn getEditedPostAttribute(\"title\");\r\n\t\t// });\r\n\r\n\r\n\t\treturn [\r\n\t\t\trestAttributes,\r\n\t\t\t[\r\n\t\t\t\tcreateBlock(\r\n\t\t\t\t\t\"homegrade-content-blocks/section-titling\",\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontent: attributes.sectionTitle,\r\n\t\t\t\t\t\tlevel: 3,\r\n\t\t\t\t\t},\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\tcreateBlock(\"core/heading\", {\r\n\t\t\t\t\t\t\tplaceholder: \"Titre de section\",\r\n\t\t\t\t\t\t\tcontent: attributes.hasCustomTitle ? blockCustomTitle : \"\",\r\n\t\t\t\t\t\t\tlevel: 1,\r\n\t\t\t\t\t\t\tclassName: \"section_titling__title\",\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\tcreateBlock(\"core/paragraph\", {\r\n\t\t\t\t\t\t\tcontent: attributes.pageHeaderTitle,\r\n\t\t\t\t\t\t\tplaceholder: \"Tapez votre sous-titre...\",\r\n\t\t\t\t\t\t\tclassName: \"section_titling__subtitle\",\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t],\r\n\t\t\t\t),\r\n\r\n\t\t\t\t...innerBlocks,\r\n\t\t\t],\r\n\t\t];\r\n\t},\r\n};\r\n\r\nexport default [v1];\r\n","import { __ } from \"@wordpress/i18n\";\nimport \"./editor.scss\";\nimport { useSelect } from \"@wordpress/data\";\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tRichText,\n\tMediaReplaceFlow,\n\tInspectorControls,\n\t__experimentalLinkControl as LinkControl,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\n\nimport {\n\tPanelBody,\n\tTextControl,\n\tButton,\n\tTip,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from \"@wordpress/components\";\n\nimport { lock, trash } from \"@wordpress/icons\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst {\n\t\thasCustomTitle,\n\t\thasCta,\n\t\tcta,\n\t\thasCustomImage,\n\t\timageId,\n\t\timageAlt,\n\t\timageUrl,\n\t\tcoverSize,\n\t} = attributes;\n\n\tconst pageIllustration = useSelect((select) => {\n\t\tconst currentPost = select(\"core/editor\").getCurrentPost();\n\t\tif (currentPost && currentPost.acf && currentPost.acf.page_illustration) {\n\t\t\tlet Image = select(\"core\").getMedia(currentPost.acf.page_illustration);\n\t\t\treturn Image;\n\t\t}\n\t});\n\n\tfunction onChangeHasCustomTitle(newHasAutoTitle) {\n\t\tsetAttributes({ hasCustomTitle: !hasCustomTitle });\n\t\tif (newHasAutoTitle) {\n\t\t\tsetAttributes({ blockCustomTitle: undefined });\n\t\t}\n\t}\n\tfunction onChangeHasCustomImage(newHasAutoImage) {\n\t\tsetAttributes({ hasCustomImage: !hasCustomImage });\n\t\tif (!newHasAutoImage) {\n\t\t\tremoveImageAttributes();\n\t\t}\n\t}\n\tfunction setImageAttributes(image) {\n\t\tsetAttributes({\n\t\t\timageId: image.id,\n\t\t\timageAlt: image.alt,\n\t\t\timageUrl: image.url,\n\t\t});\n\t}\n\tfunction removeImageAttributes() {\n\t\tsetAttributes({\n\t\t\timageId: null,\n\t\t\timageAlt: null,\n\t\t\timageUrl: null,\n\t\t});\n\t}\n\tfunction onChangeHasCta(newHasCta) {\n\t\tsetAttributes({ hasCta: !hasCta });\n\t\tif (!newHasCta) {\n\t\t\tsetAttributes({ cta: undefined });\n\t\t}\n\t}\n\tfunction onChangeCTA(newCtaValue) {\n\t\tsetAttributes({\n\t\t\tcta: {\n\t\t\t\ttitle: !cta || !cta.title ? newCtaValue.title : cta.title,\n\t\t\t\tid: newCtaValue.id,\n\t\t\t\tkind: newCtaValue.kind,\n\t\t\t\ttype: newCtaValue.type,\n\t\t\t\turl: newCtaValue.url,\n\t\t\t},\n\t\t});\n\t}\n\tfunction onChangeTextControl(newCtaTitle) {\n\t\tsetAttributes({\n\t\t\tcta: {\n\t\t\t\t...cta,\n\t\t\t\ttitle: newCtaTitle,\n\t\t\t},\n\t\t});\n\t}\n\tfunction onCoverSizeChange(coverSize) {\n\t\tsetAttributes({ coverSize });\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{!hasCustomTitle && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tLe titre est automatiquement généré à partir du titre de la page\n\t\t\t\t\t\t\n\t\t\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{!hasCustomImage && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tLa couverture est automatiquement généré à partir de\n\t\t\t\t\t\t\tl'illustration de couverture de la page.\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t{hasCustomImage && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{imageUrl && {imageAlt}}\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{imageUrl && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\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\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{hasCta && (\n\t\t\t\t\t\t<>\n\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\t{cta && cta.title && cta.url && {cta.title}}\n\t\t\t\t
\n\t\t\t\t{pageIllustration && !hasCustomImage && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{hasCustomImage && imageUrl && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{hasCustomImage && !imageUrl && (\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\";\nimport \"./style.scss\";\nimport save from \"./save\";\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\nimport deprecated from \"./deprecated\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tforeground: \"#f03\",\n\t\tsrc: (\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\n\t\t\t\n\t\t),\n\t},\n\tedit: Edit,\n\tsave,\n\tdeprecated\n});\n","import { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\r\nimport { __ } from \"@wordpress/i18n\";\r\n\r\nexport default function save({ attributes, setAttributes }) {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst trash = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z\"\n}));\nexport default trash;\n//# sourceMappingURL=trash.js.map","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// 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":["createBlock","useBlockProps","RichText","InnerBlocks","useSelect","v1","attributes","hasCustomTitle","type","default","blockCustomTitle","pageHeaderTitle","hasCta","cta","hasCustomImage","imageUrl","imageAlt","imageId","imageProportion","anchor","coverSize","save","createElement","className","Content","migrate","innerBlocks","restAttributes","content","sectionTitle","level","placeholder","__","MediaReplaceFlow","InspectorControls","__experimentalLinkControl","LinkControl","MediaPlaceholder","PanelBody","TextControl","Button","Tip","ToggleControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","lock","trash","Edit","setAttributes","pageIllustration","select","currentPost","getCurrentPost","acf","page_illustration","Image","getMedia","onChangeHasCustomTitle","newHasAutoTitle","undefined","onChangeHasCustomImage","newHasAutoImage","removeImageAttributes","setImageAttributes","image","id","alt","url","onChangeHasCta","newHasCta","onChangeCTA","newCtaValue","title","kind","onChangeTextControl","newCtaTitle","onCoverSizeChange","Fragment","label","checked","onChange","src","mediaId","mediaUrl","allowedTypes","accept","onSelect","name","variant","icon","onClick","isBlock","value","class","template","allowedBlocks","href","source_url","multiple","handleUpload","registerBlockType","metadata","deprecated","foreground","xmlns","viewBox","d","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/content-page-header/build/render.php b/blocks/content-page-header/build/render.php index 33316ed..6d62057 100644 --- a/blocks/content-page-header/build/render.php +++ b/blocks/content-page-header/build/render.php @@ -13,19 +13,8 @@ $customTitle = $attributes['blockCustomTitle'] ?? null; $anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null; ?> -
" 'block-content-page-header']) ?>>
-
- -

- - -

- -

-
-

@@ -38,5 +27,4 @@ $anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null; " src="" alt=""> -
\ No newline at end of file diff --git a/blocks/content-page-header/build/style-index.css b/blocks/content-page-header/build/style-index.css index 0fc6500..95046e2 100644 --- a/blocks/content-page-header/build/style-index.css +++ b/blocks/content-page-header/build/style-index.css @@ -1,11 +1,4 @@ /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -.block-content-page-header p { - display: none; -} -.block-content-page-header .innerblocks p { - display: block; -} -/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file diff --git a/blocks/content-page-header/build/style-index.css.map b/blocks/content-page-header/build/style-index.css.map deleted file mode 100644 index e1693e0..0000000 --- a/blocks/content-page-header/build/style-index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"./style-index.css","mappings":";;;AAEC;EACC;AADF;AAGC;EACC;AADF,C","sources":["webpack://multiblocks/./src/style.scss"],"sourcesContent":["// Styled by the theme\r\n.block-content-page-header {\r\n\tp {\r\n\t\tdisplay: none;\r\n\t}\r\n\t.innerblocks p {\r\n\t\tdisplay: block;\r\n\t}\r\n}\r\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/content-page-header/src/block.json b/blocks/content-page-header/src/block.json index 9dac335..737fd30 100644 --- a/blocks/content-page-header/src/block.json +++ b/blocks/content-page-header/src/block.json @@ -21,9 +21,6 @@ "type": "boolean", "default": false }, - "blockCustomTitle": { - "type": "string" - }, "pageHeaderTitle": { "type": "string" }, diff --git a/blocks/content-page-header/src/deprecated.js b/blocks/content-page-header/src/deprecated.js new file mode 100644 index 0000000..2d4d7ee --- /dev/null +++ b/blocks/content-page-header/src/deprecated.js @@ -0,0 +1,101 @@ +import { createBlock } from "@wordpress/blocks"; +import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor"; +import { useSelect } from "@wordpress/data"; + +const v1 = { + attributes: { + hasCustomTitle: { + type: "boolean", + default: false, + }, + blockCustomTitle: { + type: "string", + }, + pageHeaderTitle: { + type: "string", + }, + hasCta: { + type: "boolean", + default: false, + }, + cta: { + type: "object", + }, + hasCustomImage: { + type: "boolean", + default: false, + }, + imageUrl: { + type: "string", + }, + imageAlt: { + type: "string", + }, + imageId: { + type: "number", + }, + imageProportion: { + type: "string", + default: "original", + }, + anchor: { + type: "string", + }, + coverSize: { + type: "string", + default: "medium", + }, + }, + + save({ attributes }) { + return ( +
+ +
+ ); + }, + + migrate(attributes, innerBlocks) { + const { blockCustomTitle, pageHeaderTitle, ...restAttributes } = attributes; + + // const pageTitle = useSelect((select) => { + // const { getEditedPostAttribute } = select("core/editor"); + // return getEditedPostAttribute("title"); + // }); + + + return [ + restAttributes, + [ + createBlock( + "homegrade-content-blocks/section-titling", + { + content: attributes.sectionTitle, + level: 3, + }, + [ + createBlock("core/heading", { + placeholder: "Titre de section", + content: attributes.hasCustomTitle ? blockCustomTitle : "", + level: 1, + className: "section_titling__title", + }), + createBlock("core/paragraph", { + content: attributes.pageHeaderTitle, + placeholder: "Tapez votre sous-titre...", + className: "section_titling__subtitle", + }), + ], + ), + + ...innerBlocks, + ], + ]; + }, +}; + +export default [v1]; diff --git a/blocks/content-page-header/src/edit.js b/blocks/content-page-header/src/edit.js index 3e79297..d5b6eec 100644 --- a/blocks/content-page-header/src/edit.js +++ b/blocks/content-page-header/src/edit.js @@ -21,14 +21,11 @@ import { __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from "@wordpress/components"; -import { trash } from "@wordpress/icons"; +import { lock, trash } from "@wordpress/icons"; export default function Edit({ attributes, setAttributes }) { const { - anchor, - blockCustomTitle, hasCustomTitle, - pageHeaderTitle, hasCta, cta, hasCustomImage, @@ -38,11 +35,6 @@ export default function Edit({ attributes, setAttributes }) { coverSize, } = attributes; - const pageTitle = useSelect((select) => { - const { getEditedPostAttribute } = select("core/editor"); - return getEditedPostAttribute("title"); - }); - const pageIllustration = useSelect((select) => { const currentPost = select("core/editor").getCurrentPost(); if (currentPost && currentPost.acf && currentPost.acf.page_illustration) { @@ -51,12 +43,6 @@ export default function Edit({ attributes, setAttributes }) { } }); - function onChangeBlockCustomTitle(blockCustomTitle) { - setAttributes({ blockCustomTitle }); - } - function onChangeTitle(newTitle) { - setAttributes({ pageHeaderTitle: newTitle }); - } function onChangeHasCustomTitle(newHasAutoTitle) { setAttributes({ hasCustomTitle: !hasCustomTitle }); if (newHasAutoTitle) { @@ -158,7 +144,7 @@ export default function Edit({ attributes, setAttributes }) { !imageUrl ? __( "Ajouter votre image manuellement", - "homegrade-blocks" + "homegrade-blocks", ) : __("Remplacer", "homegrade-blocks") } @@ -223,38 +209,9 @@ export default function Edit({ attributes, setAttributes }) { })} >
-
- {!hasCustomTitle && ( -

{pageTitle}

- )} - {hasCustomTitle && ( - - )} - - -
- -
" 'block-content-page-header']) ?>>
-
- -

- - -

- -

-
-

@@ -38,5 +27,4 @@ $anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null; " src="" alt=""> -
\ No newline at end of file diff --git a/blocks/content-page-header/src/save.js b/blocks/content-page-header/src/save.js index 9b189d1..d2f7304 100644 --- a/blocks/content-page-header/src/save.js +++ b/blocks/content-page-header/src/save.js @@ -3,12 +3,8 @@ import { __ } from "@wordpress/i18n"; export default function save({ attributes, setAttributes }) { return ( -
+ <> -
+ ); } diff --git a/blocks/content-page-header/src/style.scss b/blocks/content-page-header/src/style.scss index 3575777..079cd15 100644 --- a/blocks/content-page-header/src/style.scss +++ b/blocks/content-page-header/src/style.scss @@ -1,9 +1,9 @@ // Styled by the theme -.block-content-page-header { - p { - display: none; - } - .innerblocks p { - display: block; - } -} +// .block-content-page-header { +// p { +// display: none; +// } +// .innerblocks p { +// display: block; +// } +// }