@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
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
2
|
+
import StoryVariantGridItem_default from "./StoryVariantGridItem.js";
|
|
3
|
+
import { useResizeObserver } from "@poveste/vendors/vue-use";
|
|
4
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, defineComponent, normalizeStyle, onMounted, openBlock, ref, renderList, unref, watch } from "@poveste/vendors/vue";
|
|
5
|
+
//#region src/app/components/story/StoryVariantGrid.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var _hoisted_1 = { class: "poveste-story-variant-grid flex flex-col items-stretch h-full __poveste-pane-shadow-from-right" };
|
|
7
|
+
var _hoisted_2 = { class: "flex w-0 flex-1 mx-4" };
|
|
8
|
+
var margin = 16;
|
|
9
|
+
var gap = 16;
|
|
10
|
+
var StoryVariantGrid_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
11
|
+
__name: "StoryVariantGrid",
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const storyStore = useStoryStore();
|
|
14
|
+
const gridTemplateWidth = computed(() => {
|
|
15
|
+
if (storyStore.currentStory.layout.type !== "grid") return;
|
|
16
|
+
const layoutWidth = storyStore.currentStory.layout.width;
|
|
17
|
+
if (!layoutWidth) return "200px";
|
|
18
|
+
if (typeof layoutWidth === "number") return `${layoutWidth}px`;
|
|
19
|
+
return layoutWidth;
|
|
20
|
+
});
|
|
21
|
+
const itemWidth = ref(16);
|
|
22
|
+
const maxItemHeight = ref(0);
|
|
23
|
+
const maxCount = ref(10);
|
|
24
|
+
const countPerRow = ref(0);
|
|
25
|
+
const visibleRows = ref(0);
|
|
26
|
+
const el = ref(null);
|
|
27
|
+
useResizeObserver(el, () => {
|
|
28
|
+
updateMaxCount();
|
|
29
|
+
updateSize();
|
|
30
|
+
});
|
|
31
|
+
function updateMaxCount() {
|
|
32
|
+
if (!maxItemHeight.value) return;
|
|
33
|
+
const width = el.value.clientWidth - margin * 2;
|
|
34
|
+
const height = el.value.clientHeight;
|
|
35
|
+
const scrollTop = el.value.scrollTop;
|
|
36
|
+
countPerRow.value = Math.floor((width + gap) / (itemWidth.value + gap));
|
|
37
|
+
visibleRows.value = Math.ceil((height + scrollTop + gap) / (maxItemHeight.value + gap));
|
|
38
|
+
const newMaxCount = countPerRow.value * visibleRows.value;
|
|
39
|
+
if (maxCount.value < newMaxCount) maxCount.value = newMaxCount;
|
|
40
|
+
if (storyStore.currentVariant) {
|
|
41
|
+
const index = storyStore.currentStory.variants.indexOf(storyStore.currentVariant);
|
|
42
|
+
if (index + 1 > maxCount.value) maxCount.value = index + 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function onItemResize(w, h) {
|
|
46
|
+
itemWidth.value = w;
|
|
47
|
+
if (maxItemHeight.value < h) {
|
|
48
|
+
maxItemHeight.value = h;
|
|
49
|
+
updateMaxCount();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
watch(() => storyStore.currentVariant, () => {
|
|
53
|
+
maxItemHeight.value = 0;
|
|
54
|
+
updateMaxCount();
|
|
55
|
+
});
|
|
56
|
+
const gridEl = ref(null);
|
|
57
|
+
const gridColumnWidth = ref(1);
|
|
58
|
+
const viewWidth = ref(1);
|
|
59
|
+
function updateSize() {
|
|
60
|
+
if (!el.value) return;
|
|
61
|
+
viewWidth.value = el.value.clientWidth;
|
|
62
|
+
if (!gridEl.value) return;
|
|
63
|
+
if (gridTemplateWidth.value.endsWith("%")) gridColumnWidth.value = viewWidth.value * Number.parseInt(gridTemplateWidth.value) / 100 - gap;
|
|
64
|
+
else gridColumnWidth.value = Number.parseInt(gridTemplateWidth.value);
|
|
65
|
+
}
|
|
66
|
+
onMounted(() => {
|
|
67
|
+
updateSize();
|
|
68
|
+
});
|
|
69
|
+
useResizeObserver(gridEl, () => {
|
|
70
|
+
updateSize();
|
|
71
|
+
});
|
|
72
|
+
const columnCount = computed(() => Math.min(storyStore.currentStory.variants.length, Math.floor((viewWidth.value + gap) / (gridColumnWidth.value + gap))));
|
|
73
|
+
return (_ctx, _cache) => {
|
|
74
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
75
|
+
ref_key: "el",
|
|
76
|
+
ref: el,
|
|
77
|
+
class: "overflow-y-auto flex flex-1",
|
|
78
|
+
onScroll: _cache[0] || (_cache[0] = ($event) => updateMaxCount())
|
|
79
|
+
}, [createElementVNode("div", _hoisted_2, [createElementVNode("div", {
|
|
80
|
+
class: "m-auto",
|
|
81
|
+
style: normalizeStyle({ minHeight: `${unref(storyStore).currentStory.variants.length / countPerRow.value * (maxItemHeight.value + gap) - gap}px` })
|
|
82
|
+
}, [createElementVNode("div", {
|
|
83
|
+
ref_key: "gridEl",
|
|
84
|
+
ref: gridEl,
|
|
85
|
+
class: "grid gap-4 my-4",
|
|
86
|
+
style: normalizeStyle({ gridTemplateColumns: `repeat(${columnCount.value}, ${gridColumnWidth.value}px)` })
|
|
87
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants.slice(0, maxCount.value), (variant, index) => {
|
|
88
|
+
return openBlock(), createBlock(StoryVariantGridItem_default, {
|
|
89
|
+
key: index,
|
|
90
|
+
variant,
|
|
91
|
+
story: unref(storyStore).currentStory,
|
|
92
|
+
onResize: onItemResize
|
|
93
|
+
}, null, 8, ["variant", "story"]);
|
|
94
|
+
}), 128))], 4)], 4)])], 544)]);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
//#endregion
|
|
99
|
+
export { StoryVariantGrid_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default from "./StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/app/components/story/StoryVariantGridItem.vue
|
|
5
|
+
var StoryVariantGridItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-270b4ce8"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { StoryVariantGridItem_default as default };
|
package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { povesteConfig } from "../../util/config.js";
|
|
2
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
+
import { useScrollOnActive } from "../../util/scroll.js";
|
|
4
|
+
import { usePreviewDark } from "../../util/color-scheme.js";
|
|
5
|
+
import { getContrastColor } from "../../util/preview-settings.js";
|
|
6
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
7
|
+
import ToolbarNewTab_default from "../toolbar/ToolbarNewTab.js";
|
|
8
|
+
import GenericRenderStory_default from "./GenericRenderStory.js";
|
|
9
|
+
import { getSourceCode } from "../../util/docs.js";
|
|
10
|
+
import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
11
|
+
import CheckerboardPattern_default from "../misc/CheckerboardPattern.js";
|
|
12
|
+
import StoryVariantSinglePreviewRemote_default from "./StoryVariantSinglePreviewRemote.js";
|
|
13
|
+
import { useResizeObserver } from "@poveste/vendors/vue-use";
|
|
14
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, resolveComponent, resolveDirective, toDisplayString, toRefs, unref, useCssVars, withCtx, withDirectives, withModifiers } from "@poveste/vendors/vue";
|
|
15
|
+
import { Icon } from "@poveste/vendors/iconify";
|
|
16
|
+
import { useRouter } from "@poveste/vendors/vue-router";
|
|
17
|
+
import { HstCopyIcon } from "@poveste/controls";
|
|
18
|
+
//#region src/app/components/story/StoryVariantGridItem.vue?vue&type=script&setup=true&lang.ts
|
|
19
|
+
var _hoisted_1 = { class: "flex-none flex items-center" };
|
|
20
|
+
var _hoisted_2 = { class: "truncate flex-1" };
|
|
21
|
+
var _hoisted_3 = { class: "flex-none ml-auto hidden group-hover:flex items-center" };
|
|
22
|
+
var StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
|
+
__name: "StoryVariantGridItem",
|
|
24
|
+
props: {
|
|
25
|
+
variant: {
|
|
26
|
+
type: Object,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
story: {
|
|
30
|
+
type: Object,
|
|
31
|
+
required: true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: { resize: (_width, _height) => true },
|
|
35
|
+
setup(__props, { emit: __emit }) {
|
|
36
|
+
useCssVars((_ctx) => ({
|
|
37
|
+
"v0884d9dc": unref(variant).iconColor,
|
|
38
|
+
"v233de319": unref(settings).backgroundColor
|
|
39
|
+
}));
|
|
40
|
+
const props = __props;
|
|
41
|
+
const emit = __emit;
|
|
42
|
+
const { variant } = toRefs(props);
|
|
43
|
+
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
44
|
+
const storyStore = useStoryStore();
|
|
45
|
+
storyStore.setPreviewReady(props.variant, false);
|
|
46
|
+
function onReady() {
|
|
47
|
+
storyStore.setPreviewReady(props.variant, true);
|
|
48
|
+
}
|
|
49
|
+
const router = useRouter();
|
|
50
|
+
function selectVariant() {
|
|
51
|
+
router.push(targetRoute.value);
|
|
52
|
+
}
|
|
53
|
+
const el = ref();
|
|
54
|
+
const { autoScroll } = useScrollOnActive(isActive, el);
|
|
55
|
+
useResizeObserver(el, () => {
|
|
56
|
+
if (props.variant.previewReady) {
|
|
57
|
+
emit("resize", el.value.clientWidth, el.value.clientHeight);
|
|
58
|
+
if (isActive.value) autoScroll();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
62
|
+
const previewDark = usePreviewDark(settings);
|
|
63
|
+
const contrastColor = computed(() => getContrastColor(settings));
|
|
64
|
+
const autoApplyContrastColor = computed(() => !!povesteConfig.autoApplyContrastColor);
|
|
65
|
+
const useIframe = computed(() => {
|
|
66
|
+
const layout = props.story.layout;
|
|
67
|
+
if (layout?.type === "grid" && layout.iframeGrid !== void 0) return layout.iframeGrid;
|
|
68
|
+
return povesteConfig.isolateStyles !== false;
|
|
69
|
+
});
|
|
70
|
+
return (_ctx, _cache) => {
|
|
71
|
+
const _component_RouterLink = resolveComponent("RouterLink");
|
|
72
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
73
|
+
return openBlock(), createElementBlock("div", {
|
|
74
|
+
ref_key: "el",
|
|
75
|
+
ref: el,
|
|
76
|
+
class: "poveste-story-variant-grid-item cursor-default flex flex-col gap-y-1 group"
|
|
77
|
+
}, [createElementVNode("div", _hoisted_1, [withDirectives((openBlock(), createBlock(_component_RouterLink, {
|
|
78
|
+
to: unref(targetRoute),
|
|
79
|
+
class: normalizeClass(["rounded w-max px-2 py-0.5 min-w-16 cursor-pointer flex items-center gap-1 flex-shrink", {
|
|
80
|
+
"hover:bg-gray-200 text-gray-500 dark:hover:bg-gray-800": !unref(isActive),
|
|
81
|
+
"bg-primary-200 hover:bg-primary-300 text-primary-800 dark:bg-primary-700 dark:hover:bg-primary-800 dark:text-primary-200": unref(isActive)
|
|
82
|
+
}])
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx(() => [createVNode(unref(Icon), {
|
|
85
|
+
icon: unref(variant).icon ?? "carbon:cube",
|
|
86
|
+
class: normalizeClass(["w-4 h-4 opacity-50", {
|
|
87
|
+
"text-gray-500": !unref(isActive) && !unref(variant).iconColor,
|
|
88
|
+
"bind-icon-color": !unref(isActive) && unref(variant).iconColor
|
|
89
|
+
}])
|
|
90
|
+
}, null, 8, ["icon", "class"]), createElementVNode("span", _hoisted_2, toDisplayString(unref(variant).title), 1)]),
|
|
91
|
+
_: 1
|
|
92
|
+
}, 8, ["to", "class"])), [[_directive_tooltip, unref(variant).title]]), createElementVNode("div", _hoisted_3, [createVNode(unref(HstCopyIcon), { content: () => unref(getSourceCode)(__props.story, unref(variant)) }, null, 8, ["content"]), createVNode(ToolbarNewTab_default, {
|
|
93
|
+
variant: unref(variant),
|
|
94
|
+
story: __props.story
|
|
95
|
+
}, null, 8, ["variant", "story"])])]), createElementVNode("div", {
|
|
96
|
+
class: normalizeClass(["border bg-white dark:bg-gray-700 rounded flex-1 p-4 relative", {
|
|
97
|
+
"border-gray-100 dark:border-gray-800": !unref(isActive),
|
|
98
|
+
"border-primary-200 dark:border-primary-900": unref(isActive)
|
|
99
|
+
}]),
|
|
100
|
+
"data-test-id": "sandbox-render",
|
|
101
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"])),
|
|
102
|
+
onKeyup: _cache[1] || (_cache[1] = ($event) => selectVariant())
|
|
103
|
+
}, [
|
|
104
|
+
_cache[2] || (_cache[2] = createElementVNode("div", {
|
|
105
|
+
class: "absolute inset-0 rounded bind-preview-bg",
|
|
106
|
+
"data-test-id": "responsive-preview-bg"
|
|
107
|
+
}, null, -1)),
|
|
108
|
+
unref(settings).checkerboard ? (openBlock(), createBlock(CheckerboardPattern_default, {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: "absolute inset-0 w-full h-full text-gray-500/20"
|
|
111
|
+
})) : createCommentVNode("", true),
|
|
112
|
+
createElementVNode("div", {
|
|
113
|
+
class: "relative h-full",
|
|
114
|
+
style: normalizeStyle({
|
|
115
|
+
"--poveste-contrast-color": contrastColor.value,
|
|
116
|
+
"--histoire-contrast-color": contrastColor.value,
|
|
117
|
+
"color": autoApplyContrastColor.value ? contrastColor.value : void 0
|
|
118
|
+
})
|
|
119
|
+
}, [useIframe.value ? (openBlock(), createBlock(StoryVariantSinglePreviewRemote_default, {
|
|
120
|
+
key: `iframe-${__props.story.id}-${unref(variant).id}`,
|
|
121
|
+
story: __props.story,
|
|
122
|
+
variant: unref(variant),
|
|
123
|
+
"auto-height": ""
|
|
124
|
+
}, null, 8, ["story", "variant"])) : (openBlock(), createBlock(GenericRenderStory_default, {
|
|
125
|
+
key: `${__props.story.id}-${unref(variant).id}`,
|
|
126
|
+
variant: unref(variant),
|
|
127
|
+
story: __props.story,
|
|
128
|
+
dir: unref(settings).textDirection,
|
|
129
|
+
class: normalizeClass({ [unref(povesteConfig).theme.darkClass]: unref(previewDark) }),
|
|
130
|
+
onReady
|
|
131
|
+
}, null, 8, [
|
|
132
|
+
"variant",
|
|
133
|
+
"story",
|
|
134
|
+
"dir",
|
|
135
|
+
"class"
|
|
136
|
+
]))], 4)
|
|
137
|
+
], 34)], 512);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
//#endregion
|
|
142
|
+
export { StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import StoryVariantListItem_vue_vue_type_script_setup_true_lang_default from "./StoryVariantListItem.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/app/components/story/StoryVariantListItem.vue
|
|
5
|
+
var StoryVariantListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryVariantListItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-37853789"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { StoryVariantListItem_default as default };
|
package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useScrollOnActive } from "../../util/scroll.js";
|
|
2
|
+
import BaseListItemLink_default from "../base/BaseListItemLink.js";
|
|
3
|
+
import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
4
|
+
import { createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, toDisplayString, toRefs, unref, useCssVars, withCtx } from "@poveste/vendors/vue";
|
|
5
|
+
import { Icon } from "@poveste/vendors/iconify";
|
|
6
|
+
//#region src/app/components/story/StoryVariantListItem.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var _hoisted_1 = { class: "truncate" };
|
|
8
|
+
var StoryVariantListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
|
+
__name: "StoryVariantListItem",
|
|
10
|
+
props: { variant: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
} },
|
|
14
|
+
setup(__props) {
|
|
15
|
+
useCssVars((_ctx) => ({ "v25a47cf6": unref(variant).iconColor }));
|
|
16
|
+
const { variant } = toRefs(__props);
|
|
17
|
+
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
18
|
+
const el = ref();
|
|
19
|
+
useScrollOnActive(isActive, el);
|
|
20
|
+
return (_ctx, _cache) => {
|
|
21
|
+
return openBlock(), createElementBlock("div", {
|
|
22
|
+
ref_key: "el",
|
|
23
|
+
ref: el,
|
|
24
|
+
class: "poveste-story-variant-list-item",
|
|
25
|
+
"data-test-id": "story-variant-list-item"
|
|
26
|
+
}, [createVNode(BaseListItemLink_default, {
|
|
27
|
+
to: unref(targetRoute),
|
|
28
|
+
"is-active": unref(isActive),
|
|
29
|
+
class: "px-2 py-2 md:py-1.5 m-1 rounded-sm flex items-center gap-2"
|
|
30
|
+
}, {
|
|
31
|
+
default: withCtx(({ active }) => [createVNode(unref(Icon), {
|
|
32
|
+
icon: unref(variant).icon ?? "carbon:cube",
|
|
33
|
+
class: normalizeClass(["w-5 h-5 sm:w-4 sm:h-4 flex-none", {
|
|
34
|
+
"text-gray-500": !active && !unref(variant).iconColor,
|
|
35
|
+
"bind-icon-color": !active && unref(variant).iconColor
|
|
36
|
+
}])
|
|
37
|
+
}, null, 8, ["icon", "class"]), createElementVNode("span", _hoisted_1, toDisplayString(unref(variant).title), 1)]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["to", "is-active"])], 512);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { StoryVariantListItem_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import StoryVariantSingle_vue_vue_type_script_setup_true_lang_default from "./StoryVariantSingle.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/app/components/story/StoryVariantSingle.vue
|
|
5
|
+
var StoryVariantSingle_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryVariantSingle_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-db50bc8f"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { StoryVariantSingle_default as default };
|
package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { isMobile } from "../../util/responsive.js";
|
|
2
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
+
import BaseSplitPane_default from "../base/BaseSplitPane.js";
|
|
4
|
+
import StoryVariantListItem_default from "./StoryVariantListItem.js";
|
|
5
|
+
import StoryVariantSingleView_default from "./StoryVariantSingleView.js";
|
|
6
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, useCssVars, withCtx } from "@poveste/vendors/vue";
|
|
7
|
+
import { Icon } from "@poveste/vendors/iconify";
|
|
8
|
+
//#region src/app/components/story/StoryVariantSingle.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var _hoisted_1 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "poveste-story-variant-single p-2 h-full __poveste-pane-shadow-from-right"
|
|
12
|
+
};
|
|
13
|
+
var _hoisted_2 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "divide-y divide-gray-100 dark:divide-gray-800 h-full flex flex-col"
|
|
16
|
+
};
|
|
17
|
+
var _hoisted_3 = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "p-2 h-full"
|
|
20
|
+
};
|
|
21
|
+
var _hoisted_4 = { class: "h-full overflow-y-auto" };
|
|
22
|
+
var _hoisted_5 = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "p-2 h-full __poveste-pane-shadow-from-right"
|
|
25
|
+
};
|
|
26
|
+
var StoryVariantSingle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
27
|
+
__name: "StoryVariantSingle",
|
|
28
|
+
emits: { openVariantMenu: () => true },
|
|
29
|
+
setup(__props) {
|
|
30
|
+
useCssVars((_ctx) => ({ "dd8d1ad8": variant.value?.iconColor }));
|
|
31
|
+
const storyStore = useStoryStore();
|
|
32
|
+
const hasSingleVariant = computed(() => storyStore.currentStory?.variants.length === 1);
|
|
33
|
+
const variant = computed(() => storyStore.currentVariant);
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return hasSingleVariant.value && variant.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(StoryVariantSingleView_default, {
|
|
36
|
+
variant: variant.value,
|
|
37
|
+
story: unref(storyStore).currentStory
|
|
38
|
+
}, null, 8, ["variant", "story"])])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("a", {
|
|
39
|
+
class: "px-6 h-12 hover:text-primary-500 dark:hover:text-primary-400 cursor-pointer flex gap-2 flex-wrap w-full items-center flex-none",
|
|
40
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("openVariantMenu"))
|
|
41
|
+
}, [variant.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(Icon), {
|
|
42
|
+
icon: variant.value.icon ?? "carbon:cube",
|
|
43
|
+
class: normalizeClass(["w-5 h-5 flex-none", {
|
|
44
|
+
"text-gray-500": !variant.value.iconColor,
|
|
45
|
+
"bind-icon-color": variant.value.iconColor
|
|
46
|
+
}])
|
|
47
|
+
}, null, 8, ["icon", "class"]), createTextVNode(" " + toDisplayString(variant.value.title), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Select a variant... ")], 64)), createVNode(unref(Icon), {
|
|
48
|
+
icon: "carbon:chevron-sort",
|
|
49
|
+
class: "w-5 h-5 shrink-0 ml-auto"
|
|
50
|
+
})]), unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(StoryVariantSingleView_default, {
|
|
51
|
+
variant: unref(storyStore).currentVariant,
|
|
52
|
+
story: unref(storyStore).currentStory
|
|
53
|
+
}, null, 8, ["variant", "story"])])) : createCommentVNode("", true)])) : (openBlock(), createBlock(BaseSplitPane_default, {
|
|
54
|
+
key: 1,
|
|
55
|
+
"save-id": "story-single-main-split",
|
|
56
|
+
min: 5,
|
|
57
|
+
max: 40,
|
|
58
|
+
"default-split": 17
|
|
59
|
+
}, {
|
|
60
|
+
first: withCtx(() => [createElementVNode("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
61
|
+
return openBlock(), createBlock(StoryVariantListItem_default, {
|
|
62
|
+
key: index,
|
|
63
|
+
variant: v
|
|
64
|
+
}, null, 8, ["variant"]);
|
|
65
|
+
}), 128))])]),
|
|
66
|
+
last: withCtx(() => [unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(StoryVariantSingleView_default, {
|
|
67
|
+
variant: unref(storyStore).currentVariant,
|
|
68
|
+
story: unref(storyStore).currentStory
|
|
69
|
+
}, null, 8, ["variant", "story"])])) : createCommentVNode("", true)]),
|
|
70
|
+
_: 1
|
|
71
|
+
}))], 64));
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { StoryVariantSingle_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import StoryVariantSinglePreviewNative_vue_vue_type_script_setup_true_lang_default from "./StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/app/components/story/StoryVariantSinglePreviewNative.vue
|
|
3
|
+
var StoryVariantSinglePreviewNative_default = StoryVariantSinglePreviewNative_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { StoryVariantSinglePreviewNative_default as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { povesteConfig } from "../../util/config.js";
|
|
2
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
+
import { usePreviewDark } from "../../util/color-scheme.js";
|
|
4
|
+
import { getContrastColor } from "../../util/preview-settings.js";
|
|
5
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
6
|
+
import GenericRenderStory_default from "./GenericRenderStory.js";
|
|
7
|
+
import StoryResponsivePreview_default from "./StoryResponsivePreview.js";
|
|
8
|
+
import { computed, createBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, unref, withCtx } from "@poveste/vendors/vue";
|
|
9
|
+
//#region src/app/components/story/StoryVariantSinglePreviewNative.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var StoryVariantSinglePreviewNative_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
11
|
+
__name: "StoryVariantSinglePreviewNative",
|
|
12
|
+
props: {
|
|
13
|
+
story: {},
|
|
14
|
+
variant: {}
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const storyStore = useStoryStore();
|
|
19
|
+
storyStore.setPreviewReady(props.variant, false);
|
|
20
|
+
function onReady() {
|
|
21
|
+
storyStore.setPreviewReady(props.variant, true);
|
|
22
|
+
}
|
|
23
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
24
|
+
const previewDark = usePreviewDark(settings);
|
|
25
|
+
const contrastColor = computed(() => getContrastColor(settings));
|
|
26
|
+
const autoApplyContrastColor = computed(() => !!povesteConfig.autoApplyContrastColor);
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return openBlock(), createBlock(StoryResponsivePreview_default, {
|
|
29
|
+
class: "poveste-story-variant-single-preview-native",
|
|
30
|
+
variant: __props.variant
|
|
31
|
+
}, {
|
|
32
|
+
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight }) => [createElementVNode("div", {
|
|
33
|
+
style: normalizeStyle([isResponsiveEnabled ? {
|
|
34
|
+
width: finalWidth ? `${finalWidth}px` : "100%",
|
|
35
|
+
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
36
|
+
} : {
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: "100%"
|
|
39
|
+
}, {
|
|
40
|
+
"--poveste-contrast-color": contrastColor.value,
|
|
41
|
+
"--histoire-contrast-color": contrastColor.value,
|
|
42
|
+
"color": autoApplyContrastColor.value ? contrastColor.value : void 0
|
|
43
|
+
}]),
|
|
44
|
+
class: "relative",
|
|
45
|
+
"data-test-id": "sandbox-render"
|
|
46
|
+
}, [(openBlock(), createBlock(GenericRenderStory_default, {
|
|
47
|
+
key: `${__props.story.id}-${__props.variant.id}`,
|
|
48
|
+
variant: __props.variant,
|
|
49
|
+
story: __props.story,
|
|
50
|
+
class: normalizeClass(["h-full", {
|
|
51
|
+
[unref(povesteConfig).sandboxDarkClass]: unref(previewDark),
|
|
52
|
+
[unref(povesteConfig).theme.darkClass]: unref(previewDark)
|
|
53
|
+
}]),
|
|
54
|
+
dir: unref(settings).textDirection,
|
|
55
|
+
onReady
|
|
56
|
+
}, null, 8, [
|
|
57
|
+
"variant",
|
|
58
|
+
"story",
|
|
59
|
+
"class",
|
|
60
|
+
"dir"
|
|
61
|
+
]))], 4)]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["variant"]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { StoryVariantSinglePreviewNative_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import StoryVariantSinglePreviewRemote_vue_vue_type_script_setup_true_lang_default from "./StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/app/components/story/StoryVariantSinglePreviewRemote.vue
|
|
3
|
+
var StoryVariantSinglePreviewRemote_default = StoryVariantSinglePreviewRemote_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { StoryVariantSinglePreviewRemote_default as default };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { EVENT_SEND, PREVIEW_SETTINGS_SYNC, SANDBOX_HEIGHT, SANDBOX_READY, STATE_SYNC } from "../../util/const.js";
|
|
2
|
+
import { trackWindow } from "../../util/keyboard.js";
|
|
3
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
4
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
5
|
+
import { getSandboxUrl } from "../../util/sandbox.js";
|
|
6
|
+
import { toRawDeep } from "../../util/state.js";
|
|
7
|
+
import { useEventsStore } from "../../stores/events.js";
|
|
8
|
+
import StoryResponsivePreview_default from "./StoryResponsivePreview.js";
|
|
9
|
+
import { useEventListener } from "@poveste/vendors/vue-use";
|
|
10
|
+
import { computed, createBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, toRaw, watch, withCtx } from "@poveste/vendors/vue";
|
|
11
|
+
import { applyState } from "@poveste/shared";
|
|
12
|
+
//#region src/app/components/story/StoryVariantSinglePreviewRemote.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
+
var _hoisted_1 = ["src"];
|
|
14
|
+
var StoryVariantSinglePreviewRemote_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
15
|
+
__name: "StoryVariantSinglePreviewRemote",
|
|
16
|
+
props: {
|
|
17
|
+
story: {},
|
|
18
|
+
variant: {},
|
|
19
|
+
autoHeight: { type: Boolean }
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
24
|
+
const iframe = ref();
|
|
25
|
+
function syncState() {
|
|
26
|
+
if (iframe.value && props.variant.previewReady) iframe.value.contentWindow.postMessage({
|
|
27
|
+
type: STATE_SYNC,
|
|
28
|
+
state: toRawDeep(props.variant.state, true)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
let synced = false;
|
|
32
|
+
watch(() => props.variant.state, () => {
|
|
33
|
+
if (synced) {
|
|
34
|
+
synced = false;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
syncState();
|
|
38
|
+
}, {
|
|
39
|
+
deep: true,
|
|
40
|
+
immediate: true
|
|
41
|
+
});
|
|
42
|
+
const storyStore = useStoryStore();
|
|
43
|
+
storyStore.setPreviewReady(props.variant, false);
|
|
44
|
+
const reportedHeight = ref(null);
|
|
45
|
+
useEventListener(window, "message", (event) => {
|
|
46
|
+
if (event.source !== iframe.value?.contentWindow) return;
|
|
47
|
+
switch (event.data?.type) {
|
|
48
|
+
case STATE_SYNC:
|
|
49
|
+
updateVariantState(event.data.state);
|
|
50
|
+
break;
|
|
51
|
+
case EVENT_SEND:
|
|
52
|
+
logEvent(event.data.event);
|
|
53
|
+
break;
|
|
54
|
+
case SANDBOX_READY:
|
|
55
|
+
setPreviewReady();
|
|
56
|
+
break;
|
|
57
|
+
case SANDBOX_HEIGHT: if (typeof event.data.h === "number") {
|
|
58
|
+
const next = Math.max(40, event.data.h);
|
|
59
|
+
if (next !== reportedHeight.value) reportedHeight.value = next;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
function updateVariantState(state) {
|
|
64
|
+
synced = applyState(props.variant.state, state);
|
|
65
|
+
}
|
|
66
|
+
function logEvent(event) {
|
|
67
|
+
useEventsStore().addEvent(event);
|
|
68
|
+
}
|
|
69
|
+
function setPreviewReady() {
|
|
70
|
+
storyStore.setPreviewReady(props.variant, true);
|
|
71
|
+
}
|
|
72
|
+
const sandboxUrl = computed(() => {
|
|
73
|
+
return getSandboxUrl(props.story, props.variant);
|
|
74
|
+
});
|
|
75
|
+
const isIframeLoaded = ref(false);
|
|
76
|
+
let stopTrackKeyboard;
|
|
77
|
+
let unmounted = false;
|
|
78
|
+
watch(sandboxUrl, () => {
|
|
79
|
+
isIframeLoaded.value = false;
|
|
80
|
+
storyStore.setPreviewReady(props.variant, false);
|
|
81
|
+
stopTrackKeyboard?.();
|
|
82
|
+
stopTrackKeyboard = void 0;
|
|
83
|
+
});
|
|
84
|
+
onBeforeUnmount(() => {
|
|
85
|
+
unmounted = true;
|
|
86
|
+
stopTrackKeyboard?.();
|
|
87
|
+
});
|
|
88
|
+
function syncSettings() {
|
|
89
|
+
if (iframe.value) iframe.value.contentWindow.postMessage({
|
|
90
|
+
type: PREVIEW_SETTINGS_SYNC,
|
|
91
|
+
settings: toRaw(settings)
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
watch(() => settings, () => {
|
|
95
|
+
syncSettings();
|
|
96
|
+
}, {
|
|
97
|
+
deep: true,
|
|
98
|
+
immediate: true
|
|
99
|
+
});
|
|
100
|
+
function onIframeLoad() {
|
|
101
|
+
if (unmounted) return;
|
|
102
|
+
isIframeLoaded.value = true;
|
|
103
|
+
syncState();
|
|
104
|
+
syncSettings();
|
|
105
|
+
stopTrackKeyboard?.();
|
|
106
|
+
if (iframe.value?.contentWindow) stopTrackKeyboard = trackWindow(iframe.value.contentWindow);
|
|
107
|
+
}
|
|
108
|
+
return (_ctx, _cache) => {
|
|
109
|
+
return openBlock(), createBlock(StoryResponsivePreview_default, {
|
|
110
|
+
class: "poveste-story-variant-single-preview-remote",
|
|
111
|
+
variant: __props.variant
|
|
112
|
+
}, {
|
|
113
|
+
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight, resizing }) => [createElementVNode("iframe", {
|
|
114
|
+
ref_key: "iframe",
|
|
115
|
+
ref: iframe,
|
|
116
|
+
src: sandboxUrl.value,
|
|
117
|
+
class: normalizeClass(["w-full h-full relative", {
|
|
118
|
+
"invisible": !isIframeLoaded.value,
|
|
119
|
+
"pointer-events-none": resizing
|
|
120
|
+
}]),
|
|
121
|
+
style: normalizeStyle(isResponsiveEnabled ? {
|
|
122
|
+
width: finalWidth ? `${finalWidth}px` : null,
|
|
123
|
+
height: finalHeight ? `${finalHeight}px` : null
|
|
124
|
+
} : props.autoHeight && reportedHeight.value ? { height: `${reportedHeight.value}px` } : void 0),
|
|
125
|
+
"data-test-id": "preview-iframe",
|
|
126
|
+
onLoad: _cache[0] || (_cache[0] = ($event) => onIframeLoad())
|
|
127
|
+
}, null, 46, _hoisted_1)]),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 8, ["variant"]);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
//#endregion
|
|
134
|
+
export { StoryVariantSinglePreviewRemote_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import StoryVariantSingleView_vue_vue_type_script_setup_true_lang_default from "./StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/app/components/story/StoryVariantSingleView.vue
|
|
3
|
+
var StoryVariantSingleView_default = StoryVariantSingleView_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { StoryVariantSingleView_default as default };
|
package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import StoryVariantSinglePreviewRemote_default from "./StoryVariantSinglePreviewRemote.js";
|
|
2
|
+
import StoryVariantSinglePreviewNative_default from "./StoryVariantSinglePreviewNative.js";
|
|
3
|
+
import { createBlock, createElementBlock, defineComponent, openBlock } from "@poveste/vendors/vue";
|
|
4
|
+
//#region src/app/components/story/StoryVariantSingleView.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _hoisted_1 = {
|
|
6
|
+
class: "poveste-story-variant-single-view h-full flex flex-col",
|
|
7
|
+
"data-test-id": "story-variant-single-view"
|
|
8
|
+
};
|
|
9
|
+
var StoryVariantSingleView_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
10
|
+
__name: "StoryVariantSingleView",
|
|
11
|
+
props: {
|
|
12
|
+
variant: {},
|
|
13
|
+
story: {}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [__props.story.layout?.iframe === false ? (openBlock(), createBlock(StoryVariantSinglePreviewNative_default, {
|
|
18
|
+
key: 0,
|
|
19
|
+
story: __props.story,
|
|
20
|
+
variant: __props.variant
|
|
21
|
+
}, null, 8, ["story", "variant"])) : (openBlock(), createBlock(StoryVariantSinglePreviewRemote_default, {
|
|
22
|
+
key: 1,
|
|
23
|
+
story: __props.story,
|
|
24
|
+
variant: __props.variant
|
|
25
|
+
}, null, 8, ["story", "variant"]))]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { StoryVariantSingleView_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import StoryView_vue_vue_type_script_setup_true_lang_default from "./StoryView.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/app/components/story/StoryView.vue
|
|
3
|
+
var StoryView_default = StoryView_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { StoryView_default as default };
|