diff --git a/packages/block-editor/src/components/rich-text/stories/rich-text-shortcut.story.js b/packages/block-editor/src/components/rich-text/stories/rich-text-shortcut.story.js new file mode 100644 index 0000000000000..98a8a3d615ae0 --- /dev/null +++ b/packages/block-editor/src/components/rich-text/stories/rich-text-shortcut.story.js @@ -0,0 +1,80 @@ +/** + * Internal dependencies + */ +import { keyboardShortcutContext } from '../index.js'; +import { RichTextShortcut } from '../shortcut.js'; + +const meta = { + title: 'BlockEditor/RichTextShortcut', + component: RichTextShortcut, + parameters: { + docs: { + canvas: { + sourceState: 'shown', + }, + description: { + component: + 'The `RichTextShortcut` component is used to define a keyboard shortcut for a specific action.', + }, + }, + }, + argTypes: { + character: { + control: { + type: 'text', + }, + description: 'The character that triggers the shortcut.', + table: { + type: { + summary: 'string', + }, + }, + }, + type: { + control: { + type: 'select', + options: [ 'primary', 'access' ], + }, + description: 'The type of shortcut.', + table: { + type: { + summary: 'string', + }, + }, + }, + onUse: { + description: 'Function to be called when the shortcut is used.', + table: { + type: { + summary: 'function', + }, + }, + }, + }, + decorators: [ + ( Story ) => { + const keyboardShortcuts = { + current: new Set(), + }; + + return ( + + { Story() } + + ); + }, + ], +}; + +export default meta; + +export const Default = { + args: { + character: 'b', + type: 'primary', + onUse: () => {}, + }, + render: function Template( args ) { + return ; + }, +};