@seed-ship/mcp-ui-solid 6.24.0 → 7.0.0
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/CHANGELOG.md +64 -0
- package/README.md +61 -0
- package/dist/adapters/connector.cjs +3 -3
- package/dist/adapters/connector.cjs.map +1 -1
- package/dist/adapters/connector.d.cts +108 -0
- package/dist/adapters/connector.d.ts +1 -2
- package/dist/adapters/connector.js +3 -3
- package/dist/adapters/connector.js.map +1 -1
- package/dist/adapters/index.d.cts +21 -0
- package/dist/adapters/index.d.ts +6 -7
- package/dist/adapters/macro-run.d.cts +99 -0
- package/dist/adapters/macro-run.d.ts +1 -2
- package/dist/adapters/presentation.d.cts +1 -2
- package/dist/adapters/presentation.d.ts +1 -2
- package/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/components/ActionGroupRenderer.cjs +6 -6
- package/dist/components/ActionGroupRenderer.cjs.map +1 -1
- package/dist/components/ActionGroupRenderer.d.cts +38 -0
- package/dist/components/ActionGroupRenderer.d.ts +1 -2
- package/dist/components/ActionGroupRenderer.js +6 -6
- package/dist/components/ActionGroupRenderer.js.map +1 -1
- package/dist/components/ActionRenderer.d.cts +9 -0
- package/dist/components/ActionRenderer.d.ts +0 -1
- package/dist/components/AgentCard.d.cts +19 -0
- package/dist/components/AgentCard.d.ts +1 -2
- package/dist/components/AgentHandoff.d.cts +11 -0
- package/dist/components/AgentHandoff.d.ts +1 -2
- package/dist/components/ArtifactRenderer.d.cts +11 -0
- package/dist/components/ArtifactRenderer.d.ts +0 -1
- package/dist/components/AutocompleteDropdown.cjs +6 -6
- package/dist/components/AutocompleteDropdown.cjs.map +1 -1
- package/dist/components/AutocompleteDropdown.d.cts +70 -0
- package/dist/components/AutocompleteDropdown.d.ts +1 -2
- package/dist/components/AutocompleteDropdown.js +6 -6
- package/dist/components/AutocompleteDropdown.js.map +1 -1
- package/dist/components/AutocompleteFormField.cjs +6 -5
- package/dist/components/AutocompleteFormField.cjs.map +1 -1
- package/dist/components/AutocompleteFormField.d.cts +51 -0
- package/dist/components/AutocompleteFormField.d.ts +1 -2
- package/dist/components/AutocompleteFormField.d.ts.map +1 -1
- package/dist/components/AutocompleteFormField.js +6 -5
- package/dist/components/AutocompleteFormField.js.map +1 -1
- package/dist/components/BriefingDiff.d.cts +11 -0
- package/dist/components/BriefingDiff.d.ts +1 -2
- package/dist/components/CarouselRenderer.d.cts +12 -0
- package/dist/components/CarouselRenderer.d.ts +1 -2
- package/dist/components/ChartJSRenderer.cjs +216 -6
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.cts +62 -0
- package/dist/components/ChartJSRenderer.d.ts +1 -2
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +217 -7
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/ChatPrompt.cjs +5 -5
- package/dist/components/ChatPrompt.cjs.map +1 -1
- package/dist/components/ChatPrompt.d.cts +69 -0
- package/dist/components/ChatPrompt.d.ts +1 -2
- package/dist/components/ChatPrompt.js +5 -5
- package/dist/components/ChatPrompt.js.map +1 -1
- package/dist/components/CodeBlockRenderer.d.cts +23 -0
- package/dist/components/CodeBlockRenderer.d.ts +1 -2
- package/dist/components/ComponentToolbar.cjs +5 -5
- package/dist/components/ComponentToolbar.cjs.map +1 -1
- package/dist/components/ComponentToolbar.d.cts +46 -0
- package/dist/components/ComponentToolbar.d.ts +0 -1
- package/dist/components/ComponentToolbar.js +5 -5
- package/dist/components/ComponentToolbar.js.map +1 -1
- package/dist/components/DataPreviewSection.d.cts +11 -0
- package/dist/components/DataPreviewSection.d.ts +1 -2
- package/dist/components/DegradedFallback.cjs +1 -1
- package/dist/components/DegradedFallback.cjs.map +1 -1
- package/dist/components/DegradedFallback.d.cts +43 -0
- package/dist/components/DegradedFallback.d.ts +0 -1
- package/dist/components/DegradedFallback.js +1 -1
- package/dist/components/DegradedFallback.js.map +1 -1
- package/dist/components/DraggableGridItem.d.cts +94 -0
- package/dist/components/DraggableGridItem.d.ts +1 -2
- package/dist/components/EditableLayoutContext.d.cts +4 -0
- package/dist/components/EditableLayoutContext.d.ts +0 -1
- package/dist/components/EditableUIResourceRenderer.d.cts +42 -0
- package/dist/components/EditableUIResourceRenderer.d.ts +1 -2
- package/dist/components/ElicitationForm.d.cts +67 -0
- package/dist/components/ElicitationForm.d.ts +1 -2
- package/dist/components/ExpandableWrapper.cjs +10 -7
- package/dist/components/ExpandableWrapper.cjs.map +1 -1
- package/dist/components/ExpandableWrapper.d.cts +49 -0
- package/dist/components/ExpandableWrapper.d.ts +0 -1
- package/dist/components/ExpandableWrapper.d.ts.map +1 -1
- package/dist/components/ExpandableWrapper.js +10 -7
- package/dist/components/ExpandableWrapper.js.map +1 -1
- package/dist/components/FeedbackInline.d.cts +70 -0
- package/dist/components/FeedbackInline.d.ts +0 -1
- package/dist/components/FooterRenderer.d.cts +15 -0
- package/dist/components/FooterRenderer.d.ts +0 -1
- package/dist/components/FormFieldRenderer.cjs +13 -12
- package/dist/components/FormFieldRenderer.cjs.map +1 -1
- package/dist/components/FormFieldRenderer.d.cts +19 -0
- package/dist/components/FormFieldRenderer.d.ts +1 -2
- package/dist/components/FormFieldRenderer.d.ts.map +1 -1
- package/dist/components/FormFieldRenderer.js +13 -12
- package/dist/components/FormFieldRenderer.js.map +1 -1
- package/dist/components/FormRenderer.cjs +1 -1
- package/dist/components/FormRenderer.cjs.map +1 -1
- package/dist/components/FormRenderer.d.cts +14 -0
- package/dist/components/FormRenderer.d.ts +1 -2
- package/dist/components/FormRenderer.js +1 -1
- package/dist/components/FormRenderer.js.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.d.cts +58 -0
- package/dist/components/GenerativeUIErrorBoundary.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.default.d.cts +1 -0
- package/dist/components/GenerativeUIErrorBoundary.default.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.js +1 -1
- package/dist/components/GenerativeUIErrorBoundary.js.map +1 -1
- package/dist/components/GhostText.cjs +2 -2
- package/dist/components/GhostText.cjs.map +1 -1
- package/dist/components/GhostText.d.cts +112 -0
- package/dist/components/GhostText.d.ts +0 -1
- package/dist/components/GhostText.js +2 -2
- package/dist/components/GhostText.js.map +1 -1
- package/dist/components/GraphRenderer.cjs +100 -29
- package/dist/components/GraphRenderer.cjs.map +1 -1
- package/dist/components/GraphRenderer.d.cts +66 -0
- package/dist/components/GraphRenderer.d.ts +2 -3
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +100 -29
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/GridRenderer.d.cts +49 -0
- package/dist/components/GridRenderer.d.ts +1 -2
- package/dist/components/IframeFallbackLink.d.cts +22 -0
- package/dist/components/IframeFallbackLink.d.ts +0 -1
- package/dist/components/ImageGalleryRenderer.d.cts +22 -0
- package/dist/components/ImageGalleryRenderer.d.ts +1 -2
- package/dist/components/LightboxOverlay.d.cts +31 -0
- package/dist/components/LightboxOverlay.d.ts +1 -2
- package/dist/components/MapRenderer.d.cts +77 -0
- package/dist/components/MapRenderer.d.ts +1 -2
- package/dist/components/MissingValue.cjs +2 -2
- package/dist/components/MissingValue.cjs.map +1 -1
- package/dist/components/MissingValue.d.cts +26 -0
- package/dist/components/MissingValue.d.ts +0 -1
- package/dist/components/MissingValue.js +2 -2
- package/dist/components/MissingValue.js.map +1 -1
- package/dist/components/ModalRenderer.cjs +39 -31
- package/dist/components/ModalRenderer.cjs.map +1 -1
- package/dist/components/ModalRenderer.d.cts +66 -0
- package/dist/components/ModalRenderer.d.ts +1 -2
- package/dist/components/ModalRenderer.d.ts.map +1 -1
- package/dist/components/ModalRenderer.js +40 -32
- package/dist/components/ModalRenderer.js.map +1 -1
- package/dist/components/PortalDropdownMenu.cjs +6 -3
- package/dist/components/PortalDropdownMenu.cjs.map +1 -1
- package/dist/components/PortalDropdownMenu.d.cts +55 -0
- package/dist/components/PortalDropdownMenu.d.ts +0 -1
- package/dist/components/PortalDropdownMenu.d.ts.map +1 -1
- package/dist/components/PortalDropdownMenu.js +7 -4
- package/dist/components/PortalDropdownMenu.js.map +1 -1
- package/dist/components/PresentationFeedback.d.cts +112 -0
- package/dist/components/PresentationFeedback.d.ts +0 -1
- package/dist/components/RenderContext.d.cts +41 -0
- package/dist/components/RenderContext.d.ts +1 -2
- package/dist/components/ResizeHandle.d.cts +49 -0
- package/dist/components/ResizeHandle.d.ts +0 -1
- package/dist/components/SafeHtml.d.cts +45 -0
- package/dist/components/SafeHtml.d.ts +0 -1
- package/dist/components/ScratchpadPanel.cjs +38 -44
- package/dist/components/ScratchpadPanel.cjs.map +1 -1
- package/dist/components/ScratchpadPanel.d.cts +34 -0
- package/dist/components/ScratchpadPanel.d.ts +1 -2
- package/dist/components/ScratchpadPanel.d.ts.map +1 -1
- package/dist/components/ScratchpadPanel.js +38 -44
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/components/SplitStepper.d.cts +11 -0
- package/dist/components/SplitStepper.d.ts +1 -2
- package/dist/components/StreamingUIRenderer.d.cts +58 -0
- package/dist/components/StreamingUIRenderer.d.ts +3 -4
- package/dist/components/UIResourceRenderer.cjs +20 -20
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.cts +181 -0
- package/dist/components/UIResourceRenderer.d.ts +3 -4
- package/dist/components/UIResourceRenderer.default.d.cts +1 -0
- package/dist/components/UIResourceRenderer.default.d.ts +1 -2
- package/dist/components/UIResourceRenderer.js +20 -20
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/VerifiedText.d.cts +22 -0
- package/dist/components/VerifiedText.d.ts +1 -2
- package/dist/components/VideoRenderer.d.cts +41 -0
- package/dist/components/VideoRenderer.d.ts +1 -2
- package/dist/components/chart-data-table.d.cts +68 -0
- package/dist/components/chart-data-table.d.ts +0 -1
- package/dist/components/chart-missing-plugin.cjs +4 -4
- package/dist/components/chart-missing-plugin.cjs.map +1 -1
- package/dist/components/chart-missing-plugin.d.cts +128 -0
- package/dist/components/chart-missing-plugin.d.ts +4 -3
- package/dist/components/chart-missing-plugin.d.ts.map +1 -1
- package/dist/components/chart-missing-plugin.js +4 -4
- package/dist/components/chart-missing-plugin.js.map +1 -1
- package/dist/components/index.d.cts +62 -0
- package/dist/components/index.d.ts +57 -58
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/context/AutocompleteContext.d.cts +76 -0
- package/dist/context/AutocompleteContext.d.ts +1 -2
- package/dist/context/MCPActionContext.d.cts +169 -0
- package/dist/context/MCPActionContext.d.ts +0 -1
- package/dist/context/MCPUIConfigContext.d.cts +201 -0
- package/dist/context/MCPUIConfigContext.d.ts +1 -2
- package/dist/context/MCPUIMathContext.d.cts +17 -0
- package/dist/context/MCPUIMathContext.d.ts +0 -1
- package/dist/context/MCPUIStringsContext.d.cts +802 -0
- package/dist/context/MCPUIStringsContext.d.ts +1 -2
- package/dist/context/MCPUITelemetryContext.d.cts +35 -0
- package/dist/context/MCPUITelemetryContext.d.ts +1 -2
- package/dist/context/index.d.cts +7 -0
- package/dist/context/index.d.ts +2 -3
- package/dist/hooks/createResponsiveGrid.d.cts +5 -0
- package/dist/hooks/createResponsiveGrid.d.ts +0 -1
- package/dist/hooks/index.d.cts +25 -0
- package/dist/hooks/index.d.ts +20 -21
- package/dist/hooks/useAction.d.cts +164 -0
- package/dist/hooks/useAction.d.ts +2 -3
- package/dist/hooks/useAutocomplete.d.cts +118 -0
- package/dist/hooks/useAutocomplete.d.ts +1 -2
- package/dist/hooks/useChatBus.d.cts +55 -0
- package/dist/hooks/useChatBus.d.ts +1 -2
- package/dist/hooks/useConditionalField.d.cts +34 -0
- package/dist/hooks/useConditionalField.d.ts +1 -2
- package/dist/hooks/useDataValidator.d.cts +41 -0
- package/dist/hooks/useDataValidator.d.ts +1 -2
- package/dist/hooks/useDragDrop.d.cts +99 -0
- package/dist/hooks/useDragDrop.d.ts +1 -2
- package/dist/hooks/useFormPersistence.d.cts +80 -0
- package/dist/hooks/useFormPersistence.d.ts +0 -1
- package/dist/hooks/useModal.d.cts +106 -0
- package/dist/hooks/useModal.d.ts +0 -1
- package/dist/hooks/useResize.d.cts +86 -0
- package/dist/hooks/useResize.d.ts +1 -2
- package/dist/hooks/useStreamingUI.d.cts +117 -0
- package/dist/hooks/useStreamingUI.d.ts +1 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.d.cts +91 -92
- package/dist/index.d.ts +91 -92
- package/dist/plugins/duckdb.d.cts +1 -2
- package/dist/plugins/duckdb.d.ts +1 -2
- package/dist/plugins/groq.d.cts +12 -0
- package/dist/plugins/groq.d.ts +1 -2
- package/dist/plugins/index.d.cts +9 -0
- package/dist/plugins/index.d.ts +3 -4
- package/dist/plugins/katex.d.cts +1 -2
- package/dist/plugins/katex.d.ts +1 -2
- package/dist/plugins/rest.d.cts +12 -0
- package/dist/plugins/rest.d.ts +1 -2
- package/dist/plugins/supabase.d.cts +12 -0
- package/dist/plugins/supabase.d.ts +1 -2
- package/dist/services/chat-bus.d.cts +100 -0
- package/dist/services/chat-bus.d.ts +1 -2
- package/dist/services/chat-prompt-controller.d.cts +92 -0
- package/dist/services/chat-prompt-controller.d.ts +1 -2
- package/dist/services/component-registry.d.cts +119 -0
- package/dist/services/component-registry.d.ts +1 -2
- package/dist/services/data-validator.d.cts +27 -0
- package/dist/services/data-validator.d.ts +1 -2
- package/dist/services/index.d.cts +9 -0
- package/dist/services/index.d.ts +4 -5
- package/dist/services/telemetry.d.cts +86 -0
- package/dist/services/telemetry.d.ts +1 -2
- package/dist/services/validation.d.cts +169 -0
- package/dist/services/validation.d.ts +1 -2
- package/dist/stores/scratchpad-store.d.cts +109 -0
- package/dist/stores/scratchpad-store.d.ts +1 -2
- package/dist/stores/server-capabilities-store.d.cts +171 -0
- package/dist/stores/server-capabilities-store.d.ts +0 -1
- package/dist/test-setup.d.cts +5 -0
- package/dist/test-setup.d.ts +0 -1
- package/dist/testing/index.d.cts +34 -0
- package/dist/testing/index.d.ts +1 -2
- package/dist/types/chat-bus.d.cts +783 -0
- package/dist/types/chat-bus.d.ts +4 -5
- package/dist/types/index.d.cts +1616 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types-export.d.cts +1 -2
- package/dist/types-export.d.ts +1 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/degraded-projections.d.cts +119 -0
- package/dist/utils/degraded-projections.d.ts +0 -1
- package/dist/utils/duplicate-mount-registry.d.cts +83 -0
- package/dist/utils/duplicate-mount-registry.d.ts +0 -1
- package/dist/utils/escape-html.d.cts +12 -0
- package/dist/utils/escape-html.d.ts +0 -1
- package/dist/utils/format-string.d.cts +25 -0
- package/dist/utils/format-string.d.ts +0 -1
- package/dist/utils/iframe-coep.d.cts +53 -0
- package/dist/utils/iframe-coep.d.ts +1 -2
- package/dist/utils/logger.d.cts +57 -0
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/math-markdown.cjs +1 -1
- package/dist/utils/math-markdown.cjs.map +1 -1
- package/dist/utils/math-markdown.d.cts +15 -0
- package/dist/utils/math-markdown.d.ts +1 -2
- package/dist/utils/math-markdown.js +1 -1
- package/dist/utils/math-markdown.js.map +1 -1
- package/dist/utils/missing-value.d.cts +78 -0
- package/dist/utils/missing-value.d.ts +0 -1
- package/dist/utils/pan-zoom.d.cts +234 -0
- package/dist/utils/pan-zoom.d.ts +0 -1
- package/dist/utils/perf.d.cts +18 -0
- package/dist/utils/perf.d.ts +0 -1
- package/dist/utils/safe-url.d.cts +33 -0
- package/dist/utils/safe-url.d.ts +0 -1
- package/dist/utils/sanitize-html.d.cts +142 -0
- package/dist/utils/sanitize-html.d.ts +0 -1
- package/dist/utils/stable-key.d.cts +32 -0
- package/dist/utils/stable-key.d.ts +0 -1
- package/dist/utils/theme.cjs +91 -0
- package/dist/utils/theme.cjs.map +1 -0
- package/dist/utils/theme.d.cts +10 -0
- package/dist/utils/theme.d.ts +10 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +91 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/validation.d.cts +3 -4
- package/dist/validation.d.ts +3 -4
- package/docs/SECURITY-DEPENDENCIES.md +209 -0
- package/docs/THEMING.md +205 -0
- package/docs/ZOD4-STABLE-MIGRATION-2026-10-26.md +181 -0
- package/package.json +12 -9
- package/src/adapters/connector.ts +3 -3
- package/src/components/ActionGroupRenderer.tsx +6 -6
- package/src/components/AutocompleteDropdown.tsx +17 -17
- package/src/components/AutocompleteFormField.tsx +10 -9
- package/src/components/ChartJSRenderer.tsx +483 -239
- package/src/components/ChatPrompt.tsx +16 -16
- package/src/components/ComponentToolbar.tsx +5 -5
- package/src/components/DegradedFallback.tsx +9 -9
- package/src/components/ExpandableWrapper.tsx +15 -11
- package/src/components/FormFieldRenderer.tsx +52 -51
- package/src/components/FormRenderer.tsx +12 -12
- package/src/components/GenerativeUIErrorBoundary.tsx +6 -6
- package/src/components/GhostText.tsx +7 -7
- package/src/components/GraphRenderer.tsx +83 -67
- package/src/components/MissingValue.tsx +2 -2
- package/src/components/ModalRenderer.tsx +11 -5
- package/src/components/PortalDropdownMenu.tsx +6 -2
- package/src/components/ScratchpadPanel.tsx +144 -141
- package/src/components/UIResourceRenderer.tsx +101 -101
- package/src/components/chart-missing-plugin.ts +5 -3
- package/src/styles/autocomplete.css +53 -53
- package/src/utils/math-markdown.ts +1 -1
- package/src/utils/theme.ts +101 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.cjs","sources":["../../src/utils/theme.ts"],"sourcesContent":["import { createEffect, onCleanup } from 'solid-js'\n\nconst THEME_PREFIX = '--mcp-ui-'\n\n/** Read only explicitly supplied host tokens; blank values retain engine defaults. */\nexport function readThemeTokens(\n element: Element | undefined,\n names: readonly string[],\n): Record<string, string | undefined> {\n const result: Record<string, string | undefined> = {}\n const view = element?.ownerDocument.defaultView\n const style = element && view ? view.getComputedStyle(element) : undefined\n for (const name of names) result[name] = style?.getPropertyValue(name).trim() || undefined\n return result\n}\n\n/** Observe inherited theme changes, including moving a mounted renderer into a portal. */\nexport function observeTheme(element: HTMLElement, callback: () => void): () => void {\n const view = element.ownerDocument.defaultView\n if (!view?.MutationObserver) return () => {}\n let stopped = false\n let pending = false\n const schedule = () => {\n if (pending || stopped) return\n pending = true\n queueMicrotask(() => {\n pending = false\n if (!stopped) callback()\n })\n }\n const observer = new view.MutationObserver((records) => {\n if (records.some((record) => {\n if (record.type === 'attributes') {\n return record.target instanceof view.Element && record.target.contains(element)\n }\n return [...record.addedNodes, ...record.removedNodes].some(\n (node) => node === element || node.contains(element),\n )\n })) schedule()\n })\n // Attribute names are deliberately not filtered: hosts may use any data-* selector.\n observer.observe(element.ownerDocument.documentElement, {\n attributes: true,\n childList: true,\n subtree: true,\n })\n return () => {\n stopped = true\n observer.disconnect()\n }\n}\n\n/**\n * A body portal cannot inherit a local host theme. Copy only our effective\n * custom properties and dark state from its stationary anchor, and keep them\n * synchronized for the lifetime of the Solid owner. Geometry stays unchanged.\n */\nexport function bindPortalTheme(portal: HTMLElement, source: () => HTMLElement | undefined): void {\n createEffect(() => {\n const anchor = source()\n const view = anchor?.ownerDocument.defaultView\n if (!anchor || !view) return\n const copied = new Set<string>()\n const sync = () => {\n const style = view.getComputedStyle(anchor)\n const inherited = portal.parentElement ? view.getComputedStyle(portal.parentElement) : undefined\n const names = new Set(copied)\n for (const computed of [style, inherited]) {\n if (!computed) continue\n for (let index = 0; index < computed.length; index++) {\n const name = computed.item(index)\n if (name.startsWith(THEME_PREFIX)) names.add(name)\n }\n }\n const values = new Map<string, string>()\n for (const name of names) {\n const value = style.getPropertyValue(name).trim()\n if (value) values.set(name, value)\n // Empty setProperty removes a declaration. Explicitly block a body\n // token when the local scope reset it to the guaranteed-invalid value.\n else if (inherited?.getPropertyValue(name).trim()) values.set(name, 'initial')\n }\n for (const name of copied) {\n if (!values.has(name)) portal.style.removeProperty(name)\n }\n copied.clear()\n for (const [name, value] of values) {\n if (portal.style.getPropertyValue(name) !== value) portal.style.setProperty(name, value)\n copied.add(name)\n }\n portal.classList.toggle('dark', anchor.closest('.dark') !== null)\n }\n sync()\n const stop = observeTheme(anchor, sync)\n onCleanup(() => {\n stop()\n for (const name of copied) portal.style.removeProperty(name)\n portal.classList.remove('dark')\n })\n })\n}\n"],"names":["createEffect","onCleanup"],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Read only explicitly supplied host tokens; blank values retain engine defaults. */
|
|
2
|
+
export declare function readThemeTokens(element: Element | undefined, names: readonly string[]): Record<string, string | undefined>;
|
|
3
|
+
/** Observe inherited theme changes, including moving a mounted renderer into a portal. */
|
|
4
|
+
export declare function observeTheme(element: HTMLElement, callback: () => void): () => void;
|
|
5
|
+
/**
|
|
6
|
+
* A body portal cannot inherit a local host theme. Copy only our effective
|
|
7
|
+
* custom properties and dark state from its stationary anchor, and keep them
|
|
8
|
+
* synchronized for the lifetime of the Solid owner. Geometry stays unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare function bindPortalTheme(portal: HTMLElement, source: () => HTMLElement | undefined): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Read only explicitly supplied host tokens; blank values retain engine defaults. */
|
|
2
|
+
export declare function readThemeTokens(element: Element | undefined, names: readonly string[]): Record<string, string | undefined>;
|
|
3
|
+
/** Observe inherited theme changes, including moving a mounted renderer into a portal. */
|
|
4
|
+
export declare function observeTheme(element: HTMLElement, callback: () => void): () => void;
|
|
5
|
+
/**
|
|
6
|
+
* A body portal cannot inherit a local host theme. Copy only our effective
|
|
7
|
+
* custom properties and dark state from its stationary anchor, and keep them
|
|
8
|
+
* synchronized for the lifetime of the Solid owner. Geometry stays unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare function bindPortalTheme(portal: HTMLElement, source: () => HTMLElement | undefined): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAMpC;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAiCnF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,CA2ChG"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createEffect, onCleanup } from "solid-js";
|
|
2
|
+
const THEME_PREFIX = "--mcp-ui-";
|
|
3
|
+
function readThemeTokens(element, names) {
|
|
4
|
+
const result = {};
|
|
5
|
+
const view = element == null ? void 0 : element.ownerDocument.defaultView;
|
|
6
|
+
const style = element && view ? view.getComputedStyle(element) : void 0;
|
|
7
|
+
for (const name of names) result[name] = (style == null ? void 0 : style.getPropertyValue(name).trim()) || void 0;
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
function observeTheme(element, callback) {
|
|
11
|
+
const view = element.ownerDocument.defaultView;
|
|
12
|
+
if (!(view == null ? void 0 : view.MutationObserver)) return () => {
|
|
13
|
+
};
|
|
14
|
+
let stopped = false;
|
|
15
|
+
let pending = false;
|
|
16
|
+
const schedule = () => {
|
|
17
|
+
if (pending || stopped) return;
|
|
18
|
+
pending = true;
|
|
19
|
+
queueMicrotask(() => {
|
|
20
|
+
pending = false;
|
|
21
|
+
if (!stopped) callback();
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const observer = new view.MutationObserver((records) => {
|
|
25
|
+
if (records.some((record) => {
|
|
26
|
+
if (record.type === "attributes") {
|
|
27
|
+
return record.target instanceof view.Element && record.target.contains(element);
|
|
28
|
+
}
|
|
29
|
+
return [...record.addedNodes, ...record.removedNodes].some(
|
|
30
|
+
(node) => node === element || node.contains(element)
|
|
31
|
+
);
|
|
32
|
+
})) schedule();
|
|
33
|
+
});
|
|
34
|
+
observer.observe(element.ownerDocument.documentElement, {
|
|
35
|
+
attributes: true,
|
|
36
|
+
childList: true,
|
|
37
|
+
subtree: true
|
|
38
|
+
});
|
|
39
|
+
return () => {
|
|
40
|
+
stopped = true;
|
|
41
|
+
observer.disconnect();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function bindPortalTheme(portal, source) {
|
|
45
|
+
createEffect(() => {
|
|
46
|
+
const anchor = source();
|
|
47
|
+
const view = anchor == null ? void 0 : anchor.ownerDocument.defaultView;
|
|
48
|
+
if (!anchor || !view) return;
|
|
49
|
+
const copied = /* @__PURE__ */ new Set();
|
|
50
|
+
const sync = () => {
|
|
51
|
+
const style = view.getComputedStyle(anchor);
|
|
52
|
+
const inherited = portal.parentElement ? view.getComputedStyle(portal.parentElement) : void 0;
|
|
53
|
+
const names = new Set(copied);
|
|
54
|
+
for (const computed of [style, inherited]) {
|
|
55
|
+
if (!computed) continue;
|
|
56
|
+
for (let index = 0; index < computed.length; index++) {
|
|
57
|
+
const name = computed.item(index);
|
|
58
|
+
if (name.startsWith(THEME_PREFIX)) names.add(name);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const values = /* @__PURE__ */ new Map();
|
|
62
|
+
for (const name of names) {
|
|
63
|
+
const value = style.getPropertyValue(name).trim();
|
|
64
|
+
if (value) values.set(name, value);
|
|
65
|
+
else if (inherited == null ? void 0 : inherited.getPropertyValue(name).trim()) values.set(name, "initial");
|
|
66
|
+
}
|
|
67
|
+
for (const name of copied) {
|
|
68
|
+
if (!values.has(name)) portal.style.removeProperty(name);
|
|
69
|
+
}
|
|
70
|
+
copied.clear();
|
|
71
|
+
for (const [name, value] of values) {
|
|
72
|
+
if (portal.style.getPropertyValue(name) !== value) portal.style.setProperty(name, value);
|
|
73
|
+
copied.add(name);
|
|
74
|
+
}
|
|
75
|
+
portal.classList.toggle("dark", anchor.closest(".dark") !== null);
|
|
76
|
+
};
|
|
77
|
+
sync();
|
|
78
|
+
const stop = observeTheme(anchor, sync);
|
|
79
|
+
onCleanup(() => {
|
|
80
|
+
stop();
|
|
81
|
+
for (const name of copied) portal.style.removeProperty(name);
|
|
82
|
+
portal.classList.remove("dark");
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
bindPortalTheme,
|
|
88
|
+
observeTheme,
|
|
89
|
+
readThemeTokens
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sources":["../../src/utils/theme.ts"],"sourcesContent":["import { createEffect, onCleanup } from 'solid-js'\n\nconst THEME_PREFIX = '--mcp-ui-'\n\n/** Read only explicitly supplied host tokens; blank values retain engine defaults. */\nexport function readThemeTokens(\n element: Element | undefined,\n names: readonly string[],\n): Record<string, string | undefined> {\n const result: Record<string, string | undefined> = {}\n const view = element?.ownerDocument.defaultView\n const style = element && view ? view.getComputedStyle(element) : undefined\n for (const name of names) result[name] = style?.getPropertyValue(name).trim() || undefined\n return result\n}\n\n/** Observe inherited theme changes, including moving a mounted renderer into a portal. */\nexport function observeTheme(element: HTMLElement, callback: () => void): () => void {\n const view = element.ownerDocument.defaultView\n if (!view?.MutationObserver) return () => {}\n let stopped = false\n let pending = false\n const schedule = () => {\n if (pending || stopped) return\n pending = true\n queueMicrotask(() => {\n pending = false\n if (!stopped) callback()\n })\n }\n const observer = new view.MutationObserver((records) => {\n if (records.some((record) => {\n if (record.type === 'attributes') {\n return record.target instanceof view.Element && record.target.contains(element)\n }\n return [...record.addedNodes, ...record.removedNodes].some(\n (node) => node === element || node.contains(element),\n )\n })) schedule()\n })\n // Attribute names are deliberately not filtered: hosts may use any data-* selector.\n observer.observe(element.ownerDocument.documentElement, {\n attributes: true,\n childList: true,\n subtree: true,\n })\n return () => {\n stopped = true\n observer.disconnect()\n }\n}\n\n/**\n * A body portal cannot inherit a local host theme. Copy only our effective\n * custom properties and dark state from its stationary anchor, and keep them\n * synchronized for the lifetime of the Solid owner. Geometry stays unchanged.\n */\nexport function bindPortalTheme(portal: HTMLElement, source: () => HTMLElement | undefined): void {\n createEffect(() => {\n const anchor = source()\n const view = anchor?.ownerDocument.defaultView\n if (!anchor || !view) return\n const copied = new Set<string>()\n const sync = () => {\n const style = view.getComputedStyle(anchor)\n const inherited = portal.parentElement ? view.getComputedStyle(portal.parentElement) : undefined\n const names = new Set(copied)\n for (const computed of [style, inherited]) {\n if (!computed) continue\n for (let index = 0; index < computed.length; index++) {\n const name = computed.item(index)\n if (name.startsWith(THEME_PREFIX)) names.add(name)\n }\n }\n const values = new Map<string, string>()\n for (const name of names) {\n const value = style.getPropertyValue(name).trim()\n if (value) values.set(name, value)\n // Empty setProperty removes a declaration. Explicitly block a body\n // token when the local scope reset it to the guaranteed-invalid value.\n else if (inherited?.getPropertyValue(name).trim()) values.set(name, 'initial')\n }\n for (const name of copied) {\n if (!values.has(name)) portal.style.removeProperty(name)\n }\n copied.clear()\n for (const [name, value] of values) {\n if (portal.style.getPropertyValue(name) !== value) portal.style.setProperty(name, value)\n copied.add(name)\n }\n portal.classList.toggle('dark', anchor.closest('.dark') !== null)\n }\n sync()\n const stop = observeTheme(anchor, sync)\n onCleanup(() => {\n stop()\n for (const name of copied) portal.style.removeProperty(name)\n portal.classList.remove('dark')\n })\n })\n}\n"],"names":[],"mappings":"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"}
|
package/dist/validation.d.cts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* import { validateLayout } from '@seed-ship/mcp-ui-solid/validation'
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
export { validateComponent, validateLayout, validateGridPosition, validateChartComponent, validateTableComponent, validatePayloadSize, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, sanitizeString, DEFAULT_RESOURCE_LIMITS, validateFieldValue, validateFormData, DEFAULT_VALIDATION_MESSAGES, } from
|
|
13
|
-
export type { FormValidationMessages } from
|
|
14
|
-
export type { UIComponent, UILayout, GridPosition, ComponentType, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ValidationResult, ResourceLimits, } from
|
|
15
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
12
|
+
export { validateComponent, validateLayout, validateGridPosition, validateChartComponent, validateTableComponent, validatePayloadSize, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, sanitizeString, DEFAULT_RESOURCE_LIMITS, validateFieldValue, validateFormData, DEFAULT_VALIDATION_MESSAGES, } from "./services/validation.cjs";
|
|
13
|
+
export type { FormValidationMessages } from "./services/validation.cjs";
|
|
14
|
+
export type { UIComponent, UILayout, GridPosition, ComponentType, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ValidationResult, ResourceLimits, } from "./types.cjs";
|
package/dist/validation.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* import { validateLayout } from '@seed-ship/mcp-ui-solid/validation'
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
export { validateComponent, validateLayout, validateGridPosition, validateChartComponent, validateTableComponent, validatePayloadSize, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, sanitizeString, DEFAULT_RESOURCE_LIMITS, validateFieldValue, validateFormData, DEFAULT_VALIDATION_MESSAGES, } from
|
|
13
|
-
export type { FormValidationMessages } from
|
|
14
|
-
export type { UIComponent, UILayout, GridPosition, ComponentType, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ValidationResult, ResourceLimits, } from
|
|
15
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
12
|
+
export { validateComponent, validateLayout, validateGridPosition, validateChartComponent, validateTableComponent, validatePayloadSize, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, sanitizeString, DEFAULT_RESOURCE_LIMITS, validateFieldValue, validateFormData, DEFAULT_VALIDATION_MESSAGES, } from "./services/validation.js";
|
|
13
|
+
export type { FormValidationMessages } from "./services/validation.js";
|
|
14
|
+
export type { UIComponent, UILayout, GridPosition, ComponentType, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ValidationResult, ResourceLimits, } from "./types.js";
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Security dependency notes
|
|
2
|
+
|
|
3
|
+
## 2026-10-26 — stable fast-uri follow-up after PR #40
|
|
4
|
+
|
|
5
|
+
The workspace override floor moves from `^3.1.6` to `^3.1.9`; the pnpm 8.15.0
|
|
6
|
+
lockfile resolves **3.1.9**, without a major-4 upgrade or unrelated updates.
|
|
7
|
+
The upstream [3.1.9 release](https://github.com/fastify/fast-uri/releases/tag/v3.1.9)
|
|
8
|
+
fixes these four advisory entries:
|
|
9
|
+
|
|
10
|
+
- Moderate: [percent-decoded scheme spoofing](https://github.com/advisories/GHSA-w74x-v6f9-j3xg)
|
|
11
|
+
and [authority host confusion](https://github.com/advisories/GHSA-wjr9-j795-jxcr).
|
|
12
|
+
- Low: [relative-reference path equivalence](https://github.com/advisories/GHSA-xhq7-xmqj-769h)
|
|
13
|
+
and [suffix-reference scheme injection](https://github.com/advisories/GHSA-333x-w4r6-6crp).
|
|
14
|
+
|
|
15
|
+
The CLI publishes a direct `fast-uri: ^3.1.9` dependency and injects its default
|
|
16
|
+
import into **both** Ajv instances with the documented
|
|
17
|
+
[`uriResolver` option](https://ajv.js.org/options.html#uriresolver).
|
|
18
|
+
Ajv 8.18.0 itself requests `^3.0.1`: a workspace override or a direct dependency
|
|
19
|
+
without explicit injection cannot guarantee which copy Ajv uses in a consumer.
|
|
20
|
+
Vite leaves the dependency external in ESM and CJS, as it does for Ajv.
|
|
21
|
+
|
|
22
|
+
This protects the CLI's schema-ID and `$ref` resolution, not every URI policy
|
|
23
|
+
in a host. `validate` compiles the fixed Spec JSON Schema; `test-examples`
|
|
24
|
+
compiles registry-supplied component schemas. Format checks are a separate Ajv
|
|
25
|
+
formats path. The suffix advisory requires a non-default option not used by
|
|
26
|
+
these commands; this is not a claim that all four exploits were CLI-reachable.
|
|
27
|
+
|
|
28
|
+
Fresh full and production workspace `pnpm audit --json` runs move from four
|
|
29
|
+
entries (two moderate, two low) to **zero**, both exiting 0 after the update.
|
|
30
|
+
GitHub alerts require a separate merge/rescan; none is dismissed or suppressed.
|
|
31
|
+
An independent packed-consumer gate intentionally retains `fast-uri` 3.1.8
|
|
32
|
+
under Ajv and checks that both public CLI module formats use the direct 3.1.9
|
|
33
|
+
resolver instead. That control consumer is deliberately not audit-clean;
|
|
34
|
+
applications must update and audit their own complete dependency trees.
|
|
35
|
+
|
|
36
|
+
No renderer, Solid peer, Zod schema, package version or release workflow changes.
|
|
37
|
+
The prepared Spec 6.0.0 / Solid 7.0.0 (Solid 1) / CLI 5.0.2 versions are retained.
|
|
38
|
+
This PR neither stages nor publishes them and does not resume Solid 2 PR #34.
|
|
39
|
+
|
|
40
|
+
## 2026-10-26 — prepared stable-line Zod 4 migration
|
|
41
|
+
|
|
42
|
+
Spec 6.0.0, MCPUI Solid 7.0.0 (still Solid 1) and CLI 5.0.2 prepare real Zod
|
|
43
|
+
4.6.6 with preserved JSON omission/error-code contracts and qualified emitted
|
|
44
|
+
package declarations. This is not a Solid 2 migration or publication approval.
|
|
45
|
+
See the [decision and qualification record](./ZOD4-STABLE-MIGRATION-2026-10-26.md).
|
|
46
|
+
|
|
47
|
+
Fresh baseline full audit: one HIGH Zod plus four fast-uri entries. After the
|
|
48
|
+
upgrade, Zod is absent but the two moderate/two low fast-uri advisories remain
|
|
49
|
+
in full and production audits. Both still exit nonzero. Reconcile GitHub alerts
|
|
50
|
+
after a merge/rescan separately; no advisory is dismissed by this change.
|
|
51
|
+
|
|
52
|
+
The records below describe their dated pre-migration state; they do not override
|
|
53
|
+
the newer evidence or establish a current clean security audit.
|
|
54
|
+
|
|
55
|
+
## 2026-10-24 — compatible tooling fixes, runtime Zod still unresolved
|
|
56
|
+
|
|
57
|
+
This follow-up updates development tooling on the stable Solid 1 line. It does
|
|
58
|
+
not migrate Zod, change public schemas, dismiss advisories, or publish a package.
|
|
59
|
+
|
|
60
|
+
| Dependency | Previous lock | Updated lock | Scope |
|
|
61
|
+
| --- | --- | --- | --- |
|
|
62
|
+
| Vite | 6.4.3 | 6.4.5 | CLI, Spec and Solid development/build/test tooling; stays on major 6, compatible with the existing Solid 1 plugin. |
|
|
63
|
+
| Vitest / `@vitest/ui` / `@vitest/mocker` | 4.1.11 | 4.1.12 | Test tooling; UI is declared only by Solid. |
|
|
64
|
+
|
|
65
|
+
The exact development pins and pnpm 8.15.0 lockfile update target the five Vite
|
|
66
|
+
advisories ([Windows existence check](https://github.com/advisories/GHSA-587h-7wmj-h5pm),
|
|
67
|
+
[argument escaping](https://github.com/advisories/GHSA-698v-4r3x-3vcv),
|
|
68
|
+
[editor flags](https://github.com/advisories/GHSA-r825-w8mm-5pxw),
|
|
69
|
+
[cross-origin middleware](https://github.com/advisories/GHSA-9jrq-w75r-8gcw),
|
|
70
|
+
[filesystem allowlist](https://github.com/advisories/GHSA-rq7h-c2jc-7f22)) and
|
|
71
|
+
two mocker advisories ([manual registration](https://github.com/advisories/GHSA-qxg6-89mg-rqv8),
|
|
72
|
+
[Windows traversal](https://github.com/advisories/GHSA-xp26-3454-mjgp)).
|
|
73
|
+
|
|
74
|
+
Fresh full-workspace `pnpm audit --json` comparison on this date:
|
|
75
|
+
|
|
76
|
+
- Baseline lock: 8 distinct advisories (2 high, 5 moderate, 1 low).
|
|
77
|
+
- Updated lock: **1 high**, runtime Zod
|
|
78
|
+
[`GHSA-mrhx-c7xc-m3w5`](https://github.com/advisories/GHSA-mrhx-c7xc-m3w5).
|
|
79
|
+
- Audit exit status remains nonzero. This is not a clean security audit.
|
|
80
|
+
- GitHub's 11 open Dependabot alerts include four occurrences of the same Zod
|
|
81
|
+
advisory across manifests/lockfile. Removing seven tooling advisory entries
|
|
82
|
+
from this lock does not by itself close GitHub alerts: merge and rescan are
|
|
83
|
+
separate evidence, and package publication is separate again.
|
|
84
|
+
|
|
85
|
+
No runtime dependency, `solid-js` peer, Solid/plugin resolution, package version
|
|
86
|
+
or wire schema changes. In particular Zod remains `3.25.76`; no override forces
|
|
87
|
+
an incompatible Zod 4 resolution under the published `^3.22.4` dependency ranges.
|
|
88
|
+
The only related non-tooling lock change is Picomatch deduplication to an already
|
|
89
|
+
present `4.0.7` through the updated Vite peer graph.
|
|
90
|
+
|
|
91
|
+
### Why this does not silently switch to `zod/v3` in a Zod 4 package
|
|
92
|
+
|
|
93
|
+
The advisory lists a fix in 4.6.6. The
|
|
94
|
+
[upstream fix](https://github.com/colinhacks/zod/commit/a0ebf970f2d752e5f58527cd2942ff48be4f46bd)
|
|
95
|
+
changes the v4 collection parsers, not v3. The array, set and map parser classes
|
|
96
|
+
in the published `4.6.7/v3` API are identical to the corresponding `3.25.76`
|
|
97
|
+
classes. Using the newer package with the old subpath is not a remediation.
|
|
98
|
+
|
|
99
|
+
A bounded local probe used 32 elements, never an OOM test. For array `.max(2)`,
|
|
100
|
+
array `.length(2)` and set `.size(2)`, both old root and new `/v3` performed 32
|
|
101
|
+
element callbacks and produced 33 issues for invalid values. The real v4 API
|
|
102
|
+
stopped before element parsing and produced one issue. Synchronous and async
|
|
103
|
+
results agreed. An unbounded array still visits all elements in every version:
|
|
104
|
+
input and collection limits remain necessary even after migrating.
|
|
105
|
+
|
|
106
|
+
Spec exports its schema objects and inferred types. A real v4 migration must
|
|
107
|
+
qualify those public APIs, records, optional/default output behavior and errors
|
|
108
|
+
against the [migration guide](https://zod.dev/v4/changelog). It is a separate
|
|
109
|
+
versioning decision, not a safe lockfile-only patch. A workspace-only fork or
|
|
110
|
+
patch would not automatically protect consumers either.
|
|
111
|
+
|
|
112
|
+
The current Solid entry-point size check also continues into schema validation
|
|
113
|
+
after collecting its size error. Changing that path can reduce local exposure,
|
|
114
|
+
but cannot fix exported Zod 3 schemas called directly by consumers; it must not
|
|
115
|
+
be presented as closing the entire advisory. Runtime Zod remediation remains
|
|
116
|
+
an explicit follow-up before claiming the release is security-ready.
|
|
117
|
+
|
|
118
|
+
### Relation to Dependabot PR #37
|
|
119
|
+
|
|
120
|
+
That PR's inspected head `27ed1dc168c8efd8acc523fd3fbd1b87c046b558`
|
|
121
|
+
changes only the lockfile, resolving Zod 4.6.7 against `^3.22.4` manifest
|
|
122
|
+
specifiers. Its CI fails building Spec with 20 `z.record` signature errors.
|
|
123
|
+
This compatible tooling follow-up does not adopt that resolution or claim to
|
|
124
|
+
supersede the remaining Zod work. Reassess any later revision of #37 separately.
|
|
125
|
+
|
|
126
|
+
## Historical record: 6.25.1, verified 2026-10-18
|
|
127
|
+
|
|
128
|
+
Verified on 2026-10-18. This is a dependency-remediation record, not a claim
|
|
129
|
+
that every renderer or consuming application has been security-audited.
|
|
130
|
+
The sections below preserve that historical snapshot. Their former single
|
|
131
|
+
`braces` advisory count is not the current audit result above; its absence from
|
|
132
|
+
the current feed is not a claim that this PR patched it.
|
|
133
|
+
|
|
134
|
+
## Updates
|
|
135
|
+
|
|
136
|
+
| Dependency | Previous lock | Updated lock | Scope and advisories |
|
|
137
|
+
| --- | --- | --- | --- |
|
|
138
|
+
| DOMPurify | 3.4.13 | 3.4.17 | Required runtime dependency; published floor is `^3.4.17`. [Rawtext root](https://github.com/cure53/DOMPurify/security/advisories/GHSA-6688-9rhm-gjv2), [hook removal](https://github.com/cure53/DOMPurify/security/advisories/GHSA-p98j-92pf-mc4p) and [subsequent hardening](https://github.com/cure53/DOMPurify/releases/tag/3.4.17). |
|
|
139
|
+
| Solid / Seroval / Seroval plugins | 1.9.11 / 1.5.6 / 1.5.0 | 1.9.17 / 1.6.11 / 1.6.11 | Workspace development resolution; Solid remains a required host peer. [Callable invocation](https://github.com/lxsmnsyc/seroval/security/advisories/GHSA-p6vx-979v-rg4c), [TypedArray allocation](https://github.com/lxsmnsyc/seroval/security/advisories/GHSA-jp82-f5mq-hwhp). |
|
|
140
|
+
| source-map-js | 1.2.1 | 1.2.2 | Build/test tooling via PostCSS and css-tree. [Indexed-map denial of service](https://github.com/advisories/GHSA-68fv-2mgg-jv7q). |
|
|
141
|
+
| brace-expansion | 5.0.9 | 5.0.12 | Lint tooling via minimatch. [Rewrite complexity](https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-q2hr-2g5m-vwhr), [nested groups](https://github.com/advisories/GHSA-qhr7-859c-m2p7), [comma recursion](https://github.com/advisories/GHSA-6j4f-fj2g-mc7p). |
|
|
142
|
+
|
|
143
|
+
The sanitizer accepts strings, not live DOM nodes, and the library's profiles
|
|
144
|
+
do not use `IN_PLACE` or node-removing hooks. The two reported DOMPurify
|
|
145
|
+
preconditions were not found in these library paths; this is not a finding
|
|
146
|
+
that every possible host configuration is safe. No renderer policy is relaxed.
|
|
147
|
+
|
|
148
|
+
Solid 1.9.17 requests Seroval and its plugins in the supported `~1.6.8` range.
|
|
149
|
+
The workspace override follows that range instead of forcing Solid's old
|
|
150
|
+
`~1.5.3` resolution. Seroval 1.6.2 alone would not cover the additional
|
|
151
|
+
TypedArray advisory, which was fixed in 1.6.3.
|
|
152
|
+
|
|
153
|
+
## Host applications
|
|
154
|
+
|
|
155
|
+
This package externalizes dependencies. Its DOMPurify manifest floor affects
|
|
156
|
+
the version installed by consumers, but this repository's root pnpm overrides
|
|
157
|
+
and development lockfile do **not** propagate to an application's lockfile.
|
|
158
|
+
The public `solid-js` peer range remains `^1.9.0` for compatibility; it is not
|
|
159
|
+
a guarantee that the host has a corrected Seroval resolution.
|
|
160
|
+
|
|
161
|
+
Update the application lockfile separately. An upstream-aligned option is
|
|
162
|
+
Solid 1.9.17 with its supported Seroval/plugin 1.6.x dependencies; verify the
|
|
163
|
+
resolved versions and audit the application itself. The library's new test
|
|
164
|
+
performs a real asynchronous Solid server render with hydration serialization,
|
|
165
|
+
plus a legitimate Map/Date/typed-array/Promise JSON transport roundtrip through
|
|
166
|
+
Solid's own Seroval. It is a compatibility smoke test, not browser hydration
|
|
167
|
+
proof, an exploitability assessment of the host, or an end-to-end SolidStart test.
|
|
168
|
+
|
|
169
|
+
## Remaining advisory: braces 3.0.3
|
|
170
|
+
|
|
171
|
+
[`GHSA-vfj7-8cjw-p6xm`](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm)
|
|
172
|
+
is HIGH severity and has no patched version listed as of the verification
|
|
173
|
+
date. It concerns stack exhaustion when deeply nested, attacker-controlled
|
|
174
|
+
brace patterns reach recursive glob parsing. `braces` and `brace-expansion`
|
|
175
|
+
are different packages: updating the latter does not fix this advisory.
|
|
176
|
+
|
|
177
|
+
The retained development-only chain is:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
ESLint / typescript-eslint
|
|
181
|
+
-> typescript-estree -> globby -> fast-glob -> micromatch -> braces 3.0.3
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
No compatible published parent update that removes this chain was identified.
|
|
185
|
+
Even the checked latest globby release still uses fast-glob/micromatch and
|
|
186
|
+
braces. The [upstream issue](https://github.com/micromatch/braces/issues/70)
|
|
187
|
+
remains the follow-up point.
|
|
188
|
+
|
|
189
|
+
Current lint scripts use `eslint src`; repository lint configuration has
|
|
190
|
+
simple static file patterns and no `parserOptions.project` glob. No production
|
|
191
|
+
renderer path to braces was identified. Keep project/glob patterns static and
|
|
192
|
+
reviewed, and do not expose this tooling as a service accepting untrusted
|
|
193
|
+
patterns without a depth guard and isolation. These observations bound the
|
|
194
|
+
known exposure; they do not prove complete unreachability, including through
|
|
195
|
+
every future lint configuration or pull request.
|
|
196
|
+
|
|
197
|
+
The advisory stays visible: no audit suppression, alias, downgrade, vendored
|
|
198
|
+
patch or GitHub dismissal is included. Recheck upstream before claiming it
|
|
199
|
+
resolved. The verified full-workspace audit moves from 9 advisories
|
|
200
|
+
(1 critical, 5 high, 1 moderate, 2 low) to **1 high**; a nonzero full audit
|
|
201
|
+
result is therefore expected until this residual is fixed.
|
|
202
|
+
|
|
203
|
+
## Release boundary
|
|
204
|
+
|
|
205
|
+
The package version bump does not itself start npm staging. The current
|
|
206
|
+
GitHub workflow triggers on an approved `v*.*.*` tag (or manual dispatch),
|
|
207
|
+
then uses `npm stage publish`. A successful upload still requires maintainer
|
|
208
|
+
approval in npm Staged Packages with 2FA before it is public. Do not label a
|
|
209
|
+
merge, a green CI run or an uploaded stage as a public npm release.
|
package/docs/THEMING.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Theming (6.25.0)
|
|
2
|
+
|
|
3
|
+
Set `--mcp-ui-*` custom properties on any ancestor of the library's components.
|
|
4
|
+
They inherit through nested components and can be scoped differently for two
|
|
5
|
+
instances on the same page. No provider, global theme or new dependency is
|
|
6
|
+
required. Continue scanning `src/**/*.{ts,tsx}` with Tailwind v4 and use the
|
|
7
|
+
host's class-based `.dark` variant. Import the existing autocomplete CSS when
|
|
8
|
+
using those components, as before.
|
|
9
|
+
|
|
10
|
+
## Defaults and inheritance
|
|
11
|
+
|
|
12
|
+
The migrated component roots carry `mcp-ui-root`, but **do not assign public
|
|
13
|
+
token defaults** there. Assigning `--mcp-ui-surface: white` on a nested root
|
|
14
|
+
would mask an inherited host value. Instead, each static utility consumes a
|
|
15
|
+
token with the exact old color as its fallback, for example:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
class="bg-[color:var(--mcp-ui-surface,var(--color-white,#fff))] dark:bg-[color:var(--mcp-ui-surface,var(--color-gray-800,#1f2937))]"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The host's existing Tailwind palette remains authoritative. Fallbacks retain
|
|
22
|
+
the original per-component shades, dark variants and alpha paints; there is
|
|
23
|
+
deliberately no single replacement palette that collapses those distinctions.
|
|
24
|
+
Removing a token restores that original fallback. A custom color replaces the
|
|
25
|
+
whole paint, including opacity, rather than applying the old opacity to it.
|
|
26
|
+
Host tokens apply without a `.dark` class too; that class only selects the
|
|
27
|
+
original dark fallbacks. Normal form text falls back to its inherited color
|
|
28
|
+
when `--mcp-ui-fg` is absent, while muted fields keep their secondary role.
|
|
29
|
+
|
|
30
|
+
## Tokens
|
|
31
|
+
|
|
32
|
+
Values below describe the original fallbacks, not declarations on the root.
|
|
33
|
+
`gray-*`, `blue-*`, etc. refer to the host's Tailwind color variables. Exact
|
|
34
|
+
per-use defaults remain visible in the static source classes. The frozen
|
|
35
|
+
6.24.0 browser fixture records representative resolved light/dark values.
|
|
36
|
+
|
|
37
|
+
| Token | Role | Original default / behavior |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| `--mcp-ui-bg` | Outer resource-renderer background | Transparent |
|
|
40
|
+
| `--mcp-ui-surface` | Cards, panels, menus, input surfaces | White; dark gray-800, with original local exceptions |
|
|
41
|
+
| `--mcp-ui-surface-muted` | Headers, secondary/disabled surfaces | Original gray-50/100; dark gray-700/900 variants |
|
|
42
|
+
| `--mcp-ui-surface-hover` | Hovered neutral elements | Original gray-50/100; dark gray-700 variants |
|
|
43
|
+
| `--mcp-ui-fg` | Primary text | Original gray-700/900; dark gray-100/300/white |
|
|
44
|
+
| `--mcp-ui-fg-muted` | Descriptions and secondary text | Original gray-500/600; dark gray-400 variants |
|
|
45
|
+
| `--mcp-ui-fg-subtle` | Hints, placeholders, disabled text | Original gray-400 and existing autocomplete RGBA values |
|
|
46
|
+
| `--mcp-ui-border` | Decorative borders and dividers | Original gray-100/200; dark gray-600/700 |
|
|
47
|
+
| `--mcp-ui-border-control` | Form-field outlines | Original gray-300; dark gray-600, with local variants |
|
|
48
|
+
| `--mcp-ui-focus` | Focus ring/border | Original blue-400/500 |
|
|
49
|
+
| `--mcp-ui-accent` | Primary action, link, selected text | Original blue/indigo shades |
|
|
50
|
+
| `--mcp-ui-accent-fg` | Text on a strong action fill | White |
|
|
51
|
+
| `--mcp-ui-accent-hover` | Strong action hover fill | Original blue-700 |
|
|
52
|
+
| `--mcp-ui-accent-soft` | Selection and preview backgrounds | Original blue-50/100; dark blue-900 with original alpha |
|
|
53
|
+
| `--mcp-ui-accent-border` | Accent borders | Original blue-200/300; dark blue-600/800 |
|
|
54
|
+
| `--mcp-ui-danger` | Destructive/error text or strong fill | Original red/rose shades |
|
|
55
|
+
| `--mcp-ui-danger-hover` | Destructive hover fill | Original red-700 |
|
|
56
|
+
| `--mcp-ui-danger-soft` | Error backgrounds | Original red-50/100; dark red-900 with original alpha |
|
|
57
|
+
| `--mcp-ui-danger-border` | Error borders | Original red-200/300; dark red-600/800 |
|
|
58
|
+
| `--mcp-ui-warning` | Warning/loading text or strong fill | Original amber/yellow/orange shades |
|
|
59
|
+
| `--mcp-ui-warning-hover` | Warning action hover | Original amber-700 |
|
|
60
|
+
| `--mcp-ui-warning-soft` | Warning backgrounds | Original amber/yellow/orange soft paints |
|
|
61
|
+
| `--mcp-ui-warning-border` | Warning borders | Original amber/yellow/orange border shades |
|
|
62
|
+
| `--mcp-ui-success` | Successful/completed states | Original green/emerald shades |
|
|
63
|
+
| `--mcp-ui-success-soft` | Success backgrounds | Original green-50/100; dark green-900 with original alpha |
|
|
64
|
+
| `--mcp-ui-info` | Ready/information states | Original cyan/sky/teal shades |
|
|
65
|
+
| `--mcp-ui-info-soft` | Information backgrounds | Original cyan/sky/teal soft paints |
|
|
66
|
+
| `--mcp-ui-info-border` | Information borders | Original cyan/sky/teal border shades |
|
|
67
|
+
| `--mcp-ui-secondary` | Processing/comparison states | Original purple/violet/pink shades |
|
|
68
|
+
| `--mcp-ui-secondary-soft` | Secondary-state backgrounds | Original purple/violet/pink soft paints |
|
|
69
|
+
| `--mcp-ui-highlight` | Table search match | Original yellow-200 and existing dark search paint |
|
|
70
|
+
| `--mcp-ui-overlay` | Dialog backdrop | Black at 50% |
|
|
71
|
+
| `--mcp-ui-shadow` | Full shadow value, not a color | Existing Tailwind shadow or autocomplete box-shadow |
|
|
72
|
+
| `--mcp-ui-scrollbar-thumb` / `--mcp-ui-scrollbar-track` | Scratchpad native scrollbars | Original automatic rendering when unset |
|
|
73
|
+
| `--mcp-ui-chart-1` … `--mcp-ui-chart-8` | Series / graph node / pie-point colors | Engine-managed defaults when absent |
|
|
74
|
+
| `--mcp-ui-chart-grid` | Chart grid / graph edges | Existing engine defaults |
|
|
75
|
+
| `--mcp-ui-chart-axis` | Chart axis border / graph node stroke | Existing engine defaults |
|
|
76
|
+
| `--mcp-ui-chart-label` | Axes, legend, graph labels, no-data text | Existing engine defaults |
|
|
77
|
+
|
|
78
|
+
Typography, spacing and radii are not changed by this release. Native
|
|
79
|
+
scrollbars retain their automatic appearance unless the host supplies tokens.
|
|
80
|
+
Existing non-color `!important` utilities and the pre-existing
|
|
81
|
+
autocomplete selected-state/reduced-motion rules remain; the theme migration
|
|
82
|
+
adds no `!important` rule and no global palette selector.
|
|
83
|
+
|
|
84
|
+
## Host example
|
|
85
|
+
|
|
86
|
+
```css
|
|
87
|
+
.app-theme {
|
|
88
|
+
--mcp-ui-surface: #fff;
|
|
89
|
+
--mcp-ui-surface-muted: #f1f5f9;
|
|
90
|
+
--mcp-ui-surface-hover: #e2e8f0;
|
|
91
|
+
--mcp-ui-fg: #0f172a;
|
|
92
|
+
--mcp-ui-fg-muted: #475569;
|
|
93
|
+
--mcp-ui-fg-subtle: #64748b;
|
|
94
|
+
--mcp-ui-border: #cbd5e1;
|
|
95
|
+
--mcp-ui-border-control: #64748b;
|
|
96
|
+
--mcp-ui-accent: #1d4ed8;
|
|
97
|
+
--mcp-ui-accent-hover: #1e40af;
|
|
98
|
+
--mcp-ui-accent-fg: #fff;
|
|
99
|
+
--mcp-ui-accent-soft: #dbeafe;
|
|
100
|
+
--mcp-ui-focus: #1d4ed8;
|
|
101
|
+
--mcp-ui-chart-1: #1d4ed8;
|
|
102
|
+
--mcp-ui-chart-grid: #cbd5e1;
|
|
103
|
+
--mcp-ui-chart-axis: #64748b;
|
|
104
|
+
--mcp-ui-chart-label: #334155;
|
|
105
|
+
}
|
|
106
|
+
.dark .app-theme {
|
|
107
|
+
--mcp-ui-surface: #0f172a;
|
|
108
|
+
--mcp-ui-surface-muted: #1e293b;
|
|
109
|
+
--mcp-ui-surface-hover: #334155;
|
|
110
|
+
--mcp-ui-fg: #f8fafc;
|
|
111
|
+
--mcp-ui-fg-muted: #cbd5e1;
|
|
112
|
+
--mcp-ui-fg-subtle: #94a3b8;
|
|
113
|
+
--mcp-ui-border: #475569;
|
|
114
|
+
--mcp-ui-border-control: #94a3b8;
|
|
115
|
+
--mcp-ui-accent: #93c5fd;
|
|
116
|
+
--mcp-ui-accent-hover: #60a5fa;
|
|
117
|
+
--mcp-ui-accent-fg: #0f172a;
|
|
118
|
+
--mcp-ui-accent-soft: #1e3a8a;
|
|
119
|
+
--mcp-ui-focus: #93c5fd;
|
|
120
|
+
--mcp-ui-chart-1: #93c5fd;
|
|
121
|
+
--mcp-ui-chart-grid: #475569;
|
|
122
|
+
--mcp-ui-chart-axis: #94a3b8;
|
|
123
|
+
--mcp-ui-chart-label: #e2e8f0;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Choose semantic status colors and all series colors appropriate for the host.
|
|
128
|
+
Recheck contrast against the actual backgrounds, including hover/disabled
|
|
129
|
+
states and chart series. The example is a starting point, not a full theme
|
|
130
|
+
or an accessibility certification.
|
|
131
|
+
|
|
132
|
+
## Portals and mounted graphics
|
|
133
|
+
|
|
134
|
+
Export menus and dialogs stay mounted under `document.body`. Moving them into
|
|
135
|
+
the host container would restore clipping and transformed-parent positioning
|
|
136
|
+
bugs. The library copies only effective `--mcp-ui-*` values and local dark
|
|
137
|
+
state from the menu trigger or the stationary inline expansion slot. It
|
|
138
|
+
updates them while the portal is open and clears stale values when its
|
|
139
|
+
anchor changes. `ModalRenderer` uses a hidden inline anchor. Fullscreen
|
|
140
|
+
content is still moved, not duplicated.
|
|
141
|
+
|
|
142
|
+
Canvas renderers read computed tokens from their own roots. Ancestor
|
|
143
|
+
class/style/data-attribute changes, token removal and DOM reparenting trigger
|
|
144
|
+
an in-place Chart.js `update('none')` or G6 `setOptions`/`draw`, preserving
|
|
145
|
+
renderer identity and layout/zoom. Explicit dataset, scale, element, tooltip,
|
|
146
|
+
node and edge styles keep precedence. Chart payload objects are shallow-cloned
|
|
147
|
+
before the engine adds its generated colors, allowing one payload in multiple
|
|
148
|
+
independently themed instances.
|
|
149
|
+
Point paint overrides are separate from the line/radar stroke: an explicit
|
|
150
|
+
point outline does not block a host series color on the line itself. Live
|
|
151
|
+
updates also refresh Chart.js's shared point/bar paints without replacing
|
|
152
|
+
their shared option objects or changing non-color settings.
|
|
153
|
+
|
|
154
|
+
Chart.js tooltips use `surface`, `fg` and `border`; G6 tooltip content reads
|
|
155
|
+
those current tokens when shown. An omitted series token leaves its original
|
|
156
|
+
engine color. Chart.js's default cycle is seven colors, while configured host
|
|
157
|
+
tokens address eight repeating slots. No default palette is installed globally.
|
|
158
|
+
|
|
159
|
+
Pure stylesheet/CSSOM or media-query changes without a DOM attribute change
|
|
160
|
+
are not observed. When switching such a host theme, also update the host's
|
|
161
|
+
class or a `data-theme` attribute. The supported light/dark strategy remains
|
|
162
|
+
the `.dark` ancestor class.
|
|
163
|
+
|
|
164
|
+
## Coverage and known accessibility gaps
|
|
165
|
+
|
|
166
|
+
Migrated: `ChatPrompt`, `UIResourceRenderer` (including table chrome and virtual
|
|
167
|
+
rows), `ScratchpadPanel`, `FormFieldRenderer`, `AutocompleteFormField`,
|
|
168
|
+
`AutocompleteDropdown`, `GhostText`, `ComponentToolbar`, `ExpandableWrapper`,
|
|
169
|
+
`PortalDropdownMenu`, `FormRenderer`, `ActionGroupRenderer`, `ModalRenderer`,
|
|
170
|
+
missing-value/degraded/error surfaces, and Chart.js/G6 chrome and canvas colors.
|
|
171
|
+
|
|
172
|
+
Not fully migrated: map/Leaflet chrome and external tiles, code highlighting
|
|
173
|
+
themes, `AgentCard`/`AgentHandoff`/`AgentStatusBadge`, standalone artifact,
|
|
174
|
+
carousel, footer, grid/editor, gallery/video and presentation-feedback chrome,
|
|
175
|
+
and other renderers outside the list above. Native OS select popups are outside
|
|
176
|
+
the library's DOM styling. Hosts should remove old overrides only for migrated
|
|
177
|
+
surfaces and retain targeted overrides for these remaining components.
|
|
178
|
+
|
|
179
|
+
Default colors are preserved even where they miss accessibility targets.
|
|
180
|
+
The frozen Chromium fixture measured these existing gaps:
|
|
181
|
+
|
|
182
|
+
| Measurement | Light | Dark | Target |
|
|
183
|
+
| --- | ---: | ---: | ---: |
|
|
184
|
+
| Required input / form select / scratchpad select border | 1.47:1 | 1.94:1 | 3:1 |
|
|
185
|
+
| Search / choice control border | 1.24:1 | 1.94:1 | 3:1 |
|
|
186
|
+
| Required input visible 2px focus ring | 3.76:1 | 3.90:1 | 3:1 |
|
|
187
|
+
|
|
188
|
+
The represented text measurements reached at least 4.52:1; this is not a full
|
|
189
|
+
audit of every field, state or renderer. Supplementary Chart.js 4.5.1 palette
|
|
190
|
+
measurements on white put six of seven opaque default colors, and all seven
|
|
191
|
+
50%-alpha fills, below 3:1. These are palette measurements, not a rendered
|
|
192
|
+
canvas or adjacent-series audit. Changing those defaults would alter existing
|
|
193
|
+
appearance, so hosts must supply their own accessible theme where needed.
|
|
194
|
+
|
|
195
|
+
See [`tests/theme/README.md`](../tests/theme/README.md) for the exact baseline
|
|
196
|
+
commit, tool versions, measured deficits and limits. The fixture checks actual
|
|
197
|
+
computed styles, not screenshot equality; raster canvas appearance and native
|
|
198
|
+
popup pixels are outside that comparison.
|
|
199
|
+
|
|
200
|
+
## Release handoff
|
|
201
|
+
|
|
202
|
+
This is a Solid-only 6.25.0 release. The MCP schema and Spec/CLI versions are
|
|
203
|
+
unchanged. Hosts can upgrade, bind their design tokens, remove the corresponding
|
|
204
|
+
overrides and run their own browser contrast checks. The public release follows
|
|
205
|
+
review/CI, the `v6.25.0` tag, then maintainer approval of the staged npm package.
|