From 249a177f026f27b6ab45436e20fef5a8e25f6120 Mon Sep 17 00:00:00 2001 From: Rishit Gupta <74411873+Rishit30G@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:05:14 +0530 Subject: [PATCH] Storybook: Add Block Canvas Component --- .../block-canvas/stories/index.story.js | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 packages/block-editor/src/components/block-canvas/stories/index.story.js diff --git a/packages/block-editor/src/components/block-canvas/stories/index.story.js b/packages/block-editor/src/components/block-canvas/stories/index.story.js new file mode 100644 index 0000000000000..d91670f0af8e6 --- /dev/null +++ b/packages/block-editor/src/components/block-canvas/stories/index.story.js @@ -0,0 +1,59 @@ +/** + * Internal dependencies + */ +import { BlockCanvas, BlockList } from '../..'; + +const meta = { + title: 'BlockEditor/BlockCanvas', + component: BlockCanvas, + parameters: { + docs: { + canvas: { sourceState: 'shown' }, + description: { + component: + 'The BlockCanvas component is used to render the canvas for the block editor.', + }, + }, + }, + argTypes: { + children: { + control: false, // Disable direct control for `children` as it defaults to `BlockList` + description: 'The children to render in the canvas.', + table: { + type: { summary: 'node' }, + defaultValue: { summary: 'BlockList' }, + }, + }, + height: { + control: 'text', + description: 'The height of the canvas.', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '300px' }, + }, + }, + styles: { + control: 'object', + description: 'The styles to apply to the canvas.', + table: { + type: { summary: 'object' }, + }, + }, + }, +}; + +export default meta; + +export const Default = { + args: { + height: '300px', + styles: { + border: '1px solid #ccc', + backgroundColor: '#f9f9f9', + }, + children: , // Default `children` is `BlockList` + }, + render: function Template( args ) { + return ; + }, +};