removing unused hasCustomTitle
This commit is contained in:
parent
37de8bc461
commit
7b57772c92
|
|
@ -17,10 +17,6 @@
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"render": "file:./render.php",
|
"render": "file:./render.php",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"hasCustomTitle": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"pageHeaderTitle": {
|
"pageHeaderTitle": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '33d8b36cf2904cb62a91');
|
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'de0da04da745c8c7f08b');
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,6 @@ function Edit({
|
||||||
setAttributes
|
setAttributes
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
hasCustomTitle,
|
|
||||||
hasCta,
|
hasCta,
|
||||||
cta,
|
cta,
|
||||||
hasCustomImage,
|
hasCustomImage,
|
||||||
|
|
@ -158,16 +157,6 @@ function Edit({
|
||||||
return Image;
|
return Image;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
function onChangeHasCustomTitle(newHasAutoTitle) {
|
|
||||||
setAttributes({
|
|
||||||
hasCustomTitle: !hasCustomTitle
|
|
||||||
});
|
|
||||||
if (newHasAutoTitle) {
|
|
||||||
setAttributes({
|
|
||||||
blockCustomTitle: undefined
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function onChangeHasCustomImage(newHasAutoImage) {
|
function onChangeHasCustomImage(newHasAutoImage) {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
hasCustomImage: !hasCustomImage
|
hasCustomImage: !hasCustomImage
|
||||||
|
|
@ -225,13 +214,6 @@ function Edit({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
|
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
|
||||||
className: "homegrade-blocks-content-page-header__panel-cta",
|
|
||||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Titre du bloc", "homegrade-blocks")
|
|
||||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToggleControl, {
|
|
||||||
label: "Titre automatique",
|
|
||||||
checked: !hasCustomTitle,
|
|
||||||
onChange: onChangeHasCustomTitle
|
|
||||||
}), !hasCustomTitle && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Tip, null, "Le titre est automatiquement g\xE9n\xE9r\xE9 \xE0 partir du titre de la page")), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
|
|
||||||
className: "homegrade-blocks-components-image__panel-body",
|
className: "homegrade-blocks-components-image__panel-body",
|
||||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Image d'accompagnement", "homegrade-blocks")
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Image d'accompagnement", "homegrade-blocks")
|
||||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToggleControl, {
|
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToggleControl, {
|
||||||
|
|
@ -346,10 +328,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, {
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, {
|
||||||
icon: {
|
icon: {
|
||||||
foreground: "#f03",
|
foreground: "#DF1E1E",
|
||||||
src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||||
id: "Calque_2",
|
|
||||||
"data-name": "Calque 2",
|
|
||||||
xmlns: "http://www.w3.org/2000/svg",
|
xmlns: "http://www.w3.org/2000/svg",
|
||||||
viewBox: "0 0 401.94 401.92"
|
viewBox: "0 0 401.94 401.92"
|
||||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("defs", null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
|
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("defs", null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
|
||||||
|
|
@ -536,7 +516,7 @@ module.exports = window["wp"]["primitives"];
|
||||||
\************************/
|
\************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-page-header","version":"0.1.0","title":"Content page header","category":"homegrade-blocks","icon":"smiley","description":"Bloc bannière/header de contenu de premier niveau pour les pages de contenu","supports":{"html":false,"anchor":true},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"hasCustomTitle":{"type":"boolean","default":false},"pageHeaderTitle":{"type":"string"},"hasCta":{"type":"boolean","default":false},"cta":{"type":"object"},"hasCustomImage":{"type":"boolean","default":false},"imageUrl":{"type":"string"},"imageAlt":{"type":"string"},"imageId":{"type":"number"},"imageProportion":{"type":"string","default":"original"},"anchor":{"type":"string"},"coverSize":{"type":"string","default":"medium"}}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-page-header","version":"0.1.0","title":"Content page header","category":"homegrade-blocks","icon":"smiley","description":"Bloc bannière/header de contenu de premier niveau pour les pages de contenu","supports":{"html":false,"anchor":true},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"pageHeaderTitle":{"type":"string"},"hasCta":{"type":"boolean","default":false},"cta":{"type":"object"},"hasCustomImage":{"type":"boolean","default":false},"imageUrl":{"type":"string"},"imageAlt":{"type":"string"},"imageId":{"type":"number"},"imageProportion":{"type":"string","default":"original"},"anchor":{"type":"string"},"coverSize":{"type":"string","default":"medium"}}}');
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -17,10 +17,6 @@
|
||||||
"style": "file:./style-index.css",
|
"style": "file:./style-index.css",
|
||||||
"render": "file:./render.php",
|
"render": "file:./render.php",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"hasCustomTitle": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"pageHeaderTitle": {
|
"pageHeaderTitle": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ import { lock, trash } from "@wordpress/icons";
|
||||||
|
|
||||||
export default function Edit({ attributes, setAttributes }) {
|
export default function Edit({ attributes, setAttributes }) {
|
||||||
const {
|
const {
|
||||||
hasCustomTitle,
|
|
||||||
hasCta,
|
hasCta,
|
||||||
cta,
|
cta,
|
||||||
hasCustomImage,
|
hasCustomImage,
|
||||||
|
|
@ -43,12 +42,6 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function onChangeHasCustomTitle(newHasAutoTitle) {
|
|
||||||
setAttributes({ hasCustomTitle: !hasCustomTitle });
|
|
||||||
if (newHasAutoTitle) {
|
|
||||||
setAttributes({ blockCustomTitle: undefined });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function onChangeHasCustomImage(newHasAutoImage) {
|
function onChangeHasCustomImage(newHasAutoImage) {
|
||||||
setAttributes({ hasCustomImage: !hasCustomImage });
|
setAttributes({ hasCustomImage: !hasCustomImage });
|
||||||
if (!newHasAutoImage) {
|
if (!newHasAutoImage) {
|
||||||
|
|
@ -100,21 +93,6 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<InspectorControls>
|
<InspectorControls>
|
||||||
<PanelBody
|
|
||||||
className="homegrade-blocks-content-page-header__panel-cta"
|
|
||||||
title={__("Titre du bloc", "homegrade-blocks")}
|
|
||||||
>
|
|
||||||
<ToggleControl
|
|
||||||
label="Titre automatique"
|
|
||||||
checked={!hasCustomTitle}
|
|
||||||
onChange={onChangeHasCustomTitle}
|
|
||||||
/>
|
|
||||||
{!hasCustomTitle && (
|
|
||||||
<Tip>
|
|
||||||
Le titre est automatiquement généré à partir du titre de la page
|
|
||||||
</Tip>
|
|
||||||
)}
|
|
||||||
</PanelBody>
|
|
||||||
<PanelBody
|
<PanelBody
|
||||||
className="homegrade-blocks-components-image__panel-body"
|
className="homegrade-blocks-components-image__panel-body"
|
||||||
title={__("Image d'accompagnement", "homegrade-blocks")}
|
title={__("Image d'accompagnement", "homegrade-blocks")}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user