diff --git a/plugins/carhop-blocks/blocks/content-box/build/index.asset.php b/plugins/carhop-blocks/blocks/content-box/build/index.asset.php
index 75e49c5..9fd3920 100644
--- a/plugins/carhop-blocks/blocks/content-box/build/index.asset.php
+++ b/plugins/carhop-blocks/blocks/content-box/build/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '15318d1c4f5eab934866');
+ array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '73384dc26665f6c790ed');
diff --git a/plugins/carhop-blocks/blocks/content-box/build/index.js b/plugins/carhop-blocks/blocks/content-box/build/index.js
index 258e967..160081c 100644
--- a/plugins/carhop-blocks/blocks/content-box/build/index.js
+++ b/plugins/carhop-blocks/blocks/content-box/build/index.js
@@ -2,6 +2,39 @@
/******/ "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/block.json":
/*!************************!*\
!*** ./src/block.json ***!
@@ -27,10 +60,12 @@ __webpack_require__.r(__webpack_exports__);
/* 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 _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
-/* 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__);
+/* harmony import */ var _utilities_utilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../_utilities/utilities */ "../_utilities/utilities.js");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
+/* 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__);
+
@@ -47,6 +82,8 @@ function Edit({
backgroundColor,
textColor
} = attributes;
+ const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_3__.isColorLight)(backgroundColor);
+ console.log(isLightBackgroundColor);
function onBackgroundColorChange(value) {
setAttributes({
backgroundColor: value
@@ -67,48 +104,48 @@ function Edit({
textColor: 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__.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_3__.PanelBody, {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.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_3__.CheckboxControl, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.CheckboxControl, {
label: "Arri\xE8re plan color\xE9",
checked: hasBackgroundColor,
onChange: onHasBackgroundColorChange
- }), hasBackgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ColorPalette, {
+ }), hasBackgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ColorPalette, {
colors: colors,
value: backgroundColor,
onChange: onBackgroundColorChange
})
})]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
className: "deligraph-blocks-components-image__panel-body",
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Couleur du texte", "deligraph-blocks"),
- children: hasBackgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ColorPalette, {
+ children: hasBackgroundColor && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ColorPalette, {
colors: colors,
value: textColor,
onChange: onTextColorChange
})
})
})]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("section", {
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("section", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
- className: "content-box",
+ className: `content-box ${isLightBackgroundColor ? "content-box--bg-light" : "content-box--bg-dark"}`,
style: {
"--content-box-background-color": backgroundColor,
"--content-box-text-color": textColor
}
}),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
className: "content-box__innerblocks",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
template: [["core/paragraph", {
placeholder: "Ajouter ici le texte"
}]],
- allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "acf/statistics-datas", "carhop-blocks/scroll-story-block"]
+ allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "acf/statistics-datas", "carhop-blocks/scroll-story-block", "ninja-forms/form"]
})
})
})]
@@ -184,8 +221,10 @@ __webpack_require__.r(__webpack_exports__);
/* 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 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__);
+/* harmony import */ var _utilities_utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_utilities/utilities */ "../_utilities/utilities.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+
function save({
@@ -196,17 +235,18 @@ function save({
backgroundColor,
textColor
} = attributes;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("section", {
+ const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_1__.isColorLight)(backgroundColor);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
- className: "content-box",
+ className: `content-box ${isLightBackgroundColor ? "content-box--bg-light" : "content-box--bg-dark"}`,
style: {
"--content-box-background-color": backgroundColor,
"--content-box-text-color": textColor
}
}),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
className: "content-box__innerblocks",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
})
});
}
diff --git a/plugins/carhop-blocks/blocks/content-box/build/index.js.map b/plugins/carhop-blocks/blocks/content-box/build/index.js.map
index bd4803f..c132e74 100644
--- a/plugins/carhop-blocks/blocks/content-box/build/index.js.map
+++ b/plugins/carhop-blocks/blocks/content-box/build/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AAQJ;AACV;AASQ;AAAA;AAEhB,SAASqB,IAAIA,CAAC;EAAEC,UAAU;EAAEC,aAAa;EAAE,GAAGC;AAAM,CAAC,EAAE;EACrE,MAAMC,MAAM,GAAGtB,mEAAU,CAAC,qBAAqB,CAAC;EAChD,MAAM;IAAEuB,kBAAkB;IAAEC,eAAe;IAAEC;EAAU,CAAC,GAAGN,UAAU;EAErE,SAASO,uBAAuBA,CAACC,KAAK,EAAE;IACvCP,aAAa,CAAC;MAAEI,eAAe,EAAEG;IAAM,CAAC,CAAC;EAC1C;EACA,SAASC,0BAA0BA,CAACD,KAAK,EAAE;IAC1CP,aAAa,CAAC;MAAEG,kBAAkB,EAAEI;IAAM,CAAC,CAAC;IAC5C,IAAI,CAACA,KAAK,EAAE;MACXP,aAAa,CAAC;QAAEI,eAAe,EAAE;MAAK,CAAC,CAAC;IACzC;EACD;EACA,SAASK,iBAAiBA,CAACF,KAAK,EAAE;IACjCP,aAAa,CAAC;MAAEK,SAAS,EAAEE;I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AAC,CACE,CAAC;AAEZ;;;;;;;;;;;ACnBA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;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://front-header/./src/edit.js","webpack://front-header/./src/editor.scss","webpack://front-header/./src/index.js","webpack://front-header/./src/save.js","webpack://front-header/./src/style.scss","webpack://front-header/external window [\"wp\",\"blockEditor\"]","webpack://front-header/external window [\"wp\",\"blocks\"]","webpack://front-header/external window [\"wp\",\"components\"]","webpack://front-header/external window [\"wp\",\"i18n\"]","webpack://front-header/external window \"ReactJSXRuntime\"","webpack://front-header/webpack/bootstrap","webpack://front-header/webpack/runtime/chunk loaded","webpack://front-header/webpack/runtime/compat get default export","webpack://front-header/webpack/runtime/define property getters","webpack://front-header/webpack/runtime/hasOwnProperty shorthand","webpack://front-header/webpack/runtime/make namespace object","webpack://front-header/webpack/runtime/jsonp chunk loading","webpack://front-header/webpack/before-startup","webpack://front-header/webpack/startup","webpack://front-header/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport {\n\tuseBlockProps,\n\tInnerBlocks,\n\tuseSetting,\n\tInspectorControls,\n\tMediaReplaceFlow,\n\tMediaPlaceholder,\n} from \"@wordpress/block-editor\";\nimport \"./editor.scss\";\n\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n\tCheckboxControl,\n\tColorPalette,\n} from \"@wordpress/components\";\n\nexport default function Edit({ attributes, setAttributes, ...props }) {\n\tconst colors = useSetting(\"color.palette.theme\");\n\tconst { hasBackgroundColor, backgroundColor, textColor } = attributes;\n\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\tfunction onTextColorChange(value) {\n\t\tsetAttributes({ textColor: value });\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{hasBackgroundColor && (\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\t\n\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>\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>\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),\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, InnerBlocks } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { hasBackgroundColor, backgroundColor, textColor } = attributes;\n\treturn (\n\t\t\n\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 {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// 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[\"webpackChunkfront_header\"] = globalThis[\"webpackChunkfront_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":["__","useBlockProps","InnerBlocks","useSetting","InspectorControls","MediaReplaceFlow","MediaPlaceholder","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","CheckboxControl","ColorPalette","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","setAttributes","props","colors","hasBackgroundColor","backgroundColor","textColor","onBackgroundColorChange","value","onHasBackgroundColorChange","onTextColorChange","children","className","title","label","checked","onChange","style","template","placeholder","allowedBlocks","registerBlockType","save","metadata","name","icon","foreground","src","width","height","viewBox","d","edit","Content"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"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,GAAGH,QAAQ,CAACR,GAAG,CAACS,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;;EAExC;EACA,MAAMG,SAAS,GAAG,CAAC,KAAK,GAAGL,CAAC,GAAG,KAAK,GAAGG,CAAC,GAAG,KAAK,GAAGC,CAAC,IAAI,GAAG;;EAE3D;EACA,OAAOC,SAAS,GAAG,GAAG;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBqC;AAQJ;AACV;AACmC;AAS3B;AAAA;AAEhB,SAASsB,IAAIA,CAAC;EAAEC,UAAU;EAAEC,aAAa;EAAE,GAAGC;AAAM,CAAC,EAAE;EACrE,MAAMC,MAAM,GAAGtB,mEA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A;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://front-header/../_utilities/utilities.js","webpack://front-header/./src/edit.js","webpack://front-header/./src/editor.scss","webpack://front-header/./src/index.js","webpack://front-header/./src/save.js","webpack://front-header/./src/style.scss","webpack://front-header/external window [\"wp\",\"blockEditor\"]","webpack://front-header/external window [\"wp\",\"blocks\"]","webpack://front-header/external window [\"wp\",\"components\"]","webpack://front-header/external window [\"wp\",\"i18n\"]","webpack://front-header/external window \"ReactJSXRuntime\"","webpack://front-header/webpack/bootstrap","webpack://front-header/webpack/runtime/chunk loaded","webpack://front-header/webpack/runtime/compat get default export","webpack://front-header/webpack/runtime/define property getters","webpack://front-header/webpack/runtime/hasOwnProperty shorthand","webpack://front-header/webpack/runtime/make namespace object","webpack://front-header/webpack/runtime/jsonp chunk loading","webpack://front-header/webpack/before-startup","webpack://front-header/webpack/startup","webpack://front-header/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 \"./editor.scss\";\nimport { isColorLight } from \"../../_utilities/utilities\";\n\nimport {\n\tPanelBody,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tButton,\n\tCheckboxControl,\n\tColorPalette,\n} from \"@wordpress/components\";\n\nexport default function Edit({ attributes, setAttributes, ...props }) {\n\tconst colors = useSetting(\"color.palette.theme\");\n\tconst { hasBackgroundColor, backgroundColor, textColor } = attributes;\n\n\tconst isLightBackgroundColor = isColorLight(backgroundColor);\n\tconsole.log(isLightBackgroundColor);\n\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\tfunction onTextColorChange(value) {\n\t\tsetAttributes({ textColor: value });\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{hasBackgroundColor && (\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\t\n\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>\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>\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),\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, InnerBlocks } from \"@wordpress/block-editor\";\nimport { isColorLight } from \"../../_utilities/utilities\";\n\nexport default function save({ attributes }) {\n\tconst { hasBackgroundColor, backgroundColor, textColor } = attributes;\n\tconst isLightBackgroundColor = isColorLight(backgroundColor);\n\treturn (\n\t\t\n\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 {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// 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[\"webpackChunkfront_header\"] = globalThis[\"webpackChunkfront_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":["isColorLight","color","hex","replace","length","split","map","char","join","r","parseInt","substr","g","b","luminance","__","useBlockProps","InnerBlocks","useSetting","InspectorControls","MediaReplaceFlow","MediaPlaceholder","PanelBody","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","Button","CheckboxControl","ColorPalette","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","setAttributes","props","colors","hasBackgroundColor","backgroundColor","textColor","isLightBackgroundColor","console","log","onBackgroundColorChange","value","onHasBackgroundColorChange","onTextColorChange","children","className","title","label","checked","onChange","style","template","placeholder","allowedBlocks","registerBlockType","save","metadata","name","icon","foreground","src","width","height","viewBox","d","edit","Content"],"sourceRoot":""}
\ No newline at end of file
diff --git a/plugins/carhop-blocks/blocks/content-box/build/view.js.map b/plugins/carhop-blocks/blocks/content-box/build/view.js.map
deleted file mode 100644
index 447c519..0000000
--- a/plugins/carhop-blocks/blocks/content-box/build/view.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"view.js","mappings":";;;;AAAAA,OAAO,CAACC,GAAG,CAAC,qDAAqD,CAAC,C","sources":["webpack://front-header/./src/view.js"],"sourcesContent":["console.log(\"Hello World! (from front-header-front-header block)\");\n"],"names":["console","log"],"sourceRoot":""}
\ No newline at end of file
diff --git a/plugins/carhop-blocks/blocks/content-box/src/edit.js b/plugins/carhop-blocks/blocks/content-box/src/edit.js
index 3f22897..d368eb6 100644
--- a/plugins/carhop-blocks/blocks/content-box/src/edit.js
+++ b/plugins/carhop-blocks/blocks/content-box/src/edit.js
@@ -8,6 +8,7 @@ import {
MediaPlaceholder,
} from "@wordpress/block-editor";
import "./editor.scss";
+import { isColorLight } from "../../_utilities/utilities";
import {
PanelBody,
@@ -22,6 +23,9 @@ export default function Edit({ attributes, setAttributes, ...props }) {
const colors = useSetting("color.palette.theme");
const { hasBackgroundColor, backgroundColor, textColor } = attributes;
+ const isLightBackgroundColor = isColorLight(backgroundColor);
+ console.log(isLightBackgroundColor);
+
function onBackgroundColorChange(value) {
setAttributes({ backgroundColor: value });
}
@@ -73,7 +77,11 @@ export default function Edit({ attributes, setAttributes, ...props }) {
diff --git a/plugins/carhop-blocks/blocks/content-box/src/save.js b/plugins/carhop-blocks/blocks/content-box/src/save.js
index 3df395e..0681660 100644
--- a/plugins/carhop-blocks/blocks/content-box/src/save.js
+++ b/plugins/carhop-blocks/blocks/content-box/src/save.js
@@ -1,11 +1,17 @@
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
+import { isColorLight } from "../../_utilities/utilities";
export default function save({ attributes }) {
const { hasBackgroundColor, backgroundColor, textColor } = attributes;
+ const isLightBackgroundColor = isColorLight(backgroundColor);
return (