-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
230 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
import { type Plugin } from 'vite' | ||
import { whyframe } from '@whyframe/core' | ||
import { whyframeVue } from '@whyframe/vue' | ||
import { type PluginOption } from 'vite' | ||
import { type DefaultTheme } from 'vitepress' | ||
|
||
export function storyPlugin(): Plugin { | ||
export function storyPlugin(): PluginOption { | ||
let themeConfig: DefaultTheme.Config | ||
|
||
return { | ||
name: 'sefirot-story' | ||
// configResolved(config) { | ||
// themeConfig = (config as any).vitepress.userConfig.themeConfig | ||
// if (Array.isArray(themeConfig.sidebar)) { | ||
// themeConfig.sidebar.push({ | ||
// text: 'Storybook', | ||
// items: [ | ||
// { text: 'Introduction', link: '/story/introduction' }, | ||
// { text: 'Components', link: '/story/components' }, | ||
// { text: 'Design Tokens', link: '/story/design-tokens' } | ||
// ] | ||
// }) | ||
// } | ||
// }, | ||
// // hotUpdate() { | ||
// // if (this.environment.name !== 'client') { return } | ||
return [ | ||
{ | ||
name: 'sefirot-story' | ||
// configResolved(config) { | ||
// themeConfig = (config as any).vitepress.userConfig.themeConfig | ||
// if (Array.isArray(themeConfig.sidebar)) { | ||
// themeConfig.sidebar.push({ | ||
// text: 'Storybook', | ||
// items: [ | ||
// { text: 'Introduction', link: '/stories/introduction' }, | ||
// { text: 'Components', link: '/stories/components' }, | ||
// { text: 'Design Tokens', link: '/stories/design-tokens' } | ||
// ] | ||
// }) | ||
// } | ||
// }, | ||
// hotUpdate() { | ||
// if (this.environment.name !== 'client') { return } | ||
|
||
// // if (Array.isArray(themeConfig.sidebar)) { | ||
// // themeConfig.sidebar.push({ | ||
// // text: 'Test HMR', | ||
// // items: [ | ||
// // { text: 'Introduction', link: '/story/introduction' }, | ||
// // { text: 'Components', link: '/story/components' }, | ||
// // { text: 'Design Tokens', link: '/story/design-tokens' } | ||
// // ] | ||
// // }) | ||
// if (Array.isArray(themeConfig.sidebar)) { | ||
// themeConfig.sidebar.push({ | ||
// text: 'Test HMR', | ||
// items: [ | ||
// { text: 'Introduction', link: '/stories/introduction' }, | ||
// { text: 'Components', link: '/stories/components' }, | ||
// { text: 'Design Tokens', link: '/stories/design-tokens' } | ||
// ] | ||
// }) | ||
|
||
// // return [this.environment.moduleGraph.getModuleById('/@siteData')!] | ||
// // } | ||
// // } | ||
} | ||
// return [this.environment.moduleGraph.getModuleById('/@siteData')!] | ||
// } | ||
// } | ||
}, | ||
whyframe({ defaultSrc: '/stories/_frame', components: [{ name: 'Story' }] }), | ||
whyframeVue({ include: /\.(?:vue|md)$/ }) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
layout: false | ||
--- | ||
|
||
<div id="vp-app" ref="el"></div> | ||
|
||
<script setup lang="ts"> | ||
import { onMounted, ref } from 'vue' | ||
import { createApp } from 'whyframe:app' | ||
import styles from 'sefirot/styles/bootstrap.css?inline' | ||
|
||
const el = ref<HTMLDivElement>() | ||
|
||
onMounted(() => { | ||
if (!el.value || !window.frameElement) return | ||
createApp(el.value) | ||
;(window.frameElement as HTMLIFrameElement).style.visibility = 'visible' | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
/// <reference types="@histoire/plugin-vue/components.js" /> | ||
/// <reference types="@whyframe/core/global" /> | ||
/// <reference types="./client" /> | ||
|
||
declare const __STORY_HOST__: string | ||
declare const __DOCS_HOST__: string |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.