mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-01 03:31:58 +00:00
- Add comprehensive PrimeVue theme setup with ComfyUI preset - Configure proper Vue app setup with Pinia stores, i18n, and services - Remove unused onboarding addon from Storybook dependencies - Improve Vite configuration with better chunking and alias resolution - Add proper CSS imports and styling for ComfyUI components 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
72 lines
1.8 KiB
TypeScript
72 lines
1.8 KiB
TypeScript
import { definePreset } from '@primevue/themes'
|
|
import Aura from '@primevue/themes/aura'
|
|
import { setup } from '@storybook/vue3'
|
|
import type { Preview } 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 '../src/assets/css/style.css'
|
|
import { i18n } from '../src/i18n'
|
|
import '../src/lib/litegraph/public/css/litegraph.css'
|
|
import { useWidgetStore } from '../src/stores/widgetStore'
|
|
import { useColorPaletteStore } from '../src/stores/workspace/colorPaletteStore'
|
|
|
|
const ComfyUIPreset = definePreset(Aura, {
|
|
semantic: {
|
|
// @ts-expect-error fixme ts strict error
|
|
primary: Aura['primitive'].blue
|
|
}
|
|
})
|
|
|
|
// Setup Vue app for Storybook
|
|
setup((app) => {
|
|
app.directive('tooltip', Tooltip)
|
|
const pinia = createPinia()
|
|
app.use(pinia)
|
|
|
|
// Initialize stores
|
|
const colorPaletteStore = useColorPaletteStore(pinia)
|
|
const widgetStore = useWidgetStore(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)
|
|
})
|
|
|
|
const preview: Preview = {
|
|
parameters: {
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/i
|
|
}
|
|
},
|
|
backgrounds: {
|
|
default: 'light',
|
|
values: [
|
|
{ name: 'light', value: '#ffffff' },
|
|
{ name: 'dark', value: '#1a1a1a' }
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
export default preview
|