mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
- axios ^1.8.2 -> ^1.13.5 (GHSA-43fc-jf86-j433, HIGH) - glob ^11.0.3 -> ^11.1.0 (GHSA-5j98-mcp5-4vw2, HIGH) - storybook ecosystem ^10.1.9 -> ^10.2.8 (GHSA-8452-54wp-rmv6, HIGH) - tailwindcss + @tailwindcss/vite ^4.1.12 -> ^4.1.18 (tar vulns, HIGH) - vue-i18n ^9.14.3 -> ^9.14.5 (GHSA-x8qp-wqqm-57ph, MODERATE) - jsondiffpatch ^0.6.0 -> ^0.7.3 (GHSA-33vc-wfww-vjfv, MODERATE) Remove deprecated showName/dynamicTitle from Storybook toolbar config (properties removed in Storybook 10.2.x). Amp-Thread-ID: https://ampcode.com/threads/T-019c4b81-3522-754d-9d26-eedc70c9925a Co-authored-by: Amp <amp@ampcode.com>
100 lines
2.4 KiB
TypeScript
100 lines
2.4 KiB
TypeScript
import { definePreset } from '@primevue/themes'
|
|
import Aura from '@primevue/themes/aura'
|
|
import { setup } from '@storybook/vue3'
|
|
import type { Preview, StoryContext, StoryFn } from '@storybook/vue3-vite'
|
|
import { createPinia } from 'pinia'
|
|
import 'primeicons/primeicons.css'
|
|
import PrimeVue from 'primevue/config'
|
|
import ConfirmationService from 'primevue/confirmationservice'
|
|
import ToastService from 'primevue/toastservice'
|
|
import Tooltip from 'primevue/tooltip'
|
|
|
|
import { i18n } from '@/i18n'
|
|
import '@/lib/litegraph/public/css/litegraph.css'
|
|
import '@/assets/css/style.css'
|
|
|
|
const ComfyUIPreset = definePreset(Aura, {
|
|
semantic: {
|
|
// @ts-expect-error fix me
|
|
primary: Aura['primitive'].blue
|
|
}
|
|
})
|
|
|
|
// Setup Vue app for Storybook
|
|
setup((app) => {
|
|
app.directive('tooltip', Tooltip)
|
|
|
|
// Create Pinia instance
|
|
const pinia = createPinia()
|
|
|
|
app.use(pinia)
|
|
app.use(i18n)
|
|
app.use(PrimeVue, {
|
|
theme: {
|
|
preset: ComfyUIPreset,
|
|
options: {
|
|
prefix: 'p',
|
|
cssLayer: {
|
|
name: 'primevue',
|
|
order: 'primevue, tailwind-utilities'
|
|
},
|
|
darkModeSelector: '.dark-theme, :root:has(.dark-theme)'
|
|
}
|
|
}
|
|
})
|
|
app.use(ConfirmationService)
|
|
app.use(ToastService)
|
|
})
|
|
|
|
// Theme and dialog decorator
|
|
export const withTheme = (Story: StoryFn, context: StoryContext) => {
|
|
const theme = context.globals.theme || 'light'
|
|
|
|
// Apply theme class to document root
|
|
if (theme === 'dark') {
|
|
document.documentElement.classList.add('dark-theme')
|
|
document.body.classList.add('dark-theme')
|
|
} else {
|
|
document.documentElement.classList.remove('dark-theme')
|
|
document.body.classList.remove('dark-theme')
|
|
}
|
|
document.body.classList.add('[&_*]:!font-inter')
|
|
|
|
return Story(context.args, context)
|
|
}
|
|
|
|
const preview: Preview = {
|
|
parameters: {
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/i
|
|
}
|
|
},
|
|
backgrounds: {
|
|
default: 'light',
|
|
values: [
|
|
{ name: 'light', value: '#ffffff' },
|
|
{ name: 'dark', value: '#0a0a0a' }
|
|
]
|
|
}
|
|
},
|
|
globalTypes: {
|
|
theme: {
|
|
name: 'Theme',
|
|
description: 'Global theme for components',
|
|
defaultValue: 'light',
|
|
toolbar: {
|
|
icon: 'circlehollow',
|
|
items: [
|
|
{ value: 'light', icon: 'sun', title: 'Light' },
|
|
{ value: 'dark', icon: 'moon', title: 'Dark' }
|
|
]
|
|
}
|
|
}
|
|
},
|
|
decorators: [withTheme]
|
|
}
|
|
|
|
export default preview
|