From 61503f275305dd13589545ef9a63cadb3bc122d3 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 4 Dec 2025 16:56:05 +0100 Subject: [PATCH] FEATURE Adding numbering variant --- .../src/scroll-story-block/block.json | 8 +++++++- .../src/scroll-story-block/edit.js | 19 ++++++++++++++++++- .../src/scroll-story-block/save.js | 9 ++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/plugins/carhop-blocks/src/scroll-story-block/block.json b/plugins/carhop-blocks/src/scroll-story-block/block.json index b72b172..97a9d6b 100644 --- a/plugins/carhop-blocks/src/scroll-story-block/block.json +++ b/plugins/carhop-blocks/src/scroll-story-block/block.json @@ -15,5 +15,11 @@ "editorScript": "file:./index.js", "editorStyle": "file:./index.css", "style": "file:./style-index.css", - "viewScript": "file:./view.js" + "viewScript": "file:./view.js", + "attributes": { + "hasNumbering": { + "type": "boolean", + "default": false + } + } } \ No newline at end of file diff --git a/plugins/carhop-blocks/src/scroll-story-block/edit.js b/plugins/carhop-blocks/src/scroll-story-block/edit.js index e65211c..efdc05f 100644 --- a/plugins/carhop-blocks/src/scroll-story-block/edit.js +++ b/plugins/carhop-blocks/src/scroll-story-block/edit.js @@ -1,13 +1,30 @@ import { __ } from "@wordpress/i18n"; import { useBlockProps, InnerBlocks } from "@wordpress/block-editor"; import "./editor.scss"; +import { PanelBody, CheckboxControl } from "@wordpress/components"; +import { InspectorControls } from "@wordpress/block-editor"; export default function Edit({ attributes, setAttributes }) { + const { hasNumbering } = attributes; return ( <> + + + setAttributes({ hasNumbering: value })} + /> + +
+
);