extending block features and styles
This commit is contained in:
parent
a5316c06cd
commit
af0f8dea42
|
|
@ -14,6 +14,16 @@
|
||||||
"editorStyle": "file:./index.css",
|
"editorStyle": "file:./index.css",
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
|
"hasTitle": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"blockTitle": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"blockSubtitle": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"hasLateralCover": {
|
"hasLateralCover": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
|
@ -27,6 +37,12 @@
|
||||||
"lateralCoverAlt": {
|
"lateralCoverAlt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"lateralCoverCaption": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"lateralCoverDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"hasStepPictures": {
|
"hasStepPictures": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
|
|
@ -35,7 +51,7 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"stepPictureFormat": {
|
"lateralPicturesFormat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "md"
|
"default": "md"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'fddbf94156c32fb6a84b');
|
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'be9ed402b020cb138b51');
|
||||||
|
|
|
||||||
|
|
@ -2,243 +2,6 @@
|
||||||
/******/ "use strict";
|
/******/ "use strict";
|
||||||
/******/ var __webpack_modules__ = ({
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
/***/ "../_components/Image.jsx":
|
|
||||||
/*!********************************!*\
|
|
||||||
!*** ../_components/Image.jsx ***!
|
|
||||||
\********************************/
|
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
||||||
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ "default": () => (/* binding */ Image)
|
|
||||||
/* harmony export */ });
|
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
|
||||||
|
|
||||||
function Image({
|
|
||||||
imageUrl,
|
|
||||||
imageAlt,
|
|
||||||
imageProportion
|
|
||||||
}) {
|
|
||||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
|
||||||
src: imageUrl,
|
|
||||||
alt: imageAlt,
|
|
||||||
className: `homegrade-blocks-components-image homegrade-blocks-components-image--${imageProportion}-ratio`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "../_components/ImageMediaPlaceholder.jsx":
|
|
||||||
/*!************************************************!*\
|
|
||||||
!*** ../_components/ImageMediaPlaceholder.jsx ***!
|
|
||||||
\************************************************/
|
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
||||||
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ "default": () => (/* binding */ ImageMediaPlaceholder)
|
|
||||||
/* harmony export */ });
|
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
|
||||||
|
|
||||||
|
|
||||||
function ImageMediaPlaceholder({
|
|
||||||
imageId,
|
|
||||||
imageAlt,
|
|
||||||
imageUrl,
|
|
||||||
setAttributes
|
|
||||||
}) {
|
|
||||||
function setImageAttributes(image) {
|
|
||||||
setAttributes({
|
|
||||||
imageId: image.id,
|
|
||||||
imageAlt: image.alt,
|
|
||||||
imageUrl: image.url
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function removeImageAttributes() {
|
|
||||||
setAttributes({
|
|
||||||
imageId: null,
|
|
||||||
imageAlt: null,
|
|
||||||
imageUrl: null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !imageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaPlaceholder, {
|
|
||||||
accept: "image/*",
|
|
||||||
allowedTypes: ["image"],
|
|
||||||
onSelect: setImageAttributes,
|
|
||||||
multiple: false,
|
|
||||||
handleUpload: true
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "../_components/ImagePanelBody.jsx":
|
|
||||||
/*!*****************************************!*\
|
|
||||||
!*** ../_components/ImagePanelBody.jsx ***!
|
|
||||||
\*****************************************/
|
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
||||||
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ "default": () => (/* binding */ ImagePanelBody)
|
|
||||||
/* harmony export */ });
|
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
|
||||||
/* 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_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
|
||||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
|
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
|
|
||||||
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/trash.js");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ImagePanelBody({
|
|
||||||
imageUrl,
|
|
||||||
imageAlt,
|
|
||||||
imageId,
|
|
||||||
imageProportion,
|
|
||||||
setAttributes
|
|
||||||
}) {
|
|
||||||
function setImageAttributes(image) {
|
|
||||||
setAttributes({
|
|
||||||
imageId: image.id,
|
|
||||||
imageAlt: image.alt,
|
|
||||||
imageUrl: image.url
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function removeImageAttributes() {
|
|
||||||
setAttributes({
|
|
||||||
imageId: null,
|
|
||||||
imageAlt: null,
|
|
||||||
imageUrl: null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function onImageProportionChange(imageProportion) {
|
|
||||||
console.log(imageProportion);
|
|
||||||
setAttributes({
|
|
||||||
imageProportion
|
|
||||||
});
|
|
||||||
}
|
|
||||||
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_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
|
|
||||||
className: "homegrade-blocks-components-image__panel-body",
|
|
||||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Image", "homegrade-blocks__texte-backoffice")
|
|
||||||
}, imageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
|
||||||
src: imageUrl,
|
|
||||||
alt: imageAlt
|
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
|
||||||
className: "media-replace-container"
|
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaReplaceFlow, {
|
|
||||||
mediaId: imageId,
|
|
||||||
mediaUrl: imageUrl,
|
|
||||||
allowedTypes: ["image"],
|
|
||||||
accept: "image/*",
|
|
||||||
onSelect: setImageAttributes,
|
|
||||||
name: !imageUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter", "homegrade-blocks__texte-backoffice") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remplacer", "homegrade-blocks__texte-backoffice")
|
|
||||||
}), imageUrl && (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_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
|
|
||||||
className: "custom-flow-button",
|
|
||||||
variant: "primary",
|
|
||||||
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
|
|
||||||
label: "Supprimer",
|
|
||||||
onClick: removeImageAttributes
|
|
||||||
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Tip, null, "Si besoin, Utilisez le champ \"L\xE9gende\"de la m\xE9diath\xE8que pour afficher un copyright"), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Tip, null, "Si besoin, Utilisez le champ \"Description\" de la m\xE9diath\xE8que pour donner afficher une description de votre image"), imageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
|
|
||||||
label: "Proportion",
|
|
||||||
className: "homegrade-blocks-components-image__ratio-selector",
|
|
||||||
isBlock: true,
|
|
||||||
onChange: onImageProportionChange,
|
|
||||||
value: imageProportion
|
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
|
||||||
variant: "primary",
|
|
||||||
label: "Original",
|
|
||||||
value: "original"
|
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
|
||||||
variant: "primary",
|
|
||||||
label: "Moyen",
|
|
||||||
value: "medium"
|
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
|
|
||||||
variant: "primary",
|
|
||||||
label: "Carr\xE9",
|
|
||||||
value: "square"
|
|
||||||
}))));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "../_components/ImagePanelBodyContent.jsx":
|
|
||||||
/*!************************************************!*\
|
|
||||||
!*** ../_components/ImagePanelBodyContent.jsx ***!
|
|
||||||
\************************************************/
|
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
||||||
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ "default": () => (/* binding */ ImagePanelBody)
|
|
||||||
/* harmony export */ });
|
|
||||||
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
|
||||||
/* 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_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
|
||||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
|
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
|
||||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
|
|
||||||
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/trash.js");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ImagePanelBody({
|
|
||||||
imageUrl,
|
|
||||||
imageAlt,
|
|
||||||
imageId,
|
|
||||||
imageProportion,
|
|
||||||
setAttributes
|
|
||||||
}) {
|
|
||||||
function setImageAttributes(image) {
|
|
||||||
setAttributes({
|
|
||||||
imageId: image.id,
|
|
||||||
imageAlt: image.alt,
|
|
||||||
imageUrl: image.url
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function removeImageAttributes() {
|
|
||||||
setAttributes({
|
|
||||||
imageId: null,
|
|
||||||
imageAlt: null,
|
|
||||||
imageUrl: null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, imageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
|
||||||
src: imageUrl,
|
|
||||||
alt: imageAlt
|
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
|
||||||
className: "media-replace-container"
|
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaReplaceFlow, {
|
|
||||||
mediaId: imageId,
|
|
||||||
mediaUrl: imageUrl,
|
|
||||||
allowedTypes: ["image"],
|
|
||||||
accept: "image/*",
|
|
||||||
onSelect: setImageAttributes,
|
|
||||||
name: !imageUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter", "homegrade-blocks__texte-backoffice") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remplacer", "homegrade-blocks__texte-backoffice")
|
|
||||||
}), imageUrl && (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_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
|
|
||||||
className: "custom-flow-button",
|
|
||||||
variant: "primary",
|
|
||||||
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
|
|
||||||
label: "Supprimer",
|
|
||||||
onClick: removeImageAttributes
|
|
||||||
}))));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "./src/edit.js":
|
/***/ "./src/edit.js":
|
||||||
/*!*********************!*\
|
/*!*********************!*\
|
||||||
!*** ./src/edit.js ***!
|
!*** ./src/edit.js ***!
|
||||||
|
|
@ -261,18 +24,12 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
|
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
||||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__);
|
/* 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_11__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/trash.js");
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/trash.js");
|
||||||
/* harmony import */ var _components_ImageMediaPlaceholder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../_components/ImageMediaPlaceholder */ "../_components/ImageMediaPlaceholder.jsx");
|
|
||||||
/* harmony import */ var _components_Image__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../_components/Image */ "../_components/Image.jsx");
|
|
||||||
/* harmony import */ var _components_ImagePanelBody__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../_components/ImagePanelBody */ "../_components/ImagePanelBody.jsx");
|
|
||||||
/* harmony import */ var _components_ImagePanelBodyContent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../_components/ImagePanelBodyContent */ "../_components/ImagePanelBodyContent.jsx");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// import "./steps-container";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -286,31 +43,30 @@ function Edit({
|
||||||
}) {
|
}) {
|
||||||
let {
|
let {
|
||||||
hasStepPictures,
|
hasStepPictures,
|
||||||
stepPictureFormat,
|
lateralPicturesFormat,
|
||||||
hasStepIcons,
|
hasStepIcons,
|
||||||
hasLateralCover,
|
hasLateralCover,
|
||||||
lateralCoverId,
|
lateralCoverId,
|
||||||
lateralCoverAlt,
|
lateralCoverAlt,
|
||||||
lateralCoverUrl
|
lateralCoverUrl,
|
||||||
|
lateralCoverDescription,
|
||||||
|
lateralCoverCaption,
|
||||||
|
blockTitle,
|
||||||
|
blockSubtitle,
|
||||||
|
hasTitle
|
||||||
} = attributes;
|
} = attributes;
|
||||||
let children = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select("core/block-editor").getBlocksByClientId(clientId)[0].innerBlocks);
|
let children = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select("core/block-editor").getBlocksByClientId(clientId)[0].innerBlocks);
|
||||||
function handleStepPictureFormatChange(stepPictureFormat) {
|
function onChangeBlockTitle(blockTitle) {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
stepPictureFormat
|
blockTitle
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function onChangehasStepPictures() {
|
function onChangeBlockSubtitle(blockSubtitle) {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
hasStepPictures: !hasStepPictures
|
blockSubtitle
|
||||||
});
|
|
||||||
}
|
|
||||||
function onChangehasStepIcons() {
|
|
||||||
setAttributes({
|
|
||||||
hasStepIcons: !hasStepIcons
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function onChangeImagesDispositionType(disposition) {
|
function onChangeImagesDispositionType(disposition) {
|
||||||
console.log(disposition);
|
|
||||||
if (disposition === "hasStepPictures") {
|
if (disposition === "hasStepPictures") {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
hasStepPictures: true,
|
hasStepPictures: true,
|
||||||
|
|
@ -325,18 +81,44 @@ function Edit({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function handlelateralPicturesFormatChange(lateralPicturesFormat) {
|
||||||
|
setAttributes({
|
||||||
|
lateralPicturesFormat
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onChangehasStepIcons() {
|
||||||
|
setAttributes({
|
||||||
|
hasStepIcons: !hasStepIcons
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onChangeHasTitle(newHasTitle) {
|
||||||
|
setAttributes({
|
||||||
|
hasTitle: !hasTitle
|
||||||
|
});
|
||||||
|
if (!newHasTitle) {
|
||||||
|
setAttributes({
|
||||||
|
blockTitle: "",
|
||||||
|
blockSubtitle: ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
function setLateralCoverAttributes(cover) {
|
function setLateralCoverAttributes(cover) {
|
||||||
|
console.log(cover);
|
||||||
setAttributes({
|
setAttributes({
|
||||||
lateralCoverId: cover.id,
|
lateralCoverId: cover.id,
|
||||||
lateralCoverAlt: cover.alt,
|
lateralCoverAlt: cover.alt,
|
||||||
lateralCoverUrl: cover.url
|
lateralCoverUrl: cover.url,
|
||||||
|
lateralCoverCaption: cover?.caption,
|
||||||
|
lateralCoverDescription: cover?.description
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function removeLateralCoverAttributes() {
|
function removeLateralCoverAttributes() {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
lateralCoverId: null,
|
lateralCoverId: null,
|
||||||
lateralCoverAlt: null,
|
lateralCoverAlt: null,
|
||||||
lateralCoverUrl: null
|
lateralCoverUrl: null,
|
||||||
|
lateralCoverCaption: null,
|
||||||
|
lateralCoverDescription: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function updateChildrensProps(children) {
|
function updateChildrensProps(children) {
|
||||||
|
|
@ -362,31 +144,33 @@ function Edit({
|
||||||
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_6__.PanelBody, {
|
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_6__.PanelBody, {
|
||||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Variantes de Timeline", "homegrade-blocks__texte-backoffice"),
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Variantes de Timeline", "homegrade-blocks__texte-backoffice"),
|
||||||
className: "homegrade-blocks-timeline__panel-body homegrade-blocks-components-image__panel-body"
|
className: "homegrade-blocks-timeline__panel-body homegrade-blocks-components-image__panel-body"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", {
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToggleControl, {
|
||||||
htmlFor: ""
|
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Titre de bloc", "homegrade-blocks__texte-backoffice"),
|
||||||
}, "Icones"), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.FormToggle, {
|
help: hasTitle ? "Titre de bloc." : "Ne pas afficher de bloc titrage",
|
||||||
|
checked: hasTitle,
|
||||||
|
onChange: onChangeHasTitle
|
||||||
|
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToggleControl, {
|
||||||
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Icones", "homegrade-blocks__texte-backoffice"),
|
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Icones", "homegrade-blocks__texte-backoffice"),
|
||||||
|
help: hasStepIcons ? "Afficher des icones pour chaque ligne" : "Ne pas afficher d'icones",
|
||||||
checked: hasStepIcons,
|
checked: hasStepIcons,
|
||||||
onChange: onChangehasStepIcons
|
onChange: onChangehasStepIcons
|
||||||
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.__experimentalToggleGroupControl, {
|
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.__experimentalToggleGroupControl, {
|
||||||
label: "Type d'image",
|
label: "Type d'image Lat\xE9rale",
|
||||||
className: "homegrade-blocks-components-image__ratio-selector",
|
className: "homegrade-blocks-components-image__ratio-selector",
|
||||||
isBlock: true,
|
isBlock: true,
|
||||||
onChange: onChangeImagesDispositionType,
|
onChange: onChangeImagesDispositionType,
|
||||||
value: hasStepPictures ? "hasStepPictures" : "hasLateralCover"
|
value: hasStepPictures ? "hasStepPictures" : "hasLateralCover"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.__experimentalToggleGroupControlOption, {
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.__experimentalToggleGroupControlOption, {
|
||||||
variant: "hasStepPictures",
|
variant: "hasStepPictures",
|
||||||
label: "Images par ligne",
|
label: "image par ligne de timeline",
|
||||||
value: "hasStepPictures"
|
value: "hasStepPictures"
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.__experimentalToggleGroupControlOption, {
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.__experimentalToggleGroupControlOption, {
|
||||||
variant: "lateralCover",
|
variant: "lateralCover",
|
||||||
label: "Illustration lat\xE9arale",
|
label: " Image lat\xE9rale unique",
|
||||||
value: "hasLateralCover"
|
value: "hasLateralCover"
|
||||||
}))), hasStepPictures && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.RadioControl
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.RadioControl, {
|
||||||
// label={__("Tailles des images", "textdomain")}
|
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Format d'image(s) latérale(s)", "textdomain"),
|
||||||
, {
|
selected: lateralPicturesFormat,
|
||||||
help: "Taille des images",
|
|
||||||
selected: stepPictureFormat,
|
|
||||||
options: [{
|
options: [{
|
||||||
label: "Carré",
|
label: "Carré",
|
||||||
value: "squared"
|
value: "squared"
|
||||||
|
|
@ -394,10 +178,10 @@ function Edit({
|
||||||
label: "Moyenne",
|
label: "Moyenne",
|
||||||
value: "md"
|
value: "md"
|
||||||
}, {
|
}, {
|
||||||
label: "Hautes",
|
label: "Hauteur originale",
|
||||||
value: "xl"
|
value: "xl"
|
||||||
}],
|
}],
|
||||||
onChange: handleStepPictureFormatChange
|
onChange: handlelateralPicturesFormatChange
|
||||||
})), lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
})), lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
src: lateralCoverUrl,
|
src: lateralCoverUrl,
|
||||||
alt: lateralCoverAlt
|
alt: lateralCoverAlt
|
||||||
|
|
@ -413,7 +197,7 @@ function Edit({
|
||||||
}), lateralCoverUrl && (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_components__WEBPACK_IMPORTED_MODULE_6__.Button, {
|
}), lateralCoverUrl && (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_components__WEBPACK_IMPORTED_MODULE_6__.Button, {
|
||||||
className: "custom-flow-button",
|
className: "custom-flow-button",
|
||||||
variant: "primary",
|
variant: "primary",
|
||||||
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_11__["default"],
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"],
|
||||||
label: "Supprimer",
|
label: "Supprimer",
|
||||||
onClick: removeLateralCoverAttributes
|
onClick: removeLateralCoverAttributes
|
||||||
}))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
|
}))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
|
||||||
|
|
@ -421,20 +205,41 @@ function Edit({
|
||||||
className: `homegrade-blocks-timeline ${hasStepIcons ? "homegrade-blocks-timeline--has-step-icons" : ""}
|
className: `homegrade-blocks-timeline ${hasStepIcons ? "homegrade-blocks-timeline--has-step-icons" : ""}
|
||||||
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`
|
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`
|
||||||
})
|
})
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "section_titling section_titling--center"
|
||||||
|
}, hasTitle && (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__.RichText, {
|
||||||
|
value: blockTitle,
|
||||||
|
tagName: "h3",
|
||||||
|
className: "section_titling__title",
|
||||||
|
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter ici le Titre de la liste de membres", "homegrade"),
|
||||||
|
onChange: onChangeBlockTitle
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.RichText, {
|
||||||
|
value: blockSubtitle,
|
||||||
|
tagName: "h4",
|
||||||
|
className: "section_titling__subtitle",
|
||||||
|
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter ici le Sous-titre de la liste de membres", "homegrade"),
|
||||||
|
onChange: onChangeBlockSubtitle
|
||||||
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline__container"
|
||||||
}, hasLateralCover && !lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.MediaPlaceholder, {
|
}, hasLateralCover && !lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.MediaPlaceholder, {
|
||||||
accept: "image/*",
|
accept: "image/*",
|
||||||
allowedTypes: ["image"],
|
allowedTypes: ["image"],
|
||||||
onSelect: setLateralCoverAttributes,
|
onSelect: setLateralCoverAttributes,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
handleUpload: true
|
handleUpload: true
|
||||||
}), hasLateralCover && lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
}), hasLateralCover && lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figure", {
|
||||||
className: "homegrade-blocks-timeline__lateral-cover",
|
className: `homegrade-blocks-timeline__lateral-cover homegrade-blocks-timeline__lateral-cover--${lateralPicturesFormat}`
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
src: lateralCoverUrl,
|
src: lateralCoverUrl,
|
||||||
alt: lateralCoverAlt
|
alt: lateralCoverAlt
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InnerBlocks, {
|
}), (lateralCoverDescription || lateralCoverCaption) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figcaption", null, lateralCoverDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "description"
|
||||||
|
}, lateralCoverDescription), lateralCoverCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "caption"
|
||||||
|
}, lateralCoverCaption))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InnerBlocks, {
|
||||||
allowedBlocks: ["homegrade-content-blocks/timeline-step"],
|
allowedBlocks: ["homegrade-content-blocks/timeline-step"],
|
||||||
template: TEMPLATE
|
template: TEMPLATE
|
||||||
})));
|
}))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
@ -514,25 +319,47 @@ function save({
|
||||||
attributes
|
attributes
|
||||||
}) {
|
}) {
|
||||||
let {
|
let {
|
||||||
|
hasTitle,
|
||||||
|
blockTitle,
|
||||||
|
blockSubtitle,
|
||||||
hasStepPictures,
|
hasStepPictures,
|
||||||
stepPictureFormat,
|
lateralPicturesFormat,
|
||||||
hasStepIcons,
|
hasStepIcons,
|
||||||
hasLateralCover,
|
hasLateralCover,
|
||||||
lateralCoverUrl,
|
lateralCoverUrl,
|
||||||
lateralCoverAlt
|
lateralCoverAlt,
|
||||||
|
lateralCoverCaption,
|
||||||
|
lateralCoverDescription
|
||||||
} = attributes;
|
} = attributes;
|
||||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
|
||||||
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
|
||||||
className: `homegrade-blocks-timeline ${hasStepIcons ? "homegrade-blocks-timeline--has-step-icons" : ""} ${hasStepPictures ? "homegrade-blocks-timeline--has-step-pictures" : "homegrade-blocks-timeline--has-no-step-pictures"}
|
className: `homegrade-blocks-timeline ${hasStepIcons ? "homegrade-blocks-timeline--has-step-icons" : ""} ${hasStepPictures ? "homegrade-blocks-timeline--has-step-pictures" : "homegrade-blocks-timeline--has-no-step-pictures"}
|
||||||
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`
|
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`
|
||||||
})
|
})
|
||||||
}, hasLateralCover && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
}, hasTitle && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
className: "homegrade-blocks-timeline__lateral-cover",
|
className: "section_titling section_titling--center"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
|
||||||
|
value: blockTitle,
|
||||||
|
tagName: "h3",
|
||||||
|
className: "section_titling__title"
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
|
||||||
|
value: blockSubtitle,
|
||||||
|
tagName: "h4",
|
||||||
|
className: "section_titling__subtitle"
|
||||||
|
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline__container"
|
||||||
|
}, hasLateralCover && lateralCoverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figure", {
|
||||||
|
className: `homegrade-blocks-timeline__lateral-cover homegrade-blocks-timeline__lateral-cover--${lateralPicturesFormat}`
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
src: lateralCoverUrl,
|
src: lateralCoverUrl,
|
||||||
alt: lateralCoverAlt
|
alt: lateralCoverAlt
|
||||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
}), (lateralCoverDescription || lateralCoverCaption) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figcaption", null, lateralCoverDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "description"
|
||||||
|
}, lateralCoverDescription), lateralCoverCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "caption"
|
||||||
|
}, lateralCoverCaption))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
className: "homegrade-blocks-timeline__innercontent"
|
className: "homegrade-blocks-timeline__innercontent"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)));
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
@ -1017,7 +844,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/timeline","version":"0.1.0","title":"Timeline","category":"homegrade-blocks","description":"Pour la création de timeline","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"hasLateralCover":{"type":"boolean","default":false},"lateralCoverId":{"type":"number"},"lateralCoverUrl":{"type":"string"},"lateralCoverAlt":{"type":"string"},"hasStepPictures":{"type":"boolean","default":true},"hasStepIcons":{"type":"boolean","default":true},"stepPictureFormat":{"type":"string","default":"md"}}}');
|
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/timeline","version":"0.1.0","title":"Timeline","category":"homegrade-blocks","description":"Pour la création de timeline","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"hasTitle":{"type":"boolean","default":true},"blockTitle":{"type":"string"},"blockSubtitle":{"type":"string"},"hasLateralCover":{"type":"boolean","default":false},"lateralCoverId":{"type":"number"},"lateralCoverUrl":{"type":"string"},"lateralCoverAlt":{"type":"string"},"lateralCoverCaption":{"type":"string"},"lateralCoverDescription":{"type":"string"},"hasStepPictures":{"type":"boolean","default":true},"hasStepIcons":{"type":"boolean","default":true},"lateralPicturesFormat":{"type":"string","default":"md"}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
15
blocks/timeline/build/steps-container/block.json
Normal file
15
blocks/timeline/build/steps-container/block.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 2,
|
||||||
|
"name": "homegrade-content-blocks/timeline-steps-container",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Étapes",
|
||||||
|
"category": "homegrade-blocks",
|
||||||
|
"description": "steps container",
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css"
|
||||||
|
}
|
||||||
1
blocks/timeline/build/steps-container/index.asset.php
Normal file
1
blocks/timeline/build/steps-container/index.asset.php
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'b2debb11d7a463ba7b7e');
|
||||||
4
blocks/timeline/build/steps-container/index.css
Normal file
4
blocks/timeline/build/steps-container/index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!********************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/steps-container/editor.scss ***!
|
||||||
|
\********************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
361
blocks/timeline/build/steps-container/index.js
Normal file
361
blocks/timeline/build/steps-container/index.js
Normal file
|
|
@ -0,0 +1,361 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "./src/steps-container/edit.js":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** ./src/steps-container/edit.js ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ Edit)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* 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 _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/steps-container/editor.scss");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Edit() {
|
||||||
|
let {
|
||||||
|
hasStepIcons,
|
||||||
|
hasLateralCover
|
||||||
|
} = attributes;
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({
|
||||||
|
className: `homegrade-blocks-timeline__steps-container`
|
||||||
|
})
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, {
|
||||||
|
allowedBlocks: ["homegrade-content-blocks/timeline-step"],
|
||||||
|
template: [["homegrade-content-blocks/timeline-step", {
|
||||||
|
tipTitle: "Astuce 1"
|
||||||
|
}], ["homegrade-content-blocks/timeline-step", {
|
||||||
|
tipTitle: "Astuce 2"
|
||||||
|
}]],
|
||||||
|
templateLock: false
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/steps-container/index.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./src/steps-container/index.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/steps-container/style.scss");
|
||||||
|
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/steps-container/block.json");
|
||||||
|
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./src/steps-container/edit.js");
|
||||||
|
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/steps-container/save.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, {
|
||||||
|
title: _block_json__WEBPACK_IMPORTED_MODULE_3__.title,
|
||||||
|
icon: {
|
||||||
|
foreground: "#DF1E1E",
|
||||||
|
src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||||
|
viewBox: "0 0 73.9 90"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
|
||||||
|
id: "Calque_1-2",
|
||||||
|
"data-name": "Calque 1"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||||
|
class: "cls-1",
|
||||||
|
d: "m4.1,19.22v17.13c.64-.23,1.33-.35,2.05-.35s1.41.13,2.05.35v-17.12c-.64.23-1.33.35-2.05.35s-1.41-.12-2.05-.35Zm0-2.6c.64.23,1.33.35,2.05.35s1.41-.12,2.05-.35c2.39-.85,4.1-3.12,4.1-5.81s-1.71-4.96-4.1-5.81c-.64-.23-1.33-.35-2.05-.35s-1.41.12-2.05.35C1.71,5.85,0,8.13,0,10.81s1.71,4.96,4.1,5.81ZM8.21,2.41V0h-4.11v2.41c.64-.23,1.33-.35,2.05-.35.72,0,1.41.12,2.05.35Zm17.24,17.44c.82.82,1.85,1.23,2.87,1.23h29.15c1.23,0,2.05-.82,2.05-2.05V2.6c0-1.23-.82-2.05-2.05-2.05h-29.15c-1.02,0-2.05.41-2.87,1.23l-7.59,7.6c-.82.82-.82,2.05,0,2.87l7.59,7.6ZM4.11,87.6v2.4h4.11v-2.4c-.64.23-1.33.35-2.05.35-.72,0-1.41-.12-2.05-.35Zm4.11-14.21c-.64-.23-1.33-.35-2.05-.35s-1.41.12-2.05.35C1.71,74.23,0,76.51,0,79.19s1.71,4.96,4.1,5.81c.64.23,1.33.35,2.05.35s1.41-.12,2.05-.35c2.39-.85,4.1-3.13,4.1-5.81s-1.71-4.96-4.1-5.81Zm47.21-4.46h-27.1c-1.02,0-2.05.41-2.87,1.23l-7.59,7.6c-.82.82-.82,2.05,0,2.87l7.59,7.6c.82.82,1.85,1.23,2.87,1.23h27.1c1.23,0,2.05-.82,2.05-2.05v-16.42c0-1.23-.82-2.05-2.05-2.05Zm16.42-34.44H28.33c-1.02,0-2.05.41-2.87,1.23l-7.59,7.59c-.82.82-.82,2.05,0,2.87l7.59,7.6c.82.82,1.85,1.23,2.87,1.23h43.52c1.23,0,2.05-.82,2.05-2.05v-16.42c0-1.23-.82-2.05-2.05-2.05Zm-63.63,4.46c-.64-.23-1.33-.35-2.05-.35-.72,0-1.41.13-2.05.35C1.71,39.79,0,42.07,0,44.75s1.71,4.96,4.1,5.81c.64.23,1.33.35,2.05.35s1.41-.13,2.05-.35c2.39-.85,4.1-3.12,4.1-5.81s-1.71-4.96-4.1-5.81Zm0,31.84v-17.12c-.64.23-1.33.35-2.05.35s-1.41-.13-2.05-.35v17.12c.64-.23,1.33-.35,2.05-.35s1.41.12,2.05.35Z"
|
||||||
|
})))
|
||||||
|
},
|
||||||
|
supports: _block_json__WEBPACK_IMPORTED_MODULE_3__.supports,
|
||||||
|
attributes: _block_json__WEBPACK_IMPORTED_MODULE_3__.attributes,
|
||||||
|
edit: _edit__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
|
save: _save__WEBPACK_IMPORTED_MODULE_5__["default"]
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/steps-container/save.js":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** ./src/steps-container/save.js ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ save)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
|
||||||
|
className: `homegrade-blocks-timeline__steps-container`
|
||||||
|
})
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/steps-container/editor.scss":
|
||||||
|
/*!*****************************************!*\
|
||||||
|
!*** ./src/steps-container/editor.scss ***!
|
||||||
|
\*****************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/steps-container/style.scss":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./src/steps-container/style.scss ***!
|
||||||
|
\****************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/block-editor":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** external ["wp","blockEditor"] ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blockEditor"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/blocks":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** external ["wp","blocks"] ***!
|
||||||
|
\********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/element":
|
||||||
|
/*!*********************************!*\
|
||||||
|
!*** external ["wp","element"] ***!
|
||||||
|
\*********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["element"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!******************************!*\
|
||||||
|
!*** external ["wp","i18n"] ***!
|
||||||
|
\******************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["i18n"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/steps-container/block.json":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./src/steps-container/block.json ***!
|
||||||
|
\****************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/timeline-steps-container","version":"0.1.0","title":"Étapes","category":"homegrade-blocks","description":"steps container","supports":{"html":false},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var chunkIds = deferred[i][0];
|
||||||
|
/******/ var fn = deferred[i][1];
|
||||||
|
/******/ var priority = deferred[i][2];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = (module) => {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ () => (module['default']) :
|
||||||
|
/******/ () => (module);
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = (exports, definition) => {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/make namespace object */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = (exports) => {
|
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||||
|
/******/ }
|
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ "steps-container/index": 0,
|
||||||
|
/******/ "steps-container/style-index": 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var chunkIds = data[0];
|
||||||
|
/******/ var moreModules = data[1];
|
||||||
|
/******/ var runtime = data[2];
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["steps-container/style-index"], () => (__webpack_require__("./src/steps-container/index.js")))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
1
blocks/timeline/build/steps-container/index.js.map
Normal file
1
blocks/timeline/build/steps-container/index.js.map
Normal file
File diff suppressed because one or more lines are too long
4
blocks/timeline/build/steps-container/style-index.css
Normal file
4
blocks/timeline/build/steps-container/style-index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!*******************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/steps-container/style.scss ***!
|
||||||
|
\*******************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
65
blocks/timeline/build/timeline-step copy/block.json
Normal file
65
blocks/timeline/build/timeline-step copy/block.json
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 2,
|
||||||
|
"name": "homegrade-content-blocks/timeline-step",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Étape de timeline",
|
||||||
|
"category": "homegrade-blocks",
|
||||||
|
"description": "Bloc d'étape de timeline",
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css",
|
||||||
|
"attributes": {
|
||||||
|
"timelineStepTitle": {
|
||||||
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"timelineStepSubtitle": {
|
||||||
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"timelineStepImageUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timelineStepImageId": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"timelineStepImageCaption": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timelineStepImageDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timelineStepImageAlt": {
|
||||||
|
"type": "string",
|
||||||
|
"source": "attribute",
|
||||||
|
"selector": "img",
|
||||||
|
"attribute": "alt",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"timelineStepIconUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timelineStepIconId": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"timelineStepIconAlt": {
|
||||||
|
"type": "string",
|
||||||
|
"source": "attribute",
|
||||||
|
"selector": "img",
|
||||||
|
"attribute": "alt",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"hasStepIcon": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"hasStepPicture": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
blocks/timeline/build/timeline-step copy/index.asset.php
Normal file
1
blocks/timeline/build/timeline-step copy/index.asset.php
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '159682f2c74a19a6326f');
|
||||||
4
blocks/timeline/build/timeline-step copy/index.css
Normal file
4
blocks/timeline/build/timeline-step copy/index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!***********************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/timeline-step copy/editor.scss ***!
|
||||||
|
\***********************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
625
blocks/timeline/build/timeline-step copy/index.js
Normal file
625
blocks/timeline/build/timeline-step copy/index.js
Normal file
|
|
@ -0,0 +1,625 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "./src/timeline-step copy/edit.js":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./src/timeline-step copy/edit.js ***!
|
||||||
|
\****************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ Edit)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* 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 _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/timeline-step copy/editor.scss");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
||||||
|
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/@wordpress/icons/build-module/library/trash.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Edit({
|
||||||
|
attributes,
|
||||||
|
setAttributes,
|
||||||
|
...props
|
||||||
|
}) {
|
||||||
|
let {
|
||||||
|
timelineStepTitle,
|
||||||
|
timelineStepSubtitle,
|
||||||
|
timelineStepImageUrl,
|
||||||
|
timelineStepImageId,
|
||||||
|
timelineStepImageAlt,
|
||||||
|
timelineStepImageCaption,
|
||||||
|
timelineStepImageDescription,
|
||||||
|
timelineStepIconUrl,
|
||||||
|
timelineStepIconId,
|
||||||
|
timelineStepIconAlt,
|
||||||
|
hasStepPicture,
|
||||||
|
hasStepIcon
|
||||||
|
} = attributes;
|
||||||
|
function onChangeTimelineStepTitle(timelineStepTitle) {
|
||||||
|
setAttributes({
|
||||||
|
timelineStepTitle
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function onChangeTimelineDescription(timelineStepSubtitle) {
|
||||||
|
setAttributes({
|
||||||
|
timelineStepSubtitle
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function setImageAttributes(media) {
|
||||||
|
if (!media || !media.url) {
|
||||||
|
setAttributes({
|
||||||
|
timelineStepImageUrl: null,
|
||||||
|
timelineStepImageId: null,
|
||||||
|
timelineStepImageAlt: null,
|
||||||
|
timelineStepImageCaption: null,
|
||||||
|
timelineStepImageDescription: null
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setAttributes({
|
||||||
|
timelineStepImageUrl: media.url,
|
||||||
|
timelineStepImageId: media.id,
|
||||||
|
timelineStepImageAlt: media?.alt,
|
||||||
|
timelineStepImageCaption: media?.caption,
|
||||||
|
timelineStepImageDescription: media?.description
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function removeImageAttributes() {
|
||||||
|
setAttributes({
|
||||||
|
timelineStepImageUrl: null,
|
||||||
|
timelineStepImageId: null,
|
||||||
|
timelineStepImageAlt: null
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function setIconAttributes(media) {
|
||||||
|
console.log(media);
|
||||||
|
if (!media || !media.url) {
|
||||||
|
setAttributes({
|
||||||
|
timelineStepIconUrl: null,
|
||||||
|
timelineStepIconId: null,
|
||||||
|
timelineStepIconAlt: null
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setAttributes({
|
||||||
|
timelineStepIconUrl: media.url,
|
||||||
|
timelineStepIconId: media.id,
|
||||||
|
timelineStepIconAlt: media?.alt
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function removeIconAttributes() {
|
||||||
|
setAttributes({
|
||||||
|
timelineStepIconUrl: null,
|
||||||
|
timelineStepIconId: null,
|
||||||
|
timelineStepIconAlt: null
|
||||||
|
});
|
||||||
|
}
|
||||||
|
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||||
|
if (hasStepPicture === false) {
|
||||||
|
setImageAttributes(null);
|
||||||
|
}
|
||||||
|
}, [hasStepPicture]);
|
||||||
|
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||||
|
if (hasStepIcon === false) {
|
||||||
|
setIconAttributes(null);
|
||||||
|
}
|
||||||
|
}, [hasStepIcon]);
|
||||||
|
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_3__.InspectorControls, null, hasStepPicture && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
|
||||||
|
className: "homegrade-blocks-timeline-step__panel-body homegrade-blocks-timeline-step__panel-body--image",
|
||||||
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Image", "homegrade-blocks__texte-backoffice")
|
||||||
|
}, timelineStepImageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
|
src: timelineStepImageUrl,
|
||||||
|
alt: timelineStepImageAlt
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "media-replace-container"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaReplaceFlow, {
|
||||||
|
mediaId: timelineStepImageId,
|
||||||
|
mediaUrl: timelineStepImageUrl,
|
||||||
|
allowedTypes: ["image"],
|
||||||
|
accept: "image/*",
|
||||||
|
onSelect: setImageAttributes,
|
||||||
|
name: !timelineStepImageUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter", "homegrade-blocks__texte-backoffice") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remplacer", "homegrade-blocks__texte-backoffice")
|
||||||
|
}), timelineStepImageUrl && (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_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
|
||||||
|
className: "custom-flow-button",
|
||||||
|
variant: "primary",
|
||||||
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||||
|
label: "Supprimer",
|
||||||
|
onClick: removeImageAttributes
|
||||||
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Tip, null, "Si besoin, Utilisez le champ \"L\xE9gende\"de la m\xE9diath\xE8que pour afficher un copyright"), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Tip, null, "Si besoin, Utilisez le champ \"Description\" de la m\xE9diath\xE8que pour donner afficher une description de votre image")), hasStepIcon && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
|
||||||
|
className: "homegrade-blocks-timeline-step__panel-body homegrade-blocks-timeline-step__panel-body--icon",
|
||||||
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Icone", "homegrade-blocks__texte-backoffice")
|
||||||
|
}, timelineStepIconUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
|
src: timelineStepIconUrl,
|
||||||
|
alt: timelineStepIconAlt
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "media-replace-container"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaReplaceFlow, {
|
||||||
|
mediaId: timelineStepIconId,
|
||||||
|
mediaUrl: timelineStepIconUrl,
|
||||||
|
allowedTypes: ["image"],
|
||||||
|
accept: "image/*",
|
||||||
|
onSelect: setIconAttributes,
|
||||||
|
name: !timelineStepIconUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter", "homegrade-blocks__texte-backoffice") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remplacer", "homegrade-blocks__texte-backoffice")
|
||||||
|
}), timelineStepIconUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
|
||||||
|
className: "custom-flow-button",
|
||||||
|
variant: "primary",
|
||||||
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||||
|
label: "Supprimer",
|
||||||
|
onClick: removeIconAttributes
|
||||||
|
})))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarGroup, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaReplaceFlow, {
|
||||||
|
mediaId: timelineStepImageId,
|
||||||
|
mediaUrl: timelineStepImageUrl,
|
||||||
|
allowedTypes: ["image"],
|
||||||
|
accept: "image/*",
|
||||||
|
onSelect: setImageAttributes,
|
||||||
|
name: !timelineStepImageUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ajouter une Image", "homegrade-blocks__texte-backoffice") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remplacer Image", "homegrade-blocks__texte-backoffice")
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton, {
|
||||||
|
title: "Supprimer Image",
|
||||||
|
icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||||
|
isActive: timelineStepImageUrl,
|
||||||
|
onClick: removeImageAttributes
|
||||||
|
}))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({
|
||||||
|
className: `homegrade-blocks-timeline-step`
|
||||||
|
})
|
||||||
|
}, hasStepPicture && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline-step__cover"
|
||||||
|
}, !timelineStepImageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.MediaPlaceholder, {
|
||||||
|
accept: "image/*",
|
||||||
|
allowedTypes: ["image"],
|
||||||
|
onSelect: setImageAttributes,
|
||||||
|
multiple: false,
|
||||||
|
handleUpload: true
|
||||||
|
}), timelineStepImageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
|
src: timelineStepImageUrl,
|
||||||
|
alt: timelineStepImageAlt
|
||||||
|
}), timelineStepImageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, timelineStepImageDescription), timelineStepImageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, timelineStepImageCaption)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: `homegrade-blocks-timeline-step__content`
|
||||||
|
}, hasStepIcon && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline-step__icon"
|
||||||
|
}, !timelineStepIconUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "please-add-icon"
|
||||||
|
}, "Ajoutez une icone !"), timelineStepIconUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
|
src: timelineStepIconUrl,
|
||||||
|
alt: timelineStepIconAlt
|
||||||
|
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline-step__text-content"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, {
|
||||||
|
tagName: "h3",
|
||||||
|
className: "homegrade-blocks-timeline-step__title",
|
||||||
|
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Date ou Titre de l'étape", "homegrade-blocks__texte-backoffice"),
|
||||||
|
value: timelineStepTitle,
|
||||||
|
onChange: onChangeTimelineStepTitle
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, {
|
||||||
|
tagName: "h2",
|
||||||
|
className: "homegrade-blocks-timeline-step__subtitle",
|
||||||
|
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Titre / Sous-titre de l'étape", "homegrade-blocks__texte-backoffice"),
|
||||||
|
value: timelineStepSubtitle,
|
||||||
|
onChange: onChangeTimelineDescription
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, {
|
||||||
|
allowedBlocks: ["core/paragraph", "core/button", "core/buttons", "core/list"]
|
||||||
|
})))));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/timeline-step copy/index.js":
|
||||||
|
/*!*****************************************!*\
|
||||||
|
!*** ./src/timeline-step copy/index.js ***!
|
||||||
|
\*****************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/timeline-step copy/style.scss");
|
||||||
|
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/timeline-step copy/block.json");
|
||||||
|
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./src/timeline-step copy/edit.js");
|
||||||
|
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/timeline-step copy/save.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, {
|
||||||
|
title: _block_json__WEBPACK_IMPORTED_MODULE_3__.title,
|
||||||
|
icon: {
|
||||||
|
foreground: "#DF1E1E",
|
||||||
|
src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||||
|
version: "1.1",
|
||||||
|
x: "0px",
|
||||||
|
y: "0px",
|
||||||
|
viewBox: "0 0 100 125",
|
||||||
|
"enable-background": "new 0 0 100 100"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||||
|
d: "M84.6,33.6c-0.8-1.1-2.3-1.5-3.5-0.7c-1.1,0.8-1.5,2.3-0.7,3.5l7.4,11.1H66c-1.2-7.8-7.9-13.8-16-13.8s-14.8,6-16,13.8H7.5 C6.1,47.5,5,48.6,5,50s1.1,2.5,2.5,2.5H34c1.2,7.8,7.9,13.8,16,13.8s14.8-6,16-13.8h21.8l-7.4,11.1c-0.8,1.1-0.5,2.7,0.7,3.5 c0.4,0.3,0.9,0.4,1.4,0.4c0.8,0,1.6-0.4,2.1-1.1l10-15c0.6-0.8,0.6-1.9,0-2.8L84.6,33.6z M50,63.8c-7.6,0-13.8-6.2-13.8-13.8 S42.4,36.3,50,36.3S63.8,42.4,63.8,50S57.6,63.8,50,63.8z"
|
||||||
|
})))
|
||||||
|
},
|
||||||
|
supports: _block_json__WEBPACK_IMPORTED_MODULE_3__.supports,
|
||||||
|
attributes: _block_json__WEBPACK_IMPORTED_MODULE_3__.attributes,
|
||||||
|
edit: _edit__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
|
save: _save__WEBPACK_IMPORTED_MODULE_5__["default"]
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/timeline-step copy/save.js":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./src/timeline-step copy/save.js ***!
|
||||||
|
\****************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ save)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
function save({
|
||||||
|
attributes
|
||||||
|
}) {
|
||||||
|
const {
|
||||||
|
timelineStepTitle,
|
||||||
|
timelineStepSubtitle,
|
||||||
|
timelineStepImageUrl,
|
||||||
|
timelineStepImageAlt,
|
||||||
|
timelineStepImageCaption,
|
||||||
|
timelineStepImageDescription,
|
||||||
|
timelineStepIconUrl,
|
||||||
|
timelineStepIconAlt,
|
||||||
|
hasStepPicture,
|
||||||
|
hasStepIcon
|
||||||
|
} = attributes;
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
|
||||||
|
className: `homegrade-blocks-timeline-step`
|
||||||
|
})
|
||||||
|
}, hasStepPicture && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figure", {
|
||||||
|
className: "homegrade-blocks-timeline-step__cover"
|
||||||
|
}, timelineStepImageUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
|
src: timelineStepImageUrl,
|
||||||
|
alt: timelineStepImageAlt
|
||||||
|
}), (timelineStepImageDescription || timelineStepImageCaption) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("figcaption", null, timelineStepImageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "description"
|
||||||
|
}, timelineStepImageDescription), timelineStepImageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "caption"
|
||||||
|
}, timelineStepImageCaption))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: `homegrade-blocks-timeline-step__content`
|
||||||
|
}, hasStepIcon && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline-step__icon"
|
||||||
|
}, timelineStepIconUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||||
|
src: timelineStepIconUrl,
|
||||||
|
alt: timelineStepIconAlt
|
||||||
|
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
className: "homegrade-blocks-timeline-step__text-content"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
|
||||||
|
tagName: "h3",
|
||||||
|
className: "homegrade-blocks-timeline-step__title",
|
||||||
|
value: timelineStepTitle
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
|
||||||
|
tagName: "p",
|
||||||
|
className: "homegrade-blocks-timeline-step__subtitle",
|
||||||
|
value: timelineStepSubtitle
|
||||||
|
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null))));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/timeline-step copy/editor.scss":
|
||||||
|
/*!********************************************!*\
|
||||||
|
!*** ./src/timeline-step copy/editor.scss ***!
|
||||||
|
\********************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/timeline-step copy/style.scss":
|
||||||
|
/*!*******************************************!*\
|
||||||
|
!*** ./src/timeline-step copy/style.scss ***!
|
||||||
|
\*******************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "../../node_modules/@wordpress/icons/build-module/library/trash.js":
|
||||||
|
/*!*************************************************************************!*\
|
||||||
|
!*** ../../node_modules/@wordpress/icons/build-module/library/trash.js ***!
|
||||||
|
\*************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
|
||||||
|
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WordPress dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
const trash = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, {
|
||||||
|
xmlns: "http://www.w3.org/2000/svg",
|
||||||
|
viewBox: "0 0 24 24"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, {
|
||||||
|
d: "M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"
|
||||||
|
}));
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (trash);
|
||||||
|
//# sourceMappingURL=trash.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/block-editor":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** external ["wp","blockEditor"] ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blockEditor"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/blocks":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** external ["wp","blocks"] ***!
|
||||||
|
\********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/components":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** external ["wp","components"] ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["components"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/element":
|
||||||
|
/*!*********************************!*\
|
||||||
|
!*** external ["wp","element"] ***!
|
||||||
|
\*********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["element"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!******************************!*\
|
||||||
|
!*** external ["wp","i18n"] ***!
|
||||||
|
\******************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["i18n"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/primitives":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** external ["wp","primitives"] ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["primitives"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/timeline-step copy/block.json":
|
||||||
|
/*!*******************************************!*\
|
||||||
|
!*** ./src/timeline-step copy/block.json ***!
|
||||||
|
\*******************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/timeline-step","version":"0.1.0","title":"Étape de timeline","category":"homegrade-blocks","description":"Bloc d\'étape de timeline","supports":{"html":false},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"timelineStepTitle":{"type":"string","default":""},"timelineStepSubtitle":{"type":"string","default":""},"timelineStepImageUrl":{"type":"string"},"timelineStepImageId":{"type":"number"},"timelineStepImageCaption":{"type":"string"},"timelineStepImageDescription":{"type":"string"},"timelineStepImageAlt":{"type":"string","source":"attribute","selector":"img","attribute":"alt","default":""},"timelineStepIconUrl":{"type":"string"},"timelineStepIconId":{"type":"number"},"timelineStepIconAlt":{"type":"string","source":"attribute","selector":"img","attribute":"alt","default":""},"hasStepIcon":{"type":"boolean","default":true},"hasStepPicture":{"type":"boolean","default":true}}}');
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var chunkIds = deferred[i][0];
|
||||||
|
/******/ var fn = deferred[i][1];
|
||||||
|
/******/ var priority = deferred[i][2];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = (module) => {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ () => (module['default']) :
|
||||||
|
/******/ () => (module);
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = (exports, definition) => {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/make namespace object */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = (exports) => {
|
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||||
|
/******/ }
|
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ "timeline-step copy/index": 0,
|
||||||
|
/******/ "timeline-step copy/style-index": 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var chunkIds = data[0];
|
||||||
|
/******/ var moreModules = data[1];
|
||||||
|
/******/ var runtime = data[2];
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["timeline-step copy/style-index"], () => (__webpack_require__("./src/timeline-step copy/index.js")))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
1
blocks/timeline/build/timeline-step copy/index.js.map
Normal file
1
blocks/timeline/build/timeline-step copy/index.js.map
Normal file
File diff suppressed because one or more lines are too long
4
blocks/timeline/build/timeline-step copy/style-index.css
Normal file
4
blocks/timeline/build/timeline-step copy/style-index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!**********************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/timeline-step copy/style.scss ***!
|
||||||
|
\**********************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
4
blocks/timeline/build/timeline-step/style-index.css
Normal file
4
blocks/timeline/build/timeline-step/style-index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!*****************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/timeline-step/style.scss ***!
|
||||||
|
\*****************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
15
blocks/timeline/build/tips-container/block.json
Normal file
15
blocks/timeline/build/tips-container/block.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 2,
|
||||||
|
"name": "homegrade-content-blocks/tips-container",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "tips container",
|
||||||
|
"category": "homegrade-blocks",
|
||||||
|
"description": "tips container",
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css"
|
||||||
|
}
|
||||||
1
blocks/timeline/build/tips-container/index.asset.php
Normal file
1
blocks/timeline/build/tips-container/index.asset.php
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'e03eaf34cd07ed126eb2');
|
||||||
4
blocks/timeline/build/tips-container/index.css
Normal file
4
blocks/timeline/build/tips-container/index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!*******************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/tips-container/editor.scss ***!
|
||||||
|
\*******************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
358
blocks/timeline/build/tips-container/index.js
Normal file
358
blocks/timeline/build/tips-container/index.js
Normal file
|
|
@ -0,0 +1,358 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "./src/tips-container/edit.js":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** ./src/tips-container/edit.js ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ Edit)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* 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 _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/tips-container/editor.scss");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Edit() {
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({
|
||||||
|
className: `homegrade-blocks-tips-to-know__tips-container`
|
||||||
|
})
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, {
|
||||||
|
allowedBlocks: ["homegrade-content-blocks/tip"],
|
||||||
|
template: [["homegrade-content-blocks/tip", {
|
||||||
|
tipTitle: "Astuce 1"
|
||||||
|
}], ["homegrade-content-blocks/tip", {
|
||||||
|
tipTitle: "Astuce 2"
|
||||||
|
}]],
|
||||||
|
templateLock: false
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/tips-container/index.js":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** ./src/tips-container/index.js ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||||
|
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/tips-container/style.scss");
|
||||||
|
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/tips-container/block.json");
|
||||||
|
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./src/tips-container/edit.js");
|
||||||
|
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/tips-container/save.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, {
|
||||||
|
title: _block_json__WEBPACK_IMPORTED_MODULE_3__.title,
|
||||||
|
icon: {
|
||||||
|
foreground: "#DF1E1E",
|
||||||
|
src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||||
|
xmlns: "http://www.w3.org/2000/svg",
|
||||||
|
viewBox: "0 0 30 30.02"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
|
||||||
|
id: "Calque_1-2",
|
||||||
|
"data-name": "Calque 1"
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||||
|
class: "cls-1",
|
||||||
|
d: "m5.55,15.41l9,4.49c.29.13.61.13.9,0l9-4.49c.34-.17.55-.51.55-.89v-6.19l-8.66,4.32c-.85.41-1.83.41-2.68,0l-8.66-4.32v6.19c0,.38.21.72.55.89Zm0-9.03l9,4.48c.29.13.61.13.9,0l9-4.48c.34-.17.55-.52.55-.9,0-.38-.21-.72-.55-.89L15.45.1c-.29-.13-.61-.13-.9,0L5.55,4.59c-.34.17-.55.51-.55.89,0,.38.21.73.55.9Zm2.65,14.62l-3.77,3.38c-1.46-.79-3.28-.25-4.07,1.21s-.25,3.28,1.21,4.07,3.28.25,4.07-1.21c.24-.44.37-.94.36-1.45,0-.39-.08-.77-.23-1.13l4.1-3.65c.21-.19.33-.46.33-.75v-1.47l-2-1v2Zm7.8,3.18v-2.37c-.64.25-1.36.25-2,0v2.37c-1.56.55-2.38,2.27-1.83,3.83.55,1.56,2.27,2.38,3.83,1.83,1.56-.55,2.38-2.27,1.83-3.83-.3-.85-.97-1.53-1.83-1.83Zm11-.18c-.5,0-.99.14-1.43.38l-3.77-3.38v-2l-2,1v1.51c0,.29.12.56.33.75l4.1,3.65c-.15.34-.23.72-.23,1.09,0,1.66,1.34,3,3,3s3-1.34,3-3-1.34-3-3-3Z"
|
||||||
|
})))
|
||||||
|
},
|
||||||
|
supports: _block_json__WEBPACK_IMPORTED_MODULE_3__.supports,
|
||||||
|
attributes: _block_json__WEBPACK_IMPORTED_MODULE_3__.attributes,
|
||||||
|
edit: _edit__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
|
save: _save__WEBPACK_IMPORTED_MODULE_5__["default"]
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/tips-container/save.js":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** ./src/tips-container/save.js ***!
|
||||||
|
\************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ save)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
||||||
|
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||||
|
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
|
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
|
||||||
|
className: `homegrade-blocks-tips-to-know__tips-container`
|
||||||
|
})
|
||||||
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/tips-container/editor.scss":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./src/tips-container/editor.scss ***!
|
||||||
|
\****************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/tips-container/style.scss":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** ./src/tips-container/style.scss ***!
|
||||||
|
\***************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/block-editor":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** external ["wp","blockEditor"] ***!
|
||||||
|
\*************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blockEditor"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/blocks":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** external ["wp","blocks"] ***!
|
||||||
|
\********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["blocks"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/element":
|
||||||
|
/*!*********************************!*\
|
||||||
|
!*** external ["wp","element"] ***!
|
||||||
|
\*********************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["element"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "@wordpress/i18n":
|
||||||
|
/*!******************************!*\
|
||||||
|
!*** external ["wp","i18n"] ***!
|
||||||
|
\******************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = window["wp"]["i18n"];
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/tips-container/block.json":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** ./src/tips-container/block.json ***!
|
||||||
|
\***************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/tips-container","version":"0.1.0","title":"tips container","category":"homegrade-blocks","description":"tips container","supports":{"html":false},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var chunkIds = deferred[i][0];
|
||||||
|
/******/ var fn = deferred[i][1];
|
||||||
|
/******/ var priority = deferred[i][2];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = (module) => {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ () => (module['default']) :
|
||||||
|
/******/ () => (module);
|
||||||
|
/******/ __webpack_require__.d(getter, { a: getter });
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/define property getters */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define getter functions for harmony exports
|
||||||
|
/******/ __webpack_require__.d = (exports, definition) => {
|
||||||
|
/******/ for(var key in definition) {
|
||||||
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||||
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/make namespace object */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = (exports) => {
|
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||||
|
/******/ }
|
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ "tips-container/index": 0,
|
||||||
|
/******/ "tips-container/style-index": 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var chunkIds = data[0];
|
||||||
|
/******/ var moreModules = data[1];
|
||||||
|
/******/ var runtime = data[2];
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["tips-container/style-index"], () => (__webpack_require__("./src/tips-container/index.js")))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
1
blocks/timeline/build/tips-container/index.js.map
Normal file
1
blocks/timeline/build/tips-container/index.js.map
Normal file
File diff suppressed because one or more lines are too long
4
blocks/timeline/build/tips-container/style-index.css
Normal file
4
blocks/timeline/build/tips-container/style-index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/tips-container/style.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
|
||||||
|
|
@ -14,6 +14,16 @@
|
||||||
"editorStyle": "file:./index.css",
|
"editorStyle": "file:./index.css",
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
|
"hasTitle": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"blockTitle": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"blockSubtitle": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"hasLateralCover": {
|
"hasLateralCover": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
|
@ -27,6 +37,15 @@
|
||||||
"lateralCoverAlt": {
|
"lateralCoverAlt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"lateralCoverAlt": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"lateralCoverCaption": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"lateralCoverDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"hasStepPictures": {
|
"hasStepPictures": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
|
|
@ -35,7 +54,7 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"stepPictureFormat": {
|
"lateralPicturesFormat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "md"
|
"default": "md"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { __ } from "@wordpress/i18n";
|
import { __ } from "@wordpress/i18n";
|
||||||
import "./editor.scss";
|
import "./editor.scss";
|
||||||
import "./timeline-step";
|
import "./timeline-step";
|
||||||
|
// import "./steps-container";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useBlockProps,
|
useBlockProps,
|
||||||
|
|
@ -18,24 +19,26 @@ import {
|
||||||
PanelRow,
|
PanelRow,
|
||||||
Button,
|
Button,
|
||||||
RadioControl,
|
RadioControl,
|
||||||
FormToggle,
|
ToggleControl,
|
||||||
__experimentalToggleGroupControl as ToggleGroupControl,
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
||||||
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
||||||
} from "@wordpress/components";
|
} from "@wordpress/components";
|
||||||
import { trash } from "@wordpress/icons";
|
import { trash } from "@wordpress/icons";
|
||||||
import ImageMediaPlaceholder from "../../_components/ImageMediaPlaceholder";
|
|
||||||
import Image from "../../_components/Image";
|
|
||||||
import ImagePanelBody from "../../_components/ImagePanelBody";
|
|
||||||
import ImagePanelBodyContent from "../../_components/ImagePanelBodyContent";
|
|
||||||
export default function Edit({ attributes, setAttributes, clientId }) {
|
export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
let {
|
let {
|
||||||
hasStepPictures,
|
hasStepPictures,
|
||||||
stepPictureFormat,
|
lateralPicturesFormat,
|
||||||
hasStepIcons,
|
hasStepIcons,
|
||||||
hasLateralCover,
|
hasLateralCover,
|
||||||
lateralCoverId,
|
lateralCoverId,
|
||||||
lateralCoverAlt,
|
lateralCoverAlt,
|
||||||
lateralCoverUrl,
|
lateralCoverUrl,
|
||||||
|
lateralCoverDescription,
|
||||||
|
lateralCoverCaption,
|
||||||
|
blockTitle,
|
||||||
|
blockSubtitle,
|
||||||
|
hasTitle,
|
||||||
} = attributes;
|
} = attributes;
|
||||||
|
|
||||||
let children = useSelect(
|
let children = useSelect(
|
||||||
|
|
@ -43,17 +46,14 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
select("core/block-editor").getBlocksByClientId(clientId)[0].innerBlocks
|
select("core/block-editor").getBlocksByClientId(clientId)[0].innerBlocks
|
||||||
);
|
);
|
||||||
|
|
||||||
function handleStepPictureFormatChange(stepPictureFormat) {
|
function onChangeBlockTitle(blockTitle) {
|
||||||
setAttributes({ stepPictureFormat });
|
setAttributes({ blockTitle });
|
||||||
}
|
}
|
||||||
function onChangehasStepPictures() {
|
function onChangeBlockSubtitle(blockSubtitle) {
|
||||||
setAttributes({ hasStepPictures: !hasStepPictures });
|
setAttributes({ blockSubtitle });
|
||||||
}
|
|
||||||
function onChangehasStepIcons() {
|
|
||||||
setAttributes({ hasStepIcons: !hasStepIcons });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChangeImagesDispositionType(disposition) {
|
function onChangeImagesDispositionType(disposition) {
|
||||||
console.log(disposition);
|
|
||||||
if (disposition === "hasStepPictures") {
|
if (disposition === "hasStepPictures") {
|
||||||
setAttributes({ hasStepPictures: true, hasLateralCover: false });
|
setAttributes({ hasStepPictures: true, hasLateralCover: false });
|
||||||
removeLateralCoverAttributes();
|
removeLateralCoverAttributes();
|
||||||
|
|
@ -62,11 +62,27 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
setAttributes({ hasStepPictures: false, hasLateralCover: true });
|
setAttributes({ hasStepPictures: false, hasLateralCover: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function handlelateralPicturesFormatChange(lateralPicturesFormat) {
|
||||||
|
setAttributes({ lateralPicturesFormat });
|
||||||
|
}
|
||||||
|
function onChangehasStepIcons() {
|
||||||
|
setAttributes({ hasStepIcons: !hasStepIcons });
|
||||||
|
}
|
||||||
|
function onChangeHasTitle(newHasTitle) {
|
||||||
|
setAttributes({ hasTitle: !hasTitle });
|
||||||
|
if (!newHasTitle) {
|
||||||
|
setAttributes({ blockTitle: "", blockSubtitle: "" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setLateralCoverAttributes(cover) {
|
function setLateralCoverAttributes(cover) {
|
||||||
|
console.log(cover);
|
||||||
setAttributes({
|
setAttributes({
|
||||||
lateralCoverId: cover.id,
|
lateralCoverId: cover.id,
|
||||||
lateralCoverAlt: cover.alt,
|
lateralCoverAlt: cover.alt,
|
||||||
lateralCoverUrl: cover.url,
|
lateralCoverUrl: cover.url,
|
||||||
|
lateralCoverCaption: cover?.caption,
|
||||||
|
lateralCoverDescription: cover?.description,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function removeLateralCoverAttributes() {
|
function removeLateralCoverAttributes() {
|
||||||
|
|
@ -74,6 +90,8 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
lateralCoverId: null,
|
lateralCoverId: null,
|
||||||
lateralCoverAlt: null,
|
lateralCoverAlt: null,
|
||||||
lateralCoverUrl: null,
|
lateralCoverUrl: null,
|
||||||
|
lateralCoverCaption: null,
|
||||||
|
lateralCoverDescription: null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,9 +140,23 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<PanelRow>
|
<PanelRow>
|
||||||
<label htmlFor="">Icones</label>
|
<ToggleControl
|
||||||
<FormToggle
|
label={__("Titre de bloc", "homegrade-blocks__texte-backoffice")}
|
||||||
|
help={
|
||||||
|
hasTitle ? "Titre de bloc." : "Ne pas afficher de bloc titrage"
|
||||||
|
}
|
||||||
|
checked={hasTitle}
|
||||||
|
onChange={onChangeHasTitle}
|
||||||
|
/>
|
||||||
|
</PanelRow>
|
||||||
|
<PanelRow>
|
||||||
|
<ToggleControl
|
||||||
label={__("Icones", "homegrade-blocks__texte-backoffice")}
|
label={__("Icones", "homegrade-blocks__texte-backoffice")}
|
||||||
|
help={
|
||||||
|
hasStepIcons
|
||||||
|
? "Afficher des icones pour chaque ligne"
|
||||||
|
: "Ne pas afficher d'icones"
|
||||||
|
}
|
||||||
checked={hasStepIcons}
|
checked={hasStepIcons}
|
||||||
onChange={onChangehasStepIcons}
|
onChange={onChangehasStepIcons}
|
||||||
/>
|
/>
|
||||||
|
|
@ -132,7 +164,7 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
|
|
||||||
<PanelRow>
|
<PanelRow>
|
||||||
<ToggleGroupControl
|
<ToggleGroupControl
|
||||||
label="Type d'image"
|
label="Type d'image Latérale"
|
||||||
className="homegrade-blocks-components-image__ratio-selector"
|
className="homegrade-blocks-components-image__ratio-selector"
|
||||||
isBlock
|
isBlock
|
||||||
onChange={onChangeImagesDispositionType}
|
onChange={onChangeImagesDispositionType}
|
||||||
|
|
@ -140,31 +172,30 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
>
|
>
|
||||||
<ToggleGroupControlOption
|
<ToggleGroupControlOption
|
||||||
variant="hasStepPictures"
|
variant="hasStepPictures"
|
||||||
label="Images par ligne"
|
label="image par ligne de timeline"
|
||||||
value="hasStepPictures"
|
value="hasStepPictures"
|
||||||
/>
|
/>
|
||||||
<ToggleGroupControlOption
|
<ToggleGroupControlOption
|
||||||
variant="lateralCover"
|
variant="lateralCover"
|
||||||
label="Illustration latéarale"
|
label=" Image latérale unique"
|
||||||
value="hasLateralCover"
|
value="hasLateralCover"
|
||||||
/>
|
/>
|
||||||
</ToggleGroupControl>
|
</ToggleGroupControl>
|
||||||
</PanelRow>
|
</PanelRow>
|
||||||
{hasStepPictures && (
|
|
||||||
<PanelRow>
|
<PanelRow>
|
||||||
<RadioControl
|
<RadioControl
|
||||||
// label={__("Tailles des images", "textdomain")}
|
label={__("Format d'image(s) latérale(s)", "textdomain")}
|
||||||
help="Taille des images"
|
selected={lateralPicturesFormat}
|
||||||
selected={stepPictureFormat}
|
options={[
|
||||||
options={[
|
{ label: "Carré", value: "squared" },
|
||||||
{ label: "Carré", value: "squared" },
|
{ label: "Moyenne", value: "md" },
|
||||||
{ label: "Moyenne", value: "md" },
|
{ label: "Hauteur originale", value: "xl" },
|
||||||
{ label: "Hautes", value: "xl" },
|
]}
|
||||||
]}
|
onChange={handlelateralPicturesFormatChange}
|
||||||
onChange={handleStepPictureFormatChange}
|
/>
|
||||||
/>
|
</PanelRow>
|
||||||
</PanelRow>
|
|
||||||
)}
|
|
||||||
{lateralCoverUrl && (
|
{lateralCoverUrl && (
|
||||||
<img src={lateralCoverUrl} alt={lateralCoverAlt} />
|
<img src={lateralCoverUrl} alt={lateralCoverAlt} />
|
||||||
)}
|
)}
|
||||||
|
|
@ -206,26 +237,67 @@ export default function Edit({ attributes, setAttributes, clientId }) {
|
||||||
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`,
|
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{hasLateralCover && !lateralCoverUrl && (
|
<div className="section_titling section_titling--center">
|
||||||
<MediaPlaceholder
|
{hasTitle && (
|
||||||
accept="image/*"
|
<>
|
||||||
allowedTypes={["image"]}
|
<RichText
|
||||||
onSelect={setLateralCoverAttributes}
|
value={blockTitle}
|
||||||
multiple={false}
|
tagName="h3"
|
||||||
handleUpload={true}
|
className="section_titling__title"
|
||||||
|
placeholder={__(
|
||||||
|
"Ajouter ici le Titre de la liste de membres",
|
||||||
|
"homegrade"
|
||||||
|
)}
|
||||||
|
onChange={onChangeBlockTitle}
|
||||||
|
/>
|
||||||
|
<RichText
|
||||||
|
value={blockSubtitle}
|
||||||
|
tagName="h4"
|
||||||
|
className="section_titling__subtitle"
|
||||||
|
placeholder={__(
|
||||||
|
"Ajouter ici le Sous-titre de la liste de membres",
|
||||||
|
"homegrade"
|
||||||
|
)}
|
||||||
|
onChange={onChangeBlockSubtitle}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="homegrade-blocks-timeline__container">
|
||||||
|
{hasLateralCover && !lateralCoverUrl && (
|
||||||
|
<MediaPlaceholder
|
||||||
|
accept="image/*"
|
||||||
|
allowedTypes={["image"]}
|
||||||
|
onSelect={setLateralCoverAttributes}
|
||||||
|
multiple={false}
|
||||||
|
handleUpload={true}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{hasLateralCover && lateralCoverUrl && (
|
||||||
|
<figure
|
||||||
|
className={`homegrade-blocks-timeline__lateral-cover homegrade-blocks-timeline__lateral-cover--${lateralPicturesFormat}`}
|
||||||
|
>
|
||||||
|
<img src={lateralCoverUrl} alt={lateralCoverAlt} />
|
||||||
|
|
||||||
|
{(lateralCoverDescription || lateralCoverCaption) && (
|
||||||
|
<figcaption>
|
||||||
|
{lateralCoverDescription && (
|
||||||
|
<p className="description">{lateralCoverDescription}</p>
|
||||||
|
)}
|
||||||
|
{lateralCoverCaption && (
|
||||||
|
<p className="caption">{lateralCoverCaption}</p>
|
||||||
|
)}
|
||||||
|
</figcaption>
|
||||||
|
)}
|
||||||
|
</figure>
|
||||||
|
)}
|
||||||
|
<InnerBlocks
|
||||||
|
allowedBlocks={["homegrade-content-blocks/timeline-step"]}
|
||||||
|
template={TEMPLATE}
|
||||||
/>
|
/>
|
||||||
)}
|
</div>
|
||||||
{hasLateralCover && lateralCoverUrl && (
|
|
||||||
<img
|
|
||||||
className="homegrade-blocks-timeline__lateral-cover"
|
|
||||||
src={lateralCoverUrl}
|
|
||||||
alt={lateralCoverAlt}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<InnerBlocks
|
|
||||||
allowedBlocks={["homegrade-content-blocks/timeline-step"]}
|
|
||||||
template={TEMPLATE}
|
|
||||||
/>
|
|
||||||
</section>
|
</section>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,17 @@ import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor";
|
||||||
|
|
||||||
export default function save({ attributes }) {
|
export default function save({ attributes }) {
|
||||||
let {
|
let {
|
||||||
|
hasTitle,
|
||||||
|
blockTitle,
|
||||||
|
blockSubtitle,
|
||||||
hasStepPictures,
|
hasStepPictures,
|
||||||
stepPictureFormat,
|
lateralPicturesFormat,
|
||||||
hasStepIcons,
|
hasStepIcons,
|
||||||
hasLateralCover,
|
hasLateralCover,
|
||||||
lateralCoverUrl,
|
lateralCoverUrl,
|
||||||
lateralCoverAlt,
|
lateralCoverAlt,
|
||||||
|
lateralCoverCaption,
|
||||||
|
lateralCoverDescription,
|
||||||
} = attributes;
|
} = attributes;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -23,9 +28,42 @@ export default function save({ attributes }) {
|
||||||
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`,
|
${hasLateralCover ? "homegrade-blocks-timeline--has-lateral-cover" : ""}`,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{hasLateralCover && <img className="homegrade-blocks-timeline__lateral-cover" src={lateralCoverUrl} alt={lateralCoverAlt} />}
|
{hasTitle && (
|
||||||
<div className="homegrade-blocks-timeline__innercontent">
|
<div className="section_titling section_titling--center">
|
||||||
<InnerBlocks.Content />
|
<RichText.Content
|
||||||
|
value={blockTitle}
|
||||||
|
tagName="h3"
|
||||||
|
className="section_titling__title"
|
||||||
|
/>
|
||||||
|
<RichText.Content
|
||||||
|
value={blockSubtitle}
|
||||||
|
tagName="h4"
|
||||||
|
className="section_titling__subtitle"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="homegrade-blocks-timeline__container">
|
||||||
|
{hasLateralCover && lateralCoverUrl && (
|
||||||
|
<figure
|
||||||
|
className={`homegrade-blocks-timeline__lateral-cover homegrade-blocks-timeline__lateral-cover--${lateralPicturesFormat}`}
|
||||||
|
>
|
||||||
|
<img src={lateralCoverUrl} alt={lateralCoverAlt} />
|
||||||
|
|
||||||
|
{(lateralCoverDescription || lateralCoverCaption) && (
|
||||||
|
<figcaption>
|
||||||
|
{lateralCoverDescription && (
|
||||||
|
<p className="description">{lateralCoverDescription}</p>
|
||||||
|
)}
|
||||||
|
{lateralCoverCaption && (
|
||||||
|
<p className="caption">{lateralCoverCaption}</p>
|
||||||
|
)}
|
||||||
|
</figcaption>
|
||||||
|
)}
|
||||||
|
</figure>
|
||||||
|
)}
|
||||||
|
<div className="homegrade-blocks-timeline__innercontent">
|
||||||
|
<InnerBlocks.Content />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
15
blocks/timeline/src/steps-container/block.json
Normal file
15
blocks/timeline/src/steps-container/block.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 2,
|
||||||
|
"name": "homegrade-content-blocks/timeline-steps-container",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Étapes",
|
||||||
|
"category": "homegrade-blocks",
|
||||||
|
"description": "steps container",
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"editorScript": "file:./index.js",
|
||||||
|
"editorStyle": "file:./index.css",
|
||||||
|
"style": "file:./style-index.css"
|
||||||
|
}
|
||||||
23
blocks/timeline/src/steps-container/edit.js
Normal file
23
blocks/timeline/src/steps-container/edit.js
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { __ } from "@wordpress/i18n";
|
||||||
|
import "./editor.scss";
|
||||||
|
|
||||||
|
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
|
||||||
|
export default function Edit() {
|
||||||
|
let { hasStepIcons, hasLateralCover } = attributes;
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
{...useBlockProps({
|
||||||
|
className: `homegrade-blocks-timeline__steps-container`,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<InnerBlocks
|
||||||
|
allowedBlocks={["homegrade-content-blocks/timeline-step"]}
|
||||||
|
template={[
|
||||||
|
["homegrade-content-blocks/timeline-step", { tipTitle: "Astuce 1" }],
|
||||||
|
["homegrade-content-blocks/timeline-step", { tipTitle: "Astuce 2" }],
|
||||||
|
]}
|
||||||
|
templateLock={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
1
blocks/timeline/src/steps-container/editor.scss
Normal file
1
blocks/timeline/src/steps-container/editor.scss
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
// HANDLED BY PARENT BLOCK
|
||||||
28
blocks/timeline/src/steps-container/index.js
Normal file
28
blocks/timeline/src/steps-container/index.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { registerBlockType } from "@wordpress/blocks";
|
||||||
|
import "./style.scss";
|
||||||
|
import metadata from "./block.json";
|
||||||
|
|
||||||
|
import Edit from "./edit";
|
||||||
|
import Save from "./save";
|
||||||
|
|
||||||
|
registerBlockType(metadata.name, {
|
||||||
|
title: metadata.title,
|
||||||
|
icon: {
|
||||||
|
foreground: "#DF1E1E",
|
||||||
|
src: (
|
||||||
|
<svg viewBox="0 0 73.9 90">
|
||||||
|
<g id="Calque_1-2" data-name="Calque 1">
|
||||||
|
<path
|
||||||
|
class="cls-1"
|
||||||
|
d="m4.1,19.22v17.13c.64-.23,1.33-.35,2.05-.35s1.41.13,2.05.35v-17.12c-.64.23-1.33.35-2.05.35s-1.41-.12-2.05-.35Zm0-2.6c.64.23,1.33.35,2.05.35s1.41-.12,2.05-.35c2.39-.85,4.1-3.12,4.1-5.81s-1.71-4.96-4.1-5.81c-.64-.23-1.33-.35-2.05-.35s-1.41.12-2.05.35C1.71,5.85,0,8.13,0,10.81s1.71,4.96,4.1,5.81ZM8.21,2.41V0h-4.11v2.41c.64-.23,1.33-.35,2.05-.35.72,0,1.41.12,2.05.35Zm17.24,17.44c.82.82,1.85,1.23,2.87,1.23h29.15c1.23,0,2.05-.82,2.05-2.05V2.6c0-1.23-.82-2.05-2.05-2.05h-29.15c-1.02,0-2.05.41-2.87,1.23l-7.59,7.6c-.82.82-.82,2.05,0,2.87l7.59,7.6ZM4.11,87.6v2.4h4.11v-2.4c-.64.23-1.33.35-2.05.35-.72,0-1.41-.12-2.05-.35Zm4.11-14.21c-.64-.23-1.33-.35-2.05-.35s-1.41.12-2.05.35C1.71,74.23,0,76.51,0,79.19s1.71,4.96,4.1,5.81c.64.23,1.33.35,2.05.35s1.41-.12,2.05-.35c2.39-.85,4.1-3.13,4.1-5.81s-1.71-4.96-4.1-5.81Zm47.21-4.46h-27.1c-1.02,0-2.05.41-2.87,1.23l-7.59,7.6c-.82.82-.82,2.05,0,2.87l7.59,7.6c.82.82,1.85,1.23,2.87,1.23h27.1c1.23,0,2.05-.82,2.05-2.05v-16.42c0-1.23-.82-2.05-2.05-2.05Zm16.42-34.44H28.33c-1.02,0-2.05.41-2.87,1.23l-7.59,7.59c-.82.82-.82,2.05,0,2.87l7.59,7.6c.82.82,1.85,1.23,2.87,1.23h43.52c1.23,0,2.05-.82,2.05-2.05v-16.42c0-1.23-.82-2.05-2.05-2.05Zm-63.63,4.46c-.64-.23-1.33-.35-2.05-.35-.72,0-1.41.13-2.05.35C1.71,39.79,0,42.07,0,44.75s1.71,4.96,4.1,5.81c.64.23,1.33.35,2.05.35s1.41-.13,2.05-.35c2.39-.85,4.1-3.12,4.1-5.81s-1.71-4.96-4.1-5.81Zm0,31.84v-17.12c-.64.23-1.33.35-2.05.35s-1.41-.13-2.05-.35v17.12c.64-.23,1.33-.35,2.05-.35s1.41.12,2.05.35Z"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
supports: metadata.supports,
|
||||||
|
attributes: metadata.attributes,
|
||||||
|
edit: Edit,
|
||||||
|
save: Save,
|
||||||
|
});
|
||||||
13
blocks/timeline/src/steps-container/save.js
Normal file
13
blocks/timeline/src/steps-container/save.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor";
|
||||||
|
|
||||||
|
export default function save() {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
{...useBlockProps.save({
|
||||||
|
className: `homegrade-blocks-timeline__steps-container`,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<InnerBlocks.Content />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
1
blocks/timeline/src/steps-container/style.scss
Normal file
1
blocks/timeline/src/steps-container/style.scss
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
// HANDLED BY PARENT BLOCK
|
||||||
Loading…
Reference in New Issue
Block a user