From c41db977d6789415f61db22252d46716798da2eb Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 8 Apr 2026 15:55:36 +0200 Subject: [PATCH] FEATURE Refactoring block to best handle urls, innerlink and passing svg arrow for better reusability --- plugins/carhop-blocks/build/cta/index-rtl.css | 11 +- .../carhop-blocks/build/cta/index.asset.php | 2 +- plugins/carhop-blocks/build/cta/index.css | 11 +- plugins/carhop-blocks/build/cta/index.css.map | 2 +- plugins/carhop-blocks/build/cta/index.js | 163 ++++++++++++------ plugins/carhop-blocks/build/cta/index.js.map | 2 +- plugins/carhop-blocks/build/cta/render.php | 40 ++++- .../carhop-blocks/build/cta/style-index.css | 42 +---- .../build/cta/style-index.css.map | 1 - plugins/carhop-blocks/build/cta/view.js | 7 - plugins/carhop-blocks/src/cta/edit.js | 41 ++++- plugins/carhop-blocks/src/cta/editor.scss | 14 +- .../src/cta/img/carhop-fleche-ancre-page.svg | 4 + .../img/carhop-fleche-lien-externe-full.svg | 24 +-- plugins/carhop-blocks/src/cta/render.php | 40 ++++- plugins/carhop-blocks/src/cta/save.js | 20 +-- 16 files changed, 253 insertions(+), 171 deletions(-) delete mode 100644 plugins/carhop-blocks/build/cta/style-index.css.map create mode 100644 plugins/carhop-blocks/src/cta/img/carhop-fleche-ancre-page.svg diff --git a/plugins/carhop-blocks/build/cta/index-rtl.css b/plugins/carhop-blocks/build/cta/index-rtl.css index b53ea44..40c9a25 100644 --- a/plugins/carhop-blocks/build/cta/index-rtl.css +++ b/plugins/carhop-blocks/build/cta/index-rtl.css @@ -1,18 +1,15 @@ /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** 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/cta/editor.scss ***! \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -.wp-block-carhop-blocks-cta { - color: var(--cta-current-color); -} .wp-block-carhop-blocks-cta a { - color: var(--cta-current-color) !important; + padding-bottom: 0 !important; + margin-bottom: 0 !important; } .wp-block-carhop-blocks-cta { padding: 2px; - display: block; width: -moz-fit-content; width: fit-content; - display: flex; + display: flex !important; align-items: center; gap: 10px; line-height: normal; @@ -23,7 +20,7 @@ } .wp-block-carhop-blocks-cta .icon svg path, .wp-block-carhop-blocks-cta .icon svg circle { - stroke: var(--cta-current-color); + stroke: currentColor; } .wp-block-carhop-blocks-cta.align--left { margin-right: 0; diff --git a/plugins/carhop-blocks/build/cta/index.asset.php b/plugins/carhop-blocks/build/cta/index.asset.php index 8a8173c..74f1c10 100644 --- a/plugins/carhop-blocks/build/cta/index.asset.php +++ b/plugins/carhop-blocks/build/cta/index.asset.php @@ -1 +1 @@ - array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '1a1c96d4851a5a9d92ea'); + array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'b611b7ff4b53bdf52fa8'); diff --git a/plugins/carhop-blocks/build/cta/index.css b/plugins/carhop-blocks/build/cta/index.css index 9330584..a218039 100644 --- a/plugins/carhop-blocks/build/cta/index.css +++ b/plugins/carhop-blocks/build/cta/index.css @@ -1,18 +1,15 @@ /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** 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/cta/editor.scss ***! \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -.wp-block-carhop-blocks-cta { - color: var(--cta-current-color); -} .wp-block-carhop-blocks-cta a { - color: var(--cta-current-color) !important; + padding-bottom: 0 !important; + margin-bottom: 0 !important; } .wp-block-carhop-blocks-cta { padding: 2px; - display: block; width: -moz-fit-content; width: fit-content; - display: flex; + display: flex !important; align-items: center; gap: 10px; line-height: normal; @@ -23,7 +20,7 @@ } .wp-block-carhop-blocks-cta .icon svg path, .wp-block-carhop-blocks-cta .icon svg circle { - stroke: var(--cta-current-color); + stroke: currentColor; } .wp-block-carhop-blocks-cta.align--left { margin-left: 0; diff --git a/plugins/carhop-blocks/build/cta/index.css.map b/plugins/carhop-blocks/build/cta/index.css.map index 72d64e3..155ff66 100644 --- a/plugins/carhop-blocks/build/cta/index.css.map +++ b/plugins/carhop-blocks/build/cta/index.css.map @@ -1 +1 @@ -{"version":3,"file":"cta/index.css","mappings":";;;AAAA;EACC;AACD;AAAC;EACC;AAEF;AALA;EAOC;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;AACD;AAEE;EACC;EACA;AAAH;AAEE;;EAEC;AAAH;AAIC;EACC;AAFF;AAIC;EACC;EACA;AAFF;AAIC;EACC;AAFF,C","sources":["webpack://carhop-blocks/./src/cta/editor.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tcolor: var(--cta-current-color);\n\ta {\n\t\tcolor: var(--cta-current-color) !important;\n\n\t\t&:after{}\n\t}\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tstroke: var(--cta-current-color);\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"cta/index.css","mappings":";;;AAEC;EAGC;EACA;AAHF;AAHA;EAQC;EAEA;EAAA;EACA;EACA;EACA;EACA;AAHD;AAME;EACC;EACA;AAJH;AAME;;EAEC;AAJH;AASC;EACC;AAPF;AASC;EACC;EACA;AAPF;AASC;EACC;AAPF,C","sources":["webpack://carhop-blocks/./src/cta/editor.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\t// color: var(--cta-current-color);\n\ta {\n\t\t// color: var(--cta-current-color) !important;\n\n\t\tpadding-bottom: 0 !important;\n\t\tmargin-bottom: 0 !important;\n\t}\n\tpadding: 2px;\n\n\twidth: fit-content;\n\tdisplay: flex !important;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tstroke: currentColor;\n\t\t\t// stroke: var(--cta-current-color);\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/build/cta/index.js b/plugins/carhop-blocks/build/cta/index.js index 8dd6741..6f77600 100644 --- a/plugins/carhop-blocks/build/cta/index.js +++ b/plugins/carhop-blocks/build/cta/index.js @@ -30,8 +30,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/cta/editor.scss"); /* harmony import */ var _img_carhop_fleche_lien_externe_full_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./img/carhop-fleche-lien-externe-full.svg */ "./src/cta/img/carhop-fleche-lien-externe-full.svg"); -/* 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__); +/* harmony import */ var _img_carhop_fleche_ancre_page_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./img/carhop-fleche-ancre-page.svg */ "./src/cta/img/carhop-fleche-ancre-page.svg"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); + @@ -50,37 +52,58 @@ function Edit({ link } = attributes; const colors = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useSetting)("color.palette.theme"); + const isHashLink = typeof link?.url === "string" && link.url.startsWith("#"); function handleColorChange(value) { setAttributes({ color: value }); } - 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__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.AlignmentToolbar, { + console.log(attributes); + console.log(link); + function handleLinkChange(newLink) { + if (!newLink) { + setAttributes({ + link: undefined + }); + return; + } + if (newLink.url) { + newLink.title = newLink.url; + } + console.log(newLink); + setAttributes({ + link: newLink + }); + } + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.AlignmentToolbar, { value: attributes.align, onChange: value => setAttributes({ align: value }) }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { title: "Lien", initialOpen: true, - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.__experimentalLinkControl, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.__experimentalLinkControl, { value: attributes.link, - onChange: value => { - setAttributes({ - link: value - }); + label: "Lien", + onSelect: value => { + console.log("onSelect"); + console.log(value); + }, + onChange: newlink => { + handleLinkChange(newlink); } - }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { + }, "link-control") + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { title: "Couleur", initialOpen: true, - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelRow, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelRow, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { value: color, onChange: value => { handleColorChange(value); @@ -91,14 +114,14 @@ function Edit({ }) })] }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ - className: `cta align--${attributes.align}`, + className: `cta align--${attributes.align}${isHashLink ? " cta--hash-link" : ""}`, style: { "--cta-current-color": color } }), - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText, { tagName: "a", placeholder: "Ajouter un lien", value: attributes.text, @@ -106,7 +129,15 @@ function Edit({ text }), allowedFormats: [] - }) + }), isHashLink ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_img_carhop_fleche_ancre_page_svg__WEBPACK_IMPORTED_MODULE_5__.ReactComponent, { + style: { + color + } + }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_img_carhop_fleche_lien_externe_full_svg__WEBPACK_IMPORTED_MODULE_4__.ReactComponent, { + style: { + color + } + })] })] }); } @@ -123,6 +154,48 @@ __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin +/***/ }), + +/***/ "./src/cta/img/carhop-fleche-ancre-page.svg": +/*!**************************************************!*\ + !*** ./src/cta/img/carhop-fleche-ancre-page.svg ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ReactComponent: () => (/* binding */ SvgCarhopFlecheAncrePage), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +var _circle, _path; +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + +var SvgCarhopFlecheAncrePage = function SvgCarhopFlecheAncrePage(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ + xmlns: "http://www.w3.org/2000/svg", + "aria-hidden": "true", + viewBox: "0 0 32 32" + }, props), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", { + cx: 16, + cy: 16, + r: 15, + fill: "none", + stroke: "currentColor", + strokeWidth: 2 + })), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { + fill: "none", + stroke: "currentColor", + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2, + d: "M16 9v11m-5-3 5 6 5-6" + }))); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPg0KCTxjaXJjbGUgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgY3g9IjE2IiBjeT0iMTYiIHI9IjE1Ii8+DQoJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTYgOXYxMU0xMSAxN2w1IDYgNS02Ii8+DQo8L3N2Zz4NCg=="); + /***/ }), /***/ "./src/cta/img/carhop-fleche-lien-externe-full.svg": @@ -138,26 +211,31 @@ __webpack_require__.r(__webpack_exports__); /* 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__); -var _defs, _path, _circle; +var _g, _circle; function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } var SvgCarhopFlecheLienExterneFull = function SvgCarhopFlecheLienExterneFull(props) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ xmlns: "http://www.w3.org/2000/svg", - id: "carhop-fleche-lien-externe-full_svg__fleche-lien-externe-full", + "aria-hidden": "true", viewBox: "0 0 32 32" - }, props), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("style", null, ".carhop-fleche-lien-externe-full_svg__cls-1{fill:none;stroke:#000;stroke-width:2px}"))), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - d: "m21.15 10.59-9.38 10.02M21.15 21.4V10.59H10.83", - className: "carhop-fleche-lien-externe-full_svg__cls-1" - })), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", { + }, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { + fill: "none", + stroke: "currentColor", + strokeWidth: 2 + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { + d: "m21.15 10.59-9.38 10.02M21.15 21.4V10.59H10.83" + }))), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", { cx: 16, cy: 16, r: 15, - className: "carhop-fleche-lien-externe-full_svg__cls-1" + fill: "none", + stroke: "currentColor", + strokeWidth: 2 }))); }; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iZmxlY2hlLWxpZW4tZXh0ZXJuZS1mdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgICBzdHJva2U6ICMwMDA7CiAgICAgICAgc3Ryb2tlLXdpZHRoOiAycHg7CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgPC9kZWZzPgogIDxnPgogICAgPHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuMTUsMTAuNTlsLTkuMzgsMTAuMDIiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIxLjE1LDIxLjR2LTEwLjgxaC0xMC4zMiIvPgogIDwvZz4KICA8Y2lyY2xlIGNsYXNzPSJjbHMtMSIgY3g9IjE2IiBjeT0iMTYiIHI9IjE1Ii8+Cjwvc3ZnPg=="); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPgoJPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiI+CgkJPHBhdGggZD0iTTIxLjE1LDEwLjU5bC05LjM4LDEwLjAyIi8+CgkJPHBhdGggZD0iTTIxLjE1LDIxLjR2LTEwLjgxaC0xMC4zMiIvPgoJPC9nPgoJPGNpcmNsZSBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTUiLz4KPC9zdmc+Cg=="); /***/ }), @@ -229,37 +307,12 @@ __webpack_require__.r(__webpack_exports__); /* 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 _img_carhop_fleche_lien_externe_full_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./img/carhop-fleche-lien-externe-full.svg */ "./src/cta/img/carhop-fleche-lien-externe-full.svg"); -/* 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({ attributes }) { - const { - align, - link, - text, - color - } = attributes; - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, {}) - // - // {text} - //
- // - //
- //
- ; + return; } /***/ }), diff --git a/plugins/carhop-blocks/build/cta/index.js.map b/plugins/carhop-blocks/build/cta/index.js.map index a7a05f5..22fc235 100644 --- a/plugins/carhop-blocks/build/cta/index.js.map +++ b/plugins/carhop-blocks/build/cta/index.js.map @@ -1 +1 @@ -{"version":3,"file":"cta/index.js","mappings":";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ACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,E;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;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,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://carhop-blocks/./src/cta/edit.js","webpack://carhop-blocks/./src/cta/editor.scss?8c7f","webpack://carhop-blocks/./src/cta/img/carhop-fleche-lien-externe-full.svg","webpack://carhop-blocks/./src/cta/index.js","webpack://carhop-blocks/./src/cta/save.js","webpack://carhop-blocks/./src/cta/style.scss?a37d","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\",\"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":["import { __ } from \"@wordpress/i18n\";\nimport {\n\tuseBlockProps,\n\tRichText,\n\tInspectorControls,\n\t__experimentalLinkControl as LinkControl,\n\tuseSetting,\n} from \"@wordpress/block-editor\";\nimport { PanelBody } from \"@wordpress/components\";\nimport \"./editor.scss\";\nimport { BlockControls, AlignmentToolbar } from \"@wordpress/block-editor\";\nimport { ColorPalette, PanelRow } from \"@wordpress/components\";\nimport { Tip } from \"@wordpress/components\";\nimport { ReactComponent as ArrowIcon } from \"./img/carhop-fleche-lien-externe-full.svg\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { color, link } = attributes;\n\tconst colors = useSetting(\"color.palette.theme\");\n\n\tfunction handleColorChange(value) {\n\t\tsetAttributes({ color: value });\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t setAttributes({ align: value })}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetAttributes({ link: value });\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\thandleColorChange(value);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tcolors={colors}\n\t\t\t\t\t\t\t\tdisableCustomColors={true}\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 setAttributes({ text })}\n\t\t\t\t\tallowedFormats={[]}\n\t\t\t\t/>\n\t\t\t\t{/*
\n\t\t\t\t\t\n\t\t\t\t
*/}\n\t\t\t\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","var _defs, _path, _circle;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nvar SvgCarhopFlecheLienExterneFull = function SvgCarhopFlecheLienExterneFull(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n id: \"carhop-fleche-lien-externe-full_svg__fleche-lien-externe-full\",\n viewBox: \"0 0 32 32\"\n }, props), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".carhop-fleche-lien-externe-full_svg__cls-1{fill:none;stroke:#000;stroke-width:2px}\"))), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m21.15 10.59-9.38 10.02M21.15 21.4V10.59H10.83\",\n className: \"carhop-fleche-lien-externe-full_svg__cls-1\"\n })), _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 16,\n cy: 16,\n r: 15,\n className: \"carhop-fleche-lien-externe-full_svg__cls-1\"\n })));\n};\nexport { SvgCarhopFlecheLienExterneFull as ReactComponent };\nexport default \"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iZmxlY2hlLWxpZW4tZXh0ZXJuZS1mdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgICBzdHJva2U6ICMwMDA7CiAgICAgICAgc3Ryb2tlLXdpZHRoOiAycHg7CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgPC9kZWZzPgogIDxnPgogICAgPHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuMTUsMTAuNTlsLTkuMzgsMTAuMDIiLz4KICAgIDxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIxLjE1LDIxLjR2LTEwLjgxaC0xMC4zMiIvPgogIDwvZz4KICA8Y2lyY2xlIGNsYXNzPSJjbHMtMSIgY3g9IjE2IiBjeT0iMTYiIHI9IjE1Ii8+Cjwvc3ZnPg==\";","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\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\t\n\t\t\t\n\t\t),\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { ReactComponent as ArrowIcon } from \"./img/carhop-fleche-lien-externe-full.svg\";\n\nexport default function save({ attributes }) {\n\tconst { align, link, text, color } = attributes;\n\treturn (\n\t\t<>\n\t\t// \n\t\t// \t{text}\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[\"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\"cta/index\": 0,\n\t\"cta/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, [\"cta/style-index\"], () => (__webpack_require__(\"./src/cta/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","RichText","InspectorControls","__experimentalLinkControl","LinkControl","useSetting","PanelBody","BlockControls","AlignmentToolbar","ColorPalette","PanelRow","Tip","ReactComponent","ArrowIcon","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","color","link","colors","handleColorChange","value","children","align","onChange","title","initialOpen","disableCustomColors","className","style","tagName","placeholder","text","allowedFormats","registerBlockType","save","metadata","name","icon","src","width","height","viewBox","d","stroke","fill","strokeWidth","cx","cy","r","edit"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"cta/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AAOJ;AACiB;AAC3B;AACmD;AACX;AACnB;AAC4C;AACN;AAAA;AAEnE,SAASsB,IAAIA,CAAC;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAE;EAC3D,MAAM;IAAEC,KAAK;IAAEC;EAAK,CAAC,GAAGH,UAAU;EAClC,MAAMI,MAAM,GAAGrB,mEAAU,CAAC,qBAAqB,CAAC;EAChD,MAAMsB,UAAU,GAAG,OAAOF,IAAI,EAAEG,GAAG,KAAK,QAAQ,IAAIH,IAAI,CAACG,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC;EAE5E,SAASC,iBAAiBA,CAACC,KAAK,EAAE;IACjCR,aAAa,CAAC;MAAEC,KAAK,EAAEO;IAAM,CAAC,CAAC;EAChC;EAEAC,OAAO,CAACC,GAAG,CAACX,UAAU,CAAC;EACvBU,OAAO,CAACC,GAAG,CAACR,IAAI,CAAC;EAEjB,SAASS,gBAAgBA,CAACC,OAAO,EAAE;IAClC,IAAI,CAACA,OAAO,EAAE;MACbZ,aAAa,CAAC;QAAEE,IAAI,EAAEW;MAAU,CAAC,CAAC;MAClC;IACD;IAEA,IAAID,O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;;;;;ACAA,sC;;;;;;;;;;ACAA,iC;;;;;;;;;;ACAA,2C;;;;;;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,E;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;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,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://carhop-blocks/./src/cta/edit.js","webpack://carhop-blocks/./src/cta/editor.scss","webpack://carhop-blocks/./src/cta/img/carhop-fleche-ancre-page.svg","webpack://carhop-blocks/./src/cta/img/carhop-fleche-lien-externe-full.svg","webpack://carhop-blocks/./src/cta/index.js","webpack://carhop-blocks/./src/cta/save.js","webpack://carhop-blocks/./src/cta/style.scss","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\",\"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":["import { __ } from \"@wordpress/i18n\";\nimport {\n\tuseBlockProps,\n\tRichText,\n\tInspectorControls,\n\t__experimentalLinkControl as LinkControl,\n\tuseSetting,\n} from \"@wordpress/block-editor\";\nimport { PanelBody } from \"@wordpress/components\";\nimport \"./editor.scss\";\nimport { BlockControls, AlignmentToolbar } from \"@wordpress/block-editor\";\nimport { ColorPalette, PanelRow } from \"@wordpress/components\";\nimport { Tip } from \"@wordpress/components\";\nimport { ReactComponent as ArrowIcon } from \"./img/carhop-fleche-lien-externe-full.svg\";\nimport { ReactComponent as AnchorIcon } from \"./img/carhop-fleche-ancre-page.svg\";\n\nexport default function Edit({ attributes, setAttributes }) {\n\tconst { color, link } = attributes;\n\tconst colors = useSetting(\"color.palette.theme\");\n\tconst isHashLink = typeof link?.url === \"string\" && link.url.startsWith(\"#\");\n\n\tfunction handleColorChange(value) {\n\t\tsetAttributes({ color: value });\n\t}\n\n\tconsole.log(attributes);\n\tconsole.log(link);\n\n\tfunction handleLinkChange(newLink) {\n\t\tif (!newLink) {\n\t\t\tsetAttributes({ link: undefined });\n\t\t\treturn;\n\t\t}\n\n\t\tif (newLink.url) {\n\t\t\tnewLink.title = newLink.url;\n\t\t}\n\n\t\tconsole.log(newLink);\n\t\tsetAttributes({ link: newLink });\n\t}\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t setAttributes({ align: value })}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tconsole.log(\"onSelect\");\n\t\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(newlink) => {\n\t\t\t\t\t\t\t\thandleLinkChange(newlink);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\thandleColorChange(value);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tcolors={colors}\n\t\t\t\t\t\t\t\tdisableCustomColors={true}\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 setAttributes({ text })}\n\t\t\t\t\tallowedFormats={[]}\n\t\t\t\t/>\n\n\t\t\t\t{isHashLink ? (\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 {};","var _circle, _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nvar SvgCarhopFlecheAncrePage = function SvgCarhopFlecheAncrePage(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n viewBox: \"0 0 32 32\"\n }, props), _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 16,\n cy: 16,\n r: 15,\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2,\n d: \"M16 9v11m-5-3 5 6 5-6\"\n })));\n};\nexport { SvgCarhopFlecheAncrePage as ReactComponent };\nexport default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPg0KCTxjaXJjbGUgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgY3g9IjE2IiBjeT0iMTYiIHI9IjE1Ii8+DQoJPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTYgOXYxMU0xMSAxN2w1IDYgNS02Ii8+DQo8L3N2Zz4NCg==\";","var _g, _circle;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nvar SvgCarhopFlecheLienExterneFull = function SvgCarhopFlecheLienExterneFull(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n viewBox: \"0 0 32 32\"\n }, props), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m21.15 10.59-9.38 10.02M21.15 21.4V10.59H10.83\"\n }))), _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 16,\n cy: 16,\n r: 15,\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2\n })));\n};\nexport { SvgCarhopFlecheLienExterneFull as ReactComponent };\nexport default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPgoJPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiI+CgkJPHBhdGggZD0iTTIxLjE1LDEwLjU5bC05LjM4LDEwLjAyIi8+CgkJPHBhdGggZD0iTTIxLjE1LDIxLjR2LTEwLjgxaC0xMC4zMiIvPgoJPC9nPgoJPGNpcmNsZSBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTUiLz4KPC9zdmc+Cg==\";","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\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\t\n\t\t\t\n\t\t),\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps } from \"@wordpress/block-editor\";\nimport { ReactComponent as ArrowIcon } from \"./img/carhop-fleche-lien-externe-full.svg\";\n\nexport default function save({ attributes }) {\n\treturn;\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[\"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\"cta/index\": 0,\n\t\"cta/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, [\"cta/style-index\"], () => (__webpack_require__(\"./src/cta/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","RichText","InspectorControls","__experimentalLinkControl","LinkControl","useSetting","PanelBody","BlockControls","AlignmentToolbar","ColorPalette","PanelRow","Tip","ReactComponent","ArrowIcon","AnchorIcon","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","color","link","colors","isHashLink","url","startsWith","handleColorChange","value","console","log","handleLinkChange","newLink","undefined","title","children","align","onChange","initialOpen","label","onSelect","newlink","disableCustomColors","className","style","tagName","placeholder","text","allowedFormats","registerBlockType","save","metadata","name","icon","src","width","height","viewBox","d","stroke","fill","strokeWidth","cx","cy","r","edit"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/build/cta/render.php b/plugins/carhop-blocks/build/cta/render.php index 31af90e..6696143 100644 --- a/plugins/carhop-blocks/build/cta/render.php +++ b/plugins/carhop-blocks/build/cta/render.php @@ -5,6 +5,10 @@ $text = isset($attributes['text']) ? $attributes['text'] : ''; $color = isset($attributes['color']) ? $attributes['color'] : ''; $target = isset($link) && $link['opensInNewTab'] ? '_blank' : '_self'; +$raw_url = isset($link['url']) ? $link['url'] : ''; +$is_inner_page_link = is_string($raw_url) && strpos($raw_url, '#') === 0; + + $styles = []; if ($color) { $styles[] = 'color: ' . esc_attr($color); @@ -12,7 +16,7 @@ if ($color) { } $wrapper_attributes = get_block_wrapper_attributes([ - 'class' => 'align--' . esc_attr($align), + 'class' => 'align--' . esc_attr($align) . ($is_inner_page_link ? ' cta--inner-page-link' : ' cta--external-page-link'), 'style' => implode('; ', $styles) ]); @@ -21,4 +25,38 @@ $link_url = isset($link['url']) ? esc_url($link['url']) : '#'; target=""> + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/carhop-blocks/build/cta/style-index.css b/plugins/carhop-blocks/build/cta/style-index.css index 4699348..2576558 100644 --- a/plugins/carhop-blocks/build/cta/style-index.css +++ b/plugins/carhop-blocks/build/cta/style-index.css @@ -1,41 +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/cta/style.scss ***! - \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -.wp-block-carhop-blocks-cta { - margin-top: 20px; - color: var(--cta-current-color, currentColor); - padding: 2px; - display: block; - width: -moz-fit-content; - width: fit-content; - display: flex; - align-items: center; - gap: 10px; - line-height: normal; - font-weight: 600; -} -.wp-block-carhop-blocks-cta a { - text-decoration: none; -} -.wp-block-carhop-blocks-cta .icon svg { - width: 30px; - height: 30px; -} -.wp-block-carhop-blocks-cta .icon svg path, -.wp-block-carhop-blocks-cta .icon svg circle { - fill: transparent; - stroke: var(--cta-current-color); - stroke-width: 2; -} -.wp-block-carhop-blocks-cta.align--left { - margin-left: 0; -} -.wp-block-carhop-blocks-cta.align--right { - margin-right: 0; - margin-left: auto; -} -.wp-block-carhop-blocks-cta.align--center { - margin: 0 auto; -} - -/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file +.wp-block-carhop-blocks-cta{align-items:center;color:var(--cta-current-color,currentColor);display:block;display:flex;font-weight:600;gap:10px;line-height:normal;margin-top:20px;padding:2px;width:-moz-fit-content;width:fit-content}.wp-block-carhop-blocks-cta a{text-decoration:none}.wp-block-carhop-blocks-cta .icon svg{height:30px;width:30px}.wp-block-carhop-blocks-cta .icon svg circle,.wp-block-carhop-blocks-cta .icon svg path{fill:transparent;stroke:var(--cta-current-color);stroke-width:2}.wp-block-carhop-blocks-cta.align--left{margin-left:0}.wp-block-carhop-blocks-cta.align--right{margin-left:auto;margin-right:0}.wp-block-carhop-blocks-cta.align--center{margin:0 auto} diff --git a/plugins/carhop-blocks/build/cta/style-index.css.map b/plugins/carhop-blocks/build/cta/style-index.css.map deleted file mode 100644 index 1a9346a..0000000 --- a/plugins/carhop-blocks/build/cta/style-index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cta/style-index.css","mappings":";;;AAAA;EACC;EACA;EAEA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;EAEA;AADD;AAGC;EACC;AADF;AAIE;EACC;EACA;AAFH;AAIE;;EAEC;EACA;EACA;AAFH;AAMC;EACC;AAJF;AAMC;EACC;EACA;AAJF;AAMC;EACC;AAJF,C","sources":["webpack://carhop-blocks/./src/cta/style.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tmargin-top: 20px;\n\tcolor: var(--cta-current-color, currentColor);\n\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\tfont-weight: 600;\n\n\ta {\n\t\ttext-decoration: none;\n\t}\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tfill: transparent;\n\t\t\tstroke: var(--cta-current-color);\n\t\t\tstroke-width: 2;\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/carhop-blocks/build/cta/view.js b/plugins/carhop-blocks/build/cta/view.js index baef117..e69de29 100644 --- a/plugins/carhop-blocks/build/cta/view.js +++ b/plugins/carhop-blocks/build/cta/view.js @@ -1,7 +0,0 @@ -/******/ (() => { // webpackBootstrap -/*!*************************!*\ - !*** ./src/cta/view.js ***! - \*************************/ - -/******/ })() -; \ No newline at end of file diff --git a/plugins/carhop-blocks/src/cta/edit.js b/plugins/carhop-blocks/src/cta/edit.js index 378327a..7fd0acc 100644 --- a/plugins/carhop-blocks/src/cta/edit.js +++ b/plugins/carhop-blocks/src/cta/edit.js @@ -12,15 +12,33 @@ import { BlockControls, AlignmentToolbar } from "@wordpress/block-editor"; import { ColorPalette, PanelRow } from "@wordpress/components"; import { Tip } from "@wordpress/components"; import { ReactComponent as ArrowIcon } from "./img/carhop-fleche-lien-externe-full.svg"; +import { ReactComponent as AnchorIcon } from "./img/carhop-fleche-ancre-page.svg"; export default function Edit({ attributes, setAttributes }) { const { color, link } = attributes; const colors = useSetting("color.palette.theme"); + const isHashLink = typeof link?.url === "string" && link.url.startsWith("#"); function handleColorChange(value) { setAttributes({ color: value }); } + console.log(attributes); + console.log(link); + + function handleLinkChange(newLink) { + if (!newLink) { + setAttributes({ link: undefined }); + return; + } + + if (newLink.url) { + newLink.title = newLink.url; + } + + console.log(newLink); + setAttributes({ link: newLink }); + } return ( <> @@ -33,9 +51,15 @@ export default function Edit({ attributes, setAttributes }) {
{ - setAttributes({ link: value }); + label="Lien" + onSelect={(value) => { + console.log("onSelect"); + console.log(value); + }} + onChange={(newlink) => { + handleLinkChange(newlink); }} />
@@ -56,7 +80,9 @@ export default function Edit({ attributes, setAttributes }) {
setAttributes({ text })} allowedFormats={[]} /> - {/*
- -
*/} + + {isHashLink ? ( + + ) : ( + + )}
); diff --git a/plugins/carhop-blocks/src/cta/editor.scss b/plugins/carhop-blocks/src/cta/editor.scss index 01d6e06..d8a5506 100644 --- a/plugins/carhop-blocks/src/cta/editor.scss +++ b/plugins/carhop-blocks/src/cta/editor.scss @@ -1,14 +1,15 @@ .wp-block-carhop-blocks-cta { - color: var(--cta-current-color); + // color: var(--cta-current-color); a { - color: var(--cta-current-color) !important; + // color: var(--cta-current-color) !important; - &:after{} + padding-bottom: 0 !important; + margin-bottom: 0 !important; } padding: 2px; - display: block; + width: fit-content; - display: flex; + display: flex !important; align-items: center; gap: 10px; line-height: normal; @@ -20,7 +21,8 @@ } svg path, svg circle { - stroke: var(--cta-current-color); + stroke: currentColor; + // stroke: var(--cta-current-color); } } diff --git a/plugins/carhop-blocks/src/cta/img/carhop-fleche-ancre-page.svg b/plugins/carhop-blocks/src/cta/img/carhop-fleche-ancre-page.svg new file mode 100644 index 0000000..cb8d808 --- /dev/null +++ b/plugins/carhop-blocks/src/cta/img/carhop-fleche-ancre-page.svg @@ -0,0 +1,4 @@ + diff --git a/plugins/carhop-blocks/src/cta/img/carhop-fleche-lien-externe-full.svg b/plugins/carhop-blocks/src/cta/img/carhop-fleche-lien-externe-full.svg index 8d401f6..5f6dbf7 100644 --- a/plugins/carhop-blocks/src/cta/img/carhop-fleche-lien-externe-full.svg +++ b/plugins/carhop-blocks/src/cta/img/carhop-fleche-lien-externe-full.svg @@ -1,17 +1,7 @@ - - - - - - - - - - - \ No newline at end of file + diff --git a/plugins/carhop-blocks/src/cta/render.php b/plugins/carhop-blocks/src/cta/render.php index 31af90e..6696143 100644 --- a/plugins/carhop-blocks/src/cta/render.php +++ b/plugins/carhop-blocks/src/cta/render.php @@ -5,6 +5,10 @@ $text = isset($attributes['text']) ? $attributes['text'] : ''; $color = isset($attributes['color']) ? $attributes['color'] : ''; $target = isset($link) && $link['opensInNewTab'] ? '_blank' : '_self'; +$raw_url = isset($link['url']) ? $link['url'] : ''; +$is_inner_page_link = is_string($raw_url) && strpos($raw_url, '#') === 0; + + $styles = []; if ($color) { $styles[] = 'color: ' . esc_attr($color); @@ -12,7 +16,7 @@ if ($color) { } $wrapper_attributes = get_block_wrapper_attributes([ - 'class' => 'align--' . esc_attr($align), + 'class' => 'align--' . esc_attr($align) . ($is_inner_page_link ? ' cta--inner-page-link' : ' cta--external-page-link'), 'style' => implode('; ', $styles) ]); @@ -21,4 +25,38 @@ $link_url = isset($link['url']) ? esc_url($link['url']) : '#'; target=""> + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/carhop-blocks/src/cta/save.js b/plugins/carhop-blocks/src/cta/save.js index 765f40c..20994c5 100644 --- a/plugins/carhop-blocks/src/cta/save.js +++ b/plugins/carhop-blocks/src/cta/save.js @@ -2,23 +2,5 @@ import { useBlockProps } from "@wordpress/block-editor"; import { ReactComponent as ArrowIcon } from "./img/carhop-fleche-lien-externe-full.svg"; export default function save({ attributes }) { - const { align, link, text, color } = attributes; - return ( - <> - // - // {text} - //
- // - //
- //
- ); + return; }