FEATURE Passing alignfull only to other pages than articles on editor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2025-10-22 17:03:20 +02:00
parent a3a57e92da
commit 5084319f1f
6 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,7 @@
"apiVersion": 3,
"name": "carhop-blocks/content-box",
"version": "0.1.0",
"title": "Content Box",
"title": "Boite de contenu",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Boite de contenu pour la mise en forme d'éléments de contenu",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '46ebeceedf581ec6f850');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '40cbdd78d4946dcf6410');

View File

@ -41,7 +41,7 @@ function isColorLight(color) {
\************************/
/***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Content Box","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#136f63"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"#ffffff"},"blockVariant":{"type":"string","default":"framed"}}}');
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Boite de contenu","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#136f63"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"#ffffff"},"blockVariant":{"type":"string","default":"framed"}}}');
/***/ }),
@ -191,7 +191,7 @@ function Edit({
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
className: `alignfull content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}`,
className: `${postType !== "articles" && "alignfull"} content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}`,
style: {
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
"--content-box-background-color": blockVariant === "backgrounded" ? backgroundColor : "transparent"

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
"apiVersion": 3,
"name": "carhop-blocks/content-box",
"version": "0.1.0",
"title": "Content Box",
"title": "Boite de contenu",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Boite de contenu pour la mise en forme d'éléments de contenu",

View File

@ -132,7 +132,9 @@ export default function Edit({ attributes, setAttributes, ...props }) {
</InspectorControls>
<section
{...useBlockProps({
className: `alignfull content-box content-box--variant-${blockVariant} ${
className: `${
postType !== "articles" && "alignfull"
} content-box content-box--variant-${blockVariant} ${
hasLightBackground
? "content-box--bg-light"
: "content-box--bg-dark"