Compare commits
No commits in common. "f81fddf4501ae1813979362fbccc9014767534b3" and "887aed22ab4cd559388a640336a48845fec57fa5" have entirely different histories.
f81fddf450
...
887aed22ab
|
|
@ -411,10 +411,6 @@ return array(
|
||||||
'style' => 'file:./style-index.css',
|
'style' => 'file:./style-index.css',
|
||||||
'viewScript' => 'file:./view.js',
|
'viewScript' => 'file:./view.js',
|
||||||
'attributes' => array(
|
'attributes' => array(
|
||||||
'hasBorder' => array(
|
|
||||||
'type' => 'boolean',
|
|
||||||
'default' => true
|
|
||||||
),
|
|
||||||
'hasBackgroundColor' => array(
|
'hasBackgroundColor' => array(
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'default' => false
|
'default' => false
|
||||||
|
|
@ -1200,14 +1196,6 @@ return array(
|
||||||
'title' => array(
|
'title' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => ''
|
'default' => ''
|
||||||
),
|
|
||||||
'iconId' => array(
|
|
||||||
'type' => 'number',
|
|
||||||
'default' => 0
|
|
||||||
),
|
|
||||||
'iconUrl' => array(
|
|
||||||
'type' => 'string',
|
|
||||||
'default' => ''
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,6 @@
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"viewScript": "file:./view.js",
|
"viewScript": "file:./view.js",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"hasBorder": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"hasBackgroundColor": {
|
"hasBackgroundColor": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '3bb8c381c4f6eeb1196a');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'b9d661166b3c086cffae');
|
||||||
|
|
|
||||||
|
|
@ -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-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":{"hasBorder":{"type":"boolean","default":true},"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#136f63"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"#136f63"}}}');
|
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"}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -81,8 +81,7 @@ function Edit({
|
||||||
hasBackgroundColor,
|
hasBackgroundColor,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
textColor,
|
textColor,
|
||||||
hasLightBackground,
|
hasLightBackground
|
||||||
hasBorder
|
|
||||||
} = attributes;
|
} = attributes;
|
||||||
function onBackgroundColorChange(value) {
|
function onBackgroundColorChange(value) {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
|
@ -117,21 +116,35 @@ function Edit({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
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__.jsxs)(_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, {
|
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",
|
className: "deligraph-blocks-components-image__panel-body",
|
||||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Options", "carhop-blocks"),
|
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, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.CheckboxControl, {
|
||||||
label: "Bordure",
|
label: "Arri\xE8re plan color\xE9",
|
||||||
checked: hasBorder,
|
checked: hasBackgroundColor,
|
||||||
onChange: value => setAttributes({
|
onChange: onHasBackgroundColorChange
|
||||||
hasBorder: value
|
}), 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", {
|
}), /*#__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: `content-card ${hasLightBackground ? "content-card--bg-light" : "content-card--bg-dark"} ${hasBorder ? "content-card--has-border" : ""}`,
|
className: `content-card ${hasLightBackground ? "content-card--bg-light" : "content-card--bg-dark"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-card-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
"--content-card-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
"--content-card-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
"--content-card-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
||||||
|
|
@ -143,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/group", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/cta-group", "carhop-blocks/cta"]
|
allowedBlocks: ["core/heading", "core/paragraph", "core/group", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/cta-group"]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})]
|
})]
|
||||||
|
|
@ -230,12 +243,11 @@ function save({
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
textColor,
|
textColor,
|
||||||
hasLightBackground,
|
hasLightBackground,
|
||||||
hasBackgroundColor,
|
hasBackgroundColor
|
||||||
hasBorder
|
|
||||||
} = attributes;
|
} = 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: `content-card ${hasLightBackground ? "content-card--bg-light" : "content-card--bg-dark"} ${hasBorder ? "content-card--has-border" : ""}`,
|
className: `content-card ${hasLightBackground ? "content-card--bg-light" : "content-card--bg-dark"}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-card-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
"--content-card-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
|
||||||
"--content-card-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
"--content-card-background-color": hasBackgroundColor ? backgroundColor : "transparent"
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -25,14 +25,6 @@
|
||||||
"title": {
|
"title": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": ""
|
"default": ""
|
||||||
},
|
|
||||||
"iconId": {
|
|
||||||
"type": "number",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"iconUrl": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '4780c6235b38248e46c9');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'f0707b941eb4f50b49b3');
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
\****************************/
|
\****************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/tab","version":"0.1.0","title":"Tab","category":"carhop-blocks","icon":"smiley","description":"Tab pour la mise en forme supérieure d\'éléments de contenu","example":{},"supports":{"html":false,"color":{"text":true,"background":false,"link":false}},"textdomain":"tab","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"title":{"type":"string","default":""},"iconId":{"type":"number","default":0},"iconUrl":{"type":"string","default":""}}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/tab","version":"0.1.0","title":"Tab","category":"carhop-blocks","icon":"smiley","description":"Tab pour la mise en forme supérieure d\'éléments de contenu","example":{},"supports":{"html":false,"color":{"text":true,"background":false,"link":false}},"textdomain":"tab","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"title":{"type":"string","default":""}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -48,7 +48,6 @@ function Edit({
|
||||||
const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
className: "block-chapo"
|
className: "block-chapo"
|
||||||
});
|
});
|
||||||
console.log(attributes);
|
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_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, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
|
||||||
|
|
@ -112,17 +111,22 @@ function Edit({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})]
|
})]
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||||
...blockProps,
|
...blockProps,
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText, {
|
||||||
allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "core/image", "core/embed", "core/quote", "core/pullquote", "core/media-text", "core/table", "core/group", "core/columns", "core/post-title", "carhop-blocks/cta", "carhop-blocks/heading", "carhop-blocks/cta-group", "carhop-blocks/audio-player", "carhop-blocks/content-box", "carhop-blocks/content-card", "carhop-blocks/notice-panel", "shortcode"],
|
tagName: "h2",
|
||||||
template: [["core/heading", {
|
className: "tab__title",
|
||||||
content: "Titre",
|
placeholder: "Titre",
|
||||||
level: 3
|
value: title,
|
||||||
}], ["core/paragraph", {
|
onChange: value => setAttributes({
|
||||||
|
title: value
|
||||||
|
})
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
|
||||||
|
allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "core/image", "core/embed", "core/quote", "core/pullquote", "core/media-text", "core/table", "core/group", "core/columns", "core/post-title", "carhop-blocks/cta", "carhop-blocks/heading", "carhop-blocks/cta-group", "carhop-blocks/audio-player", "carhop-blocks/content-box", "carhop-blocks/notice-panel", "shortcode"],
|
||||||
|
template: [["core/paragraph", {
|
||||||
content: "Contenu"
|
content: "Contenu"
|
||||||
}]]
|
}]]
|
||||||
})
|
})]
|
||||||
})]
|
})]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -175,10 +179,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
__experimentalLabel: attributes => {
|
|
||||||
const label = attributes?.title?.trim();
|
|
||||||
return label || _block_json__WEBPACK_IMPORTED_MODULE_4__.title;
|
|
||||||
},
|
|
||||||
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
|
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
|
||||||
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
|
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
|
||||||
});
|
});
|
||||||
|
|
@ -212,8 +212,12 @@ function save({
|
||||||
const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
|
||||||
className: "tab"
|
className: "tab"
|
||||||
});
|
});
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
|
||||||
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__.RichText.Content, {
|
||||||
|
value: title,
|
||||||
|
tagName: "h2",
|
||||||
|
className: "tab__title"
|
||||||
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '36820ff09c645c75d8de');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '9351ef08403e5d3a4db5');
|
||||||
|
|
|
||||||
|
|
@ -5,29 +5,12 @@
|
||||||
/*!**************************************************!*\
|
/*!**************************************************!*\
|
||||||
!*** ./src/core-variants/core-buttons/editor.js ***!
|
!*** ./src/core-variants/core-buttons/editor.js ***!
|
||||||
\**************************************************/
|
\**************************************************/
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
/***/ (() => {
|
||||||
|
|
||||||
"use strict";
|
wp.blocks.registerBlockStyle("core/buttons", {
|
||||||
__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__);
|
|
||||||
|
|
||||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockStyle)("core/buttons", {
|
|
||||||
name: "big-buttons",
|
name: "big-buttons",
|
||||||
label: "Grands boutons "
|
label: "Grands boutons "
|
||||||
});
|
});
|
||||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockVariation)("core/button", {
|
|
||||||
name: "email-button",
|
|
||||||
title: "Bouton email",
|
|
||||||
description: "Ajoute une icone email devant le texte.",
|
|
||||||
attributes: {
|
|
||||||
className: "email-button"
|
|
||||||
},
|
|
||||||
isActive: ({
|
|
||||||
className = ""
|
|
||||||
}) => className.split(/\s+/).includes("email-button"),
|
|
||||||
scope: ["inserter", "transform", "block"]
|
|
||||||
});
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -563,6 +546,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2__);
|
/* harmony import */ var _core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_core_embed_variant_editor_js__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var _core_list_variant_editor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core-list-variant/editor.js */ "./src/core-variants/core-list-variant/editor.js");
|
/* harmony import */ var _core_list_variant_editor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core-list-variant/editor.js */ "./src/core-variants/core-list-variant/editor.js");
|
||||||
/* harmony import */ var _core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./core-buttons/editor.js */ "./src/core-variants/core-buttons/editor.js");
|
/* harmony import */ var _core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./core-buttons/editor.js */ "./src/core-variants/core-buttons/editor.js");
|
||||||
|
/* harmony import */ var _core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_core_buttons_editor_js__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
/* harmony import */ var _core_columns_editor_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./core-columns/editor.js */ "./src/core-variants/core-columns/editor.js");
|
/* harmony import */ var _core_columns_editor_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./core-columns/editor.js */ "./src/core-variants/core-columns/editor.js");
|
||||||
/* harmony import */ var _core_pullquote_editor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./core-pullquote/editor.js */ "./src/core-variants/core-pullquote/editor.js");
|
/* harmony import */ var _core_pullquote_editor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./core-pullquote/editor.js */ "./src/core-variants/core-pullquote/editor.js");
|
||||||
/* harmony import */ var _core_pullquote_editor_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_core_pullquote_editor_js__WEBPACK_IMPORTED_MODULE_6__);
|
/* harmony import */ var _core_pullquote_editor_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_core_pullquote_editor_js__WEBPACK_IMPORTED_MODULE_6__);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -17,10 +17,6 @@
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"viewScript": "file:./view.js",
|
"viewScript": "file:./view.js",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"hasBorder": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"hasBackgroundColor": {
|
"hasBackgroundColor": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,8 @@ 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 {
|
const { hasBackgroundColor, backgroundColor, textColor, hasLightBackground } =
|
||||||
hasBackgroundColor,
|
attributes;
|
||||||
backgroundColor,
|
|
||||||
textColor,
|
|
||||||
hasLightBackground,
|
|
||||||
hasBorder,
|
|
||||||
} = attributes;
|
|
||||||
|
|
||||||
function onBackgroundColorChange(value) {
|
function onBackgroundColorChange(value) {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
|
@ -52,16 +47,6 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
<>
|
<>
|
||||||
<InspectorControls>
|
<InspectorControls>
|
||||||
<PanelBody
|
<PanelBody
|
||||||
className="deligraph-blocks-components-image__panel-body"
|
|
||||||
title={__("Options", "carhop-blocks")}
|
|
||||||
>
|
|
||||||
<CheckboxControl
|
|
||||||
label="Bordure"
|
|
||||||
checked={hasBorder}
|
|
||||||
onChange={(value) => setAttributes({ hasBorder: value })}
|
|
||||||
/>
|
|
||||||
</PanelBody>
|
|
||||||
{/* <PanelBody
|
|
||||||
className="deligraph-blocks-components-image__panel-body"
|
className="deligraph-blocks-components-image__panel-body"
|
||||||
title={__("Arrière plan", "deligraph-blocks")}
|
title={__("Arrière plan", "deligraph-blocks")}
|
||||||
>
|
>
|
||||||
|
|
@ -93,7 +78,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</PanelBody> */}
|
</PanelBody>
|
||||||
</InspectorControls>
|
</InspectorControls>
|
||||||
<div
|
<div
|
||||||
{...useBlockProps({
|
{...useBlockProps({
|
||||||
|
|
@ -101,7 +86,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
hasLightBackground
|
hasLightBackground
|
||||||
? "content-card--bg-light"
|
? "content-card--bg-light"
|
||||||
: "content-card--bg-dark"
|
: "content-card--bg-dark"
|
||||||
} ${hasBorder ? "content-card--has-border" : ""}`,
|
}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-card-text-color": textColor ?? "inherit",
|
"--content-card-text-color": textColor ?? "inherit",
|
||||||
"--content-card-background-color": hasBackgroundColor
|
"--content-card-background-color": hasBackgroundColor
|
||||||
|
|
@ -124,7 +109,6 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
"core/buttons",
|
"core/buttons",
|
||||||
"carhop-blocks/heading",
|
"carhop-blocks/heading",
|
||||||
"carhop-blocks/cta-group",
|
"carhop-blocks/cta-group",
|
||||||
"carhop-blocks/cta",
|
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,8 @@ 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 {
|
const { backgroundColor, textColor, hasLightBackground, hasBackgroundColor } =
|
||||||
backgroundColor,
|
attributes;
|
||||||
textColor,
|
|
||||||
hasLightBackground,
|
|
||||||
hasBackgroundColor,
|
|
||||||
hasBorder,
|
|
||||||
} = attributes;
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
{...useBlockProps.save({
|
{...useBlockProps.save({
|
||||||
|
|
@ -16,7 +11,7 @@ export default function save({ attributes }) {
|
||||||
hasLightBackground
|
hasLightBackground
|
||||||
? "content-card--bg-light"
|
? "content-card--bg-light"
|
||||||
: "content-card--bg-dark"
|
: "content-card--bg-dark"
|
||||||
} ${hasBorder ? "content-card--has-border" : ""}`,
|
}`,
|
||||||
style: {
|
style: {
|
||||||
"--content-card-text-color": textColor ?? "inherit",
|
"--content-card-text-color": textColor ?? "inherit",
|
||||||
"--content-card-background-color": hasBackgroundColor
|
"--content-card-background-color": hasBackgroundColor
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,4 @@
|
||||||
import { registerBlockStyle, registerBlockVariation } from "@wordpress/blocks";
|
wp.blocks.registerBlockStyle("core/buttons", {
|
||||||
|
|
||||||
registerBlockStyle("core/buttons", {
|
|
||||||
name: "big-buttons",
|
name: "big-buttons",
|
||||||
label: "Grands boutons ",
|
label: "Grands boutons ",
|
||||||
});
|
});
|
||||||
|
|
||||||
registerBlockVariation("core/button", {
|
|
||||||
name: "email-button",
|
|
||||||
title: "Bouton email",
|
|
||||||
description: "Ajoute une icone email devant le texte.",
|
|
||||||
attributes: {
|
|
||||||
className: "email-button",
|
|
||||||
},
|
|
||||||
isActive: ({ className = "" }) =>
|
|
||||||
className.split(/\s+/).includes("email-button"),
|
|
||||||
scope: ["inserter", "transform", "block"],
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,6 @@
|
||||||
"title": {
|
"title": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": ""
|
"default": ""
|
||||||
},
|
|
||||||
"iconId": {
|
|
||||||
"type": "number",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"iconUrl": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,6 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
className: "block-chapo",
|
className: "block-chapo",
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(attributes);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<InspectorControls>
|
<InspectorControls>
|
||||||
|
|
@ -43,17 +42,9 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
<>
|
<>
|
||||||
{iconUrl ? (
|
{iconUrl ? (
|
||||||
<div className="tab__icon-preview">
|
<div className="tab__icon-preview">
|
||||||
<img
|
<img src={iconUrl} alt="" style={{ maxWidth: 48, height: "auto" }} />
|
||||||
src={iconUrl}
|
|
||||||
alt=""
|
|
||||||
style={{ maxWidth: 48, height: "auto" }}
|
|
||||||
/>
|
|
||||||
<div style={{ marginTop: 8 }}>
|
<div style={{ marginTop: 8 }}>
|
||||||
<Button
|
<Button variant="secondary" onClick={open} style={{ marginRight: 8 }}>
|
||||||
variant="secondary"
|
|
||||||
onClick={open}
|
|
||||||
style={{ marginRight: 8 }}
|
|
||||||
>
|
|
||||||
{__("Remplacer", "carhop-blocks")}
|
{__("Remplacer", "carhop-blocks")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
|
@ -79,6 +70,13 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
</PanelBody>
|
</PanelBody>
|
||||||
</InspectorControls>
|
</InspectorControls>
|
||||||
<div {...blockProps}>
|
<div {...blockProps}>
|
||||||
|
<RichText
|
||||||
|
tagName="h2"
|
||||||
|
className="tab__title"
|
||||||
|
placeholder="Titre"
|
||||||
|
value={title}
|
||||||
|
onChange={(value) => setAttributes({ title: value })}
|
||||||
|
/>
|
||||||
<InnerBlocks
|
<InnerBlocks
|
||||||
allowedBlocks={[
|
allowedBlocks={[
|
||||||
"core/heading",
|
"core/heading",
|
||||||
|
|
@ -100,14 +98,10 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
"carhop-blocks/cta-group",
|
"carhop-blocks/cta-group",
|
||||||
"carhop-blocks/audio-player",
|
"carhop-blocks/audio-player",
|
||||||
"carhop-blocks/content-box",
|
"carhop-blocks/content-box",
|
||||||
"carhop-blocks/content-card",
|
|
||||||
"carhop-blocks/notice-panel",
|
"carhop-blocks/notice-panel",
|
||||||
"shortcode",
|
"shortcode",
|
||||||
]}
|
]}
|
||||||
template={[
|
template={[["core/paragraph", { content: "Contenu" }]]}
|
||||||
["core/heading", { content: "Titre", level: 3 }],
|
|
||||||
["core/paragraph", { content: "Contenu" }],
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,6 @@ registerBlockType(metadata.name, {
|
||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
__experimentalLabel: (attributes) => {
|
|
||||||
const label = attributes?.title?.trim();
|
|
||||||
return label || metadata.title;
|
|
||||||
},
|
|
||||||
edit: Edit,
|
edit: Edit,
|
||||||
save,
|
save,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ export default function save({ attributes }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<RichText.Content value={title} tagName="h2" className="tab__title" />
|
||||||
<InnerBlocks.Content />
|
<InnerBlocks.Content />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user