|
|
|
@ -16,15 +16,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
|
|
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
|
|
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
|
|
|
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
|
|
|
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
|
|
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
|
|
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
|
|
|
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
|
|
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
|
|
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
|
|
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
|
|
|
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
|
|
|
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__);
|
|
|
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-3.js");
|
|
|
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-3.js");
|
|
|
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-4.js");
|
|
|
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-4.js");
|
|
|
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-5.js");
|
|
|
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-5.js");
|
|
|
|
@ -35,9 +35,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import BlockHeadingControls from "./BlockHeadingControls";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Edit({
|
|
|
|
function Edit({
|
|
|
|
attributes,
|
|
|
|
attributes,
|
|
|
|
@ -51,7 +48,7 @@ function Edit({
|
|
|
|
hasIcon,
|
|
|
|
hasIcon,
|
|
|
|
iconName
|
|
|
|
iconName
|
|
|
|
} = attributes;
|
|
|
|
} = attributes;
|
|
|
|
const blockIndex = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
|
|
|
|
const blockIndex = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
getBlockIndex
|
|
|
|
getBlockIndex
|
|
|
|
} = select("core/block-editor");
|
|
|
|
} = select("core/block-editor");
|
|
|
|
@ -67,10 +64,6 @@ function Edit({
|
|
|
|
headingLevel: newHeadingLevel
|
|
|
|
headingLevel: newHeadingLevel
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function insertParagraphOnEnter(e) {
|
|
|
|
|
|
|
|
const newBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("core/paragraph", {});
|
|
|
|
|
|
|
|
(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.dispatch)("core/block-editor").insertBlocks(newBlock, blockIndex + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleIconChange(newIconName) {
|
|
|
|
function handleIconChange(newIconName) {
|
|
|
|
setAttributes({
|
|
|
|
setAttributes({
|
|
|
|
iconName: newIconName
|
|
|
|
iconName: newIconName
|
|
|
|
@ -81,63 +74,67 @@ function Edit({
|
|
|
|
hasIcon: hasIconToggleValue
|
|
|
|
hasIcon: hasIconToggleValue
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
|
|
|
|
function insertParagraphOnEnter(e) {
|
|
|
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Icone", "homegrade-blocks__texte-fonctionnel"),
|
|
|
|
const newBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.createBlock)("core/paragraph", {});
|
|
|
|
|
|
|
|
(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.dispatch)("core/block-editor").insertBlocks(newBlock, blockIndex + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, {
|
|
|
|
|
|
|
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Icone", "homegrade-blocks__texte-backoffice"),
|
|
|
|
initialOpen: true
|
|
|
|
initialOpen: true
|
|
|
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToggleControl, {
|
|
|
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToggleControl, {
|
|
|
|
label: "Afficher un icone",
|
|
|
|
label: "Afficher un icone",
|
|
|
|
checked: hasIcon,
|
|
|
|
checked: hasIcon,
|
|
|
|
onChange: onHasIconChange
|
|
|
|
onChange: onHasIconChange
|
|
|
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarGroup, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarGroup, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
isActive: headingLevel === "h3",
|
|
|
|
isActive: headingLevel === "h3",
|
|
|
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"],
|
|
|
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"],
|
|
|
|
onClick: () => {
|
|
|
|
onClick: () => {
|
|
|
|
onChangeHeadingLevel("h3");
|
|
|
|
onChangeHeadingLevel("h3");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
isActive: headingLevel === "h4",
|
|
|
|
isActive: headingLevel === "h4",
|
|
|
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"],
|
|
|
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"],
|
|
|
|
onClick: () => {
|
|
|
|
onClick: () => {
|
|
|
|
onChangeHeadingLevel("h4");
|
|
|
|
onChangeHeadingLevel("h4");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
isActive: headingLevel === "h5",
|
|
|
|
isActive: headingLevel === "h5",
|
|
|
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"],
|
|
|
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"],
|
|
|
|
onClick: () => {
|
|
|
|
onClick: () => {
|
|
|
|
onChangeHeadingLevel("h5");
|
|
|
|
onChangeHeadingLevel("h5");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})), hasIcon && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarGroup, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
})), hasIcon && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarGroup, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
title: "Clé",
|
|
|
|
title: "Clé",
|
|
|
|
icon: "admin-network",
|
|
|
|
icon: "admin-network",
|
|
|
|
isActive: iconName === "key",
|
|
|
|
isActive: iconName === "key",
|
|
|
|
onClick: () => handleIconChange("key")
|
|
|
|
onClick: () => handleIconChange("key")
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
title: "Lien",
|
|
|
|
title: "Lien",
|
|
|
|
icon: "admin-links",
|
|
|
|
icon: "admin-links",
|
|
|
|
isActive: iconName === "chain",
|
|
|
|
isActive: iconName === "chain",
|
|
|
|
onClick: () => handleIconChange("chain")
|
|
|
|
onClick: () => handleIconChange("chain")
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
title: "Homegrade",
|
|
|
|
title: "Homegrade",
|
|
|
|
icon: "admin-home",
|
|
|
|
icon: "admin-home",
|
|
|
|
isActive: iconName === "house",
|
|
|
|
isActive: iconName === "house",
|
|
|
|
onClick: () => handleIconChange("house")
|
|
|
|
onClick: () => handleIconChange("house")
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
|
|
|
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarButton, {
|
|
|
|
title: "Inspiration",
|
|
|
|
title: "Inspiration",
|
|
|
|
icon: "lightbulb",
|
|
|
|
icon: "lightbulb",
|
|
|
|
isActive: iconName === "bulb",
|
|
|
|
isActive: iconName === "bulb",
|
|
|
|
onClick: () => handleIconChange("bulb")
|
|
|
|
onClick: () => handleIconChange("bulb")
|
|
|
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.KeyboardShortcuts, {
|
|
|
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.KeyboardShortcuts, {
|
|
|
|
shortcuts: {
|
|
|
|
shortcuts: {
|
|
|
|
enter: e => insertParagraphOnEnter(e)
|
|
|
|
enter: e => insertParagraphOnEnter(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.RichText, {
|
|
|
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.RichText, {
|
|
|
|
onChange: onChangeTitle,
|
|
|
|
onChange: onChangeTitle,
|
|
|
|
value: title,
|
|
|
|
value: title,
|
|
|
|
disableLineBreaks: true,
|
|
|
|
disableLineBreaks: true,
|
|
|
|
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Insérez votre titre ici", "homegrade-blocks__texte-fonctionnel"),
|
|
|
|
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Insérez votre titre ici", "homegrade-blocks__texte-backoffice"),
|
|
|
|
allowedFormats: ["homegrade-format/tooltip"],
|
|
|
|
allowedFormats: ["homegrade-format/tooltip"],
|
|
|
|
tagName: headingLevel,
|
|
|
|
tagName: headingLevel,
|
|
|
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.useBlockProps)({
|
|
|
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.useBlockProps)({
|
|
|
|
className: `homegrade-blocks-custom-heading ${hasIcon ? "has-icon has-icon--" + iconName : " "}`
|
|
|
|
className: `homegrade-blocks-custom-heading ${hasIcon ? "has-icon has-icon--" + iconName : " "}`
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
style: {
|
|
|
|
style: {
|
|
|
|
@ -418,7 +415,7 @@ module.exports = window["wp"]["primitives"];
|
|
|
|
\************************/
|
|
|
|
\************************/
|
|
|
|
/***/ ((module) => {
|
|
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-heading","version":"0.1.0","title":"Titre","category":"homegrade-blocks","icon":"smiley","description":"Bloc de titrage","supports":{"html":false},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"title":{"type":"string"},"headingLevel":{"type":"string","default":"h3"},"hasIcon":{"type":"boolean","default":false},"iconName":{"type":"string","default":"key"}}}');
|
|
|
|
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-heading","version":"0.1.0","title":"Titre","category":"homegrade-blocks","icon":"smiley","description":"Bloc de titrage h2/h3/h4 avec ou sans icône","supports":{"html":false,"renaming":true},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"title":{"type":"string"},"headingLevel":{"type":"string","default":"h3"},"hasIcon":{"type":"boolean","default":false},"iconName":{"type":"string","default":"key"}}}');
|
|
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
|
|
|