@seed-ship/mcp-ui-solid 6.25.1 → 8.0.0-solid2.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 +57 -0
- package/README.md +39 -3
- package/dist/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/adapters/connector.cjs +141 -104
- 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 +141 -106
- 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.cjs +249 -211
- package/dist/adapters/macro-run.cjs.map +1 -1
- package/dist/adapters/macro-run.d.cts +99 -0
- package/dist/adapters/macro-run.d.ts +1 -2
- package/dist/adapters/macro-run.js +249 -213
- package/dist/adapters/macro-run.js.map +1 -1
- package/dist/adapters/presentation.cjs +142 -113
- package/dist/adapters/presentation.cjs.map +1 -1
- package/dist/adapters/presentation.d.cts +1 -2
- package/dist/adapters/presentation.d.ts +1 -2
- package/dist/adapters/presentation.js +143 -117
- package/dist/adapters/presentation.js.map +1 -1
- package/dist/adapters.cjs +12 -14
- package/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/adapters.js +1 -12
- package/dist/components/ActionGroupRenderer.cjs +193 -182
- 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 +191 -180
- package/dist/components/ActionGroupRenderer.js.map +1 -1
- package/dist/components/ActionRenderer.cjs +31 -32
- package/dist/components/ActionRenderer.cjs.map +1 -1
- package/dist/components/ActionRenderer.d.cts +9 -0
- package/dist/components/ActionRenderer.d.ts +0 -1
- package/dist/components/ActionRenderer.js +30 -31
- package/dist/components/ActionRenderer.js.map +1 -1
- package/dist/components/AgentCard.cjs +153 -117
- package/dist/components/AgentCard.cjs.map +1 -1
- package/dist/components/AgentCard.d.cts +19 -0
- package/dist/components/AgentCard.d.ts +3 -4
- package/dist/components/AgentCard.d.ts.map +1 -1
- package/dist/components/AgentCard.js +153 -118
- package/dist/components/AgentCard.js.map +1 -1
- package/dist/components/AgentHandoff.cjs +66 -48
- package/dist/components/AgentHandoff.cjs.map +1 -1
- package/dist/components/AgentHandoff.d.cts +11 -0
- package/dist/components/AgentHandoff.d.ts +2 -3
- package/dist/components/AgentHandoff.d.ts.map +1 -1
- package/dist/components/AgentHandoff.js +66 -48
- package/dist/components/AgentHandoff.js.map +1 -1
- package/dist/components/ArtifactRenderer.cjs +61 -56
- package/dist/components/ArtifactRenderer.cjs.map +1 -1
- package/dist/components/ArtifactRenderer.d.cts +11 -0
- package/dist/components/ArtifactRenderer.d.ts +0 -1
- package/dist/components/ArtifactRenderer.js +60 -55
- package/dist/components/ArtifactRenderer.js.map +1 -1
- package/dist/components/AutocompleteDropdown.cjs +246 -201
- package/dist/components/AutocompleteDropdown.cjs.map +1 -1
- package/dist/components/AutocompleteDropdown.d.cts +71 -0
- package/dist/components/AutocompleteDropdown.d.ts +3 -3
- package/dist/components/AutocompleteDropdown.d.ts.map +1 -1
- package/dist/components/AutocompleteDropdown.js +244 -200
- package/dist/components/AutocompleteDropdown.js.map +1 -1
- package/dist/components/AutocompleteFormField.cjs +304 -282
- 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 +300 -279
- package/dist/components/AutocompleteFormField.js.map +1 -1
- package/dist/components/BriefingDiff.cjs +221 -167
- package/dist/components/BriefingDiff.cjs.map +1 -1
- package/dist/components/BriefingDiff.d.cts +11 -0
- package/dist/components/BriefingDiff.d.ts +2 -3
- package/dist/components/BriefingDiff.d.ts.map +1 -1
- package/dist/components/BriefingDiff.js +221 -167
- package/dist/components/BriefingDiff.js.map +1 -1
- package/dist/components/CarouselRenderer.cjs +83 -77
- package/dist/components/CarouselRenderer.cjs.map +1 -1
- package/dist/components/CarouselRenderer.d.cts +12 -0
- package/dist/components/CarouselRenderer.d.ts +1 -2
- package/dist/components/CarouselRenderer.js +82 -76
- package/dist/components/CarouselRenderer.js.map +1 -1
- package/dist/components/ChartJSRenderer.cjs +1048 -864
- 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 +1045 -840
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/ChatPrompt.cjs +444 -355
- 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.d.ts.map +1 -1
- package/dist/components/ChatPrompt.js +442 -353
- package/dist/components/ChatPrompt.js.map +1 -1
- package/dist/components/CodeBlockRenderer.cjs +270 -296
- package/dist/components/CodeBlockRenderer.cjs.map +1 -1
- package/dist/components/CodeBlockRenderer.d.cts +23 -0
- package/dist/components/CodeBlockRenderer.d.ts +1 -2
- package/dist/components/CodeBlockRenderer.d.ts.map +1 -1
- package/dist/components/CodeBlockRenderer.js +268 -272
- package/dist/components/CodeBlockRenderer.js.map +1 -1
- package/dist/components/ComponentToolbar.cjs +87 -74
- 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 +86 -73
- package/dist/components/ComponentToolbar.js.map +1 -1
- package/dist/components/DataPreviewSection.cjs +381 -359
- package/dist/components/DataPreviewSection.cjs.map +1 -1
- package/dist/components/DataPreviewSection.d.cts +11 -0
- package/dist/components/DataPreviewSection.d.ts +2 -3
- package/dist/components/DataPreviewSection.d.ts.map +1 -1
- package/dist/components/DataPreviewSection.js +377 -355
- package/dist/components/DataPreviewSection.js.map +1 -1
- package/dist/components/DegradedFallback.cjs +130 -107
- 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 +130 -107
- package/dist/components/DegradedFallback.js.map +1 -1
- package/dist/components/DraggableGridItem.cjs +152 -128
- package/dist/components/DraggableGridItem.cjs.map +1 -1
- package/dist/components/DraggableGridItem.d.cts +95 -0
- package/dist/components/DraggableGridItem.d.ts +3 -3
- package/dist/components/DraggableGridItem.d.ts.map +1 -1
- package/dist/components/DraggableGridItem.js +151 -128
- package/dist/components/DraggableGridItem.js.map +1 -1
- package/dist/components/EditableLayoutContext.cjs +13 -12
- package/dist/components/EditableLayoutContext.cjs.map +1 -1
- package/dist/components/EditableLayoutContext.d.cts +4 -0
- package/dist/components/EditableLayoutContext.d.ts +0 -1
- package/dist/components/EditableLayoutContext.js +14 -14
- package/dist/components/EditableLayoutContext.js.map +1 -1
- package/dist/components/EditableUIResourceRenderer.cjs +232 -198
- package/dist/components/EditableUIResourceRenderer.cjs.map +1 -1
- package/dist/components/EditableUIResourceRenderer.d.cts +42 -0
- package/dist/components/EditableUIResourceRenderer.d.ts +2 -3
- package/dist/components/EditableUIResourceRenderer.d.ts.map +1 -1
- package/dist/components/EditableUIResourceRenderer.js +230 -197
- package/dist/components/EditableUIResourceRenderer.js.map +1 -1
- package/dist/components/ElicitationForm.cjs +42 -45
- package/dist/components/ElicitationForm.cjs.map +1 -1
- package/dist/components/ElicitationForm.d.cts +67 -0
- package/dist/components/ElicitationForm.d.ts +1 -2
- package/dist/components/ElicitationForm.js +41 -44
- package/dist/components/ElicitationForm.js.map +1 -1
- package/dist/components/ExpandableWrapper.cjs +236 -169
- package/dist/components/ExpandableWrapper.cjs.map +1 -1
- package/dist/components/ExpandableWrapper.d.cts +50 -0
- package/dist/components/ExpandableWrapper.d.ts +2 -2
- package/dist/components/ExpandableWrapper.d.ts.map +1 -1
- package/dist/components/ExpandableWrapper.js +235 -169
- package/dist/components/ExpandableWrapper.js.map +1 -1
- package/dist/components/FeedbackInline.cjs +118 -74
- package/dist/components/FeedbackInline.cjs.map +1 -1
- package/dist/components/FeedbackInline.d.cts +70 -0
- package/dist/components/FeedbackInline.d.ts +0 -1
- package/dist/components/FeedbackInline.js +117 -73
- package/dist/components/FeedbackInline.js.map +1 -1
- package/dist/components/FooterRenderer.cjs +101 -78
- package/dist/components/FooterRenderer.cjs.map +1 -1
- package/dist/components/FooterRenderer.d.cts +15 -0
- package/dist/components/FooterRenderer.d.ts +0 -1
- package/dist/components/FooterRenderer.js +100 -77
- package/dist/components/FooterRenderer.js.map +1 -1
- package/dist/components/FormFieldRenderer.cjs +1200 -1043
- 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 +1200 -1043
- package/dist/components/FormFieldRenderer.js.map +1 -1
- package/dist/components/FormRenderer.cjs +340 -324
- 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.d.ts.map +1 -1
- package/dist/components/FormRenderer.js +337 -321
- package/dist/components/FormRenderer.js.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs +167 -130
- package/dist/components/GenerativeUIErrorBoundary.cjs.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.d.cts +58 -0
- package/dist/components/GenerativeUIErrorBoundary.d.ts +2 -3
- package/dist/components/GenerativeUIErrorBoundary.d.ts.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.default.d.cts +1 -0
- package/dist/components/GenerativeUIErrorBoundary.default.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.js +164 -127
- package/dist/components/GenerativeUIErrorBoundary.js.map +1 -1
- package/dist/components/GhostText.cjs +132 -100
- package/dist/components/GhostText.cjs.map +1 -1
- package/dist/components/GhostText.d.cts +113 -0
- package/dist/components/GhostText.d.ts +2 -2
- package/dist/components/GhostText.d.ts.map +1 -1
- package/dist/components/GhostText.js +132 -102
- package/dist/components/GhostText.js.map +1 -1
- package/dist/components/GraphRenderer.cjs +418 -400
- package/dist/components/GraphRenderer.cjs.map +1 -1
- package/dist/components/GraphRenderer.d.cts +66 -0
- package/dist/components/GraphRenderer.d.ts +1 -2
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +415 -379
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/GridRenderer.cjs +99 -91
- package/dist/components/GridRenderer.cjs.map +1 -1
- package/dist/components/GridRenderer.d.cts +49 -0
- package/dist/components/GridRenderer.d.ts +1 -2
- package/dist/components/GridRenderer.js +97 -90
- package/dist/components/GridRenderer.js.map +1 -1
- package/dist/components/IframeFallbackLink.cjs +53 -34
- package/dist/components/IframeFallbackLink.cjs.map +1 -1
- package/dist/components/IframeFallbackLink.d.cts +22 -0
- package/dist/components/IframeFallbackLink.d.ts +1 -2
- package/dist/components/IframeFallbackLink.d.ts.map +1 -1
- package/dist/components/IframeFallbackLink.js +49 -30
- package/dist/components/IframeFallbackLink.js.map +1 -1
- package/dist/components/ImageGalleryRenderer.cjs +162 -174
- package/dist/components/ImageGalleryRenderer.cjs.map +1 -1
- package/dist/components/ImageGalleryRenderer.d.cts +22 -0
- package/dist/components/ImageGalleryRenderer.d.ts +1 -2
- package/dist/components/ImageGalleryRenderer.js +160 -172
- package/dist/components/ImageGalleryRenderer.js.map +1 -1
- package/dist/components/LightboxOverlay.cjs +382 -250
- package/dist/components/LightboxOverlay.cjs.map +1 -1
- package/dist/components/LightboxOverlay.d.cts +31 -0
- package/dist/components/LightboxOverlay.d.ts +1 -2
- package/dist/components/LightboxOverlay.d.ts.map +1 -1
- package/dist/components/LightboxOverlay.js +381 -249
- package/dist/components/LightboxOverlay.js.map +1 -1
- package/dist/components/MapRenderer.cjs +432 -460
- package/dist/components/MapRenderer.cjs.map +1 -1
- package/dist/components/MapRenderer.d.cts +77 -0
- package/dist/components/MapRenderer.d.ts +1 -2
- package/dist/components/MapRenderer.d.ts.map +1 -1
- package/dist/components/MapRenderer.js +431 -441
- package/dist/components/MapRenderer.js.map +1 -1
- package/dist/components/MissingValue.cjs +44 -37
- package/dist/components/MissingValue.cjs.map +1 -1
- package/dist/components/MissingValue.d.cts +27 -0
- package/dist/components/MissingValue.d.ts +2 -2
- package/dist/components/MissingValue.d.ts.map +1 -1
- package/dist/components/MissingValue.js +44 -39
- package/dist/components/MissingValue.js.map +1 -1
- package/dist/components/ModalRenderer.cjs +189 -162
- package/dist/components/ModalRenderer.cjs.map +1 -1
- package/dist/components/ModalRenderer.d.cts +67 -0
- package/dist/components/ModalRenderer.d.ts +3 -3
- package/dist/components/ModalRenderer.d.ts.map +1 -1
- package/dist/components/ModalRenderer.js +188 -161
- package/dist/components/ModalRenderer.js.map +1 -1
- package/dist/components/PortalDropdownMenu.cjs +107 -83
- package/dist/components/PortalDropdownMenu.cjs.map +1 -1
- package/dist/components/PortalDropdownMenu.d.cts +56 -0
- package/dist/components/PortalDropdownMenu.d.ts +2 -2
- package/dist/components/PortalDropdownMenu.d.ts.map +1 -1
- package/dist/components/PortalDropdownMenu.js +106 -82
- package/dist/components/PortalDropdownMenu.js.map +1 -1
- package/dist/components/PresentationFeedback.cjs +279 -201
- package/dist/components/PresentationFeedback.cjs.map +1 -1
- package/dist/components/PresentationFeedback.d.cts +112 -0
- package/dist/components/PresentationFeedback.d.ts +0 -1
- package/dist/components/PresentationFeedback.js +279 -202
- package/dist/components/PresentationFeedback.js.map +1 -1
- package/dist/components/RenderContext.cjs +45 -26
- package/dist/components/RenderContext.cjs.map +1 -1
- package/dist/components/RenderContext.d.cts +41 -0
- package/dist/components/RenderContext.d.ts +2 -3
- package/dist/components/RenderContext.d.ts.map +1 -1
- package/dist/components/RenderContext.js +45 -28
- package/dist/components/RenderContext.js.map +1 -1
- package/dist/components/ResizeHandle.cjs +169 -168
- package/dist/components/ResizeHandle.cjs.map +1 -1
- package/dist/components/ResizeHandle.d.cts +49 -0
- package/dist/components/ResizeHandle.d.ts +1 -2
- package/dist/components/ResizeHandle.d.ts.map +1 -1
- package/dist/components/ResizeHandle.js +167 -167
- package/dist/components/ResizeHandle.js.map +1 -1
- package/dist/components/SafeHtml.cjs +60 -28
- package/dist/components/SafeHtml.cjs.map +1 -1
- package/dist/components/SafeHtml.d.cts +45 -0
- package/dist/components/SafeHtml.d.ts +2 -3
- package/dist/components/SafeHtml.d.ts.map +1 -1
- package/dist/components/SafeHtml.js +60 -29
- package/dist/components/SafeHtml.js.map +1 -1
- package/dist/components/ScratchpadPanel.cjs +2660 -2215
- 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 +2655 -2210
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/components/SplitStepper.cjs +150 -116
- package/dist/components/SplitStepper.cjs.map +1 -1
- package/dist/components/SplitStepper.d.cts +11 -0
- package/dist/components/SplitStepper.d.ts +2 -3
- package/dist/components/SplitStepper.d.ts.map +1 -1
- package/dist/components/SplitStepper.js +150 -116
- package/dist/components/SplitStepper.js.map +1 -1
- package/dist/components/StreamingUIRenderer.cjs +377 -279
- package/dist/components/StreamingUIRenderer.cjs.map +1 -1
- package/dist/components/StreamingUIRenderer.d.cts +58 -0
- package/dist/components/StreamingUIRenderer.d.ts +4 -5
- package/dist/components/StreamingUIRenderer.d.ts.map +1 -1
- package/dist/components/StreamingUIRenderer.js +376 -278
- package/dist/components/StreamingUIRenderer.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +2395 -2147
- 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.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.default.d.cts +1 -0
- package/dist/components/UIResourceRenderer.default.d.ts +1 -2
- package/dist/components/UIResourceRenderer.js +2368 -2100
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/VerifiedText.cjs +185 -176
- package/dist/components/VerifiedText.cjs.map +1 -1
- package/dist/components/VerifiedText.d.cts +22 -0
- package/dist/components/VerifiedText.d.ts +2 -3
- package/dist/components/VerifiedText.d.ts.map +1 -1
- package/dist/components/VerifiedText.js +184 -175
- package/dist/components/VerifiedText.js.map +1 -1
- package/dist/components/VideoRenderer.cjs +200 -212
- package/dist/components/VideoRenderer.cjs.map +1 -1
- package/dist/components/VideoRenderer.d.cts +41 -0
- package/dist/components/VideoRenderer.d.ts +1 -2
- package/dist/components/VideoRenderer.js +197 -211
- package/dist/components/VideoRenderer.js.map +1 -1
- package/dist/components/chart-data-table.cjs +96 -110
- package/dist/components/chart-data-table.cjs.map +1 -1
- package/dist/components/chart-data-table.d.cts +68 -0
- package/dist/components/chart-data-table.d.ts +0 -1
- package/dist/components/chart-data-table.js +95 -110
- package/dist/components/chart-data-table.js.map +1 -1
- package/dist/components/chart-missing-plugin.cjs +223 -160
- 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 +1 -2
- package/dist/components/chart-missing-plugin.js +222 -170
- 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.cjs +68 -67
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +10 -48
- package/dist/context/AutocompleteContext.cjs +178 -147
- package/dist/context/AutocompleteContext.cjs.map +1 -1
- package/dist/context/AutocompleteContext.d.cts +76 -0
- package/dist/context/AutocompleteContext.d.ts +2 -3
- package/dist/context/AutocompleteContext.d.ts.map +1 -1
- package/dist/context/AutocompleteContext.js +179 -151
- package/dist/context/AutocompleteContext.js.map +1 -1
- package/dist/context/MCPActionContext.cjs +176 -144
- package/dist/context/MCPActionContext.cjs.map +1 -1
- package/dist/context/MCPActionContext.d.cts +169 -0
- package/dist/context/MCPActionContext.d.ts +1 -2
- package/dist/context/MCPActionContext.d.ts.map +1 -1
- package/dist/context/MCPActionContext.js +176 -147
- package/dist/context/MCPActionContext.js.map +1 -1
- package/dist/context/MCPUIConfigContext.cjs +92 -21
- package/dist/context/MCPUIConfigContext.cjs.map +1 -1
- package/dist/context/MCPUIConfigContext.d.cts +201 -0
- package/dist/context/MCPUIConfigContext.d.ts +3 -4
- package/dist/context/MCPUIConfigContext.d.ts.map +1 -1
- package/dist/context/MCPUIConfigContext.js +93 -25
- package/dist/context/MCPUIConfigContext.js.map +1 -1
- package/dist/context/MCPUIMathContext.cjs +17 -13
- package/dist/context/MCPUIMathContext.cjs.map +1 -1
- package/dist/context/MCPUIMathContext.d.cts +18 -0
- package/dist/context/MCPUIMathContext.d.ts +2 -2
- package/dist/context/MCPUIMathContext.d.ts.map +1 -1
- package/dist/context/MCPUIMathContext.js +17 -14
- package/dist/context/MCPUIMathContext.js.map +1 -1
- package/dist/context/MCPUIStringsContext.cjs +380 -332
- package/dist/context/MCPUIStringsContext.cjs.map +1 -1
- package/dist/context/MCPUIStringsContext.d.cts +802 -0
- package/dist/context/MCPUIStringsContext.d.ts +2 -3
- package/dist/context/MCPUIStringsContext.d.ts.map +1 -1
- package/dist/context/MCPUIStringsContext.js +380 -337
- package/dist/context/MCPUIStringsContext.js.map +1 -1
- package/dist/context/MCPUITelemetryContext.cjs +42 -19
- package/dist/context/MCPUITelemetryContext.cjs.map +1 -1
- package/dist/context/MCPUITelemetryContext.d.cts +36 -0
- package/dist/context/MCPUITelemetryContext.d.ts +4 -4
- package/dist/context/MCPUITelemetryContext.d.ts.map +1 -1
- package/dist/context/MCPUITelemetryContext.js +42 -21
- package/dist/context/MCPUITelemetryContext.js.map +1 -1
- package/dist/context/index.d.cts +7 -0
- package/dist/context/index.d.ts +2 -3
- package/dist/hooks/createResponsiveGrid.cjs +39 -34
- package/dist/hooks/createResponsiveGrid.cjs.map +1 -1
- package/dist/hooks/createResponsiveGrid.d.cts +5 -0
- package/dist/hooks/createResponsiveGrid.d.ts +0 -1
- package/dist/hooks/createResponsiveGrid.js +39 -34
- package/dist/hooks/createResponsiveGrid.js.map +1 -1
- package/dist/hooks/index.d.cts +25 -0
- package/dist/hooks/index.d.ts +20 -21
- package/dist/hooks/useAction.cjs +195 -112
- package/dist/hooks/useAction.cjs.map +1 -1
- package/dist/hooks/useAction.d.cts +164 -0
- package/dist/hooks/useAction.d.ts +2 -3
- package/dist/hooks/useAction.js +195 -113
- package/dist/hooks/useAction.js.map +1 -1
- package/dist/hooks/useAutocomplete.cjs +227 -237
- package/dist/hooks/useAutocomplete.cjs.map +1 -1
- package/dist/hooks/useAutocomplete.d.cts +118 -0
- package/dist/hooks/useAutocomplete.d.ts +1 -2
- package/dist/hooks/useAutocomplete.d.ts.map +1 -1
- package/dist/hooks/useAutocomplete.js +227 -237
- package/dist/hooks/useAutocomplete.js.map +1 -1
- package/dist/hooks/useChatBus.cjs +70 -23
- package/dist/hooks/useChatBus.cjs.map +1 -1
- package/dist/hooks/useChatBus.d.cts +55 -0
- package/dist/hooks/useChatBus.d.ts +1 -2
- package/dist/hooks/useChatBus.d.ts.map +1 -1
- package/dist/hooks/useChatBus.js +70 -24
- package/dist/hooks/useChatBus.js.map +1 -1
- package/dist/hooks/useConditionalField.cjs +49 -40
- package/dist/hooks/useConditionalField.cjs.map +1 -1
- package/dist/hooks/useConditionalField.d.cts +34 -0
- package/dist/hooks/useConditionalField.d.ts +2 -3
- package/dist/hooks/useConditionalField.js +49 -41
- package/dist/hooks/useConditionalField.js.map +1 -1
- package/dist/hooks/useDataValidator.cjs +44 -28
- package/dist/hooks/useDataValidator.cjs.map +1 -1
- package/dist/hooks/useDataValidator.d.cts +41 -0
- package/dist/hooks/useDataValidator.d.ts +1 -2
- package/dist/hooks/useDataValidator.js +44 -28
- package/dist/hooks/useDataValidator.js.map +1 -1
- package/dist/hooks/useDragDrop.cjs +180 -161
- package/dist/hooks/useDragDrop.cjs.map +1 -1
- package/dist/hooks/useDragDrop.d.cts +99 -0
- package/dist/hooks/useDragDrop.d.ts +1 -2
- package/dist/hooks/useDragDrop.d.ts.map +1 -1
- package/dist/hooks/useDragDrop.js +181 -162
- package/dist/hooks/useDragDrop.js.map +1 -1
- package/dist/hooks/useFormPersistence.cjs +145 -120
- package/dist/hooks/useFormPersistence.cjs.map +1 -1
- package/dist/hooks/useFormPersistence.d.cts +80 -0
- package/dist/hooks/useFormPersistence.d.ts +0 -1
- package/dist/hooks/useFormPersistence.d.ts.map +1 -1
- package/dist/hooks/useFormPersistence.js +146 -121
- package/dist/hooks/useFormPersistence.js.map +1 -1
- package/dist/hooks/useModal.cjs +99 -35
- package/dist/hooks/useModal.cjs.map +1 -1
- package/dist/hooks/useModal.d.cts +106 -0
- package/dist/hooks/useModal.d.ts +0 -1
- package/dist/hooks/useModal.d.ts.map +1 -1
- package/dist/hooks/useModal.js +99 -36
- package/dist/hooks/useModal.js.map +1 -1
- package/dist/hooks/useResize.cjs +212 -204
- package/dist/hooks/useResize.cjs.map +1 -1
- package/dist/hooks/useResize.d.cts +86 -0
- package/dist/hooks/useResize.d.ts +1 -2
- package/dist/hooks/useResize.d.ts.map +1 -1
- package/dist/hooks/useResize.js +212 -204
- package/dist/hooks/useResize.js.map +1 -1
- package/dist/hooks/useStreamingUI.cjs +340 -257
- package/dist/hooks/useStreamingUI.cjs.map +1 -1
- package/dist/hooks/useStreamingUI.d.cts +117 -0
- package/dist/hooks/useStreamingUI.d.ts +7 -8
- package/dist/hooks/useStreamingUI.d.ts.map +1 -1
- package/dist/hooks/useStreamingUI.js +340 -258
- package/dist/hooks/useStreamingUI.js.map +1 -1
- package/dist/hooks.cjs +24 -26
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +5 -21
- package/dist/index.cjs +182 -184
- package/dist/index.d.cts +91 -92
- package/dist/index.d.ts +91 -92
- package/dist/index.js +36 -160
- package/dist/plugins/duckdb.cjs +164 -172
- package/dist/plugins/duckdb.cjs.map +1 -1
- package/dist/plugins/duckdb.d.cts +1 -2
- package/dist/plugins/duckdb.d.ts +1 -2
- package/dist/plugins/duckdb.d.ts.map +1 -1
- package/dist/plugins/duckdb.js +161 -153
- package/dist/plugins/duckdb.js.map +1 -1
- package/dist/plugins/groq.cjs +86 -88
- package/dist/plugins/groq.cjs.map +1 -1
- package/dist/plugins/groq.d.cts +12 -0
- package/dist/plugins/groq.d.ts +1 -2
- package/dist/plugins/groq.js +86 -89
- package/dist/plugins/groq.js.map +1 -1
- package/dist/plugins/index.d.cts +9 -0
- package/dist/plugins/index.d.ts +3 -4
- package/dist/plugins/katex.cjs +24 -20
- package/dist/plugins/katex.cjs.map +1 -1
- package/dist/plugins/katex.d.cts +1 -2
- package/dist/plugins/katex.d.ts +1 -2
- package/dist/plugins/katex.js +22 -21
- package/dist/plugins/katex.js.map +1 -1
- package/dist/plugins/rest.cjs +84 -84
- package/dist/plugins/rest.cjs.map +1 -1
- package/dist/plugins/rest.d.cts +12 -0
- package/dist/plugins/rest.d.ts +1 -2
- package/dist/plugins/rest.js +84 -85
- package/dist/plugins/rest.js.map +1 -1
- package/dist/plugins/supabase.cjs +71 -75
- package/dist/plugins/supabase.cjs.map +1 -1
- package/dist/plugins/supabase.d.cts +12 -0
- package/dist/plugins/supabase.d.ts +1 -2
- package/dist/plugins/supabase.js +71 -76
- package/dist/plugins/supabase.js.map +1 -1
- package/dist/server/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/server/adapters/connector.cjs +160 -0
- package/dist/server/adapters/connector.cjs.map +1 -0
- package/dist/server/adapters/connector.js +158 -0
- package/dist/server/adapters/connector.js.map +1 -0
- package/dist/server/adapters/macro-run.cjs +276 -0
- package/dist/server/adapters/macro-run.cjs.map +1 -0
- package/dist/server/adapters/macro-run.js +274 -0
- package/dist/server/adapters/macro-run.js.map +1 -0
- package/dist/server/adapters/presentation.cjs +172 -0
- package/dist/server/adapters/presentation.cjs.map +1 -0
- package/dist/server/adapters/presentation.js +168 -0
- package/dist/server/adapters/presentation.js.map +1 -0
- package/dist/server/adapters.cjs +18 -0
- package/dist/server/adapters.cjs.map +1 -0
- package/dist/server/adapters.js +6 -0
- package/dist/server/adapters.js.map +1 -0
- package/dist/server/components/ActionGroupRenderer.cjs +240 -0
- package/dist/server/components/ActionGroupRenderer.cjs.map +1 -0
- package/dist/server/components/ActionGroupRenderer.js +240 -0
- package/dist/server/components/ActionGroupRenderer.js.map +1 -0
- package/dist/server/components/ActionRenderer.cjs +25 -0
- package/dist/server/components/ActionRenderer.cjs.map +1 -0
- package/dist/server/components/ActionRenderer.js +25 -0
- package/dist/server/components/ActionRenderer.js.map +1 -0
- package/dist/server/components/AgentCard.cjs +218 -0
- package/dist/server/components/AgentCard.cjs.map +1 -0
- package/dist/server/components/AgentCard.js +217 -0
- package/dist/server/components/AgentCard.js.map +1 -0
- package/dist/server/components/AgentHandoff.cjs +90 -0
- package/dist/server/components/AgentHandoff.cjs.map +1 -0
- package/dist/server/components/AgentHandoff.js +90 -0
- package/dist/server/components/AgentHandoff.js.map +1 -0
- package/dist/server/components/ArtifactRenderer.cjs +62 -0
- package/dist/server/components/ArtifactRenderer.cjs.map +1 -0
- package/dist/server/components/ArtifactRenderer.js +62 -0
- package/dist/server/components/ArtifactRenderer.js.map +1 -0
- package/dist/server/components/AutocompleteDropdown.cjs +425 -0
- package/dist/server/components/AutocompleteDropdown.cjs.map +1 -0
- package/dist/server/components/AutocompleteDropdown.js +424 -0
- package/dist/server/components/AutocompleteDropdown.js.map +1 -0
- package/dist/server/components/AutocompleteFormField.cjs +565 -0
- package/dist/server/components/AutocompleteFormField.cjs.map +1 -0
- package/dist/server/components/AutocompleteFormField.js +564 -0
- package/dist/server/components/AutocompleteFormField.js.map +1 -0
- package/dist/server/components/BriefingDiff.cjs +401 -0
- package/dist/server/components/BriefingDiff.cjs.map +1 -0
- package/dist/server/components/BriefingDiff.js +401 -0
- package/dist/server/components/BriefingDiff.js.map +1 -0
- package/dist/server/components/CarouselRenderer.cjs +121 -0
- package/dist/server/components/CarouselRenderer.cjs.map +1 -0
- package/dist/server/components/CarouselRenderer.js +121 -0
- package/dist/server/components/CarouselRenderer.js.map +1 -0
- package/dist/server/components/ChartJSRenderer.cjs +1041 -0
- package/dist/server/components/ChartJSRenderer.cjs.map +1 -0
- package/dist/server/components/ChartJSRenderer.js +1040 -0
- package/dist/server/components/ChartJSRenderer.js.map +1 -0
- package/dist/server/components/ChatPrompt.cjs +697 -0
- package/dist/server/components/ChatPrompt.cjs.map +1 -0
- package/dist/server/components/ChatPrompt.js +697 -0
- package/dist/server/components/ChatPrompt.js.map +1 -0
- package/dist/server/components/CodeBlockRenderer.cjs +319 -0
- package/dist/server/components/CodeBlockRenderer.cjs.map +1 -0
- package/dist/server/components/CodeBlockRenderer.js +319 -0
- package/dist/server/components/CodeBlockRenderer.js.map +1 -0
- package/dist/server/components/ComponentToolbar.cjs +93 -0
- package/dist/server/components/ComponentToolbar.cjs.map +1 -0
- package/dist/server/components/ComponentToolbar.js +93 -0
- package/dist/server/components/ComponentToolbar.js.map +1 -0
- package/dist/server/components/DataPreviewSection.cjs +501 -0
- package/dist/server/components/DataPreviewSection.cjs.map +1 -0
- package/dist/server/components/DataPreviewSection.js +501 -0
- package/dist/server/components/DataPreviewSection.js.map +1 -0
- package/dist/server/components/DegradedFallback.cjs +258 -0
- package/dist/server/components/DegradedFallback.cjs.map +1 -0
- package/dist/server/components/DegradedFallback.js +258 -0
- package/dist/server/components/DegradedFallback.js.map +1 -0
- package/dist/server/components/DraggableGridItem.cjs +277 -0
- package/dist/server/components/DraggableGridItem.cjs.map +1 -0
- package/dist/server/components/DraggableGridItem.js +276 -0
- package/dist/server/components/DraggableGridItem.js.map +1 -0
- package/dist/server/components/EditableLayoutContext.cjs +26 -0
- package/dist/server/components/EditableLayoutContext.cjs.map +1 -0
- package/dist/server/components/EditableLayoutContext.js +25 -0
- package/dist/server/components/EditableLayoutContext.js.map +1 -0
- package/dist/server/components/EditableUIResourceRenderer.cjs +395 -0
- package/dist/server/components/EditableUIResourceRenderer.cjs.map +1 -0
- package/dist/server/components/EditableUIResourceRenderer.js +394 -0
- package/dist/server/components/EditableUIResourceRenderer.js.map +1 -0
- package/dist/server/components/ElicitationForm.cjs +64 -0
- package/dist/server/components/ElicitationForm.cjs.map +1 -0
- package/dist/server/components/ElicitationForm.js +64 -0
- package/dist/server/components/ElicitationForm.js.map +1 -0
- package/dist/server/components/ExpandableWrapper.cjs +191 -0
- package/dist/server/components/ExpandableWrapper.cjs.map +1 -0
- package/dist/server/components/ExpandableWrapper.js +190 -0
- package/dist/server/components/ExpandableWrapper.js.map +1 -0
- package/dist/server/components/FeedbackInline.cjs +134 -0
- package/dist/server/components/FeedbackInline.cjs.map +1 -0
- package/dist/server/components/FeedbackInline.js +134 -0
- package/dist/server/components/FeedbackInline.js.map +1 -0
- package/dist/server/components/FooterRenderer.cjs +196 -0
- package/dist/server/components/FooterRenderer.cjs.map +1 -0
- package/dist/server/components/FooterRenderer.js +196 -0
- package/dist/server/components/FooterRenderer.js.map +1 -0
- package/dist/server/components/FormFieldRenderer.cjs +1916 -0
- package/dist/server/components/FormFieldRenderer.cjs.map +1 -0
- package/dist/server/components/FormFieldRenderer.js +1916 -0
- package/dist/server/components/FormFieldRenderer.js.map +1 -0
- package/dist/server/components/FormRenderer.cjs +388 -0
- package/dist/server/components/FormRenderer.cjs.map +1 -0
- package/dist/server/components/FormRenderer.js +388 -0
- package/dist/server/components/FormRenderer.js.map +1 -0
- package/dist/server/components/GenerativeUIErrorBoundary.cjs +259 -0
- package/dist/server/components/GenerativeUIErrorBoundary.cjs.map +1 -0
- package/dist/server/components/GenerativeUIErrorBoundary.js +259 -0
- package/dist/server/components/GenerativeUIErrorBoundary.js.map +1 -0
- package/dist/server/components/GhostText.cjs +264 -0
- package/dist/server/components/GhostText.cjs.map +1 -0
- package/dist/server/components/GhostText.js +262 -0
- package/dist/server/components/GhostText.js.map +1 -0
- package/dist/server/components/GraphRenderer.cjs +513 -0
- package/dist/server/components/GraphRenderer.cjs.map +1 -0
- package/dist/server/components/GraphRenderer.js +510 -0
- package/dist/server/components/GraphRenderer.js.map +1 -0
- package/dist/server/components/GridRenderer.cjs +116 -0
- package/dist/server/components/GridRenderer.cjs.map +1 -0
- package/dist/server/components/GridRenderer.js +115 -0
- package/dist/server/components/GridRenderer.js.map +1 -0
- package/dist/server/components/IframeFallbackLink.cjs +75 -0
- package/dist/server/components/IframeFallbackLink.cjs.map +1 -0
- package/dist/server/components/IframeFallbackLink.js +75 -0
- package/dist/server/components/IframeFallbackLink.js.map +1 -0
- package/dist/server/components/ImageGalleryRenderer.cjs +289 -0
- package/dist/server/components/ImageGalleryRenderer.cjs.map +1 -0
- package/dist/server/components/ImageGalleryRenderer.js +289 -0
- package/dist/server/components/ImageGalleryRenderer.js.map +1 -0
- package/dist/server/components/LightboxOverlay.cjs +426 -0
- package/dist/server/components/LightboxOverlay.cjs.map +1 -0
- package/dist/server/components/LightboxOverlay.js +426 -0
- package/dist/server/components/LightboxOverlay.js.map +1 -0
- package/dist/server/components/MapRenderer.cjs +560 -0
- package/dist/server/components/MapRenderer.cjs.map +1 -0
- package/dist/server/components/MapRenderer.js +556 -0
- package/dist/server/components/MapRenderer.js.map +1 -0
- package/dist/server/components/MissingValue.cjs +52 -0
- package/dist/server/components/MissingValue.cjs.map +1 -0
- package/dist/server/components/MissingValue.js +50 -0
- package/dist/server/components/MissingValue.js.map +1 -0
- package/dist/server/components/ModalRenderer.cjs +234 -0
- package/dist/server/components/ModalRenderer.cjs.map +1 -0
- package/dist/server/components/ModalRenderer.js +234 -0
- package/dist/server/components/ModalRenderer.js.map +1 -0
- package/dist/server/components/PortalDropdownMenu.cjs +98 -0
- package/dist/server/components/PortalDropdownMenu.cjs.map +1 -0
- package/dist/server/components/PortalDropdownMenu.js +98 -0
- package/dist/server/components/PortalDropdownMenu.js.map +1 -0
- package/dist/server/components/PresentationFeedback.cjs +317 -0
- package/dist/server/components/PresentationFeedback.cjs.map +1 -0
- package/dist/server/components/PresentationFeedback.js +316 -0
- package/dist/server/components/PresentationFeedback.js.map +1 -0
- package/dist/server/components/RenderContext.cjs +66 -0
- package/dist/server/components/RenderContext.cjs.map +1 -0
- package/dist/server/components/RenderContext.js +64 -0
- package/dist/server/components/RenderContext.js.map +1 -0
- package/dist/server/components/ResizeHandle.cjs +158 -0
- package/dist/server/components/ResizeHandle.cjs.map +1 -0
- package/dist/server/components/ResizeHandle.js +157 -0
- package/dist/server/components/ResizeHandle.js.map +1 -0
- package/dist/server/components/SafeHtml.cjs +70 -0
- package/dist/server/components/SafeHtml.cjs.map +1 -0
- package/dist/server/components/SafeHtml.js +69 -0
- package/dist/server/components/SafeHtml.js.map +1 -0
- package/dist/server/components/ScratchpadPanel.cjs +4738 -0
- package/dist/server/components/ScratchpadPanel.cjs.map +1 -0
- package/dist/server/components/ScratchpadPanel.js +4738 -0
- package/dist/server/components/ScratchpadPanel.js.map +1 -0
- package/dist/server/components/SplitStepper.cjs +218 -0
- package/dist/server/components/SplitStepper.cjs.map +1 -0
- package/dist/server/components/SplitStepper.js +218 -0
- package/dist/server/components/SplitStepper.js.map +1 -0
- package/dist/server/components/StreamingUIRenderer.cjs +576 -0
- package/dist/server/components/StreamingUIRenderer.cjs.map +1 -0
- package/dist/server/components/StreamingUIRenderer.js +576 -0
- package/dist/server/components/StreamingUIRenderer.js.map +1 -0
- package/dist/server/components/UIResourceRenderer.cjs +4135 -0
- package/dist/server/components/UIResourceRenderer.cjs.map +1 -0
- package/dist/server/components/UIResourceRenderer.js +4133 -0
- package/dist/server/components/UIResourceRenderer.js.map +1 -0
- package/dist/server/components/VerifiedText.cjs +193 -0
- package/dist/server/components/VerifiedText.cjs.map +1 -0
- package/dist/server/components/VerifiedText.js +193 -0
- package/dist/server/components/VerifiedText.js.map +1 -0
- package/dist/server/components/VideoRenderer.cjs +342 -0
- package/dist/server/components/VideoRenderer.cjs.map +1 -0
- package/dist/server/components/VideoRenderer.js +340 -0
- package/dist/server/components/VideoRenderer.js.map +1 -0
- package/dist/server/components/chart-data-table.cjs +105 -0
- package/dist/server/components/chart-data-table.cjs.map +1 -0
- package/dist/server/components/chart-data-table.js +104 -0
- package/dist/server/components/chart-data-table.js.map +1 -0
- package/dist/server/components/chart-missing-plugin.cjs +19 -0
- package/dist/server/components/chart-missing-plugin.cjs.map +1 -0
- package/dist/server/components/chart-missing-plugin.js +18 -0
- package/dist/server/components/chart-missing-plugin.js.map +1 -0
- package/dist/server/components.cjs +73 -0
- package/dist/server/components.cjs.map +1 -0
- package/dist/server/components.js +33 -0
- package/dist/server/components.js.map +1 -0
- package/dist/server/context/AutocompleteContext.cjs +197 -0
- package/dist/server/context/AutocompleteContext.cjs.map +1 -0
- package/dist/server/context/AutocompleteContext.js +194 -0
- package/dist/server/context/AutocompleteContext.js.map +1 -0
- package/dist/server/context/MCPActionContext.cjs +194 -0
- package/dist/server/context/MCPActionContext.cjs.map +1 -0
- package/dist/server/context/MCPActionContext.js +191 -0
- package/dist/server/context/MCPActionContext.js.map +1 -0
- package/dist/server/context/MCPUIConfigContext.cjs +108 -0
- package/dist/server/context/MCPUIConfigContext.cjs.map +1 -0
- package/dist/server/context/MCPUIConfigContext.js +105 -0
- package/dist/server/context/MCPUIConfigContext.js.map +1 -0
- package/dist/server/context/MCPUIMathContext.cjs +31 -0
- package/dist/server/context/MCPUIMathContext.cjs.map +1 -0
- package/dist/server/context/MCPUIMathContext.js +30 -0
- package/dist/server/context/MCPUIMathContext.js.map +1 -0
- package/dist/server/context/MCPUIStringsContext.cjs +399 -0
- package/dist/server/context/MCPUIStringsContext.cjs.map +1 -0
- package/dist/server/context/MCPUIStringsContext.js +394 -0
- package/dist/server/context/MCPUIStringsContext.js.map +1 -0
- package/dist/server/context/MCPUITelemetryContext.cjs +56 -0
- package/dist/server/context/MCPUITelemetryContext.cjs.map +1 -0
- package/dist/server/context/MCPUITelemetryContext.js +54 -0
- package/dist/server/context/MCPUITelemetryContext.js.map +1 -0
- package/dist/server/hooks/createResponsiveGrid.cjs +42 -0
- package/dist/server/hooks/createResponsiveGrid.cjs.map +1 -0
- package/dist/server/hooks/createResponsiveGrid.js +42 -0
- package/dist/server/hooks/createResponsiveGrid.js.map +1 -0
- package/dist/server/hooks/useAction.cjs +201 -0
- package/dist/server/hooks/useAction.cjs.map +1 -0
- package/dist/server/hooks/useAction.js +200 -0
- package/dist/server/hooks/useAction.js.map +1 -0
- package/dist/server/hooks/useAutocomplete.cjs +232 -0
- package/dist/server/hooks/useAutocomplete.cjs.map +1 -0
- package/dist/server/hooks/useAutocomplete.js +232 -0
- package/dist/server/hooks/useAutocomplete.js.map +1 -0
- package/dist/server/hooks/useChatBus.cjs +83 -0
- package/dist/server/hooks/useChatBus.cjs.map +1 -0
- package/dist/server/hooks/useChatBus.js +82 -0
- package/dist/server/hooks/useChatBus.js.map +1 -0
- package/dist/server/hooks/useConditionalField.cjs +55 -0
- package/dist/server/hooks/useConditionalField.cjs.map +1 -0
- package/dist/server/hooks/useConditionalField.js +54 -0
- package/dist/server/hooks/useConditionalField.js.map +1 -0
- package/dist/server/hooks/useDataValidator.cjs +47 -0
- package/dist/server/hooks/useDataValidator.cjs.map +1 -0
- package/dist/server/hooks/useDataValidator.js +47 -0
- package/dist/server/hooks/useDataValidator.js.map +1 -0
- package/dist/server/hooks/useDragDrop.cjs +189 -0
- package/dist/server/hooks/useDragDrop.cjs.map +1 -0
- package/dist/server/hooks/useDragDrop.js +189 -0
- package/dist/server/hooks/useDragDrop.js.map +1 -0
- package/dist/server/hooks/useFormPersistence.cjs +148 -0
- package/dist/server/hooks/useFormPersistence.cjs.map +1 -0
- package/dist/server/hooks/useFormPersistence.js +148 -0
- package/dist/server/hooks/useFormPersistence.js.map +1 -0
- package/dist/server/hooks/useModal.cjs +105 -0
- package/dist/server/hooks/useModal.cjs.map +1 -0
- package/dist/server/hooks/useModal.js +104 -0
- package/dist/server/hooks/useModal.js.map +1 -0
- package/dist/server/hooks/useResize.cjs +217 -0
- package/dist/server/hooks/useResize.cjs.map +1 -0
- package/dist/server/hooks/useResize.js +217 -0
- package/dist/server/hooks/useResize.js.map +1 -0
- package/dist/server/hooks/useStreamingUI.cjs +345 -0
- package/dist/server/hooks/useStreamingUI.cjs.map +1 -0
- package/dist/server/hooks/useStreamingUI.js +344 -0
- package/dist/server/hooks/useStreamingUI.js.map +1 -0
- package/dist/server/hooks.cjs +30 -0
- package/dist/server/hooks.cjs.map +1 -0
- package/dist/server/hooks.js +15 -0
- package/dist/server/hooks.js.map +1 -0
- package/dist/server/index.cjs +188 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.js +63 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/plugins/duckdb.cjs +186 -0
- package/dist/server/plugins/duckdb.cjs.map +1 -0
- package/dist/server/plugins/duckdb.js +178 -0
- package/dist/server/plugins/duckdb.js.map +1 -0
- package/dist/server/plugins/groq.cjs +94 -0
- package/dist/server/plugins/groq.cjs.map +1 -0
- package/dist/server/plugins/groq.js +93 -0
- package/dist/server/plugins/groq.js.map +1 -0
- package/dist/server/plugins/katex.cjs +29 -0
- package/dist/server/plugins/katex.cjs.map +1 -0
- package/dist/server/plugins/katex.js +24 -0
- package/dist/server/plugins/katex.js.map +1 -0
- package/dist/server/plugins/rest.cjs +91 -0
- package/dist/server/plugins/rest.cjs.map +1 -0
- package/dist/server/plugins/rest.js +90 -0
- package/dist/server/plugins/rest.js.map +1 -0
- package/dist/server/plugins/supabase.cjs +74 -0
- package/dist/server/plugins/supabase.cjs.map +1 -0
- package/dist/server/plugins/supabase.js +73 -0
- package/dist/server/plugins/supabase.js.map +1 -0
- package/dist/server/services/chat-bus.cjs +290 -0
- package/dist/server/services/chat-bus.cjs.map +1 -0
- package/dist/server/services/chat-bus.js +285 -0
- package/dist/server/services/chat-bus.js.map +1 -0
- package/dist/server/services/chat-prompt-controller.cjs +152 -0
- package/dist/server/services/chat-prompt-controller.cjs.map +1 -0
- package/dist/server/services/chat-prompt-controller.js +151 -0
- package/dist/server/services/chat-prompt-controller.js.map +1 -0
- package/dist/server/services/component-registry.cjs +1879 -0
- package/dist/server/services/component-registry.cjs.map +1 -0
- package/dist/server/services/component-registry.js +1859 -0
- package/dist/server/services/component-registry.js.map +1 -0
- package/dist/server/services/data-validator.cjs +104 -0
- package/dist/server/services/data-validator.cjs.map +1 -0
- package/dist/server/services/data-validator.js +104 -0
- package/dist/server/services/data-validator.js.map +1 -0
- package/dist/server/services/telemetry.cjs +54 -0
- package/dist/server/services/telemetry.cjs.map +1 -0
- package/dist/server/services/telemetry.js +54 -0
- package/dist/server/services/telemetry.js.map +1 -0
- package/dist/server/services/validation.cjs +771 -0
- package/dist/server/services/validation.cjs.map +1 -0
- package/dist/server/services/validation.js +756 -0
- package/dist/server/services/validation.js.map +1 -0
- package/dist/server/stores/scratchpad-store.cjs +203 -0
- package/dist/server/stores/scratchpad-store.cjs.map +1 -0
- package/dist/server/stores/scratchpad-store.js +199 -0
- package/dist/server/stores/scratchpad-store.js.map +1 -0
- package/dist/server/stores/server-capabilities-store.cjs +159 -0
- package/dist/server/stores/server-capabilities-store.cjs.map +1 -0
- package/dist/server/stores/server-capabilities-store.js +155 -0
- package/dist/server/stores/server-capabilities-store.js.map +1 -0
- package/dist/server/testing/index.cjs +42 -0
- package/dist/server/testing/index.cjs.map +1 -0
- package/dist/server/testing/index.js +42 -0
- package/dist/server/testing/index.js.map +1 -0
- package/dist/server/types-export.cjs +6 -0
- package/dist/server/types-export.cjs.map +1 -0
- package/dist/server/types-export.js +3 -0
- package/dist/server/types-export.js.map +1 -0
- package/dist/server/types.cjs +6 -0
- package/dist/server/types.cjs.map +1 -0
- package/dist/server/types.js +3 -0
- package/dist/server/types.js.map +1 -0
- package/dist/server/utils/degraded-projections.cjs +169 -0
- package/dist/server/utils/degraded-projections.cjs.map +1 -0
- package/dist/server/utils/degraded-projections.js +166 -0
- package/dist/server/utils/degraded-projections.js.map +1 -0
- package/dist/server/utils/duplicate-mount-registry.cjs +66 -0
- package/dist/server/utils/duplicate-mount-registry.cjs.map +1 -0
- package/dist/server/utils/duplicate-mount-registry.js +63 -0
- package/dist/server/utils/duplicate-mount-registry.js.map +1 -0
- package/dist/server/utils/escape-html.cjs +18 -0
- package/dist/server/utils/escape-html.cjs.map +1 -0
- package/dist/server/utils/escape-html.js +18 -0
- package/dist/server/utils/escape-html.js.map +1 -0
- package/dist/server/utils/format-string.cjs +31 -0
- package/dist/server/utils/format-string.cjs.map +1 -0
- package/dist/server/utils/format-string.js +31 -0
- package/dist/server/utils/format-string.js.map +1 -0
- package/dist/server/utils/iframe-coep.cjs +74 -0
- package/dist/server/utils/iframe-coep.cjs.map +1 -0
- package/dist/server/utils/iframe-coep.js +72 -0
- package/dist/server/utils/iframe-coep.js.map +1 -0
- package/dist/server/utils/logger.cjs +72 -0
- package/dist/server/utils/logger.cjs.map +1 -0
- package/dist/server/utils/logger.js +70 -0
- package/dist/server/utils/logger.js.map +1 -0
- package/dist/server/utils/math-markdown.cjs +248 -0
- package/dist/server/utils/math-markdown.cjs.map +1 -0
- package/dist/server/utils/math-markdown.js +247 -0
- package/dist/server/utils/math-markdown.js.map +1 -0
- package/dist/server/utils/missing-value.cjs +81 -0
- package/dist/server/utils/missing-value.cjs.map +1 -0
- package/dist/server/utils/missing-value.js +77 -0
- package/dist/server/utils/missing-value.js.map +1 -0
- package/dist/server/utils/overlay-lifecycle.cjs +30 -0
- package/dist/server/utils/overlay-lifecycle.cjs.map +1 -0
- package/dist/server/utils/overlay-lifecycle.js +30 -0
- package/dist/server/utils/overlay-lifecycle.js.map +1 -0
- package/dist/server/utils/pan-zoom.cjs +534 -0
- package/dist/server/utils/pan-zoom.cjs.map +1 -0
- package/dist/server/utils/pan-zoom.js +530 -0
- package/dist/server/utils/pan-zoom.js.map +1 -0
- package/dist/server/utils/perf.cjs +40 -0
- package/dist/server/utils/perf.cjs.map +1 -0
- package/dist/server/utils/perf.js +38 -0
- package/dist/server/utils/perf.js.map +1 -0
- package/dist/server/utils/safe-url.cjs +70 -0
- package/dist/server/utils/safe-url.cjs.map +1 -0
- package/dist/server/utils/safe-url.js +70 -0
- package/dist/server/utils/safe-url.js.map +1 -0
- package/dist/server/utils/sanitize-html.cjs +258 -0
- package/dist/server/utils/sanitize-html.cjs.map +1 -0
- package/dist/server/utils/sanitize-html.js +254 -0
- package/dist/server/utils/sanitize-html.js.map +1 -0
- package/dist/server/utils/solid2-virtualizer.cjs +49 -0
- package/dist/server/utils/solid2-virtualizer.cjs.map +1 -0
- package/dist/server/utils/solid2-virtualizer.js +48 -0
- package/dist/server/utils/solid2-virtualizer.js.map +1 -0
- package/dist/server/utils/stable-key.cjs +78 -0
- package/dist/server/utils/stable-key.cjs.map +1 -0
- package/dist/server/utils/stable-key.js +78 -0
- package/dist/server/utils/stable-key.js.map +1 -0
- package/dist/server/utils/theme.cjs +85 -0
- package/dist/server/utils/theme.cjs.map +1 -0
- package/dist/server/utils/theme.js +84 -0
- package/dist/server/utils/theme.js.map +1 -0
- package/dist/server/validation.cjs +21 -0
- package/dist/server/validation.cjs.map +1 -0
- package/dist/server/validation.js +3 -0
- package/dist/server/validation.js.map +1 -0
- package/dist/services/chat-bus.cjs +270 -215
- package/dist/services/chat-bus.cjs.map +1 -1
- package/dist/services/chat-bus.d.cts +100 -0
- package/dist/services/chat-bus.d.ts +1 -2
- package/dist/services/chat-bus.js +271 -221
- package/dist/services/chat-bus.js.map +1 -1
- package/dist/services/chat-prompt-controller.cjs +148 -79
- package/dist/services/chat-prompt-controller.cjs.map +1 -1
- package/dist/services/chat-prompt-controller.d.cts +92 -0
- package/dist/services/chat-prompt-controller.d.ts +1 -2
- package/dist/services/chat-prompt-controller.d.ts.map +1 -1
- package/dist/services/chat-prompt-controller.js +149 -81
- package/dist/services/chat-prompt-controller.js.map +1 -1
- package/dist/services/component-registry.cjs +1829 -1289
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.cts +119 -0
- package/dist/services/component-registry.d.ts +1 -2
- package/dist/services/component-registry.js +1829 -1309
- package/dist/services/component-registry.js.map +1 -1
- package/dist/services/data-validator.cjs +96 -77
- package/dist/services/data-validator.cjs.map +1 -1
- package/dist/services/data-validator.d.cts +27 -0
- package/dist/services/data-validator.d.ts +1 -2
- package/dist/services/data-validator.js +97 -78
- package/dist/services/data-validator.js.map +1 -1
- package/dist/services/index.d.cts +9 -0
- package/dist/services/index.d.ts +4 -5
- package/dist/services/telemetry.cjs +49 -50
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.d.cts +86 -0
- package/dist/services/telemetry.d.ts +1 -2
- package/dist/services/telemetry.js +50 -51
- package/dist/services/telemetry.js.map +1 -1
- package/dist/services/validation.cjs +724 -710
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.cts +169 -0
- package/dist/services/validation.d.ts +1 -2
- package/dist/services/validation.js +723 -724
- package/dist/services/validation.js.map +1 -1
- package/dist/stores/scratchpad-store.cjs +184 -106
- package/dist/stores/scratchpad-store.cjs.map +1 -1
- package/dist/stores/scratchpad-store.d.cts +109 -0
- package/dist/stores/scratchpad-store.d.ts +2 -3
- package/dist/stores/scratchpad-store.d.ts.map +1 -1
- package/dist/stores/scratchpad-store.js +185 -111
- package/dist/stores/scratchpad-store.js.map +1 -1
- package/dist/stores/server-capabilities-store.cjs +140 -49
- package/dist/stores/server-capabilities-store.cjs.map +1 -1
- package/dist/stores/server-capabilities-store.d.cts +171 -0
- package/dist/stores/server-capabilities-store.d.ts +2 -3
- package/dist/stores/server-capabilities-store.d.ts.map +1 -1
- package/dist/stores/server-capabilities-store.js +141 -54
- package/dist/stores/server-capabilities-store.js.map +1 -1
- package/dist/test-setup.d.cts +5 -0
- package/dist/test-setup.d.ts +0 -1
- package/dist/testing/index.cjs +39 -16
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +34 -0
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +39 -16
- package/dist/testing/index.js.map +1 -1
- package/dist/types/chat-bus.d.cts +783 -0
- package/dist/types/chat-bus.d.ts +5 -6
- package/dist/types/chat-bus.d.ts.map +1 -1
- package/dist/types/index.d.cts +1616 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types-export.cjs +0 -2
- package/dist/types-export.d.cts +1 -2
- package/dist/types-export.d.ts +1 -2
- package/dist/types-export.js +0 -2
- package/dist/types.cjs +0 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -2
- package/dist/utils/degraded-projections.cjs +153 -112
- package/dist/utils/degraded-projections.cjs.map +1 -1
- package/dist/utils/degraded-projections.d.cts +119 -0
- package/dist/utils/degraded-projections.d.ts +0 -1
- package/dist/utils/degraded-projections.js +152 -114
- package/dist/utils/degraded-projections.js.map +1 -1
- package/dist/utils/duplicate-mount-registry.cjs +54 -15
- package/dist/utils/duplicate-mount-registry.cjs.map +1 -1
- package/dist/utils/duplicate-mount-registry.d.cts +83 -0
- package/dist/utils/duplicate-mount-registry.d.ts +0 -1
- package/dist/utils/duplicate-mount-registry.js +55 -19
- package/dist/utils/duplicate-mount-registry.js.map +1 -1
- package/dist/utils/escape-html.cjs +15 -7
- package/dist/utils/escape-html.cjs.map +1 -1
- package/dist/utils/escape-html.d.cts +12 -0
- package/dist/utils/escape-html.d.ts +0 -1
- package/dist/utils/escape-html.js +16 -8
- package/dist/utils/escape-html.js.map +1 -1
- package/dist/utils/format-string.cjs +28 -7
- package/dist/utils/format-string.cjs.map +1 -1
- package/dist/utils/format-string.d.cts +25 -0
- package/dist/utils/format-string.d.ts +0 -1
- package/dist/utils/format-string.js +29 -8
- package/dist/utils/format-string.js.map +1 -1
- package/dist/utils/iframe-coep.cjs +65 -21
- package/dist/utils/iframe-coep.cjs.map +1 -1
- package/dist/utils/iframe-coep.d.cts +53 -0
- package/dist/utils/iframe-coep.d.ts +1 -2
- package/dist/utils/iframe-coep.d.ts.map +1 -1
- package/dist/utils/iframe-coep.js +65 -23
- package/dist/utils/iframe-coep.js.map +1 -1
- package/dist/utils/logger.cjs +57 -38
- package/dist/utils/logger.cjs.map +1 -1
- package/dist/utils/logger.d.cts +57 -0
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +58 -41
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/math-markdown.cjs +230 -222
- 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 +229 -222
- package/dist/utils/math-markdown.js.map +1 -1
- package/dist/utils/missing-value.cjs +67 -46
- package/dist/utils/missing-value.cjs.map +1 -1
- package/dist/utils/missing-value.d.cts +78 -0
- package/dist/utils/missing-value.d.ts +0 -1
- package/dist/utils/missing-value.js +68 -51
- package/dist/utils/missing-value.js.map +1 -1
- package/dist/utils/overlay-lifecycle.cjs +43 -0
- package/dist/utils/overlay-lifecycle.cjs.map +1 -0
- package/dist/utils/overlay-lifecycle.d.cts +4 -0
- package/dist/utils/overlay-lifecycle.d.ts +4 -0
- package/dist/utils/overlay-lifecycle.d.ts.map +1 -0
- package/dist/utils/overlay-lifecycle.js +42 -0
- package/dist/utils/overlay-lifecycle.js.map +1 -0
- package/dist/utils/pan-zoom.cjs +519 -297
- package/dist/utils/pan-zoom.cjs.map +1 -1
- package/dist/utils/pan-zoom.d.cts +235 -0
- package/dist/utils/pan-zoom.d.ts +2 -2
- package/dist/utils/pan-zoom.d.ts.map +1 -1
- package/dist/utils/pan-zoom.js +519 -301
- package/dist/utils/pan-zoom.js.map +1 -1
- package/dist/utils/perf.cjs +31 -25
- package/dist/utils/perf.cjs.map +1 -1
- package/dist/utils/perf.d.cts +18 -0
- package/dist/utils/perf.d.ts +0 -1
- package/dist/utils/perf.js +32 -28
- package/dist/utils/perf.js.map +1 -1
- package/dist/utils/safe-url.cjs +67 -20
- package/dist/utils/safe-url.cjs.map +1 -1
- package/dist/utils/safe-url.d.cts +33 -0
- package/dist/utils/safe-url.d.ts +0 -1
- package/dist/utils/safe-url.js +68 -21
- package/dist/utils/safe-url.js.map +1 -1
- package/dist/utils/sanitize-html.cjs +250 -71
- package/dist/utils/sanitize-html.cjs.map +1 -1
- package/dist/utils/sanitize-html.d.cts +142 -0
- package/dist/utils/sanitize-html.d.ts +0 -1
- package/dist/utils/sanitize-html.js +248 -73
- package/dist/utils/sanitize-html.js.map +1 -1
- package/dist/utils/solid2-virtualizer.cjs +47 -0
- package/dist/utils/solid2-virtualizer.cjs.map +1 -0
- package/dist/utils/solid2-virtualizer.d.cts +17 -0
- package/dist/utils/solid2-virtualizer.d.ts +17 -0
- package/dist/utils/solid2-virtualizer.d.ts.map +1 -0
- package/dist/utils/solid2-virtualizer.js +47 -0
- package/dist/utils/solid2-virtualizer.js.map +1 -0
- package/dist/utils/stable-key.cjs +69 -32
- package/dist/utils/stable-key.cjs.map +1 -1
- package/dist/utils/stable-key.d.cts +32 -0
- package/dist/utils/stable-key.d.ts +0 -1
- package/dist/utils/stable-key.js +70 -33
- package/dist/utils/stable-key.js.map +1 -1
- package/dist/utils/theme.cjs +86 -83
- package/dist/utils/theme.cjs.map +1 -1
- package/dist/utils/theme.d.cts +10 -0
- package/dist/utils/theme.d.ts +1 -2
- package/dist/utils/theme.d.ts.map +1 -1
- package/dist/utils/theme.js +87 -86
- package/dist/utils/theme.js.map +1 -1
- package/dist/validation.cjs +15 -17
- package/dist/validation.d.cts +3 -4
- package/dist/validation.d.ts +3 -4
- package/dist/validation.js +1 -18
- package/docs/SECURITY-DEPENDENCIES.md +121 -1
- package/docs/SOLID2-DEPOSIUM-HANDOFF-2026-10-27.md +157 -0
- package/docs/SOLID2-PREVIEW-HANDOFF-2026-10-23.md +230 -0
- package/docs/SOLID2-PREVIEW.md +270 -0
- package/docs/ZOD4-STABLE-MIGRATION-2026-10-26.md +181 -0
- package/package.json +65 -16
- package/src/adapters/connector.ts +3 -3
- package/src/components/AutocompleteDropdown.tsx +4 -3
- package/src/components/AutocompleteFormField.tsx +18 -18
- package/src/components/CarouselRenderer.tsx +1 -1
- package/src/components/ChartJSRenderer.tsx +42 -37
- package/src/components/ChatPrompt.tsx +5 -7
- package/src/components/CodeBlockRenderer.tsx +27 -13
- package/src/components/DataPreviewSection.tsx +8 -12
- package/src/components/DraggableGridItem.tsx +8 -4
- package/src/components/EditableLayoutContext.tsx +1 -1
- package/src/components/EditableUIResourceRenderer.tsx +20 -27
- package/src/components/ExpandableWrapper.tsx +34 -23
- package/src/components/FormFieldRenderer.tsx +27 -25
- package/src/components/FormRenderer.tsx +18 -25
- package/src/components/GenerativeUIErrorBoundary.tsx +28 -26
- package/src/components/GhostText.tsx +2 -1
- package/src/components/GraphRenderer.tsx +10 -7
- package/src/components/GridRenderer.tsx +1 -1
- package/src/components/IframeFallbackLink.tsx +2 -1
- package/src/components/LightboxOverlay.tsx +10 -10
- package/src/components/MapRenderer.tsx +42 -21
- package/src/components/MissingValue.tsx +2 -1
- package/src/components/ModalRenderer.tsx +21 -29
- package/src/components/PortalDropdownMenu.tsx +8 -7
- package/src/components/PresentationFeedback.tsx +2 -2
- package/src/components/RenderContext.tsx +4 -3
- package/src/components/ResizeHandle.tsx +5 -4
- package/src/components/SafeHtml.tsx +7 -6
- package/src/components/ScratchpadPanel.tsx +43 -41
- package/src/components/SplitStepper.tsx +2 -2
- package/src/components/StreamingUIRenderer.tsx +11 -10
- package/src/components/UIResourceRenderer.tsx +155 -131
- package/src/components/VerifiedText.tsx +2 -3
- package/src/components/VideoRenderer.tsx +2 -2
- package/src/context/AutocompleteContext.tsx +9 -8
- package/src/context/MCPActionContext.tsx +7 -7
- package/src/context/MCPUIConfigContext.tsx +13 -7
- package/src/context/MCPUIMathContext.tsx +4 -3
- package/src/context/MCPUIStringsContext.tsx +11 -6
- package/src/context/MCPUITelemetryContext.tsx +6 -11
- package/src/hooks/createResponsiveGrid.ts +4 -4
- package/src/hooks/useAutocomplete.ts +38 -50
- package/src/hooks/useChatBus.tsx +5 -5
- package/src/hooks/useDragDrop.ts +19 -27
- package/src/hooks/useFormPersistence.ts +29 -18
- package/src/hooks/useModal.ts +8 -6
- package/src/hooks/useResize.ts +10 -17
- package/src/hooks/useStreamingUI.ts +56 -19
- package/src/plugins/duckdb.ts +12 -3
- package/src/services/chat-prompt-controller.ts +8 -7
- package/src/solid-jsx-attrs.d.ts +4 -23
- package/src/stores/scratchpad-store.tsx +63 -52
- package/src/stores/server-capabilities-store.tsx +10 -8
- package/src/types/chat-bus.ts +1 -1
- package/src/utils/iframe-coep.ts +2 -2
- package/src/utils/overlay-lifecycle.ts +41 -0
- package/src/utils/pan-zoom.ts +2 -1
- package/src/utils/sanitize-html.ts +1 -1
- package/src/utils/solid2-virtualizer.ts +62 -0
- package/src/utils/theme.ts +19 -13
- package/dist/adapters.cjs.map +0 -1
- package/dist/adapters.js.map +0 -1
- package/dist/components.cjs.map +0 -1
- package/dist/components.js.map +0 -1
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types-export.cjs.map +0 -1
- package/dist/types-export.js.map +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validation.cjs.map +0 -1
- package/dist/validation.js.map +0 -1
|
@@ -1,757 +1,756 @@
|
|
|
1
|
-
import { GraphComponentParamsSchema, MapComponentParamsSchema, FormComponentParamsSchema, ArtifactComponentParamsSchema, CodeComponentParamsSchema, ActionGroupParamsSchema, ImageGalleryParamsSchema, CarouselComponentParamsSchema, VideoComponentParamsSchema, ActionParamsSchema, LinkComponentParamsSchema, ImageComponentParamsSchema, IframeComponentParamsSchema, TextComponentParamsSchema, MetricComponentParamsSchema, ComponentTypeSchema } from "@seed-ship/mcp-ui-spec";
|
|
2
1
|
import { formatMCPUIString } from "../utils/format-string.js";
|
|
3
2
|
import { PART_TO_WHOLE_CHART_TYPES } from "../utils/missing-value.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
import { ActionGroupParamsSchema, ActionParamsSchema, ArtifactComponentParamsSchema, CarouselComponentParamsSchema, CodeComponentParamsSchema, ComponentTypeSchema, FormComponentParamsSchema, GraphComponentParamsSchema, IframeComponentParamsSchema, ImageComponentParamsSchema, ImageGalleryParamsSchema, LinkComponentParamsSchema, MapComponentParamsSchema, MetricComponentParamsSchema, TextComponentParamsSchema, VideoComponentParamsSchema } from "@seed-ship/mcp-ui-spec";
|
|
4
|
+
// src/services/validation.ts
|
|
5
|
+
/**
|
|
6
|
+
* All known ComponentType values — used to distinguish known-but-unvalidated
|
|
7
|
+
* types (pass through) from truly unknown strings (reject).
|
|
8
|
+
*
|
|
9
|
+
* Derived directly from the spec's `ComponentTypeSchema` (the single source of
|
|
10
|
+
* truth) rather than hand-maintained, so a new enum member in the spec can
|
|
11
|
+
* never silently drift out of solid's known-types set again. This is what
|
|
12
|
+
* restored `composite`: it is in the spec enum but had been dropped from the
|
|
13
|
+
* former hand-written list, contradicting the pass-through docstrings below.
|
|
14
|
+
*/
|
|
15
|
+
var KNOWN_COMPONENT_TYPES = new Set(ComponentTypeSchema.options);
|
|
16
|
+
/**
|
|
17
|
+
* Spec-driven validation dispatch table (B.1 — v5.5.0, expanded in v5.6.0).
|
|
18
|
+
*
|
|
19
|
+
* For each ComponentType where we delegate shape validation to a Zod schema
|
|
20
|
+
* from `@seed-ship/mcp-ui-spec`, this table maps:
|
|
21
|
+
* - the schema to safeParse against
|
|
22
|
+
* - the legacy error code to emit when shape parsing fails (preserves the
|
|
23
|
+
* pre-v5.5.0 `errors[].code` API contract — see MCP-UI-AUDIT-2026-04-26.md
|
|
24
|
+
* §I.3.a + §J.1)
|
|
25
|
+
*
|
|
26
|
+
* **v5.6.0** : `map` and `form` joined the dispatch after spec@5.0.2 relaxed
|
|
27
|
+
* their schemas (LatLngPoint union for map.center, regex relax for
|
|
28
|
+
* field.name) per deposium audit §L answers. As of v6.x this table
|
|
29
|
+
* spec-validates 15 of the 21 component types; the remainder use imperative
|
|
30
|
+
* validators (`chart`/`table`) or are pass-through (`grid`/`footer`/`composite`/`modal`).
|
|
31
|
+
*
|
|
32
|
+
* Types deliberately omitted (kept on the imperative path):
|
|
33
|
+
* - `chart`, `table` — have rich imperative validators with their own
|
|
34
|
+
* codes (MISSING_DATA, DATA_LENGTH_MISMATCH, RESOURCE_LIMIT_EXCEEDED, …)
|
|
35
|
+
* - `modal` — all params are optional; nothing to enforce.
|
|
36
|
+
* - `grid`, `footer`, `composite` — pass-through, validated elsewhere.
|
|
37
|
+
*/
|
|
38
|
+
var SPEC_VALIDATORS = {
|
|
39
|
+
metric: {
|
|
40
|
+
schema: MetricComponentParamsSchema,
|
|
41
|
+
legacyCode: "INVALID_METRIC"
|
|
42
|
+
},
|
|
43
|
+
text: {
|
|
44
|
+
schema: TextComponentParamsSchema,
|
|
45
|
+
legacyCode: "INVALID_TEXT"
|
|
46
|
+
},
|
|
47
|
+
iframe: {
|
|
48
|
+
schema: IframeComponentParamsSchema,
|
|
49
|
+
legacyCode: "INVALID_IFRAME"
|
|
50
|
+
},
|
|
51
|
+
image: {
|
|
52
|
+
schema: ImageComponentParamsSchema,
|
|
53
|
+
legacyCode: "INVALID_IMAGE"
|
|
54
|
+
},
|
|
55
|
+
link: {
|
|
56
|
+
schema: LinkComponentParamsSchema,
|
|
57
|
+
legacyCode: "INVALID_LINK"
|
|
58
|
+
},
|
|
59
|
+
action: {
|
|
60
|
+
schema: ActionParamsSchema,
|
|
61
|
+
legacyCode: "INVALID_ACTION"
|
|
62
|
+
},
|
|
63
|
+
video: {
|
|
64
|
+
schema: VideoComponentParamsSchema,
|
|
65
|
+
legacyCode: "INVALID_VIDEO"
|
|
66
|
+
},
|
|
67
|
+
carousel: {
|
|
68
|
+
schema: CarouselComponentParamsSchema,
|
|
69
|
+
legacyCode: "EMPTY_CAROUSEL"
|
|
70
|
+
},
|
|
71
|
+
"image-gallery": {
|
|
72
|
+
schema: ImageGalleryParamsSchema,
|
|
73
|
+
legacyCode: "EMPTY_GALLERY"
|
|
74
|
+
},
|
|
75
|
+
"action-group": {
|
|
76
|
+
schema: ActionGroupParamsSchema,
|
|
77
|
+
legacyCode: "EMPTY_ACTION_GROUP"
|
|
78
|
+
},
|
|
79
|
+
code: {
|
|
80
|
+
schema: CodeComponentParamsSchema,
|
|
81
|
+
legacyCode: "INVALID_CODE"
|
|
82
|
+
},
|
|
83
|
+
artifact: {
|
|
84
|
+
schema: ArtifactComponentParamsSchema,
|
|
85
|
+
legacyCode: "INVALID_ARTIFACT"
|
|
86
|
+
},
|
|
87
|
+
form: {
|
|
88
|
+
schema: FormComponentParamsSchema,
|
|
89
|
+
legacyCode: "EMPTY_FORM"
|
|
90
|
+
},
|
|
91
|
+
map: {
|
|
92
|
+
schema: MapComponentParamsSchema,
|
|
93
|
+
legacyCode: "INVALID_MAP"
|
|
94
|
+
},
|
|
95
|
+
graph: {
|
|
96
|
+
schema: GraphComponentParamsSchema,
|
|
97
|
+
legacyCode: "INVALID_GRAPH"
|
|
98
|
+
}
|
|
27
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Map a Zod issue list to the legacy `ValidationError[]` shape.
|
|
102
|
+
*
|
|
103
|
+
* Preserves the pre-v5.5.0 contract: `path` always begins with `params`,
|
|
104
|
+
* `code` is the per-type legacy code (so consumers that filtered by
|
|
105
|
+
* `errors[].code === 'EMPTY_CAROUSEL'` keep working), `message` is Zod's
|
|
106
|
+
* native human-readable message.
|
|
107
|
+
*/
|
|
28
108
|
function mapZodIssuesToErrors(issues, legacyCode) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
109
|
+
return issues.map((issue) => ({
|
|
110
|
+
path: issue.path.length > 0 ? `params.${issue.path.join(".")}` : "params",
|
|
111
|
+
message: issue.message,
|
|
112
|
+
code: legacyCode
|
|
113
|
+
}));
|
|
34
114
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// headroom for that while still rejecting runaway payloads ; genuinely
|
|
44
|
-
// large datasets belong in vector tiles (PMTiles), not inline GeoJSON.
|
|
45
|
-
// The guard itself (`validatePayloadSize`) is unchanged — only the
|
|
46
|
-
// default ceiling moved.
|
|
47
|
-
maxPayloadSize: 512 * 1024,
|
|
48
|
-
// 512KB
|
|
49
|
-
renderTimeout: 5e3
|
|
50
|
-
// 5 seconds
|
|
115
|
+
/**
|
|
116
|
+
* Default resource limits (configurable via env)
|
|
117
|
+
*/
|
|
118
|
+
var DEFAULT_RESOURCE_LIMITS = {
|
|
119
|
+
maxDataPoints: 1e3,
|
|
120
|
+
maxTableRows: 100,
|
|
121
|
+
maxPayloadSize: 524288,
|
|
122
|
+
renderTimeout: 5e3
|
|
51
123
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"www.clinicaltrials.gov",
|
|
145
|
-
"linear.app",
|
|
146
|
-
"www.linear.app",
|
|
147
|
-
// Payment platforms (v2.2.12)
|
|
148
|
-
"polar.sh",
|
|
149
|
-
"www.polar.sh",
|
|
150
|
-
"checkout.stripe.com",
|
|
151
|
-
"js.stripe.com",
|
|
152
|
-
"billing.stripe.com",
|
|
153
|
-
"buy.stripe.com",
|
|
154
|
-
"connect.stripe.com",
|
|
155
|
-
"invoice.stripe.com"
|
|
124
|
+
/**
|
|
125
|
+
* Default allowed iframe domains (whitelist)
|
|
126
|
+
* Must match CSP frame-src directive
|
|
127
|
+
* Updated Sprint 7: Added code, design, docs, and map providers
|
|
128
|
+
*
|
|
129
|
+
* This list is exported for transparency and can be extended via ValidationOptions
|
|
130
|
+
*/
|
|
131
|
+
var DEFAULT_IFRAME_DOMAINS = [
|
|
132
|
+
"quickchart.io",
|
|
133
|
+
"www.quickchart.io",
|
|
134
|
+
"deposium.com",
|
|
135
|
+
"deposium.vip",
|
|
136
|
+
"deposium.ai",
|
|
137
|
+
"localhost",
|
|
138
|
+
"youtube.com",
|
|
139
|
+
"www.youtube.com",
|
|
140
|
+
"youtube-nocookie.com",
|
|
141
|
+
"www.youtube-nocookie.com",
|
|
142
|
+
"youtu.be",
|
|
143
|
+
"vimeo.com",
|
|
144
|
+
"player.vimeo.com",
|
|
145
|
+
"codepen.io",
|
|
146
|
+
"codesandbox.io",
|
|
147
|
+
"stackblitz.com",
|
|
148
|
+
"jsfiddle.net",
|
|
149
|
+
"figma.com",
|
|
150
|
+
"www.figma.com",
|
|
151
|
+
"miro.com",
|
|
152
|
+
"docs.google.com",
|
|
153
|
+
"drive.google.com",
|
|
154
|
+
"sheets.google.com",
|
|
155
|
+
"slides.google.com",
|
|
156
|
+
"maps.google.com",
|
|
157
|
+
"www.google.com",
|
|
158
|
+
"datastudio.google.com",
|
|
159
|
+
"lookerstudio.google.com",
|
|
160
|
+
"airtable.com",
|
|
161
|
+
"notion.so",
|
|
162
|
+
"www.notion.so",
|
|
163
|
+
"openstreetmap.org",
|
|
164
|
+
"www.openstreetmap.org",
|
|
165
|
+
"public.tableau.com",
|
|
166
|
+
"app.powerbi.com",
|
|
167
|
+
"observablehq.com",
|
|
168
|
+
"mermaid.live",
|
|
169
|
+
"excalidraw.com",
|
|
170
|
+
"lucidchart.com",
|
|
171
|
+
"lucid.app",
|
|
172
|
+
"loom.com",
|
|
173
|
+
"www.loom.com",
|
|
174
|
+
"cloudflarestream.com",
|
|
175
|
+
"streamable.com",
|
|
176
|
+
"github.com",
|
|
177
|
+
"gist.github.com",
|
|
178
|
+
"gitlab.com",
|
|
179
|
+
"replit.com",
|
|
180
|
+
"glitch.com",
|
|
181
|
+
"calendly.com",
|
|
182
|
+
"typeform.com",
|
|
183
|
+
"cal.com",
|
|
184
|
+
"canva.com",
|
|
185
|
+
"vercel.app",
|
|
186
|
+
"netlify.app",
|
|
187
|
+
"amazon.com",
|
|
188
|
+
"amazon.fr",
|
|
189
|
+
"amazon.de",
|
|
190
|
+
"amazon.co.uk",
|
|
191
|
+
"amazon.es",
|
|
192
|
+
"amazon.it",
|
|
193
|
+
"amazon.ca",
|
|
194
|
+
"amazon.co.jp",
|
|
195
|
+
"images-amazon.com",
|
|
196
|
+
"media-amazon.com",
|
|
197
|
+
"ws-na.amazon-adsystem.com",
|
|
198
|
+
"gamma.app",
|
|
199
|
+
"www.gamma.app",
|
|
200
|
+
"app.hubspot.com",
|
|
201
|
+
"share.hubspot.com",
|
|
202
|
+
"www.data.gouv.fr",
|
|
203
|
+
"data.gouv.fr",
|
|
204
|
+
"clinicaltrials.gov",
|
|
205
|
+
"www.clinicaltrials.gov",
|
|
206
|
+
"linear.app",
|
|
207
|
+
"www.linear.app",
|
|
208
|
+
"polar.sh",
|
|
209
|
+
"www.polar.sh",
|
|
210
|
+
"checkout.stripe.com",
|
|
211
|
+
"js.stripe.com",
|
|
212
|
+
"billing.stripe.com",
|
|
213
|
+
"buy.stripe.com",
|
|
214
|
+
"connect.stripe.com",
|
|
215
|
+
"invoice.stripe.com"
|
|
156
216
|
];
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Trusted iframe domains that require allow-same-origin to function.
|
|
219
|
+
* These domains need access to their own cookies/storage for auth.
|
|
220
|
+
* All other whitelisted domains get a restrictive sandbox without allow-same-origin.
|
|
221
|
+
*/
|
|
222
|
+
var TRUSTED_IFRAME_DOMAINS = [
|
|
223
|
+
"deposium.com",
|
|
224
|
+
"deposium.vip",
|
|
225
|
+
"deposium.ai",
|
|
226
|
+
"localhost",
|
|
227
|
+
"docs.google.com",
|
|
228
|
+
"drive.google.com",
|
|
229
|
+
"sheets.google.com",
|
|
230
|
+
"slides.google.com",
|
|
231
|
+
"maps.google.com",
|
|
232
|
+
"datastudio.google.com",
|
|
233
|
+
"lookerstudio.google.com",
|
|
234
|
+
"notion.so",
|
|
235
|
+
"www.notion.so",
|
|
236
|
+
"airtable.com",
|
|
237
|
+
"figma.com",
|
|
238
|
+
"www.figma.com",
|
|
239
|
+
"miro.com",
|
|
240
|
+
"polar.sh",
|
|
241
|
+
"www.polar.sh",
|
|
242
|
+
"checkout.stripe.com",
|
|
243
|
+
"js.stripe.com",
|
|
244
|
+
"billing.stripe.com",
|
|
245
|
+
"buy.stripe.com",
|
|
246
|
+
"connect.stripe.com",
|
|
247
|
+
"invoice.stripe.com",
|
|
248
|
+
"app.hubspot.com",
|
|
249
|
+
"share.hubspot.com",
|
|
250
|
+
"app.powerbi.com",
|
|
251
|
+
"linear.app",
|
|
252
|
+
"www.linear.app",
|
|
253
|
+
"calendly.com",
|
|
254
|
+
"typeform.com",
|
|
255
|
+
"cal.com",
|
|
256
|
+
"canva.com"
|
|
197
257
|
];
|
|
258
|
+
/**
|
|
259
|
+
* Validate grid position bounds (1-12 columns)
|
|
260
|
+
*/
|
|
198
261
|
function validateGridPosition(position) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
code: "INVALID_GRID_ROW_START"
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
if (position.rowSpan !== void 0 && position.rowSpan < 1) {
|
|
241
|
-
errors.push({
|
|
242
|
-
path: "position.rowSpan",
|
|
243
|
-
message: "Row span must be >= 1",
|
|
244
|
-
code: "INVALID_GRID_ROW_SPAN"
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
return {
|
|
248
|
-
valid: errors.length === 0,
|
|
249
|
-
errors: errors.length > 0 ? errors : void 0
|
|
250
|
-
};
|
|
262
|
+
const errors = [];
|
|
263
|
+
if (!position) return {
|
|
264
|
+
valid: false,
|
|
265
|
+
errors: [{
|
|
266
|
+
path: "position",
|
|
267
|
+
message: "Position is required",
|
|
268
|
+
code: "MISSING_POSITION"
|
|
269
|
+
}]
|
|
270
|
+
};
|
|
271
|
+
if (position.colStart < 1 || position.colStart > 12) errors.push({
|
|
272
|
+
path: "position.colStart",
|
|
273
|
+
message: "Column start must be between 1 and 12",
|
|
274
|
+
code: "INVALID_GRID_COL_START"
|
|
275
|
+
});
|
|
276
|
+
if (position.colSpan < 1 || position.colSpan > 12) errors.push({
|
|
277
|
+
path: "position.colSpan",
|
|
278
|
+
message: "Column span must be between 1 and 12",
|
|
279
|
+
code: "INVALID_GRID_COL_SPAN"
|
|
280
|
+
});
|
|
281
|
+
if (position.colStart + position.colSpan - 1 > 12) errors.push({
|
|
282
|
+
path: "position",
|
|
283
|
+
message: "Column start + span exceeds grid width (12)",
|
|
284
|
+
code: "GRID_OVERFLOW"
|
|
285
|
+
});
|
|
286
|
+
if (position.rowStart !== void 0 && position.rowStart < 1) errors.push({
|
|
287
|
+
path: "position.rowStart",
|
|
288
|
+
message: "Row start must be >= 1",
|
|
289
|
+
code: "INVALID_GRID_ROW_START"
|
|
290
|
+
});
|
|
291
|
+
if (position.rowSpan !== void 0 && position.rowSpan < 1) errors.push({
|
|
292
|
+
path: "position.rowSpan",
|
|
293
|
+
message: "Row span must be >= 1",
|
|
294
|
+
code: "INVALID_GRID_ROW_SPAN"
|
|
295
|
+
});
|
|
296
|
+
return {
|
|
297
|
+
valid: errors.length === 0,
|
|
298
|
+
errors: errors.length > 0 ? errors : void 0
|
|
299
|
+
};
|
|
251
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Validate chart component against resource limits
|
|
303
|
+
*/
|
|
252
304
|
function validateChartComponent(params, limits = DEFAULT_RESOURCE_LIMITS) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
} else if (value === null) {
|
|
339
|
-
if (missingUnsupported) {
|
|
340
|
-
errors.push({
|
|
341
|
-
path,
|
|
342
|
-
message: `Missing value (null) is not supported by '${chartType}' charts, which would draw it as a zero share — use a bar or line chart, or a table`,
|
|
343
|
-
code: "MISSING_VALUE_UNSUPPORTED"
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
} else if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
347
|
-
errors.push({
|
|
348
|
-
path,
|
|
349
|
-
message: `Invalid data value: ${value} (must be a finite number, or null for a missing value)`,
|
|
350
|
-
code: "INVALID_DATA_TYPE"
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
const unit = params.unit;
|
|
356
|
-
if (unit !== void 0 && (typeof unit !== "string" || unit.length > 32)) {
|
|
357
|
-
errors.push({
|
|
358
|
-
path: "params.unit",
|
|
359
|
-
message: "Invalid unit: expected a string of at most 32 characters",
|
|
360
|
-
code: "INVALID_UNIT"
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
return {
|
|
364
|
-
valid: errors.length === 0,
|
|
365
|
-
errors: errors.length > 0 ? errors : void 0
|
|
366
|
-
};
|
|
305
|
+
const errors = [];
|
|
306
|
+
if (!params?.data) return {
|
|
307
|
+
valid: false,
|
|
308
|
+
errors: [{
|
|
309
|
+
path: "params.data",
|
|
310
|
+
message: "Missing chart data object",
|
|
311
|
+
code: "MISSING_DATA"
|
|
312
|
+
}]
|
|
313
|
+
};
|
|
314
|
+
if (!Array.isArray(params.data.datasets)) return {
|
|
315
|
+
valid: false,
|
|
316
|
+
errors: [{
|
|
317
|
+
path: "params.data.datasets",
|
|
318
|
+
message: "Missing or invalid datasets array",
|
|
319
|
+
code: "MISSING_DATASETS"
|
|
320
|
+
}]
|
|
321
|
+
};
|
|
322
|
+
const chartType = params.type || "bar";
|
|
323
|
+
const usesPoints = (data) => data.some((value) => typeof value === "object" && value !== null && "x" in value);
|
|
324
|
+
const hasObjectData = params.data.datasets.some((dataset) => Array.isArray(dataset.data) && usesPoints(dataset.data));
|
|
325
|
+
if (!(chartType === "scatter" || chartType === "bubble" || hasObjectData)) {
|
|
326
|
+
if (!Array.isArray(params.data.labels)) return {
|
|
327
|
+
valid: false,
|
|
328
|
+
errors: [{
|
|
329
|
+
path: "params.data.labels",
|
|
330
|
+
message: "Missing or invalid labels array",
|
|
331
|
+
code: "MISSING_LABELS"
|
|
332
|
+
}]
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
const totalDataPoints = params.data.datasets.reduce((sum, dataset) => sum + (Array.isArray(dataset.data) ? dataset.data.length : 0), 0);
|
|
336
|
+
if (totalDataPoints > limits.maxDataPoints) errors.push({
|
|
337
|
+
path: "params.data",
|
|
338
|
+
message: `Chart exceeds max data points: ${totalDataPoints} > ${limits.maxDataPoints}`,
|
|
339
|
+
code: "RESOURCE_LIMIT_EXCEEDED"
|
|
340
|
+
});
|
|
341
|
+
if (chartType !== "scatter" && chartType !== "bubble" && Array.isArray(params.data.labels)) {
|
|
342
|
+
const expectedLength = params.data.labels.length;
|
|
343
|
+
for (const [index, dataset] of params.data.datasets.entries()) if (Array.isArray(dataset.data) && !usesPoints(dataset.data) && dataset.data.length > 0 && dataset.data.length !== expectedLength) errors.push({
|
|
344
|
+
path: `params.data.datasets[${index}]`,
|
|
345
|
+
message: `Dataset length mismatch: expected ${expectedLength}, got ${dataset.data.length}`,
|
|
346
|
+
code: "DATA_LENGTH_MISMATCH"
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
const missingUnsupported = PART_TO_WHOLE_CHART_TYPES.has(chartType);
|
|
350
|
+
for (const [index, dataset] of params.data.datasets.entries()) {
|
|
351
|
+
if (!Array.isArray(dataset.data)) continue;
|
|
352
|
+
const datasetIsPointChart = chartType === "scatter" || chartType === "bubble" || usesPoints(dataset.data);
|
|
353
|
+
for (const [dataIndex, value] of dataset.data.entries()) {
|
|
354
|
+
const path = `params.data.datasets[${index}].data[${dataIndex}]`;
|
|
355
|
+
if (datasetIsPointChart) {
|
|
356
|
+
const vObj = value;
|
|
357
|
+
if (typeof value !== "object" || value === null || vObj.x == null || vObj.y !== null && typeof vObj.y !== "number" || vObj.r !== void 0 && (typeof vObj.r !== "number" || !Number.isFinite(vObj.r) || vObj.r < 0)) errors.push({
|
|
358
|
+
path,
|
|
359
|
+
message: `Invalid point data: expected {x, y} object (y may be null for a missing value)`,
|
|
360
|
+
code: "INVALID_POINT_DATA"
|
|
361
|
+
});
|
|
362
|
+
else if (missingUnsupported && vObj.y === null) errors.push({
|
|
363
|
+
path,
|
|
364
|
+
message: `Missing value (null) is not supported by '${chartType}' charts, which would draw it as a zero share — use a bar or line chart, or a table`,
|
|
365
|
+
code: "MISSING_VALUE_UNSUPPORTED"
|
|
366
|
+
});
|
|
367
|
+
} else if (value === null) {
|
|
368
|
+
if (missingUnsupported) errors.push({
|
|
369
|
+
path,
|
|
370
|
+
message: `Missing value (null) is not supported by '${chartType}' charts, which would draw it as a zero share — use a bar or line chart, or a table`,
|
|
371
|
+
code: "MISSING_VALUE_UNSUPPORTED"
|
|
372
|
+
});
|
|
373
|
+
} else if (typeof value !== "number" || !Number.isFinite(value)) errors.push({
|
|
374
|
+
path,
|
|
375
|
+
message: `Invalid data value: ${value} (must be a finite number, or null for a missing value)`,
|
|
376
|
+
code: "INVALID_DATA_TYPE"
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const unit = params.unit;
|
|
381
|
+
if (unit !== void 0 && (typeof unit !== "string" || unit.length > 32)) errors.push({
|
|
382
|
+
path: "params.unit",
|
|
383
|
+
message: "Invalid unit: expected a string of at most 32 characters",
|
|
384
|
+
code: "INVALID_UNIT"
|
|
385
|
+
});
|
|
386
|
+
return {
|
|
387
|
+
valid: errors.length === 0,
|
|
388
|
+
errors: errors.length > 0 ? errors : void 0
|
|
389
|
+
};
|
|
367
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Validate table component against resource limits
|
|
393
|
+
*/
|
|
368
394
|
function validateTableComponent(params, limits = DEFAULT_RESOURCE_LIMITS) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
message: `Missing column key: ${column.key}`,
|
|
411
|
-
code: "MISSING_COLUMN_DATA"
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return {
|
|
417
|
-
valid: errors.length === 0,
|
|
418
|
-
errors: errors.length > 0 ? errors : void 0
|
|
419
|
-
};
|
|
395
|
+
const errors = [];
|
|
396
|
+
for (const key of [
|
|
397
|
+
"pageSize",
|
|
398
|
+
"chatPageSize",
|
|
399
|
+
"initialPage"
|
|
400
|
+
]) {
|
|
401
|
+
const value = params[key];
|
|
402
|
+
if (value !== void 0 && (typeof value !== "number" || !Number.isInteger(value) || value < 0)) errors.push({
|
|
403
|
+
path: `params.${key}`,
|
|
404
|
+
message: `${key} must be a nonnegative integer`,
|
|
405
|
+
code: "INVALID_PAGINATION"
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
if (params.rows.length > limits.maxTableRows) errors.push({
|
|
409
|
+
path: "params.rows",
|
|
410
|
+
message: `Table exceeds max rows: ${params.rows.length} > ${limits.maxTableRows}`,
|
|
411
|
+
code: "RESOURCE_LIMIT_EXCEEDED"
|
|
412
|
+
});
|
|
413
|
+
if (params.columns.length === 0) errors.push({
|
|
414
|
+
path: "params.columns",
|
|
415
|
+
message: "Table must have at least one column",
|
|
416
|
+
code: "EMPTY_COLUMNS"
|
|
417
|
+
});
|
|
418
|
+
const columnKeys = /* @__PURE__ */ new Set();
|
|
419
|
+
for (const [index, column] of params.columns.entries()) {
|
|
420
|
+
if (columnKeys.has(column.key)) errors.push({
|
|
421
|
+
path: `params.columns[${index}]`,
|
|
422
|
+
message: `Duplicate column key: ${column.key}`,
|
|
423
|
+
code: "DUPLICATE_COLUMN_KEY"
|
|
424
|
+
});
|
|
425
|
+
columnKeys.add(column.key);
|
|
426
|
+
}
|
|
427
|
+
for (const [rowIndex, row] of params.rows.entries()) for (const column of params.columns) if (!(column.key in row)) errors.push({
|
|
428
|
+
path: `params.rows[${rowIndex}]`,
|
|
429
|
+
message: `Missing column key: ${column.key}`,
|
|
430
|
+
code: "MISSING_COLUMN_DATA"
|
|
431
|
+
});
|
|
432
|
+
return {
|
|
433
|
+
valid: errors.length === 0,
|
|
434
|
+
errors: errors.length > 0 ? errors : void 0
|
|
435
|
+
};
|
|
420
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Validate payload size
|
|
439
|
+
*/
|
|
421
440
|
function validatePayloadSize(component, limits = DEFAULT_RESOURCE_LIMITS) {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
]
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
return { valid: true };
|
|
441
|
+
const payloadSize = JSON.stringify(component).length;
|
|
442
|
+
if (payloadSize > limits.maxPayloadSize) return {
|
|
443
|
+
valid: false,
|
|
444
|
+
errors: [{
|
|
445
|
+
path: "component",
|
|
446
|
+
message: `Payload size exceeds limit: ${payloadSize} > ${limits.maxPayloadSize} bytes`,
|
|
447
|
+
code: "PAYLOAD_TOO_LARGE"
|
|
448
|
+
}]
|
|
449
|
+
};
|
|
450
|
+
return { valid: true };
|
|
436
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Sanitize string to prevent XSS
|
|
454
|
+
* Basic implementation - DOMPurify used at render time
|
|
455
|
+
*/
|
|
437
456
|
function sanitizeString(input) {
|
|
438
|
-
|
|
457
|
+
return input.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/on\w+="[^"]*"/gi, "").replace(/javascript:/gi, "");
|
|
439
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* Validate iframe domain against whitelist
|
|
461
|
+
*
|
|
462
|
+
* @param url - The URL to validate
|
|
463
|
+
* @param options - Optional validation options
|
|
464
|
+
* @param options.policy - 'strict' (default), 'extend', or 'allow-all'
|
|
465
|
+
* @param options.customDomains - Additional domains when policy is 'extend'
|
|
466
|
+
*/
|
|
440
467
|
function validateIframeDomain(url, options) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
return { valid: true };
|
|
468
|
-
} catch (error) {
|
|
469
|
-
return {
|
|
470
|
-
valid: false,
|
|
471
|
-
errors: [
|
|
472
|
-
{
|
|
473
|
-
path: "url",
|
|
474
|
-
message: "Invalid URL format",
|
|
475
|
-
code: "INVALID_URL"
|
|
476
|
-
}
|
|
477
|
-
]
|
|
478
|
-
};
|
|
479
|
-
}
|
|
468
|
+
if (options?.policy === "allow-all") return { valid: true };
|
|
469
|
+
try {
|
|
470
|
+
const domain = new URL(url).hostname;
|
|
471
|
+
let effectiveWhitelist = DEFAULT_IFRAME_DOMAINS;
|
|
472
|
+
if (options?.policy === "extend" && options.customDomains) effectiveWhitelist = [...DEFAULT_IFRAME_DOMAINS, ...options.customDomains];
|
|
473
|
+
if (!(domain === "localhost" || /^127(\.\d{1,3}){3}$/.test(domain) || effectiveWhitelist.some((allowed) => allowed !== "localhost" && (domain === allowed || domain.endsWith(`.${allowed}`))))) return {
|
|
474
|
+
valid: false,
|
|
475
|
+
errors: [{
|
|
476
|
+
path: "url",
|
|
477
|
+
message: `Domain not whitelisted: ${domain}`,
|
|
478
|
+
code: "DOMAIN_NOT_WHITELISTED"
|
|
479
|
+
}]
|
|
480
|
+
};
|
|
481
|
+
return { valid: true };
|
|
482
|
+
} catch (error) {
|
|
483
|
+
return {
|
|
484
|
+
valid: false,
|
|
485
|
+
errors: [{
|
|
486
|
+
path: "url",
|
|
487
|
+
message: "Invalid URL format",
|
|
488
|
+
code: "INVALID_URL"
|
|
489
|
+
}]
|
|
490
|
+
};
|
|
491
|
+
}
|
|
480
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* Is this URL's host a trusted iframe host?
|
|
495
|
+
*
|
|
496
|
+
* A host matches when it equals an entry of `TRUSTED_IFRAME_DOMAINS` (plus
|
|
497
|
+
* `options.customTrustedDomains`) or is a subdomain of one. Trusted hosts
|
|
498
|
+
* need their own cookies/storage to authenticate, which is why they receive
|
|
499
|
+
* `allow-same-origin` in `getIframeSandbox` and deliberately do NOT receive
|
|
500
|
+
* the `credentialless` iframe attribute (an authenticated embed loaded
|
|
501
|
+
* without its cookies only shows a login screen).
|
|
502
|
+
*
|
|
503
|
+
* An unparsable URL is never trusted.
|
|
504
|
+
*
|
|
505
|
+
* @param url - The iframe URL
|
|
506
|
+
* @param options - Optional custom trusted domains, merged over the defaults
|
|
507
|
+
* @returns `true` when the URL's host is trusted
|
|
508
|
+
* @since v6.21.0 — extracted from `getIframeSandbox`, identical matching.
|
|
509
|
+
*/
|
|
481
510
|
function isTrustedIframeDomain(url, options) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
} catch {
|
|
489
|
-
return false;
|
|
490
|
-
}
|
|
511
|
+
try {
|
|
512
|
+
const domain = new URL(url).hostname;
|
|
513
|
+
return (options?.customTrustedDomains ? [...TRUSTED_IFRAME_DOMAINS, ...options.customTrustedDomains] : TRUSTED_IFRAME_DOMAINS).some((trusted) => domain === trusted || domain.endsWith(`.${trusted}`));
|
|
514
|
+
} catch {
|
|
515
|
+
return false;
|
|
516
|
+
}
|
|
491
517
|
}
|
|
518
|
+
/**
|
|
519
|
+
* Get the appropriate sandbox attribute for an iframe URL.
|
|
520
|
+
*
|
|
521
|
+
* Trusted domains (Google, Deposium, payment, auth-requiring services) get
|
|
522
|
+
* `allow-same-origin` so they can access their own cookies/storage.
|
|
523
|
+
* All other whitelisted domains get a restrictive sandbox without it,
|
|
524
|
+
* preventing access to the parent page's localStorage/cookies.
|
|
525
|
+
*
|
|
526
|
+
* @param url - The iframe URL
|
|
527
|
+
* @param options - Optional custom trusted domains
|
|
528
|
+
* @returns sandbox attribute string
|
|
529
|
+
*/
|
|
492
530
|
function getIframeSandbox(url, options) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
return baseSandbox;
|
|
531
|
+
const baseSandbox = "allow-scripts allow-popups";
|
|
532
|
+
if (isTrustedIframeDomain(url, options)) return `${baseSandbox} allow-same-origin allow-forms`;
|
|
533
|
+
return baseSandbox;
|
|
498
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* Validate entire component
|
|
537
|
+
*
|
|
538
|
+
* @param component - The component to validate
|
|
539
|
+
* @param options - Optional validation options (limits, iframePolicy, customIframeDomains)
|
|
540
|
+
*/
|
|
499
541
|
function validateComponent(component, options) {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
case "table": {
|
|
561
|
-
const tableResult = validateTableComponent(
|
|
562
|
-
component.params,
|
|
563
|
-
limits
|
|
564
|
-
);
|
|
565
|
-
if (!tableResult.valid) {
|
|
566
|
-
errors.push(...tableResult.errors || []);
|
|
567
|
-
}
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
case "modal":
|
|
571
|
-
break;
|
|
572
|
-
default:
|
|
573
|
-
if (!KNOWN_COMPONENT_TYPES.has(component.type)) {
|
|
574
|
-
errors.push({
|
|
575
|
-
path: "type",
|
|
576
|
-
message: `Unknown component type: ${component.type}`,
|
|
577
|
-
code: "UNKNOWN_COMPONENT_TYPE"
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
break;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return {
|
|
584
|
-
valid: errors.length === 0,
|
|
585
|
-
errors: errors.length > 0 ? errors : void 0
|
|
586
|
-
};
|
|
542
|
+
const limits = options?.limits ?? DEFAULT_RESOURCE_LIMITS;
|
|
543
|
+
const errors = [];
|
|
544
|
+
if (!component.params) return {
|
|
545
|
+
valid: false,
|
|
546
|
+
errors: [{
|
|
547
|
+
path: "params",
|
|
548
|
+
message: "Missing component params",
|
|
549
|
+
code: "MISSING_PARAMS"
|
|
550
|
+
}]
|
|
551
|
+
};
|
|
552
|
+
const gridResult = validateGridPosition(component.position);
|
|
553
|
+
if (!gridResult.valid) errors.push(...gridResult.errors || []);
|
|
554
|
+
const sizeResult = validatePayloadSize(component, limits);
|
|
555
|
+
if (!sizeResult.valid) errors.push(...sizeResult.errors || []);
|
|
556
|
+
const specValidator = SPEC_VALIDATORS[component.type];
|
|
557
|
+
if (specValidator) {
|
|
558
|
+
const result = specValidator.schema.safeParse(component.params);
|
|
559
|
+
if (!result.success) errors.push(...mapZodIssuesToErrors(result.error.issues, specValidator.legacyCode));
|
|
560
|
+
if (result.success) {
|
|
561
|
+
if (component.type === "iframe" || component.type === "video") {
|
|
562
|
+
const url = component.params?.url;
|
|
563
|
+
if (typeof url === "string") {
|
|
564
|
+
const domainResult = validateIframeDomain(url, {
|
|
565
|
+
policy: options?.iframePolicy,
|
|
566
|
+
customDomains: options?.customIframeDomains
|
|
567
|
+
});
|
|
568
|
+
if (!domainResult.valid) errors.push(...domainResult.errors || []);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if (component.type === "map") {
|
|
572
|
+
const mapParams = component.params;
|
|
573
|
+
if (!(mapParams.center != null || Array.isArray(mapParams.markers) && mapParams.markers.length > 0 || mapParams.geojson != null || Array.isArray(mapParams.layers) && mapParams.layers.length > 0 || mapParams.pmtiles != null)) errors.push({
|
|
574
|
+
path: "params",
|
|
575
|
+
message: "Map must have center, markers, geojson, layers, or pmtiles",
|
|
576
|
+
code: "INVALID_MAP"
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
} else switch (component.type) {
|
|
581
|
+
case "chart": {
|
|
582
|
+
const chartResult = validateChartComponent(component.params, limits);
|
|
583
|
+
if (!chartResult.valid) errors.push(...chartResult.errors || []);
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
case "table": {
|
|
587
|
+
const tableResult = validateTableComponent(component.params, limits);
|
|
588
|
+
if (!tableResult.valid) errors.push(...tableResult.errors || []);
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
case "modal": break;
|
|
592
|
+
default: if (!KNOWN_COMPONENT_TYPES.has(component.type)) errors.push({
|
|
593
|
+
path: "type",
|
|
594
|
+
message: `Unknown component type: ${component.type}`,
|
|
595
|
+
code: "UNKNOWN_COMPONENT_TYPE"
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
valid: errors.length === 0,
|
|
600
|
+
errors: errors.length > 0 ? errors : void 0
|
|
601
|
+
};
|
|
587
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* Validate entire layout
|
|
605
|
+
*
|
|
606
|
+
* @param layout - The layout to validate
|
|
607
|
+
* @param options - Optional validation options (limits, iframePolicy, customIframeDomains)
|
|
608
|
+
*/
|
|
588
609
|
function validateLayout(layout, options) {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
if (layout.grid.columns !== 12) {
|
|
617
|
-
errors.push({
|
|
618
|
-
path: "grid.columns",
|
|
619
|
-
message: "Grid must have 12 columns (Bootstrap-like)",
|
|
620
|
-
code: "INVALID_GRID_COLUMNS"
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
return {
|
|
624
|
-
valid: errors.length === 0,
|
|
625
|
-
errors: errors.length > 0 ? errors : void 0
|
|
626
|
-
};
|
|
610
|
+
const errors = [];
|
|
611
|
+
if (layout.components.length === 0) errors.push({
|
|
612
|
+
path: "components",
|
|
613
|
+
message: "Layout must have at least one component",
|
|
614
|
+
code: "EMPTY_LAYOUT"
|
|
615
|
+
});
|
|
616
|
+
if (layout.components.length > 12) errors.push({
|
|
617
|
+
path: "components",
|
|
618
|
+
message: `Layout exceeds max components: ${layout.components.length} > 12`,
|
|
619
|
+
code: "TOO_MANY_COMPONENTS"
|
|
620
|
+
});
|
|
621
|
+
for (const [index, component] of layout.components.entries()) {
|
|
622
|
+
const result = validateComponent(component, options);
|
|
623
|
+
if (!result.valid) errors.push(...result.errors?.map((error) => ({
|
|
624
|
+
...error,
|
|
625
|
+
path: `components[${index}].${error.path}`
|
|
626
|
+
})) || []);
|
|
627
|
+
}
|
|
628
|
+
if (layout.grid.columns !== 12) errors.push({
|
|
629
|
+
path: "grid.columns",
|
|
630
|
+
message: "Grid must have 12 columns (Bootstrap-like)",
|
|
631
|
+
code: "INVALID_GRID_COLUMNS"
|
|
632
|
+
});
|
|
633
|
+
return {
|
|
634
|
+
valid: errors.length === 0,
|
|
635
|
+
errors: errors.length > 0 ? errors : void 0
|
|
636
|
+
};
|
|
627
637
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
638
|
+
/** English defaults for {@link FormValidationMessages}. */
|
|
639
|
+
var DEFAULT_VALIDATION_MESSAGES = {
|
|
640
|
+
required: "{field} is required",
|
|
641
|
+
mustBeChecked: "{field} must be checked",
|
|
642
|
+
minLength: "Minimum {min} characters required",
|
|
643
|
+
maxLength: "Maximum {max} characters allowed",
|
|
644
|
+
invalidPattern: "Invalid format",
|
|
645
|
+
invalidEmail: "Invalid email address",
|
|
646
|
+
invalidNumber: "Must be a valid number",
|
|
647
|
+
minValue: "Minimum value is {min}",
|
|
648
|
+
maxValue: "Maximum value is {max}",
|
|
649
|
+
minDate: "Date must be after {min}",
|
|
650
|
+
maxDate: "Date must be before {max}",
|
|
651
|
+
invalidOption: "Please select a valid option",
|
|
652
|
+
invalidFormat: "Invalid format (expected: {format})"
|
|
642
653
|
};
|
|
654
|
+
/**
|
|
655
|
+
* Validate a single form field value against field rules
|
|
656
|
+
*/
|
|
643
657
|
function validateFieldValue(value, field, messages) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
658
|
+
const m = {
|
|
659
|
+
...DEFAULT_VALIDATION_MESSAGES,
|
|
660
|
+
...messages
|
|
661
|
+
};
|
|
662
|
+
const fieldName = field.label || field.name;
|
|
663
|
+
if (field.required) {
|
|
664
|
+
if (value === void 0 || value === null || value === "") return {
|
|
665
|
+
valid: false,
|
|
666
|
+
error: formatMCPUIString(m.required, { field: fieldName })
|
|
667
|
+
};
|
|
668
|
+
if (field.type === "checkbox" && value !== true) return {
|
|
669
|
+
valid: false,
|
|
670
|
+
error: formatMCPUIString(m.mustBeChecked, { field: fieldName })
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
if (value === void 0 || value === null || value === "") return { valid: true };
|
|
674
|
+
switch (field.type) {
|
|
675
|
+
case "text":
|
|
676
|
+
case "textarea":
|
|
677
|
+
case "password":
|
|
678
|
+
if (field.minLength && String(value).length < field.minLength) return {
|
|
679
|
+
valid: false,
|
|
680
|
+
error: formatMCPUIString(m.minLength, { min: field.minLength })
|
|
681
|
+
};
|
|
682
|
+
if (field.maxLength && String(value).length > field.maxLength) return {
|
|
683
|
+
valid: false,
|
|
684
|
+
error: formatMCPUIString(m.maxLength, { max: field.maxLength })
|
|
685
|
+
};
|
|
686
|
+
if (field.pattern && !new RegExp(field.pattern).test(String(value))) return {
|
|
687
|
+
valid: false,
|
|
688
|
+
error: m.invalidPattern
|
|
689
|
+
};
|
|
690
|
+
break;
|
|
691
|
+
case "email":
|
|
692
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(value))) return {
|
|
693
|
+
valid: false,
|
|
694
|
+
error: m.invalidEmail
|
|
695
|
+
};
|
|
696
|
+
break;
|
|
697
|
+
case "number": {
|
|
698
|
+
const numValue = Number(value);
|
|
699
|
+
if (isNaN(numValue)) return {
|
|
700
|
+
valid: false,
|
|
701
|
+
error: m.invalidNumber
|
|
702
|
+
};
|
|
703
|
+
if (field.min !== void 0 && numValue < field.min) return {
|
|
704
|
+
valid: false,
|
|
705
|
+
error: formatMCPUIString(m.minValue, { min: field.min })
|
|
706
|
+
};
|
|
707
|
+
if (field.max !== void 0 && numValue > field.max) return {
|
|
708
|
+
valid: false,
|
|
709
|
+
error: formatMCPUIString(m.maxValue, { max: field.max })
|
|
710
|
+
};
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
case "date":
|
|
714
|
+
if (field.minDate && value < field.minDate) return {
|
|
715
|
+
valid: false,
|
|
716
|
+
error: formatMCPUIString(m.minDate, { min: field.minDate })
|
|
717
|
+
};
|
|
718
|
+
if (field.maxDate && value > field.maxDate) return {
|
|
719
|
+
valid: false,
|
|
720
|
+
error: formatMCPUIString(m.maxDate, { max: field.maxDate })
|
|
721
|
+
};
|
|
722
|
+
break;
|
|
723
|
+
case "select":
|
|
724
|
+
case "radio": if (field.options && field.options.length > 0) {
|
|
725
|
+
if (!field.options.map((opt) => opt.value).includes(String(value))) return {
|
|
726
|
+
valid: false,
|
|
727
|
+
error: m.invalidOption
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
if (field.valueFormat && value !== void 0 && value !== null && value !== "") {
|
|
732
|
+
const vals = Array.isArray(value) ? value : [String(value)];
|
|
733
|
+
for (const v of vals) if (!new RegExp(field.valueFormat).test(v)) return {
|
|
734
|
+
valid: false,
|
|
735
|
+
error: field.valueFormatHint || formatMCPUIString(m.invalidFormat, { format: field.valueFormat })
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
return { valid: true };
|
|
725
739
|
}
|
|
740
|
+
/**
|
|
741
|
+
* Validate entire form data against field definitions
|
|
742
|
+
*/
|
|
726
743
|
function validateFormData(data, fields, messages) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
errors
|
|
737
|
-
};
|
|
744
|
+
const errors = {};
|
|
745
|
+
for (const field of fields) {
|
|
746
|
+
const result = validateFieldValue(data[field.name], field, messages);
|
|
747
|
+
if (!result.valid && result.error) errors[field.name] = result.error;
|
|
748
|
+
}
|
|
749
|
+
return {
|
|
750
|
+
valid: Object.keys(errors).length === 0,
|
|
751
|
+
errors
|
|
752
|
+
};
|
|
738
753
|
}
|
|
739
|
-
export {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
DEFAULT_VALIDATION_MESSAGES,
|
|
743
|
-
TRUSTED_IFRAME_DOMAINS,
|
|
744
|
-
getIframeSandbox,
|
|
745
|
-
isTrustedIframeDomain,
|
|
746
|
-
sanitizeString,
|
|
747
|
-
validateChartComponent,
|
|
748
|
-
validateComponent,
|
|
749
|
-
validateFieldValue,
|
|
750
|
-
validateFormData,
|
|
751
|
-
validateGridPosition,
|
|
752
|
-
validateIframeDomain,
|
|
753
|
-
validateLayout,
|
|
754
|
-
validatePayloadSize,
|
|
755
|
-
validateTableComponent
|
|
756
|
-
};
|
|
757
|
-
//# sourceMappingURL=validation.js.map
|
|
754
|
+
export { DEFAULT_IFRAME_DOMAINS, DEFAULT_RESOURCE_LIMITS, DEFAULT_VALIDATION_MESSAGES, TRUSTED_IFRAME_DOMAINS, getIframeSandbox, isTrustedIframeDomain, sanitizeString, validateChartComponent, validateComponent, validateFieldValue, validateFormData, validateGridPosition, validateIframeDomain, validateLayout, validatePayloadSize, validateTableComponent };
|
|
755
|
+
|
|
756
|
+
//# sourceMappingURL=validation.js.map
|