diff --git a/packages/histoire/src/client/app/components/sandbox/lib.ts b/packages/histoire/src/client/app/components/sandbox/lib.ts new file mode 100644 index 00000000..33b63825 --- /dev/null +++ b/packages/histoire/src/client/app/components/sandbox/lib.ts @@ -0,0 +1,8 @@ +import { Story, Variant } from '../../types' + +export function getSandboxUrl (story: Story, variant: Variant) { + const url = new URLSearchParams() + url.append('storyId', story.id) + url.append('variantId', variant.id) + return '/__sandbox?' + url.toString() +} diff --git a/packages/histoire/src/client/app/components/story/StoryResponsivePreview.vue b/packages/histoire/src/client/app/components/story/StoryResponsivePreview.vue index cd8da3d6..b2005f8c 100644 --- a/packages/histoire/src/client/app/components/story/StoryResponsivePreview.vue +++ b/packages/histoire/src/client/app/components/story/StoryResponsivePreview.vue @@ -9,6 +9,7 @@ import HatchedPattern from '../misc/HatchedPattern.vue' import CheckerboardPattern from '../misc/CheckerboardPattern.vue' import { toRawDeep } from '../../util/reactivity' import { Settings } from 'http2' +import { getSandboxUrl } from '../sandbox/lib' const props = defineProps<{ story: Story @@ -61,10 +62,7 @@ useEventListener(window, 'message', (event) => { }) const sandboxUrl = computed(() => { - const url = new URLSearchParams() - url.append('storyId', props.story.id) - url.append('variantId', props.variant.id) - return '/__sandbox?' + url.toString() + return getSandboxUrl(props.story, props.variant) }) const isIframeLoaded = ref(false) diff --git a/packages/histoire/src/client/app/components/story/StoryVariantSingleView.vue b/packages/histoire/src/client/app/components/story/StoryVariantSingleView.vue index 3149874b..0947b7d2 100644 --- a/packages/histoire/src/client/app/components/story/StoryVariantSingleView.vue +++ b/packages/histoire/src/client/app/components/story/StoryVariantSingleView.vue @@ -1,24 +1,18 @@ @@ -33,141 +27,13 @@ const settings = usePreviewSettings() v-if="!isMobile" class="htw-flex-none htw-flex htw-items-center htw-h-8 -htw-mt-1" > - -
- - {{ variant.title }} -
- - - -
- - -
- - -
- - - -
-
- -
- - - + + + +
@@ -178,9 +44,3 @@ const settings = usePreviewSettings() /> - - diff --git a/packages/histoire/src/client/app/components/story/variant/StoryVariantBackground.vue b/packages/histoire/src/client/app/components/story/variant/StoryVariantBackground.vue new file mode 100644 index 00000000..125bdb9e --- /dev/null +++ b/packages/histoire/src/client/app/components/story/variant/StoryVariantBackground.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/packages/histoire/src/client/app/components/story/variant/StoryVariantNewTab.vue b/packages/histoire/src/client/app/components/story/variant/StoryVariantNewTab.vue new file mode 100644 index 00000000..5a2be024 --- /dev/null +++ b/packages/histoire/src/client/app/components/story/variant/StoryVariantNewTab.vue @@ -0,0 +1,29 @@ + + + diff --git a/packages/histoire/src/client/app/components/story/variant/StoryVariantResponsiveSize.vue b/packages/histoire/src/client/app/components/story/variant/StoryVariantResponsiveSize.vue new file mode 100644 index 00000000..a1be75b1 --- /dev/null +++ b/packages/histoire/src/client/app/components/story/variant/StoryVariantResponsiveSize.vue @@ -0,0 +1,82 @@ + + + diff --git a/packages/histoire/src/client/app/components/story/variant/StoryVariantTitle.vue b/packages/histoire/src/client/app/components/story/variant/StoryVariantTitle.vue new file mode 100644 index 00000000..b22a136c --- /dev/null +++ b/packages/histoire/src/client/app/components/story/variant/StoryVariantTitle.vue @@ -0,0 +1,21 @@ + + + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77a24ac5..abc59a31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1209,7 +1209,7 @@ packages: vue: optional: true dependencies: - vite: 2.8.6 + vite: 2.8.6_sass@1.49.9 vue: 3.2.31 /@volar/code-gen/0.33.2: