@histoire/app 0.9.6 → 0.10.2
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/sandbox.css +1 -1
- package/dist/bundled/components/panel/StoryDocs.js +7 -0
- package/dist/bundled/components/panel/StorySourceCode.js +16 -8
- package/dist/bundled/components/search/SearchPane.js +12 -6
- package/dist/bundled/components/story/StoryVariantGridItem.js +4 -3
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +3 -1
- package/dist/bundled/style.css +11 -11
- package/package.json +4 -4
- package/src/app/components/panel/StoryDocs.vue +12 -0
- package/src/app/components/panel/StorySourceCode.vue +9 -6
- package/src/app/components/search/SearchPane.vue +14 -4
- package/src/app/components/story/StoryVariantGridItem.vue +1 -0
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +2 -0
- package/src/app/style/sandbox.css +1 -1
- package/src/app/types.ts +3 -0
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { createTextVNode, ref, watchEffect, defineComponent, toRefs, openBlock, createElementBlock, unref, createBlock, withCtx, createVNode } from "@histoire/vendors/vue";
|
|
2
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
3
3
|
import BaseEmpty from "../base/BaseEmpty.js";
|
|
4
|
+
import { markdownFiles } from "virtual:$histoire-markdown-files";
|
|
4
5
|
const _hoisted_1 = /* @__PURE__ */ createTextVNode(" No documentation available ");
|
|
5
6
|
const _hoisted_2 = ["innerHTML"];
|
|
6
7
|
function useStoryDoc(story) {
|
|
7
8
|
const renderedDoc = ref("");
|
|
8
9
|
watchEffect(async () => {
|
|
9
10
|
var _a;
|
|
11
|
+
const mdKey = story.value.file.filePath.replace(/\.(\w*?)$/, ".md");
|
|
12
|
+
if (markdownFiles[mdKey]) {
|
|
13
|
+
const md = await markdownFiles[mdKey]();
|
|
14
|
+
renderedDoc.value = md.html;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
10
17
|
let comp = (_a = story.value.file) == null ? void 0 : _a.component;
|
|
11
18
|
if (comp) {
|
|
12
19
|
if (comp.__asyncResolved) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, createElementVNode, defineComponent, ref, watchEffect, markRaw, shallowRef, onMounted, watch, computed, openBlock, createElementBlock, createVNode, unref, createCommentVNode, toDisplayString } from "@histoire/vendors/vue";
|
|
1
|
+
import { pushScopeId, popScopeId, createElementVNode, defineComponent, ref, watchEffect, markRaw, shallowRef, onMounted, watch, computed, openBlock, createElementBlock, createVNode, unref, createCommentVNode, toDisplayString, createBlock, withCtx } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
2
3
|
import { setCDN, getHighlighter } from "shiki";
|
|
3
4
|
import { HstCopyIcon } from "@histoire/controls";
|
|
4
5
|
import { unindent } from "@histoire/shared";
|
|
5
6
|
import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
6
7
|
import { isDark } from "../../util/dark.js";
|
|
8
|
+
import BaseEmpty from "../base/BaseEmpty.js";
|
|
7
9
|
import "./StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
8
10
|
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
11
|
+
const _withScopeId = (n) => (pushScopeId("data-v-68151bff"), n = n(), popScopeId(), n);
|
|
10
12
|
const _hoisted_1 = { class: "htw-bg-gray-100 dark:htw-bg-gray-800 htw-h-full htw-overflow-hidden htw-flex htw-flex-col" };
|
|
11
13
|
const _hoisted_2 = {
|
|
12
14
|
key: 0,
|
|
@@ -18,10 +20,7 @@ const _hoisted_5 = {
|
|
|
18
20
|
key: 1,
|
|
19
21
|
class: "htw-text-red-500 htw-h-full htw-p-2 htw-overflow-auto htw-font-mono htw-text-sm"
|
|
20
22
|
};
|
|
21
|
-
const _hoisted_6 =
|
|
22
|
-
key: 2,
|
|
23
|
-
class: "htw-opacity-50 htw-p-4"
|
|
24
|
-
};
|
|
23
|
+
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, "Not available", -1));
|
|
25
24
|
const _hoisted_7 = ["value"];
|
|
26
25
|
const _hoisted_8 = {
|
|
27
26
|
key: 4,
|
|
@@ -103,7 +102,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
102
|
class: "htw-flex-none"
|
|
104
103
|
}, null, 8, ["content"])
|
|
105
104
|
])) : createCommentVNode("", true),
|
|
106
|
-
error.value ? (openBlock(), createElementBlock("div", _hoisted_5, " Error: " + toDisplayString(error.value), 1)) : !sourceCode.value ? (openBlock(),
|
|
105
|
+
error.value ? (openBlock(), createElementBlock("div", _hoisted_5, " Error: " + toDisplayString(error.value), 1)) : !sourceCode.value ? (openBlock(), createBlock(BaseEmpty, { key: 2 }, {
|
|
106
|
+
default: withCtx(() => [
|
|
107
|
+
createVNode(unref(Icon), {
|
|
108
|
+
icon: "carbon:code-hide",
|
|
109
|
+
class: "htw-w-8 htw-h-8 htw-opacity-50 htw-mb-6"
|
|
110
|
+
}),
|
|
111
|
+
_hoisted_6
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
})) : !unref(sourceHtml) ? (openBlock(), createElementBlock("textarea", {
|
|
107
115
|
key: 3,
|
|
108
116
|
class: "__histoire-code-placeholder htw-w-full htw-h-full htw-p-4 htw-outline-none htw-bg-transparent htw-resize-none htw-m-0",
|
|
109
117
|
value: sourceCode.value,
|
|
@@ -119,5 +127,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
119
127
|
};
|
|
120
128
|
}
|
|
121
129
|
});
|
|
122
|
-
var StorySourceCode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
130
|
+
var StorySourceCode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-68151bff"]]);
|
|
123
131
|
export { StorySourceCode as default };
|
|
@@ -135,7 +135,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
135
135
|
continue;
|
|
136
136
|
switch (idMapData.kind) {
|
|
137
137
|
case "story": {
|
|
138
|
-
list.push(storyResultFactory(storyStore.getStoryById(idMapData.id), rank));
|
|
138
|
+
list.push(storyResultFactory(storyStore.getStoryById(idMapData.id), rank, "docs"));
|
|
139
139
|
rank++;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
@@ -146,7 +146,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
watch(rateLimitedSearch, searchOnDocField);
|
|
149
|
-
function storyResultFactory(story, rank) {
|
|
149
|
+
function storyResultFactory(story, rank, type = "title") {
|
|
150
150
|
return {
|
|
151
151
|
kind: "story",
|
|
152
152
|
rank,
|
|
@@ -156,14 +156,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
156
156
|
name: "story",
|
|
157
157
|
params: {
|
|
158
158
|
storyId: story.id
|
|
159
|
+
},
|
|
160
|
+
query: {
|
|
161
|
+
...type === "docs" ? { tab: "docs" } : {}
|
|
159
162
|
}
|
|
160
163
|
},
|
|
161
164
|
path: story.file.path.slice(0, -1),
|
|
162
165
|
icon: story.icon,
|
|
163
|
-
iconColor: story.iconColor
|
|
166
|
+
iconColor: story.iconColor,
|
|
167
|
+
type
|
|
164
168
|
};
|
|
165
169
|
}
|
|
166
|
-
function variantResultFactory(story, variant, rank) {
|
|
170
|
+
function variantResultFactory(story, variant, rank, type = "title") {
|
|
167
171
|
var _a;
|
|
168
172
|
return {
|
|
169
173
|
kind: "variant",
|
|
@@ -176,12 +180,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
176
180
|
storyId: story.id
|
|
177
181
|
},
|
|
178
182
|
query: {
|
|
179
|
-
variantId: variant.id
|
|
183
|
+
variantId: variant.id,
|
|
184
|
+
...type === "docs" ? { tab: "docs" } : {}
|
|
180
185
|
}
|
|
181
186
|
},
|
|
182
187
|
path: [...(_a = story.file.path) != null ? _a : [], story.title],
|
|
183
188
|
icon: variant.icon,
|
|
184
|
-
iconColor: variant.iconColor
|
|
189
|
+
iconColor: variant.iconColor,
|
|
190
|
+
type
|
|
185
191
|
};
|
|
186
192
|
}
|
|
187
193
|
const results = computed(() => {
|
|
@@ -7,7 +7,7 @@ import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
|
7
7
|
import { useScrollOnActive } from "../../util/scroll.js";
|
|
8
8
|
import "./StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
9
9
|
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
10
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
10
|
+
const _withScopeId = (n) => (pushScopeId("data-v-2db4d3d2"), n = n(), popScopeId(), n);
|
|
11
11
|
const _hoisted_1 = { class: "htw-flex-none htw-flex htw-items-center" };
|
|
12
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "StoryVariantGridItem",
|
|
@@ -27,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
setup(__props, { emit }) {
|
|
28
28
|
const props = __props;
|
|
29
29
|
useCssVars((_ctx) => ({
|
|
30
|
-
"
|
|
30
|
+
"1eec3e4a": unref(variant).iconColor
|
|
31
31
|
}));
|
|
32
32
|
const { variant } = toRefs(props);
|
|
33
33
|
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
@@ -89,6 +89,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
89
|
"htw-border-gray-100 dark:htw-border-gray-800": !unref(isActive),
|
|
90
90
|
"htw-border-primary-200 dark:htw-border-primary-900": unref(isActive)
|
|
91
91
|
}]),
|
|
92
|
+
"data-test-id": "sandbox-render",
|
|
92
93
|
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"])),
|
|
93
94
|
onKeyup: _cache[1] || (_cache[1] = ($event) => selectVariant())
|
|
94
95
|
}, [
|
|
@@ -103,5 +104,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
|
-
var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
107
|
+
var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2db4d3d2"]]);
|
|
107
108
|
export { StoryVariantGridItem as default };
|
|
@@ -24,7 +24,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
style: normalizeStyle(isResponsiveEnabled ? {
|
|
25
25
|
width: finalWidth ? `${finalWidth}px` : "100%",
|
|
26
26
|
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
27
|
-
} : { width: "100%", height: "100%" })
|
|
27
|
+
} : { width: "100%", height: "100%" }),
|
|
28
|
+
class: "htw-relative",
|
|
29
|
+
"data-test-id": "sandbox-render"
|
|
28
30
|
}, [
|
|
29
31
|
(openBlock(), createBlock(_sfc_main$1, {
|
|
30
32
|
key: `${__props.story.id}-${__props.variant.id}`,
|
package/dist/bundled/style.css
CHANGED
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.bind-tree-padding[data-v-8eb31f6a] {
|
|
53
|
+
padding-left: var(--7b519d4f);
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
.bind-tree-margin[data-v-d0757d50] {
|
|
53
57
|
margin-left: var(--9d1e9326);
|
|
54
58
|
}
|
|
@@ -56,10 +60,6 @@
|
|
|
56
60
|
color: var(--411af7ae);
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
.bind-tree-padding[data-v-8eb31f6a] {
|
|
60
|
-
padding-left: var(--7b519d4f);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
63
|
.bind-icon-color[data-v-b9d4a640] {
|
|
64
64
|
color: var(--10f93ca4);
|
|
65
65
|
}
|
|
@@ -68,11 +68,6 @@
|
|
|
68
68
|
color: var(--7333f29c);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.__histoire-code-placeholder[data-v-ed3a82aa] {
|
|
72
|
-
color: inherit;
|
|
73
|
-
font-size: inherit;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
71
|
.bind-icon-color[data-v-7f8cccbc] {
|
|
77
72
|
color: var(--cebc8760);
|
|
78
73
|
}
|
|
@@ -81,8 +76,13 @@
|
|
|
81
76
|
color: var(--0589c2c6);
|
|
82
77
|
}
|
|
83
78
|
|
|
84
|
-
.
|
|
85
|
-
color:
|
|
79
|
+
.__histoire-code-placeholder[data-v-68151bff] {
|
|
80
|
+
color: inherit;
|
|
81
|
+
font-size: inherit;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.bind-icon-color[data-v-2db4d3d2] {
|
|
85
|
+
color: var(--1eec3e4a);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.bind-preview-bg[data-v-bc4883a4] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.2",
|
|
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.10.2",
|
|
28
|
+
"@histoire/shared": "^0.10.2",
|
|
29
|
+
"@histoire/vendors": "^0.10.2",
|
|
30
30
|
"@types/flexsearch": "^0.7.3",
|
|
31
31
|
"flexsearch": "^0.7.21",
|
|
32
32
|
"shiki": "0.10.1"
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { PropType, Ref, ref, toRefs, watchEffect } from 'vue'
|
|
3
3
|
import type { Story } from '../../types'
|
|
4
|
+
// @ts-expect-error virtual module
|
|
5
|
+
import { markdownFiles } from 'virtual:$histoire-markdown-files'
|
|
4
6
|
|
|
5
7
|
export function useStoryDoc (story: Ref<Story>) {
|
|
6
8
|
const renderedDoc = ref('')
|
|
7
9
|
|
|
8
10
|
watchEffect(async () => {
|
|
11
|
+
// Markdown file
|
|
12
|
+
const mdKey = story.value.file.filePath.replace(/\.(\w*?)$/, '.md')
|
|
13
|
+
if (markdownFiles[mdKey]) {
|
|
14
|
+
const md = await markdownFiles[mdKey]()
|
|
15
|
+
renderedDoc.value = md.html
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Custom blocks (Vue 3)
|
|
20
|
+
// @TODO extract
|
|
9
21
|
let comp = story.value.file?.component
|
|
10
22
|
if (comp) {
|
|
11
23
|
if (comp.__asyncResolved) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, markRaw, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'
|
|
3
|
+
import { Icon } from '@iconify/vue'
|
|
3
4
|
import { getHighlighter, Highlighter, setCDN } from 'shiki'
|
|
4
5
|
import { HstCopyIcon } from '@histoire/controls'
|
|
5
6
|
import { unindent } from '@histoire/shared'
|
|
@@ -7,6 +8,7 @@ import { unindent } from '@histoire/shared'
|
|
|
7
8
|
import { clientSupportPlugins } from 'virtual:$histoire-support-plugins-client'
|
|
8
9
|
import type { Variant, Story } from '../../types'
|
|
9
10
|
import { isDark } from '../../util/dark'
|
|
11
|
+
import BaseEmpty from '../base/BaseEmpty.vue'
|
|
10
12
|
|
|
11
13
|
const props = defineProps<{
|
|
12
14
|
story: Story
|
|
@@ -98,12 +100,13 @@ const sourceHtml = computed(() => sourceCode.value
|
|
|
98
100
|
Error: {{ error }}
|
|
99
101
|
</div>
|
|
100
102
|
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
<BaseEmpty v-else-if="!sourceCode">
|
|
104
|
+
<Icon
|
|
105
|
+
icon="carbon:code-hide"
|
|
106
|
+
class="htw-w-8 htw-h-8 htw-opacity-50 htw-mb-6"
|
|
107
|
+
/>
|
|
108
|
+
<span>Not available</span>
|
|
109
|
+
</BaseEmpty>
|
|
107
110
|
|
|
108
111
|
<textarea
|
|
109
112
|
v-else-if="!sourceHtml"
|
|
@@ -7,7 +7,7 @@ import charset from 'flexsearch/dist/module/lang/latin/advanced.js'
|
|
|
7
7
|
import language from 'flexsearch/dist/module/lang/en.js'
|
|
8
8
|
import { useStoryStore } from '../../stores/story'
|
|
9
9
|
import BaseEmpty from '../base/BaseEmpty.vue'
|
|
10
|
-
import type { SearchResult, Story, Variant } from '../../types'
|
|
10
|
+
import type { SearchResult, SearchResultType, Story, Variant } from '../../types'
|
|
11
11
|
import SearchItem from './SearchItem.vue'
|
|
12
12
|
import { searchData, onUpdate } from './search-title-data'
|
|
13
13
|
import type { SearchData } from './types'
|
|
@@ -161,7 +161,7 @@ async function searchOnDocField (query: string) {
|
|
|
161
161
|
if (!idMapData) continue
|
|
162
162
|
switch (idMapData.kind) {
|
|
163
163
|
case 'story': {
|
|
164
|
-
list.push(storyResultFactory(storyStore.getStoryById(idMapData.id), rank))
|
|
164
|
+
list.push(storyResultFactory(storyStore.getStoryById(idMapData.id), rank, 'docs'))
|
|
165
165
|
rank++
|
|
166
166
|
break
|
|
167
167
|
}
|
|
@@ -174,7 +174,7 @@ async function searchOnDocField (query: string) {
|
|
|
174
174
|
|
|
175
175
|
watch(rateLimitedSearch, searchOnDocField)
|
|
176
176
|
|
|
177
|
-
function storyResultFactory (story: Story, rank: number): SearchResult {
|
|
177
|
+
function storyResultFactory (story: Story, rank: number, type: SearchResultType = 'title'): SearchResult {
|
|
178
178
|
return {
|
|
179
179
|
kind: 'story',
|
|
180
180
|
rank,
|
|
@@ -185,14 +185,20 @@ function storyResultFactory (story: Story, rank: number): SearchResult {
|
|
|
185
185
|
params: {
|
|
186
186
|
storyId: story.id,
|
|
187
187
|
},
|
|
188
|
+
query: {
|
|
189
|
+
...type === 'docs'
|
|
190
|
+
? { tab: 'docs' }
|
|
191
|
+
: {},
|
|
192
|
+
},
|
|
188
193
|
},
|
|
189
194
|
path: story.file.path.slice(0, -1),
|
|
190
195
|
icon: story.icon,
|
|
191
196
|
iconColor: story.iconColor,
|
|
197
|
+
type,
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
200
|
|
|
195
|
-
function variantResultFactory (story: Story, variant: Variant, rank: number): SearchResult {
|
|
201
|
+
function variantResultFactory (story: Story, variant: Variant, rank: number, type: SearchResultType = 'title'): SearchResult {
|
|
196
202
|
return {
|
|
197
203
|
kind: 'variant',
|
|
198
204
|
rank,
|
|
@@ -205,11 +211,15 @@ function variantResultFactory (story: Story, variant: Variant, rank: number): Se
|
|
|
205
211
|
},
|
|
206
212
|
query: {
|
|
207
213
|
variantId: variant.id,
|
|
214
|
+
...type === 'docs'
|
|
215
|
+
? { tab: 'docs' }
|
|
216
|
+
: {},
|
|
208
217
|
},
|
|
209
218
|
},
|
|
210
219
|
path: [...story.file.path ?? [], story.title],
|
|
211
220
|
icon: variant.icon,
|
|
212
221
|
iconColor: variant.iconColor,
|
|
222
|
+
type,
|
|
213
223
|
}
|
|
214
224
|
}
|
|
215
225
|
|
|
@@ -91,6 +91,7 @@ useResizeObserver(el, () => {
|
|
|
91
91
|
'htw-border-gray-100 dark:htw-border-gray-800': !isActive,
|
|
92
92
|
'htw-border-primary-200 dark:htw-border-primary-900': isActive,
|
|
93
93
|
}"
|
|
94
|
+
data-test-id="sandbox-render"
|
|
94
95
|
@click.stop="selectVariant()"
|
|
95
96
|
@keyup="selectVariant()"
|
|
96
97
|
>
|
|
@@ -29,6 +29,8 @@ function onReady () {
|
|
|
29
29
|
width: finalWidth ? `${finalWidth}px` : '100%',
|
|
30
30
|
height: finalHeight ? `${finalHeight}px` : '100%',
|
|
31
31
|
} : { width: '100%', height: '100%' }"
|
|
32
|
+
class="htw-relative"
|
|
33
|
+
data-test-id="sandbox-render"
|
|
32
34
|
>
|
|
33
35
|
<GenericRenderStory
|
|
34
36
|
:key="`${story.id}-${variant.id}`"
|
package/src/app/types.ts
CHANGED
|
@@ -26,12 +26,15 @@ export interface TreeGroup {
|
|
|
26
26
|
|
|
27
27
|
export type Tree = (TreeGroup | TreeFolder | TreeLeaf)[]
|
|
28
28
|
|
|
29
|
+
export type SearchResultType = 'title' | 'docs'
|
|
30
|
+
|
|
29
31
|
export interface SearchResult {
|
|
30
32
|
kind: 'story' | 'variant'
|
|
31
33
|
rank: number
|
|
32
34
|
id: string
|
|
33
35
|
title: string
|
|
34
36
|
route: RouteLocationRaw
|
|
37
|
+
type: SearchResultType
|
|
35
38
|
path?: string[]
|
|
36
39
|
icon?: string
|
|
37
40
|
iconColor?: string
|