modulor-js / modulor-storybook

3 stars 2 forks source link

Fixes #56

Closed nogizhopaboroda closed 5 years ago

nogizhopaboroda commented 6 years ago

1) seems like path-to-regexp changed compiling or so. In my case routes in freshly-installed storybook sandbox-manager didn't handle parameters (router didn't resolve). this https://github.com/modulor-js/modulor-storybook/compare/fixes?expand=1#diff-2b6c10a00f0514c18d858be9e646d256R122 seems to fix it

2) In some cases it's nice to be able to set up default view params (preview height/width, disabling plugins/stories tree/filtering/etc). For example i'm currently making examples in modulor-html as stories and i'd like decrease default preview height.

proposed usage:

//additional.js

import AddonsApi from 'modulor-storybook/addons';

AddonsApi.setDefaultViewParams({ height: 35 });

I put it in AddonsApi, though it might make sense to split it out as a separate module, like config. What do you guys think?

nogizhopaboroda commented 6 years ago

@pankajpatel @nvignola could you please check?

pankajpatel commented 6 years ago

Yeah, I would also go with separate config rather than AddonsApi

nogizhopaboroda commented 6 years ago

Updated pr. Now usage is:

//additional.js
import { setDefaultParams } from 'modulor-storybook/js/config';

setDefaultParams({ height: 35 });