Node's Pretty Magical

    @foxpage/foxpage-component-editor-storybook-addon
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.18 • Public • Published

    Config

    register in .storybook/addon.ts

    import '@foxpage/foxpage-component-editor-storybook-addon/lib/register';
    

    Useage

    in your *.stories.js file:

    // import addon
    import { withFoxpageEditor, mountEditor } from '@foxpage/foxpage-component-editor-storybook-addon';
    
    // import component and editor
    import Component from '../src/index';
    import Editor from '../editor/index';
    
    // init stories
    const stories = storiesOf('Use foxpage-editor-addon', module);
    stories.addDecorator(withFoxpageEditor);
    
    stories.add('editable story', () => {
      // mount edit with props
      const props = mountEditor(Editor, {
        promoId: 593,
        blockId: 1,
      });
    
      // use props
      return <Component {...props} />
    });
    
    

    Install

    npm i @foxpage/foxpage-component-editor-storybook-addon

    DownloadsWeekly Downloads

    141

    Version

    0.3.18

    License

    MIT

    Unpacked Size

    23.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • songzinpm
    • sqjing
    • yhdeng
    • xdrxdr
    • wangyilong
    • melody-yangjie