@vizejs/vite-plugin-musea 0.391.0 → 0.404.8
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.
- package/dist/a11y/index.d.mts +2 -2
- package/dist/a11y/index.mjs +2 -2
- package/dist/{a11y-Cht-W4kd.mjs → a11y-Ci9EEv6F.mjs} +43 -23
- package/dist/a11y-Ci9EEv6F.mjs.map +1 -0
- package/dist/cli/index.d.mts +6 -22
- package/dist/cli/index.d.mts.map +1 -1
- package/dist/cli/index.mjs +92 -16
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{gallery-CKU5e84r.mjs → gallery-DnAsudTG.mjs} +2 -2
- package/dist/{gallery-CKU5e84r.mjs.map → gallery-DnAsudTG.mjs.map} +1 -1
- package/dist/{index-75q-ZCzF.d.mts → index-X16io2wM.d.mts} +26 -7
- package/dist/index-X16io2wM.d.mts.map +1 -0
- package/dist/index.d.mts +5 -253
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +11 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{art-processing-U_FYqvAE.mjs → options-CGA4BetG.mjs} +41 -3
- package/dist/options-CGA4BetG.mjs.map +1 -0
- package/dist/plugin-_rDO6Wej.d.mts +259 -0
- package/dist/plugin-_rDO6Wej.d.mts.map +1 -0
- package/dist/{template-BXWLfxIQ.mjs → template-B_y7_OsF.mjs} +2 -2
- package/dist/{template-BXWLfxIQ.mjs.map → template-B_y7_OsF.mjs.map} +1 -1
- package/dist/{vrt-D454uyH6.d.mts → vrt-DC8PNsYN.d.mts} +3 -84
- package/dist/vrt-DC8PNsYN.d.mts.map +1 -0
- package/dist/vrt-DJ_qLgan.d.mts +84 -0
- package/dist/vrt-DJ_qLgan.d.mts.map +1 -0
- package/dist/{vrt-DgVSWKGl.mjs → vrt-DYTmYF1X.mjs} +2 -1
- package/dist/vrt-DYTmYF1X.mjs.map +1 -0
- package/dist/vrt.d.mts +1 -1
- package/dist/vrt.mjs +1 -1
- package/package.json +4 -4
- package/dist/a11y-Cht-W4kd.mjs.map +0 -1
- package/dist/art-processing-U_FYqvAE.mjs.map +0 -1
- package/dist/index-75q-ZCzF.d.mts.map +0 -1
- package/dist/vrt-D454uyH6.d.mts.map +0 -1
- package/dist/vrt-DgVSWKGl.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery-CKU5e84r.mjs","names":["stylesBase","stylesLayout","stylesComponents"],"sources":["../src/gallery/styles-base.css?inline","../src/gallery/styles-layout.css?inline","../src/gallery/styles-components.css?inline","../src/gallery/styles.ts","../src/gallery/index.ts"],"sourcesContent":[":root {\n --musea-bg-primary: #e6e2d6;\n --musea-bg-secondary: #ddd9cd;\n --musea-bg-tertiary: #d4d0c4;\n --musea-bg-elevated: #e6e2d6;\n --musea-accent: #121212;\n --musea-accent-hover: #2a2a2a;\n --musea-accent-subtle: rgba(18, 18, 18, 0.08);\n --musea-text: #121212;\n --musea-text-secondary: #3a3a3a;\n --musea-text-muted: #6b6b6b;\n --musea-border: #c8c4b8;\n --musea-border-subtle: #d4d0c4;\n --musea-success: #16a34a;\n --musea-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);\n --musea-radius-sm: 4px;\n --musea-radius-md: 6px;\n --musea-radius-lg: 8px;\n --musea-transition: 0.15s ease;\n}\n\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\nbody {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n background: var(--musea-bg-primary);\n color: var(--musea-text);\n min-height: 100vh;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n}\n","/* Header */\n.header {\n background: var(--musea-bg-secondary);\n border-bottom: 1px solid var(--musea-border);\n padding: 0 1.5rem;\n height: 56px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: sticky;\n top: 0;\n z-index: 100;\n}\n\n.header-left {\n display: flex;\n align-items: center;\n gap: 1.5rem;\n}\n\n.logo {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 1.125rem;\n font-weight: 700;\n color: var(--musea-accent);\n text-decoration: none;\n}\n\n.logo-svg {\n width: 32px;\n height: 32px;\n flex-shrink: 0;\n}\n\n.logo-icon svg {\n width: 16px;\n height: 16px;\n color: var(--musea-text);\n}\n\n.header-subtitle {\n color: var(--musea-text-muted);\n font-size: 0.8125rem;\n font-weight: 500;\n padding-left: 1.5rem;\n border-left: 1px solid var(--musea-border);\n}\n\n.search-container {\n position: relative;\n width: 280px;\n}\n\n.search-input {\n width: 100%;\n background: var(--musea-bg-tertiary);\n border: 1px solid var(--musea-border);\n border-radius: var(--musea-radius-md);\n padding: 0.5rem 0.75rem 0.5rem 2.25rem;\n color: var(--musea-text);\n font-size: 0.8125rem;\n outline: none;\n transition:\n border-color var(--musea-transition),\n background var(--musea-transition);\n}\n\n.search-input::placeholder {\n color: var(--musea-text-muted);\n}\n\n.search-input:focus {\n border-color: var(--musea-accent);\n background: var(--musea-bg-elevated);\n}\n\n.search-icon {\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n color: var(--musea-text-muted);\n pointer-events: none;\n}\n\n/* Layout */\n.main {\n display: grid;\n grid-template-columns: 260px 1fr;\n min-height: calc(100vh - 56px);\n}\n\n/* Sidebar */\n.sidebar {\n background: var(--musea-bg-secondary);\n border-right: 1px solid var(--musea-border);\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.sidebar::-webkit-scrollbar {\n width: 6px;\n}\n\n.sidebar::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.sidebar::-webkit-scrollbar-thumb {\n background: var(--musea-border);\n border-radius: 3px;\n}\n\n.sidebar-section {\n padding: 0.75rem;\n}\n\n.category-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.625rem 0.75rem;\n font-size: 0.6875rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--musea-text-muted);\n cursor: pointer;\n user-select: none;\n border-radius: var(--musea-radius-sm);\n transition: background var(--musea-transition);\n}\n\n.category-header:hover {\n background: var(--musea-bg-tertiary);\n}\n\n.category-icon {\n width: 16px;\n height: 16px;\n transition: transform var(--musea-transition);\n}\n\n.category-header.collapsed .category-icon {\n transform: rotate(-90deg);\n}\n\n.category-count {\n margin-left: auto;\n background: var(--musea-bg-tertiary);\n padding: 0.125rem 0.375rem;\n border-radius: 4px;\n font-size: 0.625rem;\n}\n\n.art-list {\n list-style: none;\n margin-top: 0.25rem;\n}\n\n.art-item {\n display: flex;\n align-items: center;\n gap: 0.625rem;\n padding: 0.5rem 0.75rem 0.5rem 1.75rem;\n border-radius: var(--musea-radius-sm);\n cursor: pointer;\n font-size: 0.8125rem;\n color: var(--musea-text-secondary);\n transition: all var(--musea-transition);\n position: relative;\n}\n\n.art-item::before {\n content: \"\";\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--musea-border);\n transition: background var(--musea-transition);\n}\n\n.art-item:hover {\n background: var(--musea-bg-tertiary);\n color: var(--musea-text);\n}\n\n.art-item:hover::before {\n background: var(--musea-text-muted);\n}\n\n.art-item.active {\n background: var(--musea-accent-subtle);\n color: var(--musea-accent-hover);\n}\n\n.art-item.active::before {\n background: var(--musea-accent);\n}\n\n.art-variant-count {\n margin-left: auto;\n font-size: 0.6875rem;\n color: var(--musea-text-muted);\n opacity: 0;\n transition: opacity var(--musea-transition);\n}\n\n.art-item:hover .art-variant-count {\n opacity: 1;\n}\n\n/* Content */\n.content {\n background: var(--musea-bg-primary);\n overflow-y: auto;\n}\n\n.content-inner {\n max-width: 1400px;\n margin: 0 auto;\n padding: 2rem;\n}\n\n.content-header {\n margin-bottom: 2rem;\n}\n\n.content-title {\n font-size: 1.5rem;\n font-weight: 700;\n margin-bottom: 0.5rem;\n}\n\n.content-description {\n color: var(--musea-text-muted);\n font-size: 0.9375rem;\n max-width: 600px;\n}\n\n.content-meta {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-top: 1rem;\n}\n\n.meta-tag {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n padding: 0.25rem 0.625rem;\n background: var(--musea-bg-secondary);\n border: 1px solid var(--musea-border);\n border-radius: var(--musea-radius-sm);\n font-size: 0.75rem;\n color: var(--musea-text-muted);\n}\n\n.meta-tag svg {\n width: 12px;\n height: 12px;\n}\n","/* Gallery Grid */\n.gallery {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n gap: 1.25rem;\n}\n\n/* Variant Card */\n.variant-card {\n background: var(--musea-bg-secondary);\n border: 1px solid var(--musea-border);\n border-radius: var(--musea-radius-lg);\n overflow: hidden;\n}\n\n.variant-preview {\n aspect-ratio: 16 / 7;\n background: var(--musea-bg-tertiary);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n}\n\n.variant-preview iframe {\n width: 70%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n border: none;\n background: white;\n border-radius: var(--musea-radius-md);\n box-shadow: 0 12px 30px rgba(13, 13, 13, 0.12);\n}\n\n.variant-preview-placeholder {\n color: var(--musea-text-muted);\n font-size: 0.8125rem;\n text-align: center;\n padding: 1rem;\n}\n\n.variant-preview-code {\n font-family: \"JetBrains Mono\", \"SF Mono\", \"Fira Code\", monospace;\n font-size: 0.75rem;\n color: var(--musea-text-muted);\n background: var(--musea-bg-primary);\n padding: 1rem;\n overflow: auto;\n max-height: 100%;\n width: 100%;\n}\n\n.variant-info {\n padding: 1rem;\n border-top: 1px solid var(--musea-border);\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.variant-name {\n font-weight: 600;\n font-size: 0.875rem;\n}\n\n.variant-badge {\n font-size: 0.625rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n background: var(--musea-accent-subtle);\n color: var(--musea-accent);\n}\n\n.variant-actions {\n display: flex;\n gap: 0.5rem;\n}\n\n.variant-action-btn {\n width: 28px;\n height: 28px;\n border: none;\n background: var(--musea-bg-tertiary);\n border-radius: var(--musea-radius-sm);\n color: var(--musea-text-muted);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all var(--musea-transition);\n}\n\n.variant-action-btn:hover {\n background: var(--musea-bg-elevated);\n color: var(--musea-text);\n}\n\n.variant-action-btn svg {\n width: 14px;\n height: 14px;\n}\n\n/* Empty State */\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 400px;\n text-align: center;\n padding: 2rem;\n}\n\n.empty-state-icon {\n width: 80px;\n height: 80px;\n background: var(--musea-bg-secondary);\n border-radius: var(--musea-radius-lg);\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 1.5rem;\n}\n\n.empty-state-icon svg {\n width: 40px;\n height: 40px;\n color: var(--musea-text-muted);\n}\n\n.empty-state-title {\n font-size: 1.125rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n}\n\n.empty-state-text {\n color: var(--musea-text-muted);\n font-size: 0.875rem;\n max-width: 300px;\n}\n\n/* Loading */\n.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 200px;\n color: var(--musea-text-muted);\n gap: 0.75rem;\n}\n\n.loading-spinner {\n width: 20px;\n height: 20px;\n border: 2px solid var(--musea-border);\n border-top-color: var(--musea-accent);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Responsive */\n@media (max-width: 768px) {\n .main {\n grid-template-columns: 1fr;\n }\n .sidebar {\n display: none;\n }\n .header-subtitle {\n display: none;\n }\n}\n","/**\n * CSS theme variables and style definitions for the Musea gallery.\n *\n * CSS is split into separate .css files and imported as text\n * via tsdown's `?inline` support.\n */\n\n// @ts-expect-error -- CSS imported as text via tsdown `?inline`\nimport stylesBase from \"./styles-base.css?inline\";\n// @ts-expect-error -- CSS imported as text via tsdown `?inline`\nimport stylesLayout from \"./styles-layout.css?inline\";\n// @ts-expect-error -- CSS imported as text via tsdown `?inline`\nimport stylesComponents from \"./styles-components.css?inline\";\n\n/**\n * Generate the full gallery CSS styles string.\n */\nexport function generateGalleryStyles(): string {\n return `${stylesBase}\\n${stylesLayout}\\n${stylesComponents}`;\n}\n","/**\n * Gallery HTML generation for the Musea component gallery.\n *\n * Contains the inline gallery SPA template (used as a fallback when the\n * pre-built gallery is not available) and the gallery virtual module.\n */\n\nimport { generateGalleryStyles } from \"./styles.js\";\nimport { generateGalleryBody, generateGalleryScript } from \"./template.js\";\nimport { generateGalleryGlobalsScript } from \"./globals.js\";\nimport type { MuseaTokenPreviewConfig } from \"../tokens/preview.js\";\n\nexport { generateGalleryModule } from \"./module.js\";\n\n/**\n * Generate the inline gallery HTML page.\n */\nexport function generateGalleryHtml(\n basePath: string,\n devSessionToken: string,\n themeConfig?: { default: string; custom?: Record<string, unknown> },\n tokenPreviewConfig?: MuseaTokenPreviewConfig,\n): string {\n const globalsScript = generateGalleryGlobalsScript({\n basePath,\n devSessionToken,\n themeConfig,\n tokenPreviewConfig,\n });\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Musea - Component Gallery</title>\n <script>${globalsScript}${\"<\"}/script>\n <style>${generateGalleryStyles()}\n </style>\n</head>\n<body>${generateGalleryBody(basePath)}\n\n <script type=\"module\">${generateGalleryScript(basePath)}\n </script>\n</body>\n</html>`;\n}\n"],"mappings":";;AAAA,IAAA,sBAAM;;;ACAN,IAAA,wBAAG;;;ACAH,IAAA,4BAAG;;;;;;;;;;;;ACiBH,SAAgB,wBAAgC;CAC9C,OAAO,GAAGA,oBAAW,IAAIC,sBAAa,IAAIC;AAC5C;;;;;;;;;;;;ACFA,SAAgB,oBACd,UACA,iBACA,aACA,oBACQ;CAOR,OAAO;;;;;;YANe,6BAA6B;EACjD;EACA;EACA;EACA;CACF,CAOsB,EAAA;WACb,sBAAsB,EAAE;;;QAG3B,oBAAoB,QAAQ,EAAE;;0BAEZ,sBAAsB,QAAQ,EAAE;;;;AAI1D"}
|
|
1
|
+
{"version":3,"file":"gallery-DnAsudTG.mjs","names":["stylesBase","stylesLayout","stylesComponents"],"sources":["../src/gallery/styles-base.css?inline","../src/gallery/styles-layout.css?inline","../src/gallery/styles-components.css?inline","../src/gallery/styles.ts","../src/gallery/index.ts"],"sourcesContent":[":root {\n --musea-bg-primary: #e6e2d6;\n --musea-bg-secondary: #ddd9cd;\n --musea-bg-tertiary: #d4d0c4;\n --musea-bg-elevated: #e6e2d6;\n --musea-accent: #121212;\n --musea-accent-hover: #2a2a2a;\n --musea-accent-subtle: rgba(18, 18, 18, 0.08);\n --musea-text: #121212;\n --musea-text-secondary: #3a3a3a;\n --musea-text-muted: #6b6b6b;\n --musea-border: #c8c4b8;\n --musea-border-subtle: #d4d0c4;\n --musea-success: #16a34a;\n --musea-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);\n --musea-radius-sm: 4px;\n --musea-radius-md: 6px;\n --musea-radius-lg: 8px;\n --musea-transition: 0.15s ease;\n}\n\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\nbody {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n background: var(--musea-bg-primary);\n color: var(--musea-text);\n min-height: 100vh;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n}\n","/* Header */\n.header {\n background: var(--musea-bg-secondary);\n border-bottom: 1px solid var(--musea-border);\n padding: 0 1.5rem;\n height: 56px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: sticky;\n top: 0;\n z-index: 100;\n}\n\n.header-left {\n display: flex;\n align-items: center;\n gap: 1.5rem;\n}\n\n.logo {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 1.125rem;\n font-weight: 700;\n color: var(--musea-accent);\n text-decoration: none;\n}\n\n.logo-svg {\n width: 32px;\n height: 32px;\n flex-shrink: 0;\n}\n\n.logo-icon svg {\n width: 16px;\n height: 16px;\n color: var(--musea-text);\n}\n\n.header-subtitle {\n color: var(--musea-text-muted);\n font-size: 0.8125rem;\n font-weight: 500;\n padding-left: 1.5rem;\n border-left: 1px solid var(--musea-border);\n}\n\n.search-container {\n position: relative;\n width: 280px;\n}\n\n.search-input {\n width: 100%;\n background: var(--musea-bg-tertiary);\n border: 1px solid var(--musea-border);\n border-radius: var(--musea-radius-md);\n padding: 0.5rem 0.75rem 0.5rem 2.25rem;\n color: var(--musea-text);\n font-size: 0.8125rem;\n outline: none;\n transition:\n border-color var(--musea-transition),\n background var(--musea-transition);\n}\n\n.search-input::placeholder {\n color: var(--musea-text-muted);\n}\n\n.search-input:focus {\n border-color: var(--musea-accent);\n background: var(--musea-bg-elevated);\n}\n\n.search-icon {\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n color: var(--musea-text-muted);\n pointer-events: none;\n}\n\n/* Layout */\n.main {\n display: grid;\n grid-template-columns: 260px 1fr;\n min-height: calc(100vh - 56px);\n}\n\n/* Sidebar */\n.sidebar {\n background: var(--musea-bg-secondary);\n border-right: 1px solid var(--musea-border);\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.sidebar::-webkit-scrollbar {\n width: 6px;\n}\n\n.sidebar::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.sidebar::-webkit-scrollbar-thumb {\n background: var(--musea-border);\n border-radius: 3px;\n}\n\n.sidebar-section {\n padding: 0.75rem;\n}\n\n.category-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.625rem 0.75rem;\n font-size: 0.6875rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--musea-text-muted);\n cursor: pointer;\n user-select: none;\n border-radius: var(--musea-radius-sm);\n transition: background var(--musea-transition);\n}\n\n.category-header:hover {\n background: var(--musea-bg-tertiary);\n}\n\n.category-icon {\n width: 16px;\n height: 16px;\n transition: transform var(--musea-transition);\n}\n\n.category-header.collapsed .category-icon {\n transform: rotate(-90deg);\n}\n\n.category-count {\n margin-left: auto;\n background: var(--musea-bg-tertiary);\n padding: 0.125rem 0.375rem;\n border-radius: 4px;\n font-size: 0.625rem;\n}\n\n.art-list {\n list-style: none;\n margin-top: 0.25rem;\n}\n\n.art-item {\n display: flex;\n align-items: center;\n gap: 0.625rem;\n padding: 0.5rem 0.75rem 0.5rem 1.75rem;\n border-radius: var(--musea-radius-sm);\n cursor: pointer;\n font-size: 0.8125rem;\n color: var(--musea-text-secondary);\n transition: all var(--musea-transition);\n position: relative;\n}\n\n.art-item::before {\n content: \"\";\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--musea-border);\n transition: background var(--musea-transition);\n}\n\n.art-item:hover {\n background: var(--musea-bg-tertiary);\n color: var(--musea-text);\n}\n\n.art-item:hover::before {\n background: var(--musea-text-muted);\n}\n\n.art-item.active {\n background: var(--musea-accent-subtle);\n color: var(--musea-accent-hover);\n}\n\n.art-item.active::before {\n background: var(--musea-accent);\n}\n\n.art-variant-count {\n margin-left: auto;\n font-size: 0.6875rem;\n color: var(--musea-text-muted);\n opacity: 0;\n transition: opacity var(--musea-transition);\n}\n\n.art-item:hover .art-variant-count {\n opacity: 1;\n}\n\n/* Content */\n.content {\n background: var(--musea-bg-primary);\n overflow-y: auto;\n}\n\n.content-inner {\n max-width: 1400px;\n margin: 0 auto;\n padding: 2rem;\n}\n\n.content-header {\n margin-bottom: 2rem;\n}\n\n.content-title {\n font-size: 1.5rem;\n font-weight: 700;\n margin-bottom: 0.5rem;\n}\n\n.content-description {\n color: var(--musea-text-muted);\n font-size: 0.9375rem;\n max-width: 600px;\n}\n\n.content-meta {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-top: 1rem;\n}\n\n.meta-tag {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n padding: 0.25rem 0.625rem;\n background: var(--musea-bg-secondary);\n border: 1px solid var(--musea-border);\n border-radius: var(--musea-radius-sm);\n font-size: 0.75rem;\n color: var(--musea-text-muted);\n}\n\n.meta-tag svg {\n width: 12px;\n height: 12px;\n}\n","/* Gallery Grid */\n.gallery {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n gap: 1.25rem;\n}\n\n/* Variant Card */\n.variant-card {\n background: var(--musea-bg-secondary);\n border: 1px solid var(--musea-border);\n border-radius: var(--musea-radius-lg);\n overflow: hidden;\n}\n\n.variant-preview {\n aspect-ratio: 16 / 7;\n background: var(--musea-bg-tertiary);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n}\n\n.variant-preview iframe {\n width: 70%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n border: none;\n background: white;\n border-radius: var(--musea-radius-md);\n box-shadow: 0 12px 30px rgba(13, 13, 13, 0.12);\n}\n\n.variant-preview-placeholder {\n color: var(--musea-text-muted);\n font-size: 0.8125rem;\n text-align: center;\n padding: 1rem;\n}\n\n.variant-preview-code {\n font-family: \"JetBrains Mono\", \"SF Mono\", \"Fira Code\", monospace;\n font-size: 0.75rem;\n color: var(--musea-text-muted);\n background: var(--musea-bg-primary);\n padding: 1rem;\n overflow: auto;\n max-height: 100%;\n width: 100%;\n}\n\n.variant-info {\n padding: 1rem;\n border-top: 1px solid var(--musea-border);\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.variant-name {\n font-weight: 600;\n font-size: 0.875rem;\n}\n\n.variant-badge {\n font-size: 0.625rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n padding: 0.1875rem 0.5rem;\n border-radius: 4px;\n background: var(--musea-accent-subtle);\n color: var(--musea-accent);\n}\n\n.variant-actions {\n display: flex;\n gap: 0.5rem;\n}\n\n.variant-action-btn {\n width: 28px;\n height: 28px;\n border: none;\n background: var(--musea-bg-tertiary);\n border-radius: var(--musea-radius-sm);\n color: var(--musea-text-muted);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all var(--musea-transition);\n}\n\n.variant-action-btn:hover {\n background: var(--musea-bg-elevated);\n color: var(--musea-text);\n}\n\n.variant-action-btn svg {\n width: 14px;\n height: 14px;\n}\n\n/* Empty State */\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 400px;\n text-align: center;\n padding: 2rem;\n}\n\n.empty-state-icon {\n width: 80px;\n height: 80px;\n background: var(--musea-bg-secondary);\n border-radius: var(--musea-radius-lg);\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 1.5rem;\n}\n\n.empty-state-icon svg {\n width: 40px;\n height: 40px;\n color: var(--musea-text-muted);\n}\n\n.empty-state-title {\n font-size: 1.125rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n}\n\n.empty-state-text {\n color: var(--musea-text-muted);\n font-size: 0.875rem;\n max-width: 300px;\n}\n\n/* Loading */\n.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 200px;\n color: var(--musea-text-muted);\n gap: 0.75rem;\n}\n\n.loading-spinner {\n width: 20px;\n height: 20px;\n border: 2px solid var(--musea-border);\n border-top-color: var(--musea-accent);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Responsive */\n@media (max-width: 768px) {\n .main {\n grid-template-columns: 1fr;\n }\n .sidebar {\n display: none;\n }\n .header-subtitle {\n display: none;\n }\n}\n","/**\n * CSS theme variables and style definitions for the Musea gallery.\n *\n * CSS is split into separate .css files and imported as text\n * via tsdown's `?inline` support.\n */\n\n// @ts-expect-error -- CSS imported as text via tsdown `?inline`\nimport stylesBase from \"./styles-base.css?inline\";\n// @ts-expect-error -- CSS imported as text via tsdown `?inline`\nimport stylesLayout from \"./styles-layout.css?inline\";\n// @ts-expect-error -- CSS imported as text via tsdown `?inline`\nimport stylesComponents from \"./styles-components.css?inline\";\n\n/**\n * Generate the full gallery CSS styles string.\n */\nexport function generateGalleryStyles(): string {\n return `${stylesBase}\\n${stylesLayout}\\n${stylesComponents}`;\n}\n","/**\n * Gallery HTML generation for the Musea component gallery.\n *\n * Contains the inline gallery SPA template (used as a fallback when the\n * pre-built gallery is not available) and the gallery virtual module.\n */\n\nimport { generateGalleryStyles } from \"./styles.js\";\nimport { generateGalleryBody, generateGalleryScript } from \"./template.js\";\nimport { generateGalleryGlobalsScript } from \"./globals.js\";\nimport type { MuseaTokenPreviewConfig } from \"../tokens/preview.js\";\n\nexport { generateGalleryModule } from \"./module.js\";\n\n/**\n * Generate the inline gallery HTML page.\n */\nexport function generateGalleryHtml(\n basePath: string,\n devSessionToken: string,\n themeConfig?: { default: string; custom?: Record<string, unknown> },\n tokenPreviewConfig?: MuseaTokenPreviewConfig,\n): string {\n const globalsScript = generateGalleryGlobalsScript({\n basePath,\n devSessionToken,\n themeConfig,\n tokenPreviewConfig,\n });\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Musea - Component Gallery</title>\n <script>${globalsScript}${\"<\"}/script>\n <style>${generateGalleryStyles()}\n </style>\n</head>\n<body>${generateGalleryBody(basePath)}\n\n <script type=\"module\">${generateGalleryScript(basePath)}\n </script>\n</body>\n</html>`;\n}\n"],"mappings":";;AAAA,IAAA,sBAAM;;;ACAN,IAAA,wBAAG;;;ACAH,IAAA,4BAAG;;;;;;;;;;;;ACiBH,SAAgB,wBAAgC;CAC9C,OAAO,GAAGA,oBAAW,IAAIC,sBAAa,IAAIC;AAC5C;;;;;;;;;;;;ACFA,SAAgB,oBACd,UACA,iBACA,aACA,oBACQ;CAOR,OAAO;;;;;;YANe,6BAA6B;EACjD;EACA;EACA;EACA;CACF,CAOsB,EAAA;WACb,sBAAsB,EAAE;;;QAG3B,oBAAoB,QAAQ,EAAE;;0BAEZ,sBAAsB,QAAQ,EAAE;;;;AAI1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ArtFileInfo, r as MuseaVrtRunner } from "./vrt-
|
|
1
|
+
import { c as ArtFileInfo, r as MuseaVrtRunner } from "./vrt-DC8PNsYN.mjs";
|
|
2
2
|
import { Page } from "playwright";
|
|
3
3
|
|
|
4
4
|
//#region src/types/api.d.ts
|
|
@@ -70,6 +70,15 @@ interface A11yResult {
|
|
|
70
70
|
violations: A11yViolation[];
|
|
71
71
|
passes: number;
|
|
72
72
|
incomplete: number;
|
|
73
|
+
/**
|
|
74
|
+
* Why the audit could not run, when it could not run.
|
|
75
|
+
*
|
|
76
|
+
* A variant that failed to audit measured *nothing* about accessibility,
|
|
77
|
+
* so it reports no violations. Recording the failure here instead of as a
|
|
78
|
+
* synthetic `critical` violation keeps the counts honest: a broken run
|
|
79
|
+
* reads as broken rather than as a component with critical defects.
|
|
80
|
+
*/
|
|
81
|
+
error?: string;
|
|
73
82
|
}
|
|
74
83
|
/**
|
|
75
84
|
* Single accessibility violation.
|
|
@@ -103,12 +112,26 @@ declare function generateA11yJsonReport(results: A11yResult[]): string;
|
|
|
103
112
|
interface A11ySummary {
|
|
104
113
|
totalComponents: number;
|
|
105
114
|
totalVariants: number;
|
|
115
|
+
/** Variants whose audit could not run at all; see `A11yResult.error`. */
|
|
116
|
+
erroredVariants: number;
|
|
106
117
|
totalViolations: number;
|
|
107
118
|
criticalCount: number;
|
|
108
119
|
seriousCount: number;
|
|
109
120
|
moderateCount: number;
|
|
110
121
|
minorCount: number;
|
|
111
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Read axe-core's injectable browser bundle.
|
|
125
|
+
*
|
|
126
|
+
* axe-core ships CommonJS (`"main": "axe.js"`, no `exports` map), so under
|
|
127
|
+
* ESM its exports arrive on the namespace's `default` and `source` is not
|
|
128
|
+
* interop-detected as a named export: `(await import("axe-core")).source`
|
|
129
|
+
* is `undefined`. Injecting that injects nothing, leaves `window.axe`
|
|
130
|
+
* undefined, and the audit dies later as `Cannot read properties of
|
|
131
|
+
* undefined (reading 'run')` — a failure that points at the wrong line. So
|
|
132
|
+
* read both shapes and fail here, where the cause is still legible.
|
|
133
|
+
*/
|
|
134
|
+
declare function resolveAxeSource(): Promise<string>;
|
|
112
135
|
/**
|
|
113
136
|
* A11y runner using axe-core via Playwright.
|
|
114
137
|
*/
|
|
@@ -136,10 +159,6 @@ declare class MuseaA11yRunner {
|
|
|
136
159
|
* Generate JSON report for CI integration.
|
|
137
160
|
*/
|
|
138
161
|
generateJsonReport(results: A11yResult[]): string;
|
|
139
|
-
/**
|
|
140
|
-
* Get axe-core source code for injection.
|
|
141
|
-
*/
|
|
142
|
-
private getAxeSource;
|
|
143
162
|
/**
|
|
144
163
|
* Build axe-core run options from configuration.
|
|
145
164
|
*/
|
|
@@ -147,5 +166,5 @@ declare class MuseaA11yRunner {
|
|
|
147
166
|
private buildVariantUrl;
|
|
148
167
|
}
|
|
149
168
|
//#endregion
|
|
150
|
-
export {
|
|
151
|
-
//# sourceMappingURL=index-
|
|
169
|
+
export { generateA11yHtmlReport as a, A11yResult as c, computeA11ySummary as i, AnalysisApiResponse as l, MuseaA11yRunner as n, generateA11yJsonReport as o, resolveAxeSource as r, A11yOptions as s, A11ySummary as t, PaletteApiResponse as u };
|
|
170
|
+
//# sourceMappingURL=index-X16io2wM.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-X16io2wM.d.mts","names":[],"sources":["../src/types/api.ts","../src/a11y/report.ts","../src/a11y/index.ts"],"mappings":";;;;;;;UAGiB,kBAAA;EACf,KAAA;EACA,QAAA,EAAU,cAAc;EACxB,MAAA;EACA,IAAA;EACA,UAAA;AAAA;;;;UAMe,cAAA;EACf,IAAA;EACA,OAAA,EAAS,WAAA;EACT,aAAA;EACA,WAAA;EACA,QAAA;EACA,OAAA,EAAS,KAAK;IAAG,KAAA;IAAe,KAAA;EAAA;EAChC,KAAA;IAAU,GAAA;IAAa,GAAA;IAAa,IAAA;EAAA;EACpC,KAAA;AAAA;;;;KAMU,WAAA;;;AANL;UAuBU,mBAAA;EACf,KAAA,EAAO,KAAK;IACV,IAAA;IACA,IAAA;IACA,QAAA;IACA,aAAA;EAAA;EAEF,KAAA;AAAA;;;;UAUe,WAAA;EAbb;EAeF,OAAA;EAZA;EAcA,YAAA;EAdK;EAgBL,YAAA;EAN0B;EAQ1B,KAAA;AAAA;;;;UAMe,UAAA;EACf,OAAA;EACA,WAAA;EACA,UAAA,EAAY,aAAa;EACzB,MAAA;EACA,UAAA;EAFyB;;;;;;;;EAWzB,KAAA;AAAA;AAMF;;;AAAA,UAAiB,aAAA;EACf,EAAA;EACA,MAAA;EACA,WAAA;EACA,OAAA;EACA,KAAA;AAAA;;;;;;iBCvFc,kBAAA,CAAmB,OAAA,EAAS,UAAA,KAAe,WAAW;;;;iBAmBtD,sBAAA,CAAuB,OAAA,EAAS,UAAA,IAAc,OAAA,EAAS,WAAW;ADnBlF;;;AAAA,iBCgLgB,sBAAA,CAAuB,OAAqB,EAAZ,UAAU;;;;;;UCvKzC,WAAA;EACf,eAAA;EACA,aAAA;EFjBU;EEmBV,eAAA;EACA,eAAA;EACA,aAAA;EACA,YAAA;EACA,aAAA;EACA,UAAA;AAAA;;;;;;;;;;;;iBA6BoB,gBAAA,IAAoB,OAAO;;;AFvC1C;cEgEM,eAAA;EAAA,QACH,OAAA;cAEI,OAAA,GAAS,WAAA;EF7DA;AAAA;AAiBvB;;EEyDQ,SAAA,CACJ,QAAA,EAAU,WAAA,IACV,OAAA,UACA,SAAA,GAAY,cAAA,GACX,OAAA,CAAQ,UAAA;EF5DC;;;EEoHN,SAAA,CAAU,IAAA,EAAM,IAAA,EAAM,OAAA,UAAiB,WAAA,WAAsB,OAAA,CAAQ,UAAA;EFlHzE;;;EEqJF,UAAA,CAAW,OAAA,EAAS,UAAA,KAAe,WAAA;EFjJ9B;AAAA;AAUP;EE8IE,kBAAA,CAAmB,OAAA,EAAS,UAAA;;;;EAQ5B,kBAAA,CAAmB,OAAA,EAAS,UAAA;EFhJ5B;;;EAAA,QEuJQ,eAAA;EAAA,QAqCA,eAAA;AAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,258 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
1
|
+
import { a as VrtOptions, i as ViewportConfig, n as CiConfig, r as ComparisonConfig, t as CaptureConfig } from "./vrt-DJ_qLgan.mjs";
|
|
2
|
+
import { a as MuseaTokenPreviewConfig, c as ResolvedTokenPreview, d as StyleDictionaryConfig, f as StyleDictionaryOutput, i as MuseaVrtOptions, l as resolveTokenPreview, m as parseTokens, n as MuseaTheme, o as MuseaTokenPreviewKind, p as TokenCategory, r as MuseaThemeColors, s as MuseaTokenPreviewRule, t as MuseaOptions, u as DesignToken } from "./plugin-_rDO6Wej.mjs";
|
|
3
|
+
import { c as ArtFileInfo, d as CsfOutput, l as ArtMetadata, n as generateVrtReport, o as VrtResult, r as MuseaVrtRunner, s as VrtSummary, t as generateVrtJsonReport, u as ArtVariant } from "./vrt-DC8PNsYN.mjs";
|
|
4
|
+
import { c as A11yResult, l as AnalysisApiResponse, n as MuseaA11yRunner, s as A11yOptions, t as A11ySummary, u as PaletteApiResponse } from "./index-X16io2wM.mjs";
|
|
3
5
|
import { AutogenOptions, AutogenOutput, GeneratedVariant, PropDefinition, generateArtFile, writeArtFile } from "./autogen/index.mjs";
|
|
4
6
|
import { Plugin } from "vite";
|
|
5
7
|
|
|
6
|
-
//#region src/tokens/parser.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Token parsing utilities for Style Dictionary integration.
|
|
9
|
-
*
|
|
10
|
-
* Thin native binding for design token files (JSON) and directories.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Design token value.
|
|
14
|
-
*/
|
|
15
|
-
interface DesignToken {
|
|
16
|
-
value: string | number;
|
|
17
|
-
type?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
attributes?: Record<string, unknown>;
|
|
20
|
-
$tier?: "primitive" | "semantic";
|
|
21
|
-
$reference?: string;
|
|
22
|
-
$resolvedValue?: string | number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Token category (e.g., colors, spacing, typography).
|
|
26
|
-
*/
|
|
27
|
-
interface TokenCategory {
|
|
28
|
-
name: string;
|
|
29
|
-
tokens: Record<string, DesignToken>;
|
|
30
|
-
subcategories?: TokenCategory[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Style Dictionary output format.
|
|
34
|
-
*/
|
|
35
|
-
interface StyleDictionaryOutput {
|
|
36
|
-
categories: TokenCategory[];
|
|
37
|
-
metadata: {
|
|
38
|
-
name: string;
|
|
39
|
-
version?: string;
|
|
40
|
-
generatedAt: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Configuration for Style Dictionary integration.
|
|
45
|
-
*/
|
|
46
|
-
interface StyleDictionaryConfig {
|
|
47
|
-
/**
|
|
48
|
-
* Path to tokens JSON file/directory or Tailwind CSS theme file.
|
|
49
|
-
*/
|
|
50
|
-
tokensPath: string;
|
|
51
|
-
/**
|
|
52
|
-
* Output format for documentation.
|
|
53
|
-
* @default 'html'
|
|
54
|
-
*/
|
|
55
|
-
outputFormat?: "html" | "json" | "markdown";
|
|
56
|
-
/**
|
|
57
|
-
* Output directory for generated documentation.
|
|
58
|
-
* @default '.vize/tokens'
|
|
59
|
-
*/
|
|
60
|
-
outputDir?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Custom token transformations.
|
|
63
|
-
*/
|
|
64
|
-
transforms?: TokenTransform[];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Token transformation function.
|
|
68
|
-
*/
|
|
69
|
-
type TokenTransform = (token: DesignToken, path: string[]) => DesignToken;
|
|
70
|
-
/**
|
|
71
|
-
* Parse Style Dictionary tokens file/directory or Tailwind CSS theme variables.
|
|
72
|
-
*/
|
|
73
|
-
declare function parseTokens(tokensPath: string): Promise<TokenCategory[]>;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/tokens/preview.d.ts
|
|
76
|
-
type MuseaTokenPreviewKind = "color" | "spacing" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "shadow" | "radius" | "opacity" | "zIndex" | "generic";
|
|
77
|
-
interface MuseaTokenPreviewRule {
|
|
78
|
-
kind: MuseaTokenPreviewKind;
|
|
79
|
-
type?: string | string[];
|
|
80
|
-
pathIncludes?: string | string[];
|
|
81
|
-
nameIncludes?: string | string[];
|
|
82
|
-
referencePathIncludes?: string | string[];
|
|
83
|
-
}
|
|
84
|
-
interface MuseaTokenPreviewConfig {
|
|
85
|
-
/**
|
|
86
|
-
* User rules are evaluated before Musea's built-in token preview heuristics.
|
|
87
|
-
* Use `kind: "generic"` to intentionally suppress a preview for matching tokens.
|
|
88
|
-
*/
|
|
89
|
-
rules?: MuseaTokenPreviewRule[];
|
|
90
|
-
/** Disable selected preview kinds after custom and built-in rules are evaluated. */
|
|
91
|
-
disabledKinds?: MuseaTokenPreviewKind[];
|
|
92
|
-
}
|
|
93
|
-
interface ResolvedTokenPreview {
|
|
94
|
-
kind: MuseaTokenPreviewKind;
|
|
95
|
-
value: string | number;
|
|
96
|
-
tokenPath: string;
|
|
97
|
-
reference?: {
|
|
98
|
-
path: string;
|
|
99
|
-
token?: DesignToken;
|
|
100
|
-
value?: string | number;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
interface ResolveTokenPreviewInput {
|
|
104
|
-
tokenPath: string;
|
|
105
|
-
token: DesignToken;
|
|
106
|
-
tokenMap?: Record<string, DesignToken>;
|
|
107
|
-
config?: MuseaTokenPreviewConfig;
|
|
108
|
-
}
|
|
109
|
-
declare function resolveTokenPreview(input: ResolveTokenPreviewInput): ResolvedTokenPreview;
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/types/plugin.d.ts
|
|
112
|
-
type MuseaVueVersion = 0.11 | 1 | 2 | "2.7" | 3 | "legacy";
|
|
113
|
-
/**
|
|
114
|
-
* Theme color definitions for Musea gallery UI.
|
|
115
|
-
* All properties are optional — unspecified colors inherit from the `base` built-in theme.
|
|
116
|
-
*/
|
|
117
|
-
interface MuseaThemeColors {
|
|
118
|
-
bgPrimary?: string;
|
|
119
|
-
bgSecondary?: string;
|
|
120
|
-
bgTertiary?: string;
|
|
121
|
-
bgElevated?: string;
|
|
122
|
-
accent?: string;
|
|
123
|
-
accentHover?: string;
|
|
124
|
-
accentContrast?: string;
|
|
125
|
-
accentSubtle?: string;
|
|
126
|
-
text?: string;
|
|
127
|
-
textSecondary?: string;
|
|
128
|
-
textMuted?: string;
|
|
129
|
-
border?: string;
|
|
130
|
-
borderSubtle?: string;
|
|
131
|
-
success?: string;
|
|
132
|
-
error?: string;
|
|
133
|
-
info?: string;
|
|
134
|
-
warning?: string;
|
|
135
|
-
shadow?: string;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Custom theme definition.
|
|
139
|
-
*/
|
|
140
|
-
interface MuseaTheme {
|
|
141
|
-
/** Unique name for this theme. */
|
|
142
|
-
name: string;
|
|
143
|
-
/** Built-in theme to inherit unspecified colors from. @default 'dark' */
|
|
144
|
-
base?: "dark" | "light";
|
|
145
|
-
/** Color overrides. */
|
|
146
|
-
colors: MuseaThemeColors;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Musea plugin options.
|
|
150
|
-
*/
|
|
151
|
-
interface MuseaOptions {
|
|
152
|
-
/**
|
|
153
|
-
* Glob patterns to include Art files.
|
|
154
|
-
* @default ['**\/*.art.vue']
|
|
155
|
-
*/
|
|
156
|
-
include?: string[];
|
|
157
|
-
/**
|
|
158
|
-
* Glob patterns to exclude.
|
|
159
|
-
* @default ['node_modules/**', 'dist/**']
|
|
160
|
-
*/
|
|
161
|
-
exclude?: string[];
|
|
162
|
-
/**
|
|
163
|
-
* Base path for Musea gallery UI.
|
|
164
|
-
* @default '/__musea__'
|
|
165
|
-
*/
|
|
166
|
-
basePath?: string;
|
|
167
|
-
/**
|
|
168
|
-
* Enable Storybook CSF output.
|
|
169
|
-
* @default false
|
|
170
|
-
*/
|
|
171
|
-
storybookCompat?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* Storybook output directory (when storybookCompat is true).
|
|
174
|
-
* @default '.storybook/stories'
|
|
175
|
-
*/
|
|
176
|
-
storybookOutDir?: string;
|
|
177
|
-
/**
|
|
178
|
-
* Enable inline <art> blocks in regular .vue SFC files.
|
|
179
|
-
* When enabled, regular .vue files containing <art> blocks will be
|
|
180
|
-
* included in the gallery. Use <Self> to reference the host component.
|
|
181
|
-
* @default false
|
|
182
|
-
*/
|
|
183
|
-
inlineArt?: boolean;
|
|
184
|
-
/**
|
|
185
|
-
* VRT (Visual Regression Testing) configuration.
|
|
186
|
-
*/
|
|
187
|
-
vrt?: VrtOptions;
|
|
188
|
-
/**
|
|
189
|
-
* Path to a Style Dictionary tokens JSON file/directory or Tailwind CSS theme file.
|
|
190
|
-
* Supports standard Style Dictionary format and Tailwind v4 `@theme` CSS variables.
|
|
191
|
-
* @example 'src/tokens.json', 'src/tokens/', or 'src/styles/main.css'
|
|
192
|
-
*/
|
|
193
|
-
tokensPath?: string;
|
|
194
|
-
/**
|
|
195
|
-
* Design token preview rules for the gallery.
|
|
196
|
-
* Custom rules run before Musea's built-in previews.
|
|
197
|
-
*/
|
|
198
|
-
tokenPreviews?: MuseaTokenPreviewConfig;
|
|
199
|
-
/**
|
|
200
|
-
* Project root that should be treated as the outer boundary for path resolution
|
|
201
|
-
* (notably `tokensPath`). When set, sibling directories of the Vite root that
|
|
202
|
-
* live under this project root are allowed.
|
|
203
|
-
*
|
|
204
|
-
* Frameworks like Nuxt set this to their project root so a Vite app rooted at
|
|
205
|
-
* `app/` can still load tokens from `<project>/design/tokens`.
|
|
206
|
-
*
|
|
207
|
-
* Defaults to the Vite root when unset.
|
|
208
|
-
*/
|
|
209
|
-
projectRoot?: string;
|
|
210
|
-
/**
|
|
211
|
-
* Gallery theme configuration.
|
|
212
|
-
*
|
|
213
|
-
* - `'dark'` / `'light'` — use a built-in theme (default: `'dark'`)
|
|
214
|
-
* - `'system'` — follow the OS color-scheme preference
|
|
215
|
-
* - `MuseaTheme` — single custom theme (replaces defaults)
|
|
216
|
-
* - `MuseaTheme[]` — multiple custom themes (first is default, user can switch)
|
|
217
|
-
*/
|
|
218
|
-
theme?: "dark" | "light" | "system" | MuseaTheme | MuseaTheme[];
|
|
219
|
-
/**
|
|
220
|
-
* CSS files to inject into component preview iframes.
|
|
221
|
-
* Useful for loading global styles (custom properties, resets, fonts, etc.)
|
|
222
|
-
* that components depend on.
|
|
223
|
-
*
|
|
224
|
-
* Project-relative and `./` paths resolve against the project root.
|
|
225
|
-
* Bare specifiers (`normalize.css`, `@fontsource/inter/index.css`) are
|
|
226
|
-
* left for Vite to resolve.
|
|
227
|
-
* @example ['app/assets/styles/main.css', 'normalize.css']
|
|
228
|
-
*/
|
|
229
|
-
previewCss?: string[];
|
|
230
|
-
/**
|
|
231
|
-
* Path to a module that exports a default setup function for preview iframes.
|
|
232
|
-
* The function receives the Vue `App` instance and can install plugins
|
|
233
|
-
* (e.g. vue-i18n, vue-router) before the component is mounted.
|
|
234
|
-
*
|
|
235
|
-
* Signature: `(app: App) => void | Promise<void>`
|
|
236
|
-
*
|
|
237
|
-
* Path is resolved relative to the project root.
|
|
238
|
-
* @example 'musea.preview.ts'
|
|
239
|
-
*/
|
|
240
|
-
previewSetup?: string;
|
|
241
|
-
/**
|
|
242
|
-
* Host Vue version for preview runtime compatibility checks.
|
|
243
|
-
* @default 3
|
|
244
|
-
*/
|
|
245
|
-
vueVersion?: MuseaVueVersion;
|
|
246
|
-
/**
|
|
247
|
-
* Vue runtime compiler entry used by the static preview alias for bare `vue`.
|
|
248
|
-
* Defaults to resolving `vue/dist/vue.esm-bundler.js` from the Vite project root.
|
|
249
|
-
*
|
|
250
|
-
* Use this when a workspace needs a custom Vue build or a non-standard package
|
|
251
|
-
* manager layout.
|
|
252
|
-
*/
|
|
253
|
-
vueRuntimeCompiler?: string;
|
|
254
|
-
}
|
|
255
|
-
//#endregion
|
|
256
8
|
//#region src/plugin/index.d.ts
|
|
257
9
|
declare function musea(options?: MuseaOptions): Plugin[];
|
|
258
10
|
//#endregion
|
|
@@ -314,5 +66,5 @@ declare function generateTokensMarkdown(categories: TokenCategory[]): string;
|
|
|
314
66
|
*/
|
|
315
67
|
declare function processStyleDictionary(config: StyleDictionaryConfig): Promise<StyleDictionaryOutput>;
|
|
316
68
|
//#endregion
|
|
317
|
-
export { type A11yOptions, type A11yResult, type A11ySummary, type AnalysisApiResponse, type ArtFileInfo, type ArtMetadata, type ArtVariant, type AutogenOptions, type AutogenOutput, type CaptureConfig, type CiConfig, type ComparisonConfig, type CsfOutput, type DesignToken, type GeneratedVariant, MuseaA11yRunner, type MuseaOptions, type MuseaTheme, type MuseaThemeColors, type MuseaTokenPreviewConfig, type MuseaTokenPreviewKind, type MuseaTokenPreviewRule, MuseaVrtRunner, type PaletteApiResponse, type PropDefinition, type ResolvedTokenPreview, type StyleDictionaryConfig, type StyleDictionaryOutput, type TokenCategory, type TokenUsageMap, type ViewportConfig, type VrtOptions, type VrtResult, type VrtSummary, buildTokenMap, musea as default, musea, generateArtFile, generateTokensHtml, generateTokensMarkdown, generateVrtJsonReport, generateVrtReport, parseTokens, processStyleDictionary, resolveReferences, resolveTokenPreview, scanTokenUsage, writeArtFile };
|
|
69
|
+
export { type A11yOptions, type A11yResult, type A11ySummary, type AnalysisApiResponse, type ArtFileInfo, type ArtMetadata, type ArtVariant, type AutogenOptions, type AutogenOutput, type CaptureConfig, type CiConfig, type ComparisonConfig, type CsfOutput, type DesignToken, type GeneratedVariant, MuseaA11yRunner, type MuseaOptions, type MuseaTheme, type MuseaThemeColors, type MuseaTokenPreviewConfig, type MuseaTokenPreviewKind, type MuseaTokenPreviewRule, type MuseaVrtOptions, MuseaVrtRunner, type PaletteApiResponse, type PropDefinition, type ResolvedTokenPreview, type StyleDictionaryConfig, type StyleDictionaryOutput, type TokenCategory, type TokenUsageMap, type ViewportConfig, type VrtOptions, type VrtResult, type VrtSummary, buildTokenMap, musea as default, musea, generateArtFile, generateTokensHtml, generateTokensMarkdown, generateVrtJsonReport, generateVrtReport, parseTokens, processStyleDictionary, resolveReferences, resolveTokenPreview, scanTokenUsage, writeArtFile };
|
|
318
70
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/plugin/index.ts","../src/tokens/usage.ts","../src/tokens/resolver.ts","../src/tokens/generator.ts"],"mappings":";;;;;;;;iBA0CgB,KAAA,CAAM,OAAA,GAAS,YAAA,GAAoB,MAAM;;;;AAAA;;iBCFzC,cAAA,CACd,QAAA,EAAU,GAAA;EAAc,IAAA;EAAc,QAAA;IAAY,KAAA;IAAe,QAAA;EAAA;AAAA,IACjE,QAAA,EAAU,MAAA,SAAe,WAAA,IACxB,aAAA;;;ADDH;;;AAAA,UErBiB,eAAA;EACf,IAAA;EACA,WAAA;EACA,QAAA;AAAA;AFkBuD;;;AAAA,UEZxC,eAAA;EACf,OAAA;EACA,QAAA;EACA,WAAA;EACA,OAAA,EAAS,eAAe;AAAA;;;;KAMd,aAAA,GAAgB,MAAM,SAAS,eAAA;;;;iBAqB3B,aAAA,CAAc,UAAA,EAAY,aAAA,KAAkB,MAAA,SAAe,WAAA;;;;iBAO3D,iBAAA,CACd,UAAA,EAAY,aAAA,IACZ,SAAA,EAAW,MAAA,SAAe,WAAA;;;;AF5B5B;;iBGHgB,kBAAA,CAAmB,UAA2B,EAAf,aAAa;;;;iBAgI5C,sBAAA,CAAuB,UAA2B,EAAf,aAAa;;AH7HP;;;iBGqInC,sBAAA,CACpB,MAAA,EAAQ,qBAAA,GACP,OAAA,CAAQ,qBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as generateGalleryGlobalsScript, i as generateDevGlobalsScript, n as generateGalleryScript, r as generateGalleryModule, t as generateGalleryBody } from "./template-
|
|
3
|
-
import { i as MuseaVrtRunner, n as generateVrtJsonReport, r as generateVrtReport } from "./vrt-
|
|
4
|
-
import { t as MuseaA11yRunner } from "./a11y-
|
|
1
|
+
import { A as resolveInsideAny, C as parseJsonBody, D as assertVueSourcePath, E as assertArtVueSourcePath, F as loadNative, M as resolveUrlPathInside, N as HttpError, O as decodeUrlComponent, P as analyzeSfcFallback, S as createDevSessionToken, T as validateDevApiRequest, _ as scanArtFiles, a as parseScriptSetupForArt, c as resolveArtComponent, d as resolveReadableArtPath, f as buildThemeConfig, g as resolveScanRoots, h as matchGlob, i as generateArtModule, j as resolveTrustedSourcePath, k as resolveInside, l as allowedSourceRoots, m as generateStorybookFiles, o as rewriteRelativeImportStatement, p as escapeHtml, r as processMuseaArtFile, s as expandSelfTag, t as attachMuseaOptions, u as resolveComponentSourcePath, v as shouldProcess, w as serializeScriptValue, x as collectRequestBody, y as toPascalCase } from "./options-CGA4BetG.mjs";
|
|
2
|
+
import { a as generateGalleryGlobalsScript, i as generateDevGlobalsScript, n as generateGalleryScript, r as generateGalleryModule, t as generateGalleryBody } from "./template-B_y7_OsF.mjs";
|
|
3
|
+
import { i as MuseaVrtRunner, n as generateVrtJsonReport, r as generateVrtReport } from "./vrt-DYTmYF1X.mjs";
|
|
4
|
+
import { t as MuseaA11yRunner } from "./a11y-Ci9EEv6F.mjs";
|
|
5
5
|
import { n as writeArtFile, t as generateArtFile } from "./autogen-B-N0cJbZ.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import fs from "node:fs";
|
|
@@ -768,7 +768,7 @@ async function tryLoadSourceGalleryHtml(devServer, url, basePath, devSessionToke
|
|
|
768
768
|
return devServer.transformIndexHtml(url, html);
|
|
769
769
|
}
|
|
770
770
|
async function generateFallbackGalleryHtml(basePath, devSessionToken, themeConfig, tokenPreviewConfig) {
|
|
771
|
-
const { generateGalleryHtml } = await import("./gallery-
|
|
771
|
+
const { generateGalleryHtml } = await import("./gallery-DnAsudTG.mjs");
|
|
772
772
|
return generateGalleryHtml(basePath, devSessionToken, themeConfig, tokenPreviewConfig);
|
|
773
773
|
}
|
|
774
774
|
async function serveGalleryAsset(galleryDistDir, requestUrl, res) {
|
|
@@ -2267,12 +2267,14 @@ async function handleGenerate(ctx, body, sendJson, sendError) {
|
|
|
2267
2267
|
sendError("Missing required field: componentPath", 400);
|
|
2268
2268
|
return;
|
|
2269
2269
|
}
|
|
2270
|
-
if (!reqComponentPath.endsWith(".vue")) {
|
|
2270
|
+
if (!reqComponentPath.toLowerCase().endsWith(".vue")) {
|
|
2271
2271
|
sendError("componentPath must be a .vue file", 400);
|
|
2272
2272
|
return;
|
|
2273
2273
|
}
|
|
2274
|
+
const componentPath = resolveInside(ctx.config.root, reqComponentPath, "componentPath");
|
|
2275
|
+
assertVueSourcePath(componentPath, "componentPath");
|
|
2274
2276
|
const { generateArtFile: genArt } = await import("./autogen/index.mjs");
|
|
2275
|
-
const result = await genArt(
|
|
2277
|
+
const result = await genArt(componentPath, autogenOptions);
|
|
2276
2278
|
sendJson({
|
|
2277
2279
|
generated: true,
|
|
2278
2280
|
componentName: result.componentName,
|
|
@@ -2407,6 +2409,7 @@ function createApiMiddleware(ctx) {
|
|
|
2407
2409
|
return;
|
|
2408
2410
|
}
|
|
2409
2411
|
const safeArtPath = resolveInside(ctx.config.root, artPath, "art path");
|
|
2412
|
+
assertArtVueSourcePath(safeArtPath);
|
|
2410
2413
|
const { source } = parseJsonBody(await readBody());
|
|
2411
2414
|
if (typeof source !== "string") {
|
|
2412
2415
|
sendError("Missing required field: source", 400);
|
|
@@ -3454,7 +3457,7 @@ function musea(options = {}) {
|
|
|
3454
3457
|
});
|
|
3455
3458
|
if (info) artFiles.set(filePath, info);
|
|
3456
3459
|
}
|
|
3457
|
-
return [mainPlugin];
|
|
3460
|
+
return [attachMuseaOptions(mainPlugin, options)];
|
|
3458
3461
|
}
|
|
3459
3462
|
function resolveProjectRoot(projectRoot, viteRoot) {
|
|
3460
3463
|
if (!projectRoot) return void 0;
|