@poveste/app 0.1.1 → 0.1.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.
Files changed (184) hide show
  1. package/dist/app/assets/poveste-text-dark.svg +15 -0
  2. package/dist/app/assets/poveste-text.svg +15 -0
  3. package/dist/app/assets/poveste.svg +14 -0
  4. package/dist/app/style/floating.pcss +34 -0
  5. package/dist/app/style/main.pcss +100 -0
  6. package/dist/app/style/sandbox.css +24 -0
  7. package/dist/app/style/transitions.pcss +51 -0
  8. package/dist/bundle-index.js +1 -0
  9. package/dist/bundle-main-dev.js +4 -0
  10. package/dist/bundle-main.js +5 -0
  11. package/dist/bundle-sandbox-dev.js +2 -0
  12. package/dist/bundle-sandbox.js +2 -0
  13. package/dist/bundled/App.vue.js +5 -0
  14. package/dist/bundled/App.vue2.js +167 -0
  15. package/dist/bundled/_virtual/_plugin-vue_export-helper.js +10 -0
  16. package/dist/bundled/api.js +12 -0
  17. package/dist/bundled/app.css +116 -0
  18. package/dist/bundled/assets/poveste-text-dark.svg.js +4 -0
  19. package/dist/bundled/assets/poveste-text.svg.js +4 -0
  20. package/dist/bundled/assets/poveste.svg.js +4 -0
  21. package/dist/bundled/components/HomeView.vue.js +5 -0
  22. package/dist/bundled/components/HomeView.vue2.js +66 -0
  23. package/dist/bundled/components/app/AppHeader.vue.js +5 -0
  24. package/dist/bundled/components/app/AppHeader.vue2.js +71 -0
  25. package/dist/bundled/components/app/AppLogo.vue.js +5 -0
  26. package/dist/bundled/components/app/AppLogo.vue2.js +29 -0
  27. package/dist/bundled/components/app/Breadcrumb.vue.js +8 -0
  28. package/dist/bundled/components/app/Breadcrumb.vue2.js +91 -0
  29. package/dist/bundled/components/app/HomeCounter.vue.js +5 -0
  30. package/dist/bundled/components/app/HomeCounter.vue2.js +42 -0
  31. package/dist/bundled/components/app/InitialLoading.vue.js +5 -0
  32. package/dist/bundled/components/app/InitialLoading.vue2.js +51 -0
  33. package/dist/bundled/components/app/MobileOverlay.vue.js +5 -0
  34. package/dist/bundled/components/app/MobileOverlay.vue2.js +45 -0
  35. package/dist/bundled/components/base/BaseButton.vue.js +5 -0
  36. package/dist/bundled/components/base/BaseButton.vue2.js +39 -0
  37. package/dist/bundled/components/base/BaseCheckbox.vue.js +5 -0
  38. package/dist/bundled/components/base/BaseCheckbox.vue2.js +78 -0
  39. package/dist/bundled/components/base/BaseEmpty.vue.js +14 -0
  40. package/dist/bundled/components/base/BaseIcon.vue.js +8 -0
  41. package/dist/bundled/components/base/BaseIcon.vue2.js +29 -0
  42. package/dist/bundled/components/base/BaseKeyboardShortcut.vue.js +5 -0
  43. package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +20 -0
  44. package/dist/bundled/components/base/BaseListItem.vue.js +5 -0
  45. package/dist/bundled/components/base/BaseListItem.vue2.js +33 -0
  46. package/dist/bundled/components/base/BaseListItemLink.vue.js +33 -0
  47. package/dist/bundled/components/base/BaseListItemLink.vue2.js +26 -0
  48. package/dist/bundled/components/base/BaseOverflowMenu.vue.js +5 -0
  49. package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +100 -0
  50. package/dist/bundled/components/base/BaseOverflowTab.vue.js +36 -0
  51. package/dist/bundled/components/base/BaseOverflowTab.vue2.js +18 -0
  52. package/dist/bundled/components/base/BaseSelect.vue.js +5 -0
  53. package/dist/bundled/components/base/BaseSelect.vue2.js +77 -0
  54. package/dist/bundled/components/base/BaseSplitPane.vue.js +8 -0
  55. package/dist/bundled/components/base/BaseSplitPane.vue2.js +183 -0
  56. package/dist/bundled/components/base/BaseTab.vue.js +36 -0
  57. package/dist/bundled/components/base/BaseTab.vue2.js +18 -0
  58. package/dist/bundled/components/base/BaseTag.vue.js +13 -0
  59. package/dist/bundled/components/command/CommandPrompts.vue.js +5 -0
  60. package/dist/bundled/components/command/CommandPrompts.vue2.js +91 -0
  61. package/dist/bundled/components/command/CommandPromptsModal.vue.js +5 -0
  62. package/dist/bundled/components/command/CommandPromptsModal.vue2.js +45 -0
  63. package/dist/bundled/components/command/PromptSelect.vue.js +5 -0
  64. package/dist/bundled/components/command/PromptSelect.vue2.js +142 -0
  65. package/dist/bundled/components/command/PromptText.vue.js +5 -0
  66. package/dist/bundled/components/command/PromptText.vue2.js +67 -0
  67. package/dist/bundled/components/misc/CheckerboardPattern.vue.js +40 -0
  68. package/dist/bundled/components/misc/HatchedPattern.vue.js +12 -0
  69. package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +5 -0
  70. package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +72 -0
  71. package/dist/bundled/components/panel/ControlsComponentProps.vue.js +5 -0
  72. package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +45 -0
  73. package/dist/bundled/components/panel/ControlsComponentState.vue.js +5 -0
  74. package/dist/bundled/components/panel/ControlsComponentState.vue2.js +41 -0
  75. package/dist/bundled/components/panel/ControlsComponentStateItem.vue.js +5 -0
  76. package/dist/bundled/components/panel/ControlsComponentStateItem.vue2.js +46 -0
  77. package/dist/bundled/components/panel/PaneTabs.vue.js +5 -0
  78. package/dist/bundled/components/panel/PaneTabs.vue2.js +114 -0
  79. package/dist/bundled/components/panel/StatePresets.vue.js +5 -0
  80. package/dist/bundled/components/panel/StatePresets.vue2.js +193 -0
  81. package/dist/bundled/components/panel/StoryControls.vue.js +5 -0
  82. package/dist/bundled/components/panel/StoryControls.vue2.js +87 -0
  83. package/dist/bundled/components/panel/StoryDocs.vue.js +7 -0
  84. package/dist/bundled/components/panel/StoryDocs.vue2.js +161 -0
  85. package/dist/bundled/components/panel/StoryEvent.vue.js +5 -0
  86. package/dist/bundled/components/panel/StoryEvent.vue2.js +59 -0
  87. package/dist/bundled/components/panel/StoryEvents.vue.js +5 -0
  88. package/dist/bundled/components/panel/StoryEvents.vue2.js +53 -0
  89. package/dist/bundled/components/panel/StorySidePanel.vue.js +5 -0
  90. package/dist/bundled/components/panel/StorySidePanel.vue2.js +83 -0
  91. package/dist/bundled/components/panel/StorySourceCode.vue.js +8 -0
  92. package/dist/bundled/components/panel/StorySourceCode.vue2.js +204 -0
  93. package/dist/bundled/components/search/SearchItem.vue.js +8 -0
  94. package/dist/bundled/components/search/SearchItem.vue2.js +93 -0
  95. package/dist/bundled/components/search/SearchItemContent.vue.js +5 -0
  96. package/dist/bundled/components/search/SearchItemContent.vue2.js +71 -0
  97. package/dist/bundled/components/search/SearchLoading.vue.js +5 -0
  98. package/dist/bundled/components/search/SearchLoading.vue2.js +21 -0
  99. package/dist/bundled/components/search/SearchModal.vue.js +5 -0
  100. package/dist/bundled/components/search/SearchModal.vue2.js +51 -0
  101. package/dist/bundled/components/search/SearchPane.vue.js +5 -0
  102. package/dist/bundled/components/search/SearchPane.vue2.js +272 -0
  103. package/dist/bundled/components/search/search-docs-data.js +11 -0
  104. package/dist/bundled/components/search/search-title-data.js +11 -0
  105. package/dist/bundled/components/story/GenericMountStory.vue.js +5 -0
  106. package/dist/bundled/components/story/GenericMountStory.vue2.js +34 -0
  107. package/dist/bundled/components/story/GenericRenderStory.vue.js +5 -0
  108. package/dist/bundled/components/story/GenericRenderStory.vue2.js +39 -0
  109. package/dist/bundled/components/story/StoryResponsivePreview.vue.js +8 -0
  110. package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +207 -0
  111. package/dist/bundled/components/story/StoryVariantGrid.vue.js +5 -0
  112. package/dist/bundled/components/story/StoryVariantGrid.vue2.js +146 -0
  113. package/dist/bundled/components/story/StoryVariantGridItem.vue.js +8 -0
  114. package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +155 -0
  115. package/dist/bundled/components/story/StoryVariantListItem.vue.js +8 -0
  116. package/dist/bundled/components/story/StoryVariantListItem.vue2.js +55 -0
  117. package/dist/bundled/components/story/StoryVariantSingle.vue.js +8 -0
  118. package/dist/bundled/components/story/StoryVariantSingle.vue2.js +107 -0
  119. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +5 -0
  120. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +72 -0
  121. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +5 -0
  122. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +128 -0
  123. package/dist/bundled/components/story/StoryVariantSingleView.vue.js +5 -0
  124. package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +66 -0
  125. package/dist/bundled/components/story/StoryView.vue.js +5 -0
  126. package/dist/bundled/components/story/StoryView.vue2.js +104 -0
  127. package/dist/bundled/components/story/StoryViewer.vue.js +8 -0
  128. package/dist/bundled/components/story/StoryViewer.vue2.js +55 -0
  129. package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue.js +5 -0
  130. package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +31 -0
  131. package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +8 -0
  132. package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +98 -0
  133. package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +5 -0
  134. package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +36 -0
  135. package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +5 -0
  136. package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +127 -0
  137. package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +5 -0
  138. package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +27 -0
  139. package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +5 -0
  140. package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +26 -0
  141. package/dist/bundled/components/tree/StoryGroup.vue.js +5 -0
  142. package/dist/bundled/components/tree/StoryGroup.vue2.js +74 -0
  143. package/dist/bundled/components/tree/StoryList.vue.js +5 -0
  144. package/dist/bundled/components/tree/StoryList.vue2.js +41 -0
  145. package/dist/bundled/components/tree/StoryListFolder.vue.js +8 -0
  146. package/dist/bundled/components/tree/StoryListFolder.vue2.js +86 -0
  147. package/dist/bundled/components/tree/StoryListItem.vue.js +8 -0
  148. package/dist/bundled/components/tree/StoryListItem.vue2.js +69 -0
  149. package/dist/bundled/index.js +35 -0
  150. package/dist/bundled/plugin.js +49 -0
  151. package/dist/bundled/router.js +32 -0
  152. package/dist/bundled/sandbox.js +87 -0
  153. package/dist/bundled/stores/command.js +25 -0
  154. package/dist/bundled/stores/events.js +29 -0
  155. package/dist/bundled/stores/folder.js +54 -0
  156. package/dist/bundled/stores/preview-settings.js +19 -0
  157. package/dist/bundled/stores/story.js +43 -0
  158. package/dist/bundled/util/commands.js +57 -0
  159. package/dist/bundled/util/config.js +8 -0
  160. package/dist/bundled/util/const.js +10 -0
  161. package/dist/bundled/util/dark.js +28 -0
  162. package/dist/bundled/util/docs.js +26 -0
  163. package/dist/bundled/util/env.js +4 -0
  164. package/dist/bundled/util/events.js +33 -0
  165. package/dist/bundled/util/keyboard.js +90 -0
  166. package/dist/bundled/util/mapping.js +70 -0
  167. package/dist/bundled/util/open-in-editor.js +6 -0
  168. package/dist/bundled/util/preview-settings.js +22 -0
  169. package/dist/bundled/util/responsive.js +6 -0
  170. package/dist/bundled/util/sandbox.js +11 -0
  171. package/dist/bundled/util/scroll.js +31 -0
  172. package/dist/bundled/util/select.js +28 -0
  173. package/dist/bundled/util/state.js +41 -0
  174. package/dist/bundled/util/tooltip.js +15 -0
  175. package/dist/bundled/util/variant.js +21 -0
  176. package/dist/style.css +2853 -0
  177. package/package.json +8 -4
  178. package/postcss-scope-wrapper.cjs +0 -35
  179. package/postcss.config.cjs +0 -9
  180. package/scripts/copy.mjs +0 -12
  181. package/scripts/watchAndCopy.mjs +0 -15
  182. package/tailwind.config.cjs +0 -137
  183. package/tsconfig.json +0 -53
  184. package/vite.config.ts +0 -88
