From 3e61f480185cce2a25f089238bbdd5fd0611c1f5 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 4 Jun 2025 10:02:29 +0200 Subject: [PATCH] FEATURE Handling background color option --- .../blocks/chapter-section/build/block.json | 16 ++- .../chapter-section/build/index.asset.php | 2 +- .../blocks/chapter-section/build/index.js | 97 ++++++++++++++++--- .../blocks/chapter-section/build/index.js.map | 2 +- .../blocks/chapter-section/src/block.json | 16 ++- .../chapter-section/src/carhop-bg-shape.svg | 3 + .../blocks/chapter-section/src/edit.js | 79 ++++++++++++++- .../blocks/chapter-section/src/index.js | 2 +- .../blocks/chapter-section/src/save.js | 28 +++++- 9 files changed, 222 insertions(+), 23 deletions(-) create mode 100644 plugins/carhop-blocks/blocks/chapter-section/src/carhop-bg-shape.svg diff --git a/plugins/carhop-blocks/blocks/chapter-section/build/block.json b/plugins/carhop-blocks/blocks/chapter-section/build/block.json index 8adca08..0ed374a 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/build/block.json +++ b/plugins/carhop-blocks/blocks/chapter-section/build/block.json @@ -49,9 +49,21 @@ "right" ] }, - "color": { + "hasBackgroundColor": { + "type": "boolean", + "default": false + }, + "backgroundColor": { "type": "string", - "default": "#000000" + "default": "#ffffff" + }, + "backgroundOrientation": { + "type": "string", + "default": "left", + "enum": [ + "left", + "right" + ] } }, "usesContext": [ diff --git a/plugins/carhop-blocks/blocks/chapter-section/build/index.asset.php b/plugins/carhop-blocks/blocks/chapter-section/build/index.asset.php index 1d53d9b..f74cd22 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/build/index.asset.php +++ b/plugins/carhop-blocks/blocks/chapter-section/build/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '59e357af59e9ca48848d'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '4d7a8310574bcf753578'); diff --git a/plugins/carhop-blocks/blocks/chapter-section/build/index.js b/plugins/carhop-blocks/blocks/chapter-section/build/index.js index 7f56b5b..28b005d 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/build/index.js +++ b/plugins/carhop-blocks/blocks/chapter-section/build/index.js @@ -41,7 +41,7 @@ const trash = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx \************************/ /***/ ((module) => { -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/chapter-section","version":"0.1.0","title":" Section Chapitre","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"deliblocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"align":{"type":"string","default":"full"},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"coverId":{"type":"number"},"coverSize":{"type":"string","default":"large","enum":["small","medium","grande","large"]},"disposition":{"type":"string","default":"left","enum":["left","right"]},"color":{"type":"string","default":"#000000"}},"usesContext":["postType","postId"]}'); +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/chapter-section","version":"0.1.0","title":" Section Chapitre","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"deliblocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"align":{"type":"string","default":"full"},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"coverId":{"type":"number"},"coverSize":{"type":"string","default":"large","enum":["small","medium","grande","large"]},"disposition":{"type":"string","default":"left","enum":["left","right"]},"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#ffffff"},"backgroundOrientation":{"type":"string","default":"left","enum":["left","right"]}},"usesContext":["postType","postId"]}'); /***/ }), @@ -71,17 +71,22 @@ __webpack_require__.r(__webpack_exports__); + function Edit({ attributes, setAttributes, ...props }) { + const colors = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useSetting)("color.palette.theme"); const { disposition, coverUrl, coverAlt, coverId, - coverSize + coverSize, + hasBackgroundColor, + backgroundColor, + backgroundOrientation } = attributes; function onDispositionChange(disposition) { setAttributes({ @@ -107,9 +112,29 @@ function Edit({ coverUrl: null }); } + function onBackgroundColorChange(value) { + setAttributes({ + backgroundColor: value + }); + } + function onHasBackgroundColorChange(value) { + setAttributes({ + hasBackgroundColor: value + }); + if (!value) { + setAttributes({ + backgroundColor: null + }); + } + } + function onBackgroundOrientationChange(value) { + setAttributes({ + backgroundOrientation: value + }); + } return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { className: "deligraph-blocks-components-image__panel-body", title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Image d'accompagnement", "deligraph-blocks"), children: [coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", { @@ -166,12 +191,49 @@ function Edit({ value: "small" })] })] - }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { + className: "deligraph-blocks-components-image__panel-body", + title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Arrière plan", "deligraph-blocks"), + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, { + label: "Arri\xE8re plan color\xE9", + checked: hasBackgroundColor, + onChange: onHasBackgroundColorChange + }), hasBackgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { + colors: colors, + value: backgroundColor, + onChange: onBackgroundColorChange + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, { + className: "deligraph-blocks__variant", + isBlock: true, + label: "Disposition", + onChange: onBackgroundOrientationChange, + value: backgroundOrientation, + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { + label: "Gauche", + value: "left" + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { + label: "Droite", + value: "right" + })] + })] + })] + })] }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", { ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ - className: `deligraph-blocks-chapter-section chapter-section chapter-section--${disposition} alignfull` + className: `deligraph-blocks-chapter-section chapter-section chapter-section--${disposition} ${hasBackgroundColor && backgroundColor ? "chapter-section--has-background" : ""}` }), - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + children: [hasBackgroundColor && backgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("svg", { + className: `chapter-section__background chapter-section__background--${backgroundOrientation}`, + width: "1302", + height: "654", + viewBox: "0 0 1302 654", + preserveAspectRatio: "none", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", { + d: "M1302 0L0 15.8281V654L1302 642.633L1302 0Z", + fill: backgroundColor + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { className: "chapter-section__content", children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { className: "chapter-section__innerblocks", @@ -247,7 +309,7 @@ __webpack_require__.r(__webpack_exports__); d: "M21,7H3V4A1,1,0,0,1,4,3H20a1,1,0,0,1,1,1ZM3,20V9H21V20a1,1,0,0,1-1,1H4A1,1,0,0,1,3,20Zm3-6H18V12H6Zm0,4h6V16H6Z" }) }), - foreground: "#723d46" + foreground: "#136f63" }, edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] @@ -278,13 +340,26 @@ function save({ disposition, coverUrl, coverAlt, - coverSize + coverSize, + backgroundColor, + hasBackgroundColor, + backgroundOrientation } = attributes; return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("section", { ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({ - className: `deligraph-blocks-chapter-section chapter-section chapter-section--${disposition} ` + className: `deligraph-blocks-chapter-section chapter-section chapter-section--${disposition} ${backgroundColor ? "chapter-section--has-background" : ""}` }), - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { + children: [hasBackgroundColor && backgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", { + className: `chapter-section__background chapter-section__background--${backgroundOrientation}`, + width: "1302", + height: "654", + viewBox: "0 0 1302 654", + preserveAspectRatio: "none", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", { + d: "M1302 0L0 15.8281V654L1302 642.633L1302 0Z", + fill: backgroundColor + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { className: "chapter-section__content", children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { className: "chapter-section__innerblocks", diff --git a/plugins/carhop-blocks/blocks/chapter-section/build/index.js.map b/plugins/carhop-blocks/blocks/chapter-section/build/index.js.map index 55b0d68..9d0e3de 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/build/index.js.map +++ b/plugins/carhop-blocks/blocks/chapter-section/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,2BAA2B,sDAAI,CAAC,sDAAG;AACnC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD,iEAAe,KAAK,EAAC;AACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACfqC;AAOJ;AACc;AAOhB;AAER;AAAA;AACR,SAASoB,IAAIA,CAAC;EAAEC,UAAU;EAAEC,aAAa;EAAE,GAAGC;AAAM,C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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://portfolio-header/./node_modules/.pnpm/@wordpress+icons@10.19.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/trash.js","webpack://portfolio-header/./src/edit.js","webpack://portfolio-header/./src/editor.scss","webpack://portfolio-header/./src/index.js","webpack://portfolio-header/./src/save.js","webpack://portfolio-header/./src/style.scss","webpack://portfolio-header/external window [\"wp\",\"blockEditor\"]","webpack://portfolio-header/external window [\"wp\",\"blocks\"]","webpack://portfolio-header/external window [\"wp\",\"components\"]","webpack://portfolio-header/external window [\"wp\",\"i18n\"]","webpack://portfolio-header/external window [\"wp\",\"primitives\"]","webpack://portfolio-header/external window \"ReactJSXRuntime\"","webpack://portfolio-header/webpack/bootstrap","webpack://portfolio-header/webpack/runtime/chunk loaded","webpack://portfolio-header/webpack/runtime/compat get default export","webpack://portfolio-header/webpack/runtime/define property getters","webpack://portfolio-header/webpack/runtime/hasOwnProperty shorthand","webpack://portfolio-header/webpack/runtime/make namespace object","webpack://portfolio-header/webpack/runtime/jsonp chunk loading","webpack://portfolio-header/webpack/before-startup","webpack://portfolio-header/webpack/startup","webpack://portfolio-header/webpack/after-startup"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst trash = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z\"\n })\n});\nexport default trash;\n//# sourceMappingURL=trash.js.map","import { __ } from \"@wordpress/i18n\";\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tMediaReplaceFlow,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\nimport { lock, trash } from \"@wordpress/icons\";\n\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n} from \"@wordpress/components\";\n\nimport \"./editor.scss\";\nexport default function Edit({ attributes, setAttributes, ...props }) {\n\tconst { disposition, coverUrl, coverAlt, coverId, coverSize } = attributes;\n\tfunction onDispositionChange(disposition) {\n\t\tsetAttributes({ disposition });\n\t}\n\tfunction onCoverSizeChange(coverSize) {\n\t\tsetAttributes({ coverSize });\n\t}\n\n\tfunction setCoverAttributes(cover) {\n\t\tsetAttributes({\n\t\t\tcoverId: cover.id,\n\t\t\tcoverAlt: cover.alt,\n\t\t\tcoverUrl: cover.url,\n\t\t});\n\t}\n\tfunction removeCoverAttributes() {\n\t\tsetAttributes({\n\t\t\tcoverId: null,\n\t\t\tcoverAlt: null,\n\t\t\tcoverUrl: null,\n\t\t});\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{coverUrl && {coverAlt}}\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t{coverUrl && (\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\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\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\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\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{coverUrl && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{!coverUrl && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#723d46\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\nexport default function save({ attributes }) {\n\tconst { disposition, coverUrl, coverAlt, coverSize } = attributes;\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
\n\t\t\t
\n\t\t\t{coverUrl && (\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"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[\"webpackChunkportfolio_header\"] = globalThis[\"webpackChunkportfolio_header\"] || [];\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":["__","InnerBlocks","useBlockProps","InspectorControls","MediaReplaceFlow","MediaPlaceholder","lock","trash","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","setAttributes","props","disposition","coverUrl","coverAlt","coverId","coverSize","onDispositionChange","onCoverSizeChange","setCoverAttributes","cover","id","alt","url","removeCoverAttributes","children","className","title","src","mediaId","mediaUrl","allowedTypes","accept","onSelect","name","variant","icon","label","onClick","isBlock","onChange","value","template","placeholder","content","allowedBlocks","multiple","handleUpload","registerBlockType","save","metadata","xmlns","viewBox","d","foreground","edit","RichText","Content"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,2BAA2B,sDAAI,CAAC,sDAAG;AACnC;A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AK;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://portfolio-header/./node_modules/.pnpm/@wordpress+icons@10.19.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/trash.js","webpack://portfolio-header/./src/edit.js","webpack://portfolio-header/./src/editor.scss","webpack://portfolio-header/./src/index.js","webpack://portfolio-header/./src/save.js","webpack://portfolio-header/./src/style.scss","webpack://portfolio-header/external window [\"wp\",\"blockEditor\"]","webpack://portfolio-header/external window [\"wp\",\"blocks\"]","webpack://portfolio-header/external window [\"wp\",\"components\"]","webpack://portfolio-header/external window [\"wp\",\"i18n\"]","webpack://portfolio-header/external window [\"wp\",\"primitives\"]","webpack://portfolio-header/external window \"ReactJSXRuntime\"","webpack://portfolio-header/webpack/bootstrap","webpack://portfolio-header/webpack/runtime/chunk loaded","webpack://portfolio-header/webpack/runtime/compat get default export","webpack://portfolio-header/webpack/runtime/define property getters","webpack://portfolio-header/webpack/runtime/hasOwnProperty shorthand","webpack://portfolio-header/webpack/runtime/make namespace object","webpack://portfolio-header/webpack/runtime/jsonp chunk loading","webpack://portfolio-header/webpack/before-startup","webpack://portfolio-header/webpack/startup","webpack://portfolio-header/webpack/after-startup"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst trash = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z\"\n })\n});\nexport default trash;\n//# sourceMappingURL=trash.js.map","import { __ } from \"@wordpress/i18n\";\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tMediaReplaceFlow,\n\tMediaPlaceholder,\n\tuseSetting,\n} from \"@wordpress/block-editor\";\nimport { lock, trash } from \"@wordpress/icons\";\nimport { ColorPalette } from \"@wordpress/components\";\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n\tCheckboxControl,\n} from \"@wordpress/components\";\n\nimport \"./editor.scss\";\nexport default function Edit({ attributes, setAttributes, ...props }) {\n\tconst colors = useSetting(\"color.palette.theme\");\n\tconst {\n\t\tdisposition,\n\t\tcoverUrl,\n\t\tcoverAlt,\n\t\tcoverId,\n\t\tcoverSize,\n\t\thasBackgroundColor,\n\t\tbackgroundColor,\n\t\tbackgroundOrientation,\n\t} = attributes;\n\n\tfunction onDispositionChange(disposition) {\n\t\tsetAttributes({ disposition });\n\t}\n\tfunction onCoverSizeChange(coverSize) {\n\t\tsetAttributes({ coverSize });\n\t}\n\n\tfunction setCoverAttributes(cover) {\n\t\tsetAttributes({\n\t\t\tcoverId: cover.id,\n\t\t\tcoverAlt: cover.alt,\n\t\t\tcoverUrl: cover.url,\n\t\t});\n\t}\n\tfunction removeCoverAttributes() {\n\t\tsetAttributes({\n\t\t\tcoverId: null,\n\t\t\tcoverAlt: null,\n\t\t\tcoverUrl: null,\n\t\t});\n\t}\n\tfunction onBackgroundColorChange(value) {\n\t\tsetAttributes({ backgroundColor: value });\n\t}\n\tfunction onHasBackgroundColorChange(value) {\n\t\tsetAttributes({ hasBackgroundColor: value });\n\t\tif (!value) {\n\t\t\tsetAttributes({ backgroundColor: null });\n\t\t}\n\t}\n\n\tfunction onBackgroundOrientationChange(value) {\n\t\tsetAttributes({ backgroundOrientation: value });\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{coverUrl && {coverAlt}}\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t{coverUrl && (\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\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\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\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{hasBackgroundColor && (\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\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\t{hasBackgroundColor && backgroundColor && (\n\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\t
\n\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\t{coverUrl && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t{!coverUrl && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t\tforeground: \"#136f63\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText, InnerBlocks } from \"@wordpress/block-editor\";\nexport default function save({ attributes }) {\n\tconst {\n\t\tdisposition,\n\t\tcoverUrl,\n\t\tcoverAlt,\n\t\tcoverSize,\n\t\tbackgroundColor,\n\t\thasBackgroundColor,\n\t\tbackgroundOrientation,\n\t} = attributes;\n\treturn (\n\t\t\n\t\t\t{hasBackgroundColor && backgroundColor && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t{coverUrl && (\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"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[\"webpackChunkportfolio_header\"] = globalThis[\"webpackChunkportfolio_header\"] || [];\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":["__","InnerBlocks","useBlockProps","InspectorControls","MediaReplaceFlow","MediaPlaceholder","useSetting","lock","trash","ColorPalette","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","CheckboxControl","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","setAttributes","props","colors","disposition","coverUrl","coverAlt","coverId","coverSize","hasBackgroundColor","backgroundColor","backgroundOrientation","onDispositionChange","onCoverSizeChange","setCoverAttributes","cover","id","alt","url","removeCoverAttributes","onBackgroundColorChange","value","onHasBackgroundColorChange","onBackgroundOrientationChange","children","className","title","src","mediaId","mediaUrl","allowedTypes","accept","onSelect","name","variant","icon","label","onClick","isBlock","onChange","checked","width","height","viewBox","preserveAspectRatio","d","fill","template","placeholder","content","allowedBlocks","multiple","handleUpload","registerBlockType","save","metadata","xmlns","foreground","edit","RichText","Content"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/blocks/chapter-section/src/block.json b/plugins/carhop-blocks/blocks/chapter-section/src/block.json index a1a6997..6c16667 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/src/block.json +++ b/plugins/carhop-blocks/blocks/chapter-section/src/block.json @@ -49,9 +49,21 @@ "right" ] }, - "color": { + "hasBackgroundColor": { + "type": "boolean", + "default": false + }, + "backgroundColor": { "type": "string", - "default": "#000000" + "default": "#ffffff" + }, + "backgroundOrientation": { + "type": "string", + "default": "left", + "enum": [ + "left", + "right" + ] } }, "usesContext": [ diff --git a/plugins/carhop-blocks/blocks/chapter-section/src/carhop-bg-shape.svg b/plugins/carhop-blocks/blocks/chapter-section/src/carhop-bg-shape.svg new file mode 100644 index 0000000..14bcb67 --- /dev/null +++ b/plugins/carhop-blocks/blocks/chapter-section/src/carhop-bg-shape.svg @@ -0,0 +1,3 @@ + + + diff --git a/plugins/carhop-blocks/blocks/chapter-section/src/edit.js b/plugins/carhop-blocks/blocks/chapter-section/src/edit.js index 424ca09..f0760f5 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/src/edit.js +++ b/plugins/carhop-blocks/blocks/chapter-section/src/edit.js @@ -5,19 +5,32 @@ import { InspectorControls, MediaReplaceFlow, MediaPlaceholder, + useSetting, } from "@wordpress/block-editor"; import { lock, trash } from "@wordpress/icons"; - +import { ColorPalette } from "@wordpress/components"; import { PanelBody, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, Button, + CheckboxControl, } from "@wordpress/components"; import "./editor.scss"; export default function Edit({ attributes, setAttributes, ...props }) { - const { disposition, coverUrl, coverAlt, coverId, coverSize } = attributes; + const colors = useSetting("color.palette.theme"); + const { + disposition, + coverUrl, + coverAlt, + coverId, + coverSize, + hasBackgroundColor, + backgroundColor, + backgroundOrientation, + } = attributes; + function onDispositionChange(disposition) { setAttributes({ disposition }); } @@ -39,6 +52,19 @@ export default function Edit({ attributes, setAttributes, ...props }) { coverUrl: null, }); } + function onBackgroundColorChange(value) { + setAttributes({ backgroundColor: value }); + } + function onHasBackgroundColorChange(value) { + setAttributes({ hasBackgroundColor: value }); + if (!value) { + setAttributes({ backgroundColor: null }); + } + } + + function onBackgroundOrientationChange(value) { + setAttributes({ backgroundOrientation: value }); + } return ( <> @@ -96,12 +122,59 @@ export default function Edit({ attributes, setAttributes, ...props }) { + + + {hasBackgroundColor && ( + <> + + + + + + + )} +
+ {hasBackgroundColor && backgroundColor && ( + + + + )}
), - foreground: "#723d46", + foreground: "#136f63", }, edit: Edit, save, diff --git a/plugins/carhop-blocks/blocks/chapter-section/src/save.js b/plugins/carhop-blocks/blocks/chapter-section/src/save.js index cec6361..3fb4391 100644 --- a/plugins/carhop-blocks/blocks/chapter-section/src/save.js +++ b/plugins/carhop-blocks/blocks/chapter-section/src/save.js @@ -1,12 +1,36 @@ import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor"; export default function save({ attributes }) { - const { disposition, coverUrl, coverAlt, coverSize } = attributes; + const { + disposition, + coverUrl, + coverAlt, + coverSize, + backgroundColor, + hasBackgroundColor, + backgroundOrientation, + } = attributes; return (
+ {hasBackgroundColor && backgroundColor && ( + + + + )}