histoire 0.1.5 → 0.2.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/client/app/codegen/vue3.js +1 -0
- package/dist/client/app/codegen/vue3.js.map +1 -0
- package/dist/client/app/components/app/AppHeader.vue +2 -1
- package/dist/client/app/components/base/BaseCheckbox.vue +76 -0
- package/dist/client/app/components/exposed/Story.vue +20 -14
- package/dist/client/app/components/sandbox/lib.d.ts +2 -0
- package/dist/client/app/components/sandbox/lib.js +6 -0
- package/dist/client/app/components/sandbox/lib.ts +8 -0
- package/dist/client/app/components/search/SearchItem.vue +4 -1
- package/dist/client/app/components/search/SearchModal.vue +4 -4
- package/dist/client/app/components/story/StoryControls.vue +1 -1
- package/dist/client/app/components/story/StoryDocs.vue +1 -0
- package/dist/client/app/components/story/StoryListFolder.vue +1 -1
- package/dist/client/app/components/story/StoryListItem.vue +4 -1
- package/dist/client/app/components/story/StoryResponsivePreview.vue +3 -4
- package/dist/client/app/components/story/StorySidePanel.vue +1 -0
- package/dist/client/app/components/story/StorySourceCode.vue +4 -1
- package/dist/client/app/components/story/StoryVariantGrid.vue +112 -0
- package/dist/client/app/components/story/StoryVariantGridItem.vue +34 -4
- package/dist/client/app/components/story/StoryVariantListItem.vue +4 -1
- package/dist/client/app/components/story/StoryVariantSingleView.vue +20 -160
- package/dist/client/app/components/story/StoryViewer.vue +6 -25
- package/dist/client/app/components/story/variant/StoryVariantBackground.vue +67 -0
- package/dist/client/app/components/story/variant/StoryVariantNewTab.vue +29 -0
- package/dist/client/app/components/story/variant/StoryVariantResponsiveSize.vue +82 -0
- package/dist/client/app/components/story/variant/StoryVariantTitle.vue +21 -0
- package/dist/client/app/global-components.js +1 -0
- package/dist/client/app/global-components.js.map +1 -0
- package/dist/client/app/index.js +1 -0
- package/dist/client/app/index.js.map +1 -0
- package/dist/client/app/sandbox.js +1 -0
- package/dist/client/app/sandbox.js.map +1 -0
- package/dist/client/app/stores/story.d.ts +6 -6
- package/dist/client/app/stores/story.js +1 -0
- package/dist/client/app/stores/story.js.map +1 -0
- package/dist/client/app/style/main.pcss +9 -5
- package/dist/client/app/types.d.ts +1 -1
- package/dist/client/app/types.ts +1 -1
- package/dist/client/app/util/keyboard.js +1 -0
- package/dist/client/app/util/keyboard.js.map +1 -0
- package/dist/client/app/util/mapping.js +1 -0
- package/dist/client/app/util/mapping.js.map +1 -0
- package/dist/client/app/util/preview-settings.js +1 -0
- package/dist/client/app/util/preview-settings.js.map +1 -0
- package/dist/client/app/util/reactivity.js +1 -0
- package/dist/client/app/util/reactivity.js.map +1 -0
- package/dist/client/app/util/scroll.d.ts +3 -1
- package/dist/client/app/util/scroll.js +4 -0
- package/dist/client/app/util/scroll.js.map +1 -0
- package/dist/client/app/util/scroll.ts +4 -0
- package/dist/client/app/util/variant.js +1 -0
- package/dist/client/app/util/variant.js.map +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/server/index.js +1 -0
- package/dist/client/server/index.js.map +1 -0
- package/dist/controls.js +1 -0
- package/dist/controls.js.map +1 -0
- package/dist/node/bin.js +7 -0
- package/dist/node/build.js +1 -1
- package/dist/node/{collect.d.ts → collect/index.d.ts} +2 -2
- package/dist/node/{collect.js → collect/index.js} +37 -27
- package/dist/node/collect/worker.d.ts +14 -0
- package/dist/node/collect/worker.js +36 -0
- package/dist/node/commands/preview.d.ts +4 -0
- package/dist/node/commands/preview.js +36 -0
- package/dist/node/config.d.ts +2 -2
- package/dist/node/server.js +1 -1
- package/dist/node/tree.js +24 -4
- package/dist/node/types.d.ts +1 -1
- package/dist/style.css +98 -50
- package/package.json +10 -6
- package/src/client/app/components/app/AppHeader.vue +2 -1
- package/src/client/app/components/base/BaseCheckbox.vue +76 -0
- package/src/client/app/components/exposed/Story.vue +20 -14
- package/src/client/app/components/sandbox/lib.ts +8 -0
- package/src/client/app/components/search/SearchItem.vue +4 -1
- package/src/client/app/components/search/SearchModal.vue +4 -4
- package/src/client/app/components/story/StoryControls.vue +1 -1
- package/src/client/app/components/story/StoryDocs.vue +1 -0
- package/src/client/app/components/story/StoryListFolder.vue +1 -1
- package/src/client/app/components/story/StoryListItem.vue +4 -1
- package/src/client/app/components/story/StoryResponsivePreview.vue +3 -4
- package/src/client/app/components/story/StorySidePanel.vue +1 -0
- package/src/client/app/components/story/StorySourceCode.vue +4 -1
- package/src/client/app/components/story/StoryVariantGrid.vue +112 -0
- package/src/client/app/components/story/StoryVariantGridItem.vue +34 -4
- package/src/client/app/components/story/StoryVariantListItem.vue +4 -1
- package/src/client/app/components/story/StoryVariantSingleView.vue +20 -160
- package/src/client/app/components/story/StoryViewer.vue +6 -25
- package/src/client/app/components/story/variant/StoryVariantBackground.vue +67 -0
- package/src/client/app/components/story/variant/StoryVariantNewTab.vue +29 -0
- package/src/client/app/components/story/variant/StoryVariantResponsiveSize.vue +82 -0
- package/src/client/app/components/story/variant/StoryVariantTitle.vue +21 -0
- package/src/client/app/style/main.pcss +9 -5
- package/src/client/app/types.ts +1 -1
- package/src/client/app/util/scroll.ts +4 -0
- package/src/node/bin.ts +8 -0
- package/src/node/build.ts +1 -1
- package/src/node/{collect.ts → collect/index.ts} +48 -30
- package/src/node/collect/worker.ts +61 -0
- package/src/node/commands/preview.ts +50 -0
- package/src/node/config.ts +2 -2
- package/src/node/server.ts +1 -1
- package/src/node/tree.spec.ts +61 -0
- package/src/node/tree.ts +29 -5
- package/src/node/types.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue3.js","sourceRoot":"","sources":["../../../../src/client/app/codegen/vue3.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,kDAAkD;AAElD,OAAO,EAAS,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,MAA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,OAAO,SAAS,CAAC,IAAI,IAAI,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KAC3D;SAAM,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE;QAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;KACvB;SAAM,IAAI,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE;QAC7B,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KAC1C;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,SAAS,eAAe,CAAE,IAAY;IACpC,MAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC1C,IAAI,KAAK,EAAE;QACT,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;KACxB;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,SAAS,mBAAmB,CAAE,KAAU;IACtC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,EAAE,oBAAoB,CAAA;IAC1D,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;IACjC,IAAI,oBAAoB,EAAE;QACxB,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAA;KAC3C;SAAM;QACL,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;KACpD;AACH,CAAC"}
|
|
@@ -29,7 +29,7 @@ onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
|
|
|
29
29
|
<a
|
|
30
30
|
:href="histoireConfig.theme?.logoHref"
|
|
31
31
|
target="_blank"
|
|
32
|
-
class="htw-
|
|
32
|
+
class="htw-w-full htw-h-full htw-flex htw-items-center"
|
|
33
33
|
>
|
|
34
34
|
<AppLogo
|
|
35
35
|
class="htw-max-w-full htw-max-h-full"
|
|
@@ -40,6 +40,7 @@ onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
|
|
|
40
40
|
<a
|
|
41
41
|
v-tooltip="makeTooltip('Search', ({ isMac }) => isMac ? 'meta+k' : 'ctrl+k')"
|
|
42
42
|
class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
|
|
43
|
+
data-test-id="search-btn"
|
|
43
44
|
@click="$emit('search')"
|
|
44
45
|
>
|
|
45
46
|
<Icon
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false,
|
|
8
|
+
},
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const emit = defineEmits({
|
|
12
|
+
'update:modelValue': (newValue: boolean) => true,
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
function toggle () {
|
|
16
|
+
emit('update:modelValue', !props.modelValue)
|
|
17
|
+
animationEnabled.value = true
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// SVG check
|
|
21
|
+
|
|
22
|
+
const path = ref<SVGPathElement>()
|
|
23
|
+
const dasharray = ref(0)
|
|
24
|
+
const progress = computed(() => props.modelValue ? 1 : 0)
|
|
25
|
+
const dashoffset = computed(() => (1 - progress.value) * dasharray.value)
|
|
26
|
+
const animationEnabled = ref(false)
|
|
27
|
+
|
|
28
|
+
watch(path, value => {
|
|
29
|
+
dasharray.value = path.value.getTotalLength?.() ?? 21.21
|
|
30
|
+
})
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<div
|
|
35
|
+
role="checkbox"
|
|
36
|
+
tabindex="0"
|
|
37
|
+
class="htw-flex htw-items-center htw-gap-2 htw-select-none htw-px-4 htw-py-3 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700"
|
|
38
|
+
@click="toggle()"
|
|
39
|
+
@keydown.enter.prevent="toggle()"
|
|
40
|
+
@keydown.space.prevent="toggle()"
|
|
41
|
+
>
|
|
42
|
+
<div class="htw-text-white htw-w-[16px] htw-h-[16px] htw-relative">
|
|
43
|
+
<div
|
|
44
|
+
class="htw-border group-active:htw-bg-gray-500/20 htw-rounded-sm htw-box-border htw-absolute htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out"
|
|
45
|
+
:class="[
|
|
46
|
+
modelValue
|
|
47
|
+
? 'htw-border-primary-500 htw-border-8'
|
|
48
|
+
: 'htw-border-black/25 dark:htw-border-white/25 htw-delay-150',
|
|
49
|
+
]"
|
|
50
|
+
/>
|
|
51
|
+
<svg
|
|
52
|
+
width="16"
|
|
53
|
+
height="16"
|
|
54
|
+
viewBox="0 0 24 24"
|
|
55
|
+
class="htw-relative htw-z-10"
|
|
56
|
+
>
|
|
57
|
+
<path
|
|
58
|
+
ref="path"
|
|
59
|
+
d="m 4 12 l 5 5 l 10 -10"
|
|
60
|
+
fill="none"
|
|
61
|
+
class="htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out"
|
|
62
|
+
:class="[
|
|
63
|
+
animationEnabled ? 'htw-transition-all' : 'htw-transition-none',
|
|
64
|
+
{
|
|
65
|
+
'htw-delay-150': modelValue,
|
|
66
|
+
},
|
|
67
|
+
]"
|
|
68
|
+
:stroke-dasharray="dasharray"
|
|
69
|
+
:stroke-dashoffset="dashoffset"
|
|
70
|
+
/>
|
|
71
|
+
</svg>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<slot />
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
@@ -40,22 +40,28 @@ export default defineComponent({
|
|
|
40
40
|
}, this.$slots)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
const vnodes: VNode[]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
vnode.
|
|
43
|
+
let index = 0
|
|
44
|
+
const applyAttrs = (vnodes: VNode[]) => {
|
|
45
|
+
for (const vnode of vnodes) {
|
|
46
|
+
// @ts-expect-error custom option
|
|
47
|
+
if (vnode.type?.__histoireType === 'variant') {
|
|
48
|
+
if (!vnode.props) {
|
|
49
|
+
vnode.props = {}
|
|
50
|
+
}
|
|
51
|
+
vnode.props.variant = this.story.variants[index]
|
|
52
|
+
if (!vnode.props.initState && !vnode.props['init-state']) {
|
|
53
|
+
vnode.props.initState = this.initState
|
|
54
|
+
}
|
|
55
|
+
index++
|
|
56
|
+
} else if (vnode.children?.length) {
|
|
57
|
+
applyAttrs(vnode.children as VNode[])
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
}
|
|
61
|
+
|
|
62
|
+
// Apply variant as attribute to each child vnode (should be `<Variant>` components)
|
|
63
|
+
const vnodes: VNode[] = this.$slots.default()
|
|
64
|
+
applyAttrs(vnodes)
|
|
59
65
|
return vnodes
|
|
60
66
|
},
|
|
61
67
|
})
|
|
@@ -25,8 +25,7 @@ function close () {
|
|
|
25
25
|
// Autofocus
|
|
26
26
|
|
|
27
27
|
const input = ref<HTMLInputElement>()
|
|
28
|
-
const { focused } = useFocus({
|
|
29
|
-
target: input,
|
|
28
|
+
const { focused } = useFocus(input, {
|
|
30
29
|
initialValue: true,
|
|
31
30
|
})
|
|
32
31
|
|
|
@@ -132,6 +131,7 @@ function selectPrevious () {
|
|
|
132
131
|
<div
|
|
133
132
|
v-show="shown"
|
|
134
133
|
class="htw-fixed htw-inset-0 htw-bg-white/80 dark:htw-bg-gray-700/80 htw-z-20"
|
|
134
|
+
data-test-id="search-modal"
|
|
135
135
|
>
|
|
136
136
|
<div
|
|
137
137
|
class="htw-absolute htw-inset-0"
|
|
@@ -152,8 +152,8 @@ function selectPrevious () {
|
|
|
152
152
|
v-model="search"
|
|
153
153
|
placeholder="Search for stories, variants..."
|
|
154
154
|
class="htw-bg-transparent htw-w-full htw-flex-1 htw-pl-0 htw-pr-6 htw-py-4 htw-outline-none"
|
|
155
|
-
@keydown.down="selectNext()"
|
|
156
|
-
@keydown.up="selectPrevious()"
|
|
155
|
+
@keydown.down.prevent="selectNext()"
|
|
156
|
+
@keydown.up.prevent="selectPrevious()"
|
|
157
157
|
@keydown.escape="close()"
|
|
158
158
|
>
|
|
159
159
|
</div>
|
|
@@ -9,6 +9,7 @@ import HatchedPattern from '../misc/HatchedPattern.vue'
|
|
|
9
9
|
import CheckerboardPattern from '../misc/CheckerboardPattern.vue'
|
|
10
10
|
import { toRawDeep } from '../../util/reactivity'
|
|
11
11
|
import { Settings } from 'http2'
|
|
12
|
+
import { getSandboxUrl } from '../sandbox/lib'
|
|
12
13
|
|
|
13
14
|
const props = defineProps<{
|
|
14
15
|
story: Story
|
|
@@ -61,10 +62,7 @@ useEventListener(window, 'message', (event) => {
|
|
|
61
62
|
})
|
|
62
63
|
|
|
63
64
|
const sandboxUrl = computed(() => {
|
|
64
|
-
|
|
65
|
-
url.append('storyId', props.story.id)
|
|
66
|
-
url.append('variantId', props.variant.id)
|
|
67
|
-
return '/__sandbox?' + url.toString()
|
|
65
|
+
return getSandboxUrl(props.story, props.variant)
|
|
68
66
|
})
|
|
69
67
|
|
|
70
68
|
const isIframeLoaded = ref(false)
|
|
@@ -255,6 +253,7 @@ const finalHeight = computed(() => props.settings.rotate ? props.settings.respon
|
|
|
255
253
|
'htw-invisible': !isIframeLoaded,
|
|
256
254
|
'htw-pointer-events-none': resizing,
|
|
257
255
|
}"
|
|
256
|
+
data-test-id="preview-iframe"
|
|
258
257
|
@load="onIframeLoad()"
|
|
259
258
|
/>
|
|
260
259
|
</div>
|
|
@@ -67,7 +67,10 @@ const copySourceCode = () => copy(sourceCode.value)
|
|
|
67
67
|
</script>
|
|
68
68
|
|
|
69
69
|
<template>
|
|
70
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
class="htw-bg-gray-100 dark:htw-bg-gray-800 htw-h-full htw-overflow-hidden htw-relative"
|
|
72
|
+
data-test-id="story-source-code"
|
|
73
|
+
>
|
|
71
74
|
<div
|
|
72
75
|
v-if="error"
|
|
73
76
|
class="htw-text-red-500 htw-h-full htw-p-2 htw-overflow-auto htw-font-mono htw-text-sm"
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useResizeObserver } from '@vueuse/core'
|
|
3
|
+
import { computed, ref, watch } from 'vue'
|
|
4
|
+
import { useStoryStore } from '../../stores/story'
|
|
5
|
+
import StoryVariantGridItem from './StoryVariantGridItem.vue'
|
|
6
|
+
|
|
7
|
+
const storyStore = useStoryStore()
|
|
8
|
+
|
|
9
|
+
const gridTemplateWidth = computed(() => {
|
|
10
|
+
if (storyStore.currentStory.layout.type !== 'grid') {
|
|
11
|
+
return
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const layoutWidth = storyStore.currentStory.layout.width
|
|
15
|
+
|
|
16
|
+
if (!layoutWidth) {
|
|
17
|
+
return '200px'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof layoutWidth === 'number') {
|
|
21
|
+
return layoutWidth + 'px'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return layoutWidth
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const margin = 16
|
|
28
|
+
const gap = 16
|
|
29
|
+
|
|
30
|
+
const itemWidth = ref(16)
|
|
31
|
+
const maxItemHeight = ref(0)
|
|
32
|
+
const maxCount = ref(10)
|
|
33
|
+
const countPerRow = ref(0)
|
|
34
|
+
const visibleRows = ref(0)
|
|
35
|
+
|
|
36
|
+
const el = ref<HTMLDivElement>(null)
|
|
37
|
+
|
|
38
|
+
useResizeObserver(el, () => {
|
|
39
|
+
updateMaxCount()
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
function updateMaxCount () {
|
|
43
|
+
if (!maxItemHeight.value) return
|
|
44
|
+
|
|
45
|
+
const width = el.value!.clientWidth - margin * 2
|
|
46
|
+
const height = el.value!.clientHeight
|
|
47
|
+
const scrollTop = el.value!.scrollTop
|
|
48
|
+
|
|
49
|
+
// width = (countPerRow - 1) * gap + countPerRow * itemWidth.value
|
|
50
|
+
|
|
51
|
+
// W = (C - 1) * G + C * I
|
|
52
|
+
// W = C * G - G + C * I
|
|
53
|
+
// W + G = C * G + C * I
|
|
54
|
+
// W + G = C * (G + I)
|
|
55
|
+
// (W + G) / (G + I) = C
|
|
56
|
+
|
|
57
|
+
countPerRow.value = Math.floor((width + gap) / (itemWidth.value + gap))
|
|
58
|
+
visibleRows.value = Math.ceil((height + scrollTop + gap) / (maxItemHeight.value + gap))
|
|
59
|
+
const newMaxCount = countPerRow.value * visibleRows.value
|
|
60
|
+
if (maxCount.value < newMaxCount) {
|
|
61
|
+
maxCount.value = newMaxCount
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (storyStore.currentVariant) {
|
|
65
|
+
const index = storyStore.currentStory.variants.indexOf(storyStore.currentVariant)
|
|
66
|
+
if (index + 1 > maxCount.value) {
|
|
67
|
+
maxCount.value = index + 1
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function onItemResize (w: number, h: number) {
|
|
73
|
+
itemWidth.value = w
|
|
74
|
+
if (maxItemHeight.value < h) {
|
|
75
|
+
maxItemHeight.value = h
|
|
76
|
+
updateMaxCount()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
watch(() => storyStore.currentVariant, () => {
|
|
81
|
+
updateMaxCount()
|
|
82
|
+
})
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
<div
|
|
87
|
+
ref="el"
|
|
88
|
+
class="htw-h-full htw-overflow-y-auto"
|
|
89
|
+
@scroll="updateMaxCount()"
|
|
90
|
+
>
|
|
91
|
+
<div
|
|
92
|
+
:style="{
|
|
93
|
+
minHeight: `${(storyStore.currentStory.variants.length / countPerRow) * (maxItemHeight + gap) - gap}px`,
|
|
94
|
+
}"
|
|
95
|
+
>
|
|
96
|
+
<div
|
|
97
|
+
class="htw-grid htw-gap-4 htw-m-4"
|
|
98
|
+
:style="{
|
|
99
|
+
gridTemplateColumns: `repeat(auto-fill, ${gridTemplateWidth})`,
|
|
100
|
+
}"
|
|
101
|
+
>
|
|
102
|
+
<StoryVariantGridItem
|
|
103
|
+
v-for="(variant, index) of storyStore.currentStory.variants.slice(0, maxCount)"
|
|
104
|
+
:key="index"
|
|
105
|
+
:variant="variant"
|
|
106
|
+
:story="storyStore.currentStory"
|
|
107
|
+
@resize="onItemResize"
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { PropType, toRefs } from 'vue'
|
|
2
|
+
import { PropType, ref, toRefs } from 'vue'
|
|
3
|
+
import { Icon } from '@iconify/vue'
|
|
4
|
+
import { useRouter } from 'vue-router'
|
|
5
|
+
import { useResizeObserver } from '@vueuse/core'
|
|
3
6
|
import { useCurrentVariantRoute } from '../../util/variant'
|
|
4
7
|
import type { Story, Variant } from '../../types'
|
|
5
8
|
import SandboxVue3 from '../sandbox/SandboxVue3.vue'
|
|
6
|
-
import {
|
|
9
|
+
import { useScrollOnActive } from '../../util/scroll.js'
|
|
7
10
|
|
|
8
11
|
const props = defineProps({
|
|
9
12
|
variant: {
|
|
@@ -17,6 +20,10 @@ const props = defineProps({
|
|
|
17
20
|
},
|
|
18
21
|
})
|
|
19
22
|
|
|
23
|
+
const emit = defineEmits({
|
|
24
|
+
resize: (width: number, height: number) => true,
|
|
25
|
+
})
|
|
26
|
+
|
|
20
27
|
const { variant } = toRefs(props)
|
|
21
28
|
const { isActive, targetRoute } = useCurrentVariantRoute(variant)
|
|
22
29
|
|
|
@@ -28,10 +35,32 @@ function onReady () {
|
|
|
28
35
|
ready: true,
|
|
29
36
|
})
|
|
30
37
|
}
|
|
38
|
+
|
|
39
|
+
const router = useRouter()
|
|
40
|
+
|
|
41
|
+
function selectVariant () {
|
|
42
|
+
router.push(targetRoute.value)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const el = ref<HTMLDivElement>()
|
|
46
|
+
|
|
47
|
+
const { autoScroll } = useScrollOnActive(isActive, el)
|
|
48
|
+
|
|
49
|
+
useResizeObserver(el, () => {
|
|
50
|
+
if (props.variant.ready) {
|
|
51
|
+
emit('resize', el.value!.clientWidth, el.value!.clientHeight)
|
|
52
|
+
if (isActive.value) {
|
|
53
|
+
autoScroll()
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
})
|
|
31
57
|
</script>
|
|
32
58
|
|
|
33
59
|
<template>
|
|
34
|
-
<div
|
|
60
|
+
<div
|
|
61
|
+
ref="el"
|
|
62
|
+
class="htw-cursor-default htw-flex htw-flex-col htw-gap-y-1"
|
|
63
|
+
>
|
|
35
64
|
<!-- Header -->
|
|
36
65
|
<div class="htw-flex-none htw-flex htw-items-center">
|
|
37
66
|
<RouterLink
|
|
@@ -61,7 +90,8 @@ function onReady () {
|
|
|
61
90
|
'htw-border-gray-100 dark:htw-border-gray-800': !isActive,
|
|
62
91
|
'htw-border-primary-200 dark:htw-border-primary-900': isActive,
|
|
63
92
|
}"
|
|
64
|
-
@click.stop.prevent
|
|
93
|
+
@click.stop.prevent="selectVariant()"
|
|
94
|
+
@keyup="selectVariant()"
|
|
65
95
|
>
|
|
66
96
|
<SandboxVue3
|
|
67
97
|
:variant="variant"
|