-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StoryBook: Add story for BlockSettingsMenu
- Loading branch information
1 parent
041ca27
commit 8e854de
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
packages/block-editor/src/components/block-settings-menu/stories/index.story.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import BlockSettingsMenu from '../'; | ||
|
||
/** | ||
* Storybook metadata | ||
*/ | ||
const meta = { | ||
title: 'BlockEditor/BlockSettingsMenu', | ||
component: BlockSettingsMenu, | ||
parameters: { | ||
docs: { | ||
description: { | ||
component: | ||
'The `BlockSettingsMenu` component displays the block settings menu, with options like duplicate, remove, etc. It wraps the `BlockSettingsDropdown` and provides toolbar functionality.', | ||
}, | ||
canvas: { sourceState: 'shown' }, | ||
}, | ||
}, | ||
argTypes: { | ||
clientIds: { | ||
control: 'array', | ||
description: | ||
'Array of clientIds for the blocks that will be acted upon. Can be used to control block actions like duplicate or delete.', | ||
table: { | ||
type: { summary: 'Array' }, | ||
}, | ||
}, | ||
__experimentalSelectBlock: { | ||
control: 'function', | ||
description: | ||
'A callback for selecting a block. When provided, interacting with the dropdown options (like duplicate) will not update the editor selection.', | ||
table: { | ||
type: { summary: 'function' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
/** | ||
* Default Story | ||
*/ | ||
export const Default = { | ||
args: { | ||
clientIds: [ 'block-1', 'block-2' ], | ||
__experimentalSelectBlock: () => {}, | ||
}, | ||
render: function Template( { clientIds, __experimentalSelectBlock } ) { | ||
return ( | ||
<BlockSettingsMenu | ||
clientIds={ clientIds } | ||
__experimentalSelectBlock={ __experimentalSelectBlock } | ||
/> | ||
); | ||
}, | ||
}; |