histoire 0.8.4 → 0.9.2
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/client.d.ts +1 -3
- package/client.js +1 -0
- package/dist/node/alias.d.ts +0 -1
- package/dist/node/alias.js +5 -6
- package/dist/node/bin.js +1 -0
- package/dist/node/build.js +13 -1
- package/dist/node/builtin-plugins/tailwind-tokens.js +391 -377
- package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts +14 -0
- package/dist/node/builtin-plugins/vanilla-support/MountStory.js +39 -0
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts +38 -0
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.js +131 -0
- package/dist/node/builtin-plugins/vanilla-support/client.d.ts +3 -0
- package/dist/node/builtin-plugins/vanilla-support/client.js +5 -0
- package/dist/node/builtin-plugins/vanilla-support/collect.d.ts +2 -0
- package/dist/node/builtin-plugins/vanilla-support/collect.js +33 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts +2 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.js +29 -0
- package/dist/node/builtin-plugins/vanilla-support/types.d.ts +35 -0
- package/dist/node/builtin-plugins/vanilla-support/types.js +3 -0
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts +3 -0
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.js +55 -0
- package/dist/node/collect/run.js +4 -6
- package/dist/node/config.d.ts +9 -0
- package/dist/node/config.js +16 -0
- package/dist/node/context.d.ts +3 -7
- package/dist/node/context.js +2 -0
- package/dist/node/plugin.d.ts +5 -1
- package/dist/node/server.js +1 -1
- package/dist/node/stories.js +15 -1
- package/dist/node/vite.d.ts +4 -0
- package/dist/node/vite.js +47 -16
- package/package.json +11 -21
- package/src/node/alias.ts +5 -6
- package/src/node/bin.ts +1 -0
- package/src/node/build.ts +13 -1
- package/src/node/builtin-plugins/tailwind-tokens.ts +394 -377
- package/src/node/builtin-plugins/vanilla-support/MountStory.ts +50 -0
- package/src/node/builtin-plugins/vanilla-support/RenderStory.ts +166 -0
- package/src/node/builtin-plugins/vanilla-support/client.ts +6 -0
- package/src/node/builtin-plugins/vanilla-support/collect.ts +42 -0
- package/src/node/builtin-plugins/vanilla-support/plugin.ts +35 -0
- package/src/node/builtin-plugins/vanilla-support/types.ts +40 -0
- package/src/node/builtin-plugins/vanilla-support/vanilla.story.ts +63 -0
- package/src/node/collect/run.ts +4 -8
- package/src/node/config.ts +26 -0
- package/src/node/context.ts +7 -2
- package/src/node/plugin.ts +5 -1
- package/src/node/server.ts +2 -2
- package/src/node/stories.ts +18 -1
- package/src/node/vite.ts +56 -16
- package/tsconfig.json +2 -11
- package/dist/bundled/App.js +0 -166
- package/dist/bundled/_virtual/plugin-vue_export-helper.js +0 -8
- package/dist/bundled/api.js +0 -1
- package/dist/bundled/assets/histoire-text-dark.js +0 -2
- package/dist/bundled/assets/histoire-text.js +0 -2
- package/dist/bundled/assets/histoire.js +0 -2
- package/dist/bundled/components/HomeView.js +0 -24
- package/dist/bundled/components/app/AppHeader.js +0 -67
- package/dist/bundled/components/app/AppLogo.js +0 -26
- package/dist/bundled/components/app/Breadcrumb.js +0 -95
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/app/InitialLoading.js +0 -48
- package/dist/bundled/components/app/MobileOverlay.js +0 -41
- package/dist/bundled/components/base/BaseCheckbox.js +0 -75
- package/dist/bundled/components/base/BaseEmpty.js +0 -13
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseListItemLink.js +0 -50
- package/dist/bundled/components/base/BaseOverflowMenu.js +0 -97
- package/dist/bundled/components/base/BaseOverflowTab.js +0 -45
- package/dist/bundled/components/base/BaseSelect.js +0 -88
- package/dist/bundled/components/base/BaseSplitPane.js +0 -184
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseTab.js +0 -45
- package/dist/bundled/components/misc/CheckerboardPattern.js +0 -41
- package/dist/bundled/components/misc/HatchedPattern.js +0 -11
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +0 -98
- package/dist/bundled/components/panel/ControlsComponentProps.js +0 -42
- package/dist/bundled/components/panel/PaneTabs.js +0 -131
- package/dist/bundled/components/panel/StatePresets.js +0 -184
- package/dist/bundled/components/panel/StoryControls.js +0 -66
- package/dist/bundled/components/panel/StoryDocs.js +0 -58
- package/dist/bundled/components/panel/StoryEvent.js +0 -56
- package/dist/bundled/components/panel/StoryEvents.js +0 -49
- package/dist/bundled/components/panel/StorySidePanel.js +0 -71
- package/dist/bundled/components/panel/StorySourceCode.js +0 -110
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/search/SearchItem.js +0 -113
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/search/SearchLoading.js +0 -19
- package/dist/bundled/components/search/SearchModal.js +0 -46
- package/dist/bundled/components/search/SearchPane.js +0 -263
- package/dist/bundled/components/search/search-docs-data.js +0 -7
- package/dist/bundled/components/search/search-title-data.js +0 -7
- package/dist/bundled/components/story/StoryResponsivePreview.js +0 -180
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantGrid.js +0 -94
- package/dist/bundled/components/story/StoryVariantGridItem.js +0 -106
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantListItem.js +0 -58
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantSingle.js +0 -115
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +0 -43
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +0 -119
- package/dist/bundled/components/story/StoryVariantSingleView.js +0 -49
- package/dist/bundled/components/story/StoryView.js +0 -107
- package/dist/bundled/components/story/StoryViewer.js +0 -57
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/toolbar/StoryVariantBackground.js +0 -85
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/toolbar/StoryVariantNewTab.js +0 -33
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +0 -129
- package/dist/bundled/components/toolbar/StoryVariantTitle.js +0 -24
- package/dist/bundled/components/tree/StoryGroup.js +0 -74
- package/dist/bundled/components/tree/StoryList.js +0 -37
- package/dist/bundled/components/tree/StoryListFolder.js +0 -89
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/tree/StoryListItem.js +0 -72
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/index.js +0 -29
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +0 -40
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +0 -5
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +0 -11
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +0 -26
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +0 -10
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +0 -50
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +0 -8
- package/dist/bundled/router.js +0 -28
- package/dist/bundled/sandbox.js +0 -87
- package/dist/bundled/stores/events.js +0 -29
- package/dist/bundled/stores/folder.js +0 -46
- package/dist/bundled/stores/preview-settings.js +0 -15
- package/dist/bundled/stores/story.js +0 -43
- package/dist/bundled/style.css +0 -102
- package/dist/bundled/util/config.js +0 -4
- package/dist/bundled/util/const.js +0 -5
- package/dist/bundled/util/dark.js +0 -4
- package/dist/bundled/util/env.js +0 -2
- package/dist/bundled/util/events.js +0 -32
- package/dist/bundled/util/keyboard.js +0 -84
- package/dist/bundled/util/mapping.js +0 -94
- package/dist/bundled/util/preview-settings.js +0 -6
- package/dist/bundled/util/responsive.js +0 -3
- package/dist/bundled/util/sandbox.js +0 -8
- package/dist/bundled/util/scroll.js +0 -28
- package/dist/bundled/util/state.js +0 -31
- package/dist/bundled/util/tooltip.js +0 -12
- package/dist/bundled/util/variant.js +0 -35
- package/dist/client/app/App.vue +0 -162
- package/dist/client/app/api.d.ts +0 -1
- package/dist/client/app/api.js +0 -1
- package/dist/client/app/assets/histoire-text-dark.svg +0 -89
- package/dist/client/app/assets/histoire-text.svg +0 -89
- package/dist/client/app/assets/histoire.svg +0 -51
- package/dist/client/app/components/HomeView.vue +0 -17
- package/dist/client/app/components/app/AppHeader.vue +0 -64
- package/dist/client/app/components/app/AppLogo.vue +0 -24
- package/dist/client/app/components/app/Breadcrumb.vue +0 -98
- package/dist/client/app/components/app/InitialLoading.vue +0 -44
- package/dist/client/app/components/app/MobileOverlay.vue +0 -33
- package/dist/client/app/components/base/BaseCheckbox.vue +0 -77
- package/dist/client/app/components/base/BaseCopyIcon.vue +0 -34
- package/dist/client/app/components/base/BaseEmpty.vue +0 -21
- package/dist/client/app/components/base/BaseListItemLink.vue +0 -55
- package/dist/client/app/components/base/BaseOverflowMenu.vue +0 -119
- package/dist/client/app/components/base/BaseOverflowTab.vue +0 -46
- package/dist/client/app/components/base/BaseSelect.vue +0 -72
- package/dist/client/app/components/base/BaseSplitPane.vue +0 -240
- package/dist/client/app/components/base/BaseTab.vue +0 -46
- package/dist/client/app/components/misc/CheckerboardPattern.vue +0 -32
- package/dist/client/app/components/misc/HatchedPattern.vue +0 -13
- package/dist/client/app/components/panel/ControlsComponentPropItem.vue +0 -103
- package/dist/client/app/components/panel/ControlsComponentProps.vue +0 -34
- package/dist/client/app/components/panel/PaneTabs.vue +0 -89
- package/dist/client/app/components/panel/StatePresets.vue +0 -196
- package/dist/client/app/components/panel/StoryControls.vue +0 -68
- package/dist/client/app/components/panel/StoryDocs.vue +0 -61
- package/dist/client/app/components/panel/StoryEvent.vue +0 -54
- package/dist/client/app/components/panel/StoryEvents.vue +0 -45
- package/dist/client/app/components/panel/StorySidePanel.vue +0 -69
- package/dist/client/app/components/panel/StorySourceCode.vue +0 -116
- package/dist/client/app/components/search/SearchItem.vue +0 -110
- package/dist/client/app/components/search/SearchLoading.vue +0 -16
- package/dist/client/app/components/search/SearchModal.vue +0 -43
- package/dist/client/app/components/search/SearchPane.vue +0 -293
- package/dist/client/app/components/search/search-docs-data.d.ts +0 -3
- package/dist/client/app/components/search/search-docs-data.js +0 -7
- package/dist/client/app/components/search/search-title-data.d.ts +0 -3
- package/dist/client/app/components/search/search-title-data.js +0 -7
- package/dist/client/app/components/search/types.d.ts +0 -7
- package/dist/client/app/components/search/types.js +0 -1
- package/dist/client/app/components/story/StoryResponsivePreview.vue +0 -204
- package/dist/client/app/components/story/StoryVariantGrid.vue +0 -112
- package/dist/client/app/components/story/StoryVariantGridItem.vue +0 -110
- package/dist/client/app/components/story/StoryVariantListItem.vue +0 -50
- package/dist/client/app/components/story/StoryVariantSingle.vue +0 -105
- package/dist/client/app/components/story/StoryVariantSinglePreviewNative.vue +0 -42
- package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +0 -139
- package/dist/client/app/components/story/StoryVariantSingleView.vue +0 -52
- package/dist/client/app/components/story/StoryView.vue +0 -96
- package/dist/client/app/components/story/StoryViewer.vue +0 -53
- package/dist/client/app/components/toolbar/StoryVariantBackground.vue +0 -67
- package/dist/client/app/components/toolbar/StoryVariantNewTab.vue +0 -29
- package/dist/client/app/components/toolbar/StoryVariantResponsiveSize.vue +0 -82
- package/dist/client/app/components/toolbar/StoryVariantTitle.vue +0 -21
- package/dist/client/app/components/tree/StoryGroup.vue +0 -75
- package/dist/client/app/components/tree/StoryList.vue +0 -35
- package/dist/client/app/components/tree/StoryListFolder.vue +0 -89
- package/dist/client/app/components/tree/StoryListItem.vue +0 -71
- package/dist/client/app/index.d.ts +0 -2
- package/dist/client/app/index.js +0 -28
- package/dist/client/app/router.d.ts +0 -2
- package/dist/client/app/router.js +0 -26
- package/dist/client/app/sandbox.d.ts +0 -1
- package/dist/client/app/sandbox.js +0 -87
- package/dist/client/app/stores/events.d.ts +0 -29
- package/dist/client/app/stores/events.js +0 -25
- package/dist/client/app/stores/folder.d.ts +0 -10
- package/dist/client/app/stores/folder.js +0 -47
- package/dist/client/app/stores/preview-settings.d.ts +0 -8
- package/dist/client/app/stores/preview-settings.js +0 -14
- package/dist/client/app/stores/story.d.ts +0 -362
- package/dist/client/app/stores/story.js +0 -39
- package/dist/client/app/style/floating-vue.pcss +0 -34
- package/dist/client/app/style/main.pcss +0 -86
- package/dist/client/app/style/sandbox.css +0 -19
- package/dist/client/app/style/transitions.pcss +0 -51
- package/dist/client/app/types.d.ts +0 -34
- package/dist/client/app/types.js +0 -1
- package/dist/client/app/util/config.d.ts +0 -3
- package/dist/client/app/util/config.js +0 -4
- package/dist/client/app/util/const.d.ts +0 -4
- package/dist/client/app/util/const.js +0 -4
- package/dist/client/app/util/dark.d.ts +0 -2
- package/dist/client/app/util/dark.js +0 -3
- package/dist/client/app/util/env.d.ts +0 -1
- package/dist/client/app/util/env.js +0 -1
- package/dist/client/app/util/events.d.ts +0 -1
- package/dist/client/app/util/events.js +0 -31
- package/dist/client/app/util/keyboard.d.ts +0 -8
- package/dist/client/app/util/keyboard.js +0 -82
- package/dist/client/app/util/mapping.d.ts +0 -3
- package/dist/client/app/util/mapping.js +0 -85
- package/dist/client/app/util/preview-settings.d.ts +0 -9
- package/dist/client/app/util/preview-settings.js +0 -5
- package/dist/client/app/util/responsive.d.ts +0 -1
- package/dist/client/app/util/responsive.js +0 -2
- package/dist/client/app/util/sandbox.d.ts +0 -2
- package/dist/client/app/util/sandbox.js +0 -7
- package/dist/client/app/util/scroll.d.ts +0 -4
- package/dist/client/app/util/scroll.js +0 -27
- package/dist/client/app/util/state.d.ts +0 -1
- package/dist/client/app/util/state.js +0 -31
- package/dist/client/app/util/tooltip.d.ts +0 -6
- package/dist/client/app/util/tooltip.js +0 -11
- package/dist/client/app/util/variant.d.ts +0 -18
- package/dist/client/app/util/variant.js +0 -17
- package/dist/client/bundle-index.js +0 -5
- package/dist/client/bundle-main.js +0 -5
- package/dist/client/bundle-sandbox.js +0 -2
- package/dist/client/index.d.ts +0 -9
- package/dist/client/index.js +0 -4
- package/dist/style.css +0 -2382
- package/postcss.config.cjs +0 -8
- package/scripts/copy.mjs +0 -12
- package/scripts/watchAndCopy.mjs +0 -15
- package/src/client/app/App.vue +0 -162
- package/src/client/app/api.ts +0 -1
- package/src/client/app/assets/histoire-text-dark.svg +0 -89
- package/src/client/app/assets/histoire-text.svg +0 -89
- package/src/client/app/assets/histoire.svg +0 -51
- package/src/client/app/components/HomeView.vue +0 -17
- package/src/client/app/components/app/AppHeader.vue +0 -64
- package/src/client/app/components/app/AppLogo.vue +0 -24
- package/src/client/app/components/app/Breadcrumb.vue +0 -98
- package/src/client/app/components/app/InitialLoading.vue +0 -44
- package/src/client/app/components/app/MobileOverlay.vue +0 -33
- package/src/client/app/components/base/BaseCheckbox.vue +0 -77
- package/src/client/app/components/base/BaseCopyIcon.vue +0 -34
- package/src/client/app/components/base/BaseEmpty.vue +0 -21
- package/src/client/app/components/base/BaseListItemLink.vue +0 -55
- package/src/client/app/components/base/BaseOverflowMenu.vue +0 -119
- package/src/client/app/components/base/BaseOverflowTab.vue +0 -46
- package/src/client/app/components/base/BaseSelect.vue +0 -72
- package/src/client/app/components/base/BaseSplitPane.vue +0 -240
- package/src/client/app/components/base/BaseTab.vue +0 -46
- package/src/client/app/components/misc/CheckerboardPattern.vue +0 -32
- package/src/client/app/components/misc/HatchedPattern.vue +0 -13
- package/src/client/app/components/panel/ControlsComponentPropItem.vue +0 -103
- package/src/client/app/components/panel/ControlsComponentProps.vue +0 -34
- package/src/client/app/components/panel/PaneTabs.vue +0 -89
- package/src/client/app/components/panel/StatePresets.vue +0 -196
- package/src/client/app/components/panel/StoryControls.vue +0 -68
- package/src/client/app/components/panel/StoryDocs.vue +0 -61
- package/src/client/app/components/panel/StoryEvent.vue +0 -54
- package/src/client/app/components/panel/StoryEvents.vue +0 -45
- package/src/client/app/components/panel/StorySidePanel.vue +0 -69
- package/src/client/app/components/panel/StorySourceCode.vue +0 -116
- package/src/client/app/components/search/SearchItem.vue +0 -110
- package/src/client/app/components/search/SearchLoading.vue +0 -16
- package/src/client/app/components/search/SearchModal.vue +0 -43
- package/src/client/app/components/search/SearchPane.vue +0 -293
- package/src/client/app/components/search/search-docs-data.ts +0 -10
- package/src/client/app/components/search/search-title-data.ts +0 -10
- package/src/client/app/components/search/types.ts +0 -4
- package/src/client/app/components/story/StoryResponsivePreview.vue +0 -204
- package/src/client/app/components/story/StoryVariantGrid.vue +0 -112
- package/src/client/app/components/story/StoryVariantGridItem.vue +0 -110
- package/src/client/app/components/story/StoryVariantListItem.vue +0 -50
- package/src/client/app/components/story/StoryVariantSingle.vue +0 -105
- package/src/client/app/components/story/StoryVariantSinglePreviewNative.vue +0 -42
- package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +0 -139
- package/src/client/app/components/story/StoryVariantSingleView.vue +0 -52
- package/src/client/app/components/story/StoryView.vue +0 -96
- package/src/client/app/components/story/StoryViewer.vue +0 -53
- package/src/client/app/components/toolbar/StoryVariantBackground.vue +0 -67
- package/src/client/app/components/toolbar/StoryVariantNewTab.vue +0 -29
- package/src/client/app/components/toolbar/StoryVariantResponsiveSize.vue +0 -82
- package/src/client/app/components/toolbar/StoryVariantTitle.vue +0 -21
- package/src/client/app/components/tree/StoryGroup.vue +0 -75
- package/src/client/app/components/tree/StoryList.vue +0 -35
- package/src/client/app/components/tree/StoryListFolder.vue +0 -89
- package/src/client/app/components/tree/StoryListItem.vue +0 -71
- package/src/client/app/index.ts +0 -30
- package/src/client/app/router.ts +0 -29
- package/src/client/app/sandbox.ts +0 -95
- package/src/client/app/stores/events.ts +0 -36
- package/src/client/app/stores/folder.ts +0 -59
- package/src/client/app/stores/preview-settings.ts +0 -17
- package/src/client/app/stores/story.ts +0 -47
- package/src/client/app/style/floating-vue.pcss +0 -34
- package/src/client/app/style/main.pcss +0 -86
- package/src/client/app/style/sandbox.css +0 -19
- package/src/client/app/style/transitions.pcss +0 -51
- package/src/client/app/types.ts +0 -46
- package/src/client/app/util/config.ts +0 -6
- package/src/client/app/util/const.ts +0 -4
- package/src/client/app/util/dark.ts +0 -4
- package/src/client/app/util/env.ts +0 -1
- package/src/client/app/util/events.ts +0 -30
- package/src/client/app/util/keyboard.ts +0 -99
- package/src/client/app/util/mapping.ts +0 -91
- package/src/client/app/util/preview-settings.ts +0 -8
- package/src/client/app/util/responsive.ts +0 -3
- package/src/client/app/util/sandbox.ts +0 -10
- package/src/client/app/util/scroll.ts +0 -31
- package/src/client/app/util/state.ts +0 -37
- package/src/client/app/util/tooltip.ts +0 -13
- package/src/client/app/util/variant.ts +0 -20
- package/src/client/bundle-index.js +0 -5
- package/src/client/bundle-main.js +0 -5
- package/src/client/bundle-sandbox.js +0 -2
- package/src/client/index.ts +0 -13
- package/src/client/shim.d.ts +0 -7
- package/tailwind.config.cjs +0 -126
- package/vite.config.ts +0 -87
- package/vue.d.ts +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, defineComponent, useCssVars, unref, toRefs, ref, openBlock, createElementBlock, createVNode, withCtx, normalizeClass, createElementVNode, toDisplayString } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
3
|
-
import BaseListItemLink from "../base/BaseListItemLink.js";
|
|
4
|
-
import { Icon } from "@histoire/vendors/dist/client/iconify.js";
|
|
5
|
-
import { useScrollOnActive } from "../../util/scroll.js";
|
|
6
|
-
import "./StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
7
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
8
|
-
const _withScopeId = (n) => (pushScopeId("data-v-2cdc2ac0"), n = n(), popScopeId(), n);
|
|
9
|
-
const _hoisted_1 = { class: "htw-truncate" };
|
|
10
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
-
name: "StoryVariantListItem",
|
|
12
|
-
props: {
|
|
13
|
-
variant: {
|
|
14
|
-
type: Object,
|
|
15
|
-
required: true
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
setup(__props) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
useCssVars((_ctx) => ({
|
|
21
|
-
"3c4190ff": unref(variant).iconColor
|
|
22
|
-
}));
|
|
23
|
-
const { variant } = toRefs(props);
|
|
24
|
-
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
25
|
-
const el = ref();
|
|
26
|
-
useScrollOnActive(isActive, el);
|
|
27
|
-
return (_ctx, _cache) => {
|
|
28
|
-
return openBlock(), createElementBlock("div", {
|
|
29
|
-
ref_key: "el",
|
|
30
|
-
ref: el,
|
|
31
|
-
"data-test-id": "story-variant-list-item"
|
|
32
|
-
}, [
|
|
33
|
-
createVNode(BaseListItemLink, {
|
|
34
|
-
to: unref(targetRoute),
|
|
35
|
-
"is-active": unref(isActive),
|
|
36
|
-
class: "htw-px-2 htw-py-2 md:htw-py-1.5 htw-m-1 htw-rounded-sm htw-flex htw-items-center htw-gap-2"
|
|
37
|
-
}, {
|
|
38
|
-
default: withCtx(({ active }) => {
|
|
39
|
-
var _a;
|
|
40
|
-
return [
|
|
41
|
-
createVNode(unref(Icon), {
|
|
42
|
-
icon: (_a = unref(variant).icon) != null ? _a : "carbon:cube",
|
|
43
|
-
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 sm:htw-w-4 sm:htw-h-4 htw-flex-none", {
|
|
44
|
-
"htw-text-gray-500": !active && !unref(variant).iconColor,
|
|
45
|
-
"bind-icon-color": !active && unref(variant).iconColor
|
|
46
|
-
}])
|
|
47
|
-
}, null, 8, ["icon", "class"]),
|
|
48
|
-
createElementVNode("span", _hoisted_1, toDisplayString(unref(variant).title), 1)
|
|
49
|
-
];
|
|
50
|
-
}),
|
|
51
|
-
_: 1
|
|
52
|
-
}, 8, ["to", "is-active"])
|
|
53
|
-
], 512);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
var StoryVariantListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2cdc2ac0"]]);
|
|
58
|
-
export { StoryVariantListItem as default };
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, createTextVNode, defineComponent, useCssVars, unref, computed, openBlock, createElementBlock, createVNode, Fragment, createElementVNode, normalizeClass, toDisplayString, createCommentVNode, createBlock, withCtx, renderList } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
-
import { Icon } from "@histoire/vendors/dist/client/iconify.js";
|
|
4
|
-
import { isMobile } from "../../util/responsive.js";
|
|
5
|
-
import BaseSplitPane from "../base/BaseSplitPane.js";
|
|
6
|
-
import StoryVariantListItem from "./StoryVariantListItem.js";
|
|
7
|
-
import _sfc_main$1 from "./StoryVariantSingleView.js";
|
|
8
|
-
import "./StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
9
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
10
|
-
const _withScopeId = (n) => (pushScopeId("data-v-30bcb922"), n = n(), popScopeId(), n);
|
|
11
|
-
const _hoisted_1 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "htw-p-2 htw-h-full"
|
|
14
|
-
};
|
|
15
|
-
const _hoisted_2 = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800 htw-h-full htw-flex htw-flex-col"
|
|
18
|
-
};
|
|
19
|
-
const _hoisted_3 = /* @__PURE__ */ createTextVNode(" Select a variant... ");
|
|
20
|
-
const _hoisted_4 = {
|
|
21
|
-
key: 0,
|
|
22
|
-
class: "htw-p-2 htw-h-full"
|
|
23
|
-
};
|
|
24
|
-
const _hoisted_5 = { class: "htw-h-full htw-overflow-y-auto" };
|
|
25
|
-
const _hoisted_6 = {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: "htw-p-2 htw-h-full"
|
|
28
|
-
};
|
|
29
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
30
|
-
name: "StoryVariantSingle",
|
|
31
|
-
emits: {
|
|
32
|
-
"open-variant-menu": () => true
|
|
33
|
-
},
|
|
34
|
-
setup(__props) {
|
|
35
|
-
useCssVars((_ctx) => {
|
|
36
|
-
var _a;
|
|
37
|
-
return {
|
|
38
|
-
"33d9fc01": (_a = unref(variant)) == null ? void 0 : _a.iconColor
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const storyStore = useStoryStore();
|
|
42
|
-
const hasSingleVariant = computed(() => {
|
|
43
|
-
var _a;
|
|
44
|
-
return ((_a = storyStore.currentStory) == null ? void 0 : _a.variants.length) === 1;
|
|
45
|
-
});
|
|
46
|
-
const variant = computed(() => storyStore.currentVariant);
|
|
47
|
-
return (_ctx, _cache) => {
|
|
48
|
-
var _a;
|
|
49
|
-
return unref(hasSingleVariant) && unref(variant) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
50
|
-
createVNode(_sfc_main$1, {
|
|
51
|
-
variant: unref(variant),
|
|
52
|
-
story: unref(storyStore).currentStory
|
|
53
|
-
}, null, 8, ["variant", "story"])
|
|
54
|
-
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
55
|
-
unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
56
|
-
createElementVNode("a", {
|
|
57
|
-
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none",
|
|
58
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("open-variant-menu"))
|
|
59
|
-
}, [
|
|
60
|
-
unref(variant) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
61
|
-
createVNode(unref(Icon), {
|
|
62
|
-
icon: (_a = unref(variant).icon) != null ? _a : "carbon:cube",
|
|
63
|
-
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 htw-flex-none", {
|
|
64
|
-
"htw-text-gray-500": !unref(variant).iconColor,
|
|
65
|
-
"bind-icon-color": unref(variant).iconColor
|
|
66
|
-
}])
|
|
67
|
-
}, null, 8, ["icon", "class"]),
|
|
68
|
-
createTextVNode(" " + toDisplayString(unref(variant).title), 1)
|
|
69
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
70
|
-
_hoisted_3
|
|
71
|
-
], 64)),
|
|
72
|
-
createVNode(unref(Icon), {
|
|
73
|
-
icon: "carbon:chevron-sort",
|
|
74
|
-
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
75
|
-
})
|
|
76
|
-
]),
|
|
77
|
-
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
78
|
-
createVNode(_sfc_main$1, {
|
|
79
|
-
variant: unref(storyStore).currentVariant,
|
|
80
|
-
story: unref(storyStore).currentStory
|
|
81
|
-
}, null, 8, ["variant", "story"])
|
|
82
|
-
])) : createCommentVNode("", true)
|
|
83
|
-
])) : (openBlock(), createBlock(BaseSplitPane, {
|
|
84
|
-
key: 1,
|
|
85
|
-
"save-id": "story-single-main-split",
|
|
86
|
-
min: 5,
|
|
87
|
-
max: 40,
|
|
88
|
-
"default-split": 17
|
|
89
|
-
}, {
|
|
90
|
-
first: withCtx(() => [
|
|
91
|
-
createElementVNode("div", _hoisted_5, [
|
|
92
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
93
|
-
return openBlock(), createBlock(StoryVariantListItem, {
|
|
94
|
-
key: index,
|
|
95
|
-
variant: v
|
|
96
|
-
}, null, 8, ["variant"]);
|
|
97
|
-
}), 128))
|
|
98
|
-
])
|
|
99
|
-
]),
|
|
100
|
-
last: withCtx(() => [
|
|
101
|
-
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
102
|
-
createVNode(_sfc_main$1, {
|
|
103
|
-
variant: unref(storyStore).currentVariant,
|
|
104
|
-
story: unref(storyStore).currentStory
|
|
105
|
-
}, null, 8, ["variant", "story"])
|
|
106
|
-
])) : createCommentVNode("", true)
|
|
107
|
-
]),
|
|
108
|
-
_: 1
|
|
109
|
-
}))
|
|
110
|
-
], 64));
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var StoryVariantSingle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30bcb922"]]);
|
|
115
|
-
export { StoryVariantSingle as default };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, unref } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { SandboxVue3 } from "@histoire/plugin-vue/client";
|
|
3
|
-
import StoryResponsivePreview from "./StoryResponsivePreview.js";
|
|
4
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
name: "StoryVariantSinglePreviewNative",
|
|
6
|
-
props: {
|
|
7
|
-
story: null,
|
|
8
|
-
variant: null
|
|
9
|
-
},
|
|
10
|
-
setup(__props) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
Object.assign(props.variant, {
|
|
13
|
-
previewReady: false
|
|
14
|
-
});
|
|
15
|
-
function onReady() {
|
|
16
|
-
Object.assign(props.variant, {
|
|
17
|
-
previewReady: true
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return (_ctx, _cache) => {
|
|
21
|
-
return openBlock(), createBlock(StoryResponsivePreview, { variant: __props.variant }, {
|
|
22
|
-
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight }) => [
|
|
23
|
-
createElementVNode("div", {
|
|
24
|
-
style: normalizeStyle(isResponsiveEnabled ? {
|
|
25
|
-
width: finalWidth ? `${finalWidth}px` : "100%",
|
|
26
|
-
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
27
|
-
} : { width: "100%", height: "100%" })
|
|
28
|
-
}, [
|
|
29
|
-
(openBlock(), createBlock(unref(SandboxVue3), {
|
|
30
|
-
key: `${__props.story.id}-${__props.variant.id}`,
|
|
31
|
-
variant: __props.variant,
|
|
32
|
-
story: __props.story,
|
|
33
|
-
class: "htw-h-full",
|
|
34
|
-
onReady
|
|
35
|
-
}, null, 8, ["variant", "story"]))
|
|
36
|
-
], 4)
|
|
37
|
-
]),
|
|
38
|
-
_: 1
|
|
39
|
-
}, 8, ["variant"]);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
export { _sfc_main as default };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, computed, toRaw, openBlock, createBlock, withCtx, createElementVNode, unref, normalizeClass, normalizeStyle } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { useEventListener } from "@histoire/vendors/dist/client/vue-use.js";
|
|
3
|
-
import { applyState } from "@histoire/shared";
|
|
4
|
-
import { STATE_SYNC, SANDBOX_READY, EVENT_SEND, PREVIEW_SETTINGS_SYNC } from "../../util/const.js";
|
|
5
|
-
import { getSandboxUrl } from "../../util/sandbox.js";
|
|
6
|
-
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
7
|
-
import { useEventsStore } from "../../stores/events.js";
|
|
8
|
-
import StoryResponsivePreview from "./StoryResponsivePreview.js";
|
|
9
|
-
import { toRawDeep } from "../../util/state.js";
|
|
10
|
-
const _hoisted_1 = ["src"];
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
name: "StoryVariantSinglePreviewRemote",
|
|
13
|
-
props: {
|
|
14
|
-
story: null,
|
|
15
|
-
variant: null
|
|
16
|
-
},
|
|
17
|
-
setup(__props) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
20
|
-
const iframe = ref();
|
|
21
|
-
function syncState() {
|
|
22
|
-
if (iframe.value && props.variant.previewReady) {
|
|
23
|
-
iframe.value.contentWindow.postMessage({
|
|
24
|
-
type: STATE_SYNC,
|
|
25
|
-
state: toRawDeep(props.variant.state)
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
let synced = false;
|
|
30
|
-
watch(() => props.variant.state, () => {
|
|
31
|
-
if (synced) {
|
|
32
|
-
synced = false;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
syncState();
|
|
36
|
-
}, {
|
|
37
|
-
deep: true,
|
|
38
|
-
immediate: true
|
|
39
|
-
});
|
|
40
|
-
Object.assign(props.variant, {
|
|
41
|
-
previewReady: false
|
|
42
|
-
});
|
|
43
|
-
useEventListener(window, "message", (event) => {
|
|
44
|
-
switch (event.data.type) {
|
|
45
|
-
case STATE_SYNC:
|
|
46
|
-
updateVariantState(event.data.state);
|
|
47
|
-
break;
|
|
48
|
-
case EVENT_SEND:
|
|
49
|
-
logEvent(event.data.event);
|
|
50
|
-
break;
|
|
51
|
-
case SANDBOX_READY:
|
|
52
|
-
setPreviewReady();
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
function updateVariantState(state) {
|
|
57
|
-
synced = true;
|
|
58
|
-
applyState(props.variant.state, state);
|
|
59
|
-
}
|
|
60
|
-
function logEvent(event) {
|
|
61
|
-
const eventsStore = useEventsStore();
|
|
62
|
-
eventsStore.addEvent(event);
|
|
63
|
-
}
|
|
64
|
-
function setPreviewReady() {
|
|
65
|
-
Object.assign(props.variant, {
|
|
66
|
-
previewReady: true
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
const sandboxUrl = computed(() => {
|
|
70
|
-
return getSandboxUrl(props.story, props.variant);
|
|
71
|
-
});
|
|
72
|
-
const isIframeLoaded = ref(false);
|
|
73
|
-
watch(sandboxUrl, () => {
|
|
74
|
-
isIframeLoaded.value = false;
|
|
75
|
-
});
|
|
76
|
-
function syncSettings() {
|
|
77
|
-
if (iframe.value) {
|
|
78
|
-
iframe.value.contentWindow.postMessage({
|
|
79
|
-
type: PREVIEW_SETTINGS_SYNC,
|
|
80
|
-
settings: toRaw(settings)
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
watch(() => settings, () => {
|
|
85
|
-
syncSettings();
|
|
86
|
-
}, {
|
|
87
|
-
deep: true,
|
|
88
|
-
immediate: true
|
|
89
|
-
});
|
|
90
|
-
function onIframeLoad() {
|
|
91
|
-
isIframeLoaded.value = true;
|
|
92
|
-
syncState();
|
|
93
|
-
syncSettings();
|
|
94
|
-
}
|
|
95
|
-
return (_ctx, _cache) => {
|
|
96
|
-
return openBlock(), createBlock(StoryResponsivePreview, { variant: __props.variant }, {
|
|
97
|
-
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight, resizing }) => [
|
|
98
|
-
createElementVNode("iframe", {
|
|
99
|
-
ref_key: "iframe",
|
|
100
|
-
ref: iframe,
|
|
101
|
-
src: unref(sandboxUrl),
|
|
102
|
-
class: normalizeClass(["htw-w-full htw-h-full htw-relative", {
|
|
103
|
-
"htw-invisible": !isIframeLoaded.value,
|
|
104
|
-
"htw-pointer-events-none": resizing
|
|
105
|
-
}]),
|
|
106
|
-
style: normalizeStyle(isResponsiveEnabled ? {
|
|
107
|
-
width: finalWidth ? `${finalWidth}px` : null,
|
|
108
|
-
height: finalHeight ? `${finalHeight}px` : null
|
|
109
|
-
} : void 0),
|
|
110
|
-
"data-test-id": "preview-iframe",
|
|
111
|
-
onLoad: _cache[0] || (_cache[0] = ($event) => onIframeLoad())
|
|
112
|
-
}, null, 46, _hoisted_1)
|
|
113
|
-
]),
|
|
114
|
-
_: 1
|
|
115
|
-
}, 8, ["variant"]);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
export { _sfc_main as default };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, unref, createVNode, createBlock, createCommentVNode } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { isMobile } from "../../util/responsive.js";
|
|
3
|
-
import _sfc_main$1 from "../toolbar/StoryVariantTitle.js";
|
|
4
|
-
import _sfc_main$2 from "../toolbar/StoryVariantResponsiveSize.js";
|
|
5
|
-
import StoryVariantBackground from "../toolbar/StoryVariantBackground.js";
|
|
6
|
-
import _sfc_main$3 from "../toolbar/StoryVariantNewTab.js";
|
|
7
|
-
import _sfc_main$4 from "./StoryVariantSinglePreviewNative.js";
|
|
8
|
-
import _sfc_main$5 from "./StoryVariantSinglePreviewRemote.js";
|
|
9
|
-
const _hoisted_1 = {
|
|
10
|
-
class: "htw-h-full htw-flex htw-flex-col",
|
|
11
|
-
"data-test-id": "story-variant-single-view"
|
|
12
|
-
};
|
|
13
|
-
const _hoisted_2 = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "htw-flex-none htw-flex htw-items-center htw-h-8 -htw-mt-1"
|
|
16
|
-
};
|
|
17
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
-
name: "StoryVariantSingleView",
|
|
19
|
-
props: {
|
|
20
|
-
variant: null,
|
|
21
|
-
story: null
|
|
22
|
-
},
|
|
23
|
-
setup(__props) {
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
var _a;
|
|
26
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
27
|
-
!unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
28
|
-
createVNode(_sfc_main$1, { variant: __props.variant }, null, 8, ["variant"]),
|
|
29
|
-
!__props.variant.responsiveDisabled ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true),
|
|
30
|
-
createVNode(StoryVariantBackground),
|
|
31
|
-
createVNode(_sfc_main$3, {
|
|
32
|
-
variant: __props.variant,
|
|
33
|
-
story: __props.story
|
|
34
|
-
}, null, 8, ["variant", "story"])
|
|
35
|
-
])) : createCommentVNode("", true),
|
|
36
|
-
((_a = __props.story.layout) == null ? void 0 : _a.iframe) === false ? (openBlock(), createBlock(_sfc_main$4, {
|
|
37
|
-
key: 1,
|
|
38
|
-
story: __props.story,
|
|
39
|
-
variant: __props.variant
|
|
40
|
-
}, null, 8, ["story", "variant"])) : (openBlock(), createBlock(_sfc_main$5, {
|
|
41
|
-
key: 2,
|
|
42
|
-
story: __props.story,
|
|
43
|
-
variant: __props.variant
|
|
44
|
-
}, null, 8, ["story", "variant"]))
|
|
45
|
-
]);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
export { _sfc_main as default };
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, watch, unref, openBlock, createBlock, withCtx, createVNode, createElementBlock } from "@histoire/vendors/dist/client/vue.js";
|
|
21
|
-
import { useRouter, useRoute } from "@histoire/vendors/dist/client/vue-router.js";
|
|
22
|
-
import { Icon } from "@histoire/vendors/dist/client/iconify.js";
|
|
23
|
-
import { useStoryStore } from "../../stores/story.js";
|
|
24
|
-
import BaseSplitPane from "../base/BaseSplitPane.js";
|
|
25
|
-
import BaseEmpty from "../base/BaseEmpty.js";
|
|
26
|
-
import { isMobile } from "../../util/responsive.js";
|
|
27
|
-
import StoryViewer from "./StoryViewer.js";
|
|
28
|
-
import _sfc_main$2 from "../panel/StorySidePanel.js";
|
|
29
|
-
import _sfc_main$1 from "../panel/StoryDocs.js";
|
|
30
|
-
const _hoisted_1 = {
|
|
31
|
-
key: 1,
|
|
32
|
-
class: "htw-h-full"
|
|
33
|
-
};
|
|
34
|
-
const _hoisted_2 = {
|
|
35
|
-
key: 0,
|
|
36
|
-
class: "htw-h-full htw-overflow-auto"
|
|
37
|
-
};
|
|
38
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
39
|
-
name: "StoryView",
|
|
40
|
-
setup(__props) {
|
|
41
|
-
const storyStore = useStoryStore();
|
|
42
|
-
const router = useRouter();
|
|
43
|
-
const route = useRoute();
|
|
44
|
-
watch(() => storyStore.currentVariant, (value) => {
|
|
45
|
-
if (value) {
|
|
46
|
-
storyStore.currentStory.lastSelectedVariant = value;
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
immediate: true
|
|
50
|
-
});
|
|
51
|
-
watch(() => [storyStore.currentStory, storyStore.currentVariant], () => {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
if (!storyStore.currentVariant) {
|
|
54
|
-
if ((_a = storyStore.currentStory) == null ? void 0 : _a.lastSelectedVariant) {
|
|
55
|
-
setVariant(storyStore.currentStory.lastSelectedVariant.id);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (((_b = storyStore.currentStory) == null ? void 0 : _b.variants.length) === 1) {
|
|
59
|
-
setVariant(storyStore.currentStory.variants[0].id);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
immediate: true
|
|
64
|
-
});
|
|
65
|
-
function setVariant(variantId) {
|
|
66
|
-
router.replace(__spreadProps(__spreadValues({}, route), {
|
|
67
|
-
query: __spreadProps(__spreadValues({}, route.query), {
|
|
68
|
-
variantId
|
|
69
|
-
})
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
return (_ctx, _cache) => {
|
|
73
|
-
return !unref(storyStore).currentStory ? (openBlock(), createBlock(BaseEmpty, { key: 0 }, {
|
|
74
|
-
default: withCtx(() => [
|
|
75
|
-
createVNode(unref(Icon), {
|
|
76
|
-
icon: "carbon:software-resource-resource",
|
|
77
|
-
class: "htw-w-16 htw-h-16 htw-opacity-50"
|
|
78
|
-
})
|
|
79
|
-
]),
|
|
80
|
-
_: 1
|
|
81
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
82
|
-
unref(storyStore).currentStory.docsOnly ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
83
|
-
createVNode(_sfc_main$1, {
|
|
84
|
-
story: unref(storyStore).currentStory,
|
|
85
|
-
class: "md:htw-p-12 htw-w-full md:htw-max-w-[600px] lg:htw-max-w-[800px] xl:htw-max-w-[900px]"
|
|
86
|
-
}, null, 8, ["story"])
|
|
87
|
-
])) : unref(isMobile) ? (openBlock(), createBlock(StoryViewer, { key: 1 })) : (openBlock(), createBlock(BaseSplitPane, {
|
|
88
|
-
key: 2,
|
|
89
|
-
"save-id": "story-main",
|
|
90
|
-
min: 30,
|
|
91
|
-
max: 95,
|
|
92
|
-
"default-split": 75,
|
|
93
|
-
class: "htw-h-full"
|
|
94
|
-
}, {
|
|
95
|
-
first: withCtx(() => [
|
|
96
|
-
createVNode(StoryViewer)
|
|
97
|
-
]),
|
|
98
|
-
last: withCtx(() => [
|
|
99
|
-
createVNode(_sfc_main$2)
|
|
100
|
-
]),
|
|
101
|
-
_: 1
|
|
102
|
-
}))
|
|
103
|
-
]));
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
export { _sfc_main as default };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, defineComponent, useCssVars, unref, computed, ref, watch, openBlock, createElementBlock, Fragment, createElementVNode, createBlock, createCommentVNode, createVNode, withCtx, renderList } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
-
import StoryVariantListItem from "./StoryVariantListItem.js";
|
|
4
|
-
import _sfc_main$2 from "../app/MobileOverlay.js";
|
|
5
|
-
import _sfc_main$1 from "./StoryVariantGrid.js";
|
|
6
|
-
import StoryVariantSingle from "./StoryVariantSingle.js";
|
|
7
|
-
import "./StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
8
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-356879fc"), n = n(), popScopeId(), n);
|
|
10
|
-
const _hoisted_1 = { class: "htw-bg-gray-50 htw-h-full dark:htw-bg-gray-750" };
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
name: "StoryViewer",
|
|
13
|
-
setup(__props) {
|
|
14
|
-
useCssVars((_ctx) => {
|
|
15
|
-
var _a;
|
|
16
|
-
return {
|
|
17
|
-
"578fcd62": (_a = unref(variant)) == null ? void 0 : _a.iconColor
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
const storyStore = useStoryStore();
|
|
21
|
-
const variant = computed(() => storyStore.currentVariant);
|
|
22
|
-
const isMenuOpened = ref(false);
|
|
23
|
-
function closeMenu() {
|
|
24
|
-
isMenuOpened.value = false;
|
|
25
|
-
}
|
|
26
|
-
watch(variant, () => {
|
|
27
|
-
isMenuOpened.value = false;
|
|
28
|
-
});
|
|
29
|
-
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
31
|
-
createElementVNode("div", _hoisted_1, [
|
|
32
|
-
unref(storyStore).currentStory.layout.type === "grid" ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : unref(storyStore).currentStory.layout.type === "single" ? (openBlock(), createBlock(StoryVariantSingle, {
|
|
33
|
-
key: 1,
|
|
34
|
-
onOpenVariantMenu: _cache[0] || (_cache[0] = ($event) => isMenuOpened.value = true)
|
|
35
|
-
})) : createCommentVNode("", true)
|
|
36
|
-
]),
|
|
37
|
-
createVNode(_sfc_main$2, {
|
|
38
|
-
title: "Select a variant",
|
|
39
|
-
opened: isMenuOpened.value,
|
|
40
|
-
onClose: closeMenu
|
|
41
|
-
}, {
|
|
42
|
-
default: withCtx(() => [
|
|
43
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
44
|
-
return openBlock(), createBlock(StoryVariantListItem, {
|
|
45
|
-
key: index,
|
|
46
|
-
variant: v
|
|
47
|
-
}, null, 8, ["variant"]);
|
|
48
|
-
}), 128))
|
|
49
|
-
]),
|
|
50
|
-
_: 1
|
|
51
|
-
}, 8, ["opened"])
|
|
52
|
-
], 64);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
var StoryViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-356879fc"]]);
|
|
57
|
-
export { StoryViewer as default };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, createElementVNode, createTextVNode, defineComponent, useCssVars, unref, resolveComponent, resolveDirective, openBlock, createBlock, withCtx, createVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, normalizeStyle, createCommentVNode, withDirectives } from "@histoire/vendors/dist/client/vue.js";
|
|
2
|
-
import { Icon } from "@histoire/vendors/dist/client/iconify.js";
|
|
3
|
-
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
|
-
import { histoireConfig } from "../../util/config.js";
|
|
5
|
-
import _sfc_main$1 from "../base/BaseCheckbox.js";
|
|
6
|
-
import "./StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
7
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
8
|
-
const _withScopeId = (n) => (pushScopeId("data-v-bde73868"), n = n(), popScopeId(), n);
|
|
9
|
-
const _hoisted_1 = { class: "htw-cursor-pointer hover:htw-text-primary-500 htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group" };
|
|
10
|
-
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bind-preview-bg htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/50 dark:htw-border-white/50" }, null, -1));
|
|
11
|
-
const _hoisted_3 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
12
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode(" Checkerboard ");
|
|
13
|
-
const _hoisted_5 = ["onClick"];
|
|
14
|
-
const _hoisted_6 = { class: "htw-mr-auto" };
|
|
15
|
-
const _hoisted_7 = { class: "htw-ml-auto htw-opacity-70" };
|
|
16
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
-
name: "StoryVariantBackground",
|
|
18
|
-
setup(__props) {
|
|
19
|
-
useCssVars((_ctx) => ({
|
|
20
|
-
"b797c7ca": unref(settings).backgroundColor
|
|
21
|
-
}));
|
|
22
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
const _component_VDropdown = resolveComponent("VDropdown");
|
|
25
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
26
|
-
return unref(histoireConfig).backgroundPresets.length ? (openBlock(), createBlock(_component_VDropdown, {
|
|
27
|
-
key: 0,
|
|
28
|
-
placement: "bottom-end",
|
|
29
|
-
skidding: 6,
|
|
30
|
-
class: "htw-h-full htw-flex-none"
|
|
31
|
-
}, {
|
|
32
|
-
popper: withCtx(({ hide }) => [
|
|
33
|
-
createElementVNode("div", _hoisted_3, [
|
|
34
|
-
createVNode(_sfc_main$1, {
|
|
35
|
-
modelValue: unref(settings).checkerboard,
|
|
36
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).checkerboard = $event)
|
|
37
|
-
}, {
|
|
38
|
-
default: withCtx(() => [
|
|
39
|
-
_hoisted_4
|
|
40
|
-
]),
|
|
41
|
-
_: 1
|
|
42
|
-
}, 8, ["modelValue"]),
|
|
43
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(histoireConfig).backgroundPresets, (option, index) => {
|
|
44
|
-
return openBlock(), createElementBlock("button", {
|
|
45
|
-
key: index,
|
|
46
|
-
class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4", [
|
|
47
|
-
unref(settings).backgroundColor === option.color ? "htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black" : "htw-bg-transparent hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700"
|
|
48
|
-
]]),
|
|
49
|
-
onClick: ($event) => {
|
|
50
|
-
unref(settings).backgroundColor = option.color;
|
|
51
|
-
hide();
|
|
52
|
-
}
|
|
53
|
-
}, [
|
|
54
|
-
createElementVNode("span", _hoisted_6, toDisplayString(option.label), 1),
|
|
55
|
-
option.color !== "$checkerboard" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
56
|
-
createElementVNode("span", _hoisted_7, toDisplayString(option.color), 1),
|
|
57
|
-
createElementVNode("div", {
|
|
58
|
-
class: "htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/20 dark:htw-border-white/20",
|
|
59
|
-
style: normalizeStyle({
|
|
60
|
-
backgroundColor: option.color
|
|
61
|
-
})
|
|
62
|
-
}, null, 4)
|
|
63
|
-
], 64)) : createCommentVNode("", true)
|
|
64
|
-
], 10, _hoisted_5);
|
|
65
|
-
}), 128))
|
|
66
|
-
])
|
|
67
|
-
]),
|
|
68
|
-
default: withCtx(() => [
|
|
69
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
70
|
-
_hoisted_2,
|
|
71
|
-
createVNode(unref(Icon), {
|
|
72
|
-
icon: "carbon:caret-down",
|
|
73
|
-
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
74
|
-
})
|
|
75
|
-
])), [
|
|
76
|
-
[_directive_tooltip, "Background color"]
|
|
77
|
-
])
|
|
78
|
-
]),
|
|
79
|
-
_: 1
|
|
80
|
-
})) : createCommentVNode("", true);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
var StoryVariantBackground = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bde73868"]]);
|
|
85
|
-
export { StoryVariantBackground as default };
|