@poveste/app 0.2.1 → 0.3.1
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/dist/app/style/floating.pcss +16 -10
- package/dist/app/style/main.pcss +190 -30
- package/dist/app/style/sandbox.css +3 -1
- package/dist/app/style/transitions.pcss +49 -50
- package/dist/bundled/App.js +5 -0
- package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +169 -0
- package/dist/bundled/_virtual/_plugin-vue_export-helper.js +7 -9
- package/dist/bundled/api.js +5 -9
- package/dist/bundled/app.css +66 -39
- package/dist/bundled/assets/poveste-text-dark.js +4 -0
- package/dist/bundled/assets/poveste-text.js +4 -0
- package/dist/bundled/assets/poveste.js +4 -0
- package/dist/bundled/components/HomeView.js +5 -0
- package/dist/bundled/components/HomeView.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/bundled/components/app/AppActions.js +5 -0
- package/dist/bundled/components/app/AppActions.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/bundled/components/app/AppHeader.js +5 -0
- package/dist/bundled/components/app/AppHeader.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/bundled/components/app/AppLogo.js +5 -0
- package/dist/bundled/components/app/AppLogo.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/app/Breadcrumb.js +7 -0
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/bundled/components/app/HomeCounter.js +7 -0
- package/dist/bundled/components/app/HomeCounter.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/bundled/components/app/InitialLoading.js +5 -0
- package/dist/bundled/components/app/InitialLoading.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/bundled/components/app/MobileOverlay.js +5 -0
- package/dist/bundled/components/app/MobileOverlay.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/bundled/components/app/TopBar.js +5 -0
- package/dist/bundled/components/app/TopBar.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/bundled/components/app/TopBarChip.js +11 -0
- package/dist/bundled/components/app/TopBarChipItem.js +11 -0
- package/dist/bundled/components/base/BaseButton.js +5 -0
- package/dist/bundled/components/base/BaseButton.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/bundled/components/base/BaseCheckbox.js +5 -0
- package/dist/bundled/components/base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/bundled/components/base/BaseEmpty.js +12 -0
- package/dist/bundled/components/base/BaseIcon.js +7 -0
- package/dist/bundled/components/base/BaseIcon.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/base/BaseKeyboardShortcut.js +5 -0
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/bundled/components/base/BaseListItem.js +5 -0
- package/dist/bundled/components/base/BaseListItem.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/bundled/components/base/BaseListItemLink.js +24 -0
- package/dist/bundled/components/base/BaseListItemLink.vue_vue_type_script_lang.js +19 -0
- package/dist/bundled/components/base/BaseOverflowMenu.js +5 -0
- package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/bundled/components/base/BaseOverflowTab.js +26 -0
- package/dist/bundled/components/base/BaseOverflowTab.vue_vue_type_script_lang.js +17 -0
- package/dist/bundled/components/base/BaseSelect.js +5 -0
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/bundled/components/base/BaseSplitPane.js +7 -0
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +159 -0
- package/dist/bundled/components/base/BaseTab.js +26 -0
- package/dist/bundled/components/base/BaseTab.vue_vue_type_script_lang.js +17 -0
- package/dist/bundled/components/base/BaseTag.js +11 -0
- package/dist/bundled/components/command/CommandPrompts.js +5 -0
- package/dist/bundled/components/command/CommandPrompts.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/bundled/components/command/CommandPromptsModal.js +5 -0
- package/dist/bundled/components/command/CommandPromptsModal.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/bundled/components/command/PromptSelect.js +5 -0
- package/dist/bundled/components/command/PromptSelect.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/bundled/components/command/PromptText.js +5 -0
- package/dist/bundled/components/command/PromptText.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/bundled/components/layout/LayoutItem.js +5 -0
- package/dist/bundled/components/layout/LayoutItem.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/bundled/components/layout/LayoutItemGroup.js +5 -0
- package/dist/bundled/components/layout/LayoutItemGroup.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/bundled/components/layout/LayoutModal.js +5 -0
- package/dist/bundled/components/layout/LayoutModal.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/bundled/components/layout/LayoutPane.js +5 -0
- package/dist/bundled/components/layout/LayoutPane.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/bundled/components/misc/CheckerboardPattern.js +34 -0
- package/dist/bundled/components/misc/HatchedPattern.js +12 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/bundled/components/panel/ControlsComponentProps.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/bundled/components/panel/ControlsComponentState.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentState.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/bundled/components/panel/ControlsComponentStateItem.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/bundled/components/panel/PaneTabs.js +5 -0
- package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/bundled/components/panel/StatePresets.js +5 -0
- package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +147 -0
- package/dist/bundled/components/panel/StoryControls.js +5 -0
- package/dist/bundled/components/panel/StoryControls.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/bundled/components/panel/StoryDocs.js +5 -0
- package/dist/bundled/components/panel/StoryDocs.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/bundled/components/panel/StoryEvent.js +5 -0
- package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/bundled/components/panel/StoryEvents.js +5 -0
- package/dist/bundled/components/panel/StoryEvents.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/bundled/components/panel/StorySidePanel.js +5 -0
- package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/bundled/components/panel/StorySourceCode.js +7 -0
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/bundled/components/search/SearchItem.js +7 -0
- package/dist/bundled/components/search/SearchItem.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/bundled/components/search/SearchItemContent.js +5 -0
- package/dist/bundled/components/search/SearchItemContent.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/bundled/components/search/SearchLoading.js +5 -0
- package/dist/bundled/components/search/SearchLoading.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/bundled/components/search/SearchModal.js +5 -0
- package/dist/bundled/components/search/SearchModal.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/bundled/components/search/SearchPane.js +5 -0
- package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +229 -0
- package/dist/bundled/components/search/search-docs-data.js +6 -8
- package/dist/bundled/components/search/search-title-data.js +7 -9
- package/dist/bundled/components/story/GenericMountStory.js +5 -0
- package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/bundled/components/story/GenericRenderStory.js +5 -0
- package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/bundled/components/story/StoryResponsivePreview.js +7 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/bundled/components/story/StoryVariantGrid.js +5 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/bundled/components/story/StoryVariantGridItem.js +7 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/bundled/components/story/StoryVariantListItem.js +7 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/bundled/components/story/StoryVariantSingle.js +7 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +5 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +5 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/bundled/components/story/StoryVariantSingleView.js +5 -0
- package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/bundled/components/story/StoryView.js +5 -0
- package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/bundled/components/story/StoryViewer.js +7 -0
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.js +5 -0
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.js +7 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_script_setup_true_lang.js +109 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/bundled/components/toolbar/ToolbarTextDirection.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.js +7 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/bundled/components/tree/StoryGroup.js +5 -0
- package/dist/bundled/components/tree/StoryGroup.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/bundled/components/tree/StoryList.js +5 -0
- package/dist/bundled/components/tree/StoryList.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/bundled/components/tree/StoryListFolder.js +7 -0
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/bundled/components/tree/StoryListItem.js +7 -0
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/bundled/index.js +24 -33
- package/dist/bundled/plugin.js +43 -46
- package/dist/bundled/router.js +20 -28
- package/dist/bundled/sandbox.js +85 -99
- package/dist/bundled/stores/command.js +21 -23
- package/dist/bundled/stores/events.js +26 -27
- package/dist/bundled/stores/folder.js +37 -51
- package/dist/bundled/stores/layout.js +9 -13
- package/dist/bundled/stores/preview-settings.js +28 -31
- package/dist/bundled/stores/story.js +54 -41
- package/dist/bundled/util/color-scheme.js +29 -21
- package/dist/bundled/util/commands.js +39 -50
- package/dist/bundled/util/config.js +5 -7
- package/dist/bundled/util/const.js +8 -12
- package/dist/bundled/util/dark.js +16 -20
- package/dist/bundled/util/docs.js +14 -23
- package/dist/bundled/util/env.js +4 -4
- package/dist/bundled/util/events.js +22 -28
- package/dist/bundled/util/highlighter.js +23 -0
- package/dist/bundled/util/keyboard.js +89 -103
- package/dist/bundled/util/mapping.js +49 -64
- package/dist/bundled/util/open-in-editor.js +4 -4
- package/dist/bundled/util/preview-settings.js +23 -26
- package/dist/bundled/util/responsive.js +4 -5
- package/dist/bundled/util/sandbox.js +7 -8
- package/dist/bundled/util/scroll.js +20 -28
- package/dist/bundled/util/select.js +21 -26
- package/dist/bundled/util/state.js +25 -36
- package/dist/bundled/util/tooltip.js +8 -9
- package/dist/bundled/util/variant.js +14 -17
- package/dist/style.css +2828 -2953
- package/package.json +12 -9
- package/src/__tests__/postcss-scope-wrapper.spec.ts +65 -0
- package/src/app/App.vue +16 -16
- package/src/app/components/HomeView.vue +8 -3
- package/src/app/components/app/AppActions.vue +3 -3
- package/src/app/components/app/AppHeader.vue +4 -4
- package/src/app/components/app/Breadcrumb.vue +8 -8
- package/src/app/components/app/HomeCounter.vue +59 -13
- package/src/app/components/app/InitialLoading.vue +5 -5
- package/src/app/components/app/MobileOverlay.vue +5 -5
- package/src/app/components/app/TopBar.vue +4 -4
- package/src/app/components/app/TopBarChip.vue +1 -1
- package/src/app/components/app/TopBarChipItem.vue +1 -1
- package/src/app/components/base/BaseButton.vue +3 -3
- package/src/app/components/base/BaseCheckbox.vue +9 -9
- package/src/app/components/base/BaseCopyIcon.vue +1 -1
- package/src/app/components/base/BaseEmpty.vue +4 -4
- package/src/app/components/base/BaseKeyboardShortcut.vue +1 -1
- package/src/app/components/base/BaseListItem.vue +3 -3
- package/src/app/components/base/BaseListItemLink.vue +3 -3
- package/src/app/components/base/BaseOverflowMenu.vue +4 -4
- package/src/app/components/base/BaseOverflowTab.vue +3 -3
- package/src/app/components/base/BaseSelect.vue +6 -6
- package/src/app/components/base/BaseSplitPane.vue +18 -18
- package/src/app/components/base/BaseTab.vue +3 -3
- package/src/app/components/base/BaseTag.vue +1 -1
- package/src/app/components/command/CommandPrompts.vue +5 -5
- package/src/app/components/command/CommandPromptsModal.vue +5 -5
- package/src/app/components/command/PromptSelect.vue +14 -14
- package/src/app/components/command/PromptText.vue +4 -4
- package/src/app/components/layout/LayoutItem.vue +4 -4
- package/src/app/components/layout/LayoutItemGroup.vue +1 -1
- package/src/app/components/layout/LayoutModal.vue +7 -7
- package/src/app/components/layout/LayoutPane.vue +1 -1
- package/src/app/components/panel/ControlsComponentPropItem.vue +2 -2
- package/src/app/components/panel/ControlsComponentProps.vue +3 -3
- package/src/app/components/panel/ControlsComponentState.vue +2 -2
- package/src/app/components/panel/PaneTabs.vue +4 -4
- package/src/app/components/panel/StatePresets.vue +16 -16
- package/src/app/components/panel/StoryControls.vue +7 -8
- package/src/app/components/panel/StoryDocs.vue +5 -5
- package/src/app/components/panel/StoryEvent.vue +7 -7
- package/src/app/components/panel/StoryEvents.vue +1 -1
- package/src/app/components/panel/StorySidePanel.vue +6 -6
- package/src/app/components/panel/StorySourceCode.vue +31 -33
- package/src/app/components/search/SearchItem.vue +5 -17
- package/src/app/components/search/SearchItemContent.vue +9 -9
- package/src/app/components/search/SearchLoading.vue +2 -2
- package/src/app/components/search/SearchModal.vue +9 -9
- package/src/app/components/search/SearchPane.vue +41 -17
- package/src/app/components/story/StoryResponsivePreview.vue +27 -27
- package/src/app/components/story/StoryVariantGrid.vue +5 -5
- package/src/app/components/story/StoryVariantGridItem.vue +21 -21
- package/src/app/components/story/StoryVariantListItem.vue +4 -4
- package/src/app/components/story/StoryVariantSingle.vue +9 -9
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +7 -8
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +15 -14
- package/src/app/components/story/StoryVariantSingleView.vue +1 -1
- package/src/app/components/story/StoryView.vue +5 -5
- package/src/app/components/story/StoryViewer.vue +1 -1
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +1 -1
- package/src/app/components/toolbar/ToolbarBackground.vue +16 -16
- package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +14 -14
- package/src/app/components/toolbar/ToolbarTextDirection.vue +1 -1
- package/src/app/components/toolbar/ToolbarTitle.vue +6 -6
- package/src/app/components/tree/StoryGroup.vue +5 -5
- package/src/app/components/tree/StoryList.vue +1 -1
- package/src/app/components/tree/StoryListFolder.vue +6 -6
- package/src/app/components/tree/StoryListItem.vue +6 -6
- package/src/app/sandbox.ts +36 -10
- package/src/app/stores/story.ts +17 -0
- package/src/app/style/floating.pcss +16 -10
- package/src/app/style/main.pcss +190 -30
- package/src/app/style/sandbox.css +3 -1
- package/src/app/style/transitions.pcss +49 -50
- package/src/app/util/env.ts +5 -0
- package/src/app/util/events.ts +0 -1
- package/src/app/util/highlighter.ts +32 -0
- package/src/app/util/scroll.ts +2 -1
- package/src/app/util/tooltip.ts +2 -2
- package/dist/bundled/App.vue.js +0 -5
- package/dist/bundled/App.vue2.js +0 -211
- package/dist/bundled/assets/poveste-text-dark.svg.js +0 -4
- package/dist/bundled/assets/poveste-text.svg.js +0 -4
- package/dist/bundled/assets/poveste.svg.js +0 -4
- package/dist/bundled/components/HomeView.vue.js +0 -5
- package/dist/bundled/components/HomeView.vue2.js +0 -66
- package/dist/bundled/components/app/AppActions.vue.js +0 -5
- package/dist/bundled/components/app/AppActions.vue2.js +0 -76
- package/dist/bundled/components/app/AppHeader.vue.js +0 -5
- package/dist/bundled/components/app/AppHeader.vue2.js +0 -29
- package/dist/bundled/components/app/AppLogo.vue.js +0 -5
- package/dist/bundled/components/app/AppLogo.vue2.js +0 -29
- package/dist/bundled/components/app/Breadcrumb.vue.js +0 -8
- package/dist/bundled/components/app/Breadcrumb.vue2.js +0 -91
- package/dist/bundled/components/app/HomeCounter.vue.js +0 -5
- package/dist/bundled/components/app/HomeCounter.vue2.js +0 -42
- package/dist/bundled/components/app/InitialLoading.vue.js +0 -5
- package/dist/bundled/components/app/InitialLoading.vue2.js +0 -51
- package/dist/bundled/components/app/MobileOverlay.vue.js +0 -5
- package/dist/bundled/components/app/MobileOverlay.vue2.js +0 -45
- package/dist/bundled/components/app/TopBar.vue.js +0 -5
- package/dist/bundled/components/app/TopBar.vue2.js +0 -73
- package/dist/bundled/components/app/TopBarChip.vue.js +0 -13
- package/dist/bundled/components/app/TopBarChipItem.vue.js +0 -13
- package/dist/bundled/components/base/BaseButton.vue.js +0 -5
- package/dist/bundled/components/base/BaseButton.vue2.js +0 -39
- package/dist/bundled/components/base/BaseCheckbox.vue.js +0 -5
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +0 -78
- package/dist/bundled/components/base/BaseEmpty.vue.js +0 -14
- package/dist/bundled/components/base/BaseIcon.vue.js +0 -8
- package/dist/bundled/components/base/BaseIcon.vue2.js +0 -29
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue.js +0 -5
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +0 -20
- package/dist/bundled/components/base/BaseListItem.vue.js +0 -5
- package/dist/bundled/components/base/BaseListItem.vue2.js +0 -33
- package/dist/bundled/components/base/BaseListItemLink.vue.js +0 -33
- package/dist/bundled/components/base/BaseListItemLink.vue2.js +0 -26
- package/dist/bundled/components/base/BaseOverflowMenu.vue.js +0 -5
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +0 -100
- package/dist/bundled/components/base/BaseOverflowTab.vue.js +0 -36
- package/dist/bundled/components/base/BaseOverflowTab.vue2.js +0 -18
- package/dist/bundled/components/base/BaseSelect.vue.js +0 -5
- package/dist/bundled/components/base/BaseSelect.vue2.js +0 -77
- package/dist/bundled/components/base/BaseSplitPane.vue.js +0 -8
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +0 -187
- package/dist/bundled/components/base/BaseTab.vue.js +0 -36
- package/dist/bundled/components/base/BaseTab.vue2.js +0 -18
- package/dist/bundled/components/base/BaseTag.vue.js +0 -13
- package/dist/bundled/components/command/CommandPrompts.vue.js +0 -5
- package/dist/bundled/components/command/CommandPrompts.vue2.js +0 -91
- package/dist/bundled/components/command/CommandPromptsModal.vue.js +0 -5
- package/dist/bundled/components/command/CommandPromptsModal.vue2.js +0 -45
- package/dist/bundled/components/command/PromptSelect.vue.js +0 -5
- package/dist/bundled/components/command/PromptSelect.vue2.js +0 -142
- package/dist/bundled/components/command/PromptText.vue.js +0 -5
- package/dist/bundled/components/command/PromptText.vue2.js +0 -67
- package/dist/bundled/components/layout/LayoutItem.vue.js +0 -5
- package/dist/bundled/components/layout/LayoutItem.vue2.js +0 -44
- package/dist/bundled/components/layout/LayoutItemGroup.vue.js +0 -5
- package/dist/bundled/components/layout/LayoutItemGroup.vue2.js +0 -25
- package/dist/bundled/components/layout/LayoutModal.vue.js +0 -5
- package/dist/bundled/components/layout/LayoutModal.vue2.js +0 -68
- package/dist/bundled/components/layout/LayoutPane.vue.js +0 -5
- package/dist/bundled/components/layout/LayoutPane.vue2.js +0 -59
- package/dist/bundled/components/misc/CheckerboardPattern.vue.js +0 -40
- package/dist/bundled/components/misc/HatchedPattern.vue.js +0 -12
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +0 -72
- package/dist/bundled/components/panel/ControlsComponentProps.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +0 -45
- package/dist/bundled/components/panel/ControlsComponentState.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentState.vue2.js +0 -41
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue2.js +0 -46
- package/dist/bundled/components/panel/PaneTabs.vue.js +0 -5
- package/dist/bundled/components/panel/PaneTabs.vue2.js +0 -114
- package/dist/bundled/components/panel/StatePresets.vue.js +0 -5
- package/dist/bundled/components/panel/StatePresets.vue2.js +0 -193
- package/dist/bundled/components/panel/StoryControls.vue.js +0 -5
- package/dist/bundled/components/panel/StoryControls.vue2.js +0 -87
- package/dist/bundled/components/panel/StoryDocs.vue.js +0 -7
- package/dist/bundled/components/panel/StoryDocs.vue2.js +0 -161
- package/dist/bundled/components/panel/StoryEvent.vue.js +0 -5
- package/dist/bundled/components/panel/StoryEvent.vue2.js +0 -59
- package/dist/bundled/components/panel/StoryEvents.vue.js +0 -5
- package/dist/bundled/components/panel/StoryEvents.vue2.js +0 -53
- package/dist/bundled/components/panel/StorySidePanel.vue.js +0 -5
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +0 -94
- package/dist/bundled/components/panel/StorySourceCode.vue.js +0 -8
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +0 -204
- package/dist/bundled/components/search/SearchItem.vue.js +0 -8
- package/dist/bundled/components/search/SearchItem.vue2.js +0 -93
- package/dist/bundled/components/search/SearchItemContent.vue.js +0 -5
- package/dist/bundled/components/search/SearchItemContent.vue2.js +0 -71
- package/dist/bundled/components/search/SearchLoading.vue.js +0 -5
- package/dist/bundled/components/search/SearchLoading.vue2.js +0 -21
- package/dist/bundled/components/search/SearchModal.vue.js +0 -5
- package/dist/bundled/components/search/SearchModal.vue2.js +0 -51
- package/dist/bundled/components/search/SearchPane.vue.js +0 -5
- package/dist/bundled/components/search/SearchPane.vue2.js +0 -272
- package/dist/bundled/components/story/GenericMountStory.vue.js +0 -5
- package/dist/bundled/components/story/GenericMountStory.vue2.js +0 -34
- package/dist/bundled/components/story/GenericRenderStory.vue.js +0 -5
- package/dist/bundled/components/story/GenericRenderStory.vue2.js +0 -39
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +0 -8
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +0 -207
- package/dist/bundled/components/story/StoryVariantGrid.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +0 -127
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +0 -170
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +0 -55
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +0 -107
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +0 -73
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +0 -153
- package/dist/bundled/components/story/StoryVariantSingleView.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +0 -35
- package/dist/bundled/components/story/StoryView.vue.js +0 -5
- package/dist/bundled/components/story/StoryView.vue2.js +0 -114
- package/dist/bundled/components/story/StoryViewer.vue.js +0 -8
- package/dist/bundled/components/story/StoryViewer.vue2.js +0 -55
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue.js +0 -5
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +0 -35
- package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +0 -8
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +0 -127
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +0 -39
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +0 -127
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +0 -31
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +0 -8
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +0 -49
- package/dist/bundled/components/tree/StoryGroup.vue.js +0 -5
- package/dist/bundled/components/tree/StoryGroup.vue2.js +0 -74
- package/dist/bundled/components/tree/StoryList.vue.js +0 -5
- package/dist/bundled/components/tree/StoryList.vue2.js +0 -41
- package/dist/bundled/components/tree/StoryListFolder.vue.js +0 -8
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +0 -86
- package/dist/bundled/components/tree/StoryListItem.vue.js +0 -8
- package/dist/bundled/components/tree/StoryListItem.vue2.js +0 -69
|
@@ -1,54 +1,40 @@
|
|
|
1
|
+
import { useStoryStore } from "./story.js";
|
|
1
2
|
import { useStorage } from "@poveste/vendors/vue-use";
|
|
2
|
-
import { defineStore } from "@poveste/vendors/pinia";
|
|
3
3
|
import { watch } from "@poveste/vendors/vue";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setFolderOpen(path.slice(0, pathLength), true);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const storyStore = useStoryStore();
|
|
42
|
-
watch(() => storyStore.currentStory, (story) => {
|
|
43
|
-
if (story) {
|
|
44
|
-
openFileFolders(story.file.path);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
isFolderOpened,
|
|
49
|
-
toggleFolder
|
|
50
|
-
};
|
|
4
|
+
import { defineStore } from "@poveste/vendors/pinia";
|
|
5
|
+
//#region src/app/stores/folder.ts
|
|
6
|
+
var useFolderStore = defineStore("folder", () => {
|
|
7
|
+
const openedFolders = useStorage("_poveste-tree-state", /* @__PURE__ */ new Map());
|
|
8
|
+
function getStringPath(path) {
|
|
9
|
+
return path.join("␜");
|
|
10
|
+
}
|
|
11
|
+
function toggleFolder(path, defaultToggleValue = true) {
|
|
12
|
+
const stringPath = getStringPath(path);
|
|
13
|
+
const currentValue = openedFolders.value.get(stringPath);
|
|
14
|
+
if (currentValue == null) setFolderOpen(stringPath, defaultToggleValue);
|
|
15
|
+
else if (currentValue) setFolderOpen(stringPath, false);
|
|
16
|
+
else setFolderOpen(stringPath, true);
|
|
17
|
+
}
|
|
18
|
+
function setFolderOpen(path, value) {
|
|
19
|
+
const stringPath = typeof path === "string" ? path : getStringPath(path);
|
|
20
|
+
openedFolders.value.set(stringPath, value);
|
|
21
|
+
}
|
|
22
|
+
function isFolderOpened(path, defaultValue = false) {
|
|
23
|
+
const value = openedFolders.value.get(getStringPath(path));
|
|
24
|
+
if (value == null) return defaultValue;
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function openFileFolders(path) {
|
|
28
|
+
for (let pathLength = 1; pathLength < path.length; pathLength++) setFolderOpen(path.slice(0, pathLength), true);
|
|
29
|
+
}
|
|
30
|
+
const storyStore = useStoryStore();
|
|
31
|
+
watch(() => storyStore.currentStory, (story) => {
|
|
32
|
+
if (story) openFileFolders(story.file.path);
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
isFolderOpened,
|
|
36
|
+
toggleFolder
|
|
37
|
+
};
|
|
51
38
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { useFolderStore };
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { useStorage } from "@poveste/vendors/vue-use";
|
|
2
2
|
import { defineStore } from "@poveste/vendors/pinia";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
settings
|
|
12
|
-
};
|
|
3
|
+
//#region src/app/stores/layout.ts
|
|
4
|
+
var useLayoutStore = defineStore("layout", () => {
|
|
5
|
+
return { settings: useStorage("_poveste-layout-v1", {
|
|
6
|
+
storyListVisible: true,
|
|
7
|
+
storyOptionsVisible: true,
|
|
8
|
+
storyOptionsPlacement: "right"
|
|
9
|
+
}) };
|
|
13
10
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useLayoutStore };
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
import { useStorage } from "@poveste/vendors/vue-use";
|
|
2
|
-
import { defineStore } from "@poveste/vendors/pinia";
|
|
3
|
-
import { defaultPreviewColorScheme } from "../util/color-scheme.js";
|
|
4
1
|
import { povesteConfig } from "../util/config.js";
|
|
2
|
+
import { defaultPreviewColorScheme } from "../util/color-scheme.js";
|
|
5
3
|
import { PREVIEW_SETTINGS_STORAGE_KEY } from "../util/preview-settings.js";
|
|
6
|
-
"use
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
4
|
+
import { useStorage } from "@poveste/vendors/vue-use";
|
|
5
|
+
import { defineStore } from "@poveste/vendors/pinia";
|
|
6
|
+
//#region src/app/stores/preview-settings.ts
|
|
7
|
+
var usePreviewSettingsStore = defineStore("preview-settings", () => {
|
|
8
|
+
const currentSettings = useStorage(PREVIEW_SETTINGS_STORAGE_KEY, {
|
|
9
|
+
responsiveWidth: 720,
|
|
10
|
+
responsiveHeight: null,
|
|
11
|
+
rotate: false,
|
|
12
|
+
backgroundColor: povesteConfig.defaultBackgroundColor ?? "transparent",
|
|
13
|
+
backgroundColorPicked: false,
|
|
14
|
+
checkerboard: false,
|
|
15
|
+
textDirection: "ltr",
|
|
16
|
+
colorScheme: defaultPreviewColorScheme
|
|
17
|
+
});
|
|
18
|
+
const configBg = povesteConfig.defaultBackgroundColor;
|
|
19
|
+
if (configBg && !currentSettings.value.backgroundColorPicked) currentSettings.value.backgroundColor = configBg;
|
|
20
|
+
currentSettings.value.colorScheme ??= defaultPreviewColorScheme;
|
|
21
|
+
function setBackgroundColor(color) {
|
|
22
|
+
currentSettings.value.backgroundColor = color;
|
|
23
|
+
currentSettings.value.backgroundColorPicked = true;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
currentSettings,
|
|
27
|
+
setBackgroundColor
|
|
28
|
+
};
|
|
31
29
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { usePreviewSettingsStore };
|
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
import { defineStore } from "@poveste/vendors/pinia";
|
|
2
|
-
import { ref, computed } from "@poveste/vendors/vue";
|
|
3
1
|
import { router } from "../router.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
import { computed, ref } from "@poveste/vendors/vue";
|
|
3
|
+
import { defineStore } from "@poveste/vendors/pinia";
|
|
4
|
+
//#region src/app/stores/story.ts
|
|
5
|
+
var useStoryStore = defineStore("story", () => {
|
|
6
|
+
const stories = ref([]);
|
|
7
|
+
function setStories(value) {
|
|
8
|
+
stories.value = value;
|
|
9
|
+
}
|
|
10
|
+
const currentStory = computed(() => stories.value.find((s) => s.id === router.currentRoute.value.params.storyId));
|
|
11
|
+
const currentVariant = computed(() => currentStory.value?.variants.find((v) => v.id === router.currentRoute.value.query.variantId));
|
|
12
|
+
const maps = computed(() => {
|
|
13
|
+
const storyMap = /* @__PURE__ */ new Map();
|
|
14
|
+
const variantMap = /* @__PURE__ */ new Map();
|
|
15
|
+
for (const story of stories.value) {
|
|
16
|
+
storyMap.set(story.id, story);
|
|
17
|
+
for (const variant of story.variants) variantMap.set(`${story.id}:${variant.id}`, variant);
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
stories: storyMap,
|
|
21
|
+
variants: variantMap
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
function getStoryById(id) {
|
|
25
|
+
return maps.value.stories.get(id);
|
|
26
|
+
}
|
|
27
|
+
function getVariantById(idWithStoryId) {
|
|
28
|
+
return maps.value.variants.get(idWithStoryId);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether a variant's preview has finished mounting. The preview components
|
|
32
|
+
* report it and `StorySidePanel` waits on it, so it has to be reachable from
|
|
33
|
+
* both — and it stays a field on the variant rather than a map in here
|
|
34
|
+
* because it pairs with `configReady`, which the framework plugins write from
|
|
35
|
+
* inside the sandbox. The side panel reads the two together; splitting them
|
|
36
|
+
* across two owners would make that condition harder to follow, not easier.
|
|
37
|
+
*
|
|
38
|
+
* What does belong here is the write. This store owns the variant objects,
|
|
39
|
+
* so a component reaching into one of its own props to flip the flag was the
|
|
40
|
+
* part that needed to go.
|
|
41
|
+
*/
|
|
42
|
+
function setPreviewReady(variant, value) {
|
|
43
|
+
variant.previewReady = value;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
stories,
|
|
47
|
+
setStories,
|
|
48
|
+
currentStory,
|
|
49
|
+
currentVariant,
|
|
50
|
+
getStoryById,
|
|
51
|
+
getVariantById,
|
|
52
|
+
setPreviewReady
|
|
53
|
+
};
|
|
40
54
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { useStoryStore };
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { usePreferredDark } from "@poveste/vendors/vue-use";
|
|
2
|
-
import { computed } from "@poveste/vendors/vue";
|
|
3
1
|
import { povesteConfig } from "./config.js";
|
|
4
2
|
import { isDark } from "./dark.js";
|
|
5
|
-
"use
|
|
6
|
-
|
|
3
|
+
import { usePreferredDark } from "@poveste/vendors/vue-use";
|
|
4
|
+
import { computed } from "@poveste/vendors/vue";
|
|
5
|
+
//#region src/app/util/color-scheme.ts
|
|
6
|
+
/**
|
|
7
|
+
* Color scheme the story preview starts on, before the user picks one in the
|
|
8
|
+
* toolbar. Shared with the app chrome so a book configured as dark starts dark
|
|
9
|
+
* on both sides.
|
|
10
|
+
*/
|
|
11
|
+
var defaultPreviewColorScheme = povesteConfig.theme.defaultColorScheme ?? "auto";
|
|
12
|
+
/**
|
|
13
|
+
* The story preview has its own color scheme, independent from the app chrome.
|
|
14
|
+
* `chromeDark` only covers settings that predate the option (and the sandbox
|
|
15
|
+
* boot window), where we keep the old behavior of following the chrome.
|
|
16
|
+
*/
|
|
7
17
|
function resolvePreviewDark(colorScheme, prefersDark, chromeDark) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return prefersDark;
|
|
15
|
-
default:
|
|
16
|
-
return chromeDark;
|
|
17
|
-
}
|
|
18
|
+
switch (colorScheme) {
|
|
19
|
+
case "light": return false;
|
|
20
|
+
case "dark": return true;
|
|
21
|
+
case "auto": return prefersDark;
|
|
22
|
+
default: return chromeDark;
|
|
23
|
+
}
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether the story preview should be rendered dark, for previews rendered by
|
|
27
|
+
* the app itself. The sandbox resolves the same thing from the settings it
|
|
28
|
+
* receives over `PREVIEW_SETTINGS_SYNC`.
|
|
29
|
+
*/
|
|
19
30
|
function usePreviewDark(settings) {
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
const prefersDark = usePreferredDark();
|
|
32
|
+
return computed(() => resolvePreviewDark(settings.colorScheme, prefersDark.value, isDark.value));
|
|
22
33
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
resolvePreviewDark,
|
|
26
|
-
usePreviewDark
|
|
27
|
-
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { defaultPreviewColorScheme, resolvePreviewDark, usePreviewDark };
|
|
@@ -1,57 +1,46 @@
|
|
|
1
1
|
import { router } from "../router.js";
|
|
2
2
|
import { useStoryStore } from "../stores/story.js";
|
|
3
3
|
import { openInEditor } from "./open-in-editor.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
id: "builtin:poveste-docs",
|
|
29
|
-
label: "Open Poveste Documentation",
|
|
30
|
-
icon: "carbon:help",
|
|
31
|
-
clientAction: () => {
|
|
32
|
-
window.open("https://poveste.dev/guide/getting-started.html", "_blank");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
];
|
|
4
|
+
//#region src/app/util/commands.ts
|
|
5
|
+
var builtinCommands = [{
|
|
6
|
+
id: "builtin:open-in-editor",
|
|
7
|
+
label: "Open file in editor",
|
|
8
|
+
icon: "carbon:script-reference",
|
|
9
|
+
showIf: ({ route }) => route.name === "story" && !!useStoryStore().currentStory,
|
|
10
|
+
getParams: () => {
|
|
11
|
+
const story = useStoryStore().currentStory;
|
|
12
|
+
let file;
|
|
13
|
+
if (story.docsOnly) file = story.file?.docsFilePath ?? story.file?.filePath;
|
|
14
|
+
else file = story.file?.filePath;
|
|
15
|
+
return { file };
|
|
16
|
+
},
|
|
17
|
+
clientAction: ({ file }) => {
|
|
18
|
+
openInEditor(file);
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
id: "builtin:poveste-docs",
|
|
22
|
+
label: "Open Poveste Documentation",
|
|
23
|
+
icon: "carbon:help",
|
|
24
|
+
clientAction: () => {
|
|
25
|
+
window.open("https://poveste.dev/guide/getting-started.html", "_blank");
|
|
26
|
+
}
|
|
27
|
+
}];
|
|
36
28
|
function executeCommand(command, params) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
if (import.meta.hot) {
|
|
30
|
+
import.meta.hot.send("poveste:dev-command", {
|
|
31
|
+
id: command.id,
|
|
32
|
+
params
|
|
33
|
+
});
|
|
34
|
+
command.clientAction?.(params, getCommandContext());
|
|
35
|
+
}
|
|
44
36
|
}
|
|
45
37
|
function getCommandContext() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
const storyStore = useStoryStore();
|
|
39
|
+
return {
|
|
40
|
+
route: router.currentRoute.value,
|
|
41
|
+
currentStory: storyStore.currentStory,
|
|
42
|
+
currentVariant: storyStore.currentVariant
|
|
43
|
+
};
|
|
52
44
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
executeCommand,
|
|
56
|
-
getCommandContext
|
|
57
|
-
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { builtinCommands, executeCommand, getCommandContext };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { config, logos } from "virtual:$poveste-config";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
povesteConfig
|
|
8
|
-
};
|
|
2
|
+
//#region src/app/util/config.ts
|
|
3
|
+
var povesteConfig = config;
|
|
4
|
+
var customLogos = logos;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { customLogos, povesteConfig };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
SANDBOX_HEIGHT,
|
|
10
|
-
SANDBOX_READY,
|
|
11
|
-
STATE_SYNC
|
|
12
|
-
};
|
|
1
|
+
//#region src/app/util/const.ts
|
|
2
|
+
var STATE_SYNC = "__poveste:state-sync";
|
|
3
|
+
var SANDBOX_READY = "__poveste:sandbox-ready";
|
|
4
|
+
var EVENT_SEND = "__poveste:event";
|
|
5
|
+
var PREVIEW_SETTINGS_SYNC = "__poveste:preview-settings-sync";
|
|
6
|
+
var SANDBOX_HEIGHT = "__poveste:sandbox-height";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { EVENT_SEND, PREVIEW_SETTINGS_SYNC, SANDBOX_HEIGHT, SANDBOX_READY, STATE_SYNC };
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
+
import { povesteConfig } from "./config.js";
|
|
1
2
|
import { useDark, useToggle } from "@poveste/vendors/vue-use";
|
|
2
3
|
import { watch } from "@poveste/vendors/vue";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
storage: povesteConfig.theme.storeColorScheme ? localStorage : sessionStorage
|
|
4
|
+
//#region src/app/util/dark.ts
|
|
5
|
+
var isDark = useDark({
|
|
6
|
+
valueDark: "ptw-dark",
|
|
7
|
+
initialValue: povesteConfig.theme.defaultColorScheme,
|
|
8
|
+
storageKey: "poveste-color-scheme",
|
|
9
|
+
storage: povesteConfig.theme.storeColorScheme ? localStorage : sessionStorage
|
|
10
10
|
});
|
|
11
|
-
|
|
11
|
+
var toggleDark = useToggle(isDark);
|
|
12
12
|
function applyDarkToControls() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
window.__pvt_controls_dark?.forEach((ref) => {
|
|
14
|
+
ref.value = isDark.value;
|
|
15
|
+
});
|
|
16
16
|
}
|
|
17
17
|
watch(isDark, () => {
|
|
18
|
-
|
|
19
|
-
}, {
|
|
20
|
-
immediate: true
|
|
21
|
-
});
|
|
18
|
+
applyDarkToControls();
|
|
19
|
+
}, { immediate: true });
|
|
22
20
|
window.__pvt_controls_dark_ready = () => {
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
isDark,
|
|
27
|
-
toggleDark
|
|
21
|
+
applyDarkToControls();
|
|
28
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { isDark, toggleDark };
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import { unindent } from "@poveste/shared";
|
|
2
1
|
import { clientSupportPlugins } from "virtual:$poveste-support-plugins-client";
|
|
3
|
-
|
|
2
|
+
import { unindent } from "@poveste/shared";
|
|
3
|
+
//#region src/app/util/docs.ts
|
|
4
4
|
async function getSourceCode(story, variant) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const pluginModule = await clientPlugin();
|
|
16
|
-
return pluginModule.generateSourceCode(variant);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const sourceLoader = story.file?.source;
|
|
20
|
-
if (sourceLoader) {
|
|
21
|
-
return (await sourceLoader()).default;
|
|
22
|
-
}
|
|
5
|
+
if (variant.source) return variant.source;
|
|
6
|
+
else if (variant.slots?.().source) {
|
|
7
|
+
const source = variant.slots?.().source()[0].children;
|
|
8
|
+
if (source) return unindent(source);
|
|
9
|
+
} else {
|
|
10
|
+
const clientPlugin = clientSupportPlugins[story.file?.supportPluginId];
|
|
11
|
+
if (clientPlugin) return (await clientPlugin()).generateSourceCode(variant);
|
|
12
|
+
}
|
|
13
|
+
const sourceLoader = story.file?.source;
|
|
14
|
+
if (sourceLoader) return (await sourceLoader()).default;
|
|
23
15
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { getSourceCode };
|
package/dist/bundled/util/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
//#region src/app/util/env.ts
|
|
2
|
+
var isMac = navigator.platform.toLowerCase().includes("mac");
|
|
3
|
+
//#endregion
|
|
4
|
+
export { isMac };
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import { EVENT_SEND } from "./const.js";
|
|
2
|
-
|
|
2
|
+
//#region src/app/util/events.ts
|
|
3
3
|
async function logEvent(name, argument) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const { useEventsStore } = await import("../stores/events.js");
|
|
17
|
-
useEventsStore().addEvent(event);
|
|
18
|
-
}
|
|
4
|
+
const event = {
|
|
5
|
+
name,
|
|
6
|
+
argument: JSON.parse(stringifyEvent(argument))
|
|
7
|
+
};
|
|
8
|
+
if (location.href.includes("__sandbox")) window.parent?.postMessage({
|
|
9
|
+
type: EVENT_SEND,
|
|
10
|
+
event
|
|
11
|
+
});
|
|
12
|
+
else {
|
|
13
|
+
const { useEventsStore } = await import("../stores/events.js");
|
|
14
|
+
useEventsStore().addEvent(event);
|
|
15
|
+
}
|
|
19
16
|
}
|
|
20
17
|
function stringifyEvent(e) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return v;
|
|
29
|
-
}, " ");
|
|
18
|
+
const obj = {};
|
|
19
|
+
for (const k in e) obj[k] = e[k];
|
|
20
|
+
return JSON.stringify(obj, (k, v) => {
|
|
21
|
+
if (v instanceof Node) return "Node";
|
|
22
|
+
if (v instanceof Window) return "Window";
|
|
23
|
+
return v;
|
|
24
|
+
}, " ");
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { logEvent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createHighlighter } from "shiki";
|
|
2
|
+
//#region src/app/util/highlighter.ts
|
|
3
|
+
/**
|
|
4
|
+
* Shiki is meant to be used as a singleton: each instance carries its own WASM
|
|
5
|
+
* engine and grammar set. The source pane unmounts and remounts on every story
|
|
6
|
+
* navigation, so creating one per mount grows memory for the lifetime of the
|
|
7
|
+
* tab — and trips Shiki's own warning once ten are live.
|
|
8
|
+
*
|
|
9
|
+
* The langs and themes are fixed, so one shared instance is always correct.
|
|
10
|
+
*/
|
|
11
|
+
var highlighterPromise;
|
|
12
|
+
function getHighlighter() {
|
|
13
|
+
highlighterPromise ??= createHighlighter({
|
|
14
|
+
langs: ["html", "jsx"],
|
|
15
|
+
themes: ["github-light", "github-dark"]
|
|
16
|
+
}).catch((e) => {
|
|
17
|
+
highlighterPromise = void 0;
|
|
18
|
+
throw e;
|
|
19
|
+
});
|
|
20
|
+
return highlighterPromise;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getHighlighter };
|