@@ -0,0 +1,128 @@
1
+ import { defineComponent, ref, watch, computed, createBlock, openBlock, withCtx, createElementVNode, normalizeStyle, normalizeClass, toRaw } from "@poveste/vendors/vue";
2
+ import { applyState } from "@poveste/shared";
3
+ import { useEventListener } from "@poveste/vendors/vue-use";
4
+ import { useEventsStore } from "../../stores/events.js";
5
+ import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
6
+ import { SANDBOX_READY, EVENT_SEND, STATE_SYNC, PREVIEW_SETTINGS_SYNC } from "../../util/const.js";
7
+ import { getSandboxUrl } from "../../util/sandbox.js";
8
+ import { toRawDeep } from "../../util/state.js";
9
+ import StoryResponsivePreview from "./StoryResponsivePreview.vue.js";
10
+ "use strict";
11
+ const _hoisted_1 = ["src"];
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ __name: "StoryVariantSinglePreviewRemote",
14
+ props: {
15
+ story: {},
16
+ variant: {}
17
+ },
18
+ setup(__props) {
19
+ const props = __props;
20
+ const settings = usePreviewSettingsStore().currentSettings;
21
+ const iframe = ref();
22
+ function syncState() {
23
+ if (iframe.value && props.variant.previewReady) {
24
+ iframe.value.contentWindow.postMessage({
25
+ type: STATE_SYNC,
26
+ state: toRawDeep(props.variant.state, true)
27
+ });
28
+ }
29
+ }
30
+ let synced = false;
31
+ watch(() => props.variant.state, () => {
32
+ if (synced) {
33
+ synced = false;
34
+ return;
35
+ }
36
+ syncState();
37
+ }, {
38
+ deep: true,
39
+ immediate: true
40
+ });
41
+ Object.assign(props.variant, {
42
+ previewReady: false
43
+ });
44
+ useEventListener(window, "message", (event) => {
45
+ switch (event.data.type) {
46
+ case STATE_SYNC:
47
+ updateVariantState(event.data.state);
48
+ break;
49
+ case EVENT_SEND:
50
+ logEvent(event.data.event);
51
+ break;
52
+ case SANDBOX_READY:
53
+ setPreviewReady();
54
+ break;
55
+ }
56
+ });
57
+ function updateVariantState(state) {
58
+ synced = true;
59
+ applyState(props.variant.state, state);
60
+ }
61
+ function logEvent(event) {
62
+ const eventsStore = useEventsStore();
63
+ eventsStore.addEvent(event);
64
+ }
65
+ function setPreviewReady() {
66
+ Object.assign(props.variant, {
67
+ previewReady: true
68
+ });
69
+ }
70
+ const sandboxUrl = computed(() => {
71
+ return getSandboxUrl(props.story, props.variant);
72
+ });
73
+ const isIframeLoaded = ref(false);
74
+ watch(sandboxUrl, () => {
75
+ isIframeLoaded.value = false;
76
+ Object.assign(props.variant, {
77
+ previewReady: false
78
+ });
79
+ });
80
+ function syncSettings() {
81
+ if (iframe.value) {
82
+ iframe.value.contentWindow.postMessage({
83
+ type: PREVIEW_SETTINGS_SYNC,
84
+ settings: toRaw(settings)
85
+ });
86
+ }
87
+ }
88
+ watch(() => settings, () => {
89
+ syncSettings();
90
+ }, {
91
+ deep: true,
92
+ immediate: true
93
+ });
94
+ function onIframeLoad() {
95
+ isIframeLoaded.value = true;
96
+ syncState();
97
+ syncSettings();
98
+ }
99
+ return (_ctx, _cache) => {
100
+ return openBlock(), createBlock(StoryResponsivePreview, {
101
+ class: "poveste-story-variant-single-preview-remote",
102
+ variant: __props.variant
103
+ }, {
104
+ default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight, resizing }) => [
105
+ createElementVNode("iframe", {
106
+ ref_key: "iframe",
107
+ ref: iframe,
108
+ src: sandboxUrl.value,
109
+ class: normalizeClass(["htw-w-full htw-h-full htw-relative", {
110
+ "htw-invisible": !isIframeLoaded.value,
111
+ "htw-pointer-events-none": resizing
112
+ }]),
113
+ style: normalizeStyle(isResponsiveEnabled ? {
114
+ width: finalWidth ? `${finalWidth}px` : null,
115
+ height: finalHeight ? `${finalHeight}px` : null
116
+ } : void 0),
117
+ "data-test-id": "preview-iframe",
118
+ onLoad: _cache[0] || (_cache[0] = ($event) => onIframeLoad())
119
+ }, null, 46, _hoisted_1)
120
+ ]),
121
+ _: 1
122
+ }, 8, ["variant"]);
123
+ };
124
+ }
125
+ });
126
+ export {
127
+ _sfc_main as default
128
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./StoryVariantSingleView.vue2.js";
2
+ "use strict";
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,66 @@
1
+ import { defineComponent, createElementBlock, openBlock, createCommentVNode, createBlock, unref, createVNode } from "@poveste/vendors/vue";
2
+ import { isMobile } from "../../util/responsive.js";
3
+ import "../toolbar/DevOnlyToolbarOpenInEditor.vue.js";
4
+ import ToolbarBackground from "../toolbar/ToolbarBackground.vue.js";
5
+ import "../toolbar/ToolbarNewTab.vue.js";
6
+ import "../toolbar/ToolbarResponsiveSize.vue.js";
7
+ import "../toolbar/ToolbarTextDirection.vue.js";
8
+ import "../toolbar/ToolbarTitle.vue.js";
9
+ import "./StoryVariantSinglePreviewNative.vue.js";
10
+ import "./StoryVariantSinglePreviewRemote.vue.js";
11
+ import _sfc_main$1 from "../toolbar/ToolbarTitle.vue2.js";
12
+ import _sfc_main$2 from "../toolbar/ToolbarResponsiveSize.vue2.js";
13
+ import _sfc_main$3 from "../toolbar/ToolbarTextDirection.vue2.js";
14
+ import _sfc_main$4 from "../toolbar/ToolbarNewTab.vue2.js";
15
+ import _sfc_main$5 from "../toolbar/DevOnlyToolbarOpenInEditor.vue2.js";
16
+ import _sfc_main$6 from "./StoryVariantSinglePreviewNative.vue2.js";
17
+ import _sfc_main$7 from "./StoryVariantSinglePreviewRemote.vue2.js";
18
+ "use strict";
19
+ const _hoisted_1 = {
20
+ class: "poveste-story-variant-single-view htw-h-full htw-flex htw-flex-col",
21
+ "data-test-id": "story-variant-single-view"
22
+ };
23
+ const _hoisted_2 = {
24
+ key: 0,
25
+ class: "htw-flex-none htw-flex htw-items-center htw-h-8 -htw-mt-1"
26
+ };
27
+ const _sfc_main = /* @__PURE__ */ defineComponent({
28
+ __name: "StoryVariantSingleView",
29
+ props: {
30
+ variant: {},
31
+ story: {}
32
+ },
33
+ setup(__props) {
34
+ return (_ctx, _cache) => {
35
+ return openBlock(), createElementBlock("div", _hoisted_1, [
36
+ !unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
37
+ createVNode(_sfc_main$1, { variant: __props.variant }, null, 8, ["variant"]),
38
+ !__props.variant.responsiveDisabled ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true),
39
+ createVNode(ToolbarBackground),
40
+ createVNode(_sfc_main$3),
41
+ createVNode(_sfc_main$4, {
42
+ variant: __props.variant,
43
+ story: __props.story
44
+ }, null, 8, ["variant", "story"]),
45
+ _ctx.__POVESTE_DEV__ ? (openBlock(), createBlock(_sfc_main$5, {
46
+ key: 1,
47
+ file: __props.story.file?.filePath,
48
+ tooltip: "Edit story in editor"
49
+ }, null, 8, ["file"])) : createCommentVNode("", true)
50
+ ])) : createCommentVNode("", true),
51
+ __props.story.layout?.iframe === false ? (openBlock(), createBlock(_sfc_main$6, {
52
+ key: 1,
53
+ story: __props.story,
54
+ variant: __props.variant
55
+ }, null, 8, ["story", "variant"])) : (openBlock(), createBlock(_sfc_main$7, {
56
+ key: 2,
57
+ story: __props.story,
58
+ variant: __props.variant
59
+ }, null, 8, ["story", "variant"]))
60
+ ]);
61
+ };
62
+ }
63
+ });
64
+ export {
65
+ _sfc_main as default
66
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./StoryView.vue2.js";
2
+ "use strict";
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,104 @@
1
+ import { defineComponent, watch, ref, createBlock, createElementBlock, unref, openBlock, withCtx, createVNode } from "@poveste/vendors/vue";
2
+ import { Icon } from "@poveste/vendors/iconify";
3
+ import { useRouter, useRoute } from "@poveste/vendors/vue-router";
4
+ import { useStoryStore } from "../../stores/story.js";
5
+ import { isMobile } from "../../util/responsive.js";
6
+ import BaseEmpty from "../base/BaseEmpty.vue.js";
7
+ import BaseSplitPane from "../base/BaseSplitPane.vue.js";
8
+ import "../panel/StoryDocs.vue.js";
9
+ import "../panel/StorySidePanel.vue.js";
10
+ import StoryViewer from "./StoryViewer.vue.js";
11
+ import _sfc_main$1 from "../panel/StoryDocs.vue2.js";
12
+ import _sfc_main$2 from "../panel/StorySidePanel.vue2.js";
13
+ "use strict";
14
+ const _hoisted_1 = {
15
+ key: 1,
16
+ class: "poveste-story-view poveste-with-story htw-h-full"
17
+ };
18
+ const _sfc_main = /* @__PURE__ */ defineComponent({
19
+ __name: "StoryView",
20
+ setup(__props) {
21
+ const storyStore = useStoryStore();
22
+ const router = useRouter();
23
+ const route = useRoute();
24
+ watch(() => storyStore.currentVariant, (value) => {
25
+ if (value) {
26
+ storyStore.currentStory.lastSelectedVariant = value;
27
+ }
28
+ }, {
29
+ immediate: true
30
+ });
31
+ watch(() => [storyStore.currentStory, storyStore.currentVariant], () => {
32
+ if (!storyStore.currentVariant) {
33
+ if (storyStore.currentStory?.lastSelectedVariant) {
34
+ setVariant(storyStore.currentStory.lastSelectedVariant.id);
35
+ return;
36
+ }
37
+ if (storyStore.currentStory?.variants.length === 1) {
38
+ setVariant(storyStore.currentStory.variants[0].id);
39
+ }
40
+ }
41
+ }, {
42
+ immediate: true
43
+ });
44
+ function setVariant(variantId) {
45
+ router.replace({
46
+ ...route,
47
+ query: {
48
+ ...route.query,
49
+ variantId
50
+ }
51
+ });
52
+ }
53
+ const docsOnlyScroller = ref(null);
54
+ function scrollDocsToTop() {
55
+ docsOnlyScroller.value?.scrollTo(0, 0);
56
+ }
57
+ return (_ctx, _cache) => {
58
+ return !unref(storyStore).currentStory ? (openBlock(), createBlock(BaseEmpty, {
59
+ key: 0,
60
+ class: "poveste-story-view poveste-no-story"
61
+ }, {
62
+ default: withCtx(() => [
63
+ createVNode(unref(Icon), {
64
+ icon: "carbon:software-resource-resource",
65
+ class: "htw-w-16 htw-h-16 htw-opacity-50"
66
+ })
67
+ ]),
68
+ _: 1
69
+ })) : (openBlock(), createElementBlock("div", _hoisted_1, [
70
+ unref(storyStore).currentStory.docsOnly ? (openBlock(), createElementBlock("div", {
71
+ key: 0,
72
+ ref_key: "docsOnlyScroller",
73
+ ref: docsOnlyScroller,
74
+ class: "htw-h-full htw-overflow-auto"
75
+ }, [
76
+ createVNode(_sfc_main$1, {
77
+ story: unref(storyStore).currentStory,
78
+ standalone: "",
79
+ class: "md:htw-p-12 htw-w-full md:htw-max-w-[600px] lg:htw-max-w-[800px] xl:htw-max-w-[900px]",
80
+ onScrollTop: _cache[0] || (_cache[0] = ($event) => scrollDocsToTop())
81
+ }, null, 8, ["story"])
82
+ ], 512)) : unref(isMobile) ? (openBlock(), createBlock(StoryViewer, { key: 1 })) : (openBlock(), createBlock(BaseSplitPane, {
83
+ key: 2,
84
+ "save-id": "story-main",
85
+ min: 30,
86
+ max: 95,
87
+ "default-split": 75,
88
+ class: "htw-h-full"
89
+ }, {
90
+ first: withCtx(() => [
91
+ createVNode(StoryViewer)
92
+ ]),
93
+ last: withCtx(() => [
94
+ createVNode(_sfc_main$2)
95
+ ]),
96
+ _: 1
97
+ }))
98
+ ]));
99
+ };
100
+ }
101
+ });
102
+ export {
103
+ _sfc_main as default
104
+ };
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./StoryViewer.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ "use strict";
5
+ const StoryViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1d298079"]]);
6
+ export {
7
+ StoryViewer as default
8
+ };
@@ -0,0 +1,55 @@
1
+ import { defineComponent, useCssVars, computed, ref, watch, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, createBlock, createCommentVNode, unref, withCtx, renderList } from "@poveste/vendors/vue";
2
+ import { useStoryStore } from "../../stores/story.js";
3
+ import "../app/MobileOverlay.vue.js";
4
+ import "./StoryVariantGrid.vue.js";
5
+ import StoryVariantListItem from "./StoryVariantListItem.vue.js";
6
+ import StoryVariantSingle from "./StoryVariantSingle.vue.js";
7
+ import _sfc_main$1 from "./StoryVariantGrid.vue2.js";
8
+ import _sfc_main$2 from "../app/MobileOverlay.vue2.js";
9
+ "use strict";
10
+ const _hoisted_1 = { class: "poveste-story-viewer htw-bg-gray-50 htw-h-full dark:htw-bg-gray-750" };
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "StoryViewer",
13
+ setup(__props) {
14
+ useCssVars((_ctx) => ({
15
+ "v4009a800": variant.value?.iconColor
16
+ }));
17
+ const storyStore = useStoryStore();
18
+ const variant = computed(() => storyStore.currentVariant);
19
+ const isMenuOpened = ref(false);
20
+ function closeMenu() {
21
+ isMenuOpened.value = false;
22
+ }
23
+ watch(variant, () => {
24
+ isMenuOpened.value = false;
25
+ });
26
+ return (_ctx, _cache) => {
27
+ return openBlock(), createElementBlock(Fragment, null, [
28
+ createElementVNode("div", _hoisted_1, [
29
+ unref(storyStore).currentStory.layout.type === "grid" ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : unref(storyStore).currentStory.layout.type === "single" ? (openBlock(), createBlock(StoryVariantSingle, {
30
+ key: 1,
31
+ onOpenVariantMenu: _cache[0] || (_cache[0] = ($event) => isMenuOpened.value = true)
32
+ })) : createCommentVNode("", true)
33
+ ]),
34
+ createVNode(_sfc_main$2, {
35
+ title: "Select a variant",
36
+ opened: isMenuOpened.value,
37
+ onClose: closeMenu
38
+ }, {
39
+ default: withCtx(() => [
40
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
41
+ return openBlock(), createBlock(StoryVariantListItem, {
42
+ key: index,
43
+ variant: v
44
+ }, null, 8, ["variant"]);
45
+ }), 128))
46
+ ]),
47
+ _: 1
48
+ }, 8, ["opened"])
49
+ ], 64);
50
+ };
51
+ }
52
+ });
53
+ export {
54
+ _sfc_main as default
55
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./DevOnlyToolbarOpenInEditor.vue2.js";
2
+ "use strict";
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,31 @@
1
+ import { defineComponent, resolveDirective, withDirectives, createElementBlock, openBlock, unref, createVNode } from "@poveste/vendors/vue";
2
+ import { Icon } from "@poveste/vendors/iconify";
3
+ import { openInEditor } from "../../util/open-in-editor.js";
4
+ "use strict";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "DevOnlyToolbarOpenInEditor",
7
+ props: {
8
+ file: {},
9
+ tooltip: {}
10
+ },
11
+ setup(__props) {
12
+ return (_ctx, _cache) => {
13
+ const _directive_tooltip = resolveDirective("tooltip");
14
+ return withDirectives((openBlock(), createElementBlock("a", {
15
+ target: "_blank",
16
+ class: "poveste-toolbar-open-in-editor htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 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",
17
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(openInEditor)(__props.file))
18
+ }, [
19
+ createVNode(unref(Icon), {
20
+ icon: "carbon:script-reference",
21
+ class: "htw-w-4 htw-h-4"
22
+ })
23
+ ])), [
24
+ [_directive_tooltip, __props.tooltip]
25
+ ]);
26
+ };
27
+ }
28
+ });
29
+ export {
30
+ _sfc_main as default
31
+ };
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./ToolbarBackground.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ "use strict";
5
+ const ToolbarBackground = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-26d08825"]]);
6
+ export {
7
+ ToolbarBackground as default
8
+ };
@@ -0,0 +1,98 @@
1
+ import { defineComponent, useCssVars, computed, unref, resolveComponent, resolveDirective, createBlock, createCommentVNode, openBlock, withCtx, withDirectives, createElementBlock, createElementVNode, createVNode, createTextVNode, Fragment, renderList, normalizeClass, toDisplayString, normalizeStyle } from "@poveste/vendors/vue";
2
+ import { Icon } from "@poveste/vendors/iconify";
3
+ import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
4
+ import { povesteConfig } from "../../util/config.js";
5
+ import { getContrastColor } from "../../util/preview-settings.js";
6
+ import "../base/BaseCheckbox.vue.js";
7
+ import _sfc_main$1 from "../base/BaseCheckbox.vue2.js";
8
+ "use strict";
9
+ const _hoisted_1 = { class: "htw-cursor-pointer hover:htw-text-primary-500 htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group" };
10
+ const _hoisted_2 = { class: "bind-preview-bg htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/50 dark:htw-border-white/50 htw-flex htw-items-center htw-justify-center htw-text-xs" };
11
+ const _hoisted_3 = { key: 0 };
12
+ const _hoisted_4 = {
13
+ class: "htw-flex htw-flex-col htw-items-stretch",
14
+ "data-test-id": "background-popper"
15
+ };
16
+ const _hoisted_5 = ["onClick"];
17
+ const _hoisted_6 = { class: "htw-mr-auto" };
18
+ const _hoisted_7 = { class: "htw-ml-auto htw-opacity-70" };
19
+ const _hoisted_8 = { key: 0 };
20
+ const _sfc_main = /* @__PURE__ */ defineComponent({
21
+ __name: "ToolbarBackground",
22
+ setup(__props) {
23
+ useCssVars((_ctx) => ({
24
+ "v57972cd3": unref(settings).backgroundColor,
25
+ "v07febf58": contrastColor.value
26
+ }));
27
+ const settings = usePreviewSettingsStore().currentSettings;
28
+ const contrastColor = computed(() => getContrastColor(settings));
29
+ return (_ctx, _cache) => {
30
+ const _component_VDropdown = resolveComponent("VDropdown");
31
+ const _directive_tooltip = resolveDirective("tooltip");
32
+ return unref(povesteConfig).backgroundPresets.length ? (openBlock(), createBlock(_component_VDropdown, {
33
+ key: 0,
34
+ placement: "bottom-end",
35
+ skidding: 6,
36
+ class: "poveste-toolbar-background htw-h-full htw-flex-none",
37
+ "data-test-id": "toolbar-background"
38
+ }, {
39
+ popper: withCtx(({ hide }) => [
40
+ createElementVNode("div", _hoisted_4, [
41
+ createVNode(_sfc_main$1, {
42
+ modelValue: unref(settings).checkerboard,
43
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).checkerboard = $event)
44
+ }, {
45
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
46
+ createTextVNode(" Checkerboard ", -1)
47
+ ])]),
48
+ _: 1
49
+ }, 8, ["modelValue"]),
50
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(povesteConfig).backgroundPresets, (option, index) => {
51
+ return openBlock(), createElementBlock("button", {
52
+ key: index,
53
+ class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-items-baseline htw-gap-4", [
54
+ unref(settings).backgroundColor === option.color ? "htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black" : "htw-bg-transparent hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700"
55
+ ]]),
56
+ onClick: ($event) => {
57
+ unref(settings).backgroundColor = option.color;
58
+ hide();
59
+ }
60
+ }, [
61
+ createElementVNode("span", _hoisted_6, toDisplayString(option.label), 1),
62
+ option.color !== "$checkerboard" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
63
+ createElementVNode("span", _hoisted_7, toDisplayString(option.color), 1),
64
+ createElementVNode("div", {
65
+ class: "htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/20 dark:htw-border-white/20 htw-flex htw-items-center htw-justify-center htw-text-xs",
66
+ style: normalizeStyle({
67
+ backgroundColor: option.color,
68
+ color: option.contrastColor
69
+ })
70
+ }, [
71
+ option.contrastColor ? (openBlock(), createElementBlock("span", _hoisted_8, "a")) : createCommentVNode("", true)
72
+ ], 4)
73
+ ], 64)) : createCommentVNode("", true)
74
+ ], 10, _hoisted_5);
75
+ }), 128))
76
+ ])
77
+ ]),
78
+ default: withCtx(() => [
79
+ withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
80
+ createElementVNode("div", _hoisted_2, [
81
+ contrastColor.value ? (openBlock(), createElementBlock("span", _hoisted_3, "a")) : createCommentVNode("", true)
82
+ ]),
83
+ createVNode(unref(Icon), {
84
+ icon: "carbon:caret-down",
85
+ class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
86
+ })
87
+ ])), [
88
+ [_directive_tooltip, "Background color"]
89
+ ])
90
+ ]),
91
+ _: 1
92
+ })) : createCommentVNode("", true);
93
+ };
94
+ }
95
+ });
96
+ export {
97
+ _sfc_main as default
98
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./ToolbarNewTab.vue2.js";
2
+ "use strict";
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,36 @@
1
+ import { defineComponent, computed, resolveDirective, withDirectives, createElementBlock, openBlock, createVNode, unref } from "@poveste/vendors/vue";
2
+ import { Icon } from "@poveste/vendors/iconify";
3
+ import { getSandboxUrl } from "../../util/sandbox.js";
4
+ "use strict";
5
+ const _hoisted_1 = ["href"];
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "ToolbarNewTab",
8
+ props: {
9
+ variant: {},
10
+ story: {}
11
+ },
12
+ setup(__props) {
13
+ const props = __props;
14
+ const sandboxUrl = computed(() => {
15
+ return getSandboxUrl(props.story, props.variant);
16
+ });
17
+ return (_ctx, _cache) => {
18
+ const _directive_tooltip = resolveDirective("tooltip");
19
+ return withDirectives((openBlock(), createElementBlock("a", {
20
+ href: sandboxUrl.value,
21
+ target: "_blank",
22
+ class: "poveste-toolbar-new-tab htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 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"
23
+ }, [
24
+ createVNode(unref(Icon), {
25
+ icon: "carbon:launch",
26
+ class: "htw-w-4 htw-h-4"
27
+ })
28
+ ], 8, _hoisted_1)), [
29
+ [_directive_tooltip, "Open variant in new tab"]
30
+ ]);
31
+ };
32
+ }
33
+ });
34
+ export {
35
+ _sfc_main as default
36
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./ToolbarResponsiveSize.vue2.js";
2
+ "use strict";
3
+ export {
4
+ _sfc_main as default
5
+ };