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..1722ee47674b7 --- /dev/null +++ b/packages/block-editor/src/components/block-canvas/stories/index.story.js @@ -0,0 +1,75 @@ +/** + * WordPress dependencies + */ +import { useState, useEffect } from '@wordpress/element'; +import { registerCoreBlocks } from '@wordpress/block-library'; +import { + BlockCanvas, + BlockEditorProvider, + BlockToolbar, +} from '@wordpress/block-editor'; + +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.', + }, + }, + }, + decorators: [ + ( Story ) => { + const [ blocks, updateBlocks ] = useState( [] ); + + useEffect( () => { + registerCoreBlocks(); + }, [] ); + + return ( + updateBlocks( newBlocks ) } + onChange={ ( newBlocks ) => updateBlocks( newBlocks ) } + > + + + + ); + }, + ], + argTypes: { + children: { + control: false, + 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: 'Array' }, + }, + }, + }, +}; + +export default meta; + +export const Default = { + render: ( args ) => , +};