diff --git a/blocks/section-titling/build/block.json b/blocks/section-titling/build/block.json index 6f18c33..420ecd5 100644 --- a/blocks/section-titling/build/block.json +++ b/blocks/section-titling/build/block.json @@ -14,12 +14,6 @@ "editorStyle": "file:./index.css", "style": "file:./style-index.css", "attributes": { - "sectionTitle": { - "type": "string" - }, - "sectionSubtitle": { - "type": "string" - }, "textAlign": { "type": "string", "default": "left" diff --git a/blocks/section-titling/build/index.asset.php b/blocks/section-titling/build/index.asset.php index 48a05a8..bf14cb6 100644 --- a/blocks/section-titling/build/index.asset.php +++ b/blocks/section-titling/build/index.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'a530ef6e4b300fa39187'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '532929bbc982cc64e979'); diff --git a/blocks/section-titling/build/index.css b/blocks/section-titling/build/index.css index 93512a1..dc33baa 100644 --- a/blocks/section-titling/build/index.css +++ b/blocks/section-titling/build/index.css @@ -1,6 +1,6 @@ -/*!****************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! - \****************************************************************************************************************************************************************************************************************************************/ +/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***! + \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ .homegrade-blocks-staff-list .homegrade-blocks-staff-list__staff-list { display: unset; } diff --git a/blocks/section-titling/build/index.js b/blocks/section-titling/build/index.js index d383b9a..30134e2 100644 --- a/blocks/section-titling/build/index.js +++ b/blocks/section-titling/build/index.js @@ -2,6 +2,105 @@ /******/ "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_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); + + + + +const v2 = { + attributes: { + sectionTitle: { + type: "string" + }, + sectionSubtitle: { + type: "string" + }, + textAlign: { + type: "string", + default: "left" + } + }, + save({ + attributes + }) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ + className: `section_titling section_titling--${attributes.textAlign}` + }) + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { + value: attributes.sectionTitle, + tagName: "h3", + className: "section_titling__title" + }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { + value: attributes.sectionSubtitle, + tagName: "p", + className: "section_titling__subtitle" + })); + }, + migrate(attributes, innerBlocks) { + const textAlign = attributes.textAlign; + return [{ + textAlign: textAlign + }, [(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("core/heading", { + content: attributes.sectionTitle, + level: 3, + className: "section_titling__title" + }), (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("core/paragraph", { + content: attributes.sectionSubtitle, + className: "section_titling__subtitle" + })]]; + } +}; +const v1 = { + attributes: { + sectionTitle: { + type: "string" + }, + sectionSubtitle: { + type: "string" + }, + textAlign: { + type: "string", + default: "left" + } + }, + save({ + attributes + }) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ + className: `section_titling section_titling--${textAlign}` + }) + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { + value: sectionTitle, + tagName: "h3", + className: "section_titling__title" + }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { + value: sectionSubtitle, + tagName: "p", + className: "section_titling__subtitle" + })); + } +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v2, v1]); + +/***/ }), + /***/ "./src/edit.js": /*!*********************!*\ !*** ./src/edit.js ***! @@ -12,8 +111,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ Edit) /* harmony export */ }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); @@ -37,28 +136,17 @@ function Edit({ clientId }) { let { - sectionTitle, - sectionSubtitle, textAlign } = attributes; - function onChangeSectionTitle(sectionTitle) { - setAttributes({ - sectionTitle - }); - } - function onChangeSectionSubtitle(sectionSubtitle) { - setAttributes({ - sectionSubtitle - }); - } + console.log("attributes", attributes); function onChangeTextAlignment(textAlign) { setAttributes({ textAlign }); } - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Toolbar, { + 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_3__.BlockControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Toolbar, { label: "Options" - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarDropdownMenu, { + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarDropdownMenu, { icon: textAlign === "left" ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"] : textAlign === "center" ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], label: "Alignement du titrage", controls: [{ @@ -74,22 +162,20 @@ function Edit({ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], onClick: () => onChangeTextAlignment("right") }] - }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ className: `section_titling section_titling--${textAlign}` }) - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, { - value: sectionTitle, - tagName: "h3", - className: "section_titling__title", - placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter ici le Titre de Section", "homegrade-blocks__texte-backoffice"), - onChange: onChangeSectionTitle - }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, { - value: sectionSubtitle, - tagName: "p", - className: "section_titling__subtitle", - placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter ici le Sous-titre", "homegrade"), - onChange: onChangeSectionSubtitle + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, { + allowedBlocks: ["core/paragraph", "core/list", "core/heading"], + templateLock: "contentOnly", + template: [["core/heading", { + placeholder: "Titre de section", + level: 3, + className: "section_titling__title" + }], ["core/paragraph", { + className: "section_titling__subtitle" + }]] }))); } @@ -107,21 +193,24 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js"); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/header.js"); +/* harmony import */ var _deprecated__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./deprecated */ "./src/deprecated.js"); +/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); +/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/header.js"); -(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { + +(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, { icon: { - src: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"], + src: _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"], foreground: "#DF1E1E" }, edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], - save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] + save: _save__WEBPACK_IMPORTED_MODULE_3__["default"], + deprecated: _deprecated__WEBPACK_IMPORTED_MODULE_4__["default"] }); /***/ }), @@ -136,8 +225,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ save) /* harmony export */ }); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); @@ -145,24 +234,16 @@ __webpack_require__.r(__webpack_exports__); function save({ attributes }) { - let { + const { sectionTitle, sectionSubtitle, textAlign } = attributes; - return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ className: `section_titling section_titling--${textAlign}` }) - }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { - value: sectionTitle, - tagName: "h3", - className: "section_titling__title" - }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, { - value: sectionSubtitle, - tagName: "p", - className: "section_titling__subtitle" - })); + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)); } /***/ }), @@ -315,6 +396,16 @@ const positionRight = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createE /***/ }), +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ ((module) => { + +module.exports = window["React"]; + +/***/ }), + /***/ "@wordpress/block-editor": /*!*************************************!*\ !*** external ["wp","blockEditor"] ***! @@ -381,7 +472,7 @@ module.exports = window["wp"]["primitives"]; \************************/ /***/ ((module) => { -module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/section-titling","version":"0.1.0","title":"Titre de section","category":"homegrade-blocks","description":"Pour insérer un bloc de titrage (dans une grey-box ou une white-box) ","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"sectionTitle":{"type":"string"},"sectionSubtitle":{"type":"string"},"textAlign":{"type":"string","default":"left"}}}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/section-titling","version":"0.1.0","title":"Titre de section","category":"homegrade-blocks","description":"Pour insérer un bloc de titrage (dans une grey-box ou une white-box) ","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"textAlign":{"type":"string","default":"left"}}}'); /***/ }) @@ -427,9 +518,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ } /******/ var notFulfilled = Infinity; /******/ for (var i = 0; i < deferred.length; i++) { -/******/ var chunkIds = deferred[i][0]; -/******/ var fn = deferred[i][1]; -/******/ var priority = deferred[i][2]; +/******/ var [chunkIds, fn, priority] = deferred[i]; /******/ var fulfilled = true; /******/ for (var j = 0; j < chunkIds.length; j++) { /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { @@ -515,9 +604,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var runtime = data[2]; +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; @@ -540,7 +627,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json /******/ return __webpack_require__.O(result); /******/ } /******/ -/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || []; +/******/ var chunkLoadingGlobal = globalThis["webpackChunkmultiblocks"] = globalThis["webpackChunkmultiblocks"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); diff --git a/blocks/section-titling/build/index.js.map b/blocks/section-titling/build/index.js.map index 0faeb08..a244b5d 100644 --- a/blocks/section-titling/build/index.js.map +++ b/blocks/section-titling/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACd;AACiC;AACU;AACG;AACU;AAEhE,SAASS,IAAIA,CAAC;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAS,CAAC,EAAE;EACrE,IAAI;IAAEC,YAAY;IAAEC,eAAe;IAAEC;EAAU,CAAC,GAAGL,UAAU;EAE7D,SAASM,oBAAoBA,CAACH,YAAY,EAAE;IAC3CF,aAAa,CAAC;MAAEE;IAAa,CAAC,CAAC;EAChC;EACA,SAASI,uBAAuBA,CAACH,eAAe,EAAE;IACjDH,aAAa,CAAC;MAAEG;IAAgB,CAAC,CAAC;EACnC;EAEA,SAASI,qBAAqBA,CAACH,SAAS,EAAE;IACzCJ,aAAa,CAAC;MAAEI;IAAU,CAAC,CAAC;EAC7B;EAEA,OACCI,iEAAA,CAAAC,wDAAA,QACCD,iEAAA,CAAClB,kEAAa,QACbkB,iEAAA,CAACf,0DAAO;IAACiB,KAAK,EAAC;EAAS,GACvBF,iEAAA,CAACd,sEAAmB;IACnBiB,IAAI,EACHP,SAAS,KAAK,MAAM,GACjBT,wDAAY,GACZS,SAAS,KAAK,QAAQ,GACtBR,wDAAc,GACdC,wDACH;IACDa,KAAK,EAAC,uBAAuB;IAC7BE,QAAQ,EAAE,CACT;MACCC,KAAK,EAAE,QAAQ;MACfF,IAAI,EAAEhB,wDAAY;MAClBmB,OAAO,EAAEA,CAAA,KAAMP,qBAAqB,CAAC,MAAM;IAC5C,CAAC,EACD;MACCM,KAAK,EAAE,QAAQ;MACfF,IAAI,EAAEf,wDAAc;MACpBkB,OAAO,EAAEA,CAAA,KAAMP,qBAAqB,CAAC,QAAQ;IAC9C,CAAC,EACD;MACCM,KAAK,EAAE,QAAQ;MACfF,IAAI,EAAEd,wDAAa;MACnBiB,OAAO,EAAEA,CAAA,KAAMP,qBAAqB,CAAC,OAAO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ACA;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEnDA;UACA;UACA;UACA;UACA","sources":["webpack://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/header.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/position-center.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/position-left.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/position-right.js","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","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 { BlockControls } from \"@wordpress/block-editor\";\nimport { useBlockProps, RichText } from \"@wordpress/block-editor\";\nimport { Toolbar, ToolbarDropdownMenu } from \"@wordpress/components\";\nimport { positionLeft, positionCenter, positionRight } from \"@wordpress/icons\";\n\nexport default function Edit({ attributes, setAttributes, clientId }) {\n\tlet { sectionTitle, sectionSubtitle, textAlign } = attributes;\n\n\tfunction onChangeSectionTitle(sectionTitle) {\n\t\tsetAttributes({ sectionTitle });\n\t}\n\tfunction onChangeSectionSubtitle(sectionSubtitle) {\n\t\tsetAttributes({ sectionSubtitle });\n\t}\n\n\tfunction onChangeTextAlignment(textAlign) {\n\t\tsetAttributes({ textAlign });\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t onChangeTextAlignment(\"left\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Centré\",\n\t\t\t\t\t\t\t\ticon: positionCenter,\n\t\t\t\t\t\t\t\tonClick: () => onChangeTextAlignment(\"center\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Droite\",\n\t\t\t\t\t\t\t\ticon: positionRight,\n\t\t\t\t\t\t\t\tonClick: () => onChangeTextAlignment(\"right\"),\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\n\t\t\t\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nimport { header } from \"@wordpress/icons\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: header,\n\t\tforeground: \"#DF1E1E\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tlet { sectionTitle, sectionSubtitle, textAlign } = attributes;\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\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 header = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z\"\n}));\nexport default header;\n//# sourceMappingURL=header.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst positionCenter = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z\"\n}));\nexport default positionCenter;\n//# sourceMappingURL=position-center.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst positionLeft = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z\"\n}));\nexport default positionLeft;\n//# sourceMappingURL=position-left.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst positionRight = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z\"\n}));\nexport default positionRight;\n//# sourceMappingURL=position-right.js.map","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","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 = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmultiblocks\"] = self[\"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":["__","BlockControls","useBlockProps","RichText","Toolbar","ToolbarDropdownMenu","positionLeft","positionCenter","positionRight","Edit","attributes","setAttributes","clientId","sectionTitle","sectionSubtitle","textAlign","onChangeSectionTitle","onChangeSectionSubtitle","onChangeTextAlignment","createElement","Fragment","label","icon","controls","title","onClick","className","value","tagName","placeholder","onChange","registerBlockType","save","metadata","header","name","src","foreground","edit","Content"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAwD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A;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/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/header.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/position-center.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/position-left.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/position-right.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\",\"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 { useBlockProps } from \"@wordpress/block-editor\";\r\nimport { RichText } from \"@wordpress/block-editor\";\r\nimport { createBlock } from \"@wordpress/blocks\";\r\n\r\nconst v2 = {\r\n\tattributes: {\r\n\t\tsectionTitle: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\tsectionSubtitle: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\ttextAlign: {\r\n\t\t\ttype: \"string\",\r\n\t\t\tdefault: \"left\",\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\t\r\n\t\t\t\r\n\t\t);\r\n\t},\r\n\r\n\tmigrate(attributes, innerBlocks) {\r\n\t\tconst textAlign = attributes.textAlign;\r\n\t\treturn [\r\n\t\t\t{\r\n\t\t\t\ttextAlign: textAlign,\r\n\t\t\t},\r\n\t\t\t[\r\n\t\t\t\tcreateBlock(\"core/heading\", {\r\n\t\t\t\t\tcontent: attributes.sectionTitle,\r\n\t\t\t\t\tlevel: 3,\r\n\t\t\t\t\tclassName: \"section_titling__title\",\r\n\t\t\t\t}),\r\n\t\t\t\tcreateBlock(\"core/paragraph\", {\r\n\t\t\t\t\tcontent: attributes.sectionSubtitle,\r\n\t\t\t\t\tclassName: \"section_titling__subtitle\",\r\n\t\t\t\t}),\r\n\t\t\t],\r\n\t\t];\r\n\t},\r\n};\r\n\r\nconst v1 = {\r\n\tattributes: {\r\n\t\tsectionTitle: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\tsectionSubtitle: {\r\n\t\t\ttype: \"string\",\r\n\t\t},\r\n\t\ttextAlign: {\r\n\t\t\ttype: \"string\",\r\n\t\t\tdefault: \"left\",\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\t\r\n\t\t\t\r\n\t\t);\r\n\t},\r\n};\r\n\r\nexport default [v2, v1];\r\n","import { __ } from \"@wordpress/i18n\";\nimport \"./editor.scss\";\nimport { BlockControls } from \"@wordpress/block-editor\";\nimport { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\nimport { Toolbar, ToolbarDropdownMenu } from \"@wordpress/components\";\nimport { positionLeft, positionCenter, positionRight } from \"@wordpress/icons\";\n\nexport default function Edit({ attributes, setAttributes, clientId }) {\n\tlet { textAlign } = attributes;\n\n\tconsole.log(\"attributes\", attributes);\n\n\tfunction onChangeTextAlignment(textAlign) {\n\t\tsetAttributes({ textAlign });\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t onChangeTextAlignment(\"left\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Centré\",\n\t\t\t\t\t\t\t\ticon: positionCenter,\n\t\t\t\t\t\t\t\tonClick: () => onChangeTextAlignment(\"center\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Droite\",\n\t\t\t\t\t\t\t\ticon: positionRight,\n\t\t\t\t\t\t\t\tonClick: () => onChangeTextAlignment(\"right\"),\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\n\t\t\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport deprecated from \"./deprecated\";\nimport metadata from \"./block.json\";\n\nimport { header } from \"@wordpress/icons\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: header,\n\t\tforeground: \"#DF1E1E\",\n\t},\n\tedit: Edit,\n\tsave,\n\tdeprecated,\n});\n","import { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { sectionTitle, sectionSubtitle, textAlign } = attributes;\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\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 header = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z\"\n}));\nexport default header;\n//# sourceMappingURL=header.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst positionCenter = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z\"\n}));\nexport default positionCenter;\n//# sourceMappingURL=position-center.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst positionLeft = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z\"\n}));\nexport default positionLeft;\n//# sourceMappingURL=position-left.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst positionRight = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z\"\n}));\nexport default positionRight;\n//# sourceMappingURL=position-right.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\"][\"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":["useBlockProps","RichText","createBlock","v2","attributes","sectionTitle","type","sectionSubtitle","textAlign","default","save","createElement","className","Content","value","tagName","migrate","innerBlocks","content","level","v1","__","BlockControls","InnerBlocks","Toolbar","ToolbarDropdownMenu","positionLeft","positionCenter","positionRight","Edit","setAttributes","clientId","console","log","onChangeTextAlignment","Fragment","label","icon","controls","title","onClick","allowedBlocks","templateLock","template","placeholder","registerBlockType","deprecated","metadata","header","name","src","foreground","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/section-titling/build/style-index.css b/blocks/section-titling/build/style-index.css index 2488c9e..95046e2 100644 --- a/blocks/section-titling/build/style-index.css +++ b/blocks/section-titling/build/style-index.css @@ -1,4 +1,4 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ diff --git a/blocks/section-titling/src/_save.js b/blocks/section-titling/src/_save.js new file mode 100644 index 0000000..0dd8a5e --- /dev/null +++ b/blocks/section-titling/src/_save.js @@ -0,0 +1,24 @@ +import { useBlockProps, RichText } from "@wordpress/block-editor"; + +export default function save({ attributes }) { + let { sectionTitle, sectionSubtitle, textAlign } = attributes; + + return ( +
+ + +
+ ); +} diff --git a/blocks/section-titling/src/block.json b/blocks/section-titling/src/block.json index cf21da2..52b0dd6 100644 --- a/blocks/section-titling/src/block.json +++ b/blocks/section-titling/src/block.json @@ -14,12 +14,6 @@ "editorStyle": "file:./index.css", "style": "file:./style-index.css", "attributes": { - "sectionTitle": { - "type": "string" - }, - "sectionSubtitle": { - "type": "string" - }, "textAlign": { "type": "string", "default": "left" diff --git a/blocks/section-titling/src/deprecated.js b/blocks/section-titling/src/deprecated.js new file mode 100644 index 0000000..9b8ce9e --- /dev/null +++ b/blocks/section-titling/src/deprecated.js @@ -0,0 +1,97 @@ +import { useBlockProps } from "@wordpress/block-editor"; +import { RichText } from "@wordpress/block-editor"; +import { createBlock } from "@wordpress/blocks"; + +const v2 = { + attributes: { + sectionTitle: { + type: "string", + }, + sectionSubtitle: { + type: "string", + }, + textAlign: { + type: "string", + default: "left", + }, + }, + + save({ attributes }) { + return ( +
+ + +
+ ); + }, + + migrate(attributes, innerBlocks) { + const textAlign = attributes.textAlign; + return [ + { + textAlign: textAlign, + }, + [ + createBlock("core/heading", { + content: attributes.sectionTitle, + level: 3, + className: "section_titling__title", + }), + createBlock("core/paragraph", { + content: attributes.sectionSubtitle, + className: "section_titling__subtitle", + }), + ], + ]; + }, +}; + +const v1 = { + attributes: { + sectionTitle: { + type: "string", + }, + sectionSubtitle: { + type: "string", + }, + textAlign: { + type: "string", + default: "left", + }, + }, + + save({ attributes }) { + return ( +
+ + +
+ ); + }, +}; + +export default [v2, v1]; diff --git a/blocks/section-titling/src/edit.js b/blocks/section-titling/src/edit.js index 6e826f5..2647716 100644 --- a/blocks/section-titling/src/edit.js +++ b/blocks/section-titling/src/edit.js @@ -1,19 +1,14 @@ import { __ } from "@wordpress/i18n"; import "./editor.scss"; import { BlockControls } from "@wordpress/block-editor"; -import { useBlockProps, RichText } from "@wordpress/block-editor"; +import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor"; import { Toolbar, ToolbarDropdownMenu } from "@wordpress/components"; import { positionLeft, positionCenter, positionRight } from "@wordpress/icons"; export default function Edit({ attributes, setAttributes, clientId }) { - let { sectionTitle, sectionSubtitle, textAlign } = attributes; + let { textAlign } = attributes; - function onChangeSectionTitle(sectionTitle) { - setAttributes({ sectionTitle }); - } - function onChangeSectionSubtitle(sectionSubtitle) { - setAttributes({ sectionSubtitle }); - } + console.log("attributes", attributes); function onChangeTextAlignment(textAlign) { setAttributes({ textAlign }); @@ -57,22 +52,20 @@ export default function Edit({ attributes, setAttributes, clientId }) { className: `section_titling section_titling--${textAlign}`, })} > - - diff --git a/blocks/section-titling/src/index.js b/blocks/section-titling/src/index.js index 0e6d232..40643a6 100644 --- a/blocks/section-titling/src/index.js +++ b/blocks/section-titling/src/index.js @@ -3,6 +3,7 @@ import "./style.scss"; import Edit from "./edit"; import save from "./save"; +import deprecated from "./deprecated"; import metadata from "./block.json"; import { header } from "@wordpress/icons"; @@ -14,4 +15,5 @@ registerBlockType(metadata.name, { }, edit: Edit, save, + deprecated, }); diff --git a/blocks/section-titling/src/save.js b/blocks/section-titling/src/save.js index e1da377..dd7670c 100644 --- a/blocks/section-titling/src/save.js +++ b/blocks/section-titling/src/save.js @@ -1,7 +1,7 @@ -import { useBlockProps, RichText } from "@wordpress/block-editor"; +import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor"; export default function save({ attributes }) { - let { sectionTitle, sectionSubtitle, textAlign } = attributes; + const { sectionTitle, sectionSubtitle, textAlign } = attributes; return (
- - +
); }