@vitus-labs/rocketstories 0.44.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/analysis/vitus-labs-rocketstories.js.html +1 -1
- package/lib/analysis/vitus-labs-rocketstories.module.js.html +1 -1
- package/lib/analysis/vitus-labs-rocketstories.umd.js.html +1 -1
- package/lib/index.d.ts +44 -20
- package/lib/types/index.d.ts +3 -1
- package/lib/types/rocketstories.d.ts +5 -6
- package/lib/types/stories/dimension.d.ts +4 -4
- package/lib/types/stories/main.d.ts +2 -4
- package/lib/types/types.d.ts +7 -7
- package/lib/vitus-labs-rocketstories.js +19 -25
- package/lib/vitus-labs-rocketstories.js.map +1 -1
- package/lib/vitus-labs-rocketstories.module.js +19 -25
- package/lib/vitus-labs-rocketstories.module.js.map +1 -1
- package/lib/vitus-labs-rocketstories.umd.js +19 -25
- package/lib/vitus-labs-rocketstories.umd.js.map +1 -1
- package/package.json +10 -10
|
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
|
|
|
6424
6424
|
</script>
|
|
6425
6425
|
<script>
|
|
6426
6426
|
/*<!--*/
|
|
6427
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstories.js","children":[{"name":"Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","uid":"
|
|
6427
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstories.js","children":[{"name":"Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","uid":"453d-1"},{"name":"src","children":[{"name":"components/NotFound.tsx","uid":"453d-3"},{"name":"utils","children":[{"uid":"453d-5","name":"theme.ts"},{"uid":"453d-7","name":"code.ts"},{"name":"controls","children":[{"uid":"453d-11","name":"attrs.ts"},{"uid":"453d-13","name":"dimensionToControls.ts"},{"uid":"453d-15","name":"disableControls.ts"},{"uid":"453d-17","name":"filterDefaultValues.ts"},{"uid":"453d-19","name":"constants.ts"},{"uid":"453d-21","name":"makeControls.ts"},{"uid":"453d-33","name":"valuesToControls.ts"}]},{"uid":"453d-37","name":"dimensions.ts"}]},{"name":"constants/controls.ts","uid":"453d-9"},{"name":"controls","children":[{"uid":"453d-23","name":"element.ts"},{"uid":"453d-25","name":"list.ts"},{"uid":"453d-27","name":"overlay.ts"},{"uid":"453d-29","name":"rocketstyle.ts"},{"uid":"453d-31","name":"text.ts"}]},{"name":"stories","children":[{"uid":"453d-35","name":"dimension.tsx"},{"uid":"453d-39","name":"main.tsx"},{"uid":"453d-41","name":"story.tsx"}]},{"uid":"453d-43","name":"rocketstories.tsx"},{"uid":"453d-45","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"453d-1":{"renderedLength":634,"gzipLength":340,"brotliLength":0,"mainUid":"453d-0"},"453d-3":{"renderedLength":236,"gzipLength":202,"brotliLength":0,"mainUid":"453d-2"},"453d-5":{"renderedLength":113,"gzipLength":129,"brotliLength":0,"mainUid":"453d-4"},"453d-7":{"renderedLength":5174,"gzipLength":1167,"brotliLength":0,"mainUid":"453d-6"},"453d-9":{"renderedLength":246,"gzipLength":141,"brotliLength":0,"mainUid":"453d-8"},"453d-11":{"renderedLength":480,"gzipLength":264,"brotliLength":0,"mainUid":"453d-10"},"453d-13":{"renderedLength":454,"gzipLength":254,"brotliLength":0,"mainUid":"453d-12"},"453d-15":{"renderedLength":545,"gzipLength":275,"brotliLength":0,"mainUid":"453d-14"},"453d-17":{"renderedLength":220,"gzipLength":170,"brotliLength":0,"mainUid":"453d-16"},"453d-19":{"renderedLength":685,"gzipLength":291,"brotliLength":0,"mainUid":"453d-18"},"453d-21":{"renderedLength":556,"gzipLength":282,"brotliLength":0,"mainUid":"453d-20"},"453d-23":{"renderedLength":5519,"gzipLength":1015,"brotliLength":0,"mainUid":"453d-22"},"453d-25":{"renderedLength":1731,"gzipLength":525,"brotliLength":0,"mainUid":"453d-24"},"453d-27":{"renderedLength":2567,"gzipLength":578,"brotliLength":0,"mainUid":"453d-26"},"453d-29":{"renderedLength":687,"gzipLength":158,"brotliLength":0,"mainUid":"453d-28"},"453d-31":{"renderedLength":408,"gzipLength":154,"brotliLength":0,"mainUid":"453d-30"},"453d-33":{"renderedLength":2532,"gzipLength":726,"brotliLength":0,"mainUid":"453d-32"},"453d-35":{"renderedLength":5631,"gzipLength":1279,"brotliLength":0,"mainUid":"453d-34"},"453d-37":{"renderedLength":339,"gzipLength":238,"brotliLength":0,"mainUid":"453d-36"},"453d-39":{"renderedLength":2625,"gzipLength":730,"brotliLength":0,"mainUid":"453d-38"},"453d-41":{"renderedLength":588,"gzipLength":256,"brotliLength":0,"mainUid":"453d-40"},"453d-43":{"renderedLength":2945,"gzipLength":647,"brotliLength":0,"mainUid":"453d-42"},"453d-45":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"453d-44"}},"nodeMetas":{"453d-0":{"id":"/Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","moduleParts":{"vitus-labs-rocketstories.js":"453d-1"},"imported":[{"uid":"453d-46"},{"uid":"453d-48"},{"uid":"453d-49"}],"importedBy":[{"uid":"453d-42"}]},"453d-2":{"id":"/src/components/NotFound.tsx","moduleParts":{"vitus-labs-rocketstories.js":"453d-3"},"imported":[{"uid":"453d-48"},{"uid":"453d-46"}],"importedBy":[{"uid":"453d-34"}]},"453d-4":{"id":"/src/utils/theme.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-5"},"imported":[],"importedBy":[{"uid":"453d-34"},{"uid":"453d-38"}]},"453d-6":{"id":"/src/utils/code.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-7"},"imported":[{"uid":"453d-46"}],"importedBy":[{"uid":"453d-34"},{"uid":"453d-38"}]},"453d-8":{"id":"/src/constants/controls.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-9"},"imported":[],"importedBy":[{"uid":"453d-10"},{"uid":"453d-18"}]},"453d-10":{"id":"/src/utils/controls/attrs.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-11"},"imported":[{"uid":"453d-46"},{"uid":"453d-8"}],"importedBy":[{"uid":"453d-51"}]},"453d-12":{"id":"/src/utils/controls/dimensionToControls.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-13"},"imported":[],"importedBy":[{"uid":"453d-51"}]},"453d-14":{"id":"/src/utils/controls/disableControls.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-15"},"imported":[],"importedBy":[{"uid":"453d-51"}]},"453d-16":{"id":"/src/utils/controls/filterDefaultValues.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-17"},"imported":[{"uid":"453d-46"}],"importedBy":[{"uid":"453d-40"},{"uid":"453d-51"}]},"453d-18":{"id":"/src/utils/controls/constants.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-19"},"imported":[{"uid":"453d-46"},{"uid":"453d-8"}],"importedBy":[{"uid":"453d-20"}]},"453d-20":{"id":"/src/utils/controls/makeControls.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-21"},"imported":[{"uid":"453d-18"}],"importedBy":[{"uid":"453d-51"}]},"453d-22":{"id":"/src/controls/element.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-23"},"imported":[{"uid":"453d-46"}],"importedBy":[{"uid":"453d-52"}]},"453d-24":{"id":"/src/controls/list.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-25"},"imported":[],"importedBy":[{"uid":"453d-52"}]},"453d-26":{"id":"/src/controls/overlay.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-27"},"imported":[],"importedBy":[{"uid":"453d-52"}]},"453d-28":{"id":"/src/controls/rocketstyle.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-29"},"imported":[],"importedBy":[{"uid":"453d-52"}]},"453d-30":{"id":"/src/controls/text.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-31"},"imported":[{"uid":"453d-46"}],"importedBy":[{"uid":"453d-52"}]},"453d-32":{"id":"/src/utils/controls/valuesToControls.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-33"},"imported":[{"uid":"453d-52"}],"importedBy":[{"uid":"453d-51"}]},"453d-34":{"id":"/src/stories/dimension.tsx","moduleParts":{"vitus-labs-rocketstories.js":"453d-35"},"imported":[{"uid":"453d-48"},{"uid":"453d-46"},{"uid":"453d-50"},{"uid":"453d-2"},{"uid":"453d-4"},{"uid":"453d-6"},{"uid":"453d-51"}],"importedBy":[{"uid":"453d-47"}]},"453d-36":{"id":"/src/utils/dimensions.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-37"},"imported":[],"importedBy":[{"uid":"453d-38"}]},"453d-38":{"id":"/src/stories/main.tsx","moduleParts":{"vitus-labs-rocketstories.js":"453d-39"},"imported":[{"uid":"453d-48"},{"uid":"453d-46"},{"uid":"453d-4"},{"uid":"453d-6"},{"uid":"453d-36"},{"uid":"453d-51"}],"importedBy":[{"uid":"453d-47"}]},"453d-40":{"id":"/src/stories/story.tsx","moduleParts":{"vitus-labs-rocketstories.js":"453d-41"},"imported":[{"uid":"453d-48"},{"uid":"453d-51"},{"uid":"453d-16"}],"importedBy":[{"uid":"453d-47"}]},"453d-42":{"id":"/src/rocketstories.tsx","moduleParts":{"vitus-labs-rocketstories.js":"453d-43"},"imported":[{"uid":"453d-46"},{"uid":"453d-0"},{"uid":"453d-47"}],"importedBy":[{"uid":"453d-44"}]},"453d-44":{"id":"/src/index.ts","moduleParts":{"vitus-labs-rocketstories.js":"453d-45"},"imported":[{"uid":"453d-42"}],"importedBy":[],"isEntry":true},"453d-46":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-42"},{"uid":"453d-0"},{"uid":"453d-34"},{"uid":"453d-38"},{"uid":"453d-2"},{"uid":"453d-6"},{"uid":"453d-16"},{"uid":"453d-10"},{"uid":"453d-18"},{"uid":"453d-22"},{"uid":"453d-30"}],"isExternal":true},"453d-47":{"id":"/src/stories/index.ts","moduleParts":{},"imported":[{"uid":"453d-34"},{"uid":"453d-38"},{"uid":"453d-40"}],"importedBy":[{"uid":"453d-42"}]},"453d-48":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-0"},{"uid":"453d-34"},{"uid":"453d-38"},{"uid":"453d-40"},{"uid":"453d-2"}],"isExternal":true},"453d-49":{"id":"hoist-non-react-statics","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-0"}],"isExternal":true},"453d-50":{"id":"@vitus-labs/elements","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-34"}],"isExternal":true},"453d-51":{"id":"/src/utils/controls/index.ts","moduleParts":{},"imported":[{"uid":"453d-10"},{"uid":"453d-12"},{"uid":"453d-14"},{"uid":"453d-16"},{"uid":"453d-20"},{"uid":"453d-32"}],"importedBy":[{"uid":"453d-34"},{"uid":"453d-38"},{"uid":"453d-40"}]},"453d-52":{"id":"/src/controls/index.ts","moduleParts":{},"imported":[{"uid":"453d-22"},{"uid":"453d-24"},{"uid":"453d-26"},{"uid":"453d-28"},{"uid":"453d-30"}],"importedBy":[{"uid":"453d-32"}]}},"env":{"rollup":"2.70.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
6428
6428
|
|
|
6429
6429
|
const run = () => {
|
|
6430
6430
|
const width = window.innerWidth;
|
|
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
|
|
|
6424
6424
|
</script>
|
|
6425
6425
|
<script>
|
|
6426
6426
|
/*<!--*/
|
|
6427
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstories.module.js","children":[{"name":"Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","uid":"
|
|
6427
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstories.module.js","children":[{"name":"Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","uid":"453d-54"},{"name":"src","children":[{"name":"components/NotFound.tsx","uid":"453d-56"},{"name":"utils","children":[{"uid":"453d-58","name":"theme.ts"},{"uid":"453d-60","name":"code.ts"},{"name":"controls","children":[{"uid":"453d-64","name":"attrs.ts"},{"uid":"453d-66","name":"dimensionToControls.ts"},{"uid":"453d-68","name":"disableControls.ts"},{"uid":"453d-70","name":"filterDefaultValues.ts"},{"uid":"453d-72","name":"constants.ts"},{"uid":"453d-74","name":"makeControls.ts"},{"uid":"453d-86","name":"valuesToControls.ts"}]},{"uid":"453d-90","name":"dimensions.ts"}]},{"name":"constants/controls.ts","uid":"453d-62"},{"name":"controls","children":[{"uid":"453d-76","name":"element.ts"},{"uid":"453d-78","name":"list.ts"},{"uid":"453d-80","name":"overlay.ts"},{"uid":"453d-82","name":"rocketstyle.ts"},{"uid":"453d-84","name":"text.ts"}]},{"name":"stories","children":[{"uid":"453d-88","name":"dimension.tsx"},{"uid":"453d-92","name":"main.tsx"},{"uid":"453d-94","name":"story.tsx"}]},{"uid":"453d-96","name":"rocketstories.tsx"},{"uid":"453d-98","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"453d-54":{"renderedLength":628,"gzipLength":336,"brotliLength":0,"mainUid":"453d-53"},"453d-56":{"renderedLength":211,"gzipLength":183,"brotliLength":0,"mainUid":"453d-55"},"453d-58":{"renderedLength":113,"gzipLength":129,"brotliLength":0,"mainUid":"453d-57"},"453d-60":{"renderedLength":5159,"gzipLength":1163,"brotliLength":0,"mainUid":"453d-59"},"453d-62":{"renderedLength":246,"gzipLength":141,"brotliLength":0,"mainUid":"453d-61"},"453d-64":{"renderedLength":475,"gzipLength":261,"brotliLength":0,"mainUid":"453d-63"},"453d-66":{"renderedLength":454,"gzipLength":254,"brotliLength":0,"mainUid":"453d-65"},"453d-68":{"renderedLength":545,"gzipLength":275,"brotliLength":0,"mainUid":"453d-67"},"453d-70":{"renderedLength":215,"gzipLength":167,"brotliLength":0,"mainUid":"453d-69"},"453d-72":{"renderedLength":680,"gzipLength":286,"brotliLength":0,"mainUid":"453d-71"},"453d-74":{"renderedLength":556,"gzipLength":282,"brotliLength":0,"mainUid":"453d-73"},"453d-76":{"renderedLength":5514,"gzipLength":1011,"brotliLength":0,"mainUid":"453d-75"},"453d-78":{"renderedLength":1731,"gzipLength":525,"brotliLength":0,"mainUid":"453d-77"},"453d-80":{"renderedLength":2567,"gzipLength":578,"brotliLength":0,"mainUid":"453d-79"},"453d-82":{"renderedLength":687,"gzipLength":158,"brotliLength":0,"mainUid":"453d-81"},"453d-84":{"renderedLength":403,"gzipLength":149,"brotliLength":0,"mainUid":"453d-83"},"453d-86":{"renderedLength":2532,"gzipLength":726,"brotliLength":0,"mainUid":"453d-85"},"453d-88":{"renderedLength":5315,"gzipLength":1251,"brotliLength":0,"mainUid":"453d-87"},"453d-90":{"renderedLength":339,"gzipLength":238,"brotliLength":0,"mainUid":"453d-89"},"453d-92":{"renderedLength":2574,"gzipLength":713,"brotliLength":0,"mainUid":"453d-91"},"453d-94":{"renderedLength":582,"gzipLength":251,"brotliLength":0,"mainUid":"453d-93"},"453d-96":{"renderedLength":2925,"gzipLength":643,"brotliLength":0,"mainUid":"453d-95"},"453d-98":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"453d-97"}},"nodeMetas":{"453d-53":{"id":"/Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-54"},"imported":[{"uid":"453d-99"},{"uid":"453d-101"},{"uid":"453d-102"}],"importedBy":[{"uid":"453d-95"}]},"453d-55":{"id":"/src/components/NotFound.tsx","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-56"},"imported":[{"uid":"453d-101"},{"uid":"453d-99"}],"importedBy":[{"uid":"453d-87"}]},"453d-57":{"id":"/src/utils/theme.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-58"},"imported":[],"importedBy":[{"uid":"453d-87"},{"uid":"453d-91"}]},"453d-59":{"id":"/src/utils/code.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-60"},"imported":[{"uid":"453d-99"}],"importedBy":[{"uid":"453d-87"},{"uid":"453d-91"}]},"453d-61":{"id":"/src/constants/controls.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-62"},"imported":[],"importedBy":[{"uid":"453d-63"},{"uid":"453d-71"}]},"453d-63":{"id":"/src/utils/controls/attrs.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-64"},"imported":[{"uid":"453d-99"},{"uid":"453d-61"}],"importedBy":[{"uid":"453d-104"}]},"453d-65":{"id":"/src/utils/controls/dimensionToControls.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-66"},"imported":[],"importedBy":[{"uid":"453d-104"}]},"453d-67":{"id":"/src/utils/controls/disableControls.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-68"},"imported":[],"importedBy":[{"uid":"453d-104"}]},"453d-69":{"id":"/src/utils/controls/filterDefaultValues.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-70"},"imported":[{"uid":"453d-99"}],"importedBy":[{"uid":"453d-93"},{"uid":"453d-104"}]},"453d-71":{"id":"/src/utils/controls/constants.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-72"},"imported":[{"uid":"453d-99"},{"uid":"453d-61"}],"importedBy":[{"uid":"453d-73"}]},"453d-73":{"id":"/src/utils/controls/makeControls.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-74"},"imported":[{"uid":"453d-71"}],"importedBy":[{"uid":"453d-104"}]},"453d-75":{"id":"/src/controls/element.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-76"},"imported":[{"uid":"453d-99"}],"importedBy":[{"uid":"453d-105"}]},"453d-77":{"id":"/src/controls/list.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-78"},"imported":[],"importedBy":[{"uid":"453d-105"}]},"453d-79":{"id":"/src/controls/overlay.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-80"},"imported":[],"importedBy":[{"uid":"453d-105"}]},"453d-81":{"id":"/src/controls/rocketstyle.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-82"},"imported":[],"importedBy":[{"uid":"453d-105"}]},"453d-83":{"id":"/src/controls/text.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-84"},"imported":[{"uid":"453d-99"}],"importedBy":[{"uid":"453d-105"}]},"453d-85":{"id":"/src/utils/controls/valuesToControls.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-86"},"imported":[{"uid":"453d-105"}],"importedBy":[{"uid":"453d-104"}]},"453d-87":{"id":"/src/stories/dimension.tsx","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-88"},"imported":[{"uid":"453d-101"},{"uid":"453d-99"},{"uid":"453d-103"},{"uid":"453d-55"},{"uid":"453d-57"},{"uid":"453d-59"},{"uid":"453d-104"}],"importedBy":[{"uid":"453d-100"}]},"453d-89":{"id":"/src/utils/dimensions.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-90"},"imported":[],"importedBy":[{"uid":"453d-91"}]},"453d-91":{"id":"/src/stories/main.tsx","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-92"},"imported":[{"uid":"453d-101"},{"uid":"453d-99"},{"uid":"453d-57"},{"uid":"453d-59"},{"uid":"453d-89"},{"uid":"453d-104"}],"importedBy":[{"uid":"453d-100"}]},"453d-93":{"id":"/src/stories/story.tsx","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-94"},"imported":[{"uid":"453d-101"},{"uid":"453d-104"},{"uid":"453d-69"}],"importedBy":[{"uid":"453d-100"}]},"453d-95":{"id":"/src/rocketstories.tsx","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-96"},"imported":[{"uid":"453d-99"},{"uid":"453d-53"},{"uid":"453d-100"}],"importedBy":[{"uid":"453d-97"}]},"453d-97":{"id":"/src/index.ts","moduleParts":{"vitus-labs-rocketstories.module.js":"453d-98"},"imported":[{"uid":"453d-95"}],"importedBy":[],"isEntry":true},"453d-99":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-95"},{"uid":"453d-53"},{"uid":"453d-87"},{"uid":"453d-91"},{"uid":"453d-55"},{"uid":"453d-59"},{"uid":"453d-69"},{"uid":"453d-63"},{"uid":"453d-71"},{"uid":"453d-75"},{"uid":"453d-83"}],"isExternal":true},"453d-100":{"id":"/src/stories/index.ts","moduleParts":{},"imported":[{"uid":"453d-87"},{"uid":"453d-91"},{"uid":"453d-93"}],"importedBy":[{"uid":"453d-95"}]},"453d-101":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-53"},{"uid":"453d-87"},{"uid":"453d-91"},{"uid":"453d-93"},{"uid":"453d-55"}],"isExternal":true},"453d-102":{"id":"hoist-non-react-statics","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-53"}],"isExternal":true},"453d-103":{"id":"@vitus-labs/elements","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-87"}],"isExternal":true},"453d-104":{"id":"/src/utils/controls/index.ts","moduleParts":{},"imported":[{"uid":"453d-63"},{"uid":"453d-65"},{"uid":"453d-67"},{"uid":"453d-69"},{"uid":"453d-73"},{"uid":"453d-85"}],"importedBy":[{"uid":"453d-87"},{"uid":"453d-91"},{"uid":"453d-93"}]},"453d-105":{"id":"/src/controls/index.ts","moduleParts":{},"imported":[{"uid":"453d-75"},{"uid":"453d-77"},{"uid":"453d-79"},{"uid":"453d-81"},{"uid":"453d-83"}],"importedBy":[{"uid":"453d-85"}]}},"env":{"rollup":"2.70.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
6428
6428
|
|
|
6429
6429
|
const run = () => {
|
|
6430
6430
|
const width = window.innerWidth;
|
|
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
|
|
|
6424
6424
|
</script>
|
|
6425
6425
|
<script>
|
|
6426
6426
|
/*<!--*/
|
|
6427
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstories.umd.js","children":[{"name":"Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","uid":"
|
|
6427
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstories.umd.js","children":[{"name":"Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","uid":"453d-107"},{"name":"src","children":[{"name":"components/NotFound.tsx","uid":"453d-109"},{"name":"utils","children":[{"uid":"453d-111","name":"theme.ts"},{"uid":"453d-113","name":"code.ts"},{"name":"controls","children":[{"uid":"453d-117","name":"attrs.ts"},{"uid":"453d-119","name":"dimensionToControls.ts"},{"uid":"453d-121","name":"disableControls.ts"},{"uid":"453d-123","name":"filterDefaultValues.ts"},{"uid":"453d-125","name":"constants.ts"},{"uid":"453d-127","name":"makeControls.ts"},{"uid":"453d-139","name":"valuesToControls.ts"}]},{"uid":"453d-143","name":"dimensions.ts"}]},{"name":"constants/controls.ts","uid":"453d-115"},{"name":"controls","children":[{"uid":"453d-129","name":"element.ts"},{"uid":"453d-131","name":"list.ts"},{"uid":"453d-133","name":"overlay.ts"},{"uid":"453d-135","name":"rocketstyle.ts"},{"uid":"453d-137","name":"text.ts"}]},{"name":"stories","children":[{"uid":"453d-141","name":"dimension.tsx"},{"uid":"453d-145","name":"main.tsx"},{"uid":"453d-147","name":"story.tsx"}]},{"uid":"453d-149","name":"rocketstories.tsx"},{"uid":"453d-151","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"453d-107":{"renderedLength":754,"gzipLength":348,"brotliLength":0,"mainUid":"453d-106"},"453d-109":{"renderedLength":248,"gzipLength":203,"brotliLength":0,"mainUid":"453d-108"},"453d-111":{"renderedLength":121,"gzipLength":132,"brotliLength":0,"mainUid":"453d-110"},"453d-113":{"renderedLength":5790,"gzipLength":1189,"brotliLength":0,"mainUid":"453d-112"},"453d-115":{"renderedLength":310,"gzipLength":147,"brotliLength":0,"mainUid":"453d-114"},"453d-117":{"renderedLength":532,"gzipLength":271,"brotliLength":0,"mainUid":"453d-116"},"453d-119":{"renderedLength":498,"gzipLength":257,"brotliLength":0,"mainUid":"453d-118"},"453d-121":{"renderedLength":601,"gzipLength":276,"brotliLength":0,"mainUid":"453d-120"},"453d-123":{"renderedLength":244,"gzipLength":171,"brotliLength":0,"mainUid":"453d-122"},"453d-125":{"renderedLength":793,"gzipLength":296,"brotliLength":0,"mainUid":"453d-124"},"453d-127":{"renderedLength":620,"gzipLength":286,"brotliLength":0,"mainUid":"453d-126"},"453d-129":{"renderedLength":6155,"gzipLength":1029,"brotliLength":0,"mainUid":"453d-128"},"453d-131":{"renderedLength":1935,"gzipLength":531,"brotliLength":0,"mainUid":"453d-130"},"453d-133":{"renderedLength":2943,"gzipLength":588,"brotliLength":0,"mainUid":"453d-132"},"453d-135":{"renderedLength":831,"gzipLength":164,"brotliLength":0,"mainUid":"453d-134"},"453d-137":{"renderedLength":500,"gzipLength":157,"brotliLength":0,"mainUid":"453d-136"},"453d-139":{"renderedLength":2832,"gzipLength":736,"brotliLength":0,"mainUid":"453d-138"},"453d-141":{"renderedLength":6079,"gzipLength":1291,"brotliLength":0,"mainUid":"453d-140"},"453d-143":{"renderedLength":371,"gzipLength":242,"brotliLength":0,"mainUid":"453d-142"},"453d-145":{"renderedLength":2869,"gzipLength":740,"brotliLength":0,"mainUid":"453d-144"},"453d-147":{"renderedLength":660,"gzipLength":260,"brotliLength":0,"mainUid":"453d-146"},"453d-149":{"renderedLength":3261,"gzipLength":652,"brotliLength":0,"mainUid":"453d-148"},"453d-151":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"453d-150"}},"nodeMetas":{"453d-106":{"id":"/Users/vitbokisch/Dev/vitus-labs/ui-system/packages/rocketstyle/lib/vitus-labs-rocketstyle.module.js","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-107"},"imported":[{"uid":"453d-152"},{"uid":"453d-154"},{"uid":"453d-155"}],"importedBy":[{"uid":"453d-148"}]},"453d-108":{"id":"/src/components/NotFound.tsx","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-109"},"imported":[{"uid":"453d-154"},{"uid":"453d-152"}],"importedBy":[{"uid":"453d-140"}]},"453d-110":{"id":"/src/utils/theme.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-111"},"imported":[],"importedBy":[{"uid":"453d-140"},{"uid":"453d-144"}]},"453d-112":{"id":"/src/utils/code.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-113"},"imported":[{"uid":"453d-152"}],"importedBy":[{"uid":"453d-140"},{"uid":"453d-144"}]},"453d-114":{"id":"/src/constants/controls.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-115"},"imported":[],"importedBy":[{"uid":"453d-116"},{"uid":"453d-124"}]},"453d-116":{"id":"/src/utils/controls/attrs.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-117"},"imported":[{"uid":"453d-152"},{"uid":"453d-114"}],"importedBy":[{"uid":"453d-157"}]},"453d-118":{"id":"/src/utils/controls/dimensionToControls.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-119"},"imported":[],"importedBy":[{"uid":"453d-157"}]},"453d-120":{"id":"/src/utils/controls/disableControls.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-121"},"imported":[],"importedBy":[{"uid":"453d-157"}]},"453d-122":{"id":"/src/utils/controls/filterDefaultValues.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-123"},"imported":[{"uid":"453d-152"}],"importedBy":[{"uid":"453d-146"},{"uid":"453d-157"}]},"453d-124":{"id":"/src/utils/controls/constants.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-125"},"imported":[{"uid":"453d-152"},{"uid":"453d-114"}],"importedBy":[{"uid":"453d-126"}]},"453d-126":{"id":"/src/utils/controls/makeControls.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-127"},"imported":[{"uid":"453d-124"}],"importedBy":[{"uid":"453d-157"}]},"453d-128":{"id":"/src/controls/element.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-129"},"imported":[{"uid":"453d-152"}],"importedBy":[{"uid":"453d-158"}]},"453d-130":{"id":"/src/controls/list.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-131"},"imported":[],"importedBy":[{"uid":"453d-158"}]},"453d-132":{"id":"/src/controls/overlay.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-133"},"imported":[],"importedBy":[{"uid":"453d-158"}]},"453d-134":{"id":"/src/controls/rocketstyle.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-135"},"imported":[],"importedBy":[{"uid":"453d-158"}]},"453d-136":{"id":"/src/controls/text.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-137"},"imported":[{"uid":"453d-152"}],"importedBy":[{"uid":"453d-158"}]},"453d-138":{"id":"/src/utils/controls/valuesToControls.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-139"},"imported":[{"uid":"453d-158"}],"importedBy":[{"uid":"453d-157"}]},"453d-140":{"id":"/src/stories/dimension.tsx","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-141"},"imported":[{"uid":"453d-154"},{"uid":"453d-152"},{"uid":"453d-156"},{"uid":"453d-108"},{"uid":"453d-110"},{"uid":"453d-112"},{"uid":"453d-157"}],"importedBy":[{"uid":"453d-153"}]},"453d-142":{"id":"/src/utils/dimensions.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-143"},"imported":[],"importedBy":[{"uid":"453d-144"}]},"453d-144":{"id":"/src/stories/main.tsx","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-145"},"imported":[{"uid":"453d-154"},{"uid":"453d-152"},{"uid":"453d-110"},{"uid":"453d-112"},{"uid":"453d-142"},{"uid":"453d-157"}],"importedBy":[{"uid":"453d-153"}]},"453d-146":{"id":"/src/stories/story.tsx","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-147"},"imported":[{"uid":"453d-154"},{"uid":"453d-157"},{"uid":"453d-122"}],"importedBy":[{"uid":"453d-153"}]},"453d-148":{"id":"/src/rocketstories.tsx","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-149"},"imported":[{"uid":"453d-152"},{"uid":"453d-106"},{"uid":"453d-153"}],"importedBy":[{"uid":"453d-150"}]},"453d-150":{"id":"/src/index.ts","moduleParts":{"vitus-labs-rocketstories.umd.js":"453d-151"},"imported":[{"uid":"453d-148"}],"importedBy":[],"isEntry":true},"453d-152":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-148"},{"uid":"453d-106"},{"uid":"453d-140"},{"uid":"453d-144"},{"uid":"453d-108"},{"uid":"453d-112"},{"uid":"453d-122"},{"uid":"453d-116"},{"uid":"453d-124"},{"uid":"453d-128"},{"uid":"453d-136"}],"isExternal":true},"453d-153":{"id":"/src/stories/index.ts","moduleParts":{},"imported":[{"uid":"453d-140"},{"uid":"453d-144"},{"uid":"453d-146"}],"importedBy":[{"uid":"453d-148"}]},"453d-154":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-106"},{"uid":"453d-140"},{"uid":"453d-144"},{"uid":"453d-146"},{"uid":"453d-108"}],"isExternal":true},"453d-155":{"id":"hoist-non-react-statics","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-106"}],"isExternal":true},"453d-156":{"id":"@vitus-labs/elements","moduleParts":{},"imported":[],"importedBy":[{"uid":"453d-140"}],"isExternal":true},"453d-157":{"id":"/src/utils/controls/index.ts","moduleParts":{},"imported":[{"uid":"453d-116"},{"uid":"453d-118"},{"uid":"453d-120"},{"uid":"453d-122"},{"uid":"453d-126"},{"uid":"453d-138"}],"importedBy":[{"uid":"453d-140"},{"uid":"453d-144"},{"uid":"453d-146"}]},"453d-158":{"id":"/src/controls/index.ts","moduleParts":{},"imported":[{"uid":"453d-128"},{"uid":"453d-130"},{"uid":"453d-132"},{"uid":"453d-134"},{"uid":"453d-136"}],"importedBy":[{"uid":"453d-138"}]}},"env":{"rollup":"2.70.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
6428
6428
|
|
|
6429
6429
|
const run = () => {
|
|
6430
6430
|
const width = window.innerWidth;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RocketComponentType } from '@vitus-labs/rocketstyle';
|
|
2
|
+
import { ComponentType, VFC } from 'react';
|
|
2
3
|
|
|
3
4
|
declare const CONTROL_TYPES: readonly ["tag", "text", "number", "range", "boolean", "color", "select", "multi-select", "object", "array", "radio", "inline-radio", "check", "inline-check"];
|
|
4
5
|
declare type T_CONTROL_TYPES = typeof CONTROL_TYPES[number];
|
|
@@ -10,14 +11,37 @@ declare type StoryComponent = VFC<any> & {
|
|
|
10
11
|
parameters: any;
|
|
11
12
|
};
|
|
12
13
|
declare type Element = ComponentType;
|
|
13
|
-
declare type RocketComponent =
|
|
14
|
-
IS_ROCKETSTYLE: true;
|
|
15
|
-
$$rocketstyle: Record<string, any>;
|
|
14
|
+
declare type RocketComponent = RocketComponentType & {
|
|
16
15
|
VITUS_LABS__COMPONENT?: string;
|
|
17
16
|
getStaticDimensions: any;
|
|
18
17
|
getDefaultAttrs: any;
|
|
19
18
|
displayName?: string;
|
|
20
19
|
};
|
|
20
|
+
declare type ControlTypes = T_CONTROL_TYPES;
|
|
21
|
+
declare type Control = {
|
|
22
|
+
type: T_CONTROL_TYPES;
|
|
23
|
+
value?: any;
|
|
24
|
+
valueType?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
group?: string;
|
|
27
|
+
options?: any[];
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
};
|
|
30
|
+
declare type StorybookControl = {
|
|
31
|
+
control: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
defaultValue?: any;
|
|
35
|
+
description?: string;
|
|
36
|
+
options?: any[];
|
|
37
|
+
table: {
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
category?: string;
|
|
40
|
+
type: {
|
|
41
|
+
summary?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
21
45
|
declare type AttrItemControl<T> = {
|
|
22
46
|
type: T_CONTROL_TYPES;
|
|
23
47
|
value?: T;
|
|
@@ -30,10 +54,11 @@ declare type AttrsTypes<P, H = ExtractProps<P>> = {
|
|
|
30
54
|
disable: true;
|
|
31
55
|
};
|
|
32
56
|
};
|
|
33
|
-
declare type
|
|
34
|
-
|
|
57
|
+
declare type ExtractDimensions<C extends RocketComponent> = keyof C['$$rocketstyle'];
|
|
58
|
+
declare type Configuration<T extends Element | RocketComponent = Element | RocketComponent> = {
|
|
59
|
+
attrs: Record<string, any>;
|
|
35
60
|
name: string;
|
|
36
|
-
component:
|
|
61
|
+
component: T;
|
|
37
62
|
storyOptions: Partial<{
|
|
38
63
|
direction: 'inline' | 'rows';
|
|
39
64
|
alignX: 'left' | 'center' | 'right' | 'spaceBetween';
|
|
@@ -42,22 +67,22 @@ declare type Configuration<C = any> = {
|
|
|
42
67
|
pseudo: true;
|
|
43
68
|
}>;
|
|
44
69
|
decorators: any[];
|
|
45
|
-
};
|
|
70
|
+
};
|
|
71
|
+
declare type Controls = Record<string, Control>;
|
|
72
|
+
declare type PartialControls = Record<string, Partial<Control>>;
|
|
46
73
|
|
|
47
|
-
declare type MakeDimensionStories = ({ name, component, dimension, attrs, }: {
|
|
74
|
+
declare type MakeDimensionStories = <T extends RocketComponent>({ name, component, dimension, attrs, }: {
|
|
48
75
|
name: string;
|
|
49
|
-
component:
|
|
50
|
-
dimension:
|
|
76
|
+
component: T;
|
|
77
|
+
dimension: ExtractDimensions<T>;
|
|
51
78
|
attrs: Configuration['attrs'];
|
|
52
79
|
storyOptions: Configuration['storyOptions'];
|
|
53
80
|
ignore: any;
|
|
54
81
|
}) => StoryComponent;
|
|
55
82
|
declare const makeDimensionStories: MakeDimensionStories;
|
|
56
83
|
|
|
57
|
-
declare type MainStory = ({ name, component, attrs, }: {
|
|
58
|
-
name: string;
|
|
84
|
+
declare type MainStory = ({ name, component, attrs, }: Omit<Configuration, 'component'> & {
|
|
59
85
|
component: RocketComponent;
|
|
60
|
-
attrs: Record<string, unknown>;
|
|
61
86
|
}) => StoryComponent;
|
|
62
87
|
declare const mainStory: MainStory;
|
|
63
88
|
|
|
@@ -70,11 +95,11 @@ declare type Story = ({ component, attrs, }: {
|
|
|
70
95
|
};
|
|
71
96
|
declare const story: Story;
|
|
72
97
|
|
|
73
|
-
declare type Init = (
|
|
98
|
+
declare type Init = (params: Partial<Pick<Configuration, 'decorators' | 'storyOptions'>>) => <T extends Element | RocketComponent>(component: T) => ReturnType<Rocketstories>;
|
|
74
99
|
declare const init: Init;
|
|
75
|
-
declare type Rocketstories = <T extends Element | RocketComponent
|
|
100
|
+
declare type Rocketstories = <T extends Element | RocketComponent>(component: T, params?: Partial<Pick<Configuration, 'storyOptions' | 'decorators'>>) => T extends RocketComponent ? ReturnType<CreateRocketStories<T>> : ReturnType<CreateStories<T>>;
|
|
76
101
|
declare const rocketstories: Rocketstories;
|
|
77
|
-
declare type CreateStories<C
|
|
102
|
+
declare type CreateStories<C extends Element> = (defaultOptions: Configuration<C>, options: Partial<Configuration<C>>) => {
|
|
78
103
|
attrs: (params: AttrsTypes<C>) => ReturnType<CreateStories<C>>;
|
|
79
104
|
config: () => {
|
|
80
105
|
component: Element;
|
|
@@ -83,8 +108,7 @@ declare type CreateStories<C = Element> = (options: Partial<Configuration>, defa
|
|
|
83
108
|
};
|
|
84
109
|
main: () => ReturnType<typeof story>;
|
|
85
110
|
};
|
|
86
|
-
declare type
|
|
87
|
-
declare type CreateRocketStories<C extends RocketComponent = any> = (options: Partial<Configuration<C>>, defaultOptions: Configuration<C>) => {
|
|
111
|
+
declare type CreateRocketStories<C extends RocketComponent> = (defaultOptions: Configuration<C>, options: Partial<Configuration<C>>) => {
|
|
88
112
|
attrs: (params: AttrsTypes<C>) => ReturnType<CreateRocketStories<C>>;
|
|
89
113
|
config: () => {
|
|
90
114
|
component: Element;
|
|
@@ -97,4 +121,4 @@ declare type CreateRocketStories<C extends RocketComponent = any> = (options: Pa
|
|
|
97
121
|
}>) => ReturnType<typeof makeDimensionStories>;
|
|
98
122
|
};
|
|
99
123
|
|
|
100
|
-
export { rocketstories as default, init };
|
|
124
|
+
export { AttrItemControl, Configuration, Control, ControlTypes, Controls, CreateRocketStories, CreateStories, Element, ExtractDimensions, ExtractProps, Init, PartialControls, RocketComponent, Rocketstories, StoryComponent, StorybookControl, rocketstories as default, init };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import rocketstories, { init } from
|
|
1
|
+
import rocketstories, { init, Init, Rocketstories, CreateRocketStories, CreateStories } from "./rocketstories";
|
|
2
|
+
import type { ExtractDimensions, ExtractProps, Element, StoryComponent, StorybookControl, RocketComponent, Configuration, Control, ControlTypes, Controls, PartialControls, AttrItemControl } from "./types";
|
|
3
|
+
export type { Init, Rocketstories, CreateRocketStories, CreateStories, ExtractDimensions, ExtractProps, Element, StoryComponent, StorybookControl, RocketComponent, Configuration, Control, ControlTypes, Controls, PartialControls, AttrItemControl, };
|
|
2
4
|
export { init };
|
|
3
5
|
export default rocketstories;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { dimensionStory, mainStory, generalStory } from './stories';
|
|
2
|
-
import type { Element, RocketComponent, Configuration, AttrsTypes } from './types';
|
|
3
|
-
declare type Init = (
|
|
2
|
+
import type { Element, RocketComponent, Configuration, AttrsTypes, ExtractDimensions } from './types';
|
|
3
|
+
export declare type Init = (params: Partial<Pick<Configuration, 'decorators' | 'storyOptions'>>) => <T extends Element | RocketComponent>(component: T) => ReturnType<Rocketstories>;
|
|
4
4
|
declare const init: Init;
|
|
5
|
-
declare type Rocketstories = <T extends Element | RocketComponent
|
|
5
|
+
export declare type Rocketstories = <T extends Element | RocketComponent>(component: T, params?: Partial<Pick<Configuration, 'storyOptions' | 'decorators'>>) => T extends RocketComponent ? ReturnType<CreateRocketStories<T>> : ReturnType<CreateStories<T>>;
|
|
6
6
|
declare const rocketstories: Rocketstories;
|
|
7
|
-
declare type CreateStories<C
|
|
7
|
+
export declare type CreateStories<C extends Element> = (defaultOptions: Configuration<C>, options: Partial<Configuration<C>>) => {
|
|
8
8
|
attrs: (params: AttrsTypes<C>) => ReturnType<CreateStories<C>>;
|
|
9
9
|
config: () => {
|
|
10
10
|
component: Element;
|
|
@@ -13,8 +13,7 @@ declare type CreateStories<C = Element> = (options: Partial<Configuration>, defa
|
|
|
13
13
|
};
|
|
14
14
|
main: () => ReturnType<typeof generalStory>;
|
|
15
15
|
};
|
|
16
|
-
declare type
|
|
17
|
-
declare type CreateRocketStories<C extends RocketComponent = any> = (options: Partial<Configuration<C>>, defaultOptions: Configuration<C>) => {
|
|
16
|
+
export declare type CreateRocketStories<C extends RocketComponent> = (defaultOptions: Configuration<C>, options: Partial<Configuration<C>>) => {
|
|
18
17
|
attrs: (params: AttrsTypes<C>) => ReturnType<CreateRocketStories<C>>;
|
|
19
18
|
config: () => {
|
|
20
19
|
component: Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { RocketComponent, StoryComponent, Configuration } from "../types";
|
|
2
|
-
declare type MakeDimensionStories = ({ name, component, dimension, attrs, }: {
|
|
1
|
+
import type { RocketComponent, StoryComponent, Configuration, ExtractDimensions } from "../types";
|
|
2
|
+
declare type MakeDimensionStories = <T extends RocketComponent>({ name, component, dimension, attrs, }: {
|
|
3
3
|
name: string;
|
|
4
|
-
component:
|
|
5
|
-
dimension:
|
|
4
|
+
component: T;
|
|
5
|
+
dimension: ExtractDimensions<T>;
|
|
6
6
|
attrs: Configuration['attrs'];
|
|
7
7
|
storyOptions: Configuration['storyOptions'];
|
|
8
8
|
ignore: any;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { RocketComponent, StoryComponent } from "../types";
|
|
2
|
-
declare type MainStory = ({ name, component, attrs, }: {
|
|
3
|
-
name: string;
|
|
1
|
+
import type { RocketComponent, StoryComponent, Configuration } from "../types";
|
|
2
|
+
declare type MainStory = ({ name, component, attrs, }: Omit<Configuration, 'component'> & {
|
|
4
3
|
component: RocketComponent;
|
|
5
|
-
attrs: Record<string, unknown>;
|
|
6
4
|
}) => StoryComponent;
|
|
7
5
|
declare const mainStory: MainStory;
|
|
8
6
|
export default mainStory;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RocketComponentType } from '@vitus-labs/rocketstyle';
|
|
2
|
+
import type { ComponentType, VFC } from 'react';
|
|
2
3
|
import type { T_CONTROL_TYPES } from "./constants/controls";
|
|
3
4
|
export declare type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends ComponentType<infer TProps> ? TProps : TComponentOrTProps;
|
|
4
5
|
export declare type StoryComponent = VFC<any> & {
|
|
@@ -7,9 +8,7 @@ export declare type StoryComponent = VFC<any> & {
|
|
|
7
8
|
parameters: any;
|
|
8
9
|
};
|
|
9
10
|
export declare type Element = ComponentType;
|
|
10
|
-
export declare type RocketComponent =
|
|
11
|
-
IS_ROCKETSTYLE: true;
|
|
12
|
-
$$rocketstyle: Record<string, any>;
|
|
11
|
+
export declare type RocketComponent = RocketComponentType & {
|
|
13
12
|
VITUS_LABS__COMPONENT?: string;
|
|
14
13
|
getStaticDimensions: any;
|
|
15
14
|
getDefaultAttrs: any;
|
|
@@ -52,10 +51,11 @@ export declare type AttrsTypes<P, H = ExtractProps<P>> = {
|
|
|
52
51
|
disable: true;
|
|
53
52
|
};
|
|
54
53
|
};
|
|
55
|
-
export declare type
|
|
56
|
-
|
|
54
|
+
export declare type ExtractDimensions<C extends RocketComponent> = keyof C['$$rocketstyle'];
|
|
55
|
+
export declare type Configuration<T extends Element | RocketComponent = Element | RocketComponent> = {
|
|
56
|
+
attrs: Record<string, any>;
|
|
57
57
|
name: string;
|
|
58
|
-
component:
|
|
58
|
+
component: T;
|
|
59
59
|
storyOptions: Partial<{
|
|
60
60
|
direction: 'inline' | 'rows';
|
|
61
61
|
alignX: 'left' | 'center' | 'right' | 'spaceBetween';
|
|
@@ -967,32 +967,27 @@ const story = ({ component, attrs }) => {
|
|
|
967
967
|
};
|
|
968
968
|
|
|
969
969
|
const init = ({ decorators = [], storyOptions = {} }) => (component) => rocketstories(component, { decorators, storyOptions });
|
|
970
|
-
|
|
971
|
-
// @ts-ignore
|
|
970
|
+
//@ts-ignore
|
|
972
971
|
const rocketstories = (component, { decorators = [], storyOptions = {} } = {}) => {
|
|
973
|
-
|
|
974
|
-
return createStories({
|
|
975
|
-
component,
|
|
976
|
-
name: component.displayName || component.name,
|
|
977
|
-
attrs: {},
|
|
978
|
-
storyOptions: { gap: 16, direction: 'rows', ...storyOptions },
|
|
979
|
-
decorators,
|
|
980
|
-
}, {});
|
|
981
|
-
}
|
|
982
|
-
return createRocketstories({
|
|
972
|
+
const options = {
|
|
983
973
|
component,
|
|
984
974
|
name: component.displayName || component.name,
|
|
985
975
|
attrs: {},
|
|
986
976
|
storyOptions: { gap: 16, direction: 'rows', ...storyOptions },
|
|
987
977
|
decorators,
|
|
988
|
-
}
|
|
978
|
+
};
|
|
979
|
+
if (!isRocketComponent(component)) {
|
|
980
|
+
return createStories(options, {});
|
|
981
|
+
}
|
|
982
|
+
return createRocketstories(options, {});
|
|
989
983
|
};
|
|
990
|
-
const createStories = (
|
|
984
|
+
const createStories = (defaultOptions, options) => {
|
|
985
|
+
const name = core.get(options, 'component')
|
|
986
|
+
? core.get(options, 'component.displayName')
|
|
987
|
+
: defaultOptions.name;
|
|
991
988
|
const result = {
|
|
992
989
|
...defaultOptions,
|
|
993
|
-
name
|
|
994
|
-
? core.get(options, 'component.displayName')
|
|
995
|
-
: defaultOptions.name,
|
|
990
|
+
name,
|
|
996
991
|
component: options.component || defaultOptions.component,
|
|
997
992
|
attrs: { ...defaultOptions.attrs, ...options.attrs },
|
|
998
993
|
storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },
|
|
@@ -1002,7 +997,7 @@ const createStories = (options, defaultOptions) => {
|
|
|
1002
997
|
],
|
|
1003
998
|
};
|
|
1004
999
|
return {
|
|
1005
|
-
attrs: (attrs) => createStories({ attrs }
|
|
1000
|
+
attrs: (attrs) => createStories(result, { attrs }),
|
|
1006
1001
|
// create object for `export default` in stories
|
|
1007
1002
|
config: () => ({
|
|
1008
1003
|
component: result.component,
|
|
@@ -1013,11 +1008,12 @@ const createStories = (options, defaultOptions) => {
|
|
|
1013
1008
|
};
|
|
1014
1009
|
};
|
|
1015
1010
|
const createRocketstories = (options, defaultOptions) => {
|
|
1011
|
+
const name = core.get(options, 'component')
|
|
1012
|
+
? core.get(options, 'component.displayName')
|
|
1013
|
+
: defaultOptions.name;
|
|
1016
1014
|
const result = {
|
|
1017
1015
|
...defaultOptions,
|
|
1018
|
-
name
|
|
1019
|
-
? core.get(options, 'component.displayName')
|
|
1020
|
-
: defaultOptions.name,
|
|
1016
|
+
name,
|
|
1021
1017
|
component: options.component || defaultOptions.component,
|
|
1022
1018
|
attrs: { ...defaultOptions.attrs, ...options.attrs },
|
|
1023
1019
|
storyOptions: { ...defaultOptions.storyOptions, ...options.storyOptions },
|
|
@@ -1027,7 +1023,7 @@ const createRocketstories = (options, defaultOptions) => {
|
|
|
1027
1023
|
],
|
|
1028
1024
|
};
|
|
1029
1025
|
return {
|
|
1030
|
-
attrs: (attrs) => createRocketstories({ attrs }
|
|
1026
|
+
attrs: (attrs) => createRocketstories(result, { attrs }),
|
|
1031
1027
|
// create object for `export default` in stories
|
|
1032
1028
|
config: () => ({
|
|
1033
1029
|
component: result.component,
|
|
@@ -1037,15 +1033,13 @@ const createRocketstories = (options, defaultOptions) => {
|
|
|
1037
1033
|
// generate main story
|
|
1038
1034
|
main: () => mainStory(result),
|
|
1039
1035
|
// define storyOptions
|
|
1040
|
-
storyOptions: (storyOptions) => createRocketstories({ storyOptions }
|
|
1036
|
+
storyOptions: (storyOptions) => createRocketstories(result, { storyOptions }),
|
|
1041
1037
|
// generate stories of defined dimension
|
|
1042
1038
|
dimension: (dimension, params = {}) => {
|
|
1043
1039
|
const { ignore = [] } = params;
|
|
1044
1040
|
return makeDimensionStories({
|
|
1045
1041
|
...result,
|
|
1046
1042
|
ignore,
|
|
1047
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1048
|
-
// @ts-ignore
|
|
1049
1043
|
dimension,
|
|
1050
1044
|
});
|
|
1051
1045
|
},
|