diff --git a/plugins/carhop-blocks/build/content-box/block.json b/plugins/carhop-blocks/build/content-box/block.json index 685b1d1..a62e91c 100644 --- a/plugins/carhop-blocks/build/content-box/block.json +++ b/plugins/carhop-blocks/build/content-box/block.json @@ -44,7 +44,13 @@ }, "blockVariant": { "type": "string", - "default": "framed" + "default": "backgrounded", + "enum": [ + "nude", + "framed", + "framed-backgrounded", + "backgrounded" + ] }, "shapeType": { "type": "string", diff --git a/plugins/carhop-blocks/build/content-box/index-rtl.css b/plugins/carhop-blocks/build/content-box/index-rtl.css index 9831c23..c3e34e8 100644 --- a/plugins/carhop-blocks/build/content-box/index-rtl.css +++ b/plugins/carhop-blocks/build/content-box/index-rtl.css @@ -1,6 +1,22 @@ /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/content-box/editor.scss ***! \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.content-box { + padding-right: 2.5rem !important; + padding-left: 2.5rem !important; +} .content-box a { color: var(--content-box-text-color) !important; } +.editor-styles-wrapper .deligraph-blocks-chapter-section { + padding-right: 2.5rem !important; + padding-left: 2.5rem !important; +} +.content-box .wp-block-columns { + margin-top: 0 !important; + margin-bottom: 0 !important; +} +.content-box .block-editor-block-list__layout > .wp-block-columns { + margin-top: 0 !important; + margin-bottom: 0 !important; +} diff --git a/plugins/carhop-blocks/build/content-box/index.asset.php b/plugins/carhop-blocks/build/content-box/index.asset.php index 4178b4b..68ca378 100644 --- a/plugins/carhop-blocks/build/content-box/index.asset.php +++ b/plugins/carhop-blocks/build/content-box/index.asset.php @@ -1 +1 @@ - array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '1e2c2d08d328ea46924d'); + array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '4627138f4496bef9907c'); diff --git a/plugins/carhop-blocks/build/content-box/index.css b/plugins/carhop-blocks/build/content-box/index.css index 5c9aeb0..7e5c2ec 100644 --- a/plugins/carhop-blocks/build/content-box/index.css +++ b/plugins/carhop-blocks/build/content-box/index.css @@ -1,8 +1 @@ -/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/content-box/editor.scss ***! - \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -.content-box a { - color: var(--content-box-text-color) !important; -} - -/*# sourceMappingURL=index.css.map*/ \ No newline at end of file +.content-box{padding-left:2.5rem!important;padding-right:2.5rem!important}.content-box a{color:var(--content-box-text-color)!important}.editor-styles-wrapper .deligraph-blocks-chapter-section{padding-left:2.5rem!important;padding-right:2.5rem!important}.content-box .block-editor-block-list__layout>.wp-block-columns,.content-box .wp-block-columns{margin-bottom:0!important;margin-top:0!important} diff --git a/plugins/carhop-blocks/build/content-box/index.css.map b/plugins/carhop-blocks/build/content-box/index.css.map deleted file mode 100644 index 135e5b2..0000000 --- a/plugins/carhop-blocks/build/content-box/index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-box/index.css","mappings":";;;AACC;EACC;AAAF,C","sources":["webpack://carhop-blocks/./src/content-box/editor.scss"],"sourcesContent":[".content-box {\n\ta {\n\t\tcolor: var(--content-box-text-color) !important;\n\t}\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/build/content-box/index.js b/plugins/carhop-blocks/build/content-box/index.js index 4904923..f381801 100644 --- a/plugins/carhop-blocks/build/content-box/index.js +++ b/plugins/carhop-blocks/build/content-box/index.js @@ -1,862 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./_utilities/utilities.js": -/*!*********************************!*\ - !*** ./_utilities/utilities.js ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ isColorLight: () => (/* binding */ isColorLight) -/* harmony export */ }); -// Fonction pour déterminer si une couleur est claire ou sombre -function isColorLight(color) { - // Si pas de couleur, considérer comme claire - if (!color) return true; - - // Convertir hex en RGB - let hex = color.replace("#", ""); - if (hex.length === 3) { - hex = hex.split("").map(char => char + char).join(""); - } - const r = parseInt(hex.substr(0, 2), 16); - const g = parseInt(hex.substr(2, 2), 16); - const b = parseInt(hex.substr(4, 2), 16); - - // Calculer la luminance relative (formule standard) - const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255; - - // Si luminance > 0.5, la couleur est claire - return luminance > 0.5; -} - -/***/ }), - -/***/ "./src/content-box/block.json": -/*!************************************!*\ - !*** ./src/content-box/block.json ***! - \************************************/ -/***/ ((module) => { - -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Boite de contenu","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true,"align":["wide","full"]},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#f1fcf9"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"inherit"},"borderColor":{"type":"string","default":null},"blockVariant":{"type":"string","default":"framed"},"shapeType":{"type":"string","default":"straight","enum":["straight","shapeA","shapeB","shapeC"]},"blockWidth":{"type":"string","default":"full","enum":["contained","wide","full"]}}}'); - -/***/ }), - -/***/ "./src/content-box/edit.js": -/*!*********************************!*\ - !*** ./src/content-box/edit.js ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Edit) -/* harmony export */ }); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__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__); -/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/content-box/editor.scss"); -/* harmony import */ var _utilities_utilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../_utilities/utilities */ "./_utilities/utilities.js"); -/* harmony import */ var _shapeA_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shapeA.jsx */ "./src/content-box/shapeA.jsx"); -/* harmony import */ var _shapeB_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shapeB.jsx */ "./src/content-box/shapeB.jsx"); -/* harmony import */ var _shapeC_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./shapeC.jsx */ "./src/content-box/shapeC.jsx"); -/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utilities */ "./src/content-box/utilities.js"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__); - - - - - - - - - - - - -function Edit({ - attributes, - setAttributes, - ...props -}) { - const colors = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useSetting)("color.palette.theme"); - const { - hasBackgroundColor, - backgroundColor, - textColor, - hasLightBackground, - blockVariant, - blockWidth, - shapeType, - borderColor - } = attributes; - - // Détecter le type de post actuel - const postType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { - return select("core/editor").getCurrentPostType(); - }, []); - const filteredBgColors = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.filterBgColors)(colors, postType); - const filteredTextColors = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.filterTextColors)(colors, postType, backgroundColor); - function onBackgroundColorChange(value) { - if (value === undefined) { - setAttributes({ - hasBackgroundColor: false - }); - setAttributes({ - backgroundColor: "transparent" - }); - } - const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_5__.isColorLight)(value); - setAttributes({ - hasLightBackground: isLightBackgroundColor - }); - setAttributes({ - backgroundColor: value - }); - if (!isLightBackgroundColor) { - setAttributes({ - textColor: "#fff" - }); - } else { - setAttributes({ - textColor: "inherit" - }); - } - } - function onHasBackgroundColorChange(value) { - setAttributes({ - hasBackgroundColor: value - }); - if (!value) { - setAttributes({ - backgroundColor: null - }); - } - } - function onTextColorChange(value) { - setAttributes({ - textColor: value - }); - } - function onBlockVariantChange(value) { - setAttributes({ - blockVariant: value - }); - if (value === "framed" || value === "nude") { - setAttributes({ - backgroundColor: "#fff" - }); - setAttributes({ - hasLightBackground: true - }); - } - } - console.log(shapeType); - console.log(blockVariant); - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { - title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Aspect", "carhop-blocks"), - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, { - label: "Mod\xE8le de bloc", - value: blockVariant, - onChange: onBlockVariantChange, - isBlock: true, - __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "nude", - label: "Nu" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "framed", - label: "Encadr\xE9" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "backgrounded", - label: "Fond color\xE9" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "framed-backgrounded", - label: "Cadre + fond color\xE9" - })] - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, { - label: "Largeur du bloc", - value: blockWidth, - onChange: value => setAttributes({ - blockWidth: value - }), - isBlock: true, - __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "contained", - label: "Contenue" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "wide", - label: "Large" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - value: "full", - label: "Pleine largeur" - })] - })] - }), (blockVariant === "backgrounded" || blockVariant === "framed-backgrounded") && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.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_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, { - className: "deligraph-blocks__variant", - isBlock: true, - label: "Type de forme", - onChange: value => setAttributes({ - shapeType: value - }), - value: shapeType, - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - label: "Droite", - value: "straight" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - label: "Forme A", - value: "shapeA" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - label: "Forme B", - value: "shapeB" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, { - label: "Forme C", - value: "shapeC" - })] - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { - __next40pxDefaultSize: true, - label: "Type de forme", - onChange: value => setAttributes({ - shapeType: value - }), - value: shapeType, - options: [{ - disabled: true, - label: "Type de forme", - value: "" - }, { - label: "Droite", - value: "straight" - }, { - label: "Forme A", - value: "shapeA" - }, { - label: "Forme B", - value: "shapeB" - }, { - label: "Forme C", - value: "shapeC" - }] - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { - colors: filteredBgColors, - value: backgroundColor, - onChange: onBackgroundColorChange - })] - }), (blockVariant === "backgrounded" || blockVariant === "framed-backgrounded") && postType !== "articles" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { - className: "deligraph-blocks-components-image__panel-body", - title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Couleur du texte", "deligraph-blocks"), - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { - colors: filteredTextColors, - value: textColor, - onChange: onTextColorChange - }) - })] - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("section", { - ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ - className: `${postType !== "articles" && "alignfull"} content-box content-box--variant-${blockVariant} content-box--${shapeType} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"} - ${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`, - style: { - "--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit", - "--content-box-background-color": blockVariant === "backgrounded" || blockVariant === "framed-backgrounded" ? backgroundColor : "transparent" - } - }), - children: [blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { - backgroundColor: backgroundColor, - borderColor: "none" - }), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { - backgroundColor: backgroundColor, - borderColor: "none" - }), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { - backgroundColor: backgroundColor, - borderColor: "none" - }), blockVariant === "framed" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], { - backgroundColor: "none", - borderColor: borderColor - }), blockVariant === "framed" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], { - backgroundColor: "none", - borderColor: borderColor - }), blockVariant === "framed" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], { - backgroundColor: "none", - borderColor: borderColor - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { - className: "content-box__innerblocks", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, { - template: [["core/paragraph", { - placeholder: "Ajouter ici le texte" - }]], - allowedBlocks: ["core/heading", "core/paragraph", "core/group", "core/list", "core/button", "core/image", "core/buttons", "core/columns", "core/file", "core/post-title", "core/embed", "core/quote", "core/pullquote", "core/media-text", "core/table", "carhop-blocks/chapter-section", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "carhop-blocks/scroll-story-block", "carhop-blocks/cta", "carhop-blocks/cta-group", "carhop-blocks/audio-player", "carhop-blocks/content-box", "carhop-blocks/localisation-map", "carhop-blocks/notice-panel", "carhop-blocks/story-timeline", "carhop-blocks/highlight-timeline", "acf/statistics-datas", "ninja-forms/form", "gravityforms/form", "dynamiques-blocks/sitemap", "mailpoet/subscription-form-block", "shortcode"] - }) - })] - })] - }); -} - -/***/ }), - -/***/ "./src/content-box/editor.scss": -/*!*************************************!*\ - !*** ./src/content-box/editor.scss ***! - \*************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "./src/content-box/index.js": -/*!**********************************!*\ - !*** ./src/content-box/index.js ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/content-box/style.scss"); -/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/content-box/edit.js"); -/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/content-box/save.js"); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/content-box/block.json"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__); - - - - - - -(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { - icon: { - foreground: "#136f63", - src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("svg", { - width: "40", - height: "40", - viewBox: "0 0 100 100", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("g", { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", { - d: "m50,99.84988l-43.14852,-24.92494l0,-49.84988l43.14852,-24.92494l43.14852,24.92494l0,49.84988l-43.14852,24.92494zm-40.75518,-26.32675l40.75518,23.52312l40.75518,-23.52312l0,-47.04625l-40.75518,-23.55731l-40.75518,23.55731l0,47.04625z" - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", { - d: "m50,86.13945l-31.28439,-18.05263l0,-36.13945l31.28439,-18.05263l31.28439,18.05263l0,36.13945l-31.28439,18.05263zm-13.50528,-28.344l13.50528,7.79545l13.50528,-7.79545l0,-15.59091l-13.50528,-7.79545l-13.50528,7.79545l0,15.59091z" - })] - }) - }) - }, - edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], - save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] -}); - -/***/ }), - -/***/ "./src/content-box/save.js": -/*!*********************************!*\ - !*** ./src/content-box/save.js ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ save) -/* harmony export */ }); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _shapeA_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shapeA.jsx */ "./src/content-box/shapeA.jsx"); -/* harmony import */ var _shapeB_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shapeB.jsx */ "./src/content-box/shapeB.jsx"); -/* harmony import */ var _shapeC_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapeC.jsx */ "./src/content-box/shapeC.jsx"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); - - - - - -function save({ - attributes -}) { - const { - backgroundColor, - textColor, - hasLightBackground, - hasBackgroundColor, - blockVariant, - blockWidth, - shapeType, - borderColor - } = attributes; - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", { - ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({ - className: `content-box content-box--variant-${blockVariant} content-box--${shapeType} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"} - ${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`, - style: { - "--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit", - "--content-box-background-color": blockVariant === "backgrounded" || blockVariant === "framed-backgrounded" ? backgroundColor : "transparent" - } - }), - children: [blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], { - backgroundColor: backgroundColor, - borderColor: "none" - }), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { - backgroundColor: backgroundColor, - borderColor: "none" - }), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { - backgroundColor: backgroundColor, - borderColor: "none" - }), blockVariant === "framed" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], { - backgroundColor: "none", - borderColor: borderColor - }), blockVariant === "framed" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], { - backgroundColor: "none", - borderColor: borderColor - }), blockVariant === "framed" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], { - backgroundColor: "none", - borderColor: borderColor - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { - className: "content-box__innerblocks", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {}) - })] - }); -} - -/***/ }), - -/***/ "./src/content-box/shapeA.jsx": -/*!************************************!*\ - !*** ./src/content-box/shapeA.jsx ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ShapeA) -/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); - - -function ShapeA({ - backgroundOrientation, - backgroundColor, - borderColor -}) { - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", { - width: "1440", - height: "744", - viewBox: "0 0 1440 744", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - className: `content-box__shape content-box__shape--${backgroundOrientation}`, - preserveAspectRatio: "none", - vectorEffect: "non-scaling-stroke", - overflow: "visible", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", { - d: "M0 0H1440V686.701L0 744V0Z", - fill: backgroundColor, - stroke: borderColor, - strokeWidth: borderColor ? "2px" : "0", - style: { - strokeLinejoin: "round", - vectorEffect: "non-scaling-stroke" - } - }) - }); -} - -/***/ }), - -/***/ "./src/content-box/shapeB.jsx": -/*!************************************!*\ - !*** ./src/content-box/shapeB.jsx ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ShapeB) -/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); - - -function ShapeB({ - backgroundOrientation, - backgroundColor, - borderColor -}) { - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", { - className: `content-box__shape content-box__shape--${backgroundOrientation}`, - width: "1302", - height: "654", - viewBox: "0 0 1302 654", - preserveAspectRatio: "none", - vectorEffect: "non-scaling-stroke", - overflow: "visible", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", { - d: "M1302 0L0 15.8281V654L1302 642.633L1302 0Z", - fill: backgroundColor, - stroke: borderColor, - strokeWidth: borderColor ? "2px" : "0", - style: { - strokeLinejoin: "round", - vectorEffect: "non-scaling-stroke" - } - }) - }); -} - -/***/ }), - -/***/ "./src/content-box/shapeC.jsx": -/*!************************************!*\ - !*** ./src/content-box/shapeC.jsx ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ShapeB) -/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); - - -function ShapeB({ - backgroundOrientation, - backgroundColor, - borderColor -}) { - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", { - width: "1440", - height: "997", - viewBox: "0 0 1440 997", - className: `content-box__shape content-box__shape--${backgroundOrientation}`, - preserveAspectRatio: "none", - vectorEffect: "non-scaling-stroke", - overflow: "visible", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", { - d: "M1440 29.8887L0 0V997L1440 979.242V29.8887Z", - fill: backgroundColor, - stroke: borderColor, - strokeWidth: borderColor ? "2px" : "0", - style: { - strokeLinejoin: "round", - vectorEffect: "non-scaling-stroke" - } - }) - }) - }); -} - -/***/ }), - -/***/ "./src/content-box/style.scss": -/*!************************************!*\ - !*** ./src/content-box/style.scss ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "./src/content-box/utilities.js": -/*!**************************************!*\ - !*** ./src/content-box/utilities.js ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ filterBgColors: () => (/* binding */ filterBgColors), -/* harmony export */ filterTextColors: () => (/* binding */ filterTextColors) -/* harmony export */ }); -/* harmony import */ var _utilities_utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_utilities/utilities */ "./_utilities/utilities.js"); - -const filterBgColors = (colors, postType) => { - if (!postType) return colors || []; - if (postType === "articles") { - return colors?.filter(color => { - // Garder seulement certaines couleurs pour les articles - const allowedColors = ["carhop-green-light", "carhop-blue-light", "carhop-orange-light", "carhop-red-light", "carhop-purple-light"]; - return allowedColors.includes(color.slug); - }) || []; - } - return colors || []; -}; -const filterTextColors = (colors, postType, backgroundColor) => { - if (!postType) return colors || []; - if (postType === "page" && !(0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_0__.isColorLight)(backgroundColor)) { - // Retourner seulement du blanc pour les pages avec arrière-plan sombre - return [{ - name: "White", - slug: "white", - color: "#ffffff" - }]; - } - return colors || []; -}; - -/***/ }), - -/***/ "@wordpress/block-editor": -/*!*************************************!*\ - !*** external ["wp","blockEditor"] ***! - \*************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blockEditor"]; - -/***/ }), - -/***/ "@wordpress/blocks": -/*!********************************!*\ - !*** external ["wp","blocks"] ***! - \********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blocks"]; - -/***/ }), - -/***/ "@wordpress/components": -/*!************************************!*\ - !*** external ["wp","components"] ***! - \************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["components"]; - -/***/ }), - -/***/ "@wordpress/data": -/*!******************************!*\ - !*** external ["wp","data"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["data"]; - -/***/ }), - -/***/ "@wordpress/i18n": -/*!******************************!*\ - !*** external ["wp","i18n"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["i18n"]; - -/***/ }), - -/***/ "react": -/*!************************!*\ - !*** external "React" ***! - \************************/ -/***/ ((module) => { - -module.exports = window["React"]; - -/***/ }), - -/***/ "react/jsx-runtime": -/*!**********************************!*\ - !*** external "ReactJSXRuntime" ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["ReactJSXRuntime"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = __webpack_modules__; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/chunk loaded */ -/******/ (() => { -/******/ var deferred = []; -/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { -/******/ if(chunkIds) { -/******/ priority = priority || 0; -/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; -/******/ deferred[i] = [chunkIds, fn, priority]; -/******/ return; -/******/ } -/******/ var notFulfilled = Infinity; -/******/ for (var i = 0; i < deferred.length; i++) { -/******/ 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])))) { -/******/ chunkIds.splice(j--, 1); -/******/ } else { -/******/ fulfilled = false; -/******/ if(priority < notFulfilled) notFulfilled = priority; -/******/ } -/******/ } -/******/ if(fulfilled) { -/******/ deferred.splice(i--, 1) -/******/ var r = fn(); -/******/ if (r !== undefined) result = r; -/******/ } -/******/ } -/******/ return result; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/jsonp chunk loading */ -/******/ (() => { -/******/ // no baseURI -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ "content-box/index": 0, -/******/ "content-box/style-index": 0 -/******/ }; -/******/ -/******/ // no chunk on demand loading -/******/ -/******/ // no prefetching -/******/ -/******/ // no preloaded -/******/ -/******/ // no HMR -/******/ -/******/ // no HMR manifest -/******/ -/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); -/******/ -/******/ // install a JSONP callback for chunk loading -/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ 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; -/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) var result = runtime(__webpack_require__); -/******/ } -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ installedChunks[chunkId][0](); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ return __webpack_require__.O(result); -/******/ } -/******/ -/******/ var chunkLoadingGlobal = globalThis["webpackChunkcarhop_blocks"] = globalThis["webpackChunkcarhop_blocks"] || []; -/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); -/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module depends on other loaded chunks and execution need to be delayed -/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["content-box/style-index"], () => (__webpack_require__("./src/content-box/index.js"))) -/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); -/******/ -/******/ })() -; -//# sourceMappingURL=index.js.map \ No newline at end of file +(()=>{"use strict";var o,e={8186:()=>{const o=window.wp.blocks,e=window.wp.i18n,r=window.wp.blockEditor,l=window.wp.components,n=window.wp.data;function a(o){if(!o)return!0;let e=o.replace("#","");return 3===e.length&&(e=e.split("").map(o=>o+o).join("")),(.299*parseInt(e.substr(0,2),16)+.587*parseInt(e.substr(2,2),16)+.114*parseInt(e.substr(4,2),16))/255>.5}window.React;const t=window.ReactJSXRuntime;function s({backgroundOrientation:o,backgroundColor:e,borderColor:r}){return(0,t.jsx)("svg",{width:"1440",height:"744",viewBox:"0 0 1440 744",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`content-box__shape content-box__shape--${o}`,preserveAspectRatio:"none",vectorEffect:"non-scaling-stroke",overflow:"visible",children:(0,t.jsx)("path",{d:"M0 0H1440V686.701L0 744V0Z",fill:e,stroke:r,strokeWidth:r?"2px":"0",style:{strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}})})}function c({backgroundOrientation:o,backgroundColor:e,borderColor:r}){return(0,t.jsx)("svg",{className:`content-box__shape content-box__shape--${o}`,width:"1302",height:"654",viewBox:"0 0 1302 654",preserveAspectRatio:"none",vectorEffect:"non-scaling-stroke",overflow:"visible",children:(0,t.jsx)("path",{d:"M1302 0L0 15.8281V654L1302 642.633L1302 0Z",fill:e,stroke:r,strokeWidth:r?"2px":"0",style:{strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}})})}function i({backgroundOrientation:o,backgroundColor:e,borderColor:r}){return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("svg",{width:"1440",height:"997",viewBox:"0 0 1440 997",className:`content-box__shape content-box__shape--${o}`,preserveAspectRatio:"none",vectorEffect:"non-scaling-stroke",overflow:"visible",children:(0,t.jsx)("path",{d:"M1440 29.8887L0 0V997L1440 979.242V29.8887Z",fill:e,stroke:r,strokeWidth:r?"2px":"0",style:{strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}})})})}const d=JSON.parse('{"UU":"carhop-blocks/content-box"}');(0,o.registerBlockType)(d.UU,{icon:{foreground:"#136f63",src:(0,t.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 100 100",children:(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:"m50,99.84988l-43.14852,-24.92494l0,-49.84988l43.14852,-24.92494l43.14852,24.92494l0,49.84988l-43.14852,24.92494zm-40.75518,-26.32675l40.75518,23.52312l40.75518,-23.52312l0,-47.04625l-40.75518,-23.55731l-40.75518,23.55731l0,47.04625z"}),(0,t.jsx)("path",{d:"m50,86.13945l-31.28439,-18.05263l0,-36.13945l31.28439,-18.05263l31.28439,18.05263l0,36.13945l-31.28439,18.05263zm-13.50528,-28.344l13.50528,7.79545l13.50528,-7.79545l0,-15.59091l-13.50528,-7.79545l-13.50528,7.79545l0,15.59091z"})]})})},edit:function({attributes:o,setAttributes:d,...p}){const b=(0,r.useSetting)("color.palette.theme"),{hasBackgroundColor:g,align:u,backgroundColor:h,textColor:x,hasLightBackground:k,blockVariant:C,shapeType:f,borderColor:m}=o,v=(0,n.useSelect)(o=>o("core/editor").getCurrentPostType(),[]),_=((o,e)=>e&&"articles"===e?o?.filter(o=>["carhop-green-light","carhop-blue-light","carhop-orange-light","carhop-red-light","carhop-purple-light"].includes(o.slug))||[]:o||[])(b,v),j=((o,e,r)=>e?"page"!==e||a(r)?o||[]:[{name:"White",slug:"white",color:"#ffffff"}]:o||[])(b,v,h),w="full"===u?"alignfull":"wide"===u?"alignwide":"aligncontained";return console.log(u),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.InspectorControls,{children:[(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Aspect","carhop-blocks"),children:[(0,t.jsxs)(l.__experimentalToggleGroupControl,{label:"Modèle de bloc",value:C,onChange:function(o){d({blockVariant:o}),"framed"!==o&&"nude"!==o||(d({backgroundColor:"#fff"}),d({hasLightBackground:!0}))},isBlock:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,children:[(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"nude",label:"Nu"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"framed",label:"Encadré"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"backgrounded",label:"Fond coloré"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"framed-backgrounded",label:"Cadre + fond coloré"})]}),(0,t.jsxs)(l.__experimentalToggleGroupControl,{label:"Largeur du bloc",value:u,onChange:o=>d({align:o}),isBlock:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,children:[(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"",label:"Contenue"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"wide",label:"Large"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{value:"full",label:"Pleine largeur"})]})]}),"nude"!==C&&(0,t.jsxs)(l.PanelBody,{className:"deligraph-blocks-components-image__panel-body",title:(0,e.__)("Arrière plan","deligraph-blocks"),children:[(0,t.jsxs)(l.__experimentalToggleGroupControl,{className:"deligraph-blocks__variant",isBlock:!0,label:"Type de forme",onChange:o=>d({shapeType:o}),value:f,children:[(0,t.jsx)(l.__experimentalToggleGroupControlOption,{label:"Droite",value:"straight"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{label:"Forme A",value:"shapeA"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{label:"Forme B",value:"shapeB"}),(0,t.jsx)(l.__experimentalToggleGroupControlOption,{label:"Forme C",value:"shapeC"})]}),(0,t.jsx)(l.SelectControl,{__next40pxDefaultSize:!0,label:"Type de forme",onChange:o=>d({shapeType:o}),value:f,options:[{disabled:!0,label:"Type de forme",value:""},{label:"Droite",value:"straight"},{label:"Forme A",value:"shapeA"},{label:"Forme B",value:"shapeB"},{label:"Forme C",value:"shapeC"}]}),(0,t.jsx)(l.ColorPalette,{colors:_,value:h,onChange:function(o){void 0===o&&(d({hasBackgroundColor:!1}),d({backgroundColor:"transparent"}));const e=a(o);d({hasLightBackground:e}),d({backgroundColor:o}),d(e?{textColor:"inherit"}:{textColor:"#fff"})}})]}),("backgrounded"===C||"framed-backgrounded"===C)&&"articles"!==v&&(0,t.jsx)(l.PanelBody,{className:"deligraph-blocks-components-image__panel-body",title:(0,e.__)("Couleur du texte","deligraph-blocks"),children:(0,t.jsx)(l.ColorPalette,{colors:j,value:x,onChange:function(o){d({textColor:o})}})})]}),(0,t.jsxs)("section",{...(0,r.useBlockProps)({className:`${"articles"!==v&&"alignfull"} content-box content-box--variant-${C} content-box--${f} ${k?"content-box--bg-light":"content-box--bg-dark"} ${w}`,style:{"--content-box-text-color":null!=x?x:"inherit","--content-box-background-color":"backgrounded"===C||"framed-backgrounded"===C?h:"transparent"}}),children:["backgrounded"===C&&h&&"shapeA"===f&&(0,t.jsx)(s,{backgroundColor:h,borderColor:"none"}),"backgrounded"===C&&h&&"shapeB"===f&&(0,t.jsx)(c,{backgroundColor:h,borderColor:"none"}),"backgrounded"===C&&h&&"shapeC"===f&&(0,t.jsx)(i,{backgroundColor:h,borderColor:"none"}),"framed"===C&&h&&"shapeA"===f&&(0,t.jsx)(s,{backgroundColor:"none",borderColor:m}),"framed"===C&&h&&"shapeB"===f&&(0,t.jsx)(c,{backgroundColor:"none",borderColor:m}),"framed"===C&&h&&"shapeC"===f&&(0,t.jsx)(i,{backgroundColor:"none",borderColor:m}),"framed-backgrounded"===C&&h&&"shapeA"===f&&(0,t.jsx)(s,{backgroundColor:h,borderColor:m}),"framed-backgrounded"===C&&h&&"shapeB"===f&&(0,t.jsx)(c,{backgroundColor:h,borderColor:m}),"framed-backgrounded"===C&&h&&"shapeC"===f&&(0,t.jsx)(i,{backgroundColor:h,borderColor:m}),(0,t.jsx)("div",{className:"content-box__innerblocks",children:(0,t.jsx)(r.InnerBlocks,{template:[["core/paragraph",{placeholder:"Ajouter ici le texte"}]],allowedBlocks:["core/heading","core/paragraph","core/group","core/list","core/button","core/image","core/buttons","core/columns","core/file","core/post-title","core/embed","core/quote","core/pullquote","core/media-text","core/table","carhop-blocks/chapter-section","carhop-blocks/heading","carhop-blocks/decorative-shapes","carhop-blocks/scroll-story-block","carhop-blocks/cta","carhop-blocks/cta-group","carhop-blocks/audio-player","carhop-blocks/content-box","carhop-blocks/localisation-map","carhop-blocks/notice-panel","carhop-blocks/story-timeline","carhop-blocks/highlight-timeline","acf/statistics-datas","ninja-forms/form","gravityforms/form","dynamiques-blocks/sitemap","mailpoet/subscription-form-block","shortcode"]})})]})]})},save:function({attributes:o}){const{backgroundColor:e,textColor:l,hasLightBackground:n,hasBackgroundColor:a,blockVariant:d,align:p,shapeType:b,borderColor:g}=o,u=n?"content-box--bg-light":"content-box--bg-dark",h="full"===p?"alignfull":"wide"===p?"alignwide":"aligncontained";return(0,t.jsxs)("section",{...r.useBlockProps.save({className:`content-box content-box--variant-${d} content-box--${b} ${u} ${h}`,style:{"--content-box-text-color":null!=l?l:"inherit","--content-box-background-color":"backgrounded"===d||"framed-backgrounded"===d?e:"transparent"}}),children:["backgrounded"===d&&e&&"shapeA"===b&&(0,t.jsx)(s,{backgroundColor:e,borderColor:"none"}),"backgrounded"===d&&e&&"shapeB"===b&&(0,t.jsx)(c,{backgroundColor:e,borderColor:"none"}),"backgrounded"===d&&e&&"shapeC"===b&&(0,t.jsx)(i,{backgroundColor:e,borderColor:"none"}),"framed"===d&&e&&"shapeA"===b&&(0,t.jsx)(s,{backgroundColor:"none",borderColor:g}),"framed"===d&&e&&"shapeB"===b&&(0,t.jsx)(c,{backgroundColor:"none",borderColor:g}),"framed"===d&&e&&"shapeC"===b&&(0,t.jsx)(i,{backgroundColor:"none",borderColor:g}),"framed-backgrounded"===d&&e&&"shapeA"===b&&(0,t.jsx)(s,{backgroundColor:e,borderColor:g}),"framed-backgrounded"===d&&e&&"shapeB"===b&&(0,t.jsx)(c,{backgroundColor:e,borderColor:g}),"framed-backgrounded"===d&&e&&"shapeC"===b&&(0,t.jsx)(i,{backgroundColor:e,borderColor:g}),(0,t.jsx)("div",{className:"content-box__innerblocks",children:(0,t.jsx)(r.InnerBlocks.Content,{})})]})}})}},r={};function l(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,l),a.exports}l.m=e,o=[],l.O=(e,r,n,a)=>{if(!r){var t=1/0;for(d=0;d=a)&&Object.keys(l.O).every(o=>l.O[o](r[c]))?r.splice(c--,1):(s=!1,a0&&o[d-1][2]>a;d--)o[d]=o[d-1];o[d]=[r,n,a]},l.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),(()=>{var o={6527:0,7191:0};l.O.j=e=>0===o[e];var e=(e,r)=>{var n,a,[t,s,c]=r,i=0;if(t.some(e=>0!==o[e])){for(n in s)l.o(s,n)&&(l.m[n]=s[n]);if(c)var d=c(l)}for(e&&e(r);il(8186));n=l.O(n)})(); \ No newline at end of file diff --git a/plugins/carhop-blocks/build/content-box/index.js.map b/plugins/carhop-blocks/build/content-box/index.js.map deleted file mode 100644 index 34e933a..0000000 --- a/plugins/carhop-blocks/build/content-box/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"content-box/index.js","mappings":";;;;;;;;;;;;;;AAAA;AACO,SAASA,YAAYA,CAACC,KAAK,EAAE;EACnC;EACA,IAAI,CAACA,KAAK,EAAE,OAAO,IAAI;;EAEvB;EACA,IAAIC,GAAG,GAAGD,KAAK,CAACE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;EAChC,IAAID,GAAG,CAACE,MAAM,KAAK,CAAC,EAAE;IACrBF,GAAG,GAAGA,GAAG,CACPG,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAEC,IAAI,IAAKA,IAAI,GAAGA,IAAI,CAAC,CAC1BC,IAAI,CAAC,EAAE,CAAC;EACX;EAEA,MAAMC,CAAC,GAAGC,QAAQ,CAACR,GAAG,CAACS,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;EACxC,MAAMC,CAAC,GAAGF,QAAQ,CAACR,GAAG,CAACS,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;EACxC,MAAME,CAAC,GAA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ACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://carhop-blocks/./_utilities/utilities.js","webpack://carhop-blocks/./src/content-box/edit.js","webpack://carhop-blocks/./src/content-box/editor.scss?3831","webpack://carhop-blocks/./src/content-box/index.js","webpack://carhop-blocks/./src/content-box/save.js","webpack://carhop-blocks/./src/content-box/shapeA.jsx","webpack://carhop-blocks/./src/content-box/shapeB.jsx","webpack://carhop-blocks/./src/content-box/shapeC.jsx","webpack://carhop-blocks/./src/content-box/style.scss","webpack://carhop-blocks/./src/content-box/utilities.js","webpack://carhop-blocks/external window [\"wp\",\"blockEditor\"]","webpack://carhop-blocks/external window [\"wp\",\"blocks\"]","webpack://carhop-blocks/external window [\"wp\",\"components\"]","webpack://carhop-blocks/external window [\"wp\",\"data\"]","webpack://carhop-blocks/external window [\"wp\",\"i18n\"]","webpack://carhop-blocks/external window \"React\"","webpack://carhop-blocks/external window \"ReactJSXRuntime\"","webpack://carhop-blocks/webpack/bootstrap","webpack://carhop-blocks/webpack/runtime/chunk loaded","webpack://carhop-blocks/webpack/runtime/compat get default export","webpack://carhop-blocks/webpack/runtime/define property getters","webpack://carhop-blocks/webpack/runtime/hasOwnProperty shorthand","webpack://carhop-blocks/webpack/runtime/make namespace object","webpack://carhop-blocks/webpack/runtime/jsonp chunk loading","webpack://carhop-blocks/webpack/before-startup","webpack://carhop-blocks/webpack/startup","webpack://carhop-blocks/webpack/after-startup"],"sourcesContent":["// Fonction pour déterminer si une couleur est claire ou sombre\r\nexport function isColorLight(color) {\r\n\t// Si pas de couleur, considérer comme claire\r\n\tif (!color) return true;\r\n\r\n\t// Convertir hex en RGB\r\n\tlet hex = color.replace(\"#\", \"\");\r\n\tif (hex.length === 3) {\r\n\t\thex = hex\r\n\t\t\t.split(\"\")\r\n\t\t\t.map((char) => char + char)\r\n\t\t\t.join(\"\");\r\n\t}\r\n\r\n\tconst r = parseInt(hex.substr(0, 2), 16);\r\n\tconst g = parseInt(hex.substr(2, 2), 16);\r\n\tconst b = parseInt(hex.substr(4, 2), 16);\r\n\r\n\t// Calculer la luminance relative (formule standard)\r\n\tconst luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\r\n\r\n\t// Si luminance > 0.5, la couleur est claire\r\n\treturn luminance > 0.5;\r\n}\r\n","import { __ } from \"@wordpress/i18n\";\nimport {\n\tuseBlockProps,\n\tInnerBlocks,\n\tuseSetting,\n\tInspectorControls,\n\tMediaReplaceFlow,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\nimport {\n\tCard,\n\tCardHeader,\n\tCardBody,\n\tHeading,\n\tText,\n} from \"@wordpress/components\";\nimport { useSelect } from \"@wordpress/data\";\nimport \"./editor.scss\";\nimport { isColorLight } from \"../../_utilities/utilities\";\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n\tCheckboxControl,\n\tColorPalette,\n\tSelectControl,\n} from \"@wordpress/components\";\n\nimport ShapeA from \"./shapeA.jsx\";\nimport ShapeB from \"./shapeB.jsx\";\nimport ShapeC from \"./shapeC.jsx\";\nimport { filterBgColors, filterTextColors } from \"./utilities\";\n\nexport default function Edit({ attributes, setAttributes, ...props }) {\n\tconst colors = useSetting(\"color.palette.theme\");\n\n\tconst {\n\t\thasBackgroundColor,\n\t\tbackgroundColor,\n\t\ttextColor,\n\t\thasLightBackground,\n\t\tblockVariant,\n\t\tblockWidth,\n\t\tshapeType,\n\t\tborderColor,\n\t} = attributes;\n\n\t// Détecter le type de post actuel\n\tconst postType = useSelect((select) => {\n\t\treturn select(\"core/editor\").getCurrentPostType();\n\t}, []);\n\n\tconst filteredBgColors = filterBgColors(colors, postType);\n\tconst filteredTextColors = filterTextColors(\n\t\tcolors,\n\t\tpostType,\n\t\tbackgroundColor,\n\t);\n\n\tfunction onBackgroundColorChange(value) {\n\t\tif (value === undefined) {\n\t\t\tsetAttributes({ hasBackgroundColor: false });\n\t\t\tsetAttributes({ backgroundColor: \"transparent\" });\n\t\t}\n\t\tconst isLightBackgroundColor = isColorLight(value);\n\t\tsetAttributes({ hasLightBackground: isLightBackgroundColor });\n\t\tsetAttributes({ backgroundColor: value });\n\n\t\tif (!isLightBackgroundColor) {\n\t\t\tsetAttributes({ textColor: \"#fff\" });\n\t\t} else {\n\t\t\tsetAttributes({ textColor: \"inherit\" });\n\t\t}\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\tfunction onTextColorChange(value) {\n\t\tsetAttributes({ textColor: value });\n\t}\n\tfunction onBlockVariantChange(value) {\n\t\tsetAttributes({ blockVariant: value });\n\n\t\tif (value === \"framed\" || value === \"nude\") {\n\t\t\tsetAttributes({ backgroundColor: \"#fff\" });\n\t\t\tsetAttributes({ hasLightBackground: true });\n\t\t}\n\t}\n\n\tconsole.log(shapeType);\n\tconsole.log(blockVariant);\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\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\t setAttributes({ blockWidth: value })}\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\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{(blockVariant === \"backgrounded\" ||\n\t\t\t\t\tblockVariant === \"framed-backgrounded\") && (\n\t\t\t\t\t\n\t\t\t\t\t\t setAttributes({ shapeType: value })}\n\t\t\t\t\t\t\tvalue={shapeType}\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t setAttributes({ shapeType: value })}\n\t\t\t\t\t\t\tvalue={shapeType}\n\t\t\t\t\t\t\toptions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tdisabled: true,\n\t\t\t\t\t\t\t\t\tlabel: \"Type de forme\",\n\t\t\t\t\t\t\t\t\tvalue: \"\",\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\t\tlabel: \"Droite\",\n\t\t\t\t\t\t\t\t\tvalue: \"straight\",\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\t\tlabel: \"Forme A\",\n\t\t\t\t\t\t\t\t\tvalue: \"shapeA\",\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\t\tlabel: \"Forme B\",\n\t\t\t\t\t\t\t\t\tvalue: \"shapeB\",\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\t\tlabel: \"Forme C\",\n\t\t\t\t\t\t\t\t\tvalue: \"shapeC\",\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\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t\t{(blockVariant === \"backgrounded\" ||\n\t\t\t\t\tblockVariant === \"framed-backgrounded\") &&\n\t\t\t\t\tpostType !== \"articles\" && (\n\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\n\t\t\t\n\t\t\t\t{blockVariant === \"backgrounded\" &&\n\t\t\t\t\tbackgroundColor &&\n\t\t\t\t\tshapeType === \"shapeA\" && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t{blockVariant === \"backgrounded\" &&\n\t\t\t\t\tbackgroundColor &&\n\t\t\t\t\tshapeType === \"shapeB\" && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t{blockVariant === \"backgrounded\" &&\n\t\t\t\t\tbackgroundColor &&\n\t\t\t\t\tshapeType === \"shapeC\" && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t{blockVariant === \"framed\" &&\n\t\t\t\t\tbackgroundColor &&\n\t\t\t\t\tshapeType === \"shapeA\" && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t{blockVariant === \"framed\" &&\n\t\t\t\t\tbackgroundColor &&\n\t\t\t\t\tshapeType === \"shapeB\" && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t{blockVariant === \"framed\" &&\n\t\t\t\t\tbackgroundColor &&\n\t\t\t\t\tshapeType === \"shapeC\" && (\n\t\t\t\t\t\t\n\t\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}\n","// extracted by mini-css-extract-plugin\nexport {};","import { registerBlockType } from \"@wordpress/blocks\";\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tforeground: \"#136f63\",\n\t\tsrc: (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t),\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, InnerBlocks } from \"@wordpress/block-editor\";\nimport ShapeA from \"./shapeA.jsx\";\nimport ShapeB from \"./shapeB.jsx\";\nimport ShapeC from \"./shapeC.jsx\";\nexport default function save({ attributes }) {\n\tconst {\n\t\tbackgroundColor,\n\t\ttextColor,\n\t\thasLightBackground,\n\t\thasBackgroundColor,\n\t\tblockVariant,\n\t\tblockWidth,\n\t\tshapeType,\n\t\tborderColor,\n\t} = attributes;\n\n\treturn (\n\t\t\n\t\t\t{blockVariant === \"backgrounded\" &&\n\t\t\t\tbackgroundColor &&\n\t\t\t\tshapeType === \"shapeA\" && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t{blockVariant === \"backgrounded\" &&\n\t\t\t\tbackgroundColor &&\n\t\t\t\tshapeType === \"shapeB\" && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t{blockVariant === \"backgrounded\" &&\n\t\t\t\tbackgroundColor &&\n\t\t\t\tshapeType === \"shapeC\" && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t{blockVariant === \"framed\" &&\n\t\t\t\tbackgroundColor &&\n\t\t\t\tshapeType === \"shapeA\" && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t{blockVariant === \"framed\" &&\n\t\t\t\tbackgroundColor &&\n\t\t\t\tshapeType === \"shapeB\" && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t{blockVariant === \"framed\" &&\n\t\t\t\tbackgroundColor &&\n\t\t\t\tshapeType === \"shapeC\" && (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","import React from \"react\";\r\n\r\nexport default function ShapeA({\r\n\tbackgroundOrientation,\r\n\tbackgroundColor,\r\n\tborderColor,\r\n}) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import React from \"react\";\r\n\r\nexport default function ShapeB({\r\n\tbackgroundOrientation,\r\n\tbackgroundColor,\r\n\tborderColor,\r\n}) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import React from \"react\";\r\n\r\nexport default function ShapeB({\r\n\tbackgroundOrientation,\r\n\tbackgroundColor,\r\n\tborderColor,\r\n}) {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","// extracted by mini-css-extract-plugin\nexport {};","import { isColorLight } from \"../../_utilities/utilities\";\r\n\r\nexport const filterBgColors = (colors, postType) => {\r\n\tif (!postType) return colors || [];\r\n\r\n\tif (postType === \"articles\") {\r\n\t\treturn (\r\n\t\t\tcolors?.filter((color) => {\r\n\t\t\t\t// Garder seulement certaines couleurs pour les articles\r\n\t\t\t\tconst allowedColors = [\r\n\t\t\t\t\t\"carhop-green-light\",\r\n\t\t\t\t\t\"carhop-blue-light\",\r\n\t\t\t\t\t\"carhop-orange-light\",\r\n\t\t\t\t\t\"carhop-red-light\",\r\n\t\t\t\t\t\"carhop-purple-light\",\r\n\t\t\t\t];\r\n\t\t\t\treturn allowedColors.includes(color.slug);\r\n\t\t\t}) || []\r\n\t\t);\r\n\t}\r\n\r\n\treturn colors || [];\r\n};\r\n\r\nexport const filterTextColors = (colors, postType, backgroundColor) => {\r\n\tif (!postType) return colors || [];\r\n\tif (postType === \"page\" && !isColorLight(backgroundColor)) {\r\n\t\t// Retourner seulement du blanc pour les pages avec arrière-plan sombre\r\n\t\treturn [\r\n\t\t\t{\r\n\t\t\t\tname: \"White\",\r\n\t\t\t\tslug: \"white\",\r\n\t\t\t\tcolor: \"#ffffff\",\r\n\t\t\t},\r\n\t\t];\r\n\t}\r\n\r\n\treturn colors || [];\r\n};\r\n","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"React\"];","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\"content-box/index\": 0,\n\t\"content-box/style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkcarhop_blocks\"] = globalThis[\"webpackChunkcarhop_blocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"content-box/style-index\"], () => (__webpack_require__(\"./src/content-box/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["isColorLight","color","hex","replace","length","split","map","char","join","r","parseInt","substr","g","b","luminance","__","useBlockProps","InnerBlocks","useSetting","InspectorControls","MediaReplaceFlow","MediaPlaceholder","Card","CardHeader","CardBody","Heading","Text","useSelect","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","CheckboxControl","ColorPalette","SelectControl","ShapeA","ShapeB","ShapeC","filterBgColors","filterTextColors","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","props","colors","hasBackgroundColor","backgroundColor","textColor","hasLightBackground","blockVariant","blockWidth","shapeType","borderColor","postType","select","getCurrentPostType","filteredBgColors","filteredTextColors","onBackgroundColorChange","value","undefined","isLightBackgroundColor","onHasBackgroundColorChange","onTextColorChange","onBlockVariantChange","console","log","children","title","label","onChange","isBlock","__nextHasNoMarginBottom","__next40pxDefaultSize","className","options","disabled","style","template","placeholder","allowedBlocks","registerBlockType","save","metadata","name","icon","foreground","src","width","height","viewBox","d","edit","Content","React","backgroundOrientation","fill","xmlns","preserveAspectRatio","vectorEffect","overflow","stroke","strokeWidth","strokeLinejoin","filter","allowedColors","includes","slug"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/build/content-box/style-index.css b/plugins/carhop-blocks/build/content-box/style-index.css index 64522bf..8b13789 100644 --- a/plugins/carhop-blocks/build/content-box/style-index.css +++ b/plugins/carhop-blocks/build/content-box/style-index.css @@ -1,4 +1 @@ -/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/content-box/style.scss ***! - \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ diff --git a/plugins/carhop-blocks/build/content-box/view.js b/plugins/carhop-blocks/build/content-box/view.js index 2cc4cb1..e69de29 100644 --- a/plugins/carhop-blocks/build/content-box/view.js +++ b/plugins/carhop-blocks/build/content-box/view.js @@ -1,7 +0,0 @@ -/******/ (() => { // webpackBootstrap -/*!*********************************!*\ - !*** ./src/content-box/view.js ***! - \*********************************/ - -/******/ })() -; \ No newline at end of file diff --git a/plugins/carhop-blocks/src/content-box/block.json b/plugins/carhop-blocks/src/content-box/block.json index c316772..91611fa 100644 --- a/plugins/carhop-blocks/src/content-box/block.json +++ b/plugins/carhop-blocks/src/content-box/block.json @@ -44,7 +44,13 @@ }, "blockVariant": { "type": "string", - "default": "framed" + "default": "backgrounded", + "enum": [ + "nude", + "framed", + "framed-backgrounded", + "backgrounded" + ] }, "shapeType": { "type": "string", diff --git a/plugins/carhop-blocks/src/content-box/deprecated-save.js b/plugins/carhop-blocks/src/content-box/deprecated-save.js new file mode 100644 index 0000000..76bbc8c --- /dev/null +++ b/plugins/carhop-blocks/src/content-box/deprecated-save.js @@ -0,0 +1,95 @@ +import { useBlockProps, InnerBlocks } from "@wordpress/block-editor"; +import ShapeA from "./shapeA.jsx"; +import ShapeB from "./shapeB.jsx"; +import ShapeC from "./shapeC.jsx"; + +/** + * Ancien save (blockWidth) — conservé pour la migration des blocs. + */ +export default function deprecatedSave({ attributes }) { + const { + backgroundColor, + textColor, + hasLightBackground, + blockVariant, + blockWidth, + shapeType, + borderColor, + } = attributes; + + const blockWidthClass = + blockWidth === "contained" + ? "aligncontained" + : blockWidth === "wide" + ? "alignwide" + : "alignfull"; + + const lightnessClass = hasLightBackground + ? "content-box--bg-light" + : "content-box--bg-dark"; + + return ( +
+ {blockVariant === "backgrounded" && + backgroundColor && + shapeType === "shapeA" && ( + + )} + {blockVariant === "backgrounded" && + backgroundColor && + shapeType === "shapeB" && ( + + )} + {blockVariant === "backgrounded" && + backgroundColor && + shapeType === "shapeC" && ( + + )} + {blockVariant === "framed" && + backgroundColor && + shapeType === "shapeA" && ( + + )} + {blockVariant === "framed" && + backgroundColor && + shapeType === "shapeB" && ( + + )} + {blockVariant === "framed" && + backgroundColor && + shapeType === "shapeC" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeA" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeB" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeC" && ( + + )} +
+ +
+
+ ); +} diff --git a/plugins/carhop-blocks/src/content-box/edit.js b/plugins/carhop-blocks/src/content-box/edit.js index ead398c..3194c8a 100644 --- a/plugins/carhop-blocks/src/content-box/edit.js +++ b/plugins/carhop-blocks/src/content-box/edit.js @@ -37,11 +37,11 @@ export default function Edit({ attributes, setAttributes, ...props }) { const { hasBackgroundColor, + align, backgroundColor, textColor, hasLightBackground, blockVariant, - blockWidth, shapeType, borderColor, } = attributes; @@ -91,8 +91,14 @@ export default function Edit({ attributes, setAttributes, ...props }) { } } - console.log(shapeType); - console.log(blockVariant); + const alignClass = + align === "full" + ? "alignfull" + : align === "wide" + ? "alignwide" + : "aligncontained"; + + console.log(align); return ( <> @@ -118,20 +124,19 @@ export default function Edit({ attributes, setAttributes, ...props }) { setAttributes({ blockWidth: value })} + value={align} + onChange={(value) => setAttributes({ align: value })} isBlock __nextHasNoMarginBottom __next40pxDefaultSize > - + - {(blockVariant === "backgrounded" || - blockVariant === "framed-backgrounded") && ( + {blockVariant !== "nude" && ( )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeA" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeB" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeC" && ( + + )}
.wp-block-columns { + margin-top: 0 !important; + margin-bottom: 0 !important; + } +} diff --git a/plugins/carhop-blocks/src/content-box/save.js b/plugins/carhop-blocks/src/content-box/save.js index 4af7721..b632b15 100644 --- a/plugins/carhop-blocks/src/content-box/save.js +++ b/plugins/carhop-blocks/src/content-box/save.js @@ -9,18 +9,26 @@ export default function save({ attributes }) { hasLightBackground, hasBackgroundColor, blockVariant, - blockWidth, + align, shapeType, borderColor, } = attributes; + const lightnessClass = hasLightBackground + ? "content-box--bg-light" + : "content-box--bg-dark"; + + const alignClass = + align === "full" + ? "alignfull" + : align === "wide" + ? "alignwide" + : "aligncontained"; + return (
)} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeA" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeB" && ( + + )} + {blockVariant === "framed-backgrounded" && + backgroundColor && + shapeType === "shapeC" && ( + + )}