@histoire/app 0.16.1 → 0.16.5
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 +2 -2
- package/dist/bundled/components/HomeView.vue2.js +2 -2
- package/dist/bundled/components/app/AppHeader.vue2.js +1 -1
- package/dist/bundled/components/app/AppLogo.vue2.js +3 -3
- package/dist/bundled/components/app/Breadcrumb.vue2.js +13 -13
- package/dist/bundled/components/app/MobileOverlay.vue2.js +5 -5
- package/dist/bundled/components/base/BaseButton.vue2.js +7 -7
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +2 -2
- package/dist/bundled/components/base/BaseIcon.vue2.js +6 -6
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +3 -3
- package/dist/bundled/components/base/BaseListItem.vue2.js +1 -1
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +4 -4
- package/dist/bundled/components/base/BaseSelect.vue2.js +8 -8
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +4 -4
- package/dist/bundled/components/command/CommandPrompts.vue2.js +3 -3
- package/dist/bundled/components/command/PromptSelect.vue2.js +14 -14
- package/dist/bundled/components/command/PromptText.vue2.js +11 -11
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +9 -9
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +6 -6
- package/dist/bundled/components/panel/PaneTabs.vue2.js +4 -4
- package/dist/bundled/components/panel/StatePresets.vue2.js +7 -7
- package/dist/bundled/components/panel/StoryControls.vue2.js +3 -3
- package/dist/bundled/components/panel/StoryDocs.vue2.js +3 -3
- package/dist/bundled/components/panel/StoryEvent.vue2.js +5 -5
- package/dist/bundled/components/panel/StoryEvents.vue2.js +2 -2
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +1 -1
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +7 -7
- package/dist/bundled/components/search/SearchItemContent.vue2.js +11 -11
- package/dist/bundled/components/search/SearchPane.vue2.js +3 -3
- package/dist/bundled/components/story/GenericMountStory.vue2.js +2 -2
- package/dist/bundled/components/story/GenericRenderStory.vue2.js +2 -2
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +12 -12
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +3 -3
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +2 -2
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +9 -9
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +9 -9
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +5 -5
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +12 -12
- package/dist/bundled/components/story/StoryViewer.vue2.js +2 -2
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +4 -4
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +2 -2
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +4 -4
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +4 -4
- package/dist/bundled/components/tree/StoryGroup.vue2.js +10 -10
- package/dist/bundled/components/tree/StoryList.vue2.js +6 -6
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +13 -13
- package/dist/bundled/components/tree/StoryListItem.vue2.js +10 -10
- package/dist/bundled/style.css +16 -16
- package/dist/style.css +537 -528
- package/package.json +15 -15
- package/src/app/components/app/MobileOverlay.vue +2 -2
- package/src/app/components/base/BaseSelect.vue +3 -3
|
@@ -15,15 +15,15 @@ const _hoisted_3 = {
|
|
|
15
15
|
const _hoisted_4 = { class: "htw-flex-1 htw-truncate" };
|
|
16
16
|
const _hoisted_5 = { class: "htw-flex htw-gap-2 htw-items-center" };
|
|
17
17
|
const _hoisted_6 = { class: "htw-flex-1 htw-truncate" };
|
|
18
|
+
const DEFAULT_ID = "default";
|
|
18
19
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
20
|
__name: "StatePresets",
|
|
20
21
|
props: {
|
|
21
|
-
story:
|
|
22
|
-
variant:
|
|
22
|
+
story: {},
|
|
23
|
+
variant: {}
|
|
23
24
|
},
|
|
24
25
|
setup(__props) {
|
|
25
26
|
const props = __props;
|
|
26
|
-
const DEFAULT_ID = "default";
|
|
27
27
|
const saveId = computed(() => `${props.story.id}:${props.variant.id}`);
|
|
28
28
|
const omitKeys = ["_hPropDefs"];
|
|
29
29
|
const defaultState = clone(omit(toRawDeep(props.variant.state), omitKeys));
|
|
@@ -114,7 +114,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
114
114
|
createVNode(_sfc_main$1, {
|
|
115
115
|
modelValue: unref(selectedOption),
|
|
116
116
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(selectedOption) ? selectedOption.value = $event : null),
|
|
117
|
-
options:
|
|
117
|
+
options: presetsOptions.value,
|
|
118
118
|
onDblclick: _cache[3] || (_cache[3] = ($event) => startEditing()),
|
|
119
119
|
onKeydown: [
|
|
120
120
|
_cache[4] || (_cache[4] = withKeys(($event) => stopEditing(), ["enter"])),
|
|
@@ -136,7 +136,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
136
136
|
[vModelText, unref(presetStates).get(unref(selectedOption)).label]
|
|
137
137
|
]) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
138
138
|
createElementVNode("span", _hoisted_4, toDisplayString(label), 1),
|
|
139
|
-
|
|
139
|
+
canEdit.value ? withDirectives((openBlock(), createBlock(unref(Icon), {
|
|
140
140
|
key: 0,
|
|
141
141
|
icon: "carbon:edit",
|
|
142
142
|
class: "htw-flex-none htw-cursor-pointer htw-w-4 htw-h-4 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100",
|
|
@@ -165,11 +165,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
165
165
|
withDirectives(createVNode(unref(Icon), {
|
|
166
166
|
icon: savedNotif.value ? "carbon:checkmark" : "carbon:save",
|
|
167
167
|
class: normalizeClass(["htw-cursor-pointer htw-w-4 htw-h-4 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100", [
|
|
168
|
-
|
|
168
|
+
canEdit.value ? "htw-opacity-50 hover:htw-opacity-100" : "htw-opacity-25 htw-pointer-events-none"
|
|
169
169
|
]]),
|
|
170
170
|
onClick: _cache[7] || (_cache[7] = ($event) => savePreset())
|
|
171
171
|
}, null, 8, ["icon", "class"]), [
|
|
172
|
-
[_directive_tooltip, savedNotif.value ? "Saved!" :
|
|
172
|
+
[_directive_tooltip, savedNotif.value ? "Saved!" : canEdit.value ? "Save to preset" : null]
|
|
173
173
|
]),
|
|
174
174
|
withDirectives(createVNode(unref(Icon), {
|
|
175
175
|
icon: "carbon:add-alt",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, computed, openBlock, createElementBlock, createElementVNode,
|
|
1
|
+
import { defineComponent, ref, watch, computed, openBlock, createElementBlock, createElementVNode, createBlock, createCommentVNode, withCtx, createVNode, unref, Fragment, renderList } from "@histoire/vendors/vue";
|
|
2
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
3
3
|
import "../story/GenericRenderStory.vue.js";
|
|
4
4
|
import BaseEmpty from "../base/BaseEmpty.vue.js";
|
|
@@ -38,13 +38,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
38
|
var _a, _b, _c, _d;
|
|
39
39
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
40
40
|
createElementVNode("div", _hoisted_2, [
|
|
41
|
-
ready.value || !
|
|
41
|
+
ready.value || !hasCustomControls.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
42
42
|
key: 0,
|
|
43
43
|
story: __props.story,
|
|
44
44
|
variant: __props.variant
|
|
45
45
|
}, null, 8, ["story", "variant"])) : createCommentVNode("", true)
|
|
46
46
|
]),
|
|
47
|
-
|
|
47
|
+
hasCustomControls.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
48
48
|
key: `${__props.story.id}-${__props.variant.id}`,
|
|
49
49
|
"slot-name": "controls",
|
|
50
50
|
variant: __props.variant,
|
|
@@ -125,15 +125,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
125
125
|
class: "histoire-story-docs",
|
|
126
126
|
onClickCapture: onClick
|
|
127
127
|
}, [
|
|
128
|
-
_ctx.__HISTOIRE_DEV__ && unref(renderedDoc) &&
|
|
128
|
+
_ctx.__HISTOIRE_DEV__ && unref(renderedDoc) && filePath.value ? (openBlock(), createElementBlock("div", {
|
|
129
129
|
key: 0,
|
|
130
130
|
class: normalizeClass(["htw-flex htw-items-center htw-gap-2 htw-p-2", {
|
|
131
131
|
"htw-pt-4": !__props.standalone
|
|
132
132
|
}])
|
|
133
133
|
}, [
|
|
134
|
-
|
|
134
|
+
filePath.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
135
135
|
key: 0,
|
|
136
|
-
file:
|
|
136
|
+
file: filePath.value,
|
|
137
137
|
tooltip: "Edit docs in editor"
|
|
138
138
|
}, null, 8, ["file"])) : createCommentVNode("", true)
|
|
139
139
|
], 2)) : createCommentVNode("", true),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, toDisplayString, createElementBlock,
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, toDisplayString, createElementBlock, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
2
|
"use strict";
|
|
3
3
|
const _hoisted_1 = {
|
|
4
4
|
key: 0,
|
|
@@ -9,7 +9,7 @@ const _hoisted_3 = { class: "htw-p-4" };
|
|
|
9
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
10
|
__name: "StoryEvent",
|
|
11
11
|
props: {
|
|
12
|
-
event:
|
|
12
|
+
event: {}
|
|
13
13
|
},
|
|
14
14
|
setup(__props) {
|
|
15
15
|
const props = __props;
|
|
@@ -40,13 +40,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
40
|
class: normalizeClass({
|
|
41
41
|
"htw-text-primary-500": shown
|
|
42
42
|
})
|
|
43
|
-
}, toDisplayString(
|
|
44
|
-
|
|
43
|
+
}, toDisplayString(_ctx.event.name), 3),
|
|
44
|
+
_ctx.event.argument ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(formattedArgument.value), 1)) : createCommentVNode("", true)
|
|
45
45
|
], 2)
|
|
46
46
|
]),
|
|
47
47
|
popper: withCtx(() => [
|
|
48
48
|
createElementVNode("div", _hoisted_2, [
|
|
49
|
-
createElementVNode("pre", _hoisted_3, toDisplayString(
|
|
49
|
+
createElementVNode("pre", _hoisted_3, toDisplayString(_ctx.event.argument), 1)
|
|
50
50
|
])
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, onMounted, watch, nextTick, ref, openBlock, createElementBlock,
|
|
1
|
+
import { defineComponent, computed, onMounted, watch, nextTick, ref, openBlock, createElementBlock, createBlock, withCtx, createVNode, unref, createTextVNode, Fragment, renderList } from "@histoire/vendors/vue";
|
|
2
2
|
import { Icon } from "@histoire/vendors/iconify";
|
|
3
3
|
import BaseEmpty from "../base/BaseEmpty.vue.js";
|
|
4
4
|
import { useEventsStore } from "../../stores/events.js";
|
|
@@ -27,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
ref: eventsElement,
|
|
28
28
|
class: "histoire-story-events"
|
|
29
29
|
}, [
|
|
30
|
-
!
|
|
30
|
+
!hasEvents.value ? (openBlock(), createBlock(BaseEmpty, { key: 0 }, {
|
|
31
31
|
default: withCtx(() => [
|
|
32
32
|
createVNode(unref(Icon), {
|
|
33
33
|
icon: "carbon:event-schedule",
|
|
@@ -61,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
story: unref(storyStore).currentStory,
|
|
62
62
|
variant: unref(storyStore).currentVariant
|
|
63
63
|
}, null, 8, ["story", "variant"]),
|
|
64
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
64
|
+
(openBlock(), createBlock(resolveDynamicComponent(panelContentComponent.value), {
|
|
65
65
|
story: unref(storyStore).currentStory,
|
|
66
66
|
variant: unref(storyStore).currentVariant,
|
|
67
67
|
class: "htw-h-full htw-overflow-auto"
|
|
@@ -26,8 +26,8 @@ const _hoisted_9 = ["innerHTML"];
|
|
|
26
26
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
27
|
__name: "StorySourceCode",
|
|
28
28
|
props: {
|
|
29
|
-
story:
|
|
30
|
-
variant:
|
|
29
|
+
story: {},
|
|
30
|
+
variant: {}
|
|
31
31
|
},
|
|
32
32
|
setup(__props) {
|
|
33
33
|
const props = __props;
|
|
@@ -174,11 +174,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
174
174
|
])
|
|
175
175
|
]),
|
|
176
176
|
createVNode(unref(HstCopyIcon), {
|
|
177
|
-
content:
|
|
177
|
+
content: displayedSourceCode.value,
|
|
178
178
|
class: "htw-flex-none"
|
|
179
179
|
}, null, 8, ["content"])
|
|
180
180
|
])) : createCommentVNode("", true),
|
|
181
|
-
error.value ? (openBlock(), createElementBlock("div", _hoisted_6, " Error: " + toDisplayString(error.value), 1)) : !
|
|
181
|
+
error.value ? (openBlock(), createElementBlock("div", _hoisted_6, " Error: " + toDisplayString(error.value), 1)) : !displayedSourceCode.value ? (openBlock(), createBlock(BaseEmpty, { key: 2 }, {
|
|
182
182
|
default: withCtx(() => [
|
|
183
183
|
createVNode(unref(Icon), {
|
|
184
184
|
icon: "carbon:code-hide",
|
|
@@ -187,12 +187,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
187
187
|
_hoisted_7
|
|
188
188
|
]),
|
|
189
189
|
_: 1
|
|
190
|
-
})) : !
|
|
190
|
+
})) : !sourceHtml.value ? (openBlock(), createElementBlock("textarea", {
|
|
191
191
|
key: 3,
|
|
192
192
|
ref_key: "scroller",
|
|
193
193
|
ref: scroller,
|
|
194
194
|
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",
|
|
195
|
-
value:
|
|
195
|
+
value: displayedSourceCode.value,
|
|
196
196
|
readonly: "",
|
|
197
197
|
"data-test-id": "story-source-code",
|
|
198
198
|
onScroll
|
|
@@ -206,7 +206,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
206
206
|
}, [
|
|
207
207
|
createElementVNode("div", {
|
|
208
208
|
class: "__histoire-code htw-p-4 htw-w-fit",
|
|
209
|
-
innerHTML:
|
|
209
|
+
innerHTML: sourceHtml.value
|
|
210
210
|
}, null, 8, _hoisted_9)
|
|
211
211
|
], 544))
|
|
212
212
|
]);
|
|
@@ -12,7 +12,7 @@ const _hoisted_4 = {
|
|
|
12
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "SearchItemContent",
|
|
14
14
|
props: {
|
|
15
|
-
result:
|
|
15
|
+
result: {},
|
|
16
16
|
selected: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
setup(__props) {
|
|
@@ -29,26 +29,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
var _a;
|
|
30
30
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
31
31
|
createVNode(BaseIcon, {
|
|
32
|
-
icon:
|
|
32
|
+
icon: _ctx.result.icon ?? defaultIcons[_ctx.result.kind],
|
|
33
33
|
class: normalizeClass(["htw-w-4 htw-h-4", [
|
|
34
|
-
!
|
|
35
|
-
|
|
36
|
-
"htw-text-primary-500":
|
|
37
|
-
"htw-text-gray-500":
|
|
34
|
+
!_ctx.selected ? [
|
|
35
|
+
_ctx.result.iconColor ? "bind-icon-color" : {
|
|
36
|
+
"htw-text-primary-500": _ctx.result.kind === "story",
|
|
37
|
+
"htw-text-gray-500": _ctx.result.kind === "variant"
|
|
38
38
|
}
|
|
39
39
|
] : [],
|
|
40
40
|
{
|
|
41
|
-
"colorize-black":
|
|
41
|
+
"colorize-black": _ctx.selected
|
|
42
42
|
}
|
|
43
43
|
]])
|
|
44
44
|
}, null, 8, ["icon", "class"]),
|
|
45
45
|
createElementVNode("div", _hoisted_1, [
|
|
46
46
|
createElementVNode("div", _hoisted_2, [
|
|
47
|
-
createTextVNode(toDisplayString(
|
|
48
|
-
createElementVNode("span", _hoisted_3, toDisplayString(kindLabels[
|
|
47
|
+
createTextVNode(toDisplayString(_ctx.result.title) + " ", 1),
|
|
48
|
+
createElementVNode("span", _hoisted_3, toDisplayString(kindLabels[_ctx.result.kind]), 1)
|
|
49
49
|
]),
|
|
50
|
-
((_a =
|
|
51
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
50
|
+
((_a = _ctx.result.path) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
51
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.result.path, (p, index) => {
|
|
52
52
|
return openBlock(), createElementBlock("div", {
|
|
53
53
|
key: index,
|
|
54
54
|
class: "htw-flex htw-items-center htw-gap-0.5"
|
|
@@ -265,7 +265,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
265
265
|
[vModelText, searchInputText.value]
|
|
266
266
|
])
|
|
267
267
|
]),
|
|
268
|
-
unref(rateLimitedSearch) && !
|
|
268
|
+
unref(rateLimitedSearch) && !results.value.length ? (openBlock(), createBlock(BaseEmpty, {
|
|
269
269
|
key: 0,
|
|
270
270
|
class: "no-animation"
|
|
271
271
|
}, {
|
|
@@ -273,8 +273,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
273
273
|
createTextVNode(" No results ")
|
|
274
274
|
]),
|
|
275
275
|
_: 1
|
|
276
|
-
})) :
|
|
277
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
276
|
+
})) : results.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
277
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(results.value, (result, index) => {
|
|
278
278
|
return openBlock(), createBlock(SearchItem, {
|
|
279
279
|
key: result.id,
|
|
280
280
|
result,
|
|
@@ -8,7 +8,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
8
|
...__default__,
|
|
9
9
|
__name: "GenericMountStory",
|
|
10
10
|
props: {
|
|
11
|
-
story:
|
|
11
|
+
story: {}
|
|
12
12
|
},
|
|
13
13
|
setup(__props) {
|
|
14
14
|
const props = __props;
|
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "histoire-generic-mount-story",
|
|
28
|
-
story:
|
|
28
|
+
story: _ctx.story
|
|
29
29
|
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -8,7 +8,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
8
|
...__default__,
|
|
9
9
|
__name: "GenericRenderStory",
|
|
10
10
|
props: {
|
|
11
|
-
story:
|
|
11
|
+
story: {}
|
|
12
12
|
},
|
|
13
13
|
setup(__props) {
|
|
14
14
|
const props = __props;
|
|
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "histoire-generic-render-story __histoire-render-story",
|
|
33
|
-
story:
|
|
33
|
+
story: _ctx.story
|
|
34
34
|
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -23,7 +23,7 @@ const _hoisted_7 = /* @__PURE__ */ createStaticVNode('<div class="htw-absolute h
|
|
|
23
23
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
24
|
__name: "StoryResponsivePreview",
|
|
25
25
|
props: {
|
|
26
|
-
variant:
|
|
26
|
+
variant: {}
|
|
27
27
|
},
|
|
28
28
|
setup(__props) {
|
|
29
29
|
const props = __props;
|
|
@@ -118,7 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
118
118
|
const sizeTooltip = computed(() => (responsiveWidth.value ?? "Auto") + " × " + (responsiveHeight.value ?? "Auto"));
|
|
119
119
|
return (_ctx, _cache) => {
|
|
120
120
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
121
|
-
|
|
121
|
+
isResponsiveEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
122
122
|
createVNode(HatchedPattern, { class: "htw-w-full htw-h-full htw-text-black/[1%] dark:htw-text-white/[1%]" })
|
|
123
123
|
])) : createCommentVNode("", true),
|
|
124
124
|
createElementVNode("div", {
|
|
@@ -127,9 +127,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
127
127
|
class: "htw-h-full htw-overflow-auto htw-relative"
|
|
128
128
|
}, [
|
|
129
129
|
createElementVNode("div", {
|
|
130
|
-
class: normalizeClass(["htw-h-full htw-overflow-hidden htw-bg-white dark:htw-bg-gray-700 htw-rounded-lg htw-relative",
|
|
131
|
-
"htw-w-fit": !!
|
|
132
|
-
"htw-h-fit": !!
|
|
130
|
+
class: normalizeClass(["htw-h-full htw-overflow-hidden htw-bg-white dark:htw-bg-gray-700 htw-rounded-lg htw-relative", isResponsiveEnabled.value ? {
|
|
131
|
+
"htw-w-fit": !!finalWidth.value,
|
|
132
|
+
"htw-h-fit": !!finalHeight.value
|
|
133
133
|
} : void 0])
|
|
134
134
|
}, [
|
|
135
135
|
createElementVNode("div", _hoisted_3, [
|
|
@@ -141,15 +141,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
141
141
|
createElementVNode("div", _hoisted_5, [
|
|
142
142
|
_hoisted_6,
|
|
143
143
|
renderSlot(_ctx.$slots, "default", {
|
|
144
|
-
isResponsiveEnabled:
|
|
145
|
-
finalWidth:
|
|
146
|
-
finalHeight:
|
|
144
|
+
isResponsiveEnabled: isResponsiveEnabled.value,
|
|
145
|
+
finalWidth: finalWidth.value,
|
|
146
|
+
finalHeight: finalHeight.value,
|
|
147
147
|
resizing: resizing.value
|
|
148
148
|
}, void 0, true)
|
|
149
149
|
]),
|
|
150
150
|
_hoisted_7
|
|
151
151
|
]),
|
|
152
|
-
|
|
152
|
+
isResponsiveEnabled.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
153
153
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
154
154
|
ref_key: "horizontalDragger",
|
|
155
155
|
ref: horizontalDragger,
|
|
@@ -162,7 +162,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
162
162
|
])), [
|
|
163
163
|
[
|
|
164
164
|
unref(VTooltip),
|
|
165
|
-
|
|
165
|
+
sizeTooltip.value,
|
|
166
166
|
void 0,
|
|
167
167
|
{ right: true }
|
|
168
168
|
]
|
|
@@ -179,7 +179,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
179
179
|
])), [
|
|
180
180
|
[
|
|
181
181
|
unref(VTooltip),
|
|
182
|
-
|
|
182
|
+
sizeTooltip.value,
|
|
183
183
|
void 0,
|
|
184
184
|
{ bottom: true }
|
|
185
185
|
]
|
|
@@ -191,7 +191,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
191
191
|
}, null, 512), [
|
|
192
192
|
[
|
|
193
193
|
unref(VTooltip),
|
|
194
|
-
|
|
194
|
+
sizeTooltip.value,
|
|
195
195
|
void 0,
|
|
196
196
|
{ bottom: true }
|
|
197
197
|
]
|
|
@@ -15,6 +15,8 @@ const _hoisted_2 = {
|
|
|
15
15
|
class: "htw-flex-none htw-flex htw-items-center htw-justify-end htw-h-8 htw-mx-2 htw-mt-1"
|
|
16
16
|
};
|
|
17
17
|
const _hoisted_3 = { class: "htw-flex htw-w-0 htw-flex-1 htw-mx-4" };
|
|
18
|
+
const margin = 16;
|
|
19
|
+
const gap = 16;
|
|
18
20
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
21
|
__name: "StoryVariantGrid",
|
|
20
22
|
setup(__props) {
|
|
@@ -32,8 +34,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
34
|
}
|
|
33
35
|
return layoutWidth;
|
|
34
36
|
});
|
|
35
|
-
const margin = 16;
|
|
36
|
-
const gap = 16;
|
|
37
37
|
const itemWidth = ref(16);
|
|
38
38
|
const maxItemHeight = ref(0);
|
|
39
39
|
const maxCount = ref(10);
|
|
@@ -126,7 +126,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
126
|
ref: gridEl,
|
|
127
127
|
class: "htw-grid htw-gap-4 htw-my-4",
|
|
128
128
|
style: normalizeStyle({
|
|
129
|
-
gridTemplateColumns: `repeat(${
|
|
129
|
+
gridTemplateColumns: `repeat(${columnCount.value}, ${gridColumnWidth.value}px)`
|
|
130
130
|
})
|
|
131
131
|
}, [
|
|
132
132
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants.slice(0, maxCount.value), (variant, index) => {
|
|
@@ -130,8 +130,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
130
130
|
createElementVNode("div", {
|
|
131
131
|
class: "htw-relative htw-h-full",
|
|
132
132
|
style: normalizeStyle({
|
|
133
|
-
"--histoire-contrast-color":
|
|
134
|
-
color:
|
|
133
|
+
"--histoire-contrast-color": contrastColor.value,
|
|
134
|
+
color: autoApplyContrastColor.value ? contrastColor.value : void 0
|
|
135
135
|
})
|
|
136
136
|
}, [
|
|
137
137
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useCssVars,
|
|
1
|
+
import { defineComponent, useCssVars, computed, openBlock, createElementBlock, createVNode, unref, Fragment, createElementVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, createBlock, withCtx, renderList, pushScopeId, popScopeId } from "@histoire/vendors/vue";
|
|
2
2
|
import { useStoryStore } from "../../stores/story.js";
|
|
3
3
|
import { Icon } from "@histoire/vendors/iconify";
|
|
4
4
|
import { isMobile } from "../../util/responsive.js";
|
|
@@ -34,7 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
34
|
useCssVars((_ctx) => {
|
|
35
35
|
var _a;
|
|
36
36
|
return {
|
|
37
|
-
"4d25d048": (_a =
|
|
37
|
+
"4d25d048": (_a = variant.value) == null ? void 0 : _a.iconColor
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
40
|
const storyStore = useStoryStore();
|
|
@@ -44,9 +44,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
});
|
|
45
45
|
const variant = computed(() => storyStore.currentVariant);
|
|
46
46
|
return (_ctx, _cache) => {
|
|
47
|
-
return
|
|
47
|
+
return hasSingleVariant.value && variant.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
48
48
|
createVNode(_sfc_main$1, {
|
|
49
|
-
variant:
|
|
49
|
+
variant: variant.value,
|
|
50
50
|
story: unref(storyStore).currentStory
|
|
51
51
|
}, null, 8, ["variant", "story"])
|
|
52
52
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
@@ -55,15 +55,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
55
|
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none",
|
|
56
56
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("open-variant-menu"))
|
|
57
57
|
}, [
|
|
58
|
-
|
|
58
|
+
variant.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
59
59
|
createVNode(unref(Icon), {
|
|
60
|
-
icon:
|
|
60
|
+
icon: variant.value.icon ?? "carbon:cube",
|
|
61
61
|
class: normalizeClass(["htw-w-5 htw-h-5 htw-flex-none", {
|
|
62
|
-
"htw-text-gray-500": !
|
|
63
|
-
"bind-icon-color":
|
|
62
|
+
"htw-text-gray-500": !variant.value.iconColor,
|
|
63
|
+
"bind-icon-color": variant.value.iconColor
|
|
64
64
|
}])
|
|
65
65
|
}, null, 8, ["icon", "class"]),
|
|
66
|
-
createTextVNode(" " + toDisplayString(
|
|
66
|
+
createTextVNode(" " + toDisplayString(variant.value.title), 1)
|
|
67
67
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
68
68
|
createTextVNode(" Select a variant... ")
|
|
69
69
|
], 64)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle,
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, normalizeClass, unref } from "@histoire/vendors/vue";
|
|
2
2
|
import { isDark } from "../../util/dark.js";
|
|
3
3
|
import { histoireConfig } from "../../util/config.js";
|
|
4
4
|
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
@@ -10,8 +10,8 @@ import _sfc_main$1 from "./GenericRenderStory.vue2.js";
|
|
|
10
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
11
|
__name: "StoryVariantSinglePreviewNative",
|
|
12
12
|
props: {
|
|
13
|
-
story:
|
|
14
|
-
variant:
|
|
13
|
+
story: {},
|
|
14
|
+
variant: {}
|
|
15
15
|
},
|
|
16
16
|
setup(__props) {
|
|
17
17
|
const props = __props;
|
|
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
return (_ctx, _cache) => {
|
|
30
30
|
return openBlock(), createBlock(StoryResponsivePreview, {
|
|
31
31
|
class: "histoire-story-variant-single-preview-native",
|
|
32
|
-
variant:
|
|
32
|
+
variant: _ctx.variant
|
|
33
33
|
}, {
|
|
34
34
|
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight }) => [
|
|
35
35
|
createElementVNode("div", {
|
|
@@ -39,17 +39,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
40
40
|
} : { width: "100%", height: "100%" },
|
|
41
41
|
{
|
|
42
|
-
"--histoire-contrast-color":
|
|
43
|
-
color:
|
|
42
|
+
"--histoire-contrast-color": contrastColor.value,
|
|
43
|
+
color: autoApplyContrastColor.value ? contrastColor.value : void 0
|
|
44
44
|
}
|
|
45
45
|
]),
|
|
46
46
|
class: "htw-relative",
|
|
47
47
|
"data-test-id": "sandbox-render"
|
|
48
48
|
}, [
|
|
49
49
|
(openBlock(), createBlock(_sfc_main$1, {
|
|
50
|
-
key: `${
|
|
51
|
-
variant:
|
|
52
|
-
story:
|
|
50
|
+
key: `${_ctx.story.id}-${_ctx.variant.id}`,
|
|
51
|
+
variant: _ctx.variant,
|
|
52
|
+
story: _ctx.story,
|
|
53
53
|
class: normalizeClass(["htw-h-full", {
|
|
54
54
|
[unref(histoireConfig).sandboxDarkClass]: unref(isDark),
|
|
55
55
|
// @TODO remove
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, computed, openBlock, createBlock, withCtx, createElementVNode,
|
|
1
|
+
import { defineComponent, ref, watch, computed, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, toRaw } from "@histoire/vendors/vue";
|
|
2
2
|
import { useEventListener } from "@histoire/vendors/vue-use";
|
|
3
3
|
import { applyState } from "@histoire/shared";
|
|
4
4
|
import { SANDBOX_READY, EVENT_SEND, STATE_SYNC, PREVIEW_SETTINGS_SYNC } from "../../util/const.js";
|
|
@@ -12,8 +12,8 @@ const _hoisted_1 = ["src"];
|
|
|
12
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "StoryVariantSinglePreviewRemote",
|
|
14
14
|
props: {
|
|
15
|
-
story:
|
|
16
|
-
variant:
|
|
15
|
+
story: {},
|
|
16
|
+
variant: {}
|
|
17
17
|
},
|
|
18
18
|
setup(__props) {
|
|
19
19
|
const props = __props;
|
|
@@ -99,13 +99,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
99
|
return (_ctx, _cache) => {
|
|
100
100
|
return openBlock(), createBlock(StoryResponsivePreview, {
|
|
101
101
|
class: "histoire-story-variant-single-preview-remote",
|
|
102
|
-
variant:
|
|
102
|
+
variant: _ctx.variant
|
|
103
103
|
}, {
|
|
104
104
|
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight, resizing }) => [
|
|
105
105
|
createElementVNode("iframe", {
|
|
106
106
|
ref_key: "iframe",
|
|
107
107
|
ref: iframe,
|
|
108
|
-
src:
|
|
108
|
+
src: sandboxUrl.value,
|
|
109
109
|
class: normalizeClass(["htw-w-full htw-h-full htw-relative", {
|
|
110
110
|
"htw-invisible": !isIframeLoaded.value,
|
|
111
111
|
"htw-pointer-events-none": resizing
|
|
@@ -27,36 +27,36 @@ const _hoisted_2 = {
|
|
|
27
27
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
28
|
__name: "StoryVariantSingleView",
|
|
29
29
|
props: {
|
|
30
|
-
variant:
|
|
31
|
-
story:
|
|
30
|
+
variant: {},
|
|
31
|
+
story: {}
|
|
32
32
|
},
|
|
33
33
|
setup(__props) {
|
|
34
34
|
return (_ctx, _cache) => {
|
|
35
35
|
var _a, _b;
|
|
36
36
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
37
37
|
!unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
38
|
-
createVNode(_sfc_main$1, { variant:
|
|
39
|
-
!
|
|
38
|
+
createVNode(_sfc_main$1, { variant: _ctx.variant }, null, 8, ["variant"]),
|
|
39
|
+
!_ctx.variant.responsiveDisabled ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true),
|
|
40
40
|
createVNode(ToolbarBackground),
|
|
41
41
|
createVNode(_sfc_main$3),
|
|
42
42
|
createVNode(_sfc_main$4, {
|
|
43
|
-
variant:
|
|
44
|
-
story:
|
|
43
|
+
variant: _ctx.variant,
|
|
44
|
+
story: _ctx.story
|
|
45
45
|
}, null, 8, ["variant", "story"]),
|
|
46
46
|
_ctx.__HISTOIRE_DEV__ ? (openBlock(), createBlock(_sfc_main$5, {
|
|
47
47
|
key: 1,
|
|
48
|
-
file: (_a =
|
|
48
|
+
file: (_a = _ctx.story.file) == null ? void 0 : _a.filePath,
|
|
49
49
|
tooltip: "Edit story in editor"
|
|
50
50
|
}, null, 8, ["file"])) : createCommentVNode("", true)
|
|
51
51
|
])) : createCommentVNode("", true),
|
|
52
|
-
((_b =
|
|
52
|
+
((_b = _ctx.story.layout) == null ? void 0 : _b.iframe) === false ? (openBlock(), createBlock(_sfc_main$6, {
|
|
53
53
|
key: 1,
|
|
54
|
-
story:
|
|
55
|
-
variant:
|
|
54
|
+
story: _ctx.story,
|
|
55
|
+
variant: _ctx.variant
|
|
56
56
|
}, null, 8, ["story", "variant"])) : (openBlock(), createBlock(_sfc_main$7, {
|
|
57
57
|
key: 2,
|
|
58
|
-
story:
|
|
59
|
-
variant:
|
|
58
|
+
story: _ctx.story,
|
|
59
|
+
variant: _ctx.variant
|
|
60
60
|
}, null, 8, ["story", "variant"]))
|
|
61
61
|
]);
|
|
62
62
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useCssVars,
|
|
1
|
+
import { defineComponent, useCssVars, computed, ref, watch, openBlock, createElementBlock, Fragment, createElementVNode, unref, createBlock, createCommentVNode, createVNode, withCtx, renderList, pushScopeId, popScopeId } from "@histoire/vendors/vue";
|
|
2
2
|
import { useStoryStore } from "../../stores/story.js";
|
|
3
3
|
import StoryVariantListItem from "./StoryVariantListItem.vue.js";
|
|
4
4
|
import "../app/MobileOverlay.vue.js";
|
|
@@ -15,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
useCssVars((_ctx) => {
|
|
16
16
|
var _a;
|
|
17
17
|
return {
|
|
18
|
-
"663732b6": (_a =
|
|
18
|
+
"663732b6": (_a = variant.value) == null ? void 0 : _a.iconColor
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
const storyStore = useStoryStore();
|