@histoire/app 0.9.0 → 0.9.3
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/components/panel/StorySourceCode.js +16 -12
- package/dist/bundled/components/search/SearchPane.js +1 -1
- package/dist/bundled/components/story/StoryResponsivePreview.js +6 -5
- package/dist/bundled/components/story/StoryVariantGridItem.js +4 -4
- package/dist/bundled/style.css +5 -5
- package/package.json +4 -4
- package/src/app/components/panel/StorySourceCode.vue +13 -4
- package/src/app/components/search/SearchPane.vue +1 -1
- package/src/app/components/story/StoryResponsivePreview.vue +1 -1
- package/src/app/components/story/StoryVariantGridItem.vue +1 -1
|
@@ -6,7 +6,7 @@ import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
|
6
6
|
import { isDark } from "../../util/dark.js";
|
|
7
7
|
import "./StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
8
8
|
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
9
|
+
const _withScopeId = (n) => (pushScopeId("data-v-ed3a82aa"), n = n(), popScopeId(), n);
|
|
10
10
|
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
11
|
const _hoisted_2 = {
|
|
12
12
|
key: 0,
|
|
@@ -18,13 +18,17 @@ const _hoisted_5 = {
|
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "htw-text-red-500 htw-h-full htw-p-2 htw-overflow-auto htw-font-mono htw-text-sm"
|
|
20
20
|
};
|
|
21
|
-
const _hoisted_6 =
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const _hoisted_6 = {
|
|
22
|
+
key: 2,
|
|
23
|
+
class: "htw-opacity-50 htw-p-4"
|
|
24
|
+
};
|
|
25
|
+
const _hoisted_7 = ["value"];
|
|
26
|
+
const _hoisted_8 = {
|
|
27
|
+
key: 4,
|
|
24
28
|
class: "htw-w-full htw-h-full htw-overflow-auto",
|
|
25
29
|
"data-test-id": "story-source-code"
|
|
26
30
|
};
|
|
27
|
-
const
|
|
31
|
+
const _hoisted_9 = ["innerHTML"];
|
|
28
32
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
29
33
|
__name: "StorySourceCode",
|
|
30
34
|
props: {
|
|
@@ -84,10 +88,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
88
|
});
|
|
85
89
|
const sourceHtml = computed(() => {
|
|
86
90
|
var _a;
|
|
87
|
-
return (_a = highlighter.value) == null ? void 0 : _a.codeToHtml(sourceCode.value, {
|
|
91
|
+
return sourceCode.value ? (_a = highlighter.value) == null ? void 0 : _a.codeToHtml(sourceCode.value, {
|
|
88
92
|
lang: "html",
|
|
89
93
|
theme: isDark.value ? "github-dark" : "github-light"
|
|
90
|
-
});
|
|
94
|
+
}) : "";
|
|
91
95
|
});
|
|
92
96
|
return (_ctx, _cache) => {
|
|
93
97
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -99,21 +103,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
103
|
class: "htw-flex-none"
|
|
100
104
|
}, null, 8, ["content"])
|
|
101
105
|
])) : createCommentVNode("", true),
|
|
102
|
-
error.value ? (openBlock(), createElementBlock("div", _hoisted_5, " Error: " + toDisplayString(error.value), 1)) : !unref(sourceHtml) ? (openBlock(), createElementBlock("textarea", {
|
|
103
|
-
key:
|
|
106
|
+
error.value ? (openBlock(), createElementBlock("div", _hoisted_5, " Error: " + toDisplayString(error.value), 1)) : !sourceCode.value ? (openBlock(), createElementBlock("i", _hoisted_6, " Not available ")) : !unref(sourceHtml) ? (openBlock(), createElementBlock("textarea", {
|
|
107
|
+
key: 3,
|
|
104
108
|
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",
|
|
105
109
|
value: sourceCode.value,
|
|
106
110
|
readonly: "",
|
|
107
111
|
"data-test-id": "story-source-code"
|
|
108
|
-
}, null, 8,
|
|
112
|
+
}, null, 8, _hoisted_7)) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
109
113
|
createElementVNode("div", {
|
|
110
114
|
class: "__histoire-code htw-p-4 htw-w-fit",
|
|
111
115
|
innerHTML: unref(sourceHtml)
|
|
112
|
-
}, null, 8,
|
|
116
|
+
}, null, 8, _hoisted_9)
|
|
113
117
|
]))
|
|
114
118
|
]);
|
|
115
119
|
};
|
|
116
120
|
}
|
|
117
121
|
});
|
|
118
|
-
var StorySourceCode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
122
|
+
var StorySourceCode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ed3a82aa"]]);
|
|
119
123
|
export { StorySourceCode as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createTextVNode, defineComponent, ref, watch, computed, openBlock, createElementBlock, Fragment, createElementVNode, createVNode, unref, withDirectives, withKeys, withModifiers, vModelText, createBlock, withCtx, renderList, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
2
|
import { useFocus, useDebounce } from "@histoire/vendors/vue-use";
|
|
3
3
|
import { Icon } from "@histoire/vendors/iconify";
|
|
4
|
-
import flexsearch from "flexsearch";
|
|
4
|
+
import * as flexsearch from "flexsearch";
|
|
5
5
|
import charset from "../../node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js";
|
|
6
6
|
import language from "../../node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js";
|
|
7
7
|
import { useStoryStore } from "../../stores/story.js";
|
|
@@ -6,7 +6,7 @@ import CheckerboardPattern from "../misc/CheckerboardPattern.js";
|
|
|
6
6
|
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
7
7
|
import "./StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
8
8
|
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
9
|
+
const _withScopeId = (n) => (pushScopeId("data-v-4514e446"), n = n(), popScopeId(), n);
|
|
10
10
|
const _hoisted_1 = { class: "htw-w-full htw-h-full htw-flex-1 htw-border htw-border-gray-100 dark:htw-border-gray-800 htw-rounded-lg htw-relative htw-overflow-hidden" };
|
|
11
11
|
const _hoisted_2 = {
|
|
12
12
|
key: 0,
|
|
@@ -15,7 +15,7 @@ const _hoisted_2 = {
|
|
|
15
15
|
const _hoisted_3 = { class: "htw-p-4 htw-h-full htw-relative" };
|
|
16
16
|
const _hoisted_4 = { class: "htw-w-full htw-h-full htw-border htw-border-gray-100 dark:htw-border-gray-800 htw-rounded-sm htw-relative" };
|
|
17
17
|
const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bind-preview-bg htw-absolute htw-inset-0" }, null, -1));
|
|
18
|
-
const _hoisted_6 = /* @__PURE__ */ createStaticVNode('<div class="htw-absolute htw-top-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-
|
|
18
|
+
const _hoisted_6 = /* @__PURE__ */ createStaticVNode('<div class="htw-absolute htw-top-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-top-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-bottom-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-bottom-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-left-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-left-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-right-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-right-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div>', 8);
|
|
19
19
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
20
|
__name: "StoryResponsivePreview",
|
|
21
21
|
props: {
|
|
@@ -24,7 +24,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
setup(__props) {
|
|
25
25
|
const props = __props;
|
|
26
26
|
useCssVars((_ctx) => ({
|
|
27
|
-
"
|
|
27
|
+
"65757cd6": unref(settings).backgroundColor
|
|
28
28
|
}));
|
|
29
29
|
const settings = usePreviewSettingsStore().currentSettings;
|
|
30
30
|
const resizing = ref(false);
|
|
@@ -43,10 +43,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
43
|
}
|
|
44
44
|
function useDragger(el, value, min, max, axis) {
|
|
45
45
|
function onMouseDown(event) {
|
|
46
|
+
var _a;
|
|
46
47
|
event.preventDefault();
|
|
47
48
|
event.stopPropagation();
|
|
48
49
|
const start = axis === "x" ? event.clientX : event.clientY;
|
|
49
|
-
const startValue = value.value;
|
|
50
|
+
const startValue = (_a = value.value) != null ? _a : axis === "x" ? previewWrapper.value.clientWidth - 67 : previewWrapper.value.clientHeight - 70;
|
|
50
51
|
resizing.value = true;
|
|
51
52
|
const removeListeners = [
|
|
52
53
|
addWindowListener("mousemove", onMouseMove),
|
|
@@ -176,5 +177,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
});
|
|
179
|
-
var StoryResponsivePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
180
|
+
var StoryResponsivePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4514e446"]]);
|
|
180
181
|
export { StoryResponsivePreview as default };
|
|
@@ -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-feb5bbb0"), 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
|
+
"7761d6aa": unref(variant).iconColor
|
|
31
31
|
}));
|
|
32
32
|
const { variant } = toRefs(props);
|
|
33
33
|
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
@@ -89,7 +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
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"
|
|
92
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"])),
|
|
93
93
|
onKeyup: _cache[1] || (_cache[1] = ($event) => selectVariant())
|
|
94
94
|
}, [
|
|
95
95
|
createVNode(_sfc_main$1, {
|
|
@@ -102,5 +102,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
|
-
var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
105
|
+
var StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-feb5bbb0"]]);
|
|
106
106
|
export { StoryVariantGridItem as default };
|
package/dist/bundled/style.css
CHANGED
|
@@ -76,21 +76,21 @@
|
|
|
76
76
|
color: var(--0589c2c6);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
.__histoire-code-placeholder[data-v-
|
|
79
|
+
.__histoire-code-placeholder[data-v-ed3a82aa] {
|
|
80
80
|
color: inherit;
|
|
81
81
|
font-size: inherit;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.bind-icon-color[data-v-
|
|
85
|
-
color: var(--
|
|
84
|
+
.bind-icon-color[data-v-feb5bbb0] {
|
|
85
|
+
color: var(--7761d6aa);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.bind-preview-bg[data-v-bc4883a4] {
|
|
89
89
|
background-color: var(--6bcdf233);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.bind-preview-bg[data-v-
|
|
93
|
-
background-color: var(--
|
|
92
|
+
.bind-preview-bg[data-v-4514e446] {
|
|
93
|
+
background-color: var(--65757cd6);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.__histoire-hatched-pattern[data-v-0bb8c4e8] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/app",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
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.3",
|
|
28
|
+
"@histoire/shared": "^0.9.3",
|
|
29
|
+
"@histoire/vendors": "^0.9.3",
|
|
30
30
|
"@types/flexsearch": "^0.7.3",
|
|
31
31
|
"flexsearch": "^0.7.21",
|
|
32
32
|
"shiki": "0.10.1"
|
|
@@ -64,10 +64,12 @@ watch(() => [props.variant, generateSourceCodeFn.value], async () => {
|
|
|
64
64
|
immediate: true,
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
const sourceHtml = computed(() =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const sourceHtml = computed(() => sourceCode.value
|
|
68
|
+
? highlighter.value?.codeToHtml(sourceCode.value, {
|
|
69
|
+
lang: 'html',
|
|
70
|
+
theme: isDark.value ? 'github-dark' : 'github-light',
|
|
71
|
+
})
|
|
72
|
+
: '')
|
|
71
73
|
</script>
|
|
72
74
|
|
|
73
75
|
<template>
|
|
@@ -96,6 +98,13 @@ const sourceHtml = computed(() => highlighter.value?.codeToHtml(sourceCode.value
|
|
|
96
98
|
Error: {{ error }}
|
|
97
99
|
</div>
|
|
98
100
|
|
|
101
|
+
<i
|
|
102
|
+
v-else-if="!sourceCode"
|
|
103
|
+
class="htw-opacity-50 htw-p-4"
|
|
104
|
+
>
|
|
105
|
+
Not available
|
|
106
|
+
</i>
|
|
107
|
+
|
|
99
108
|
<textarea
|
|
100
109
|
v-else-if="!sourceHtml"
|
|
101
110
|
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"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useFocus, useDebounce } from '@vueuse/core'
|
|
3
3
|
import { computed, ref, watch } from 'vue'
|
|
4
4
|
import { Icon } from '@iconify/vue'
|
|
5
|
-
import flexsearch from 'flexsearch'
|
|
5
|
+
import * as flexsearch from 'flexsearch'
|
|
6
6
|
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'
|
|
@@ -37,7 +37,7 @@ function useDragger (el: Ref<HTMLDivElement>, value: Ref<number>, min: number, m
|
|
|
37
37
|
event.preventDefault()
|
|
38
38
|
event.stopPropagation()
|
|
39
39
|
const start = axis === 'x' ? event.clientX : event.clientY
|
|
40
|
-
const startValue = value.value
|
|
40
|
+
const startValue = value.value ?? (axis === 'x' ? previewWrapper.value.clientWidth - 67 : previewWrapper.value.clientHeight - 70)
|
|
41
41
|
resizing.value = true
|
|
42
42
|
|
|
43
43
|
const removeListeners = [
|
|
@@ -91,7 +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
|
-
@click.stop
|
|
94
|
+
@click.stop="selectVariant()"
|
|
95
95
|
@keyup="selectVariant()"
|
|
96
96
|
>
|
|
97
97
|
<GenericRenderStory
|