@histoire/app 0.9.5 → 0.9.6
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.js +4 -3
- package/dist/bundled/components/panel/StatePresets.js +1 -1
- package/dist/bundled/components/panel/StoryControls.js +12 -5
- package/dist/bundled/components/story/GenericMountStory.js +7 -3
- package/dist/bundled/components/story/GenericRenderStory.js +4 -0
- package/dist/bundled/components/story/StoryVariantGridItem.js +7 -6
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +3 -0
- package/dist/bundled/sandbox.js +1 -0
- package/dist/bundled/style.css +7 -7
- package/package.json +4 -4
- package/src/app/App.vue +1 -0
- package/src/app/components/panel/StatePresets.vue +1 -1
- package/src/app/components/panel/StoryControls.vue +12 -2
- package/src/app/components/story/GenericMountStory.vue +7 -0
- package/src/app/components/story/GenericRenderStory.vue +6 -0
- package/src/app/components/story/StoryVariantGridItem.vue +1 -0
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +3 -0
- package/src/app/sandbox.ts +1 -0
package/dist/bundled/App.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, Fragment, unref,
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, Fragment, unref, createBlock, createCommentVNode, createElementVNode, normalizeStyle, createVNode, withCtx, Transition } from "@histoire/vendors/vue";
|
|
2
2
|
import { files, tree, onUpdate } from "$histoire-stories";
|
|
3
3
|
import _sfc_main$3 from "./components/tree/StoryList.js";
|
|
4
4
|
import BaseSplitPane from "./components/base/BaseSplitPane.js";
|
|
@@ -84,9 +84,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
const _component_RouterView = resolveComponent("RouterView");
|
|
85
85
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
86
86
|
unref(storyStore).currentStory ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
87
|
-
|
|
87
|
+
(openBlock(), createBlock(_sfc_main$1, {
|
|
88
|
+
key: unref(storyStore).currentStory.id,
|
|
88
89
|
story: unref(storyStore).currentStory
|
|
89
|
-
}, null, 8, ["story"])
|
|
90
|
+
}, null, 8, ["story"]))
|
|
90
91
|
])) : createCommentVNode("", true),
|
|
91
92
|
createElementVNode("div", {
|
|
92
93
|
class: "htw-h-screen htw-bg-white dark:htw-bg-gray-700 dark:htw-text-gray-100",
|
|
@@ -48,7 +48,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
48
|
if (id === DEFAULT_ID) {
|
|
49
49
|
resetState();
|
|
50
50
|
} else if (presetStates.value.has(id)) {
|
|
51
|
-
applyState(props.variant.state, clone(presetStates.value.get(id).state));
|
|
51
|
+
applyState(props.variant.state, clone(toRawDeep(presetStates.value.get(id).state)));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
onMounted(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementVNode, defineComponent, openBlock, createElementBlock,
|
|
1
|
+
import { createElementVNode, defineComponent, ref, watch, openBlock, createElementBlock, createBlock, createCommentVNode, withCtx, createVNode, unref, Fragment, renderList } from "@histoire/vendors/vue";
|
|
2
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
3
3
|
import _sfc_main$2 from "../story/GenericRenderStory.js";
|
|
4
4
|
import BaseEmpty from "../base/BaseEmpty.js";
|
|
@@ -24,21 +24,28 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
setup(__props) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const ready = ref(false);
|
|
29
|
+
watch(() => props.variant, () => {
|
|
30
|
+
ready.value = false;
|
|
31
|
+
});
|
|
27
32
|
return (_ctx, _cache) => {
|
|
28
33
|
var _a, _b, _c, _d;
|
|
29
34
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
30
35
|
createElementVNode("div", _hoisted_2, [
|
|
31
|
-
|
|
36
|
+
ready.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
37
|
+
key: 0,
|
|
32
38
|
story: __props.story,
|
|
33
39
|
variant: __props.variant
|
|
34
|
-
}, null, 8, ["story", "variant"])
|
|
40
|
+
}, null, 8, ["story", "variant"])) : createCommentVNode("", true)
|
|
35
41
|
]),
|
|
36
42
|
__props.variant.slots().controls || __props.story.slots().controls ? (openBlock(), createBlock(_sfc_main$2, {
|
|
37
|
-
key:
|
|
43
|
+
key: `${__props.story.id}-${__props.variant.id}`,
|
|
38
44
|
"slot-name": "controls",
|
|
39
45
|
variant: __props.variant,
|
|
40
46
|
story: __props.story,
|
|
41
|
-
class: "htw-flex-none"
|
|
47
|
+
class: "htw-flex-none",
|
|
48
|
+
onReady: _cache[0] || (_cache[0] = ($event) => ready.value = true)
|
|
42
49
|
}, null, 8, ["variant", "story"])) : !((_b = (_a = __props.variant.state) == null ? void 0 : _a._hPropDefs) == null ? void 0 : _b.length) ? (openBlock(), createBlock(BaseEmpty, { key: 1 }, {
|
|
43
50
|
default: withCtx(() => [
|
|
44
51
|
createVNode(unref(Icon), {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { defineComponent, ref, watchEffect, markRaw, openBlock, createBlock, resolveDynamicComponent, createCommentVNode } from "@histoire/vendors/vue";
|
|
1
|
+
import { defineComponent, ref, watchEffect, markRaw, openBlock, createBlock, resolveDynamicComponent, mergeProps, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
2
|
import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
3
|
+
const __default__ = {
|
|
4
|
+
inheritAttrs: false
|
|
5
|
+
};
|
|
3
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...__default__,
|
|
4
8
|
__name: "GenericMountStory",
|
|
5
9
|
props: {
|
|
6
10
|
story: null
|
|
@@ -17,10 +21,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
21
|
}
|
|
18
22
|
});
|
|
19
23
|
return (_ctx, _cache) => {
|
|
20
|
-
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), {
|
|
24
|
+
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
21
25
|
key: 0,
|
|
22
26
|
story: __props.story
|
|
23
|
-
}, null,
|
|
27
|
+
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { defineComponent, ref, watchEffect, markRaw, openBlock, createBlock, resolveDynamicComponent, mergeProps, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
2
|
import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
3
|
+
const __default__ = {
|
|
4
|
+
inheritAttrs: false
|
|
5
|
+
};
|
|
3
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...__default__,
|
|
4
8
|
__name: "GenericRenderStory",
|
|
5
9
|
props: {
|
|
6
10
|
story: null
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, defineComponent, useCssVars, unref, toRefs, ref, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, normalizeClass, withCtx, toDisplayString, withModifiers } from "@histoire/vendors/vue";
|
|
1
|
+
import { pushScopeId, popScopeId, defineComponent, useCssVars, unref, toRefs, ref, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, normalizeClass, withCtx, toDisplayString, withModifiers, createBlock } from "@histoire/vendors/vue";
|
|
2
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
3
3
|
import { useRouter } from "@histoire/vendors/vue-router";
|
|
4
4
|
import { useResizeObserver } from "@histoire/vendors/vue-use";
|
|
@@ -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-5ead31bb"), 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
|
+
"c449decc": unref(variant).iconColor
|
|
31
31
|
}));
|
|
32
32
|
const { variant } = toRefs(props);
|
|
33
33
|
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
@@ -92,15 +92,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
92
|
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"])),
|
|
93
93
|
onKeyup: _cache[1] || (_cache[1] = ($event) => selectVariant())
|
|
94
94
|
}, [
|
|
95
|
-
|
|
95
|
+
(openBlock(), createBlock(_sfc_main$1, {
|
|
96
|
+
key: `${__props.story.id}-${unref(variant).id}`,
|
|
96
97
|
variant: unref(variant),
|
|
97
98
|
story: __props.story,
|
|
98
99
|
onReady
|
|
99
|
-
}, null, 8, ["variant", "story"])
|
|
100
|
+
}, null, 8, ["variant", "story"]))
|
|
100
101
|
], 34)
|
|
101
102
|
], 512);
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
105
|
});
|
|
105
|
-
var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
106
|
+
var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5ead31bb"]]);
|
|
106
107
|
export { StoryVariantGridItem as default };
|
|
@@ -72,6 +72,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
72
|
const isIframeLoaded = ref(false);
|
|
73
73
|
watch(sandboxUrl, () => {
|
|
74
74
|
isIframeLoaded.value = false;
|
|
75
|
+
Object.assign(props.variant, {
|
|
76
|
+
previewReady: false
|
|
77
|
+
});
|
|
75
78
|
});
|
|
76
79
|
function syncSettings() {
|
|
77
80
|
if (iframe.value) {
|
package/dist/bundled/sandbox.js
CHANGED
package/dist/bundled/style.css
CHANGED
|
@@ -68,6 +68,11 @@
|
|
|
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
|
+
|
|
71
76
|
.bind-icon-color[data-v-7f8cccbc] {
|
|
72
77
|
color: var(--cebc8760);
|
|
73
78
|
}
|
|
@@ -76,13 +81,8 @@
|
|
|
76
81
|
color: var(--0589c2c6);
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
.
|
|
80
|
-
color:
|
|
81
|
-
font-size: inherit;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.bind-icon-color[data-v-feb5bbb0] {
|
|
85
|
-
color: var(--7761d6aa);
|
|
84
|
+
.bind-icon-color[data-v-5ead31bb] {
|
|
85
|
+
color: var(--c449decc);
|
|
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.9.
|
|
3
|
+
"version": "0.9.6",
|
|
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.9.
|
|
28
|
-
"@histoire/shared": "^0.9.
|
|
29
|
-
"@histoire/vendors": "^0.9.
|
|
27
|
+
"@histoire/controls": "^0.9.6",
|
|
28
|
+
"@histoire/shared": "^0.9.6",
|
|
29
|
+
"@histoire/vendors": "^0.9.6",
|
|
30
30
|
"@types/flexsearch": "^0.7.3",
|
|
31
31
|
"flexsearch": "^0.7.21",
|
|
32
32
|
"shiki": "0.10.1"
|
package/src/app/App.vue
CHANGED
|
@@ -47,7 +47,7 @@ function applyPreset (id) {
|
|
|
47
47
|
if (id === DEFAULT_ID) {
|
|
48
48
|
resetState()
|
|
49
49
|
} else if (presetStates.value.has(id)) {
|
|
50
|
-
applyState(props.variant.state, clone(presetStates.value.get(id).state))
|
|
50
|
+
applyState(props.variant.state, clone(toRawDeep(presetStates.value.get(id).state)))
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { PropType } from 'vue'
|
|
2
|
+
import { PropType, ref, watch } from 'vue'
|
|
3
3
|
import { Icon } from '@iconify/vue'
|
|
4
4
|
import GenericRenderStory from '../story/GenericRenderStory.vue'
|
|
5
5
|
import type { Story, Variant } from '../../types'
|
|
@@ -7,7 +7,7 @@ import BaseEmpty from '../base/BaseEmpty.vue'
|
|
|
7
7
|
import StatePresets from './StatePresets.vue'
|
|
8
8
|
import ControlsComponentProps from './ControlsComponentProps.vue'
|
|
9
9
|
|
|
10
|
-
defineProps({
|
|
10
|
+
const props = defineProps({
|
|
11
11
|
variant: {
|
|
12
12
|
type: Object as PropType<Variant>,
|
|
13
13
|
required: true,
|
|
@@ -18,6 +18,13 @@ defineProps({
|
|
|
18
18
|
required: true,
|
|
19
19
|
},
|
|
20
20
|
})
|
|
21
|
+
|
|
22
|
+
// Wait for controls render before applying presets
|
|
23
|
+
const ready = ref(false)
|
|
24
|
+
|
|
25
|
+
watch(() => props.variant, () => {
|
|
26
|
+
ready.value = false
|
|
27
|
+
})
|
|
21
28
|
</script>
|
|
22
29
|
|
|
23
30
|
<template>
|
|
@@ -30,6 +37,7 @@ defineProps({
|
|
|
30
37
|
class="htw-h-9 htw-flex-none htw-px-2 htw-flex htw-items-center"
|
|
31
38
|
>
|
|
32
39
|
<StatePresets
|
|
40
|
+
v-if="ready"
|
|
33
41
|
:story="story"
|
|
34
42
|
:variant="variant"
|
|
35
43
|
/>
|
|
@@ -38,10 +46,12 @@ defineProps({
|
|
|
38
46
|
<!-- Custom controls -->
|
|
39
47
|
<GenericRenderStory
|
|
40
48
|
v-if="variant.slots().controls || story.slots().controls"
|
|
49
|
+
:key="`${story.id}-${variant.id}`"
|
|
41
50
|
slot-name="controls"
|
|
42
51
|
:variant="variant"
|
|
43
52
|
:story="story"
|
|
44
53
|
class="htw-flex-none"
|
|
54
|
+
@ready="ready = true"
|
|
45
55
|
/>
|
|
46
56
|
|
|
47
57
|
<BaseEmpty v-else-if="!variant.state?._hPropDefs?.length">
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export default {
|
|
3
|
+
inheritAttrs: false,
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<script lang="ts" setup>
|
|
2
8
|
// @ts-expect-error virtual module
|
|
3
9
|
import { clientSupportPlugins } from 'virtual:$histoire-support-plugins-client'
|
|
@@ -24,5 +30,6 @@ watchEffect(async () => {
|
|
|
24
30
|
:is="mountComponent"
|
|
25
31
|
v-if="mountComponent"
|
|
26
32
|
:story="story"
|
|
33
|
+
v-bind="$attrs"
|
|
27
34
|
/>
|
|
28
35
|
</template>
|