@poveste/app 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +40 -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 +58 -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 +5 -0
- package/dist/bundled/components/app/HomeCounter.vue_vue_type_script_setup_true_lang.js +35 -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 +2805 -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 +3 -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 +5 -5
- 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
|
@@ -32,18 +32,17 @@ const hasCustomControls = computed(() => props.variant.slots().controls || props
|
|
|
32
32
|
|
|
33
33
|
const hasInitState = computed(() => Object
|
|
34
34
|
.entries(props.variant.state || {})
|
|
35
|
-
.
|
|
36
|
-
.length > 0)
|
|
35
|
+
.some(([key]) => !key.startsWith('_h')))
|
|
37
36
|
</script>
|
|
38
37
|
|
|
39
38
|
<template>
|
|
40
39
|
<div
|
|
41
40
|
data-test-id="story-controls"
|
|
42
|
-
class="poveste-story-controls
|
|
41
|
+
class="poveste-story-controls flex flex-col divide-y divide-gray-100 dark:divide-gray-750"
|
|
43
42
|
>
|
|
44
43
|
<!-- Toolbar -->
|
|
45
44
|
<div
|
|
46
|
-
class="
|
|
45
|
+
class="h-9 flex-none px-2 flex items-center"
|
|
47
46
|
>
|
|
48
47
|
<StatePresets
|
|
49
48
|
v-if="ready || !hasCustomControls"
|
|
@@ -59,7 +58,7 @@ const hasInitState = computed(() => Object
|
|
|
59
58
|
slot-name="controls"
|
|
60
59
|
:variant="variant"
|
|
61
60
|
:story="story"
|
|
62
|
-
class="__poveste-render-custom-controls __histoire-render-custom-controls
|
|
61
|
+
class="__poveste-render-custom-controls __histoire-render-custom-controls flex-none"
|
|
63
62
|
@ready="ready = true"
|
|
64
63
|
/>
|
|
65
64
|
|
|
@@ -68,7 +67,7 @@ const hasInitState = computed(() => Object
|
|
|
68
67
|
v-else-if="hasInitState"
|
|
69
68
|
>
|
|
70
69
|
<ControlsComponentState
|
|
71
|
-
class="
|
|
70
|
+
class="flex-none my-2"
|
|
72
71
|
:variant="variant"
|
|
73
72
|
/>
|
|
74
73
|
</div>
|
|
@@ -76,7 +75,7 @@ const hasInitState = computed(() => Object
|
|
|
76
75
|
<BaseEmpty v-else-if="!variant.state?._hPropDefs?.length">
|
|
77
76
|
<Icon
|
|
78
77
|
icon="carbon:audio-console"
|
|
79
|
-
class="
|
|
78
|
+
class="w-8 h-8 opacity-50 mb-6"
|
|
80
79
|
/>
|
|
81
80
|
<span>No controls available for this story</span>
|
|
82
81
|
</BaseEmpty>
|
|
@@ -90,7 +89,7 @@ const hasInitState = computed(() => Object
|
|
|
90
89
|
:key="index"
|
|
91
90
|
:variant="variant"
|
|
92
91
|
:definition="def"
|
|
93
|
-
class="
|
|
92
|
+
class="flex-none my-2"
|
|
94
93
|
/>
|
|
95
94
|
</div>
|
|
96
95
|
</div>
|
|
@@ -35,7 +35,7 @@ export function useStoryDoc(story: Ref<Story>) {
|
|
|
35
35
|
try {
|
|
36
36
|
comp = await comp()
|
|
37
37
|
}
|
|
38
|
-
catch
|
|
38
|
+
catch {
|
|
39
39
|
// Noop
|
|
40
40
|
// Could be a class that requires `new com()`
|
|
41
41
|
}
|
|
@@ -170,9 +170,9 @@ const filePath = computed(() => story.value.file?.docsFilePath ?? (props.standal
|
|
|
170
170
|
>
|
|
171
171
|
<div
|
|
172
172
|
v-if="__POVESTE_DEV__ && renderedDoc && filePath"
|
|
173
|
-
class="
|
|
173
|
+
class="flex items-center gap-2 p-2"
|
|
174
174
|
:class="{
|
|
175
|
-
'
|
|
175
|
+
'pt-4': !standalone,
|
|
176
176
|
}"
|
|
177
177
|
>
|
|
178
178
|
<DevOnlyToolbarOpenInEditor
|
|
@@ -187,14 +187,14 @@ const filePath = computed(() => story.value.file?.docsFilePath ?? (props.standal
|
|
|
187
187
|
>
|
|
188
188
|
<Icon
|
|
189
189
|
icon="carbon:document-unknown"
|
|
190
|
-
class="
|
|
190
|
+
class="w-8 h-8 opacity-50 mb-6"
|
|
191
191
|
/>
|
|
192
192
|
No documentation available
|
|
193
193
|
</BaseEmpty>
|
|
194
194
|
<div
|
|
195
195
|
v-else
|
|
196
196
|
ref="renderedEl"
|
|
197
|
-
class="
|
|
197
|
+
class="prose dark:prose-invert p-4 max-w-none"
|
|
198
198
|
data-test-id="story-docs"
|
|
199
199
|
v-html="renderedDoc"
|
|
200
200
|
/>
|
|
@@ -20,34 +20,34 @@ const formattedArgument = computed(() => {
|
|
|
20
20
|
|
|
21
21
|
<template>
|
|
22
22
|
<VDropdown
|
|
23
|
-
class="poveste-story-event
|
|
23
|
+
class="poveste-story-event group"
|
|
24
24
|
placement="right"
|
|
25
25
|
data-test-id="event-item"
|
|
26
26
|
>
|
|
27
27
|
<template #default="{ shown }">
|
|
28
28
|
<div
|
|
29
|
-
class="group-hover:
|
|
29
|
+
class="group-hover:bg-primary-100 dark:group-hover:bg-primary-700 cursor-pointer py-2 px-4 flex items-baseline gap-1 leading-normal"
|
|
30
30
|
:class="[
|
|
31
|
-
shown ? '
|
|
31
|
+
shown ? 'bg-primary-50 dark:bg-primary-600' : 'group-odd:bg-gray-100/50 dark:group-odd:bg-gray-750/40',
|
|
32
32
|
]"
|
|
33
33
|
>
|
|
34
34
|
<span
|
|
35
35
|
:class="{
|
|
36
|
-
'
|
|
36
|
+
'text-primary-500': shown,
|
|
37
37
|
}"
|
|
38
38
|
>
|
|
39
39
|
{{ event.name }}
|
|
40
40
|
</span>
|
|
41
41
|
<span
|
|
42
42
|
v-if="event.argument"
|
|
43
|
-
class="
|
|
43
|
+
class="text-xs opacity-50 truncate"
|
|
44
44
|
>{{ formattedArgument }}</span>
|
|
45
45
|
</div>
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<template #popper>
|
|
49
|
-
<div class="
|
|
50
|
-
<pre class="
|
|
49
|
+
<div class="overflow-auto max-w-[400px] max-h-[400px]">
|
|
50
|
+
<pre class="p-4">{{ event.argument }}</pre>
|
|
51
51
|
</div>
|
|
52
52
|
</template>
|
|
53
53
|
</VDropdown>
|
|
@@ -34,8 +34,8 @@ const panelContentComponent = computed(() => {
|
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
|
-
<div class="
|
|
38
|
-
<div class="
|
|
37
|
+
<div class="h-full w-full p-2">
|
|
38
|
+
<div class="h-full w-full rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden bg-white dark:bg-gray-700">
|
|
39
39
|
<BaseEmpty
|
|
40
40
|
v-if="!storyStore.currentVariant"
|
|
41
41
|
class="poveste-story-side-panel poveste-selection"
|
|
@@ -54,11 +54,11 @@ const panelContentComponent = computed(() => {
|
|
|
54
54
|
v-else
|
|
55
55
|
:save-id="`story-sidepane-${innerOrientation}`"
|
|
56
56
|
:orientation="innerOrientation"
|
|
57
|
-
class="poveste-story-side-panel poveste-loaded
|
|
57
|
+
class="poveste-story-side-panel poveste-loaded h-full"
|
|
58
58
|
data-test-id="story-side-panel"
|
|
59
59
|
>
|
|
60
60
|
<template #first>
|
|
61
|
-
<div class="
|
|
61
|
+
<div class="flex flex-col h-full">
|
|
62
62
|
<PaneTabs
|
|
63
63
|
:story="storyStore.currentStory"
|
|
64
64
|
:variant="storyStore.currentVariant"
|
|
@@ -68,7 +68,7 @@ const panelContentComponent = computed(() => {
|
|
|
68
68
|
:is="panelContentComponent"
|
|
69
69
|
:story="storyStore.currentStory"
|
|
70
70
|
:variant="storyStore.currentVariant"
|
|
71
|
-
class="
|
|
71
|
+
class="h-full overflow-auto"
|
|
72
72
|
/>
|
|
73
73
|
</div>
|
|
74
74
|
</template>
|
|
@@ -77,7 +77,7 @@ const panelContentComponent = computed(() => {
|
|
|
77
77
|
<StorySourceCode
|
|
78
78
|
:story="storyStore.currentStory"
|
|
79
79
|
:variant="storyStore.currentVariant"
|
|
80
|
-
class="
|
|
80
|
+
class="h-full"
|
|
81
81
|
/>
|
|
82
82
|
</template>
|
|
83
83
|
</BaseSplitPane>
|
|
@@ -4,10 +4,10 @@ import type { Story, Variant } from '../../types'
|
|
|
4
4
|
import { Icon } from '@iconify/vue'
|
|
5
5
|
import { HstCopyIcon } from '@poveste/controls'
|
|
6
6
|
import { unindent } from '@poveste/shared'
|
|
7
|
-
import { createHighlighter } from 'shiki'
|
|
8
7
|
import { clientSupportPlugins } from 'virtual:$poveste-support-plugins-client'
|
|
9
8
|
import { computed, markRaw, nextTick, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'
|
|
10
9
|
import { isDark } from '../../util/dark'
|
|
10
|
+
import { getHighlighter } from '../../util/highlighter'
|
|
11
11
|
import BaseEmpty from '../base/BaseEmpty.vue'
|
|
12
12
|
|
|
13
13
|
const props = defineProps<{
|
|
@@ -87,23 +87,21 @@ const displayedSourceCode = computed(() => {
|
|
|
87
87
|
// HTML render
|
|
88
88
|
|
|
89
89
|
onMounted(async () => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
],
|
|
99
|
-
})
|
|
90
|
+
try {
|
|
91
|
+
highlighter.value = await getHighlighter()
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
// Leave `highlighter` unset so the pane falls back to the plain textarea
|
|
95
|
+
// rendering instead of showing nothing at all.
|
|
96
|
+
console.error(e)
|
|
97
|
+
}
|
|
100
98
|
})
|
|
101
99
|
|
|
102
100
|
const sourceHtml = computed(() => displayedSourceCode.value
|
|
103
101
|
? highlighter.value?.codeToHtml(displayedSourceCode.value, {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
lang: 'html',
|
|
103
|
+
theme: isDark.value ? 'github-dark' : 'github-light',
|
|
104
|
+
})
|
|
107
105
|
: '')
|
|
108
106
|
|
|
109
107
|
// Scrolling
|
|
@@ -133,32 +131,32 @@ watch(sourceHtml, async () => {
|
|
|
133
131
|
|
|
134
132
|
<template>
|
|
135
133
|
<div
|
|
136
|
-
class="poveste-story-source-code
|
|
134
|
+
class="poveste-story-source-code bg-gray-50 dark:bg-gray-750 h-full overflow-hidden flex flex-col"
|
|
137
135
|
>
|
|
138
136
|
<!-- Toolbar -->
|
|
139
137
|
<div
|
|
140
138
|
v-if="!error"
|
|
141
|
-
class="
|
|
139
|
+
class="h-10 flex-none border-b border-solid border-gray-500/5 px-4 flex items-center gap-2"
|
|
142
140
|
>
|
|
143
|
-
<div class="
|
|
141
|
+
<div class="text-gray-900 dark:text-gray-100">
|
|
144
142
|
Source
|
|
145
143
|
</div>
|
|
146
|
-
<div class="
|
|
144
|
+
<div class="flex-1" />
|
|
147
145
|
|
|
148
146
|
<!-- Display source modes -->
|
|
149
|
-
<div class="
|
|
147
|
+
<div class="flex flex-none gap-px h-full py-2">
|
|
150
148
|
<button
|
|
151
149
|
v-tooltip="!dynamicSourceCode ? 'Dynamic source code is not available' : displayedSource !== 'dynamic' ? 'Switch to dynamic source' : null"
|
|
152
|
-
class="
|
|
150
|
+
class="flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-l transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden"
|
|
153
151
|
:class="[
|
|
154
|
-
displayedSource !== 'dynamic' ? '
|
|
155
|
-
dynamicSourceCode ? '
|
|
152
|
+
displayedSource !== 'dynamic' ? 'max-w-6 opacity-70' : 'max-w-[82px] text-primary-600 dark:text-primary-400',
|
|
153
|
+
dynamicSourceCode ? 'cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50' : 'opacity-50',
|
|
156
154
|
]"
|
|
157
155
|
@click="dynamicSourceCode && (displayedSource = 'dynamic')"
|
|
158
156
|
>
|
|
159
157
|
<Icon
|
|
160
158
|
icon="carbon:flash"
|
|
161
|
-
class="
|
|
159
|
+
class="w-4 h-4 flex-none"
|
|
162
160
|
/>
|
|
163
161
|
<span
|
|
164
162
|
class="transition-opacity duration-300"
|
|
@@ -171,16 +169,16 @@ watch(sourceHtml, async () => {
|
|
|
171
169
|
</button>
|
|
172
170
|
<button
|
|
173
171
|
v-tooltip="!staticSourceCode ? 'Static source code is not available' : displayedSource !== 'static' ? 'Switch to static source' : null"
|
|
174
|
-
class="
|
|
172
|
+
class="flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-r transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden"
|
|
175
173
|
:class="[
|
|
176
|
-
displayedSource !== 'static' ? '
|
|
177
|
-
staticSourceCode ? '
|
|
174
|
+
displayedSource !== 'static' ? 'max-w-6 opacity-70' : 'max-w-[63px] text-primary-600 dark:text-primary-400',
|
|
175
|
+
staticSourceCode ? 'cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50' : 'opacity-50',
|
|
178
176
|
]"
|
|
179
177
|
@click="staticSourceCode && (displayedSource = 'static')"
|
|
180
178
|
>
|
|
181
179
|
<Icon
|
|
182
180
|
icon="carbon:document"
|
|
183
|
-
class="
|
|
181
|
+
class="w-4 h-4 flex-none"
|
|
184
182
|
/>
|
|
185
183
|
<span
|
|
186
184
|
class="transition-opacity duration-300"
|
|
@@ -195,13 +193,13 @@ watch(sourceHtml, async () => {
|
|
|
195
193
|
|
|
196
194
|
<HstCopyIcon
|
|
197
195
|
:content="displayedSourceCode"
|
|
198
|
-
class="
|
|
196
|
+
class="flex-none"
|
|
199
197
|
/>
|
|
200
198
|
</div>
|
|
201
199
|
|
|
202
200
|
<div
|
|
203
201
|
v-if="error"
|
|
204
|
-
class="
|
|
202
|
+
class="text-red-500 h-full p-2 overflow-auto font-mono text-sm"
|
|
205
203
|
>
|
|
206
204
|
Error: {{ error }}
|
|
207
205
|
</div>
|
|
@@ -209,7 +207,7 @@ watch(sourceHtml, async () => {
|
|
|
209
207
|
<BaseEmpty v-else-if="!displayedSourceCode">
|
|
210
208
|
<Icon
|
|
211
209
|
icon="carbon:code-hide"
|
|
212
|
-
class="
|
|
210
|
+
class="w-8 h-8 opacity-50 mb-6"
|
|
213
211
|
/>
|
|
214
212
|
<span>Not available</span>
|
|
215
213
|
</BaseEmpty>
|
|
@@ -217,7 +215,7 @@ watch(sourceHtml, async () => {
|
|
|
217
215
|
<textarea
|
|
218
216
|
v-else-if="!sourceHtml"
|
|
219
217
|
ref="scroller"
|
|
220
|
-
class="__poveste-code-placeholder
|
|
218
|
+
class="__poveste-code-placeholder w-full h-full p-4 outline-none bg-transparent resize-none m-0"
|
|
221
219
|
:value="displayedSourceCode"
|
|
222
220
|
readonly
|
|
223
221
|
data-test-id="story-source-code"
|
|
@@ -227,12 +225,12 @@ watch(sourceHtml, async () => {
|
|
|
227
225
|
<div
|
|
228
226
|
v-else
|
|
229
227
|
ref="scroller"
|
|
230
|
-
class="
|
|
228
|
+
class="w-full h-full overflow-auto"
|
|
231
229
|
data-test-id="story-source-code"
|
|
232
230
|
@scroll="onScroll"
|
|
233
231
|
>
|
|
234
232
|
<div
|
|
235
|
-
class="__poveste-code __histoire-code
|
|
233
|
+
class="__poveste-code __histoire-code p-4 w-fit"
|
|
236
234
|
v-html="sourceHtml"
|
|
237
235
|
/>
|
|
238
236
|
</div>
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import type { PropType } from 'vue'
|
|
3
3
|
import type { SearchResult } from '../../types'
|
|
4
4
|
import { ref, toRefs } from 'vue'
|
|
5
|
-
import { useRouter } from 'vue-router'
|
|
6
|
-
import { onKeyboardShortcut } from '../../util/keyboard'
|
|
7
5
|
import { useScrollOnActive } from '../../util/scroll'
|
|
8
6
|
import BaseListItem from '../base/BaseListItem.vue'
|
|
9
7
|
import BaseListItemLink from '../base/BaseListItemLink.vue'
|
|
@@ -30,17 +28,7 @@ const el = ref<HTMLDivElement>()
|
|
|
30
28
|
const { selected } = toRefs(props)
|
|
31
29
|
useScrollOnActive(selected, el)
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onKeyboardShortcut(['enter'], () => {
|
|
36
|
-
if (!props.selected) return
|
|
37
|
-
action()
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
function action(fromClick = false) {
|
|
41
|
-
if ('route' in props.result && !fromClick) {
|
|
42
|
-
router.push(props.result.route)
|
|
43
|
-
}
|
|
31
|
+
function action() {
|
|
44
32
|
if ('onActivate' in props.result) {
|
|
45
33
|
props.result.onActivate()
|
|
46
34
|
}
|
|
@@ -59,8 +47,8 @@ function action(fromClick = false) {
|
|
|
59
47
|
v-if="'route' in result"
|
|
60
48
|
:to="result.route"
|
|
61
49
|
:is-active="selected"
|
|
62
|
-
class="
|
|
63
|
-
@navigate="action(
|
|
50
|
+
class="px-6 py-4 gap-4"
|
|
51
|
+
@navigate="action()"
|
|
64
52
|
>
|
|
65
53
|
<SearchItemContent
|
|
66
54
|
:result="result"
|
|
@@ -71,8 +59,8 @@ function action(fromClick = false) {
|
|
|
71
59
|
<BaseListItem
|
|
72
60
|
v-if="'onActivate' in result"
|
|
73
61
|
:is-active="selected"
|
|
74
|
-
class="
|
|
75
|
-
@navigate="action(
|
|
62
|
+
class="px-6 py-4 gap-4"
|
|
63
|
+
@navigate="action()"
|
|
76
64
|
>
|
|
77
65
|
<SearchItemContent
|
|
78
66
|
:result="result"
|
|
@@ -23,14 +23,14 @@ const kindLabels = {
|
|
|
23
23
|
<template>
|
|
24
24
|
<BaseIcon
|
|
25
25
|
:icon="result.icon ?? defaultIcons[result.kind]"
|
|
26
|
-
class="
|
|
26
|
+
class="w-4 h-4"
|
|
27
27
|
:class="[
|
|
28
28
|
!selected ? [
|
|
29
29
|
result.iconColor
|
|
30
30
|
? 'bind-icon-color'
|
|
31
31
|
: {
|
|
32
|
-
'
|
|
33
|
-
'
|
|
32
|
+
'text-primary-500': result.kind === 'story',
|
|
33
|
+
'text-gray-500': result.kind === 'variant',
|
|
34
34
|
},
|
|
35
35
|
] : [],
|
|
36
36
|
{
|
|
@@ -38,27 +38,27 @@ const kindLabels = {
|
|
|
38
38
|
},
|
|
39
39
|
]"
|
|
40
40
|
/>
|
|
41
|
-
<div class="
|
|
42
|
-
<div class="
|
|
41
|
+
<div class="flex-1">
|
|
42
|
+
<div class="flex">
|
|
43
43
|
{{ result.title }}
|
|
44
|
-
<span class="
|
|
44
|
+
<span class="ml-auto opacity-40">
|
|
45
45
|
{{ kindLabels[result.kind] }}
|
|
46
46
|
</span>
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<div
|
|
50
50
|
v-if="result.path?.length"
|
|
51
|
-
class="
|
|
51
|
+
class="flex items-center gap-0.5 opacity-60"
|
|
52
52
|
>
|
|
53
53
|
<div
|
|
54
54
|
v-for="(p, index) of result.path"
|
|
55
55
|
:key="index"
|
|
56
|
-
class="
|
|
56
|
+
class="flex items-center gap-0.5"
|
|
57
57
|
>
|
|
58
58
|
<Icon
|
|
59
59
|
v-if="index > 0"
|
|
60
60
|
icon="carbon:chevron-right"
|
|
61
|
-
class="
|
|
61
|
+
class="w-4 h-4 mt-0.5 opacity-50"
|
|
62
62
|
/>
|
|
63
63
|
<span>{{ p }}</span>
|
|
64
64
|
</div>
|
|
@@ -4,11 +4,11 @@ import { Icon } from '@iconify/vue'
|
|
|
4
4
|
|
|
5
5
|
<template>
|
|
6
6
|
<div
|
|
7
|
-
class="poveste-search-loading
|
|
7
|
+
class="poveste-search-loading flex items-center gap-4 pl-6 border border-transparent focus-visible:border-primary-500 h-[51px] opacity-30"
|
|
8
8
|
>
|
|
9
9
|
<Icon
|
|
10
10
|
icon="carbon:search"
|
|
11
|
-
class="flex-none
|
|
11
|
+
class="flex-none w-4 h-4"
|
|
12
12
|
/>
|
|
13
13
|
|
|
14
14
|
Loading...
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
import { defineAsyncComponent } from 'vue'
|
|
3
3
|
import SearchLoading from './SearchLoading.vue'
|
|
4
4
|
|
|
5
|
-
const SearchPane = defineAsyncComponent({
|
|
6
|
-
loader: () => import('./SearchPane.vue'),
|
|
7
|
-
loadingComponent: SearchLoading,
|
|
8
|
-
delay: 0,
|
|
9
|
-
})
|
|
10
|
-
|
|
11
5
|
defineProps({
|
|
12
6
|
shown: {
|
|
13
7
|
type: Boolean,
|
|
@@ -19,6 +13,12 @@ const emit = defineEmits({
|
|
|
19
13
|
close: () => true,
|
|
20
14
|
})
|
|
21
15
|
|
|
16
|
+
const SearchPane = defineAsyncComponent({
|
|
17
|
+
loader: () => import('./SearchPane.vue'),
|
|
18
|
+
loadingComponent: SearchLoading,
|
|
19
|
+
delay: 0,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
22
|
function close() {
|
|
23
23
|
emit('close')
|
|
24
24
|
}
|
|
@@ -27,14 +27,14 @@ function close() {
|
|
|
27
27
|
<template>
|
|
28
28
|
<div
|
|
29
29
|
v-show="shown"
|
|
30
|
-
class="poveste-search-modal
|
|
30
|
+
class="poveste-search-modal fixed inset-0 bg-white/80 dark:bg-gray-900/80 z-20"
|
|
31
31
|
data-test-id="search-modal"
|
|
32
32
|
>
|
|
33
33
|
<div
|
|
34
|
-
class="
|
|
34
|
+
class="absolute inset-0"
|
|
35
35
|
@click="close()"
|
|
36
36
|
/>
|
|
37
|
-
<div class="
|
|
37
|
+
<div class="bg-white dark:bg-gray-900 md:mt-16 md:mx-auto w-screen max-w-[512px] shadow-xl border border-gray-200 dark:border-gray-750 rounded-lg relative divide-y divide-gray-200 dark:divide-gray-850">
|
|
38
38
|
<SearchPane
|
|
39
39
|
:shown="shown"
|
|
40
40
|
@close="close()"
|
|
@@ -3,20 +3,20 @@ import type { ClientCommand } from '@poveste/shared'
|
|
|
3
3
|
import type { SearchResult, SearchResultType, Story, Variant } from '../../types'
|
|
4
4
|
import type { SearchData } from './types'
|
|
5
5
|
import { Icon } from '@iconify/vue'
|
|
6
|
-
import {
|
|
6
|
+
import { refDebounced, useFocus } from '@vueuse/core'
|
|
7
7
|
import Fuse from 'fuse.js'
|
|
8
8
|
import { registeredCommands } from 'virtual:$poveste-commands'
|
|
9
|
-
import { computed, ref, watch } from 'vue'
|
|
9
|
+
import { computed, ref, shallowRef, watch } from 'vue'
|
|
10
|
+
import { useRouter } from 'vue-router'
|
|
10
11
|
import { useCommandStore } from '../../stores/command.js'
|
|
11
12
|
import { useStoryStore } from '../../stores/story'
|
|
12
13
|
import { builtinCommands, getCommandContext } from '../../util/commands.js'
|
|
14
|
+
import { onKeyboardShortcut } from '../../util/keyboard.js'
|
|
13
15
|
import { useSelection } from '../../util/select.js'
|
|
14
16
|
import BaseEmpty from '../base/BaseEmpty.vue'
|
|
15
17
|
import { onUpdate, searchData } from './search-title-data'
|
|
16
18
|
import SearchItem from './SearchItem.vue'
|
|
17
19
|
|
|
18
|
-
const DocSearchData = () => import('./search-docs-data')
|
|
19
|
-
|
|
20
20
|
const props = defineProps({
|
|
21
21
|
shown: {
|
|
22
22
|
type: Boolean,
|
|
@@ -28,6 +28,8 @@ const emit = defineEmits({
|
|
|
28
28
|
close: () => true,
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
+
const DocSearchData = () => import('./search-docs-data')
|
|
32
|
+
|
|
31
33
|
function close() {
|
|
32
34
|
emit('close')
|
|
33
35
|
}
|
|
@@ -51,7 +53,7 @@ watch(() => props.shown, (value) => {
|
|
|
51
53
|
// Index
|
|
52
54
|
|
|
53
55
|
const searchInputText = ref('')
|
|
54
|
-
const rateLimitedSearch =
|
|
56
|
+
const rateLimitedSearch = refDebounced(searchInputText, 50)
|
|
55
57
|
|
|
56
58
|
const storyStore = useStoryStore()
|
|
57
59
|
|
|
@@ -111,11 +113,13 @@ loadDocSearchIndex()
|
|
|
111
113
|
|
|
112
114
|
// Search
|
|
113
115
|
|
|
114
|
-
const
|
|
116
|
+
const MAX_RESULTS = 50
|
|
117
|
+
|
|
118
|
+
const titleResults = shallowRef<SearchResult[]>([])
|
|
115
119
|
|
|
116
120
|
watch(rateLimitedSearch, async (value) => {
|
|
117
121
|
const list: SearchResult[] = []
|
|
118
|
-
const result = titleSearchIndex.search(value)
|
|
122
|
+
const result = titleSearchIndex.search(value, { limit: MAX_RESULTS })
|
|
119
123
|
let rank = 0
|
|
120
124
|
|
|
121
125
|
for (const document of result) {
|
|
@@ -141,12 +145,12 @@ watch(rateLimitedSearch, async (value) => {
|
|
|
141
145
|
titleResults.value = list
|
|
142
146
|
})
|
|
143
147
|
|
|
144
|
-
const docsResults =
|
|
148
|
+
const docsResults = shallowRef<SearchResult[]>([])
|
|
145
149
|
|
|
146
150
|
async function searchOnDocField(query: string) {
|
|
147
151
|
if (docSearchIndex) {
|
|
148
152
|
const list: SearchResult[] = []
|
|
149
|
-
const result = docSearchIndex.search(query)
|
|
153
|
+
const result = docSearchIndex.search(query, { limit: MAX_RESULTS })
|
|
150
154
|
let rank = 0
|
|
151
155
|
|
|
152
156
|
for (const document of result) {
|
|
@@ -224,7 +228,7 @@ const allCommands = [
|
|
|
224
228
|
const commandResults = computed(() => {
|
|
225
229
|
if (__POVESTE_DEV__) {
|
|
226
230
|
const commandCtx = getCommandContext()
|
|
227
|
-
const searchText =
|
|
231
|
+
const searchText = rateLimitedSearch.value.toLowerCase()
|
|
228
232
|
return allCommands
|
|
229
233
|
.filter(command => !command.showIf || command.showIf(commandCtx))
|
|
230
234
|
.filter(command => command.label.toLowerCase().includes(searchText) || command.searchText?.toLowerCase().includes(searchText))
|
|
@@ -250,8 +254,8 @@ function commandResultFactory(command: ClientCommand, rank: number): SearchResul
|
|
|
250
254
|
|
|
251
255
|
// Results
|
|
252
256
|
|
|
253
|
-
const results = computed(() => {
|
|
254
|
-
const list = [
|
|
257
|
+
const results = computed<SearchResult[]>(() => {
|
|
258
|
+
const list: SearchResult[] = [
|
|
255
259
|
...commandResults.value,
|
|
256
260
|
...titleResults.value,
|
|
257
261
|
]
|
|
@@ -264,7 +268,7 @@ const results = computed(() => {
|
|
|
264
268
|
list.push(r)
|
|
265
269
|
}
|
|
266
270
|
}
|
|
267
|
-
return list
|
|
271
|
+
return list.slice(0, MAX_RESULTS)
|
|
268
272
|
})
|
|
269
273
|
|
|
270
274
|
// Selection
|
|
@@ -274,23 +278,43 @@ const {
|
|
|
274
278
|
selectNext,
|
|
275
279
|
selectPrevious,
|
|
276
280
|
} = useSelection(results)
|
|
281
|
+
|
|
282
|
+
// Activation
|
|
283
|
+
|
|
284
|
+
const router = useRouter()
|
|
285
|
+
|
|
286
|
+
onKeyboardShortcut(['enter'], () => {
|
|
287
|
+
const result = results.value[selectedIndex.value]
|
|
288
|
+
|
|
289
|
+
if (!result) {
|
|
290
|
+
return
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if ('route' in result) {
|
|
294
|
+
router.push(result.route)
|
|
295
|
+
}
|
|
296
|
+
if ('onActivate' in result) {
|
|
297
|
+
result.onActivate()
|
|
298
|
+
}
|
|
299
|
+
close()
|
|
300
|
+
})
|
|
277
301
|
</script>
|
|
278
302
|
|
|
279
303
|
<template>
|
|
280
304
|
<div
|
|
281
|
-
class="poveste-search-pane
|
|
305
|
+
class="poveste-search-pane flex items-center gap-4 pl-6 border border-transparent focus-visible:border-primary-500"
|
|
282
306
|
@click="focused = true"
|
|
283
307
|
>
|
|
284
308
|
<Icon
|
|
285
309
|
icon="carbon:search"
|
|
286
|
-
class="flex-none
|
|
310
|
+
class="flex-none w-4 h-4"
|
|
287
311
|
/>
|
|
288
312
|
|
|
289
313
|
<input
|
|
290
314
|
ref="input"
|
|
291
315
|
v-model="searchInputText"
|
|
292
316
|
placeholder="Search for stories, variants..."
|
|
293
|
-
class="
|
|
317
|
+
class="bg-transparent w-full flex-1 pl-0 pr-6 py-4 outline-none"
|
|
294
318
|
@keydown.down.prevent="selectNext()"
|
|
295
319
|
@keydown.up.prevent="selectPrevious()"
|
|
296
320
|
@keydown.escape="close()"
|
|
@@ -306,7 +330,7 @@ const {
|
|
|
306
330
|
|
|
307
331
|
<div
|
|
308
332
|
v-else-if="results.length"
|
|
309
|
-
class="
|
|
333
|
+
class="max-h-[400px] overflow-y-auto rounded-b-lg"
|
|
310
334
|
>
|
|
311
335
|
<SearchItem
|
|
312
336
|
v-for="(result, index) of results"
|