@histoire/app 0.17.15 → 0.17.17
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.vue2.js +1 -1
- package/dist/bundled/components/app/AppHeader.vue2.js +1 -1
- package/dist/bundled/components/app/AppLogo.vue2.js +1 -1
- package/dist/bundled/components/app/Breadcrumb.vue.js +1 -1
- package/dist/bundled/components/app/Breadcrumb.vue2.js +3 -3
- package/dist/bundled/components/app/HomeCounter.vue2.js +2 -7
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +1 -2
- package/dist/bundled/components/base/BaseIcon.vue.js +1 -1
- package/dist/bundled/components/base/BaseIcon.vue2.js +1 -1
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +4 -4
- package/dist/bundled/components/base/BaseSplitPane.vue.js +1 -1
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +2 -3
- package/dist/bundled/components/panel/PaneTabs.vue2.js +1 -1
- package/dist/bundled/components/panel/StoryDocs.vue2.js +4 -4
- package/dist/bundled/components/panel/StorySourceCode.vue.js +1 -1
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +1 -1
- package/dist/bundled/components/search/SearchItem.vue.js +1 -1
- package/dist/bundled/components/search/SearchItem.vue2.js +2 -2
- package/dist/bundled/components/search/SearchPane.vue2.js +2 -2
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +1 -1
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +8 -7
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +4 -4
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +1 -1
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +6 -7
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +1 -1
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +3 -3
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +1 -1
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +5 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +1 -1
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +1 -1
- package/dist/bundled/components/story/StoryView.vue2.js +1 -1
- package/dist/bundled/components/story/StoryViewer.vue.js +1 -1
- package/dist/bundled/components/story/StoryViewer.vue2.js +3 -3
- package/dist/bundled/components/tree/StoryGroup.vue2.js +2 -2
- package/dist/bundled/components/tree/StoryListFolder.vue.js +1 -1
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +4 -4
- package/dist/bundled/components/tree/StoryListItem.vue.js +1 -1
- package/dist/bundled/components/tree/StoryListItem.vue2.js +5 -5
- package/dist/bundled/sandbox.js +1 -1
- package/dist/bundled/style.css +36 -36
- package/dist/bundled/util/commands.js +1 -1
- package/dist/bundled/util/state.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/scripts/copy.mjs +1 -1
- package/scripts/watchAndCopy.mjs +4 -4
- package/src/app/App.vue +6 -6
- package/src/app/api.ts +1 -1
- package/src/app/components/HomeView.vue +4 -3
- package/src/app/components/app/AppHeader.vue +1 -1
- package/src/app/components/app/AppLogo.vue +3 -3
- package/src/app/components/app/Breadcrumb.vue +4 -4
- package/src/app/components/app/HomeCounter.vue +1 -10
- package/src/app/components/app/MobileOverlay.vue +1 -1
- package/src/app/components/base/BaseCheckbox.vue +2 -3
- package/src/app/components/base/BaseIcon.vue +2 -2
- package/src/app/components/base/BaseKeyboardShortcut.vue +1 -1
- package/src/app/components/base/BaseListItem.vue +2 -2
- package/src/app/components/base/BaseListItemLink.vue +3 -3
- package/src/app/components/base/BaseOverflowMenu.vue +4 -4
- package/src/app/components/base/BaseSelect.vue +5 -4
- package/src/app/components/base/BaseSplitPane.vue +19 -15
- package/src/app/components/command/CommandPrompts.vue +6 -5
- package/src/app/components/command/CommandPromptsModal.vue +2 -1
- package/src/app/components/command/PromptSelect.vue +6 -4
- package/src/app/components/command/PromptText.vue +4 -3
- package/src/app/components/panel/ControlsComponentPropItem.vue +1 -1
- package/src/app/components/panel/ControlsComponentProps.vue +1 -1
- package/src/app/components/panel/ControlsComponentState.vue +1 -1
- package/src/app/components/panel/PaneTabs.vue +1 -1
- package/src/app/components/panel/StatePresets.vue +13 -10
- package/src/app/components/panel/StoryControls.vue +2 -2
- package/src/app/components/panel/StoryDocs.vue +28 -24
- package/src/app/components/panel/StoryEvent.vue +2 -2
- package/src/app/components/panel/StoryEvents.vue +2 -2
- package/src/app/components/panel/StorySourceCode.vue +10 -6
- package/src/app/components/search/SearchItem.vue +4 -3
- package/src/app/components/search/SearchItemContent.vue +3 -3
- package/src/app/components/search/SearchModal.vue +2 -1
- package/src/app/components/search/SearchPane.vue +18 -18
- package/src/app/components/search/search-docs-data.ts +2 -2
- package/src/app/components/search/search-title-data.ts +2 -2
- package/src/app/components/story/GenericMountStory.vue +1 -1
- package/src/app/components/story/GenericRenderStory.vue +3 -2
- package/src/app/components/story/StoryResponsivePreview.vue +16 -14
- package/src/app/components/story/StoryVariantGrid.vue +9 -8
- package/src/app/components/story/StoryVariantGridItem.vue +7 -7
- package/src/app/components/story/StoryVariantListItem.vue +3 -2
- package/src/app/components/story/StoryVariantSingle.vue +3 -3
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +2 -2
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +10 -10
- package/src/app/components/story/StoryView.vue +4 -4
- package/src/app/components/story/StoryViewer.vue +2 -3
- package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
- package/src/app/components/tree/StoryGroup.vue +4 -4
- package/src/app/components/tree/StoryList.vue +1 -1
- package/src/app/components/tree/StoryListFolder.vue +4 -4
- package/src/app/components/tree/StoryListItem.vue +3 -3
- package/src/app/index.ts +2 -3
- package/src/app/plugin.ts +4 -3
- package/src/app/router.ts +2 -2
- package/src/app/sandbox.ts +12 -11
- package/src/app/stores/command.ts +4 -3
- package/src/app/stores/events.ts +4 -4
- package/src/app/stores/folder.ts +9 -7
- package/src/app/stores/story.ts +4 -4
- package/src/app/types.ts +2 -2
- package/src/app/util/commands.ts +5 -4
- package/src/app/util/dark.ts +2 -2
- package/src/app/util/docs.ts +6 -4
- package/src/app/util/events.ts +4 -3
- package/src/app/util/keyboard.ts +9 -8
- package/src/app/util/mapping.ts +8 -5
- package/src/app/util/open-in-editor.ts +1 -1
- package/src/app/util/preview-settings.ts +3 -3
- package/src/app/util/sandbox.ts +2 -3
- package/src/app/util/scroll.ts +5 -4
- package/src/app/util/select.ts +5 -4
- package/src/app/util/state.ts +6 -5
- package/src/app/util/tooltip.ts +2 -2
- package/src/app/util/variant.ts +3 -2
- package/src/shim.d.ts +0 -6
- package/src/virtual.d.ts +1 -0
- package/tailwind.config.cjs +19 -20
- package/tsconfig.json +26 -26
- package/vite.config.ts +7 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { pushScopeId, popScopeId, useCssVars, computed, resolveComponent, openBlock, withKeys, unref, normalizeClass, createVNode, createElementVNode, toDisplayString, Fragment, createBlock, createElementBlock, renderList, createCommentVNode, defineComponent } from "@histoire/vendors/vue";
|
|
2
|
-
import StoryListItem from "./StoryListItem.vue.js";
|
|
3
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
4
3
|
import { useFolderStore } from "../../stores/folder.js";
|
|
4
|
+
import StoryListItem from "./StoryListItem.vue.js";
|
|
5
5
|
"use strict";
|
|
6
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
6
|
+
const _withScopeId = (n) => (pushScopeId("data-v-cace6303"), n = n(), popScopeId(), n);
|
|
7
7
|
const _hoisted_1 = {
|
|
8
8
|
"data-test-id": "story-list-folder",
|
|
9
9
|
class: "histoire-story-list-folder"
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
},
|
|
24
24
|
setup(__props) {
|
|
25
25
|
useCssVars((_ctx) => ({
|
|
26
|
-
"
|
|
26
|
+
"1ee776cd": folderPadding.value
|
|
27
27
|
}));
|
|
28
28
|
const props = __props;
|
|
29
29
|
const folderStore = useFolderStore();
|
|
@@ -33,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
folderStore.toggleFolder(folderPath.value);
|
|
34
34
|
}
|
|
35
35
|
const folderPadding = computed(() => {
|
|
36
|
-
return props.depth * 12
|
|
36
|
+
return `${props.depth * 12}px`;
|
|
37
37
|
});
|
|
38
38
|
return (_ctx, _cache) => {
|
|
39
39
|
const _component_StoryListFolder = resolveComponent("StoryListFolder", true);
|
|
@@ -2,7 +2,7 @@ import _sfc_main from "./StoryListItem.vue2.js";
|
|
|
2
2
|
import "./StoryListItem.vue3.js";
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
"use strict";
|
|
5
|
-
const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c9b616b5"]]);
|
|
6
6
|
export {
|
|
7
7
|
StoryListItem as default
|
|
8
8
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { pushScopeId, popScopeId, useCssVars, computed, ref, openBlock, unref, normalizeClass, createVNode, toDisplayString, createElementVNode, createElementBlock, createCommentVNode, withCtx, defineComponent } from "@histoire/vendors/vue";
|
|
2
|
-
import BaseListItemLink from "../base/BaseListItemLink.vue.js";
|
|
3
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
4
3
|
import { useRoute } from "@histoire/vendors/vue-router";
|
|
4
|
+
import BaseListItemLink from "../base/BaseListItemLink.vue.js";
|
|
5
5
|
import { useScrollOnActive } from "../../util/scroll.js";
|
|
6
6
|
"use strict";
|
|
7
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
7
|
+
const _withScopeId = (n) => (pushScopeId("data-v-c9b616b5"), n = n(), popScopeId(), n);
|
|
8
8
|
const _hoisted_1 = { class: "bind-tree-margin htw-flex htw-items-center htw-gap-2 htw-pl-4 htw-min-w-0" };
|
|
9
9
|
const _hoisted_2 = { class: "htw-truncate" };
|
|
10
10
|
const _hoisted_3 = {
|
|
@@ -19,12 +19,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
},
|
|
20
20
|
setup(__props) {
|
|
21
21
|
useCssVars((_ctx) => ({
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"c4f9d186": filePadding.value,
|
|
23
|
+
"7270060e": _ctx.story.iconColor
|
|
24
24
|
}));
|
|
25
25
|
const props = __props;
|
|
26
26
|
const filePadding = computed(() => {
|
|
27
|
-
return props.depth * 12
|
|
27
|
+
return `${props.depth * 12}px`;
|
|
28
28
|
});
|
|
29
29
|
const route = useRoute();
|
|
30
30
|
const isActive = computed(() => route.params.storyId === props.story.id);
|
package/dist/bundled/sandbox.js
CHANGED
|
@@ -2,10 +2,10 @@ import { parseQuery } from "@histoire/vendors/vue-router";
|
|
|
2
2
|
import { ref, computed, watch, onMounted, h, createApp } from "@histoire/vendors/vue";
|
|
3
3
|
import { createPinia } from "@histoire/vendors/pinia";
|
|
4
4
|
import { applyState } from "@histoire/shared";
|
|
5
|
+
import { files } from "virtual:$histoire-stories";
|
|
5
6
|
import "./components/story/GenericMountStory.vue.js";
|
|
6
7
|
import "./components/story/GenericRenderStory.vue.js";
|
|
7
8
|
import { mapFile } from "./util/mapping.js";
|
|
8
|
-
import { files } from "virtual:$histoire-stories";
|
|
9
9
|
import { STATE_SYNC, PREVIEW_SETTINGS_SYNC, SANDBOX_READY } from "./util/const.js";
|
|
10
10
|
import { applyPreviewSettings } from "./util/preview-settings.js";
|
|
11
11
|
import { isDark } from "./util/dark.js";
|
package/dist/bundled/style.css
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
|
|
2
|
-
.landscape > div > .dragger[data-v-
|
|
2
|
+
.landscape > div > .dragger[data-v-4f40a1bb] {
|
|
3
3
|
width: .625rem;
|
|
4
4
|
}
|
|
5
|
-
.portrait > div > .dragger[data-v-
|
|
5
|
+
.portrait > div > .dragger[data-v-4f40a1bb] {
|
|
6
6
|
height: .625rem;
|
|
7
7
|
}
|
|
8
|
-
.landscape > div > .dragger.dragger-offset-before[data-v-
|
|
8
|
+
.landscape > div > .dragger.dragger-offset-before[data-v-4f40a1bb] {
|
|
9
9
|
right: 0;
|
|
10
10
|
}
|
|
11
|
-
.portrait > div > .dragger.dragger-offset-before[data-v-
|
|
11
|
+
.portrait > div > .dragger.dragger-offset-before[data-v-4f40a1bb] {
|
|
12
12
|
bottom: 0;
|
|
13
13
|
}
|
|
14
|
-
.landscape > div > .dragger.dragger-offset-center[data-v-
|
|
14
|
+
.landscape > div > .dragger.dragger-offset-center[data-v-4f40a1bb] {
|
|
15
15
|
right: -.3125rem;
|
|
16
16
|
}
|
|
17
|
-
.portrait > div > .dragger.dragger-offset-center[data-v-
|
|
17
|
+
.portrait > div > .dragger.dragger-offset-center[data-v-4f40a1bb] {
|
|
18
18
|
bottom: -.3125rem;
|
|
19
19
|
}
|
|
20
|
-
.landscape > div > .dragger.dragger-offset-after[data-v-
|
|
20
|
+
.landscape > div > .dragger.dragger-offset-after[data-v-4f40a1bb] {
|
|
21
21
|
right: -.625rem;
|
|
22
22
|
}
|
|
23
|
-
.portrait > div > .dragger.dragger-offset-after[data-v-
|
|
23
|
+
.portrait > div > .dragger.dragger-offset-after[data-v-4f40a1bb] {
|
|
24
24
|
bottom: -.625rem;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.bind-icon-color[data-v-
|
|
28
|
-
color: var(--
|
|
27
|
+
.bind-icon-color[data-v-b8625753] {
|
|
28
|
+
color: var(--6509026e);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.htw-base-empty[data-v-c5ecfead]:not(.no-animation) {
|
|
@@ -40,43 +40,36 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.bind-icon-color[data-v-
|
|
44
|
-
color: var(--
|
|
43
|
+
.bind-icon-color[data-v-a5a2e343] {
|
|
44
|
+
color: var(--597bf4c4);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.bind-tree-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
.bind-icon-color[data-v-19810958] {
|
|
51
|
-
color: var(--ae892164);
|
|
47
|
+
.bind-tree-padding[data-v-cace6303] {
|
|
48
|
+
padding-left: var(--1ee776cd);
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
.bind-tree-
|
|
55
|
-
|
|
51
|
+
.bind-tree-margin[data-v-c9b616b5] {
|
|
52
|
+
margin-left: var(--c4f9d186);
|
|
53
|
+
}
|
|
54
|
+
.bind-icon-color[data-v-c9b616b5] {
|
|
55
|
+
color: var(--7270060e);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.bind-icon-color[data-v-
|
|
59
|
-
color: var(--
|
|
58
|
+
.bind-icon-color[data-v-abf83c04] {
|
|
59
|
+
color: var(--02b8e3da);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.bind-icon-color[data-v-
|
|
63
|
-
color: var(--
|
|
62
|
+
.bind-icon-color[data-v-f8e09a03] {
|
|
63
|
+
color: var(--2762f67a);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.__histoire-code-placeholder[data-v-
|
|
66
|
+
.__histoire-code-placeholder[data-v-f7d2e46a] {
|
|
67
67
|
color: inherit;
|
|
68
68
|
font-size: inherit;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.bind-icon-color[data-v-
|
|
72
|
-
color: var(--
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.bind-icon-color[data-v-cf76cd68] {
|
|
76
|
-
color: var(--29d8c174);
|
|
77
|
-
}
|
|
78
|
-
.bind-preview-bg[data-v-cf76cd68] {
|
|
79
|
-
background-color: var(--0eff7465);
|
|
71
|
+
.bind-icon-color[data-v-d75a2748] {
|
|
72
|
+
color: var(--ddaae392);
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
.bind-preview-bg[data-v-c48fb2b2] {
|
|
@@ -84,12 +77,19 @@
|
|
|
84
77
|
color: var(--35068428);
|
|
85
78
|
}
|
|
86
79
|
|
|
87
|
-
|
|
80
|
+
.bind-icon-color[data-v-d3ab4dd6] {
|
|
81
|
+
color: var(--bd0f30ce);
|
|
82
|
+
}
|
|
83
|
+
.bind-preview-bg[data-v-d3ab4dd6] {
|
|
84
|
+
background-color: var(--8da98e9c);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
img.colorize-black[data-v-2114f510] {
|
|
88
88
|
filter: grayscale(100) brightness(0);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
.bind-preview-bg[data-v-
|
|
92
|
-
background-color: var(--
|
|
91
|
+
.bind-preview-bg[data-v-9bc3d486] {
|
|
92
|
+
background-color: var(--321f9a07);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.__histoire-hatched-pattern[data-v-91561117] {
|
|
@@ -28,14 +28,14 @@ function toRawDeep(val, clean = false, seen = /* @__PURE__ */ new WeakMap()) {
|
|
|
28
28
|
return result;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
function toRawObject(obj, target, clean = false, seen = /* @__PURE__ */ new WeakMap()) {
|
|
32
32
|
Object.keys(obj).forEach((key) => {
|
|
33
33
|
if (clean && typeof obj[key] === "function") {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
target[key] = toRawDeep(obj[key], clean, seen);
|
|
37
37
|
});
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
export {
|
|
40
40
|
toRawDeep
|
|
41
41
|
};
|
package/dist/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/app",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.17.17",
|
|
4
5
|
"description": "Pre-bundled UI for Histoire",
|
|
5
|
-
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Guillaume Chau"
|
|
8
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"repository": {
|
|
10
11
|
"url": "https://github.com/Akryum/histoire.git",
|
|
11
12
|
"type": "git",
|
|
@@ -14,7 +15,6 @@
|
|
|
14
15
|
"publishConfig": {
|
|
15
16
|
"access": "public"
|
|
16
17
|
},
|
|
17
|
-
"type": "module",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@types/flexsearch": "^0.7.6",
|
|
28
28
|
"flexsearch": "0.7.21",
|
|
29
29
|
"shiki-es": "^0.2.0",
|
|
30
|
-
"@histoire/controls": "^0.17.
|
|
31
|
-
"@histoire/shared": "^0.17.
|
|
32
|
-
"@histoire/vendors": "^0.17.
|
|
30
|
+
"@histoire/controls": "^0.17.17",
|
|
31
|
+
"@histoire/shared": "^0.17.17",
|
|
32
|
+
"@histoire/vendors": "^0.17.17"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@tailwindcss/typography": "^0.5.10",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"postcss": "^8.4.31",
|
|
46
46
|
"postcss-import": "^14.1.0",
|
|
47
47
|
"tailwindcss": "^3.3.5",
|
|
48
|
-
"typescript": "^4.
|
|
48
|
+
"typescript": "^5.4.4",
|
|
49
49
|
"vite": "^5.0.11",
|
|
50
50
|
"vue": "^3.3.8"
|
|
51
51
|
},
|
package/scripts/copy.mjs
CHANGED
package/scripts/watchAndCopy.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import chokidar from 'chokidar'
|
|
|
2
2
|
import fs from 'fs-extra'
|
|
3
3
|
import { normalizePath } from 'vite'
|
|
4
4
|
|
|
5
|
-
function toDist
|
|
5
|
+
function toDist(file) {
|
|
6
6
|
return normalizePath(file).replace(/^src\//, 'dist/')
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -10,6 +10,6 @@ function toDist (file) {
|
|
|
10
10
|
// they change.
|
|
11
11
|
chokidar
|
|
12
12
|
.watch('src/**/!(*.ts|*.vue|tsconfig.json)')
|
|
13
|
-
.on('change',
|
|
14
|
-
.on('add',
|
|
15
|
-
.on('unlink',
|
|
13
|
+
.on('change', file => fs.copy(file, toDist(file)))
|
|
14
|
+
.on('add', file => fs.copy(file, toDist(file)))
|
|
15
|
+
.on('unlink', file => fs.remove(toDist(file)))
|
package/src/app/App.vue
CHANGED
|
@@ -5,15 +5,15 @@ export default {
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
-
import { files as rawFiles, tree as rawTree
|
|
8
|
+
import { onUpdate, files as rawFiles, tree as rawTree } from 'virtual:$histoire-stories'
|
|
9
|
+
import { computed, onMounted, ref, watch } from 'vue'
|
|
10
|
+
import { useTitle } from '@vueuse/core'
|
|
9
11
|
import StoryList from './components/tree/StoryList.vue'
|
|
10
12
|
import BaseSplitPane from './components/base/BaseSplitPane.vue'
|
|
11
|
-
import { computed, onMounted, ref, watch } from 'vue'
|
|
12
13
|
import AppHeader from './components/app/AppHeader.vue'
|
|
13
14
|
import type { StoryFile, Tree } from './types'
|
|
14
15
|
import { useStoryStore } from './stores/story'
|
|
15
16
|
import { mapFile } from './util/mapping'
|
|
16
|
-
import { useTitle } from '@vueuse/core'
|
|
17
17
|
import { histoireConfig } from './util/config'
|
|
18
18
|
import { onKeyboardShortcut } from './util/keyboard'
|
|
19
19
|
import { isMobile } from './util/responsive'
|
|
@@ -29,7 +29,7 @@ const tree = ref<Tree>(rawTree)
|
|
|
29
29
|
|
|
30
30
|
onUpdate((newFiles: StoryFile[], newTree: Tree) => {
|
|
31
31
|
loading.value = false
|
|
32
|
-
files.value = newFiles.map(file => {
|
|
32
|
+
files.value = newFiles.map((file) => {
|
|
33
33
|
const existingFile = files.value.find(f => f.id === file.id)
|
|
34
34
|
return mapFile(file, existingFile)
|
|
35
35
|
})
|
|
@@ -44,7 +44,7 @@ const stories = computed(() => files.value.reduce((acc, file) => {
|
|
|
44
44
|
// Store
|
|
45
45
|
|
|
46
46
|
const storyStore = useStoryStore()
|
|
47
|
-
watch(stories, value => {
|
|
47
|
+
watch(stories, (value) => {
|
|
48
48
|
storyStore.setStories(value)
|
|
49
49
|
}, {
|
|
50
50
|
immediate: true,
|
|
@@ -66,7 +66,7 @@ useTitle(computed(() => {
|
|
|
66
66
|
const loadSearch = ref(false)
|
|
67
67
|
const isSearchOpen = ref(false)
|
|
68
68
|
|
|
69
|
-
watch(isSearchOpen, value => {
|
|
69
|
+
watch(isSearchOpen, (value) => {
|
|
70
70
|
if (value) {
|
|
71
71
|
loadSearch.value = true
|
|
72
72
|
}
|
package/src/app/api.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import { customLogos, histoireConfig } from '../util/config'
|
|
4
4
|
import HistoireLogo from '../assets/histoire.svg'
|
|
5
5
|
import { useStoryStore } from '../stores/story'
|
|
6
6
|
import HomeCounter from './app/HomeCounter.vue'
|
|
@@ -13,10 +13,11 @@ const stats = computed(() => {
|
|
|
13
13
|
let variantCount = 0
|
|
14
14
|
let docsCount = 0;
|
|
15
15
|
|
|
16
|
-
(storyStore.stories || []).forEach(story => {
|
|
16
|
+
(storyStore.stories || []).forEach((story) => {
|
|
17
17
|
if (story.docsOnly) {
|
|
18
18
|
docsCount++
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
20
21
|
storyCount++
|
|
21
22
|
if (story.variants) {
|
|
22
23
|
variantCount += story.variants.length
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Icon } from '@iconify/vue'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
|
-
import AppLogo from './AppLogo.vue'
|
|
5
4
|
import { isDark, toggleDark } from '../../util/dark'
|
|
6
5
|
import { onKeyboardShortcut } from '../../util/keyboard'
|
|
7
6
|
import { makeTooltip } from '../../util/tooltip'
|
|
8
7
|
import { histoireConfig } from '../../util/config'
|
|
8
|
+
import AppLogo from './AppLogo.vue'
|
|
9
9
|
|
|
10
10
|
defineEmits({
|
|
11
11
|
search: () => true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { isDark } from '../../util/dark'
|
|
3
2
|
import { computed } from 'vue'
|
|
4
|
-
import {
|
|
3
|
+
import { isDark } from '../../util/dark'
|
|
4
|
+
import { customLogos, histoireConfig } from '../../util/config'
|
|
5
5
|
|
|
6
6
|
import HistoireLogoDark from '../../assets/histoire-text-dark.svg'
|
|
7
7
|
import HistoireLogoLight from '../../assets/histoire-text.svg'
|
|
@@ -13,7 +13,7 @@ const logoUrl = computed(() => {
|
|
|
13
13
|
return histoireConfig.theme.logo?.light ? customLogos.light : HistoireLogoLight
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
const altText = computed(() => histoireConfig.theme.title
|
|
16
|
+
const altText = computed(() => `${histoireConfig.theme.title} logo`)
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<template>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { computed, ref, watch } from 'vue'
|
|
3
3
|
import { Icon } from '@iconify/vue'
|
|
4
4
|
import { useStoryStore } from '../../stores/story'
|
|
5
|
-
import { Story, Tree } from '../../types'
|
|
6
|
-
import MobileOverlay from './MobileOverlay.vue'
|
|
5
|
+
import type { Story, Tree } from '../../types'
|
|
7
6
|
import StoryList from '../tree/StoryList.vue'
|
|
7
|
+
import MobileOverlay from './MobileOverlay.vue'
|
|
8
8
|
|
|
9
9
|
defineProps<{
|
|
10
10
|
tree: Tree
|
|
@@ -21,11 +21,11 @@ const folders = computed(() => {
|
|
|
21
21
|
|
|
22
22
|
const isMenuOpened = ref(false)
|
|
23
23
|
|
|
24
|
-
function openMenu
|
|
24
|
+
function openMenu() {
|
|
25
25
|
isMenuOpened.value = true
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function closeMenu
|
|
28
|
+
function closeMenu() {
|
|
29
29
|
isMenuOpened.value = false
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, toRefs } from 'vue'
|
|
3
|
-
import { useTransition, syncRefs } from '@vueuse/core'
|
|
4
2
|
import { Icon } from '@iconify/vue'
|
|
5
3
|
|
|
6
4
|
const props = defineProps({
|
|
@@ -17,13 +15,6 @@ const props = defineProps({
|
|
|
17
15
|
default: 0,
|
|
18
16
|
},
|
|
19
17
|
})
|
|
20
|
-
|
|
21
|
-
const { count } = toRefs(props)
|
|
22
|
-
const delayedCount = ref(0)
|
|
23
|
-
|
|
24
|
-
const animatedCount = useTransition(delayedCount, { delay: 100, duration: 700 })
|
|
25
|
-
|
|
26
|
-
syncRefs(count, delayedCount)
|
|
27
18
|
</script>
|
|
28
19
|
|
|
29
20
|
<template>
|
|
@@ -36,7 +27,7 @@ syncRefs(count, delayedCount)
|
|
|
36
27
|
<span
|
|
37
28
|
class="htw-text-primary-500 htw-min-w-[80px] htw-font-bold"
|
|
38
29
|
>
|
|
39
|
-
{{
|
|
30
|
+
{{ count }}
|
|
40
31
|
</span>
|
|
41
32
|
<span
|
|
42
33
|
class="htw-text-sm htw-text-gray-900 dark:htw-text-gray-100"
|
|
@@ -9,11 +9,10 @@ const props = defineProps({
|
|
|
9
9
|
})
|
|
10
10
|
|
|
11
11
|
const emit = defineEmits({
|
|
12
|
-
|
|
13
|
-
'update:modelValue': (newValue: boolean) => true,
|
|
12
|
+
'update:modelValue': (_newValue: boolean) => true,
|
|
14
13
|
})
|
|
15
14
|
|
|
16
|
-
function toggle
|
|
15
|
+
function toggle() {
|
|
17
16
|
emit('update:modelValue', !props.modelValue)
|
|
18
17
|
animationEnabled.value = true
|
|
19
18
|
}
|
|
@@ -6,8 +6,8 @@ const props = defineProps<{
|
|
|
6
6
|
icon: string
|
|
7
7
|
}>()
|
|
8
8
|
|
|
9
|
-
const isUrl = computed(() => props.icon.startsWith('http') || props.icon.startsWith('data:image')
|
|
10
|
-
props.icon.startsWith('.') || props.icon.startsWith('/'))
|
|
9
|
+
const isUrl = computed(() => props.icon.startsWith('http') || props.icon.startsWith('data:image')
|
|
10
|
+
|| props.icon.startsWith('.') || props.icon.startsWith('/'))
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<template>
|
|
@@ -7,7 +7,7 @@ const emit = defineEmits<{
|
|
|
7
7
|
(e: 'navigate'): void
|
|
8
8
|
}>()
|
|
9
9
|
|
|
10
|
-
function handleNavigate
|
|
10
|
+
function handleNavigate() {
|
|
11
11
|
emit('navigate')
|
|
12
12
|
}
|
|
13
13
|
</script>
|
|
@@ -19,7 +19,7 @@ function handleNavigate () {
|
|
|
19
19
|
$attrs.class,
|
|
20
20
|
isActive
|
|
21
21
|
? 'active htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black'
|
|
22
|
-
: 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900'
|
|
22
|
+
: 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900',
|
|
23
23
|
]"
|
|
24
24
|
@click="handleNavigate()"
|
|
25
25
|
@keyup.enter="handleNavigate()"
|
|
@@ -15,8 +15,8 @@ export default defineComponent({
|
|
|
15
15
|
navigate: () => true,
|
|
16
16
|
},
|
|
17
17
|
|
|
18
|
-
setup
|
|
19
|
-
function handleNavigate
|
|
18
|
+
setup(props, { emit }) {
|
|
19
|
+
function handleNavigate(event, navigate: (event) => unknown) {
|
|
20
20
|
emit('navigate')
|
|
21
21
|
navigate(event)
|
|
22
22
|
}
|
|
@@ -42,7 +42,7 @@ export default defineComponent({
|
|
|
42
42
|
$attrs.class,
|
|
43
43
|
(isActive != null ? isActive : linkIsActive)
|
|
44
44
|
? 'active htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black'
|
|
45
|
-
: 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900'
|
|
45
|
+
: 'hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900',
|
|
46
46
|
]"
|
|
47
47
|
@click="handleNavigate($event, navigate)"
|
|
48
48
|
@keyup.enter="handleNavigate($event, navigate)"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { computed, h, onBeforeUnmount, reactive, ref } from 'vue'
|
|
3
3
|
import { useResizeObserver } from '@vueuse/core'
|
|
4
4
|
import { Icon } from '@iconify/vue'
|
|
5
5
|
|
|
@@ -43,7 +43,7 @@ const visibleChildrenCount = computed(() => {
|
|
|
43
43
|
const ChildWrapper = {
|
|
44
44
|
name: 'ChildWrapper',
|
|
45
45
|
props: ['index'],
|
|
46
|
-
setup
|
|
46
|
+
setup(props, { slots }) {
|
|
47
47
|
const el = ref<HTMLDivElement>()
|
|
48
48
|
|
|
49
49
|
const state = reactive({ width: 0, index: props.index })
|
|
@@ -69,7 +69,7 @@ const ChildWrapper = {
|
|
|
69
69
|
/**
|
|
70
70
|
* Wraps each child with a <ChildWrapper>
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
function ChildrenRender(props, { slots }) {
|
|
73
73
|
const [fragment] = slots.default()
|
|
74
74
|
return fragment.children.map((vnode, index) => h(ChildWrapper, { index }, () => [vnode]))
|
|
75
75
|
}
|
|
@@ -77,7 +77,7 @@ const ChildrenRender = (props, { slots }) => {
|
|
|
77
77
|
/**
|
|
78
78
|
* Only renders a part of a children list
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
function ChildrenSlice(props, { slots }) {
|
|
81
81
|
const [fragment] = slots.default()
|
|
82
82
|
return fragment.children.slice(props.start, props.end)
|
|
83
83
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { Dropdown as VDropdown } from 'floating-vue'
|
|
3
|
-
import {
|
|
3
|
+
import type { ComputedRef } from 'vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
4
5
|
import { Icon } from '@iconify/vue'
|
|
5
6
|
|
|
6
7
|
const props = defineProps<{
|
|
@@ -15,14 +16,14 @@ const emit = defineEmits<{
|
|
|
15
16
|
|
|
16
17
|
const formattedOptions: ComputedRef<Record<string, string>> = computed(() => {
|
|
17
18
|
if (Array.isArray(props.options)) {
|
|
18
|
-
return Object.fromEntries(props.options.map(
|
|
19
|
+
return Object.fromEntries(props.options.map(value => [value, value]))
|
|
19
20
|
}
|
|
20
21
|
return props.options
|
|
21
22
|
})
|
|
22
23
|
|
|
23
24
|
const selectedLabel = computed(() => formattedOptions.value[props.modelValue])
|
|
24
25
|
|
|
25
|
-
function selectValue
|
|
26
|
+
function selectValue(value: string, hide: () => void) {
|
|
26
27
|
emit('update:modelValue', value)
|
|
27
28
|
emit('select', value)
|
|
28
29
|
hide()
|
|
@@ -51,7 +52,7 @@ function selectValue (value: string, hide: () => void) {
|
|
|
51
52
|
<template #popper="{ hide }">
|
|
52
53
|
<div class="htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700">
|
|
53
54
|
<div
|
|
54
|
-
v-for="(
|
|
55
|
+
v-for="(label, value) in formattedOptions"
|
|
55
56
|
v-bind="{ ...$attrs, class: null, style: null }"
|
|
56
57
|
:key="label"
|
|
57
58
|
class="htw-px-2 htw-py-1 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700"
|