-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
What problem does this address?
Most of Block Editor components don't have stories.
Block Editor components's Storybook should also be added and updated like the Components.
related #22891
What is your proposed solution?
We can use this issue to track the addition and updating of the stories for Block Editor.
You can add the link to assign yourself to each component.
As I know, Block Editor Components list has never existed, so at first, we can start to be based on the directory name.
The list was made automatically, and we can ignore the component for native only.
If you cannot edit the list, please comment on which you made the PR for which directory's components.
cc @WordPress/gutenberg-components
Best Practices
1. Use CSF 3 format
Write stories as objects, not functions
Do
export const Default = {
render: function Template( { onChange, ...args } ) {
const [ value, setValue ] = useState();
return (
<SomeComponent
{ ...args }
onChange={ ( ...changeArgs ) => {
onChange( ...changeArgs );
setValue( ...changeArgs );
} }
value={ value }
/>
);
},
};Don't
const Template = ( { onChange, ...args } ) => {
const [ value, setValue ] = useState();
return (
<SomeComponent
{ ...args }
onChange={ ( ...changeArgs ) => {
onChange( ...changeArgs );
setValue( ...changeArgs );
} }
value={ value }
/>
);
};
export const Default = Template.bind( {} );2. Consists of only one component
The purpose of Storybook is to test a single UI component itself. Therefore, unless there is a special reason, we should not include anything other than that component.
3. Don’t create too many stories
While it's tempting to expose as many variations of a component as possible, the behavior of the component can be changed in the Controls section.
Therefore, additional stories should only be included if they involve significant visual or behavioral changes.
4. About meta data
To display the source panel by default, specify 'shown' in the meta.parameters.docs.canvas.sourceState field.
Example
const meta = {
// ...
parameters: {
docs: {
canvas: { sourceState: 'shown' },
// ...
},
},
// ...
};Define the component description via the meta.parameters.docs.description.component field instead of a comment.
Example
const meta = {
// ...
parameters: {
docs: {
// ...
description: {
component: 'Component description here...',
},
},
},
// ...
};Explicitly define the type of props via the meta.argTypes.{propName}.table.type.summary field.
Example
const meta = {
// ...
argTypes: {
// ...
propName: {
// ...
table: {
type: {
summary: 'string',
},
},
},
// ...
},
};For private components, you may want to define the following fields to display the badge 🔒 (Private APIs README).
Check here to see if the component is exported as private.
Example
const meta = {
// ...
tags: [ 'status-private' ],
// ...
};5. Others
If the component you're working on doesn't have a README or JDoc, I'd appreciate it if you could do the following to clarify the component's implementation first:
- If there's no README file: This is part of Add READMEs to all block-editor components #22891. If the component already has JSDoc, you can use it to help write the README.
- If there's no README and no JSDoc: You'll need to analyze the component's implementation and clarify the types of props and return types. See Add READMEs to all block-editor components #22891 (comment) for information on the JSDoc format.
Block Editor Components directories List
Components List
Note: 🔒 indicates that the component is private.
- alignment-control Storybook: Add stories for AlignmentToolbar and AlignmentControl components #67046
AlignmentControlAlignmentToolbar
-
audio-player (for native only) - autocomplete (
BlockEditorAutocompletebased onAutocompletefrom@wordpress/components. Pending until theAutocompletecomponent's stories are made.) add storybook for autocomplete #70926 -
background-image-control/BackgroundImagePanelAdd story for BackgroundImagePanel #67184 - (Internal)
block-actions - block-alignment-control Storybook: Add stories for BlockAlignmentControl and BlockAlignmentToolbar components #67233
BlockAlignmentControlBlockAlignmentToolbar
- block-alignment-matrix-control (Has
__experimentalprefix) Storybook: Add BlockAlignmentMatrixControl Stories and update README #68007 - block-breadcrumb Add story for BlockBreadCrumb #68000
- block-canvas Storybook: Add BlockCanvas Component #68589
BlockCanvas- 🔒
ExperimentalBlockCanvas
-
block-caption (for native only) -
(Internal) block-card - (Internal)
block-compareStorybook: Add JSDoc and story file for block-compare #68004 - block-content-overlay (Has
__experimentalprefix) - (Internal)
block-contextStorybook: Add Story for BlockContext #68635 - block-controls
BlockControlsBlockFormatControls
- (Internal)
block-draggableStorybook: Add Story for BlockDraggable #68269 - block-edit
- (Internal)
block-edit-visually-button -
block-editing-mode(Reack Hook) - block-full-height-alignment-control (Has
__experimentalprefix) Add Storybook story for BlockFullHeightAlignmentControl #67227 - block-heading-level-dropdown Storybook: Add stories for HeadingLevelDropdown component #67294
- block-icon Add BlockIcon Storybook stories #67186
- (Removed)
block-info-slot-fill - block-inspector Storybook: Add stories for BlockInspector component. #68340
- block-list
- (Internal)
block-list-appender - (Internal)
block-lock -
block-media-update-progress (for native only) - 🔒 block-manager Storybook: Add Story for Block Manager #68634
- block-mover Update BlockMover Stories and README #66519
- (Deprecated)
block-navigation - (Internal)
block-parent-selector - block-pattern-setup (Has
__experimentalprefix) Storybook: Add Story for Block Patterns Setup Component #68516 - block-patterns-list (Has
__experimentalprefix) Storybook: Add Story for Block Patterns List #68777 - (Internal)
block-patterns-pagingStorybook: Add Story for Block Patterns Paging Component #68512 - block-popover
- block-preview Storybook: Adds story for block preview. #68140
- 🔒 block-quick-navigation Storybook: Add Story for Block Quick Navigation Component #68624
- 🔒 block-removal-warning-modal
- (Internal)
block-renameStory Book: Add BlockRenameControl Story #67386 - block-selection-clearer Storybook: Add BlockSelectionClearer story #68473
-
block-settings (for native only) - block-settings-menu StoryBook: Add story for BlockSettingsMenu #68702
BlockSettingsMenu__unstableBlockSettingsMenuFirstItem(Has__unstableprefix)
- block-settings-menu-controls StoryBook: Add story for BlockSettingsMenuControls #68729
- block-styles Storybook: Add Story for Block Styles Component #68638
- (Internal)
block-switcherStorybook: Add Story for Block Switcher #68496 - block-title Storybook: Add stories for BlockTitle Component #67234
- block-toolbar
__unstableBlockToolbarLastItem(Has__unstableprefix)__unstableBlockToolbarLastItem(Has__unstableprefix)
- block-tools Storybook: Add Story for Block Tools #68957
- (Internal)
block-types-listStorybook: Add Story for Block Types List Component #68497 - block-variation-picker (Has
__experimentalprefix) Storybook: Add Story for BlockVariationPicker #68700 - block-variation-transforms (Has
__experimentalprefix) Storybook: Add Story for BlockVariationTransforms #68710 - block-vertical-alignment-control Storybook: Add stories for BlockVerticalAlignmentControl component #68461
BlockVerticalAlignmentToolbarBlockVerticalAlignmentControl
- border-radius-control (Has
__experimentalprefix) Storybook: Add BorderRadiusControl story #67383 - button-block-appender Add index.story.js for button block appender component #68598
-
caption (for native only) - (Internal)
child-layout-control - (Internal)
collab - color-palette Storybook: ColorPaletteControl #67846
ColorPaletteColorPaletteControl
- (Deprecated)
color-style-selectorStorybook: Add Story for Color Style Selector Component #68543 - colors
- colors-gradients (Has
__experimentalprefix) StoryBook: Add story forColorGradientControl#68675__experimentalColorGradientControl__experimentalColorGradientSettingsDropdown__experimentalPanelColorGradientSettings
- (Internal)
content-lock - contrast-checker Storybook: Add stories for the ContrastChecker component #68120
- (Internal)
convert-to-group-buttons - (Deprecated)
copy-handlerStorybook: Add Story for Copy Handler Component #68548 - date-format-picker (Has
__experimentalprefix) Storybook: Add stories for DateFormatPicker Component #67290 - default-block-appender Storybook: Add story for
DefaultBlockAppendercomponent #70601 - 🔒 dimensions-tool
- (Not a component)
duotone - duotone-control (Has
__experimentalprefix) - (Internal)
editable-text - editor-styles (Has
__unstableprefix) StoryBook: Add story for EditorStyles #68739 - (Internal)
floating-toolbarStorybook: Add Story for Floating Toolbar component #68379 - font-appearance-control (Has
__experimentalprefix) Storybook: Adds story for font appearance control. #68279 - font-family (Has
__experimentalprefix) Storybook: Add and Update Block Editor Components stories #67165 - font-sizes Storybook: Add Story for FontSizePicker #68171
- 🔒 global-styles
- gradients
- (Internal)
grid - height-control Add story for HeightControl #68001
- iframe (Has
__unstableprefix) - image-editor (Has
__experimentalprefix) Storybook: Add Image Editor Component #68645 -
image-link-destinations (for native only) - (Deprecated)
image-size-control (HasStorybook: Add stories for ImageSizeControl Component #68285__experimentalprefix) - inner-blocks Storybook: Add Story for InnerBlocks #68651
- inserter
-
_Inserter -
__experimentalLibrary(Has__experimentalprefix) - 🔒
PrivateQuickInserter
-
-
inserter-button (for native only) - (Internal)
inserter-draggable-blocksStorybook: Adds story for inserter-draggable-blocks. #68312 - (Internal)
inserter-list-item - (Internal)
inserter-listbox - inserter-menu-extension (Has
__experimentalprefix) - inspector-controls
InspectorControlsInspectorAdvancedControls
- (Internal)
inspector-controls-tabs - inspector-popover-header (Has
__experimentalprefix) - justify-content-control Storybook: Add JustifyContentControl story #68137
JustifyToolbarJustifyContentControl
- keyboard-shortcuts Storybook: Add Story for KeyboardShortcuts #68459
- letter-spacing-control (Has
__experimentalprefix) Storybook: Add LetterSpacingControl story #67342 - line-height-control Storybook: Refactor line height storybook to CSF3 #68041
- link-control Storybook: Adds story for link-control component #68382
LinkControl- (Deprecated)
__experimentalLinkControl(Has__experimentalprefix) - (Deprecated)
__experimentalLinkControlSearchInput(Has__experimental` prefix) - (Deprecated)
__experimentalLinkControlSearchResults(Has__experimentalprefix) - (Deprecated)
__experimentalLinkControlSearchItem(Has__experimentalprefix)
- list-view
ListView(Has__experimentalprefix)- 🔒
PrivateListView
- media-placeholder Storybook: Add Story for MediaPlaceholder component #68558
- media-replace-flow Storybook: Add Story for MediaReplaceFlow #68571
- media-upload Storybook: Add Story for Media Upload Component #68673
MediaUploadMediaUploadCheck
-
media-upload-progress (for native only) - (Internal)
multi-selection-inspectorStorybook: Add story for Multi-Selection-Inspector component #68308 - navigable-toolbar Storybook: Add Story for NavigableToolbar component #68474
- observe-typing
- panel-color-settings Storybook: Add stories for the panel-color-settings Component #68127
- plain-text Storybook: Add PlainText Storybook stories #67341
- (Deprecated)
preview-options (Has__experimentalprefix) - 🔒 provider
- publish-date-time-picker (Has
__experimentalprefix) Storybook: Adds story for PublishDateTimePicker #68192 - recursion-provider Add index.story.js for recursion provider component #68593
- 🔒 resizable-box-popover
- 🔒 resolution-tool StoryBook: Add Story for ResolutionTool #68292
- responsive-block-control (Has
__experimentalprefix) Storybook: Adds story for responsive block control. #68336 - rich-text
RichTextRichTextShortcutStorybook: Add Story for RichTextShortcut #68717RichTextToolbarButtonStroybook: Add Story for RichTextToolbarButton #68703
- (Deprecated)
selection-scroll-into-view - skip-to-selected-block Storybook: Add Story for SkipToSelectedBlock component #68289
- spacing-sizes-control (Has
__experimentalprefix) Storybook: Adds story for Spacing-sizes-control. #68339 - 🔒 tabbed-sidebar Storybook: Add TabbedSidebar stories and improve docs #68118
- 🔒 text-alignment-control Storybook: Add stories for the TextAlignmentControl component #67371
- text-decoration-control (Has
__experimentalprefix) Storybook: Add stories for the TextDecorationControl component #67337 - text-transform-control (Has
__experimentalprefix) Storybook : Add TextTransformControl stories #67365 - tool-selector Storybook: Add Story for Tool Selector Component #68586
- typewriter Storybook: Add story for Typewriter component #68305
- (Internal)
ungroup-button - unit-control (Has
__experimentalprefix) Storybook: Add UnitControl story #67346 - (Internal)
unsupported-block-details - url-input
- url-popover Storybook: Add Story for URLPopup component #68449
URLPopover__experimentalImageURLInputUI(Has__experimentalprefix)
-
use-block-commands(Reack Hook) -
use-block-display-information(Reack Hook) -
use-block-drop-zone(Reack Hook) -
use-flash-editable-blocks(Reack Hook) -
use-moving-animation(Reack Hook) -
use-on-block-drop(Reack Hook) -
use-paste-styles(Reack Hook) -
use-resize-canvas(Reack Hook) -
use-settings(Reack Hook) -
use-unsupported-block-editor (for native only) -
video-player (for native only) - warning Storybook: Add story for the Warning component #68124
- writing-flow feat: add story for WritingFlow component #70841
- writing-mode-control (Has
__experimentalprefix) Storybook: Add WritingModeControl story #67343