@histoire/app 0.11.9 → 0.12.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/bundled/App.vue.js +6 -0
- package/dist/bundled/{App.vue_vue_type_script_setup_true_lang.js → App.vue2.js} +14 -13
- package/dist/bundled/api.js +1 -0
- package/dist/bundled/assets/{histoire-text-dark.js → histoire-text-dark.svg.js} +0 -0
- package/dist/bundled/assets/{histoire-text.js → histoire-text.svg.js} +0 -0
- package/dist/bundled/assets/{histoire.js → histoire.svg.js} +0 -0
- package/dist/bundled/components/HomeView.vue.js +6 -0
- package/dist/bundled/components/{HomeView.vue_vue_type_script_setup_true_lang.js → HomeView.vue2.js} +2 -1
- package/dist/bundled/components/app/AppHeader.vue.js +6 -0
- package/dist/bundled/components/app/{AppHeader.vue_vue_type_script_setup_true_lang.js → AppHeader.vue2.js} +3 -2
- package/dist/bundled/components/app/AppLogo.vue.js +6 -0
- package/dist/bundled/components/app/{AppLogo.vue_vue_type_script_setup_true_lang.js → AppLogo.vue2.js} +3 -2
- package/dist/bundled/components/app/{Breadcrumb.js → Breadcrumb.vue.js} +3 -2
- package/dist/bundled/components/app/{Breadcrumb.vue_vue_type_script_setup_true_lang.js → Breadcrumb.vue2.js} +6 -6
- package/dist/bundled/components/app/{Breadcrumb.vue_vue_type_style_index_0_scoped_36846ccf_lang.js → Breadcrumb.vue3.js} +0 -0
- package/dist/bundled/components/app/InitialLoading.vue.js +6 -0
- package/dist/bundled/components/app/{InitialLoading.vue_vue_type_script_setup_true_lang.js → InitialLoading.vue2.js} +1 -0
- package/dist/bundled/components/app/MobileOverlay.vue.js +6 -0
- package/dist/bundled/components/app/{MobileOverlay.vue_vue_type_script_setup_true_lang.js → MobileOverlay.vue2.js} +1 -0
- package/dist/bundled/components/base/BaseCheckbox.vue.js +6 -0
- package/dist/bundled/components/base/{BaseCheckbox.vue_vue_type_script_setup_true_lang.js → BaseCheckbox.vue2.js} +3 -2
- package/dist/bundled/components/base/{BaseEmpty.js → BaseEmpty.vue.js} +1 -1
- package/dist/bundled/components/base/{BaseEmpty.vue_vue_type_style_index_0_scoped_c5ecfead_lang.js → BaseEmpty.vue2.js} +0 -0
- package/dist/bundled/components/base/{BaseListItemLink.js → BaseListItemLink.vue.js} +2 -1
- package/dist/bundled/components/base/{BaseListItemLink.vue_vue_type_script_lang.js → BaseListItemLink.vue2.js} +1 -0
- package/dist/bundled/components/base/BaseOverflowMenu.vue.js +6 -0
- package/dist/bundled/components/base/{BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js → BaseOverflowMenu.vue2.js} +1 -0
- package/dist/bundled/components/base/{BaseOverflowTab.js → BaseOverflowTab.vue.js} +2 -1
- package/dist/bundled/components/base/{BaseOverflowTab.vue_vue_type_script_lang.js → BaseOverflowTab.vue2.js} +1 -0
- package/dist/bundled/components/base/BaseSelect.vue.js +6 -0
- package/dist/bundled/components/base/{BaseSelect.vue_vue_type_script_setup_true_lang.js → BaseSelect.vue2.js} +1 -0
- package/dist/bundled/components/base/{BaseSplitPane.js → BaseSplitPane.vue.js} +3 -2
- package/dist/bundled/components/base/{BaseSplitPane.vue_vue_type_script_setup_true_lang.js → BaseSplitPane.vue2.js} +1 -0
- package/dist/bundled/components/base/{BaseSplitPane.vue_vue_type_style_index_0_scoped_ed925107_lang.js → BaseSplitPane.vue3.js} +0 -0
- package/dist/bundled/components/base/{BaseTab.js → BaseTab.vue.js} +2 -1
- package/dist/bundled/components/base/{BaseTab.vue_vue_type_script_lang.js → BaseTab.vue2.js} +1 -0
- package/dist/bundled/components/base/{BaseTag.js → BaseTag.vue.js} +0 -0
- package/dist/bundled/components/misc/{CheckerboardPattern.js → CheckerboardPattern.vue.js} +0 -0
- package/dist/bundled/components/misc/{HatchedPattern.js → HatchedPattern.vue.js} +1 -1
- package/dist/bundled/components/misc/{HatchedPattern.vue_vue_type_style_index_0_scoped_91561117_lang.js → HatchedPattern.vue2.js} +0 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +6 -0
- package/dist/bundled/components/panel/{ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js → ControlsComponentPropItem.vue2.js} +1 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue.js +6 -0
- package/dist/bundled/components/panel/{ControlsComponentProps.vue_vue_type_script_setup_true_lang.js → ControlsComponentProps.vue2.js} +3 -2
- package/dist/bundled/components/panel/PaneTabs.vue.js +6 -0
- package/dist/bundled/components/panel/{PaneTabs.vue_vue_type_script_setup_true_lang.js → PaneTabs.vue2.js} +8 -7
- package/dist/bundled/components/panel/StatePresets.vue.js +6 -0
- package/dist/bundled/components/panel/{StatePresets.vue_vue_type_script_setup_true_lang.js → StatePresets.vue2.js} +3 -2
- package/dist/bundled/components/panel/StoryControls.vue.js +6 -0
- package/dist/bundled/components/panel/{StoryControls.vue_vue_type_script_setup_true_lang.js → StoryControls.vue2.js} +8 -7
- package/dist/bundled/components/panel/StoryDocs.vue.js +7 -0
- package/dist/bundled/components/panel/{StoryDocs.vue_vue_type_script_setup_true_lang.js → StoryDocs.vue2.js} +57 -4
- package/dist/bundled/components/panel/StoryEvent.vue.js +6 -0
- package/dist/bundled/components/panel/{StoryEvent.vue_vue_type_script_setup_true_lang.js → StoryEvent.vue2.js} +1 -0
- package/dist/bundled/components/panel/StoryEvents.vue.js +6 -0
- package/dist/bundled/components/panel/{StoryEvents.vue_vue_type_script_setup_true_lang.js → StoryEvents.vue2.js} +4 -3
- package/dist/bundled/components/panel/StorySidePanel.vue.js +6 -0
- package/dist/bundled/components/panel/{StorySidePanel.vue_vue_type_script_setup_true_lang.js → StorySidePanel.vue2.js} +12 -11
- package/dist/bundled/components/panel/{StorySourceCode.js → StorySourceCode.vue.js} +3 -2
- package/dist/bundled/components/panel/{StorySourceCode.vue_vue_type_script_setup_true_lang.js → StorySourceCode.vue2.js} +2 -1
- package/dist/bundled/components/panel/{StorySourceCode.vue_vue_type_style_index_0_scoped_f528bb1b_lang.js → StorySourceCode.vue3.js} +0 -0
- package/dist/bundled/components/search/{SearchItem.js → SearchItem.vue.js} +3 -2
- package/dist/bundled/components/search/{SearchItem.vue_vue_type_script_setup_true_lang.js → SearchItem.vue2.js} +5 -4
- package/dist/bundled/components/search/{SearchItem.vue_vue_type_style_index_0_scoped_d95fcb03_lang.js → SearchItem.vue3.js} +0 -0
- package/dist/bundled/components/search/SearchLoading.vue.js +6 -0
- package/dist/bundled/components/search/{SearchLoading.vue_vue_type_script_setup_true_lang.js → SearchLoading.vue2.js} +1 -0
- package/dist/bundled/components/search/SearchModal.vue.js +6 -0
- package/dist/bundled/components/search/{SearchModal.vue_vue_type_script_setup_true_lang.js → SearchModal.vue2.js} +4 -3
- package/dist/bundled/components/search/SearchPane.vue.js +6 -0
- package/dist/bundled/components/search/{SearchPane.vue_vue_type_script_setup_true_lang.js → SearchPane.vue2.js} +4 -4
- package/dist/bundled/components/search/search-docs-data.js +1 -0
- package/dist/bundled/components/search/search-title-data.js +1 -0
- package/dist/bundled/components/story/GenericMountStory.vue.js +6 -0
- package/dist/bundled/components/story/{GenericMountStory.vue_vue_type_script_setup_true_lang.js → GenericMountStory.vue2.js} +1 -0
- package/dist/bundled/components/story/GenericRenderStory.vue.js +6 -0
- package/dist/bundled/components/story/{GenericRenderStory.vue_vue_type_script_setup_true_lang.js → GenericRenderStory.vue2.js} +1 -0
- package/dist/bundled/components/story/{StoryResponsivePreview.js → StoryResponsivePreview.vue.js} +3 -2
- package/dist/bundled/components/story/{StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js → StoryResponsivePreview.vue2.js} +5 -8
- package/dist/bundled/components/story/{StoryResponsivePreview.vue_vue_type_style_index_0_scoped_a83b1911_lang.js → StoryResponsivePreview.vue3.js} +0 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue.js +6 -0
- package/dist/bundled/components/story/{StoryVariantGrid.vue_vue_type_script_setup_true_lang.js → StoryVariantGrid.vue2.js} +5 -4
- package/dist/bundled/components/story/{StoryVariantGridItem.js → StoryVariantGridItem.vue.js} +3 -2
- package/dist/bundled/components/story/{StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js → StoryVariantGridItem.vue2.js} +16 -18
- package/dist/bundled/components/story/{StoryVariantGridItem.vue_vue_type_style_index_0_scoped_f7c98176_lang.js → StoryVariantGridItem.vue3.js} +0 -0
- package/dist/bundled/components/story/{StoryVariantListItem.js → StoryVariantListItem.vue.js} +3 -2
- package/dist/bundled/components/story/{StoryVariantListItem.vue_vue_type_script_setup_true_lang.js → StoryVariantListItem.vue2.js} +12 -14
- package/dist/bundled/components/story/{StoryVariantListItem.vue_vue_type_style_index_0_scoped_ab890d9c_lang.js → StoryVariantListItem.vue3.js} +0 -0
- package/dist/bundled/components/story/{StoryVariantSingle.js → StoryVariantSingle.vue.js} +3 -2
- package/dist/bundled/components/story/{StoryVariantSingle.vue_vue_type_script_setup_true_lang.js → StoryVariantSingle.vue2.js} +6 -6
- package/dist/bundled/components/story/{StoryVariantSingle.vue_vue_type_style_index_0_scoped_ddfc5b4f_lang.js → StoryVariantSingle.vue3.js} +0 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +6 -0
- package/dist/bundled/components/story/{StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js → StoryVariantSinglePreviewNative.vue2.js} +4 -3
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +6 -0
- package/dist/bundled/components/story/{StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js → StoryVariantSinglePreviewRemote.vue2.js} +2 -1
- package/dist/bundled/components/story/StoryVariantSingleView.vue.js +6 -0
- package/dist/bundled/components/story/{StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js → StoryVariantSingleView.vue2.js} +14 -13
- package/dist/bundled/components/story/StoryView.vue.js +6 -0
- package/dist/bundled/components/story/{StoryView.vue_vue_type_script_setup_true_lang.js → StoryView.vue2.js} +23 -15
- package/dist/bundled/components/story/{StoryViewer.js → StoryViewer.vue.js} +3 -2
- package/dist/bundled/components/story/{StoryViewer.vue_vue_type_script_setup_true_lang.js → StoryViewer.vue2.js} +7 -6
- package/dist/bundled/components/story/{StoryViewer.vue_vue_type_style_index_0_scoped_6046525f_lang.js → StoryViewer.vue3.js} +0 -0
- package/dist/bundled/components/toolbar/{ToolbarBackground.js → ToolbarBackground.vue.js} +3 -2
- package/dist/bundled/components/toolbar/{ToolbarBackground.vue_vue_type_script_setup_true_lang.js → ToolbarBackground.vue2.js} +3 -2
- package/dist/bundled/components/toolbar/{ToolbarBackground.vue_vue_type_style_index_0_scoped_c48fb2b2_lang.js → ToolbarBackground.vue3.js} +0 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +6 -0
- package/dist/bundled/components/toolbar/{ToolbarNewTab.vue_vue_type_script_setup_true_lang.js → ToolbarNewTab.vue2.js} +1 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +6 -0
- package/dist/bundled/components/toolbar/{ToolbarResponsiveSize.vue_vue_type_script_setup_true_lang.js → ToolbarResponsiveSize.vue2.js} +4 -3
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +6 -0
- package/dist/bundled/components/toolbar/{ToolbarTextDirection.vue_vue_type_script_setup_true_lang.js → ToolbarTextDirection.vue2.js} +1 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +6 -0
- package/dist/bundled/components/toolbar/{ToolbarTitle.vue_vue_type_script_setup_true_lang.js → ToolbarTitle.vue2.js} +2 -2
- package/dist/bundled/components/tree/StoryGroup.vue.js +6 -0
- package/dist/bundled/components/tree/{StoryGroup.vue_vue_type_script_setup_true_lang.js → StoryGroup.vue2.js} +27 -27
- package/dist/bundled/components/tree/StoryList.vue.js +6 -0
- package/dist/bundled/components/tree/{StoryList.vue_vue_type_script_setup_true_lang.js → StoryList.vue2.js} +5 -4
- package/dist/bundled/components/tree/StoryListFolder.vue.js +8 -0
- package/dist/bundled/components/tree/{StoryListFolder.vue_vue_type_script_setup_true_lang.js → StoryListFolder.vue2.js} +8 -11
- package/dist/bundled/components/tree/StoryListFolder.vue3.js +4 -0
- package/dist/bundled/components/tree/{StoryListItem.js → StoryListItem.vue.js} +3 -2
- package/dist/bundled/components/tree/{StoryListItem.vue_vue_type_script_setup_true_lang.js → StoryListItem.vue2.js} +15 -17
- package/dist/bundled/components/tree/{StoryListItem.vue_vue_type_style_index_0_scoped_19810958_lang.js → StoryListItem.vue3.js} +0 -0
- package/dist/bundled/index.js +3 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +1 -1
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +1 -1
- package/dist/bundled/router.js +3 -2
- package/dist/bundled/sandbox.js +5 -4
- package/dist/bundled/stores/events.js +1 -0
- package/dist/bundled/stores/folder.js +2 -1
- package/dist/bundled/stores/preview-settings.js +1 -0
- package/dist/bundled/stores/story.js +1 -0
- package/dist/bundled/style.css +22 -22
- package/dist/bundled/util/config.js +1 -0
- package/dist/bundled/util/dark.js +1 -0
- package/dist/bundled/util/events.js +1 -0
- package/dist/bundled/util/keyboard.js +5 -5
- package/dist/bundled/util/mapping.js +1 -0
- package/dist/bundled/util/preview-settings.js +3 -2
- package/dist/bundled/util/responsive.js +1 -0
- package/dist/bundled/util/sandbox.js +1 -0
- package/dist/bundled/util/scroll.js +1 -0
- package/dist/bundled/util/state.js +1 -0
- package/dist/bundled/util/tooltip.js +1 -0
- package/dist/bundled/util/variant.js +1 -0
- package/dist/style.css +26 -5
- package/package.json +6 -6
- package/src/app/components/panel/StoryDocs.vue +66 -2
- package/src/app/components/story/StoryView.vue +11 -1
- package/src/app/components/tree/StoryGroup.vue +18 -20
- package/src/app/components/tree/StoryListFolder.vue +3 -7
- package/tsconfig.json +2 -1
- package/dist/bundled/App.js +0 -5
- package/dist/bundled/components/HomeView.js +0 -5
- package/dist/bundled/components/app/AppHeader.js +0 -5
- package/dist/bundled/components/app/AppLogo.js +0 -5
- package/dist/bundled/components/app/InitialLoading.js +0 -5
- package/dist/bundled/components/app/MobileOverlay.js +0 -5
- package/dist/bundled/components/base/BaseCheckbox.js +0 -5
- package/dist/bundled/components/base/BaseOverflowMenu.js +0 -5
- package/dist/bundled/components/base/BaseSelect.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentProps.js +0 -5
- package/dist/bundled/components/panel/PaneTabs.js +0 -5
- package/dist/bundled/components/panel/StatePresets.js +0 -5
- package/dist/bundled/components/panel/StoryControls.js +0 -5
- package/dist/bundled/components/panel/StoryDocs.js +0 -6
- package/dist/bundled/components/panel/StoryEvent.js +0 -5
- package/dist/bundled/components/panel/StoryEvents.js +0 -5
- package/dist/bundled/components/panel/StorySidePanel.js +0 -5
- package/dist/bundled/components/search/SearchLoading.js +0 -5
- package/dist/bundled/components/search/SearchModal.js +0 -5
- package/dist/bundled/components/search/SearchPane.js +0 -5
- package/dist/bundled/components/story/GenericMountStory.js +0 -5
- package/dist/bundled/components/story/GenericRenderStory.js +0 -5
- package/dist/bundled/components/story/StoryVariantGrid.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +0 -5
- package/dist/bundled/components/story/StoryVariantSingleView.js +0 -5
- package/dist/bundled/components/story/StoryView.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarNewTab.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTextDirection.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTitle.js +0 -5
- package/dist/bundled/components/tree/StoryGroup.js +0 -5
- package/dist/bundled/components/tree/StoryList.js +0 -5
- package/dist/bundled/components/tree/StoryListFolder.js +0 -7
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_2fedbe45_lang.js +0 -4
package/dist/bundled/style.css
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
.htw-base-empty[data-v-c5ecfead]:not(.no-animation) {
|
|
3
|
-
animation: htw-base-empty-c5ecfead .15s .2s both;
|
|
4
|
-
}
|
|
5
|
-
@keyframes htw-base-empty-c5ecfead {
|
|
6
|
-
0% {
|
|
7
|
-
opacity: 0;
|
|
8
|
-
}
|
|
9
|
-
100% {
|
|
10
|
-
opacity: 1;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
2
|
.landscape > div > .dragger[data-v-ed925107] {
|
|
15
3
|
width: .625rem;
|
|
16
4
|
}
|
|
@@ -40,12 +28,24 @@
|
|
|
40
28
|
color: var(--5792748b);
|
|
41
29
|
}
|
|
42
30
|
|
|
31
|
+
.htw-base-empty[data-v-c5ecfead]:not(.no-animation) {
|
|
32
|
+
animation: htw-base-empty-c5ecfead .15s .2s both;
|
|
33
|
+
}
|
|
34
|
+
@keyframes htw-base-empty-c5ecfead {
|
|
35
|
+
0% {
|
|
36
|
+
opacity: 0;
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
43
|
.bind-icon-color[data-v-6046525f] {
|
|
44
44
|
color: var(--663732b6);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.bind-tree-padding[data-v-
|
|
48
|
-
padding-left: var(--
|
|
47
|
+
.bind-tree-padding[data-v-e161f5e0] {
|
|
48
|
+
padding-left: var(--e605dd68);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.bind-tree-margin[data-v-19810958] {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
color: var(--ae892164);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.bind-icon-color[data-v-
|
|
59
|
-
color: var(--
|
|
58
|
+
.bind-icon-color[data-v-ab890d9c] {
|
|
59
|
+
color: var(--89126aaa);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.__histoire-code-placeholder[data-v-f528bb1b] {
|
|
@@ -64,8 +64,12 @@
|
|
|
64
64
|
font-size: inherit;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.bind-icon-color[data-v-
|
|
68
|
-
color: var(--
|
|
67
|
+
.bind-icon-color[data-v-ddfc5b4f] {
|
|
68
|
+
color: var(--4d25d048);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bind-icon-color[data-v-d95fcb03] {
|
|
72
|
+
color: var(--beebbd52);
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
.bind-icon-color[data-v-f7c98176] {
|
|
@@ -80,10 +84,6 @@
|
|
|
80
84
|
color: var(--35068428);
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
.bind-icon-color[data-v-d95fcb03] {
|
|
84
|
-
color: var(--beebbd52);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
87
|
.bind-preview-bg[data-v-a83b1911] {
|
|
88
88
|
background-color: var(--03d1950e);
|
|
89
89
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEventListener } from "@histoire/vendors/vue-use";
|
|
2
2
|
import { isRef } from "@histoire/vendors/vue";
|
|
3
3
|
import { isMac } from "./env.js";
|
|
4
|
+
"use strict";
|
|
4
5
|
function onKeyboardShortcut(shortcut, handler, options = {}) {
|
|
5
|
-
|
|
6
|
-
useEventListener((_a = options.event) != null ? _a : "keydown", (event) => {
|
|
6
|
+
useEventListener(options.event ?? "keydown", (event) => {
|
|
7
7
|
if (isMatchingShortcut(isRef(shortcut) ? shortcut.value : shortcut)) {
|
|
8
8
|
handler(event);
|
|
9
9
|
}
|
|
@@ -71,13 +71,13 @@ function formatKey(key) {
|
|
|
71
71
|
return isMac ? "^" : "Ctrl";
|
|
72
72
|
}
|
|
73
73
|
if (key === "alt") {
|
|
74
|
-
return isMac ? "
|
|
74
|
+
return isMac ? "⎇" : "Alt";
|
|
75
75
|
}
|
|
76
76
|
if (key === "shift") {
|
|
77
|
-
return "
|
|
77
|
+
return "⇧";
|
|
78
78
|
}
|
|
79
79
|
if (key === "meta") {
|
|
80
|
-
return "
|
|
80
|
+
return "⌘";
|
|
81
81
|
}
|
|
82
82
|
return key.charAt(0).toUpperCase() + key.substring(1).toLowerCase();
|
|
83
83
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { reactive } from "@histoire/vendors/vue";
|
|
2
2
|
import { histoireConfig } from "./config.js";
|
|
3
|
+
"use strict";
|
|
3
4
|
const receivedSettings = reactive({});
|
|
4
5
|
function applyPreviewSettings(settings) {
|
|
5
6
|
Object.assign(receivedSettings, settings);
|
|
@@ -11,8 +12,8 @@ function applyPreviewSettings(settings) {
|
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
function getContrastColor(setting) {
|
|
14
|
-
var _a
|
|
15
|
-
return (
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = histoireConfig.backgroundPresets.find((preset) => preset.color === setting.backgroundColor)) == null ? void 0 : _a.contrastColor) ?? "unset";
|
|
16
17
|
}
|
|
17
18
|
export {
|
|
18
19
|
applyPreviewSettings,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isRef, unref } from "@histoire/vendors/vue";
|
|
2
|
+
"use strict";
|
|
2
3
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
3
4
|
function toRawDeep(val, clean = false, seen = /* @__PURE__ */ new WeakMap()) {
|
|
4
5
|
const unwrappedValue = isRef(val) ? unref(val) : val;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isMac } from "./env.js";
|
|
2
2
|
import { formatKey } from "./keyboard.js";
|
|
3
|
+
"use strict";
|
|
3
4
|
function makeTooltip(descriptionHtml, keyboardShortcut) {
|
|
4
5
|
return {
|
|
5
6
|
content: `<div>${descriptionHtml}</div><div class="htw-flex htw-items-center htw-gap-1 htw-mt-2 htw-text-sm">${genKeyboardShortcutHtml(keyboardShortcut({ isMac }))}</div>`,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed } from "@histoire/vendors/vue";
|
|
2
2
|
import { useRoute } from "@histoire/vendors/vue-router";
|
|
3
|
+
"use strict";
|
|
3
4
|
function useCurrentVariantRoute(variant) {
|
|
4
5
|
const route = useRoute();
|
|
5
6
|
const isActive = computed(() => route.query.variantId === variant.value.id);
|
package/dist/style.css
CHANGED
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
grid-template-columns:repeat(auto-fill,minmax(var(--histoire-col-size),1fr))
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
.__histoire-json-code[data-v-
|
|
300
|
+
.__histoire-json-code[data-v-e5fbff29] .cm-editor{
|
|
301
301
|
height:100%;
|
|
302
302
|
min-width:280px
|
|
303
303
|
}
|
|
@@ -1196,6 +1196,11 @@ body {
|
|
|
1196
1196
|
margin-bottom:1rem
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
|
+
.htw-mx-6{
|
|
1200
|
+
margin-left:1.5rem;
|
|
1201
|
+
margin-right:1.5rem
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1199
1204
|
.htw-my-0{
|
|
1200
1205
|
margin-top:0px;
|
|
1201
1206
|
margin-bottom:0px
|
|
@@ -1238,14 +1243,18 @@ body {
|
|
|
1238
1243
|
margin-right:auto
|
|
1239
1244
|
}
|
|
1240
1245
|
|
|
1241
|
-
.htw-mr-2{
|
|
1242
|
-
margin-right:0.5rem
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
1246
|
.htw-mb-2{
|
|
1246
1247
|
margin-bottom:0.5rem
|
|
1247
1248
|
}
|
|
1248
1249
|
|
|
1250
|
+
.htw-ml-4{
|
|
1251
|
+
margin-left:1rem
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.htw-mr-2{
|
|
1255
|
+
margin-right:0.5rem
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1249
1258
|
.htw-box-border{
|
|
1250
1259
|
box-sizing:border-box
|
|
1251
1260
|
}
|
|
@@ -1863,6 +1872,10 @@ body {
|
|
|
1863
1872
|
border-color:rgb(0 0 0 / 0.2)
|
|
1864
1873
|
}
|
|
1865
1874
|
|
|
1875
|
+
.htw-border-gray-500\/40{
|
|
1876
|
+
border-color:rgb(var(--_histoire-color-gray-500) / 0.4)
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1866
1879
|
.htw-border-gray-850{
|
|
1867
1880
|
--tw-border-opacity:1;
|
|
1868
1881
|
border-color:rgb(var(--_histoire-color-gray-850) / var(--tw-border-opacity))
|
|
@@ -2387,6 +2400,10 @@ body {
|
|
|
2387
2400
|
background-color:rgb(var(--_histoire-color-gray-600) / 0.5)
|
|
2388
2401
|
}
|
|
2389
2402
|
|
|
2403
|
+
.htw-group:first-child .group-first\:htw-hidden{
|
|
2404
|
+
display:none
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2390
2407
|
.htw-group:nth-child(odd) .group-odd\:htw-bg-gray-100\/50{
|
|
2391
2408
|
background-color:rgb(var(--_histoire-color-gray-100) / 0.5)
|
|
2392
2409
|
}
|
|
@@ -2668,3 +2685,7 @@ body {
|
|
|
2668
2685
|
max-width:900px
|
|
2669
2686
|
}
|
|
2670
2687
|
}
|
|
2688
|
+
|
|
2689
|
+
.histoire-story-list-folder-button:hover .\[\.histoire-story-list-folder-button\:hover_\&\]\:htw-opacity-100{
|
|
2690
|
+
opacity:1
|
|
2691
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Pre-bundled UI for Histoire",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"types": "./src/index.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@histoire/controls": "^0.
|
|
28
|
-
"@histoire/shared": "^0.
|
|
29
|
-
"@histoire/vendors": "^0.
|
|
27
|
+
"@histoire/controls": "^0.12.1",
|
|
28
|
+
"@histoire/shared": "^0.12.1",
|
|
29
|
+
"@histoire/vendors": "^0.12.1",
|
|
30
30
|
"@types/flexsearch": "^0.7.3",
|
|
31
31
|
"flexsearch": "0.7.21",
|
|
32
32
|
"shiki-es": "^0.1.2"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@tailwindcss/typography": "^0.5.2",
|
|
36
36
|
"@types/fs-extra": "^9.0.13",
|
|
37
37
|
"@types/node": "^17.0.32",
|
|
38
|
-
"@vitejs/plugin-vue": "^
|
|
38
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
39
39
|
"autoprefixer": "^10.4.4",
|
|
40
40
|
"chokidar": "^3.5.3",
|
|
41
41
|
"concurrently": "^7.1.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"postcss-import": "^14.1.0",
|
|
47
47
|
"tailwindcss": "^3.0.23",
|
|
48
48
|
"typescript": "^4.7.4",
|
|
49
|
-
"vite": "^
|
|
49
|
+
"vite": "^4.0.0",
|
|
50
50
|
"vue": "^3.2.31"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PropType, Ref, ref, toRefs, watchEffect } from 'vue'
|
|
2
|
+
import { nextTick, PropType, Ref, ref, toRefs, watch, watchEffect } from 'vue'
|
|
3
3
|
import type { Story } from '../../types'
|
|
4
4
|
// @ts-expect-error virtual module
|
|
5
5
|
import { markdownFiles } from 'virtual:$histoire-markdown-files'
|
|
6
|
+
import { histoireConfig } from '../../util/config.js'
|
|
6
7
|
|
|
7
8
|
export function useStoryDoc (story: Ref<Story>) {
|
|
8
9
|
const renderedDoc = ref('')
|
|
@@ -47,7 +48,7 @@ export function useStoryDoc (story: Ref<Story>) {
|
|
|
47
48
|
|
|
48
49
|
<script lang="ts" setup>
|
|
49
50
|
import { Icon } from '@iconify/vue'
|
|
50
|
-
import { useRouter } from '
|
|
51
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
51
52
|
import BaseEmpty from '../base/BaseEmpty.vue'
|
|
52
53
|
|
|
53
54
|
const props = defineProps({
|
|
@@ -57,6 +58,10 @@ const props = defineProps({
|
|
|
57
58
|
},
|
|
58
59
|
})
|
|
59
60
|
|
|
61
|
+
const emit = defineEmits<{
|
|
62
|
+
(e: 'scroll-top'): void
|
|
63
|
+
}>()
|
|
64
|
+
|
|
60
65
|
const { story } = toRefs(props)
|
|
61
66
|
|
|
62
67
|
const { renderedDoc } = useStoryDoc(story)
|
|
@@ -85,6 +90,64 @@ function onClick (e: MouseEvent) {
|
|
|
85
90
|
router.push(targetHref)
|
|
86
91
|
}
|
|
87
92
|
}
|
|
93
|
+
|
|
94
|
+
// Handle URL anchor
|
|
95
|
+
|
|
96
|
+
function getHash () {
|
|
97
|
+
const hash = location.hash
|
|
98
|
+
if (histoireConfig.routerMode === 'hash') {
|
|
99
|
+
const index = hash.indexOf('#', 1)
|
|
100
|
+
if (index !== -1) {
|
|
101
|
+
return hash.slice(index)
|
|
102
|
+
} else {
|
|
103
|
+
return undefined
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return hash
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async function scrollToAnchor () {
|
|
110
|
+
await nextTick()
|
|
111
|
+
const hash = getHash()
|
|
112
|
+
if (hash) {
|
|
113
|
+
const anchor = document.querySelector(hash)
|
|
114
|
+
if (anchor) {
|
|
115
|
+
anchor.scrollIntoView()
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
emit('scroll-top')
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
watch(renderedDoc, () => {
|
|
123
|
+
scrollToAnchor()
|
|
124
|
+
}, {
|
|
125
|
+
immediate: true,
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
// Fix anchor links with router mode 'hash'
|
|
129
|
+
|
|
130
|
+
const renderedEl = ref<HTMLElement>()
|
|
131
|
+
const route = useRoute()
|
|
132
|
+
|
|
133
|
+
async function patchAnchorLinks () {
|
|
134
|
+
await nextTick()
|
|
135
|
+
if (histoireConfig.routerMode === 'hash' && renderedEl.value) {
|
|
136
|
+
const links = renderedEl.value.querySelectorAll('a.header-anchor')
|
|
137
|
+
for (const link of links) {
|
|
138
|
+
const href = link.getAttribute('href')
|
|
139
|
+
if (href) {
|
|
140
|
+
link.setAttribute('href', `#${route.path + href}`)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
watch(renderedDoc, () => {
|
|
147
|
+
patchAnchorLinks()
|
|
148
|
+
}, {
|
|
149
|
+
immediate: true,
|
|
150
|
+
})
|
|
88
151
|
</script>
|
|
89
152
|
|
|
90
153
|
<template>
|
|
@@ -103,6 +166,7 @@ function onClick (e: MouseEvent) {
|
|
|
103
166
|
</BaseEmpty>
|
|
104
167
|
<div
|
|
105
168
|
v-else
|
|
169
|
+
ref="renderedEl"
|
|
106
170
|
class="htw-prose dark:htw-prose-invert htw-p-4 htw-max-w-none"
|
|
107
171
|
data-test-id="story-docs"
|
|
108
172
|
v-html="renderedDoc"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { watch } from 'vue'
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
3
|
import { useRoute, useRouter } from 'vue-router'
|
|
4
4
|
import { Icon } from '@iconify/vue'
|
|
5
5
|
import { useStoryStore } from '../../stores/story'
|
|
@@ -50,6 +50,14 @@ function setVariant (variantId: string) {
|
|
|
50
50
|
},
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
// Docs auto-scroll to top
|
|
55
|
+
|
|
56
|
+
const docsOnlyScroller = ref<HTMLElement>(null)
|
|
57
|
+
|
|
58
|
+
function scrollDocsToTop () {
|
|
59
|
+
docsOnlyScroller.value?.scrollTo(0, 0)
|
|
60
|
+
}
|
|
53
61
|
</script>
|
|
54
62
|
|
|
55
63
|
<template>
|
|
@@ -69,11 +77,13 @@ function setVariant (variantId: string) {
|
|
|
69
77
|
>
|
|
70
78
|
<div
|
|
71
79
|
v-if="storyStore.currentStory.docsOnly"
|
|
80
|
+
ref="docsOnlyScroller"
|
|
72
81
|
class="htw-h-full htw-overflow-auto"
|
|
73
82
|
>
|
|
74
83
|
<StoryDocs
|
|
75
84
|
:story="storyStore.currentStory"
|
|
76
85
|
class="md:htw-p-12 htw-w-full md:htw-max-w-[600px] lg:htw-max-w-[800px] xl:htw-max-w-[900px]"
|
|
86
|
+
@scroll-top="scrollDocsToTop()"
|
|
77
87
|
/>
|
|
78
88
|
</div>
|
|
79
89
|
<template v-else-if="isMobile">
|
|
@@ -27,27 +27,25 @@ function toggleOpen () {
|
|
|
27
27
|
<template>
|
|
28
28
|
<div
|
|
29
29
|
data-test-id="story-group"
|
|
30
|
-
class="histoire-story-group htw-my-2 first:htw-mt-0 last:htw-mb-0"
|
|
30
|
+
class="histoire-story-group htw-my-2 first:htw-mt-0 last:htw-mb-0 htw-group"
|
|
31
31
|
>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<span class="htw-h-[1px] htw-flex-1 htw-bg-gray-500/10 htw-mx-2" />
|
|
50
|
-
</div>
|
|
32
|
+
<template v-if="group.title">
|
|
33
|
+
<div class="htw-h-[1px] htw-bg-gray-500/10 htw-mx-6 htw-mb-2 group-first:htw-hidden" />
|
|
34
|
+
<div
|
|
35
|
+
role="button"
|
|
36
|
+
tabindex="0"
|
|
37
|
+
class="htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex htw-items-center htw-gap-2 htw-min-w-0 htw-opacity-50 hover:htw-opacity-100"
|
|
38
|
+
@click="toggleOpen"
|
|
39
|
+
@keyup.enter="toggleOpen"
|
|
40
|
+
@keyup.space="toggleOpen"
|
|
41
|
+
>
|
|
42
|
+
<Icon
|
|
43
|
+
:icon="isFolderOpen ? 'carbon:subtract' : 'carbon:add'"
|
|
44
|
+
class="htw-w-4 htw-h-4 htw-ml-4 htw-rounded-sm htw-border htw-border-gray-500/40"
|
|
45
|
+
/>
|
|
46
|
+
<span class="htw-truncate">{{ group.title }}</span>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
51
49
|
|
|
52
50
|
<!-- Children -->
|
|
53
51
|
<div
|
|
@@ -37,24 +37,20 @@ const folderPadding = computed(() => {
|
|
|
37
37
|
<div
|
|
38
38
|
role="button"
|
|
39
39
|
tabindex="0"
|
|
40
|
-
class="htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex"
|
|
40
|
+
class="histoire-story-list-folder-button htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex"
|
|
41
41
|
@click="toggleOpen"
|
|
42
42
|
@keyup.enter="toggleOpen"
|
|
43
43
|
@keyup.space="toggleOpen"
|
|
44
44
|
>
|
|
45
45
|
<span class="bind-tree-padding htw-flex htw-items-center htw-gap-2 htw-min-w-0">
|
|
46
|
-
<span class="htw-flex htw-flex-none htw-items-center">
|
|
46
|
+
<span class="htw-flex htw-flex-none htw-items-center htw-opacity-30 [.histoire-story-list-folder-button:hover_&]:htw-opacity-100 htw-ml-4 htw-rounded-sm htw-border htw-border-gray-500/40">
|
|
47
47
|
<Icon
|
|
48
48
|
icon="carbon:caret-right"
|
|
49
|
-
class="htw-w-4 htw-h-4 htw-transition-transform htw-duration-150
|
|
49
|
+
class="htw-w-4 htw-h-4 htw-transition-transform htw-duration-150"
|
|
50
50
|
:class="{
|
|
51
51
|
'htw-rotate-90': isFolderOpen,
|
|
52
52
|
}"
|
|
53
53
|
/>
|
|
54
|
-
<Icon
|
|
55
|
-
icon="carbon:folder"
|
|
56
|
-
class="htw-w-5 htw-h-5 sm:htw-w-4 sm:htw-h-4"
|
|
57
|
-
/>
|
|
58
54
|
</span>
|
|
59
55
|
<span class="htw-truncate">{{ folder.title }}</span>
|
|
60
56
|
</span>
|
package/tsconfig.json
CHANGED
package/dist/bundled/App.js
DELETED