diff --git a/blocks/content-heading/build/block.json b/blocks/content-heading/build/block.json
index 45bc5ca..14bf7b8 100644
--- a/blocks/content-heading/build/block.json
+++ b/blocks/content-heading/build/block.json
@@ -23,6 +23,14 @@
"headingLevel": {
"type": "string",
"default": "h3"
+ },
+ "hasIcon": {
+ "type": "boolean",
+ "default": false
+ },
+ "iconName": {
+ "type": "string",
+ "default": "key"
}
}
}
\ No newline at end of file
diff --git a/blocks/content-heading/build/index.asset.php b/blocks/content-heading/build/index.asset.php
index b071298..9d5decc 100644
--- a/blocks/content-heading/build/index.asset.php
+++ b/blocks/content-heading/build/index.asset.php
@@ -1 +1 @@
- array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '9d127840849a10578990');
+ array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '915fe1008255560e528e');
diff --git a/blocks/content-heading/build/index.css b/blocks/content-heading/build/index.css
deleted file mode 100644
index b632374..0000000
--- a/blocks/content-heading/build/index.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/*!****************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
- \****************************************************************************************************************************************************************************************************************************************/
-/**
- * The following styles get applied inside the editor only.
- *
- * Replace them with your own styles or remove the file completely.
- */
-
-/*# sourceMappingURL=index.css.map*/
\ No newline at end of file
diff --git a/blocks/content-heading/build/index.css.map b/blocks/content-heading/build/index.css.map
deleted file mode 100644
index a905945..0000000
--- a/blocks/content-heading/build/index.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA,C","sources":["webpack://multiblocks/./src/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n// .block-editor-image-size-control {\n// \tdisplay: none;\n// }\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
diff --git a/blocks/content-heading/build/index.js b/blocks/content-heading/build/index.js
index 4f82c01..0a3d0ed 100644
--- a/blocks/content-heading/build/index.js
+++ b/blocks/content-heading/build/index.js
@@ -16,18 +16,18 @@ __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_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_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* 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_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* 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_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
/* 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_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/heading-level-5.js");
-/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
@@ -35,6 +35,8 @@ __webpack_require__.r(__webpack_exports__);
+// import BlockHeadingControls from "./BlockHeadingControls";
+
function Edit({
@@ -45,24 +47,79 @@ function Edit({
}) {
const {
title,
- headingLevel
+ headingLevel,
+ hasIcon,
+ iconName
} = attributes;
+ const blockIndex = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
+ const {
+ getBlockIndex
+ } = select("core/block-editor");
+ return getBlockIndex(clientId);
+ });
function onChangeHeadingLevel(newHeadingLevel) {
setAttributes({
headingLevel: newHeadingLevel
});
}
function insertParagraphOnEnter(e) {
- 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);
+ 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);
}
- const blockIndex = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
- const {
- getBlockIndex
- } = select("core/block-editor");
- return getBlockIndex(clientId);
- });
- 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_2__.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, {
+ function handleIconChange(newIconName) {
+ setAttributes({
+ iconName: newIconName
+ });
+ }
+ function onHasIconChange(hasIconToggleValue) {
+ setAttributes({
+ hasIcon: hasIconToggleValue
+ });
+ }
+ // function getIconPicture() {
+ // switch (iconName) {
+ // case "key":
+ // return keyIcon;
+
+ // case "chain":
+ // return chainIcon;
+
+ // case "house":
+ // return houseIcon;
+
+ // case "bulb":
+ // return bulbIcon;
+ // }
+ // }
+ // function getDashiconSymbol() {
+ // switch (iconName) {
+ // case "key":
+ // return "admin-network";
+
+ // case "chain":
+ // return "admin-links";
+
+ // case "house":
+ // return "admin-home";
+
+ // case "bulb":
+ // return "lightbulb";
+ // }
+ // }
+
+ // let iconPicture = getIconPicture();
+ // let iconDashiconSymbol = getDashiconSymbol();
+
+ console.log("hasIcon", hasIcon);
+ console.log("iconName", iconName);
+ 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, {
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Icone", "homegrade-blocks__texte-fonctionnel"),
+ initialOpen: true
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToggleControl, {
+ label: "Afficher un icone",
+ checked: hasIcon,
+ 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, {
isActive: headingLevel === "h3",
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"],
onClick: () => {
@@ -80,11 +137,31 @@ function Edit({
onClick: () => {
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, {
+ title: "Clé",
+ icon: "admin-network",
+ isActive: iconName === "key",
+ onClick: () => handleIconChange("key")
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
+ title: "Lien",
+ icon: "admin-links",
+ isActive: iconName === "chain",
+ onClick: () => handleIconChange("chain")
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
+ title: "Homegrade",
+ icon: "admin-home",
+ isActive: iconName === "house",
+ onClick: () => handleIconChange("house")
+ }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
+ title: "Inspiration",
+ icon: "lightbulb",
+ isActive: iconName === "bulb",
+ onClick: () => handleIconChange("bulb")
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.KeyboardShortcuts, {
shortcuts: {
enter: e => insertParagraphOnEnter(e)
}
- }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
+ }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.RichText, {
onChange: value => setAttributes({
title: value
}),
@@ -93,9 +170,12 @@ function Edit({
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Insérez votre titre ici", "homegrade-blocks__texte-fonctionnel"),
allowedFormats: ["homegrade-format/tooltip"],
tagName: headingLevel,
- ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
- className: `homegrade-blocks-custom-heading`
- })
+ ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.useBlockProps)({
+ className: `homegrade-blocks-custom-heading ${hasIcon ? "has-icon has-icon--" + iconName : " "}`
+ }),
+ style: {
+ backgroundImage: "red"
+ }
})));
}
@@ -163,13 +243,15 @@ function save({
}) {
const {
title,
- headingLevel
+ headingLevel,
+ hasIcon,
+ iconName
} = attributes;
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_1__.RichText.Content, {
tagName: headingLevel,
value: title,
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
- className: `homegrade-blocks-custom-heading`
+ className: `homegrade-blocks-custom-heading ${hasIcon ? "has-icon has-icon--" + iconName : ""}`
})
}));
}
@@ -369,7 +451,7 @@ module.exports = window["wp"]["primitives"];
\************************/
/***/ ((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","source":"html","selector":"h3"},"headingLevel":{"type":"string","default":"h3"}}}');
+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","source":"html","selector":"h3"},"headingLevel":{"type":"string","default":"h3"},"hasIcon":{"type":"boolean","default":false},"iconName":{"type":"string","default":"key"}}}');
/***/ })
diff --git a/blocks/content-heading/build/index.js.map b/blocks/content-heading/build/index.js.map
index 00b1299..d7e6517 100644
--- a/blocks/content-heading/build/index.js.map
+++ b/blocks/content-heading/build/index.js.map
@@ -1 +1 @@
-{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AAMJ;AACe;AACM;AAEc;AACW;AACrB;AAEnC;AAER,SAASa,IAAIA,CAAC;EAC5BC,UAAU;EACVC,aAAa;EACbC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAE;EACF,MAAM;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAGL,UAAU;EAE1C,SAASM,oBAAoBA,CAACC,eAAe,EAAE;IAC9CN,aAAa,CAAC;MAAEI,YAAY,EAAEE;IAAgB,CAAC,CAAC;EACjD;EACA,SAASC,sBAAsBA,CAACC,CAAC,EAAE;IAClC,MAAMC,QAAQ,GAAGpB,8DAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAClDC,yDAAQ,CAAC,mBAAmB,CAAC,CAACoB,YAAY,CAACD,QAAQ,EAAEE,UAAU,GAAG,CAAC,CAAC;EACrE;EACA,MAAMA,UAAU,GAAGpB,0DAAS,CAAEqB,MAAM,IAAK;IACxC,MAAM;M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D,iEAAe,aAAa,EAAC;AAC7B;;;;;;;;;;;;;;;;;;ACbmD;;AAEnD;AACA;AACA;AACkD;AAClD,sBAAsB,iEAAa,CAAC,sDAAG;AACvC;AACA;AACA,CAAC,EAAE,iEAAa,CAAC,uDAAI;AACrB;AACA,CAAC;AACD,iEAAe,aAAa,EAAC;AAC7B;;;;;;;;;;ACbA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEnDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/heading-level-3.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/heading-level-4.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/heading-level-5.js","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/external window [\"wp\",\"primitives\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\n\nimport {\n\tuseBlockProps,\n\tRichText,\n\tBlockControls,\n} from \"@wordpress/block-editor\";\nimport { createBlock } from \"@wordpress/blocks\";\nimport { dispatch, useSelect } from \"@wordpress/data\";\n\nimport { ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\nimport { headingLevel3, headingLevel4, headingLevel5 } from \"@wordpress/icons\";\nimport { KeyboardShortcuts } from \"@wordpress/components\";\n\nimport \"./editor.scss\";\n\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\t...blockProps\n}) {\n\tconst { title, headingLevel } = attributes;\n\n\tfunction onChangeHeadingLevel(newHeadingLevel) {\n\t\tsetAttributes({ headingLevel: newHeadingLevel });\n\t}\n\tfunction insertParagraphOnEnter(e) {\n\t\tconst newBlock = createBlock(\"core/paragraph\", {});\n\t\tdispatch(\"core/block-editor\").insertBlocks(newBlock, blockIndex + 1);\n\t}\n\tconst blockIndex = useSelect((select) => {\n\t\tconst { getBlockIndex } = select(\"core/block-editor\");\n\t\treturn getBlockIndex(clientId);\n\t});\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonChangeHeadingLevel(\"h3\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonChangeHeadingLevel(\"h4\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonChangeHeadingLevel(\"h5\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t insertParagraphOnEnter(e),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t setAttributes({ title: value })}\n\t\t\t\t\tvalue={title}\n\t\t\t\t\tdisableLineBreaks\n\t\t\t\t\tplaceholder={__(\n\t\t\t\t\t\t\"Insérez votre titre ici\",\n\t\t\t\t\t\t\"homegrade-blocks__texte-fonctionnel\"\n\t\t\t\t\t)}\n\t\t\t\t\tallowedFormats={[\"homegrade-format/tooltip\"]}\n\t\t\t\t\ttagName={headingLevel}\n\t\t\t\t\t{...useBlockProps({\n\t\t\t\t\t\tclassName: `homegrade-blocks-custom-heading`,\n\t\t\t\t\t})}\n\t\t\t\t/>\n\t\t\t\n\t\t>\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { title, headingLevel } = attributes;\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t>\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst headingLevel3 = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z\"\n}));\nexport default headingLevel3;\n//# sourceMappingURL=heading-level-3.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst headingLevel4 = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z\"\n}));\nexport default headingLevel4;\n//# sourceMappingURL=heading-level-4.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst headingLevel5 = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z\"\n}));\nexport default headingLevel5;\n//# sourceMappingURL=heading-level-5.js.map","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmultiblocks\"] = self[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","RichText","BlockControls","createBlock","dispatch","useSelect","ToolbarGroup","ToolbarButton","headingLevel3","headingLevel4","headingLevel5","KeyboardShortcuts","Edit","attributes","setAttributes","clientId","blockProps","title","headingLevel","onChangeHeadingLevel","newHeadingLevel","insertParagraphOnEnter","e","newBlock","insertBlocks","blockIndex","select","getBlockIndex","createElement","Fragment","isActive","icon","onClick","shortcuts","enter","onChange","value","disableLineBreaks","placeholder","allowedFormats","tagName","className","registerBlockType","save","metadata","name","src","xmlns","viewBox","width","height","focusable","d","foreground","edit","Content"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACW;AACM;AAMrB;AAMF;AAER;AACvB;AACwD;AACY;AACW;AAEhE,SAASgB,IAAIA,CAAC;EAC5BC,UAAU;EACVC,aAAa;EACbC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAE;EACF,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGP,UAAU;EAC7D,MAAMQ,UAAU,GAAGtB,0DAAS,CAAEuB,MAAM,IAAK;IACxC,MAAM;MAAEC;IAAc,CAAC,GAAGD,MAAM,CAAC,mBAAmB,CAAC;IACrD,OAAOC,aAAa,CAACR,QAAQ,CAAC;EAC/B,CAAC,CAAC;EAEF,SAASS,oBAAoBA,CAACC,eAAe,EAAE;IAC9CX,aAAa,CAAC;MAAEI,YAAY,EAAEO;IAAgB,CAAC,CAAC;EACjD;EACA,SAASC,sBAAsBA,CAACC,CAAC,EAAE;IAClC,MAAMC,QAAQ,GAAG/B,8DAA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;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEnDA;UACA;UACA;UACA;UACA","sources":["webpack://multiblocks/./src/edit.js","webpack://multiblocks/./src/index.js","webpack://multiblocks/./src/save.js","webpack://multiblocks/./src/editor.scss","webpack://multiblocks/./src/style.scss","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/heading-level-3.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/heading-level-4.js","webpack://multiblocks/../../node_modules/@wordpress/icons/build-module/library/heading-level-5.js","webpack://multiblocks/external window [\"wp\",\"blockEditor\"]","webpack://multiblocks/external window [\"wp\",\"blocks\"]","webpack://multiblocks/external window [\"wp\",\"components\"]","webpack://multiblocks/external window [\"wp\",\"data\"]","webpack://multiblocks/external window [\"wp\",\"element\"]","webpack://multiblocks/external window [\"wp\",\"i18n\"]","webpack://multiblocks/external window [\"wp\",\"primitives\"]","webpack://multiblocks/webpack/bootstrap","webpack://multiblocks/webpack/runtime/chunk loaded","webpack://multiblocks/webpack/runtime/compat get default export","webpack://multiblocks/webpack/runtime/define property getters","webpack://multiblocks/webpack/runtime/hasOwnProperty shorthand","webpack://multiblocks/webpack/runtime/make namespace object","webpack://multiblocks/webpack/runtime/jsonp chunk loading","webpack://multiblocks/webpack/before-startup","webpack://multiblocks/webpack/startup","webpack://multiblocks/webpack/after-startup"],"sourcesContent":["import { __ } from \"@wordpress/i18n\";\nimport { createBlock } from \"@wordpress/blocks\";\nimport { dispatch, useSelect } from \"@wordpress/data\";\n\nimport {\n\tuseBlockProps,\n\tRichText,\n\tInspectorControls,\n} from \"@wordpress/block-editor\";\n\nimport {\n\tToggleControl,\n\tPanelBody,\n\tKeyboardShortcuts,\n} from \"@wordpress/components\";\n\nimport \"./editor.scss\";\n// import BlockHeadingControls from \"./BlockHeadingControls\";\nimport { BlockControls } from \"@wordpress/block-editor\";\nimport { ToolbarGroup, ToolbarButton } from \"@wordpress/components\";\nimport { headingLevel3, headingLevel4, headingLevel5 } from \"@wordpress/icons\";\n\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\t...blockProps\n}) {\n\tconst { title, headingLevel, hasIcon, iconName } = attributes;\n\tconst blockIndex = useSelect((select) => {\n\t\tconst { getBlockIndex } = select(\"core/block-editor\");\n\t\treturn getBlockIndex(clientId);\n\t});\n\n\tfunction onChangeHeadingLevel(newHeadingLevel) {\n\t\tsetAttributes({ headingLevel: newHeadingLevel });\n\t}\n\tfunction insertParagraphOnEnter(e) {\n\t\tconst newBlock = createBlock(\"core/paragraph\", {});\n\t\tdispatch(\"core/block-editor\").insertBlocks(newBlock, blockIndex + 1);\n\t}\n\n\tfunction handleIconChange(newIconName) {\n\t\tsetAttributes({ iconName: newIconName });\n\t}\n\tfunction onHasIconChange(hasIconToggleValue) {\n\t\tsetAttributes({\n\t\t\thasIcon: hasIconToggleValue,\n\t\t});\n\t}\n\t// function getIconPicture() {\n\t// \tswitch (iconName) {\n\t// \t\tcase \"key\":\n\t// \t\t\treturn keyIcon;\n\n\t// \t\tcase \"chain\":\n\t// \t\t\treturn chainIcon;\n\n\t// \t\tcase \"house\":\n\t// \t\t\treturn houseIcon;\n\n\t// \t\tcase \"bulb\":\n\t// \t\t\treturn bulbIcon;\n\t// \t}\n\t// }\n\t// function getDashiconSymbol() {\n\t// \tswitch (iconName) {\n\t// \t\tcase \"key\":\n\t// \t\t\treturn \"admin-network\";\n\n\t// \t\tcase \"chain\":\n\t// \t\t\treturn \"admin-links\";\n\n\t// \t\tcase \"house\":\n\t// \t\t\treturn \"admin-home\";\n\n\t// \t\tcase \"bulb\":\n\t// \t\t\treturn \"lightbulb\";\n\t// \t}\n\t// }\n\n\t// let iconPicture = getIconPicture();\n\t// let iconDashiconSymbol = getDashiconSymbol();\n\n\tconsole.log(\"hasIcon\", hasIcon);\n\tconsole.log(\"iconName\", iconName);\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonChangeHeadingLevel(\"h3\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonChangeHeadingLevel(\"h4\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t {\n\t\t\t\t\t\t\tonChangeHeadingLevel(\"h5\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t{hasIcon && (\n\t\t\t\t\t\n\t\t\t\t\t\t handleIconChange(\"key\")}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t handleIconChange(\"chain\")}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t handleIconChange(\"house\")}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t handleIconChange(\"bulb\")}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\n\t\t\t{/* */}\n\n\t\t\t insertParagraphOnEnter(e),\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t setAttributes({ title: value })}\n\t\t\t\t\tvalue={title}\n\t\t\t\t\tdisableLineBreaks\n\t\t\t\t\tplaceholder={__(\n\t\t\t\t\t\t\"Insérez votre titre ici\",\n\t\t\t\t\t\t\"homegrade-blocks__texte-fonctionnel\"\n\t\t\t\t\t)}\n\t\t\t\t\tallowedFormats={[\"homegrade-format/tooltip\"]}\n\t\t\t\t\ttagName={headingLevel}\n\t\t\t\t\t{...useBlockProps({\n\t\t\t\t\t\tclassName: `homegrade-blocks-custom-heading ${\n\t\t\t\t\t\t\thasIcon ? \"has-icon has-icon--\" + iconName : \" \"\n\t\t\t\t\t\t}`,\n\t\t\t\t\t})}\n\t\t\t\t\tstyle={{ backgroundImage: \"red\" }}\n\t\t\t\t/>\n\t\t\t\n\t\t>\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport \"./style.scss\";\n\nimport Edit from \"./edit\";\nimport save from \"./save\";\nimport metadata from \"./block.json\";\n\nregisterBlockType(metadata.name, {\n\ticon: {\n\t\tsrc: (\n\t\t\t\n\t\t),\n\t\tforeground: \"#DF1E1E\",\n\t},\n\tedit: Edit,\n\tsave,\n});\n","import { useBlockProps, RichText } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst { title, headingLevel, hasIcon, iconName } = attributes;\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t>\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst headingLevel3 = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z\"\n}));\nexport default headingLevel3;\n//# sourceMappingURL=heading-level-3.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst headingLevel4 = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z\"\n}));\nexport default headingLevel4;\n//# sourceMappingURL=heading-level-4.js.map","import { createElement } from \"@wordpress/element\";\n\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst headingLevel5 = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z\"\n}));\nexport default headingLevel5;\n//# sourceMappingURL=heading-level-5.js.map","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmultiblocks\"] = self[\"webpackChunkmultiblocks\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","createBlock","dispatch","useSelect","useBlockProps","RichText","InspectorControls","ToggleControl","PanelBody","KeyboardShortcuts","BlockControls","ToolbarGroup","ToolbarButton","headingLevel3","headingLevel4","headingLevel5","Edit","attributes","setAttributes","clientId","blockProps","title","headingLevel","hasIcon","iconName","blockIndex","select","getBlockIndex","onChangeHeadingLevel","newHeadingLevel","insertParagraphOnEnter","e","newBlock","insertBlocks","handleIconChange","newIconName","onHasIconChange","hasIconToggleValue","console","log","createElement","Fragment","initialOpen","label","checked","onChange","isActive","icon","onClick","shortcuts","enter","value","disableLineBreaks","placeholder","allowedFormats","tagName","className","style","backgroundImage","registerBlockType","save","metadata","name","src","xmlns","viewBox","width","height","focusable","d","foreground","edit","Content"],"sourceRoot":""}
\ No newline at end of file
diff --git a/blocks/content-heading/build/style-index.css b/blocks/content-heading/build/style-index.css
index 58125f9..68e646b 100644
--- a/blocks/content-heading/build/style-index.css
+++ b/blocks/content-heading/build/style-index.css
@@ -1,61 +1,33 @@
/*!***************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
\***************************************************************************************************************************************************************************************************************************************/
-/**
- * The following styles get applied both on the front of your site
- * and in the editor.
- *
- * Replace them with your own styles or remove the file completely.
- */
-.wpblock-citation-block {
- position: relative;
- padding: 80px 20px;
- margin-top: 50px !important;
- margin-bottom: 50px !important;
+.homegrade-blocks-custom-heading.has-icon {
+ display: flex;
+ align-items: center;
}
-.wpblock-citation-block .wpblock-citation-citation {
- font-weight: 600;
- font-size: 50px;
- line-height: 1.2;
- text-transform: unset;
- padding-bottom: 50px;
+.homegrade-blocks-custom-heading.has-icon::before {
+ content: "";
+ background-color: red;
+ width: 40px;
+ height: 40px;
+ border-radius: 100%;
+ padding: 20px;
+ display: inline-block;
+ margin-right: 10px;
+ background-position: center;
+ background-repeat: no-repeat;
}
-.wpblock-citation-block .wpblock-citation-author {
- padding-top: 20px;
+.homegrade-blocks-custom-heading.has-icon.has-icon--key::before {
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNy44MDMiIGhlaWdodD0iMTcuNDI2IiB2aWV3Qm94PSIwIDAgMTcuODAzIDE3LjQyNiI+CiAgPHBhdGggaWQ9Ikljb25fZmVhdGhlci1rZXkiIGRhdGEtbmFtZT0iSWNvbiBmZWF0aGVyLWtleSIgZD0iTTE4LjAxMywzbC0xLjU4LDEuNThNMTAuNDIsMTAuNTkzYTQuMzQ2LDQuMzQ2LDAsMSwxLTYuMTQ2LDAsNC4zNDYsNC4zNDYsMCwwLDEsNi4xNDYsMFptMCwwLDMuMjQ4LTMuMjQ4bTAsMCwyLjM3LDIuMzdMMTguOCw2Ljk1MWwtMi4zNy0yLjM3TTEzLjY2OCw3LjM0NiwxNi40MzMsNC41OCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIuMDAxIC0xLjU4NikiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg==);
}
-.wpblock-citation-block .wpblock-citation-citation,
-.wpblock-citation-block .wpblock-citation-author {
- max-width: 1040px;
- margin: 0;
+.homegrade-blocks-custom-heading.has-icon.has-icon--house::before {
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi4zODgiIGhlaWdodD0iMTQuMTg2IiB2aWV3Qm94PSIwIDAgMTIuMzg4IDE0LjE4NiI+CiAgPHBhdGggaWQ9IlRyYWPDqV8xODUzNCIgZGF0YS1uYW1lPSJUcmFjw6kgMTg1MzQiIGQ9Ik05NjAuMjE0LDkyOS40NDJsLTUuMTk0LDQuNzgydjcuNGgxMC4zODh2LTcuNFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC05NTQuMDIgLTkyOC40NDIpIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=);
}
-.wpblock-citation-block.text-align-right {
- padding-right: 50px;
- text-align: right;
+.homegrade-blocks-custom-heading.has-icon.has-icon--bulb::before {
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy4wOTgiIGhlaWdodD0iMTguNDA5IiB2aWV3Qm94PSIwIDAgMTMuMDk4IDE4LjQwOSI+CiAgPGcgaWQ9Ikdyb3VwZV8zMjA5IiBkYXRhLW5hbWU9Ikdyb3VwZSAzMjA5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTkzIC00ODEwKSI+CiAgICA8ZyBpZD0iVW5pb25fMTgiIGRhdGEtbmFtZT0iVW5pb24gMTgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE5MyA0ODEwKSIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICAgICAgPHBhdGggZD0iTTQuNDQ3LDE0Ljg0NWExLDEsMCwwLDEtMS0xVjEyLjA1OEE2LjM5Miw2LjM5MiwwLDAsMSwwLDYuNDExLDYuNDgxLDYuNDgxLDAsMCwxLDYuNTQ5LDAsNi40ODEsNi40ODEsMCwwLDEsMTMuMSw2LjQxMWE2LjM5Myw2LjM5MywwLDAsMS0zLjQ0Nyw1LjY0N3YxLjc4N2ExLDEsMCwwLDEtMSwxWiIgc3Ryb2tlPSJub25lIi8+CiAgICAgIDxwYXRoIGQ9Ik0gNy42NTA3MDAwOTIzMTU2NzQgMTIuODQ1NDk5OTkyMzcwNjEgTCA3LjY1MDcwMDA5MjMxNTY3NCAxMi4wNTgxMTk3NzM4NjQ3NSBDIDcuNjUwNzAwMDkyMzE1Njc0IDExLjMxNjIyMDI4MzUwODMgOC4wNjEzODAzODYzNTI1MzkgMTAuNjM1Mjc5NjU1NDU2NTQgOC43MTc1Nzk4NDE2MTM3NyAxMC4yODkxMzk3NDc2MTk2MyBDIDEwLjE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bmQiIHN0cm9rZS13aWR0aD0iMiIvPgogIDwvZz4KPC9zdmc+Cg==);
}
-.wpblock-citation-block.text-align-right .wpblock-citation-citation,
-.wpblock-citation-block.text-align-right .wpblock-citation-author {
- margin-left: auto;
-}
-.wpblock-citation-block.text-align-left {
- padding-left: 50px;
- text-align: left;
-}
-.wpblock-citation-block.text-align-center {
- text-align: center;
-}
-.wpblock-citation-block.text-align-center .wpblock-citation-citation,
-.wpblock-citation-block.text-align-center .wpblock-citation-author {
- margin: 0 auto;
-}
-.wpblock-citation-block figure,
-.wpblock-citation-block img {
- width: 100%;
- height: 250px;
-}
-.wpblock-citation-block img {
- -o-object-fit: cover;
- object-fit: cover;
- filter: brightness(0.3) grayscale(100%) sepia(100%) hue-rotate(200deg) opacity(0.5);
+.homegrade-blocks-custom-heading.has-icon.has-icon--chain::before {
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNi4wMTIiIGhlaWdodD0iMTUuOTk5IiB2aWV3Qm94PSIwIDAgMTYuMDEyIDE1Ljk5OSI+CiAgPGcgaWQ9Ikljb25fZmVhdGhlci1saW5rIiBkYXRhLW5hbWU9Ikljb24gZmVhdGhlci1saW5rIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMS45OTMgLTIuMDA3KSI+CiAgICA8cGF0aCBpZD0iVHJhY8OpXzE4NTU5IiBkYXRhLW5hbWU9IlRyYWPDqSAxODU1OSIgZD0iTTE1LDEwLjcwN2EzLjUsMy41LDAsMCwwLDUuMjguMzc4bDIuMS0yLjFBMy41LDMuNSwwLDEsMCwxNy40Myw0LjAzM2wtMS4yLDEuMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTYuNDAyIDApIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBpZD0iVHJhY8OpXzE4NTYwIiBkYXRhLW5hbWU9IlRyYWPDqSAxODU2MCIgZD0iTTExLjQsMTQuOWEzLjUsMy41LDAsMCwwLTUuMjgtLjM3OGwtMi4xLDIuMUEzLjUsMy41LDAsMSwwLDguOTcsMjEuNTdsMS4yLTEuMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNS41OSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8L2c+Cjwvc3ZnPgo=);
}
/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
diff --git a/blocks/content-heading/build/style-index.css.map b/blocks/content-heading/build/style-index.css.map
index dbc7af6..3685f96 100644
--- a/blocks/content-heading/build/style-index.css.map
+++ b/blocks/content-heading/build/style-index.css.map
@@ -1 +1 @@
-{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EACC;EACA;EACA;EACA;AAAD;AAEC;EACC;EACA;EACA;EACA;EACA;AAAF;AAEC;EACC;AAAF;AAGC;;EAEC;EACA;AADF;AAIC;EACC;EACA;AAFF;AAGE;;EAEC;AADH;AAIC;EACC;EACA;AAFF;AAIC;EACC;AAFF;AAIE;;EAEC;AAFH;AAMC;;EAEC;EACA;AAJF;AAMC;EACC;KAAA;EACA;AAJF,C","sources":["webpack://multiblocks/./src/style.scss"],"sourcesContent":["/**\n * The following styles get applied both on the front of your site\n * and in the editor.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wpblock-citation-block {\n\tposition: relative;\n\tpadding: 80px 20px;\n\tmargin-top: 50px !important;\n\tmargin-bottom: 50px !important;\n\n\t.wpblock-citation-citation {\n\t\tfont-weight: 600;\n\t\tfont-size: 50px;\n\t\tline-height: 1.2;\n\t\ttext-transform: unset;\n\t\tpadding-bottom: 50px;\n\t}\n\t.wpblock-citation-author {\n\t\tpadding-top: 20px;\n\t}\n\n\t.wpblock-citation-citation,\n\t.wpblock-citation-author {\n\t\tmax-width: 1040px;\n\t\tmargin: 0;\n\t}\n\n\t&.text-align-right {\n\t\tpadding-right: 50px;\n\t\ttext-align: right;\n\t\t.wpblock-citation-citation,\n\t\t.wpblock-citation-author {\n\t\t\tmargin-left: auto;\n\t\t}\n\t}\n\t&.text-align-left {\n\t\tpadding-left: 50px;\n\t\ttext-align: left;\n\t}\n\t&.text-align-center {\n\t\ttext-align: center;\n\n\t\t.wpblock-citation-citation,\n\t\t.wpblock-citation-author {\n\t\t\tmargin: 0 auto;\n\t\t}\n\t}\n\n\tfigure,\n\timg {\n\t\twidth: 100%;\n\t\theight: 250px;\n\t}\n\timg {\n\t\tobject-fit: cover;\n\t\tfilter: brightness(0.3) grayscale(100%) sepia(100%) hue-rotate(200deg)\n\t\t\topacity(0.5);\n\t}\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACC;EACA;AACD;AACC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACF;AACC;EACC;AACF;AACC;EACC;AACF;AACC;EACC;AACF;AACC;EACC;AACF,C","sources":["webpack://multiblocks/./src/style.scss"],"sourcesContent":[".homegrade-blocks-custom-heading.has-icon {\n\tdisplay: flex;\n\talign-items: center;\n\n\t&::before {\n\t\tcontent: \"\";\n\t\tbackground-color: red;\n\t\twidth: 40px;\n\t\theight: 40px;\n\t\tborder-radius: 100%;\n\t\tpadding: 20px;\n\t\tdisplay: inline-block;\n\t\tmargin-right: 10px;\n\t\tbackground-position: center;\n\t\tbackground-repeat: no-repeat;\n\t}\n\t&.has-icon--key::before {\n\t\tbackground-image: url(\"../src/img/icon_key.svg\");\n\t}\n\t&.has-icon--house::before {\n\t\tbackground-image: url(\"../src/img/icon_house.svg\");\n\t}\n\t&.has-icon--bulb::before {\n\t\tbackground-image: url(\"../src/img/icon_bulb.svg\");\n\t}\n\t&.has-icon--chain::before {\n\t\tbackground-image: url(\"../src/img/icon_chain.svg\");\n\t}\n}\n"],"names":[],"sourceRoot":""}
\ No newline at end of file
diff --git a/blocks/content-heading/src/BlockHeadingControls.js b/blocks/content-heading/src/BlockHeadingControls.js
new file mode 100644
index 0000000..52dbf05
--- /dev/null
+++ b/blocks/content-heading/src/BlockHeadingControls.js
@@ -0,0 +1,46 @@
+import { __ } from "@wordpress/i18n";
+
+export default function BlockHeadingControls({
+ hasIcon,
+ setAttributes,
+ headingLevel,
+ iconName,
+}) {
+ function handleIconChange(newIconName) {
+ setAttributes({ iconName: newIconName });
+ }
+ function getIconPicture() {
+ switch (iconName) {
+ case "key":
+ return keyIcon;
+
+ case "chain":
+ return chainIcon;
+
+ case "house":
+ return houseIcon;
+
+ case "bulb":
+ return bulbIcon;
+ }
+ }
+ function getDashiconSymbol() {
+ switch (iconName) {
+ case "key":
+ return "admin-network";
+
+ case "chain":
+ return "admin-links";
+
+ case "house":
+ return "admin-home";
+
+ case "bulb":
+ return "lightbulb";
+ }
+ }
+
+ return (
+
+ );
+}
diff --git a/blocks/content-heading/src/IconControls.js b/blocks/content-heading/src/IconControls.js
new file mode 100644
index 0000000..80ea276
--- /dev/null
+++ b/blocks/content-heading/src/IconControls.js
@@ -0,0 +1,18 @@
+import { __ } from "@wordpress/i18n";
+
+export default function IconControls({ hasIcon, setAttributes }) {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/blocks/content-heading/src/block.json b/blocks/content-heading/src/block.json
index d36da33..82922ee 100644
--- a/blocks/content-heading/src/block.json
+++ b/blocks/content-heading/src/block.json
@@ -23,6 +23,14 @@
"headingLevel": {
"type": "string",
"default": "h3"
+ },
+ "hasIcon": {
+ "type": "boolean",
+ "default": false
+ },
+ "iconName": {
+ "type": "string",
+ "default": "key"
}
}
}
\ No newline at end of file
diff --git a/blocks/content-heading/src/edit.js b/blocks/content-heading/src/edit.js
index 91fa9fe..d65ea9a 100644
--- a/blocks/content-heading/src/edit.js
+++ b/blocks/content-heading/src/edit.js
@@ -1,18 +1,24 @@
import { __ } from "@wordpress/i18n";
+import { createBlock } from "@wordpress/blocks";
+import { dispatch, useSelect } from "@wordpress/data";
import {
useBlockProps,
RichText,
- BlockControls,
+ InspectorControls,
} from "@wordpress/block-editor";
-import { createBlock } from "@wordpress/blocks";
-import { dispatch, useSelect } from "@wordpress/data";
-import { ToolbarGroup, ToolbarButton } from "@wordpress/components";
-import { headingLevel3, headingLevel4, headingLevel5 } from "@wordpress/icons";
-import { KeyboardShortcuts } from "@wordpress/components";
+import {
+ ToggleControl,
+ PanelBody,
+ KeyboardShortcuts,
+} from "@wordpress/components";
import "./editor.scss";
+// import BlockHeadingControls from "./BlockHeadingControls";
+import { BlockControls } from "@wordpress/block-editor";
+import { ToolbarGroup, ToolbarButton } from "@wordpress/components";
+import { headingLevel3, headingLevel4, headingLevel5 } from "@wordpress/icons";
export default function Edit({
attributes,
@@ -20,7 +26,11 @@ export default function Edit({
clientId,
...blockProps
}) {
- const { title, headingLevel } = attributes;
+ const { title, headingLevel, hasIcon, iconName } = attributes;
+ const blockIndex = useSelect((select) => {
+ const { getBlockIndex } = select("core/block-editor");
+ return getBlockIndex(clientId);
+ });
function onChangeHeadingLevel(newHeadingLevel) {
setAttributes({ headingLevel: newHeadingLevel });
@@ -29,13 +39,66 @@ export default function Edit({
const newBlock = createBlock("core/paragraph", {});
dispatch("core/block-editor").insertBlocks(newBlock, blockIndex + 1);
}
- const blockIndex = useSelect((select) => {
- const { getBlockIndex } = select("core/block-editor");
- return getBlockIndex(clientId);
- });
+
+ function handleIconChange(newIconName) {
+ setAttributes({ iconName: newIconName });
+ }
+ function onHasIconChange(hasIconToggleValue) {
+ setAttributes({
+ hasIcon: hasIconToggleValue,
+ });
+ }
+ // function getIconPicture() {
+ // switch (iconName) {
+ // case "key":
+ // return keyIcon;
+
+ // case "chain":
+ // return chainIcon;
+
+ // case "house":
+ // return houseIcon;
+
+ // case "bulb":
+ // return bulbIcon;
+ // }
+ // }
+ // function getDashiconSymbol() {
+ // switch (iconName) {
+ // case "key":
+ // return "admin-network";
+
+ // case "chain":
+ // return "admin-links";
+
+ // case "house":
+ // return "admin-home";
+
+ // case "bulb":
+ // return "lightbulb";
+ // }
+ // }
+
+ // let iconPicture = getIconPicture();
+ // let iconDashiconSymbol = getDashiconSymbol();
+
+ console.log("hasIcon", hasIcon);
+ console.log("iconName", iconName);
return (
<>
+
+
+
+
+
+ {hasIcon && (
+
+ handleIconChange("key")}
+ />
+ handleIconChange("chain")}
+ />
+ handleIconChange("house")}
+ />
+ handleIconChange("bulb")}
+ />
+
+ )}
+ {/* */}
+
insertParagraphOnEnter(e),
@@ -77,8 +175,11 @@ export default function Edit({
allowedFormats={["homegrade-format/tooltip"]}
tagName={headingLevel}
{...useBlockProps({
- className: `homegrade-blocks-custom-heading`,
+ className: `homegrade-blocks-custom-heading ${
+ hasIcon ? "has-icon has-icon--" + iconName : " "
+ }`,
})}
+ style={{ backgroundImage: "red" }}
/>
>
diff --git a/blocks/content-heading/src/editor.scss b/blocks/content-heading/src/editor.scss
index d0c9866..d33cd62 100644
--- a/blocks/content-heading/src/editor.scss
+++ b/blocks/content-heading/src/editor.scss
@@ -7,3 +7,4 @@
// .block-editor-image-size-control {
// display: none;
// }
+
diff --git a/blocks/content-heading/src/img/icon_bulb.png b/blocks/content-heading/src/img/icon_bulb.png
new file mode 100644
index 0000000..910efcf
Binary files /dev/null and b/blocks/content-heading/src/img/icon_bulb.png differ
diff --git a/blocks/content-heading/src/img/icon_bulb.svg b/blocks/content-heading/src/img/icon_bulb.svg
new file mode 100644
index 0000000..bd7eb62
--- /dev/null
+++ b/blocks/content-heading/src/img/icon_bulb.svg
@@ -0,0 +1,9 @@
+
diff --git a/blocks/content-heading/src/img/icon_chain.svg b/blocks/content-heading/src/img/icon_chain.svg
new file mode 100644
index 0000000..ffd3f80
--- /dev/null
+++ b/blocks/content-heading/src/img/icon_chain.svg
@@ -0,0 +1,6 @@
+
diff --git a/blocks/content-heading/src/img/icon_feather_key.png b/blocks/content-heading/src/img/icon_feather_key.png
new file mode 100644
index 0000000..b909ba2
Binary files /dev/null and b/blocks/content-heading/src/img/icon_feather_key.png differ
diff --git a/blocks/content-heading/src/img/icon_house.png b/blocks/content-heading/src/img/icon_house.png
new file mode 100644
index 0000000..b3e7798
Binary files /dev/null and b/blocks/content-heading/src/img/icon_house.png differ
diff --git a/blocks/content-heading/src/img/icon_house.svg b/blocks/content-heading/src/img/icon_house.svg
new file mode 100644
index 0000000..4b1a4c8
--- /dev/null
+++ b/blocks/content-heading/src/img/icon_house.svg
@@ -0,0 +1,3 @@
+
diff --git a/blocks/content-heading/src/img/icon_key.svg b/blocks/content-heading/src/img/icon_key.svg
new file mode 100644
index 0000000..c1f711b
--- /dev/null
+++ b/blocks/content-heading/src/img/icon_key.svg
@@ -0,0 +1,3 @@
+
diff --git a/blocks/content-heading/src/img/lily _light copie.png b/blocks/content-heading/src/img/lily _light copie.png
new file mode 100644
index 0000000..34e85ef
Binary files /dev/null and b/blocks/content-heading/src/img/lily _light copie.png differ
diff --git a/blocks/content-heading/src/save.js b/blocks/content-heading/src/save.js
index 708083b..f9b6779 100644
--- a/blocks/content-heading/src/save.js
+++ b/blocks/content-heading/src/save.js
@@ -1,7 +1,7 @@
import { useBlockProps, RichText } from "@wordpress/block-editor";
export default function save({ attributes }) {
- const { title, headingLevel } = attributes;
+ const { title, headingLevel, hasIcon, iconName } = attributes;
return (
<>
@@ -9,7 +9,9 @@ export default function save({ attributes }) {
tagName={headingLevel}
value={title}
{...useBlockProps.save({
- className: `homegrade-blocks-custom-heading`,
+ className: `homegrade-blocks-custom-heading ${
+ hasIcon ? "has-icon has-icon--" + iconName : ""
+ }`,
})}
/>
>
diff --git a/blocks/content-heading/src/style.scss b/blocks/content-heading/src/style.scss
index a72b660..a09c905 100644
--- a/blocks/content-heading/src/style.scss
+++ b/blocks/content-heading/src/style.scss
@@ -1,62 +1,29 @@
-/**
- * The following styles get applied both on the front of your site
- * and in the editor.
- *
- * Replace them with your own styles or remove the file completely.
- */
+.homegrade-blocks-custom-heading.has-icon {
+ display: flex;
+ align-items: center;
-.wpblock-citation-block {
- position: relative;
- padding: 80px 20px;
- margin-top: 50px !important;
- margin-bottom: 50px !important;
-
- .wpblock-citation-citation {
- font-weight: 600;
- font-size: 50px;
- line-height: 1.2;
- text-transform: unset;
- padding-bottom: 50px;
+ &::before {
+ content: "";
+ background-color: red;
+ width: 40px;
+ height: 40px;
+ border-radius: 100%;
+ padding: 20px;
+ display: inline-block;
+ margin-right: 10px;
+ background-position: center;
+ background-repeat: no-repeat;
}
- .wpblock-citation-author {
- padding-top: 20px;
+ &.has-icon--key::before {
+ background-image: url("../src/img/icon_key.svg");
}
-
- .wpblock-citation-citation,
- .wpblock-citation-author {
- max-width: 1040px;
- margin: 0;
+ &.has-icon--house::before {
+ background-image: url("../src/img/icon_house.svg");
}
-
- &.text-align-right {
- padding-right: 50px;
- text-align: right;
- .wpblock-citation-citation,
- .wpblock-citation-author {
- margin-left: auto;
- }
+ &.has-icon--bulb::before {
+ background-image: url("../src/img/icon_bulb.svg");
}
- &.text-align-left {
- padding-left: 50px;
- text-align: left;
- }
- &.text-align-center {
- text-align: center;
-
- .wpblock-citation-citation,
- .wpblock-citation-author {
- margin: 0 auto;
- }
- }
-
- figure,
- img {
- width: 100%;
- height: 250px;
- }
- img {
- object-fit: cover;
- filter: brightness(0.3) grayscale(100%) sepia(100%) hue-rotate(200deg)
- opacity(0.5);
+ &.has-icon--chain::before {
+ background-image: url("../src/img/icon_chain.svg");
}
}