Skip to content

Commit

Permalink
Merge pull request #74 from Automattic/storybook/iso-editor
Browse files Browse the repository at this point in the history
Storybook: Add stories for IsolatedBlockEditor
  • Loading branch information
mirka authored Oct 4, 2021
2 parents 3734d6e + a19aa0c commit c08c772
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions stories/IsolatedBlockEditor.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Internal dependencies
*/
import IsolatedBlockEditor, { DocumentSection } from '../src/index';

export default {
title: 'Isolated Block Editor',
component: IsolatedBlockEditor,
};

export const Default = () => {
return <IsolatedBlockEditor settings={ {} } />;
};

export const ToolbarSettings = ( toolbarSettings ) => {
return (
<IsolatedBlockEditor settings={ { iso: { toolbar: toolbarSettings } } }>
<DocumentSection>Arbitrary content can go here.</DocumentSection>
</IsolatedBlockEditor>
);
};
ToolbarSettings.args = {
inserter: true,
inspector: true,
navigation: true,
toc: true,
documentInspector: 'Document',
};

export const MoreMenu = ( moreMenuSettings ) => {
return <IsolatedBlockEditor settings={ { iso: { moreMenu: moreMenuSettings, toolbar: { inspector: true } } } } />;
};
MoreMenu.args = {
editor: true,
fullscreen: true,
preview: true,
topToolbar: true,
};

export const MultipleEditors = ( { count } ) => {
const arr = Array( count ).fill( null );
return (
<>
{ arr.map( ( _, idx ) => (
<div style={ { marginBottom: 16 } } key={ idx }>
<IsolatedBlockEditor settings={ {} } />
</div>
) ) }
</>
);
};
MultipleEditors.args = { count: 2 };

0 comments on commit c08c772

Please sign in to comment.