Compare commits
15 Commits
9ded3dc909
...
70ebc1976e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70ebc1976e | ||
|
|
ad0c3174aa | ||
|
|
d29a68356b | ||
|
|
845b7b56f6 | ||
|
|
d73c7d259b | ||
|
|
889d9f01d2 | ||
|
|
596e210aef | ||
|
|
fda00ffac1 | ||
|
|
59f46f2e96 | ||
|
|
235510e7ab | ||
|
|
5c17362daa | ||
|
|
84510f123f | ||
|
|
80ba790a95 | ||
|
|
20951831c9 | ||
|
|
a4de815f0d |
18
plugins/carhop-blocks/blocks/card-grid/.editorconfig
Normal file
18
plugins/carhop-blocks/blocks/card-grid/.editorconfig
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# This file is for unifying the coding style for different editors and IDEs
|
||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
# WordPress Coding Standards
|
||||||
|
# https://make.wordpress.org/core/handbook/coding-standards/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
38
plugins/carhop-blocks/blocks/card-grid/build/block.json
Normal file
38
plugins/carhop-blocks/blocks/card-grid/build/block.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 3,
|
||||||
|
"name": "carhop-blocks/card-grid",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Card Grid",
|
||||||
|
"category": "carhop-blocks",
|
||||||
|
"icon": "smiley",
|
||||||
|
"description": "Boite de contenu pour la mise en forme d'éléments de contenu",
|
||||||
|
"example": {},
|
||||||
|
"supports": {
|
||||||
|
"html": false,
|
||||||
|
"align": [
|
||||||
|
"wide",
|
||||||
|
"full"
|
||||||
|
],
|
||||||
|
"alignWide": true
|
||||||
|
},
|
||||||
|
"textdomain": "carhop-blocks",
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css",
|
||||||
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"align": {
|
||||||
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"columns": {
|
||||||
|
"type": "number",
|
||||||
|
"default": 3
|
||||||
|
},
|
||||||
|
"cardsWithBorder": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
35
plugins/carhop-blocks/blocks/card-grid/build/index-rtl.css
Normal file
35
plugins/carhop-blocks/blocks/card-grid/build/index-rtl.css
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
|
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.card-grid__innerblocks {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.card-grid .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
.card-grid--columns-2 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
.card-grid--columns-3 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
.card-grid--columns-4 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
.card-grid--columns-5 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignwide {
|
||||||
|
max-width: var(--wp--style--global--wide-size, 1200px);
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignfull {
|
||||||
|
max-width: none;
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '8fa7f47191e56bdb1c86');
|
||||||
37
plugins/carhop-blocks/blocks/card-grid/build/index.css
Normal file
37
plugins/carhop-blocks/blocks/card-grid/build/index.css
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
|
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.card-grid__innerblocks {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.card-grid .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
.card-grid--columns-2 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
.card-grid--columns-3 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
.card-grid--columns-4 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
.card-grid--columns-5 .card-grid__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignwide {
|
||||||
|
max-width: var(--wp--style--global--wide-size, 1200px);
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignfull {
|
||||||
|
max-width: none;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=index.css.map*/
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.css","mappings":";;;AACC;EACC;AAAF;AAGC;EAGC;EACA;AAHF;AAKC;EAIC;AANF;AAQC;EAIC;AATF;AAWC;EAIC;AAZF;AAcC;EAIC;AAfF;;AAoBA;EACC;EACA;EACA;AAjBD;;AAoBA;EACC;EACA;EACA;EACA;AAjBD,C","sources":["webpack://front-header/./src/editor.scss"],"sourcesContent":[".card-grid {\n\t&__innerblocks {\n\t\tdisplay: block;\n\t}\n\n\t.card-grid__innerblocks\n\t\t> .block-editor-inner-blocks\n\t\t> .block-editor-block-list__layout {\n\t\tdisplay: grid;\n\t\tgap: 1rem;\n\t}\n\t&--columns-2\n\t\t.card-grid__innerblocks\n\t\t> .block-editor-inner-blocks\n\t\t> .block-editor-block-list__layout {\n\t\tgrid-template-columns: repeat(2, 1fr);\n\t}\n\t&--columns-3\n\t\t.card-grid__innerblocks\n\t\t> .block-editor-inner-blocks\n\t\t> .block-editor-block-list__layout {\n\t\tgrid-template-columns: repeat(3, 1fr);\n\t}\n\t&--columns-4\n\t\t.card-grid__innerblocks\n\t\t> .block-editor-inner-blocks\n\t\t> .block-editor-block-list__layout {\n\t\tgrid-template-columns: repeat(4, 1fr);\n\t}\n\t&--columns-5\n\t\t.card-grid__innerblocks\n\t\t> .block-editor-inner-blocks\n\t\t> .block-editor-block-list__layout {\n\t\tgrid-template-columns: repeat(5, 1fr);\n\t}\n}\n\n// Styles pour les alignements dans l'éditeur\n.card-grid.alignwide {\n\tmax-width: var(--wp--style--global--wide-size, 1200px);\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\n.card-grid.alignfull {\n\tmax-width: none;\n\tmargin-left: 0;\n\tmargin-right: 0;\n\twidth: 100%;\n}\n"],"names":[],"sourceRoot":""}
|
||||||
412
plugins/carhop-blocks/blocks/card-grid/build/index.js
Normal file
412
plugins/carhop-blocks/blocks/card-grid/build/index.js
Normal file
|
|
@ -0,0 +1,412 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "./src/block.json":
|
||||||
|
/*!************************!*\
|
||||||
|
!*** ./src/block.json ***!
|
||||||
|
\************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/card-grid","version":"0.1.0","title":"Card Grid","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"align":["wide","full"],"alignWide":true},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"align":{"type":"string","default":""},"columns":{"type":"number","default":3},"cardsWithBorder":{"type":"boolean","default":true}}}');
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/edit.js":
|
||||||
|
/*!*********************!*\
|
||||||
|
!*** ./src/edit.js ***!
|
||||||
|
\*********************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ Edit)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
||||||
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Edit({
|
||||||
|
attributes,
|
||||||
|
setAttributes,
|
||||||
|
...props
|
||||||
|
}) {
|
||||||
|
const {
|
||||||
|
columns,
|
||||||
|
cardsWithBorder
|
||||||
|
} = attributes;
|
||||||
|
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__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
|
||||||
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nombre de colonnes", "carhop-blocks"),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RangeControl, {
|
||||||
|
__next40pxDefaultSize: true,
|
||||||
|
__nextHasNoMarginBottom: true,
|
||||||
|
initialPosition: 3,
|
||||||
|
label: "Nombre de colonnes",
|
||||||
|
max: 4,
|
||||||
|
min: 2,
|
||||||
|
onChange: value => setAttributes({
|
||||||
|
columns: value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
|
||||||
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Bordure des cartes", "carhop-blocks"),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.CheckboxControl, {
|
||||||
|
label: "Avec bordure",
|
||||||
|
checked: cardsWithBorder,
|
||||||
|
onChange: value => setAttributes({
|
||||||
|
cardsWithBorder: value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("section", {
|
||||||
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
|
className: `card-grid card-grid--columns-${columns} card-grid--cards-${cardsWithBorder ? "with-border" : "without-border"}`
|
||||||
|
}),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||||
|
className: "card-grid__innerblocks",
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
|
||||||
|
template: [["carhop-blocks/content-card", {
|
||||||
|
placeholder: "Ajouter ici le texte"
|
||||||
|
}]],
|
||||||
|
allowedBlocks: ["carhop-blocks/content-card"]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/editor.scss":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** ./src/editor.scss ***!
|
||||||
|
\*************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/index.js":
|
||||||
|
/*!**********************!*\
|
||||||
|
!*** ./src/index.js ***!
|
||||||
|
\**********************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
|
||||||
|
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
|
||||||
|
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js");
|
||||||
|
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
|
||||||
|
icon: {
|
||||||
|
foreground: "#136f63",
|
||||||
|
src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("svg", {
|
||||||
|
width: "40",
|
||||||
|
height: "40",
|
||||||
|
viewBox: "0 0 100 100",
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("g", {
|
||||||
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
|
||||||
|
d: "m50,99.84988l-43.14852,-24.92494l0,-49.84988l43.14852,-24.92494l43.14852,24.92494l0,49.84988l-43.14852,24.92494zm-40.75518,-26.32675l40.75518,23.52312l40.75518,-23.52312l0,-47.04625l-40.75518,-23.55731l-40.75518,23.55731l0,47.04625z"
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
|
||||||
|
d: "m50,86.13945l-31.28439,-18.05263l0,-36.13945l31.28439,-18.05263l31.28439,18.05263l0,36.13945l-31.28439,18.05263zm-13.50528,-28.344l13.50528,7.79545l13.50528,-7.79545l0,-15.59091l-13.50528,-7.79545l-13.50528,7.79545l0,15.59091z"
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
|
||||||
|
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/save.js":
|
||||||
|
/*!*********************!*\
|
||||||
|
!*** ./src/save.js ***!
|
||||||
|
\*********************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ save)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
function save({
|
||||||
|
attributes
|
||||||
|
}) {
|
||||||
|
const {
|
||||||
|
columns,
|
||||||
|
cardsWithBorder,
|
||||||
|
align
|
||||||
|
} = attributes;
|
||||||
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("section", {
|
||||||
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
|
className: `card-grid card-grid--columns-${columns} card-grid--cards-${cardsWithBorder ? "with-border" : "without-border"}${align ? ` align${align}` : ""}`
|
||||||
|
}),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
|
||||||
|
className: "card-grid__innerblocks",
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/style.scss":
|
||||||
|
/*!************************!*\
|
||||||
|
!*** ./src/style.scss ***!
|
||||||
|
\************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/block-editor":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** external ["wp","blockEditor"] ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blockEditor"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/blocks":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** external ["wp","blocks"] ***!
|
||||||
|
\********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/components":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** external ["wp","components"] ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["components"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!******************************!*\
|
||||||
|
!*** external ["wp","i18n"] ***!
|
||||||
|
\******************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["i18n"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "react/jsx-runtime":
|
||||||
|
/*!**********************************!*\
|
||||||
|
!*** external "ReactJSXRuntime" ***!
|
||||||
|
\**********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["ReactJSXRuntime"];
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = (module) => {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ () => (module['default']) :
|
||||||
|
/******/ () => (module);
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = (exports, definition) => {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/make namespace object */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = (exports) => {
|
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||||
|
/******/ }
|
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ "index": 0,
|
||||||
|
/******/ "./style-index": 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = globalThis["webpackChunkfront_header"] = globalThis["webpackChunkfront_header"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.card-grid__innerblocks {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
.card-grid--cards-with-border .content-card {
|
||||||
|
border: 1px solid var(--wp--preset--color--primary);
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
.card-grid--cards-without-border .content-card {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignwide {
|
||||||
|
max-width: var(--wp--style--global--wide-size, 1200px);
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignfull {
|
||||||
|
max-width: none;
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
29
plugins/carhop-blocks/blocks/card-grid/build/style-index.css
Normal file
29
plugins/carhop-blocks/blocks/card-grid/build/style-index.css
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.card-grid__innerblocks {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
.card-grid--cards-with-border .content-card {
|
||||||
|
border: 1px solid var(--wp--preset--color--primary);
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
.card-grid--cards-without-border .content-card {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignwide {
|
||||||
|
max-width: var(--wp--style--global--wide-size, 1200px);
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignfull {
|
||||||
|
max-width: none;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=style-index.css.map*/
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"./style-index.css","mappings":";;;AACC;EACC;EACA;AAAF;AAIE;EACC;EACA;AAFH;AAME;EACC;AAJH;;AAUA;EACC;EACA;EACA;AAPD;;AAUA;EACC;EACA;EACA;EACA;AAPD,C","sources":["webpack://front-header/./src/style.scss"],"sourcesContent":[".card-grid {\r\n\t&__innerblocks {\r\n\t\tdisplay: grid;\r\n\t\tgap: 1rem;\r\n\t}\r\n\r\n\t&--cards-with-border {\r\n\t\t.content-card {\r\n\t\t\tborder: 1px solid var(--wp--preset--color--primary);\r\n\t\t\tpadding: 2rem;\r\n\t\t}\r\n\t}\r\n\t&--cards-without-border {\r\n\t\t.content-card {\r\n\t\t\tborder: none;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// Styles pour les alignements\r\n.card-grid.alignwide {\r\n\tmax-width: var(--wp--style--global--wide-size, 1200px);\r\n\tmargin-left: auto;\r\n\tmargin-right: auto;\r\n}\r\n\r\n.card-grid.alignfull {\r\n\tmax-width: none;\r\n\tmargin-left: 0;\r\n\tmargin-right: 0;\r\n\twidth: 100%;\r\n}\r\n"],"names":[],"sourceRoot":""}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array(), 'version' => '9618df91ea3d5989c295');
|
||||||
7
plugins/carhop-blocks/blocks/card-grid/build/view.js
Normal file
7
plugins/carhop-blocks/blocks/card-grid/build/view.js
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/*!*********************!*\
|
||||||
|
!*** ./src/view.js ***!
|
||||||
|
\*********************/
|
||||||
|
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
21
plugins/carhop-blocks/blocks/card-grid/package.json
Normal file
21
plugins/carhop-blocks/blocks/card-grid/package.json
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"name": "front-header",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Example block scaffolded with Create Block tool.",
|
||||||
|
"author": "The WordPress Contributors",
|
||||||
|
"license": "GPL-2.0-or-later",
|
||||||
|
"main": "build/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "wp-scripts build",
|
||||||
|
"format": "wp-scripts format",
|
||||||
|
"lint:css": "wp-scripts lint-style",
|
||||||
|
"lint:js": "wp-scripts lint-js",
|
||||||
|
"packages-update": "wp-scripts packages-update",
|
||||||
|
"plugin-zip": "wp-scripts plugin-zip",
|
||||||
|
"start": "wp-scripts start"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@wordpress/scripts": "^30.12.0"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
|
||||||
|
}
|
||||||
12865
plugins/carhop-blocks/blocks/card-grid/pnpm-lock.yaml
Normal file
12865
plugins/carhop-blocks/blocks/card-grid/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
plugins/carhop-blocks/blocks/card-grid/src/.DS_Store
vendored
Normal file
BIN
plugins/carhop-blocks/blocks/card-grid/src/.DS_Store
vendored
Normal file
Binary file not shown.
38
plugins/carhop-blocks/blocks/card-grid/src/block.json
Normal file
38
plugins/carhop-blocks/blocks/card-grid/src/block.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 3,
|
||||||
|
"name": "carhop-blocks/card-grid",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Card Grid",
|
||||||
|
"category": "carhop-blocks",
|
||||||
|
"icon": "smiley",
|
||||||
|
"description": "Boite de contenu pour la mise en forme d'éléments de contenu",
|
||||||
|
"example": {},
|
||||||
|
"supports": {
|
||||||
|
"html": false,
|
||||||
|
"align": [
|
||||||
|
"wide",
|
||||||
|
"full"
|
||||||
|
],
|
||||||
|
"alignWide": true
|
||||||
|
},
|
||||||
|
"textdomain": "carhop-blocks",
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css",
|
||||||
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"align": {
|
||||||
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"columns": {
|
||||||
|
"type": "number",
|
||||||
|
"default": 3
|
||||||
|
},
|
||||||
|
"cardsWithBorder": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
63
plugins/carhop-blocks/blocks/card-grid/src/edit.js
Normal file
63
plugins/carhop-blocks/blocks/card-grid/src/edit.js
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
import { __ } from "@wordpress/i18n";
|
||||||
|
import {
|
||||||
|
useBlockProps,
|
||||||
|
InnerBlocks,
|
||||||
|
InspectorControls,
|
||||||
|
} from "@wordpress/block-editor";
|
||||||
|
import "./editor.scss";
|
||||||
|
|
||||||
|
import {
|
||||||
|
PanelBody,
|
||||||
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
||||||
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
||||||
|
RangeControl,
|
||||||
|
CheckboxControl,
|
||||||
|
} from "@wordpress/components";
|
||||||
|
|
||||||
|
export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
|
const { columns, cardsWithBorder } = attributes;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<InspectorControls>
|
||||||
|
<PanelBody title={__("Nombre de colonnes", "carhop-blocks")}>
|
||||||
|
<RangeControl
|
||||||
|
__next40pxDefaultSize
|
||||||
|
__nextHasNoMarginBottom
|
||||||
|
initialPosition={3}
|
||||||
|
label="Nombre de colonnes"
|
||||||
|
max={4}
|
||||||
|
min={2}
|
||||||
|
onChange={(value) => setAttributes({ columns: value })}
|
||||||
|
/>
|
||||||
|
</PanelBody>
|
||||||
|
<PanelBody title={__("Bordure des cartes", "carhop-blocks")}>
|
||||||
|
<CheckboxControl
|
||||||
|
label="Avec bordure"
|
||||||
|
checked={cardsWithBorder}
|
||||||
|
onChange={(value) => setAttributes({ cardsWithBorder: value })}
|
||||||
|
/>
|
||||||
|
</PanelBody>
|
||||||
|
</InspectorControls>
|
||||||
|
<section
|
||||||
|
{...useBlockProps({
|
||||||
|
className: `card-grid card-grid--columns-${columns} card-grid--cards-${
|
||||||
|
cardsWithBorder ? "with-border" : "without-border"
|
||||||
|
}`,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<div className="card-grid__innerblocks">
|
||||||
|
<InnerBlocks
|
||||||
|
template={[
|
||||||
|
[
|
||||||
|
"carhop-blocks/content-card",
|
||||||
|
{ placeholder: "Ajouter ici le texte" },
|
||||||
|
],
|
||||||
|
]}
|
||||||
|
allowedBlocks={["carhop-blocks/content-card"]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
50
plugins/carhop-blocks/blocks/card-grid/src/editor.scss
Normal file
50
plugins/carhop-blocks/blocks/card-grid/src/editor.scss
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
.card-grid {
|
||||||
|
&__innerblocks {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid__innerblocks
|
||||||
|
> .block-editor-inner-blocks
|
||||||
|
> .block-editor-block-list__layout {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
&--columns-2
|
||||||
|
.card-grid__innerblocks
|
||||||
|
> .block-editor-inner-blocks
|
||||||
|
> .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
&--columns-3
|
||||||
|
.card-grid__innerblocks
|
||||||
|
> .block-editor-inner-blocks
|
||||||
|
> .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
&--columns-4
|
||||||
|
.card-grid__innerblocks
|
||||||
|
> .block-editor-inner-blocks
|
||||||
|
> .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
&--columns-5
|
||||||
|
.card-grid__innerblocks
|
||||||
|
> .block-editor-inner-blocks
|
||||||
|
> .block-editor-block-list__layout {
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Styles pour les alignements dans l'éditeur
|
||||||
|
.card-grid.alignwide {
|
||||||
|
max-width: var(--wp--style--global--wide-size, 1200px);
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignfull {
|
||||||
|
max-width: none;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
22
plugins/carhop-blocks/blocks/card-grid/src/index.js
Normal file
22
plugins/carhop-blocks/blocks/card-grid/src/index.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { registerBlockType } from "@wordpress/blocks";
|
||||||
|
import "./style.scss";
|
||||||
|
|
||||||
|
import Edit from "./edit";
|
||||||
|
import save from "./save";
|
||||||
|
import metadata from "./block.json";
|
||||||
|
|
||||||
|
registerBlockType(metadata.name, {
|
||||||
|
icon: {
|
||||||
|
foreground: "#136f63",
|
||||||
|
src: (
|
||||||
|
<svg width="40" height="40" viewBox="0 0 100 100">
|
||||||
|
<g>
|
||||||
|
<path d="m50,99.84988l-43.14852,-24.92494l0,-49.84988l43.14852,-24.92494l43.14852,24.92494l0,49.84988l-43.14852,24.92494zm-40.75518,-26.32675l40.75518,23.52312l40.75518,-23.52312l0,-47.04625l-40.75518,-23.55731l-40.75518,23.55731l0,47.04625z" />
|
||||||
|
<path d="m50,86.13945l-31.28439,-18.05263l0,-36.13945l31.28439,-18.05263l31.28439,18.05263l0,36.13945l-31.28439,18.05263zm-13.50528,-28.344l13.50528,7.79545l13.50528,-7.79545l0,-15.59091l-13.50528,-7.79545l-13.50528,7.79545l0,15.59091z" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
edit: Edit,
|
||||||
|
save,
|
||||||
|
});
|
||||||
18
plugins/carhop-blocks/blocks/card-grid/src/save.js
Normal file
18
plugins/carhop-blocks/blocks/card-grid/src/save.js
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
||||||
|
|
||||||
|
export default function save({ attributes }) {
|
||||||
|
const { columns, cardsWithBorder, align } = attributes;
|
||||||
|
return (
|
||||||
|
<section
|
||||||
|
{...useBlockProps.save({
|
||||||
|
className: `card-grid card-grid--columns-${columns} card-grid--cards-${
|
||||||
|
cardsWithBorder ? "with-border" : "without-border"
|
||||||
|
}${align ? ` align${align}` : ""}`,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<div className="card-grid__innerblocks">
|
||||||
|
<InnerBlocks.Content />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
32
plugins/carhop-blocks/blocks/card-grid/src/style.scss
Normal file
32
plugins/carhop-blocks/blocks/card-grid/src/style.scss
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
.card-grid {
|
||||||
|
&__innerblocks {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--cards-with-border {
|
||||||
|
.content-card {
|
||||||
|
border: 1px solid var(--wp--preset--color--primary);
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&--cards-without-border {
|
||||||
|
.content-card {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Styles pour les alignements
|
||||||
|
.card-grid.alignwide {
|
||||||
|
max-width: var(--wp--style--global--wide-size, 1200px);
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-grid.alignfull {
|
||||||
|
max-width: none;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
0
plugins/carhop-blocks/blocks/card-grid/src/view.js
Normal file
0
plugins/carhop-blocks/blocks/card-grid/src/view.js
Normal file
|
|
@ -30,6 +30,14 @@
|
||||||
"contained"
|
"contained"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"coverType": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "image",
|
||||||
|
"enum": [
|
||||||
|
"classic",
|
||||||
|
"photoframe"
|
||||||
|
]
|
||||||
|
},
|
||||||
"coverUrl": {
|
"coverUrl": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => 'd0e3316a30114b6e5e46');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '1c6fc2bb0489b28aa083');
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ const trash = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx
|
||||||
\************************/
|
\************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/chapter-section","version":"0.1.0","title":" Section Chapitre","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"align":{"type":"string","default":"full"},"blockWidth":{"type":"string","default":"full","enum":["full","contained"]},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"coverId":{"type":"number"},"coverSize":{"type":"string","default":"large","enum":["small","medium","grande","large"]},"disposition":{"type":"string","default":"left","enum":["left","right"]},"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#ffffff"},"textColor":{"type":"string","default":"#136f63"},"backgroundOrientation":{"type":"string","default":"left","enum":["left","right"]}},"usesContext":["postType","postId"]}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/chapter-section","version":"0.1.0","title":" Section Chapitre","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"align":{"type":"string","default":"full"},"blockWidth":{"type":"string","default":"full","enum":["full","contained"]},"coverType":{"type":"string","default":"image","enum":["classic","photoframe"]},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"coverId":{"type":"number"},"coverSize":{"type":"string","default":"large","enum":["small","medium","grande","large"]},"disposition":{"type":"string","default":"left","enum":["left","right"]},"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#ffffff"},"textColor":{"type":"string","default":"#136f63"},"backgroundOrientation":{"type":"string","default":"left","enum":["left","right"]}},"usesContext":["postType","postId"]}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -80,6 +80,7 @@ function Edit({
|
||||||
const colors = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useSetting)("color.palette.theme");
|
const colors = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useSetting)("color.palette.theme");
|
||||||
const {
|
const {
|
||||||
disposition,
|
disposition,
|
||||||
|
coverType,
|
||||||
coverUrl,
|
coverUrl,
|
||||||
coverAlt,
|
coverAlt,
|
||||||
coverId,
|
coverId,
|
||||||
|
|
@ -124,6 +125,11 @@ function Edit({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function onCoverTypeChange(value) {
|
||||||
|
setAttributes({
|
||||||
|
coverType: value
|
||||||
|
});
|
||||||
|
}
|
||||||
function onBackgroundOrientationChange(value) {
|
function onBackgroundOrientationChange(value) {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
backgroundOrientation: value
|
backgroundOrientation: value
|
||||||
|
|
@ -174,6 +180,19 @@ function Edit({
|
||||||
onClick: removeCoverAttributes
|
onClick: removeCoverAttributes
|
||||||
})
|
})
|
||||||
})]
|
})]
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
|
||||||
|
className: "deligraph-blocks__variant",
|
||||||
|
isBlock: true,
|
||||||
|
label: "Type d'image",
|
||||||
|
onChange: onCoverTypeChange,
|
||||||
|
value: coverType,
|
||||||
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
||||||
|
label: "Classique",
|
||||||
|
value: "classic"
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
||||||
|
label: "Encadr\xE9e",
|
||||||
|
value: "photoframe"
|
||||||
|
})]
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
|
||||||
className: "deligraph-blocks__variant",
|
className: "deligraph-blocks__variant",
|
||||||
isBlock: true,
|
isBlock: true,
|
||||||
|
|
@ -271,7 +290,7 @@ function Edit({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}), coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
}), coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
||||||
className: `chapter-section__cover chapter-section__cover--${coverSize}`,
|
className: `chapter-section__cover chapter-section__cover--${coverSize} chapter-section__cover--${coverType}`,
|
||||||
src: coverUrl,
|
src: coverUrl,
|
||||||
alt: coverAlt
|
alt: coverAlt
|
||||||
}), !coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaPlaceholder, {
|
}), !coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaPlaceholder, {
|
||||||
|
|
@ -361,6 +380,7 @@ function save({
|
||||||
coverUrl,
|
coverUrl,
|
||||||
coverAlt,
|
coverAlt,
|
||||||
coverSize,
|
coverSize,
|
||||||
|
coverType,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
hasBackgroundColor,
|
hasBackgroundColor,
|
||||||
backgroundOrientation,
|
backgroundOrientation,
|
||||||
|
|
@ -391,7 +411,7 @@ function save({
|
||||||
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_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
|
||||||
})
|
})
|
||||||
}), coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("img", {
|
}), coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("img", {
|
||||||
className: `chapter-section__cover chapter-section__cover--${coverSize}`,
|
className: `chapter-section__cover chapter-section__cover--${coverSize} chapter-section__cover--${coverType}`,
|
||||||
src: coverUrl,
|
src: coverUrl,
|
||||||
alt: coverAlt
|
alt: coverAlt
|
||||||
})]
|
})]
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -30,6 +30,14 @@
|
||||||
"contained"
|
"contained"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"coverType": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "image",
|
||||||
|
"enum": [
|
||||||
|
"classic",
|
||||||
|
"photoframe"
|
||||||
|
]
|
||||||
|
},
|
||||||
"coverUrl": {
|
"coverUrl": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
const colors = useSetting("color.palette.theme");
|
const colors = useSetting("color.palette.theme");
|
||||||
const {
|
const {
|
||||||
disposition,
|
disposition,
|
||||||
|
coverType,
|
||||||
coverUrl,
|
coverUrl,
|
||||||
coverAlt,
|
coverAlt,
|
||||||
coverId,
|
coverId,
|
||||||
|
|
@ -60,6 +61,9 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
setAttributes({ backgroundColor: null });
|
setAttributes({ backgroundColor: null });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function onCoverTypeChange(value) {
|
||||||
|
setAttributes({ coverType: value });
|
||||||
|
}
|
||||||
|
|
||||||
function onBackgroundOrientationChange(value) {
|
function onBackgroundOrientationChange(value) {
|
||||||
setAttributes({ backgroundOrientation: value });
|
setAttributes({ backgroundOrientation: value });
|
||||||
|
|
@ -113,6 +117,16 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ToggleGroupControl
|
||||||
|
className="deligraph-blocks__variant"
|
||||||
|
isBlock
|
||||||
|
label="Type d'image"
|
||||||
|
onChange={onCoverTypeChange}
|
||||||
|
value={coverType}
|
||||||
|
>
|
||||||
|
<ToggleGroupControlOption label="Classique" value="classic" />
|
||||||
|
<ToggleGroupControlOption label="Encadrée" value="photoframe" />
|
||||||
|
</ToggleGroupControl>
|
||||||
<ToggleGroupControl
|
<ToggleGroupControl
|
||||||
className="deligraph-blocks__variant"
|
className="deligraph-blocks__variant"
|
||||||
isBlock
|
isBlock
|
||||||
|
|
@ -241,7 +255,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
</div>
|
</div>
|
||||||
{coverUrl && (
|
{coverUrl && (
|
||||||
<img
|
<img
|
||||||
className={`chapter-section__cover chapter-section__cover--${coverSize}`}
|
className={`chapter-section__cover chapter-section__cover--${coverSize} chapter-section__cover--${coverType}`}
|
||||||
src={coverUrl}
|
src={coverUrl}
|
||||||
alt={coverAlt}
|
alt={coverAlt}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ export default function save({ attributes }) {
|
||||||
coverUrl,
|
coverUrl,
|
||||||
coverAlt,
|
coverAlt,
|
||||||
coverSize,
|
coverSize,
|
||||||
|
coverType,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
hasBackgroundColor,
|
hasBackgroundColor,
|
||||||
backgroundOrientation,
|
backgroundOrientation,
|
||||||
|
|
@ -47,7 +48,7 @@ export default function save({ attributes }) {
|
||||||
</div>
|
</div>
|
||||||
{coverUrl && (
|
{coverUrl && (
|
||||||
<img
|
<img
|
||||||
className={`chapter-section__cover chapter-section__cover--${coverSize}`}
|
className={`chapter-section__cover chapter-section__cover--${coverSize} chapter-section__cover--${coverType}`}
|
||||||
src={coverUrl}
|
src={coverUrl}
|
||||||
alt={coverAlt}
|
alt={coverAlt}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "#136f63"
|
"default": "#136f63"
|
||||||
},
|
},
|
||||||
|
"hasLightBackground": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"textColor": {
|
"textColor": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "#ffffff"
|
"default": "#ffffff"
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'a78cf784effd61db8731');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '1e925ab101f7d6d0270a');
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ function isColorLight(color) {
|
||||||
\************************/
|
\************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Content Box","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#136f63"},"textColor":{"type":"string","default":"#ffffff"}}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Content Box","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#136f63"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"#ffffff"}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -80,11 +80,22 @@ function Edit({
|
||||||
const {
|
const {
|
||||||
hasBackgroundColor,
|
hasBackgroundColor,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
textColor
|
textColor,
|
||||||
|
hasLightBackground
|
||||||
} = attributes;
|
} = attributes;
|
||||||
const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_3__.isColorLight)(backgroundColor);
|
|
||||||
console.log(isLightBackgroundColor);
|
|
||||||
function onBackgroundColorChange(value) {
|
function onBackgroundColorChange(value) {
|
||||||
|
if (value === undefined) {
|
||||||
|
setAttributes({
|
||||||
|
hasBackgroundColor: false
|
||||||
|
});
|
||||||
|
setAttributes({
|
||||||
|
backgroundColor: "transparent"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_3__.isColorLight)(backgroundColor);
|
||||||
|
setAttributes({
|
||||||
|
hasLightBackground: isLightBackgroundColor
|
||||||
|
});
|
||||||
setAttributes({
|
setAttributes({
|
||||||
backgroundColor: value
|
backgroundColor: value
|
||||||
});
|
});
|
||||||
|
|
@ -133,10 +144,10 @@ function Edit({
|
||||||
})]
|
})]
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("section", {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("section", {
|
||||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
className: `content-box ${isLightBackgroundColor ? "content-box--bg-light" : "content-box--bg-dark"}`,
|
className: `content-box ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-background-color": backgroundColor,
|
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
"--content-box-text-color": textColor
|
"--content-box-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
||||||
|
|
@ -145,7 +156,7 @@ function Edit({
|
||||||
template: [["core/paragraph", {
|
template: [["core/paragraph", {
|
||||||
placeholder: "Ajouter ici le texte"
|
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", "carhop-blocks/cta-group", "ninja-forms/form"]
|
allowedBlocks: ["core/heading", "core/paragraph", "core/group", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "acf/statistics-datas", "carhop-blocks/scroll-story-block", "carhop-blocks/cta-group", "ninja-forms/form"]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})]
|
})]
|
||||||
|
|
@ -231,17 +242,17 @@ function save({
|
||||||
attributes
|
attributes
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
hasBackgroundColor,
|
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
textColor
|
textColor,
|
||||||
|
hasLightBackground,
|
||||||
|
hasBackgroundColor
|
||||||
} = attributes;
|
} = attributes;
|
||||||
const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_1__.isColorLight)(backgroundColor);
|
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
|
||||||
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
className: `content-box ${isLightBackgroundColor ? "content-box--bg-light" : "content-box--bg-dark"}`,
|
className: `content-box ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-background-color": backgroundColor,
|
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
"--content-box-text-color": textColor
|
"--content-box-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -25,6 +25,10 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "#136f63"
|
"default": "#136f63"
|
||||||
},
|
},
|
||||||
|
"hasLightBackground": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"textColor": {
|
"textColor": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "#ffffff"
|
"default": "#ffffff"
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,17 @@ import {
|
||||||
|
|
||||||
export default function Edit({ attributes, setAttributes, ...props }) {
|
export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
const colors = useSetting("color.palette.theme");
|
const colors = useSetting("color.palette.theme");
|
||||||
const { hasBackgroundColor, backgroundColor, textColor } = attributes;
|
const { hasBackgroundColor, backgroundColor, textColor, hasLightBackground } =
|
||||||
|
attributes;
|
||||||
const isLightBackgroundColor = isColorLight(backgroundColor);
|
|
||||||
console.log(isLightBackgroundColor);
|
|
||||||
|
|
||||||
function onBackgroundColorChange(value) {
|
function onBackgroundColorChange(value) {
|
||||||
|
if (value === undefined) {
|
||||||
|
setAttributes({ hasBackgroundColor: false });
|
||||||
|
setAttributes({ backgroundColor: "transparent" });
|
||||||
|
}
|
||||||
|
const isLightBackgroundColor = isColorLight(backgroundColor);
|
||||||
|
setAttributes({ hasLightBackground: isLightBackgroundColor });
|
||||||
|
|
||||||
setAttributes({ backgroundColor: value });
|
setAttributes({ backgroundColor: value });
|
||||||
}
|
}
|
||||||
function onHasBackgroundColorChange(value) {
|
function onHasBackgroundColorChange(value) {
|
||||||
|
|
@ -78,13 +83,15 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
<section
|
<section
|
||||||
{...useBlockProps({
|
{...useBlockProps({
|
||||||
className: `content-box ${
|
className: `content-box ${
|
||||||
isLightBackgroundColor
|
hasLightBackground
|
||||||
? "content-box--bg-light"
|
? "content-box--bg-light"
|
||||||
: "content-box--bg-dark"
|
: "content-box--bg-dark"
|
||||||
}`,
|
}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-background-color": backgroundColor,
|
"--content-box-text-color": textColor ?? "inherit",
|
||||||
"--content-box-text-color": textColor,
|
"--content-box-background-color": hasBackgroundColor
|
||||||
|
? backgroundColor
|
||||||
|
: "transparent",
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
@ -96,6 +103,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
allowedBlocks={[
|
allowedBlocks={[
|
||||||
"core/heading",
|
"core/heading",
|
||||||
"core/paragraph",
|
"core/paragraph",
|
||||||
|
"core/group",
|
||||||
"core/list",
|
"core/list",
|
||||||
"core/button",
|
"core/button",
|
||||||
"core/buttons",
|
"core/buttons",
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,19 @@ import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
||||||
import { isColorLight } from "../../_utilities/utilities";
|
import { isColorLight } from "../../_utilities/utilities";
|
||||||
|
|
||||||
export default function save({ attributes }) {
|
export default function save({ attributes }) {
|
||||||
const { hasBackgroundColor, backgroundColor, textColor } = attributes;
|
const { backgroundColor, textColor, hasLightBackground, hasBackgroundColor } =
|
||||||
const isLightBackgroundColor = isColorLight(backgroundColor);
|
attributes;
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
{...useBlockProps.save({
|
{...useBlockProps.save({
|
||||||
className: `content-box ${
|
className: `content-box ${
|
||||||
isLightBackgroundColor
|
hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"
|
||||||
? "content-box--bg-light"
|
|
||||||
: "content-box--bg-dark"
|
|
||||||
}`,
|
}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-box-background-color": backgroundColor,
|
"--content-box-text-color": textColor ?? "inherit",
|
||||||
"--content-box-text-color": textColor,
|
"--content-box-background-color": hasBackgroundColor
|
||||||
|
? backgroundColor
|
||||||
|
: "transparent",
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
18
plugins/carhop-blocks/blocks/content-card/.editorconfig
Normal file
18
plugins/carhop-blocks/blocks/content-card/.editorconfig
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# This file is for unifying the coding style for different editors and IDEs
|
||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
# WordPress Coding Standards
|
||||||
|
# https://make.wordpress.org/core/handbook/coding-standards/
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
37
plugins/carhop-blocks/blocks/content-card/build/block.json
Normal file
37
plugins/carhop-blocks/blocks/content-card/build/block.json
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 3,
|
||||||
|
"name": "carhop-blocks/content-card",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Content Card",
|
||||||
|
"category": "carhop-blocks",
|
||||||
|
"icon": "smiley",
|
||||||
|
"description": "Carte de contenu pour la mise en forme d'éléments de contenu",
|
||||||
|
"example": {},
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"textdomain": "carhop-blocks",
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css",
|
||||||
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"hasBackgroundColor": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "#136f63"
|
||||||
|
},
|
||||||
|
"hasLightBackground": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"textColor": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "#136f63"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
|
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'ed13236e340dd1b6f174');
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
|
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
493
plugins/carhop-blocks/blocks/content-card/build/index.js
Normal file
493
plugins/carhop-blocks/blocks/content-card/build/index.js
Normal file
|
|
@ -0,0 +1,493 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "../_utilities/utilities.js":
|
||||||
|
/*!**********************************!*\
|
||||||
|
!*** ../_utilities/utilities.js ***!
|
||||||
|
\**********************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ isColorLight: () => (/* binding */ isColorLight)
|
||||||
|
/* harmony export */ });
|
||||||
|
// Fonction pour déterminer si une couleur est claire ou sombre
|
||||||
|
function isColorLight(color) {
|
||||||
|
// Si pas de couleur, considérer comme claire
|
||||||
|
if (!color) return true;
|
||||||
|
|
||||||
|
// Convertir hex en RGB
|
||||||
|
let hex = color.replace("#", "");
|
||||||
|
if (hex.length === 3) {
|
||||||
|
hex = hex.split("").map(char => char + char).join("");
|
||||||
|
}
|
||||||
|
const r = parseInt(hex.substr(0, 2), 16);
|
||||||
|
const g = parseInt(hex.substr(2, 2), 16);
|
||||||
|
const b = parseInt(hex.substr(4, 2), 16);
|
||||||
|
|
||||||
|
// Calculer la luminance relative (formule standard)
|
||||||
|
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
||||||
|
|
||||||
|
// Si luminance > 0.5, la couleur est claire
|
||||||
|
return luminance > 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/block.json":
|
||||||
|
/*!************************!*\
|
||||||
|
!*** ./src/block.json ***!
|
||||||
|
\************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-card","version":"0.1.0","title":"Content Card","category":"carhop-blocks","icon":"smiley","description":"Carte de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#136f63"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"#136f63"}}}');
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/edit.js":
|
||||||
|
/*!*********************!*\
|
||||||
|
!*** ./src/edit.js ***!
|
||||||
|
\*********************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ Edit)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
||||||
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Edit({
|
||||||
|
attributes,
|
||||||
|
setAttributes,
|
||||||
|
...props
|
||||||
|
}) {
|
||||||
|
const colors = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useSetting)("color.palette.theme");
|
||||||
|
const {
|
||||||
|
hasBackgroundColor,
|
||||||
|
backgroundColor,
|
||||||
|
textColor,
|
||||||
|
hasLightBackground
|
||||||
|
} = attributes;
|
||||||
|
function onBackgroundColorChange(value) {
|
||||||
|
if (value === undefined) {
|
||||||
|
setAttributes({
|
||||||
|
hasBackgroundColor: false
|
||||||
|
});
|
||||||
|
setAttributes({
|
||||||
|
backgroundColor: "transparent"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const isLightBackgroundColor = (0,_utilities_utilities__WEBPACK_IMPORTED_MODULE_3__.isColorLight)(backgroundColor);
|
||||||
|
setAttributes({
|
||||||
|
hasLightBackground: isLightBackgroundColor
|
||||||
|
});
|
||||||
|
setAttributes({
|
||||||
|
backgroundColor: value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onHasBackgroundColorChange(value) {
|
||||||
|
setAttributes({
|
||||||
|
hasBackgroundColor: value
|
||||||
|
});
|
||||||
|
if (!value) {
|
||||||
|
setAttributes({
|
||||||
|
backgroundColor: null
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function onTextColorChange(value) {
|
||||||
|
setAttributes({
|
||||||
|
textColor: 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__.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_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_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_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_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_5__.jsx)("div", {
|
||||||
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
|
className: `content-card ${hasLightBackground ? "content-card--bg-light" : "content-card--bg-dark"}`,
|
||||||
|
style: {
|
||||||
|
"--content-card-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
|
"--content-card-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
||||||
|
className: "content-card__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/group", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/cta-group"]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/editor.scss":
|
||||||
|
/*!*************************!*\
|
||||||
|
!*** ./src/editor.scss ***!
|
||||||
|
\*************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/index.js":
|
||||||
|
/*!**********************!*\
|
||||||
|
!*** ./src/index.js ***!
|
||||||
|
\**********************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
|
||||||
|
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
|
||||||
|
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js");
|
||||||
|
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
|
||||||
|
icon: {
|
||||||
|
foreground: "#136f63",
|
||||||
|
src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("svg", {
|
||||||
|
width: "18",
|
||||||
|
height: "18",
|
||||||
|
viewBox: "0 0 18 18",
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("g", {
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
|
||||||
|
d: "M1,5c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM3,0H1C.4,0,0,.4,0,1v2c0,.6.4,1,1,1s1-.4,1-1v-1h1c.6,0,1-.4,1-1s-.4-1-1-1ZM6,2h2c.6,0,1-.4,1-1s-.4-1-1-1h-2c-.6,0-1,.4-1,1s.4,1,1,1ZM1,10c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM6,7v4c0,.6.4,1,1,1h4c.6,0,1-.4,1-1v-4c0-.6-.4-1-1-1h-4c-.6,0-1,.4-1,1ZM12,16h-2c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1s-.4-1-1-1ZM17,9c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM17,4c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM17,14c-.6,0-1,.4-1,1v1h-1c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1v-2c0-.6-.4-1-1-1ZM7,16h-2c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1s-.4-1-1-1ZM13,0h-2c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1s-.4-1-1-1Z"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
|
||||||
|
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/save.js":
|
||||||
|
/*!*********************!*\
|
||||||
|
!*** ./src/save.js ***!
|
||||||
|
\*********************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ save)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _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({
|
||||||
|
attributes
|
||||||
|
}) {
|
||||||
|
const {
|
||||||
|
backgroundColor,
|
||||||
|
textColor,
|
||||||
|
hasLightBackground,
|
||||||
|
hasBackgroundColor
|
||||||
|
} = attributes;
|
||||||
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||||
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
|
className: `content-card ${hasLightBackground ? "content-card--bg-light" : "content-card--bg-dark"}`,
|
||||||
|
style: {
|
||||||
|
"--content-card-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
|
"--content-card-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||||
|
className: "content-card__innerblocks",
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/style.scss":
|
||||||
|
/*!************************!*\
|
||||||
|
!*** ./src/style.scss ***!
|
||||||
|
\************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/block-editor":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** external ["wp","blockEditor"] ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blockEditor"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/blocks":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** external ["wp","blocks"] ***!
|
||||||
|
\********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/components":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** external ["wp","components"] ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["components"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!******************************!*\
|
||||||
|
!*** external ["wp","i18n"] ***!
|
||||||
|
\******************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["i18n"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "react/jsx-runtime":
|
||||||
|
/*!**********************************!*\
|
||||||
|
!*** external "ReactJSXRuntime" ***!
|
||||||
|
\**********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["ReactJSXRuntime"];
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = (module) => {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ () => (module['default']) :
|
||||||
|
/******/ () => (module);
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = (exports, definition) => {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/make namespace object */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = (exports) => {
|
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||||
|
/******/ }
|
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ "index": 0,
|
||||||
|
/******/ "./style-index": 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = globalThis["webpackChunkfront_header"] = globalThis["webpackChunkfront_header"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,29 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.content-card {
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
.content-card h1.wp-block-heading,
|
||||||
|
.content-card h2.wp-block-heading,
|
||||||
|
.content-card h3.wp-block-heading,
|
||||||
|
.content-card h4.wp-block-heading,
|
||||||
|
.content-card h5.wp-block-heading,
|
||||||
|
.content-card h6.wp-block-heading {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--content-card-text-color);
|
||||||
|
}
|
||||||
|
.content-card *,
|
||||||
|
.content-card p {
|
||||||
|
color: var(--content-card-text-color);
|
||||||
|
}
|
||||||
|
.content-card li {
|
||||||
|
list-style: disc;
|
||||||
|
margin-right: 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.content-card {
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
.content-card h1.wp-block-heading,
|
||||||
|
.content-card h2.wp-block-heading,
|
||||||
|
.content-card h3.wp-block-heading,
|
||||||
|
.content-card h4.wp-block-heading,
|
||||||
|
.content-card h5.wp-block-heading,
|
||||||
|
.content-card h6.wp-block-heading {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--content-card-text-color);
|
||||||
|
}
|
||||||
|
.content-card *,
|
||||||
|
.content-card p {
|
||||||
|
color: var(--content-card-text-color);
|
||||||
|
}
|
||||||
|
.content-card li {
|
||||||
|
list-style: disc;
|
||||||
|
margin-left: 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=style-index.css.map*/
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACC;AACD;AACC;;;;;;EAMC;EACA;EACA;EACA;EACA;EACA;AACF;AACC;;EAEC;AACF;AAEC;EACC;EACA;EACA;EACA;AAAF,C","sources":["webpack://front-header/./src/style.scss"],"sourcesContent":[".content-card {\r\n\tword-break: break-word;\r\n\r\n\th1.wp-block-heading,\r\n\th2.wp-block-heading,\r\n\th3.wp-block-heading,\r\n\th4.wp-block-heading,\r\n\th5.wp-block-heading,\r\n\th6.wp-block-heading {\r\n\t\tmargin-top: 0;\r\n\t\tmargin-bottom: 0;\r\n\t\tfont-size: 1.25rem;\r\n\t\ttext-transform: uppercase;\r\n\t\tfont-weight: 700;\r\n\t\tcolor: var(--content-card-text-color);\r\n\t}\r\n\t*,\r\n\tp {\r\n\t\tcolor: var(--content-card-text-color);\r\n\t}\r\n\r\n\tli {\r\n\t\tlist-style: disc;\r\n\t\tmargin-left: 1rem;\r\n\t\tmargin-bottom: 0.5rem;\r\n\t\tfont-weight: 300;\r\n\t}\r\n}\r\n"],"names":[],"sourceRoot":""}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array(), 'version' => '9618df91ea3d5989c295');
|
||||||
7
plugins/carhop-blocks/blocks/content-card/build/view.js
Normal file
7
plugins/carhop-blocks/blocks/content-card/build/view.js
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/*!*********************!*\
|
||||||
|
!*** ./src/view.js ***!
|
||||||
|
\*********************/
|
||||||
|
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
21
plugins/carhop-blocks/blocks/content-card/package.json
Normal file
21
plugins/carhop-blocks/blocks/content-card/package.json
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"name": "front-header",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Example block scaffolded with Create Block tool.",
|
||||||
|
"author": "The WordPress Contributors",
|
||||||
|
"license": "GPL-2.0-or-later",
|
||||||
|
"main": "build/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "wp-scripts build",
|
||||||
|
"format": "wp-scripts format",
|
||||||
|
"lint:css": "wp-scripts lint-style",
|
||||||
|
"lint:js": "wp-scripts lint-js",
|
||||||
|
"packages-update": "wp-scripts packages-update",
|
||||||
|
"plugin-zip": "wp-scripts plugin-zip",
|
||||||
|
"start": "wp-scripts start"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@wordpress/scripts": "^30.12.0"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
|
||||||
|
}
|
||||||
12865
plugins/carhop-blocks/blocks/content-card/pnpm-lock.yaml
Normal file
12865
plugins/carhop-blocks/blocks/content-card/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
plugins/carhop-blocks/blocks/content-card/src/.DS_Store
vendored
Normal file
BIN
plugins/carhop-blocks/blocks/content-card/src/.DS_Store
vendored
Normal file
Binary file not shown.
37
plugins/carhop-blocks/blocks/content-card/src/block.json
Normal file
37
plugins/carhop-blocks/blocks/content-card/src/block.json
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 3,
|
||||||
|
"name": "carhop-blocks/content-card",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Content Card",
|
||||||
|
"category": "carhop-blocks",
|
||||||
|
"icon": "smiley",
|
||||||
|
"description": "Carte de contenu pour la mise en forme d'éléments de contenu",
|
||||||
|
"example": {},
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"textdomain": "carhop-blocks",
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css",
|
||||||
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"hasBackgroundColor": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "#136f63"
|
||||||
|
},
|
||||||
|
"hasLightBackground": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"textColor": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "#136f63"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
118
plugins/carhop-blocks/blocks/content-card/src/edit.js
Normal file
118
plugins/carhop-blocks/blocks/content-card/src/edit.js
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
import { __ } from "@wordpress/i18n";
|
||||||
|
import {
|
||||||
|
useBlockProps,
|
||||||
|
InnerBlocks,
|
||||||
|
useSetting,
|
||||||
|
InspectorControls,
|
||||||
|
MediaReplaceFlow,
|
||||||
|
MediaPlaceholder,
|
||||||
|
} from "@wordpress/block-editor";
|
||||||
|
import "./editor.scss";
|
||||||
|
import { isColorLight } from "../../_utilities/utilities";
|
||||||
|
|
||||||
|
import {
|
||||||
|
PanelBody,
|
||||||
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
||||||
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
||||||
|
Button,
|
||||||
|
CheckboxControl,
|
||||||
|
ColorPalette,
|
||||||
|
} from "@wordpress/components";
|
||||||
|
|
||||||
|
export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
|
const colors = useSetting("color.palette.theme");
|
||||||
|
const { hasBackgroundColor, backgroundColor, textColor, hasLightBackground } =
|
||||||
|
attributes;
|
||||||
|
|
||||||
|
function onBackgroundColorChange(value) {
|
||||||
|
if (value === undefined) {
|
||||||
|
setAttributes({ hasBackgroundColor: false });
|
||||||
|
setAttributes({ backgroundColor: "transparent" });
|
||||||
|
}
|
||||||
|
const isLightBackgroundColor = isColorLight(backgroundColor);
|
||||||
|
setAttributes({ hasLightBackground: isLightBackgroundColor });
|
||||||
|
|
||||||
|
setAttributes({ backgroundColor: value });
|
||||||
|
}
|
||||||
|
function onHasBackgroundColorChange(value) {
|
||||||
|
setAttributes({ hasBackgroundColor: value });
|
||||||
|
if (!value) {
|
||||||
|
setAttributes({ backgroundColor: null });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function onTextColorChange(value) {
|
||||||
|
setAttributes({ textColor: value });
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<InspectorControls>
|
||||||
|
<PanelBody
|
||||||
|
className="deligraph-blocks-components-image__panel-body"
|
||||||
|
title={__("Arrière plan", "deligraph-blocks")}
|
||||||
|
>
|
||||||
|
<CheckboxControl
|
||||||
|
label="Arrière plan coloré"
|
||||||
|
checked={hasBackgroundColor}
|
||||||
|
onChange={onHasBackgroundColorChange}
|
||||||
|
/>
|
||||||
|
{hasBackgroundColor && (
|
||||||
|
<>
|
||||||
|
<ColorPalette
|
||||||
|
colors={colors}
|
||||||
|
value={backgroundColor}
|
||||||
|
onChange={onBackgroundColorChange}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</PanelBody>
|
||||||
|
<PanelBody
|
||||||
|
className="deligraph-blocks-components-image__panel-body"
|
||||||
|
title={__("Couleur du texte", "deligraph-blocks")}
|
||||||
|
>
|
||||||
|
{hasBackgroundColor && (
|
||||||
|
<>
|
||||||
|
<ColorPalette
|
||||||
|
colors={colors}
|
||||||
|
value={textColor}
|
||||||
|
onChange={onTextColorChange}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</PanelBody>
|
||||||
|
</InspectorControls>
|
||||||
|
<div
|
||||||
|
{...useBlockProps({
|
||||||
|
className: `content-card ${
|
||||||
|
hasLightBackground
|
||||||
|
? "content-card--bg-light"
|
||||||
|
: "content-card--bg-dark"
|
||||||
|
}`,
|
||||||
|
style: {
|
||||||
|
"--content-card-text-color": textColor ?? "inherit",
|
||||||
|
"--content-card-background-color": hasBackgroundColor
|
||||||
|
? backgroundColor
|
||||||
|
: "transparent",
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<div className="content-card__innerblocks">
|
||||||
|
<InnerBlocks
|
||||||
|
template={[
|
||||||
|
["core/paragraph", { placeholder: "Ajouter ici le texte" }],
|
||||||
|
]}
|
||||||
|
allowedBlocks={[
|
||||||
|
"core/heading",
|
||||||
|
"core/paragraph",
|
||||||
|
"core/group",
|
||||||
|
"core/list",
|
||||||
|
"core/button",
|
||||||
|
"core/buttons",
|
||||||
|
"carhop-blocks/heading",
|
||||||
|
"carhop-blocks/cta-group",
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
21
plugins/carhop-blocks/blocks/content-card/src/index.js
Normal file
21
plugins/carhop-blocks/blocks/content-card/src/index.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { registerBlockType } from "@wordpress/blocks";
|
||||||
|
import "./style.scss";
|
||||||
|
|
||||||
|
import Edit from "./edit";
|
||||||
|
import save from "./save";
|
||||||
|
import metadata from "./block.json";
|
||||||
|
|
||||||
|
registerBlockType(metadata.name, {
|
||||||
|
icon: {
|
||||||
|
foreground: "#136f63",
|
||||||
|
src: (
|
||||||
|
<svg width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<g>
|
||||||
|
<path d="M1,5c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM3,0H1C.4,0,0,.4,0,1v2c0,.6.4,1,1,1s1-.4,1-1v-1h1c.6,0,1-.4,1-1s-.4-1-1-1ZM6,2h2c.6,0,1-.4,1-1s-.4-1-1-1h-2c-.6,0-1,.4-1,1s.4,1,1,1ZM1,10c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM6,7v4c0,.6.4,1,1,1h4c.6,0,1-.4,1-1v-4c0-.6-.4-1-1-1h-4c-.6,0-1,.4-1,1ZM12,16h-2c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1s-.4-1-1-1ZM17,9c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM17,4c-.6,0-1,.4-1,1v2c0,.6.4,1,1,1s1-.4,1-1v-2c0-.6-.4-1-1-1ZM17,14c-.6,0-1,.4-1,1v1h-1c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1v-2c0-.6-.4-1-1-1ZM7,16h-2c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1s-.4-1-1-1ZM13,0h-2c-.6,0-1,.4-1,1s.4,1,1,1h2c.6,0,1-.4,1-1s-.4-1-1-1Z" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
edit: Edit,
|
||||||
|
save,
|
||||||
|
});
|
||||||
28
plugins/carhop-blocks/blocks/content-card/src/save.js
Normal file
28
plugins/carhop-blocks/blocks/content-card/src/save.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
||||||
|
import { isColorLight } from "../../_utilities/utilities";
|
||||||
|
|
||||||
|
export default function save({ attributes }) {
|
||||||
|
const { backgroundColor, textColor, hasLightBackground, hasBackgroundColor } =
|
||||||
|
attributes;
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
{...useBlockProps.save({
|
||||||
|
className: `content-card ${
|
||||||
|
hasLightBackground
|
||||||
|
? "content-card--bg-light"
|
||||||
|
: "content-card--bg-dark"
|
||||||
|
}`,
|
||||||
|
style: {
|
||||||
|
"--content-card-text-color": textColor ?? "inherit",
|
||||||
|
"--content-card-background-color": hasBackgroundColor
|
||||||
|
? backgroundColor
|
||||||
|
: "transparent",
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<div className="content-card__innerblocks">
|
||||||
|
<InnerBlocks.Content />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
28
plugins/carhop-blocks/blocks/content-card/src/style.scss
Normal file
28
plugins/carhop-blocks/blocks/content-card/src/style.scss
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
.content-card {
|
||||||
|
word-break: break-word;
|
||||||
|
|
||||||
|
h1.wp-block-heading,
|
||||||
|
h2.wp-block-heading,
|
||||||
|
h3.wp-block-heading,
|
||||||
|
h4.wp-block-heading,
|
||||||
|
h5.wp-block-heading,
|
||||||
|
h6.wp-block-heading {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--content-card-text-color);
|
||||||
|
}
|
||||||
|
*,
|
||||||
|
p {
|
||||||
|
color: var(--content-card-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
list-style: disc;
|
||||||
|
margin-left: 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -44,7 +44,6 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
<ColorPalette
|
<ColorPalette
|
||||||
value={color}
|
value={color}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
console.log(value);
|
|
||||||
handleColorChange(value);
|
handleColorChange(value);
|
||||||
}}
|
}}
|
||||||
colors={colors}
|
colors={colors}
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,11 @@
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
"editorStyle": "file:./index.css",
|
"editorStyle": "file:./index.css",
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"viewScript": "file:./view.js"
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"variant": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "medium"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'cb6831f9b1591c2d4990');
|
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'b28d29be3660a6135aa3');
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ function Shapes() {
|
||||||
\************************/
|
\************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/decorative-shapes","version":"0.1.0","title":"Formes décoratives ","category":"carhop-blocks","icon":"smiley","description":"Formes décoratives du carhop","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/decorative-shapes","version":"0.1.0","title":"Formes décoratives ","category":"carhop-blocks","icon":"smiley","description":"Formes décoratives du carhop","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"variant":{"type":"string","default":"medium"}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -145,21 +145,50 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
/* harmony import */ var _wordpress_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 _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
|
||||||
/* harmony import */ var _Shapes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Shapes */ "./src/Shapes.jsx");
|
/* harmony import */ var _Shapes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Shapes */ "./src/Shapes.jsx");
|
||||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
||||||
/* 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 _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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Edit() {
|
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
function Edit({
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
attributes,
|
||||||
|
setAttributes
|
||||||
|
}) {
|
||||||
|
const {
|
||||||
|
variant
|
||||||
|
} = attributes;
|
||||||
|
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__.InspectorControls, {
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
|
||||||
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Shapes", "carhop-blocks"),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.__experimentalToggleGroupControl, {
|
||||||
|
className: "deligraph-blocks__variant",
|
||||||
|
isBlock: true,
|
||||||
|
label: "Variante",
|
||||||
|
onChange: value => setAttributes({
|
||||||
|
variant: value
|
||||||
|
}),
|
||||||
|
value: variant,
|
||||||
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.__experimentalToggleGroupControlOption, {
|
||||||
|
label: "Medium",
|
||||||
|
value: "medium"
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.__experimentalToggleGroupControlOption, {
|
||||||
|
label: "Big",
|
||||||
|
value: "big"
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
||||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
className: "carhop-decorative-shapes decorative-shapes"
|
className: `carhop-decorative-shapes decorative-shapes decorative-shapes--${variant}`
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Shapes__WEBPACK_IMPORTED_MODULE_3__["default"], {})
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Shapes__WEBPACK_IMPORTED_MODULE_3__["default"], {})
|
||||||
})
|
})]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -240,10 +269,15 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function save() {
|
function save({
|
||||||
|
attributes
|
||||||
|
}) {
|
||||||
|
const {
|
||||||
|
variant
|
||||||
|
} = attributes;
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||||
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
className: "carhop-decorative-shapes decorative-shapes"
|
className: `carhop-decorative-shapes decorative-shapes decorative-shapes--${variant} ${variant === "big" ? "alignfull" : ""}`
|
||||||
}),
|
}),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Shapes__WEBPACK_IMPORTED_MODULE_1__["default"], {})
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Shapes__WEBPACK_IMPORTED_MODULE_1__["default"], {})
|
||||||
});
|
});
|
||||||
|
|
@ -283,6 +317,16 @@ module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/components":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** external ["wp","components"] ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["components"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "@wordpress/i18n":
|
/***/ "@wordpress/i18n":
|
||||||
/*!******************************!*\
|
/*!******************************!*\
|
||||||
!*** external ["wp","i18n"] ***!
|
!*** external ["wp","i18n"] ***!
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -7,11 +7,6 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 10rem;
|
gap: 10rem;
|
||||||
}
|
}
|
||||||
.decorative-shapes__shape {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.decorative-shapes__shape svg {
|
.decorative-shapes__shape svg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
|
|
@ -20,3 +15,19 @@
|
||||||
-o-object-fit: contain;
|
-o-object-fit: contain;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
.decorative-shapes--big {
|
||||||
|
padding: 0rem 2rem;
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6rem;
|
||||||
|
}
|
||||||
|
.decorative-shapes--big .decorative-shapes__shape {
|
||||||
|
display: block;
|
||||||
|
width: 100vw;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
.decorative-shapes--big .decorative-shapes__shape svg {
|
||||||
|
max-width: 800px;
|
||||||
|
max-height: 800px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,6 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 10rem;
|
gap: 10rem;
|
||||||
}
|
}
|
||||||
.decorative-shapes__shape {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.decorative-shapes__shape svg {
|
.decorative-shapes__shape svg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
|
|
@ -20,5 +15,21 @@
|
||||||
-o-object-fit: contain;
|
-o-object-fit: contain;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
.decorative-shapes--big {
|
||||||
|
padding: 0rem 2rem;
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6rem;
|
||||||
|
}
|
||||||
|
.decorative-shapes--big .decorative-shapes__shape {
|
||||||
|
display: block;
|
||||||
|
width: 100vw;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
.decorative-shapes--big .decorative-shapes__shape svg {
|
||||||
|
max-width: 800px;
|
||||||
|
max-height: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
/*# sourceMappingURL=style-index.css.map*/
|
/*# sourceMappingURL=style-index.css.map*/
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACC;EACA;EACA;EACA;AACD;AACC;EAEC;EACA;EACA;AAAF;AACE;EAEC;EACA;EACA;EACA;EACA;KAAA;AAAH,C","sources":["webpack://front-header/./src/style.scss"],"sourcesContent":[".decorative-shapes {\r\n\tdisplay: grid;\r\n\tgrid-template-columns: repeat(4, 1fr);\r\n\tjustify-content: center;\r\n\tgap: 10rem;\r\n\r\n\t&__shape {\r\n\t\t// background-color: red;\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t\tsvg {\r\n\t\t\t// background-color: blue;\r\n\t\t\twidth: 100%;\r\n\t\t\tmax-width: 300px;\r\n\t\t\theight: auto;\r\n\t\t\taspect-ratio: 1/1;\r\n\t\t\tobject-fit: contain;\r\n\t\t}\r\n\t}\r\n}\r\n"],"names":[],"sourceRoot":""}
|
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACC;EACA;EACA;EACA;AACD;AAME;EAEC;EACA;EACA;EACA;EACA;KAAA;AALH;AASC;EACC;EACA;EACA;EACA;EACA;AAPF;AASE;EACC;EACA;EACA;AAPH;AAQG;EACC;EACA;AANJ,C","sources":["webpack://front-header/./src/style.scss"],"sourcesContent":[".decorative-shapes {\r\n\tdisplay: grid;\r\n\tgrid-template-columns: repeat(4, 1fr);\r\n\tjustify-content: center;\r\n\tgap: 10rem;\r\n\r\n\t&__shape {\r\n\t\t// background-color: red;\r\n\t\t// display: flex;\r\n\t\t// align-items: center;\r\n\t\t// justify-content: center;\r\n\t\tsvg {\r\n\t\t\t// background-color: blue;\r\n\t\t\twidth: 100%;\r\n\t\t\tmax-width: 300px;\r\n\t\t\theight: auto;\r\n\t\t\taspect-ratio: 1/1;\r\n\t\t\tobject-fit: contain;\r\n\t\t}\r\n\t}\r\n\r\n\t&--big {\r\n\t\tpadding: 0rem 2rem;\r\n\t\tdisplay: flex !important;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t\tgap: 6rem;\r\n\r\n\t\t.decorative-shapes__shape {\r\n\t\t\tdisplay: block;\r\n\t\t\twidth: 100vw;\r\n\t\t\tmax-width: 400px;\r\n\t\t\tsvg {\r\n\t\t\t\tmax-width: 800px;\r\n\t\t\t\tmax-height: 800px;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n"],"names":[],"sourceRoot":""}
|
||||||
|
|
@ -15,5 +15,11 @@
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
"editorStyle": "file:./index.css",
|
"editorStyle": "file:./index.css",
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"viewScript": "file:./view.js"
|
"viewScript": "file:./view.js",
|
||||||
|
"attributes": {
|
||||||
|
"variant": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "medium"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,37 @@
|
||||||
import { __ } from "@wordpress/i18n";
|
import { __ } from "@wordpress/i18n";
|
||||||
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
import {
|
||||||
|
useBlockProps,
|
||||||
|
InnerBlocks,
|
||||||
|
InspectorControls,
|
||||||
|
} from "@wordpress/block-editor";
|
||||||
import "./editor.scss";
|
import "./editor.scss";
|
||||||
import Shapes from "./Shapes";
|
import Shapes from "./Shapes";
|
||||||
export default function Edit() {
|
import {
|
||||||
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
||||||
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
||||||
|
PanelBody,
|
||||||
|
} from "@wordpress/components";
|
||||||
|
export default function Edit({ attributes, setAttributes }) {
|
||||||
|
const { variant } = attributes;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<InspectorControls>
|
||||||
|
<PanelBody title={__("Shapes", "carhop-blocks")}>
|
||||||
|
<ToggleGroupControl
|
||||||
|
className="deligraph-blocks__variant"
|
||||||
|
isBlock
|
||||||
|
label="Variante"
|
||||||
|
onChange={(value) => setAttributes({ variant: value })}
|
||||||
|
value={variant}
|
||||||
|
>
|
||||||
|
<ToggleGroupControlOption label="Medium" value="medium" />
|
||||||
|
<ToggleGroupControlOption label="Big" value="big" />
|
||||||
|
</ToggleGroupControl>
|
||||||
|
</PanelBody>
|
||||||
|
</InspectorControls>
|
||||||
<div
|
<div
|
||||||
{...useBlockProps({
|
{...useBlockProps({
|
||||||
className: "carhop-decorative-shapes decorative-shapes",
|
className: `carhop-decorative-shapes decorative-shapes decorative-shapes--${variant}`,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Shapes />
|
<Shapes />
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
||||||
import Shapes from "./Shapes";
|
import Shapes from "./Shapes";
|
||||||
|
|
||||||
export default function save() {
|
export default function save({ attributes }) {
|
||||||
|
const { variant } = attributes;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
{...useBlockProps.save({
|
{...useBlockProps.save({
|
||||||
className: "carhop-decorative-shapes decorative-shapes",
|
className: `carhop-decorative-shapes decorative-shapes decorative-shapes--${variant} ${
|
||||||
|
variant === "big" ? "alignfull" : ""
|
||||||
|
}`,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Shapes />
|
<Shapes />
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
&__shape {
|
&__shape {
|
||||||
// background-color: red;
|
// background-color: red;
|
||||||
display: flex;
|
// display: flex;
|
||||||
align-items: center;
|
// align-items: center;
|
||||||
justify-content: center;
|
// justify-content: center;
|
||||||
svg {
|
svg {
|
||||||
// background-color: blue;
|
// background-color: blue;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -18,4 +18,22 @@
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--big {
|
||||||
|
padding: 0rem 2rem;
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6rem;
|
||||||
|
|
||||||
|
.decorative-shapes__shape {
|
||||||
|
display: block;
|
||||||
|
width: 100vw;
|
||||||
|
max-width: 400px;
|
||||||
|
svg {
|
||||||
|
max-width: 800px;
|
||||||
|
max-height: 800px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
/******/ (() => { // webpackBootstrap
|
/******/ (() => {
|
||||||
/*!*********************!*\
|
// webpackBootstrap
|
||||||
|
/*!*********************!*\
|
||||||
!*** ./src/view.js ***!
|
!*** ./src/view.js ***!
|
||||||
\*********************/
|
\*********************/
|
||||||
console.log("Hello World! (from front-header-front-header block)");
|
/******/
|
||||||
/******/ })()
|
})();
|
||||||
;
|
//# sourceMappingURL=view.js.map
|
||||||
//# sourceMappingURL=view.js.map
|
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
console.log("Hello World! (from front-header-front-header block)");
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
console.log("Hello World! (from create-block-picture-of-the-day block)");
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
/**
|
|
||||||
* Use this file for JavaScript code that you want to run in the front-end
|
|
||||||
* on posts/pages that contain this block.
|
|
||||||
*
|
|
||||||
* When this file is defined as the value of the `viewScript` property
|
|
||||||
* in `block.json` it will be enqueued on the front end of the site.
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* {
|
|
||||||
* "viewScript": "file:./view.js"
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* If you're not making any changes to this file because your project doesn't need any
|
|
||||||
* JavaScript running in the front-end, then you should delete this file and remove
|
|
||||||
* the `viewScript` property from `block.json`.
|
|
||||||
*
|
|
||||||
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* eslint-disable no-console */
|
|
||||||
console.log( 'Hello World! (from create-block-picture-of-the-day block)' );
|
|
||||||
/* eslint-enable no-console */
|
|
||||||
|
|
@ -49,6 +49,8 @@ function carhop_register_blocks()
|
||||||
register_block_type(__DIR__ . '/blocks/narrative-card/build');
|
register_block_type(__DIR__ . '/blocks/narrative-card/build');
|
||||||
register_block_type(__DIR__ . '/blocks/scroll-story-block/build');
|
register_block_type(__DIR__ . '/blocks/scroll-story-block/build');
|
||||||
register_block_type(__DIR__ . '/blocks/cta-group/build');
|
register_block_type(__DIR__ . '/blocks/cta-group/build');
|
||||||
|
register_block_type(__DIR__ . '/blocks/content-card/build');
|
||||||
|
register_block_type(__DIR__ . '/blocks/card-grid/build');
|
||||||
|
|
||||||
|
|
||||||
register_block_type(__DIR__ . '/acf-blocks/gallery');
|
register_block_type(__DIR__ . '/acf-blocks/gallery');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user