FEATURE replacing the block width by a native align support
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0a64a8a4d6
commit
b0973a13d5
|
|
@ -14,7 +14,11 @@
|
|||
"color": true,
|
||||
"style": true,
|
||||
"width": true
|
||||
}
|
||||
},
|
||||
"align": [
|
||||
"wide",
|
||||
"full"
|
||||
]
|
||||
},
|
||||
"textdomain": "carhop-blocks",
|
||||
"editorScript": "file:./index.js",
|
||||
|
|
@ -27,14 +31,6 @@
|
|||
"type": "string",
|
||||
"default": "full"
|
||||
},
|
||||
"blockWidth": {
|
||||
"type": "string",
|
||||
"default": "full",
|
||||
"enum": [
|
||||
"full",
|
||||
"contained"
|
||||
]
|
||||
},
|
||||
"coverType": {
|
||||
"type": "string",
|
||||
"default": "image",
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import ShapeB from "./shapeB.jsx";
|
|||
export default function Edit({ attributes, setAttributes, ...props }) {
|
||||
const colors = useSetting("color.palette.theme");
|
||||
const {
|
||||
align,
|
||||
hasLightBackground,
|
||||
disposition,
|
||||
coverType,
|
||||
|
|
@ -35,7 +36,6 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
|||
coverId,
|
||||
coverSize,
|
||||
backgroundColor,
|
||||
blockWidth,
|
||||
textColor,
|
||||
shapeType,
|
||||
blockVariant,
|
||||
|
|
@ -98,10 +98,10 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
|||
className="deligraph-blocks__variant"
|
||||
isBlock
|
||||
label="Largeur du bloc"
|
||||
onChange={(value) => setAttributes({ blockWidth: value })}
|
||||
value={blockWidth}
|
||||
onChange={(value) => setAttributes({ align: value })}
|
||||
value={align || "wide"}
|
||||
>
|
||||
<ToggleGroupControlOption label="Contenue" value="contained" />
|
||||
<ToggleGroupControlOption label="Contenue" value="wide" />
|
||||
<ToggleGroupControlOption label="Pleine largeur" value="full" />
|
||||
</ToggleGroupControl>
|
||||
{/* Modèle de bloc */}
|
||||
|
|
@ -261,12 +261,6 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
|||
<section
|
||||
{...useBlockProps({
|
||||
className: `deligraph-blocks-chapter-section chapter-section chapter-section--${disposition} chapter-section--${blockVariant}
|
||||
${
|
||||
blockWidth === "full"
|
||||
? "chapter-section--width-full"
|
||||
: "chapter-section--width-contained"
|
||||
}
|
||||
|
||||
${
|
||||
hasLightBackground
|
||||
? "chapter-section--bg-light"
|
||||
|
|
@ -282,6 +276,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
|||
},
|
||||
})}
|
||||
>
|
||||
<div className="chapter-section__inner">
|
||||
{blockVariant === "backgrounded" &&
|
||||
backgroundColor &&
|
||||
shapeType === "variationA" && (
|
||||
|
|
@ -359,6 +354,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
|||
handleUpload={true}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ export default function save({ attributes }) {
|
|||
coverSize,
|
||||
coverType,
|
||||
backgroundColor,
|
||||
blockWidth,
|
||||
textColor,
|
||||
shapeType,
|
||||
blockVariant,
|
||||
|
|
@ -21,12 +20,6 @@ export default function save({ attributes }) {
|
|||
<section
|
||||
{...useBlockProps.save({
|
||||
className: `deligraph-blocks-chapter-section chapter-section chapter-section--${disposition} chapter-section--${blockVariant}
|
||||
${
|
||||
blockWidth === "full"
|
||||
? "chapter-section--width-full"
|
||||
: "chapter-section--width-contained"
|
||||
}
|
||||
|
||||
${
|
||||
hasLightBackground
|
||||
? "chapter-section--bg-light"
|
||||
|
|
@ -43,6 +36,7 @@ export default function save({ attributes }) {
|
|||
},
|
||||
})}
|
||||
>
|
||||
<div className="chapter-section__inner">
|
||||
{blockVariant === "backgrounded" &&
|
||||
backgroundColor &&
|
||||
shapeType === "variationA" && (
|
||||
|
|
@ -76,6 +70,7 @@ export default function save({ attributes }) {
|
|||
alt={coverAlt}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user