@seed-ship/mcp-ui-solid 6.24.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/README.md +61 -0
- package/dist/adapters/connector.cjs +3 -3
- package/dist/adapters/connector.cjs.map +1 -1
- package/dist/adapters/connector.d.cts +108 -0
- package/dist/adapters/connector.d.ts +1 -2
- package/dist/adapters/connector.js +3 -3
- package/dist/adapters/connector.js.map +1 -1
- package/dist/adapters/index.d.cts +21 -0
- package/dist/adapters/index.d.ts +6 -7
- package/dist/adapters/macro-run.d.cts +99 -0
- package/dist/adapters/macro-run.d.ts +1 -2
- package/dist/adapters/presentation.d.cts +1 -2
- package/dist/adapters/presentation.d.ts +1 -2
- package/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/components/ActionGroupRenderer.cjs +6 -6
- package/dist/components/ActionGroupRenderer.cjs.map +1 -1
- package/dist/components/ActionGroupRenderer.d.cts +38 -0
- package/dist/components/ActionGroupRenderer.d.ts +1 -2
- package/dist/components/ActionGroupRenderer.js +6 -6
- package/dist/components/ActionGroupRenderer.js.map +1 -1
- package/dist/components/ActionRenderer.d.cts +9 -0
- package/dist/components/ActionRenderer.d.ts +0 -1
- package/dist/components/AgentCard.d.cts +19 -0
- package/dist/components/AgentCard.d.ts +1 -2
- package/dist/components/AgentHandoff.d.cts +11 -0
- package/dist/components/AgentHandoff.d.ts +1 -2
- package/dist/components/ArtifactRenderer.d.cts +11 -0
- package/dist/components/ArtifactRenderer.d.ts +0 -1
- package/dist/components/AutocompleteDropdown.cjs +6 -6
- package/dist/components/AutocompleteDropdown.cjs.map +1 -1
- package/dist/components/AutocompleteDropdown.d.cts +70 -0
- package/dist/components/AutocompleteDropdown.d.ts +1 -2
- package/dist/components/AutocompleteDropdown.js +6 -6
- package/dist/components/AutocompleteDropdown.js.map +1 -1
- package/dist/components/AutocompleteFormField.cjs +6 -5
- package/dist/components/AutocompleteFormField.cjs.map +1 -1
- package/dist/components/AutocompleteFormField.d.cts +51 -0
- package/dist/components/AutocompleteFormField.d.ts +1 -2
- package/dist/components/AutocompleteFormField.d.ts.map +1 -1
- package/dist/components/AutocompleteFormField.js +6 -5
- package/dist/components/AutocompleteFormField.js.map +1 -1
- package/dist/components/BriefingDiff.d.cts +11 -0
- package/dist/components/BriefingDiff.d.ts +1 -2
- package/dist/components/CarouselRenderer.d.cts +12 -0
- package/dist/components/CarouselRenderer.d.ts +1 -2
- package/dist/components/ChartJSRenderer.cjs +216 -6
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.cts +62 -0
- package/dist/components/ChartJSRenderer.d.ts +1 -2
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +217 -7
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/ChatPrompt.cjs +5 -5
- package/dist/components/ChatPrompt.cjs.map +1 -1
- package/dist/components/ChatPrompt.d.cts +69 -0
- package/dist/components/ChatPrompt.d.ts +1 -2
- package/dist/components/ChatPrompt.js +5 -5
- package/dist/components/ChatPrompt.js.map +1 -1
- package/dist/components/CodeBlockRenderer.d.cts +23 -0
- package/dist/components/CodeBlockRenderer.d.ts +1 -2
- package/dist/components/ComponentToolbar.cjs +5 -5
- package/dist/components/ComponentToolbar.cjs.map +1 -1
- package/dist/components/ComponentToolbar.d.cts +46 -0
- package/dist/components/ComponentToolbar.d.ts +0 -1
- package/dist/components/ComponentToolbar.js +5 -5
- package/dist/components/ComponentToolbar.js.map +1 -1
- package/dist/components/DataPreviewSection.d.cts +11 -0
- package/dist/components/DataPreviewSection.d.ts +1 -2
- package/dist/components/DegradedFallback.cjs +1 -1
- package/dist/components/DegradedFallback.cjs.map +1 -1
- package/dist/components/DegradedFallback.d.cts +43 -0
- package/dist/components/DegradedFallback.d.ts +0 -1
- package/dist/components/DegradedFallback.js +1 -1
- package/dist/components/DegradedFallback.js.map +1 -1
- package/dist/components/DraggableGridItem.d.cts +94 -0
- package/dist/components/DraggableGridItem.d.ts +1 -2
- package/dist/components/EditableLayoutContext.d.cts +4 -0
- package/dist/components/EditableLayoutContext.d.ts +0 -1
- package/dist/components/EditableUIResourceRenderer.d.cts +42 -0
- package/dist/components/EditableUIResourceRenderer.d.ts +1 -2
- package/dist/components/ElicitationForm.d.cts +67 -0
- package/dist/components/ElicitationForm.d.ts +1 -2
- package/dist/components/ExpandableWrapper.cjs +10 -7
- package/dist/components/ExpandableWrapper.cjs.map +1 -1
- package/dist/components/ExpandableWrapper.d.cts +49 -0
- package/dist/components/ExpandableWrapper.d.ts +0 -1
- package/dist/components/ExpandableWrapper.d.ts.map +1 -1
- package/dist/components/ExpandableWrapper.js +10 -7
- package/dist/components/ExpandableWrapper.js.map +1 -1
- package/dist/components/FeedbackInline.d.cts +70 -0
- package/dist/components/FeedbackInline.d.ts +0 -1
- package/dist/components/FooterRenderer.d.cts +15 -0
- package/dist/components/FooterRenderer.d.ts +0 -1
- package/dist/components/FormFieldRenderer.cjs +13 -12
- package/dist/components/FormFieldRenderer.cjs.map +1 -1
- package/dist/components/FormFieldRenderer.d.cts +19 -0
- package/dist/components/FormFieldRenderer.d.ts +1 -2
- package/dist/components/FormFieldRenderer.d.ts.map +1 -1
- package/dist/components/FormFieldRenderer.js +13 -12
- package/dist/components/FormFieldRenderer.js.map +1 -1
- package/dist/components/FormRenderer.cjs +1 -1
- package/dist/components/FormRenderer.cjs.map +1 -1
- package/dist/components/FormRenderer.d.cts +14 -0
- package/dist/components/FormRenderer.d.ts +1 -2
- package/dist/components/FormRenderer.js +1 -1
- package/dist/components/FormRenderer.js.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs +1 -1
- package/dist/components/GenerativeUIErrorBoundary.cjs.map +1 -1
- package/dist/components/GenerativeUIErrorBoundary.d.cts +58 -0
- package/dist/components/GenerativeUIErrorBoundary.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.default.d.cts +1 -0
- package/dist/components/GenerativeUIErrorBoundary.default.d.ts +1 -2
- package/dist/components/GenerativeUIErrorBoundary.js +1 -1
- package/dist/components/GenerativeUIErrorBoundary.js.map +1 -1
- package/dist/components/GhostText.cjs +2 -2
- package/dist/components/GhostText.cjs.map +1 -1
- package/dist/components/GhostText.d.cts +112 -0
- package/dist/components/GhostText.d.ts +0 -1
- package/dist/components/GhostText.js +2 -2
- package/dist/components/GhostText.js.map +1 -1
- package/dist/components/GraphRenderer.cjs +100 -29
- package/dist/components/GraphRenderer.cjs.map +1 -1
- package/dist/components/GraphRenderer.d.cts +66 -0
- package/dist/components/GraphRenderer.d.ts +2 -3
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +100 -29
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/GridRenderer.d.cts +49 -0
- package/dist/components/GridRenderer.d.ts +1 -2
- package/dist/components/IframeFallbackLink.d.cts +22 -0
- package/dist/components/IframeFallbackLink.d.ts +0 -1
- package/dist/components/ImageGalleryRenderer.d.cts +22 -0
- package/dist/components/ImageGalleryRenderer.d.ts +1 -2
- package/dist/components/LightboxOverlay.d.cts +31 -0
- package/dist/components/LightboxOverlay.d.ts +1 -2
- package/dist/components/MapRenderer.d.cts +77 -0
- package/dist/components/MapRenderer.d.ts +1 -2
- package/dist/components/MissingValue.cjs +2 -2
- package/dist/components/MissingValue.cjs.map +1 -1
- package/dist/components/MissingValue.d.cts +26 -0
- package/dist/components/MissingValue.d.ts +0 -1
- package/dist/components/MissingValue.js +2 -2
- package/dist/components/MissingValue.js.map +1 -1
- package/dist/components/ModalRenderer.cjs +39 -31
- package/dist/components/ModalRenderer.cjs.map +1 -1
- package/dist/components/ModalRenderer.d.cts +66 -0
- package/dist/components/ModalRenderer.d.ts +1 -2
- package/dist/components/ModalRenderer.d.ts.map +1 -1
- package/dist/components/ModalRenderer.js +40 -32
- package/dist/components/ModalRenderer.js.map +1 -1
- package/dist/components/PortalDropdownMenu.cjs +6 -3
- package/dist/components/PortalDropdownMenu.cjs.map +1 -1
- package/dist/components/PortalDropdownMenu.d.cts +55 -0
- package/dist/components/PortalDropdownMenu.d.ts +0 -1
- package/dist/components/PortalDropdownMenu.d.ts.map +1 -1
- package/dist/components/PortalDropdownMenu.js +7 -4
- package/dist/components/PortalDropdownMenu.js.map +1 -1
- package/dist/components/PresentationFeedback.d.cts +112 -0
- package/dist/components/PresentationFeedback.d.ts +0 -1
- package/dist/components/RenderContext.d.cts +41 -0
- package/dist/components/RenderContext.d.ts +1 -2
- package/dist/components/ResizeHandle.d.cts +49 -0
- package/dist/components/ResizeHandle.d.ts +0 -1
- package/dist/components/SafeHtml.d.cts +45 -0
- package/dist/components/SafeHtml.d.ts +0 -1
- package/dist/components/ScratchpadPanel.cjs +38 -44
- package/dist/components/ScratchpadPanel.cjs.map +1 -1
- package/dist/components/ScratchpadPanel.d.cts +34 -0
- package/dist/components/ScratchpadPanel.d.ts +1 -2
- package/dist/components/ScratchpadPanel.d.ts.map +1 -1
- package/dist/components/ScratchpadPanel.js +38 -44
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/components/SplitStepper.d.cts +11 -0
- package/dist/components/SplitStepper.d.ts +1 -2
- package/dist/components/StreamingUIRenderer.d.cts +58 -0
- package/dist/components/StreamingUIRenderer.d.ts +3 -4
- package/dist/components/UIResourceRenderer.cjs +20 -20
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.cts +181 -0
- package/dist/components/UIResourceRenderer.d.ts +3 -4
- package/dist/components/UIResourceRenderer.default.d.cts +1 -0
- package/dist/components/UIResourceRenderer.default.d.ts +1 -2
- package/dist/components/UIResourceRenderer.js +20 -20
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/VerifiedText.d.cts +22 -0
- package/dist/components/VerifiedText.d.ts +1 -2
- package/dist/components/VideoRenderer.d.cts +41 -0
- package/dist/components/VideoRenderer.d.ts +1 -2
- package/dist/components/chart-data-table.d.cts +68 -0
- package/dist/components/chart-data-table.d.ts +0 -1
- package/dist/components/chart-missing-plugin.cjs +4 -4
- package/dist/components/chart-missing-plugin.cjs.map +1 -1
- package/dist/components/chart-missing-plugin.d.cts +128 -0
- package/dist/components/chart-missing-plugin.d.ts +4 -3
- package/dist/components/chart-missing-plugin.d.ts.map +1 -1
- package/dist/components/chart-missing-plugin.js +4 -4
- package/dist/components/chart-missing-plugin.js.map +1 -1
- package/dist/components/index.d.cts +62 -0
- package/dist/components/index.d.ts +57 -58
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/context/AutocompleteContext.d.cts +76 -0
- package/dist/context/AutocompleteContext.d.ts +1 -2
- package/dist/context/MCPActionContext.d.cts +169 -0
- package/dist/context/MCPActionContext.d.ts +0 -1
- package/dist/context/MCPUIConfigContext.d.cts +201 -0
- package/dist/context/MCPUIConfigContext.d.ts +1 -2
- package/dist/context/MCPUIMathContext.d.cts +17 -0
- package/dist/context/MCPUIMathContext.d.ts +0 -1
- package/dist/context/MCPUIStringsContext.d.cts +802 -0
- package/dist/context/MCPUIStringsContext.d.ts +1 -2
- package/dist/context/MCPUITelemetryContext.d.cts +35 -0
- package/dist/context/MCPUITelemetryContext.d.ts +1 -2
- package/dist/context/index.d.cts +7 -0
- package/dist/context/index.d.ts +2 -3
- package/dist/hooks/createResponsiveGrid.d.cts +5 -0
- package/dist/hooks/createResponsiveGrid.d.ts +0 -1
- package/dist/hooks/index.d.cts +25 -0
- package/dist/hooks/index.d.ts +20 -21
- package/dist/hooks/useAction.d.cts +164 -0
- package/dist/hooks/useAction.d.ts +2 -3
- package/dist/hooks/useAutocomplete.d.cts +118 -0
- package/dist/hooks/useAutocomplete.d.ts +1 -2
- package/dist/hooks/useChatBus.d.cts +55 -0
- package/dist/hooks/useChatBus.d.ts +1 -2
- package/dist/hooks/useConditionalField.d.cts +34 -0
- package/dist/hooks/useConditionalField.d.ts +1 -2
- package/dist/hooks/useDataValidator.d.cts +41 -0
- package/dist/hooks/useDataValidator.d.ts +1 -2
- package/dist/hooks/useDragDrop.d.cts +99 -0
- package/dist/hooks/useDragDrop.d.ts +1 -2
- package/dist/hooks/useFormPersistence.d.cts +80 -0
- package/dist/hooks/useFormPersistence.d.ts +0 -1
- package/dist/hooks/useModal.d.cts +106 -0
- package/dist/hooks/useModal.d.ts +0 -1
- package/dist/hooks/useResize.d.cts +86 -0
- package/dist/hooks/useResize.d.ts +1 -2
- package/dist/hooks/useStreamingUI.d.cts +117 -0
- package/dist/hooks/useStreamingUI.d.ts +1 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.d.cts +91 -92
- package/dist/index.d.ts +91 -92
- package/dist/plugins/duckdb.d.cts +1 -2
- package/dist/plugins/duckdb.d.ts +1 -2
- package/dist/plugins/groq.d.cts +12 -0
- package/dist/plugins/groq.d.ts +1 -2
- package/dist/plugins/index.d.cts +9 -0
- package/dist/plugins/index.d.ts +3 -4
- package/dist/plugins/katex.d.cts +1 -2
- package/dist/plugins/katex.d.ts +1 -2
- package/dist/plugins/rest.d.cts +12 -0
- package/dist/plugins/rest.d.ts +1 -2
- package/dist/plugins/supabase.d.cts +12 -0
- package/dist/plugins/supabase.d.ts +1 -2
- package/dist/services/chat-bus.d.cts +100 -0
- package/dist/services/chat-bus.d.ts +1 -2
- package/dist/services/chat-prompt-controller.d.cts +92 -0
- package/dist/services/chat-prompt-controller.d.ts +1 -2
- package/dist/services/component-registry.d.cts +119 -0
- package/dist/services/component-registry.d.ts +1 -2
- package/dist/services/data-validator.d.cts +27 -0
- package/dist/services/data-validator.d.ts +1 -2
- package/dist/services/index.d.cts +9 -0
- package/dist/services/index.d.ts +4 -5
- package/dist/services/telemetry.d.cts +86 -0
- package/dist/services/telemetry.d.ts +1 -2
- package/dist/services/validation.d.cts +169 -0
- package/dist/services/validation.d.ts +1 -2
- package/dist/stores/scratchpad-store.d.cts +109 -0
- package/dist/stores/scratchpad-store.d.ts +1 -2
- package/dist/stores/server-capabilities-store.d.cts +171 -0
- package/dist/stores/server-capabilities-store.d.ts +0 -1
- package/dist/test-setup.d.cts +5 -0
- package/dist/test-setup.d.ts +0 -1
- package/dist/testing/index.d.cts +34 -0
- package/dist/testing/index.d.ts +1 -2
- package/dist/types/chat-bus.d.cts +783 -0
- package/dist/types/chat-bus.d.ts +4 -5
- package/dist/types/index.d.cts +1616 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types-export.d.cts +1 -2
- package/dist/types-export.d.ts +1 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/degraded-projections.d.cts +119 -0
- package/dist/utils/degraded-projections.d.ts +0 -1
- package/dist/utils/duplicate-mount-registry.d.cts +83 -0
- package/dist/utils/duplicate-mount-registry.d.ts +0 -1
- package/dist/utils/escape-html.d.cts +12 -0
- package/dist/utils/escape-html.d.ts +0 -1
- package/dist/utils/format-string.d.cts +25 -0
- package/dist/utils/format-string.d.ts +0 -1
- package/dist/utils/iframe-coep.d.cts +53 -0
- package/dist/utils/iframe-coep.d.ts +1 -2
- package/dist/utils/logger.d.cts +57 -0
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/math-markdown.cjs +1 -1
- package/dist/utils/math-markdown.cjs.map +1 -1
- package/dist/utils/math-markdown.d.cts +15 -0
- package/dist/utils/math-markdown.d.ts +1 -2
- package/dist/utils/math-markdown.js +1 -1
- package/dist/utils/math-markdown.js.map +1 -1
- package/dist/utils/missing-value.d.cts +78 -0
- package/dist/utils/missing-value.d.ts +0 -1
- package/dist/utils/pan-zoom.d.cts +234 -0
- package/dist/utils/pan-zoom.d.ts +0 -1
- package/dist/utils/perf.d.cts +18 -0
- package/dist/utils/perf.d.ts +0 -1
- package/dist/utils/safe-url.d.cts +33 -0
- package/dist/utils/safe-url.d.ts +0 -1
- package/dist/utils/sanitize-html.d.cts +142 -0
- package/dist/utils/sanitize-html.d.ts +0 -1
- package/dist/utils/stable-key.d.cts +32 -0
- package/dist/utils/stable-key.d.ts +0 -1
- package/dist/utils/theme.cjs +91 -0
- package/dist/utils/theme.cjs.map +1 -0
- package/dist/utils/theme.d.cts +10 -0
- package/dist/utils/theme.d.ts +10 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +91 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/validation.d.cts +3 -4
- package/dist/validation.d.ts +3 -4
- package/docs/SECURITY-DEPENDENCIES.md +209 -0
- package/docs/THEMING.md +205 -0
- package/docs/ZOD4-STABLE-MIGRATION-2026-10-26.md +181 -0
- package/package.json +12 -9
- package/src/adapters/connector.ts +3 -3
- package/src/components/ActionGroupRenderer.tsx +6 -6
- package/src/components/AutocompleteDropdown.tsx +17 -17
- package/src/components/AutocompleteFormField.tsx +10 -9
- package/src/components/ChartJSRenderer.tsx +483 -239
- package/src/components/ChatPrompt.tsx +16 -16
- package/src/components/ComponentToolbar.tsx +5 -5
- package/src/components/DegradedFallback.tsx +9 -9
- package/src/components/ExpandableWrapper.tsx +15 -11
- package/src/components/FormFieldRenderer.tsx +52 -51
- package/src/components/FormRenderer.tsx +12 -12
- package/src/components/GenerativeUIErrorBoundary.tsx +6 -6
- package/src/components/GhostText.tsx +7 -7
- package/src/components/GraphRenderer.tsx +83 -67
- package/src/components/MissingValue.tsx +2 -2
- package/src/components/ModalRenderer.tsx +11 -5
- package/src/components/PortalDropdownMenu.tsx +6 -2
- package/src/components/ScratchpadPanel.tsx +144 -141
- package/src/components/UIResourceRenderer.tsx +101 -101
- package/src/components/chart-missing-plugin.ts +5 -3
- package/src/styles/autocomplete.css +53 -53
- package/src/utils/math-markdown.ts +1 -1
- package/src/utils/theme.ts +101 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PortalDropdownMenu (v6.4.0) — generic dropdown that mounts via
|
|
3
|
+
* `<Portal>` on `document.body` instead of an in-tree `position: absolute`
|
|
4
|
+
* sibling. Eliminates two pain points around the legacy in-tree pattern :
|
|
5
|
+
*
|
|
6
|
+
* 1. **`overflow: hidden` clipping** — when the trigger lives inside a
|
|
7
|
+
* chat bubble or a card with `overflow: hidden`, an absolutely
|
|
8
|
+
* positioned menu sibling gets clipped at the ancestor's boundary.
|
|
9
|
+
* Mounting on `document.body` escapes the clip stack entirely.
|
|
10
|
+
* 2. **`z-index` wars** — chat surfaces stack composer / message rails
|
|
11
|
+
* above the message list, and ancestor `z-index` creates a new
|
|
12
|
+
* stacking context that captures the in-tree menu. A portal is a
|
|
13
|
+
* sibling of the document, so a single `z-index: 9999` wins.
|
|
14
|
+
*
|
|
15
|
+
* The menu is positioned with `position: fixed` from the trigger's
|
|
16
|
+
* `getBoundingClientRect()`. We re-measure on `scroll` (capture phase, so
|
|
17
|
+
* nested scrollables also fire) and `resize` to keep the menu pinned
|
|
18
|
+
* while the user interacts with surrounding chrome.
|
|
19
|
+
*
|
|
20
|
+
* Close affordances : click outside, Escape, programmatic via `onClose`.
|
|
21
|
+
*/
|
|
22
|
+
import { Component, JSX } from 'solid-js';
|
|
23
|
+
export interface PortalDropdownMenuProps {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the menu is currently open. Controlled by the parent.
|
|
26
|
+
*/
|
|
27
|
+
open: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Called when the menu wants to close (outside click / Escape / item
|
|
30
|
+
* click — it's the parent's job to actually flip `open` to false).
|
|
31
|
+
*/
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Trigger element used as the positioning anchor. The menu's right
|
|
35
|
+
* edge is aligned to the trigger's right edge, top to its bottom + 4px.
|
|
36
|
+
*/
|
|
37
|
+
trigger: HTMLElement | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Menu width in pixels. Used to compute the left coordinate so the menu's
|
|
40
|
+
* right edge aligns with the trigger's right edge. Default : `144` (the
|
|
41
|
+
* legacy table menu width — `w-36`).
|
|
42
|
+
*/
|
|
43
|
+
width?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Menu content. Wrapped in the rounded / shadowed container — keep
|
|
46
|
+
* children minimal (just the items).
|
|
47
|
+
*/
|
|
48
|
+
children: JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* Optional additional class names for the menu container, appended after
|
|
51
|
+
* the default Tailwind classes. Useful to override width or padding.
|
|
52
|
+
*/
|
|
53
|
+
class?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const PortalDropdownMenu: Component<PortalDropdownMenuProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalDropdownMenu.d.ts","sourceRoot":"","sources":["../../src/components/PortalDropdownMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,GAAG,EAA+C,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"PortalDropdownMenu.d.ts","sourceRoot":"","sources":["../../src/components/PortalDropdownMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,GAAG,EAA+C,MAAM,UAAU,CAAA;AAItF,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;IAEb;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAA;IAEnB;;;OAGG;IACH,OAAO,EAAE,WAAW,GAAG,SAAS,CAAA;IAEhC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,uBAAuB,CAsEjE,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createComponent, Portal, getNextElement, insert, effect, setStyleProperty, className, template
|
|
1
|
+
import { createComponent, Portal, getNextElement, use, insert, effect, setStyleProperty, className, template } from "solid-js/web";
|
|
2
2
|
import { createSignal, createEffect, onCleanup, Show } from "solid-js";
|
|
3
|
+
import { bindPortalTheme } from "../utils/theme.js";
|
|
3
4
|
var _tmpl$ = /* @__PURE__ */ template(`<div role=menu data-mcp-ui-portal=menu style=position:fixed;z-index:9999>`);
|
|
4
5
|
const PortalDropdownMenu = (props) => {
|
|
5
6
|
const [position, setPosition] = createSignal({
|
|
@@ -54,11 +55,13 @@ const PortalDropdownMenu = (props) => {
|
|
|
54
55
|
return createComponent(Portal, {
|
|
55
56
|
get children() {
|
|
56
57
|
var _el$ = getNextElement(_tmpl$);
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
use((element) => {
|
|
59
|
+
menuRef = element;
|
|
60
|
+
bindPortalTheme(element, () => props.trigger);
|
|
61
|
+
}, _el$);
|
|
59
62
|
insert(_el$, () => props.children);
|
|
60
63
|
effect((_p$) => {
|
|
61
|
-
var _v$ = `${position().top}px`, _v$2 = `${position().left}px`, _v$3 = `${props.width ?? 144}px`, _v$4 = `bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm ${props.class ?? ""}`;
|
|
64
|
+
var _v$ = `${position().top}px`, _v$2 = `${position().left}px`, _v$3 = `${props.width ?? 144}px`, _v$4 = `mcp-ui-root bg-[color:var(--mcp-ui-surface,var(--color-white,#fff))] dark:bg-[color:var(--mcp-ui-surface,var(--color-gray-800,#1f2937))] border border-[color:var(--mcp-ui-border,var(--color-gray-200,#e5e7eb))] dark:border-[color:var(--mcp-ui-border,var(--color-gray-600,#4b5563))] rounded-lg shadow-[var(--mcp-ui-shadow,var(--shadow-lg))] py-1 text-sm ${props.class ?? ""}`;
|
|
62
65
|
_v$ !== _p$.e && setStyleProperty(_el$, "top", _p$.e = _v$);
|
|
63
66
|
_v$2 !== _p$.t && setStyleProperty(_el$, "left", _p$.t = _v$2);
|
|
64
67
|
_v$3 !== _p$.a && setStyleProperty(_el$, "width", _p$.a = _v$3);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalDropdownMenu.js","sources":["../../src/components/PortalDropdownMenu.tsx"],"sourcesContent":["/**\n * PortalDropdownMenu (v6.4.0) — generic dropdown that mounts via\n * `<Portal>` on `document.body` instead of an in-tree `position: absolute`\n * sibling. Eliminates two pain points around the legacy in-tree pattern :\n *\n * 1. **`overflow: hidden` clipping** — when the trigger lives inside a\n * chat bubble or a card with `overflow: hidden`, an absolutely\n * positioned menu sibling gets clipped at the ancestor's boundary.\n * Mounting on `document.body` escapes the clip stack entirely.\n * 2. **`z-index` wars** — chat surfaces stack composer / message rails\n * above the message list, and ancestor `z-index` creates a new\n * stacking context that captures the in-tree menu. A portal is a\n * sibling of the document, so a single `z-index: 9999` wins.\n *\n * The menu is positioned with `position: fixed` from the trigger's\n * `getBoundingClientRect()`. We re-measure on `scroll` (capture phase, so\n * nested scrollables also fire) and `resize` to keep the menu pinned\n * while the user interacts with surrounding chrome.\n *\n * Close affordances : click outside, Escape, programmatic via `onClose`.\n */\n\nimport { Component, JSX, Show, createSignal, createEffect, onCleanup } from 'solid-js'\nimport { Portal } from 'solid-js/web'\n\nexport interface PortalDropdownMenuProps {\n /**\n * Whether the menu is currently open. Controlled by the parent.\n */\n open: boolean\n\n /**\n * Called when the menu wants to close (outside click / Escape / item\n * click — it's the parent's job to actually flip `open` to false).\n */\n onClose: () => void\n\n /**\n * Trigger element used as the positioning anchor. The menu's right\n * edge is aligned to the trigger's right edge, top to its bottom + 4px.\n */\n trigger: HTMLElement | undefined\n\n /**\n * Menu width in pixels. Used to compute the left coordinate so the menu's\n * right edge aligns with the trigger's right edge. Default : `144` (the\n * legacy table menu width — `w-36`).\n */\n width?: number\n\n /**\n * Menu content. Wrapped in the rounded / shadowed container — keep\n * children minimal (just the items).\n */\n children: JSX.Element\n\n /**\n * Optional additional class names for the menu container, appended after\n * the default Tailwind classes. Useful to override width or padding.\n */\n class?: string\n}\n\nexport const PortalDropdownMenu: Component<PortalDropdownMenuProps> = (props) => {\n const [position, setPosition] = createSignal({ top: 0, left: 0 })\n let menuRef: HTMLDivElement | undefined\n\n const updatePosition = () => {\n const t = props.trigger\n if (!t) return\n const rect = t.getBoundingClientRect()\n const w = props.width ?? 144\n setPosition({\n top: rect.bottom + 4,\n left: rect.right - w,\n })\n }\n\n // Measure once when the menu opens, then react to viewport changes.\n createEffect(() => {\n if (!props.open) return\n updatePosition()\n\n const onDown = (e: MouseEvent) => {\n const target = e.target as Node\n if (menuRef?.contains(target) || props.trigger?.contains(target)) return\n props.onClose()\n }\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') props.onClose()\n }\n const onScrollOrResize = () => updatePosition()\n\n document.addEventListener('mousedown', onDown)\n document.addEventListener('keydown', onKey)\n // Capture phase so scrolls inside nested containers (e.g. chat virtual\n // list) also re-position the menu. `passive: true` because we never\n // preventDefault here.\n window.addEventListener('scroll', onScrollOrResize, { capture: true, passive: true })\n window.addEventListener('resize', onScrollOrResize)\n\n onCleanup(() => {\n document.removeEventListener('mousedown', onDown)\n document.removeEventListener('keydown', onKey)\n window.removeEventListener('scroll', onScrollOrResize, { capture: true })\n window.removeEventListener('resize', onScrollOrResize)\n })\n })\n\n return (\n <Show when={props.open}>\n <Portal>\n <div\n ref={menuRef}\n role=\"menu\"\n data-mcp-ui-portal=\"menu\"\n style={{\n position: 'fixed',\n top: `${position().top}px`,\n left: `${position().left}px`,\n 'z-index': 9999,\n width: `${props.width ?? 144}px`,\n }}\n class={`bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1 text-sm ${props.class ?? ''}`}\n >\n {props.children}\n </div>\n </Portal>\n </Show>\n )\n}\n"],"names":["PortalDropdownMenu","props","position","setPosition","createSignal","top","left","menuRef","updatePosition","t","trigger","rect","getBoundingClientRect","w","width","bottom","right","createEffect","open","onDown","e","target","contains","onClose","onKey","key","onScrollOrResize","document","addEventListener","window","capture","passive","onCleanup","removeEventListener","_$createComponent","Show","when","children","Portal","_el$","_$getNextElement","_tmpl$","
|
|
1
|
+
{"version":3,"file":"PortalDropdownMenu.js","sources":["../../src/components/PortalDropdownMenu.tsx"],"sourcesContent":["/**\n * PortalDropdownMenu (v6.4.0) — generic dropdown that mounts via\n * `<Portal>` on `document.body` instead of an in-tree `position: absolute`\n * sibling. Eliminates two pain points around the legacy in-tree pattern :\n *\n * 1. **`overflow: hidden` clipping** — when the trigger lives inside a\n * chat bubble or a card with `overflow: hidden`, an absolutely\n * positioned menu sibling gets clipped at the ancestor's boundary.\n * Mounting on `document.body` escapes the clip stack entirely.\n * 2. **`z-index` wars** — chat surfaces stack composer / message rails\n * above the message list, and ancestor `z-index` creates a new\n * stacking context that captures the in-tree menu. A portal is a\n * sibling of the document, so a single `z-index: 9999` wins.\n *\n * The menu is positioned with `position: fixed` from the trigger's\n * `getBoundingClientRect()`. We re-measure on `scroll` (capture phase, so\n * nested scrollables also fire) and `resize` to keep the menu pinned\n * while the user interacts with surrounding chrome.\n *\n * Close affordances : click outside, Escape, programmatic via `onClose`.\n */\n\nimport { Component, JSX, Show, createSignal, createEffect, onCleanup } from 'solid-js'\nimport { Portal } from 'solid-js/web'\nimport { bindPortalTheme } from '../utils/theme'\n\nexport interface PortalDropdownMenuProps {\n /**\n * Whether the menu is currently open. Controlled by the parent.\n */\n open: boolean\n\n /**\n * Called when the menu wants to close (outside click / Escape / item\n * click — it's the parent's job to actually flip `open` to false).\n */\n onClose: () => void\n\n /**\n * Trigger element used as the positioning anchor. The menu's right\n * edge is aligned to the trigger's right edge, top to its bottom + 4px.\n */\n trigger: HTMLElement | undefined\n\n /**\n * Menu width in pixels. Used to compute the left coordinate so the menu's\n * right edge aligns with the trigger's right edge. Default : `144` (the\n * legacy table menu width — `w-36`).\n */\n width?: number\n\n /**\n * Menu content. Wrapped in the rounded / shadowed container — keep\n * children minimal (just the items).\n */\n children: JSX.Element\n\n /**\n * Optional additional class names for the menu container, appended after\n * the default Tailwind classes. Useful to override width or padding.\n */\n class?: string\n}\n\nexport const PortalDropdownMenu: Component<PortalDropdownMenuProps> = (props) => {\n const [position, setPosition] = createSignal({ top: 0, left: 0 })\n let menuRef: HTMLDivElement | undefined\n\n const updatePosition = () => {\n const t = props.trigger\n if (!t) return\n const rect = t.getBoundingClientRect()\n const w = props.width ?? 144\n setPosition({\n top: rect.bottom + 4,\n left: rect.right - w,\n })\n }\n\n // Measure once when the menu opens, then react to viewport changes.\n createEffect(() => {\n if (!props.open) return\n updatePosition()\n\n const onDown = (e: MouseEvent) => {\n const target = e.target as Node\n if (menuRef?.contains(target) || props.trigger?.contains(target)) return\n props.onClose()\n }\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') props.onClose()\n }\n const onScrollOrResize = () => updatePosition()\n\n document.addEventListener('mousedown', onDown)\n document.addEventListener('keydown', onKey)\n // Capture phase so scrolls inside nested containers (e.g. chat virtual\n // list) also re-position the menu. `passive: true` because we never\n // preventDefault here.\n window.addEventListener('scroll', onScrollOrResize, { capture: true, passive: true })\n window.addEventListener('resize', onScrollOrResize)\n\n onCleanup(() => {\n document.removeEventListener('mousedown', onDown)\n document.removeEventListener('keydown', onKey)\n window.removeEventListener('scroll', onScrollOrResize, { capture: true })\n window.removeEventListener('resize', onScrollOrResize)\n })\n })\n\n return (\n <Show when={props.open}>\n <Portal>\n <div\n ref={(element) => {\n menuRef = element\n bindPortalTheme(element, () => props.trigger)\n }}\n role=\"menu\"\n data-mcp-ui-portal=\"menu\"\n style={{\n position: 'fixed',\n top: `${position().top}px`,\n left: `${position().left}px`,\n 'z-index': 9999,\n width: `${props.width ?? 144}px`,\n }}\n class={`mcp-ui-root bg-[color:var(--mcp-ui-surface,var(--color-white,#fff))] dark:bg-[color:var(--mcp-ui-surface,var(--color-gray-800,#1f2937))] border border-[color:var(--mcp-ui-border,var(--color-gray-200,#e5e7eb))] dark:border-[color:var(--mcp-ui-border,var(--color-gray-600,#4b5563))] rounded-lg shadow-[var(--mcp-ui-shadow,var(--shadow-lg))] py-1 text-sm ${props.class ?? ''}`}\n >\n {props.children}\n </div>\n </Portal>\n </Show>\n )\n}\n"],"names":["PortalDropdownMenu","props","position","setPosition","createSignal","top","left","menuRef","updatePosition","t","trigger","rect","getBoundingClientRect","w","width","bottom","right","createEffect","open","onDown","e","target","contains","onClose","onKey","key","onScrollOrResize","document","addEventListener","window","capture","passive","onCleanup","removeEventListener","_$createComponent","Show","when","children","Portal","_el$","_$getNextElement","_tmpl$","_$use","element","bindPortalTheme","_$insert","_$effect","_p$","_v$","_v$2","_v$3","_v$4","class","_$setStyleProperty","a","o","_$className","undefined"],"mappings":";;;;AAgEO,MAAMA,qBAA0DC,CAAAA,UAAU;AAC/E,QAAM,CAACC,UAAUC,WAAW,IAAIC,aAAa;AAAA,IAAEC,KAAK;AAAA,IAAGC,MAAM;AAAA,EAAA,CAAG;AAChE,MAAIC;AAEJ,QAAMC,iBAAiBA,MAAM;AAC3B,UAAMC,IAAIR,MAAMS;AAChB,QAAI,CAACD,EAAG;AACR,UAAME,OAAOF,EAAEG,sBAAAA;AACf,UAAMC,IAAIZ,MAAMa,SAAS;AACzBX,gBAAY;AAAA,MACVE,KAAKM,KAAKI,SAAS;AAAA,MACnBT,MAAMK,KAAKK,QAAQH;AAAAA,IAAAA,CACpB;AAAA,EACH;AAGAI,eAAa,MAAM;AACjB,QAAI,CAAChB,MAAMiB,KAAM;AACjBV,mBAAAA;AAEA,UAAMW,SAASA,CAACC,MAAkB;;AAChC,YAAMC,SAASD,EAAEC;AACjB,WAAId,mCAASe,SAASD,cAAWpB,WAAMS,YAANT,mBAAeqB,SAASD,SAAS;AAClEpB,YAAMsB,QAAAA;AAAAA,IACR;AACA,UAAMC,QAAQA,CAACJ,MAAqB;AAClC,UAAIA,EAAEK,QAAQ,SAAUxB,OAAMsB,QAAAA;AAAAA,IAChC;AACA,UAAMG,mBAAmBA,MAAMlB,eAAAA;AAE/BmB,aAASC,iBAAiB,aAAaT,MAAM;AAC7CQ,aAASC,iBAAiB,WAAWJ,KAAK;AAI1CK,WAAOD,iBAAiB,UAAUF,kBAAkB;AAAA,MAAEI,SAAS;AAAA,MAAMC,SAAS;AAAA,IAAA,CAAM;AACpFF,WAAOD,iBAAiB,UAAUF,gBAAgB;AAElDM,cAAU,MAAM;AACdL,eAASM,oBAAoB,aAAad,MAAM;AAChDQ,eAASM,oBAAoB,WAAWT,KAAK;AAC7CK,aAAOI,oBAAoB,UAAUP,kBAAkB;AAAA,QAAEI,SAAS;AAAA,MAAA,CAAM;AACxED,aAAOI,oBAAoB,UAAUP,gBAAgB;AAAA,IACvD,CAAC;AAAA,EACH,CAAC;AAED,SAAAQ,gBACGC,MAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEnC,MAAMiB;AAAAA,IAAI;AAAA,IAAA,IAAAmB,WAAA;AAAA,aAAAH,gBACnBI,QAAM;AAAA,QAAA,IAAAD,WAAA;AAAA,cAAAE,OAAAC,eAAAC,MAAA;AAAAC,cAEGC,CAAAA,YAAY;AAChBpC,sBAAUoC;AACVC,4BAAgBD,SAAS,MAAM1C,MAAMS,OAAO;AAAA,UAC9C,GAAC6B,IAAA;AAAAM,iBAAAN,MAAA,MAYAtC,MAAMoC,QAAQ;AAAAS,iBAAAC,CAAAA,QAAA;AAAA,gBAAAC,MAPR,GAAG9C,SAAAA,EAAWG,GAAG,MAAI4C,OACpB,GAAG/C,SAAAA,EAAWI,IAAI,MAAI4C,OAErB,GAAGjD,MAAMa,SAAS,GAAG,MAAIqC,OAE3B,mWAAmWlD,MAAMmD,SAAS,EAAE;AAAEJ,oBAAAD,IAAA3B,KAAAiC,iBAAAd,MAAA,OAAAQ,IAAA3B,IAAA4B,GAAA;AAAAC,qBAAAF,IAAAtC,KAAA4C,iBAAAd,MAAA,QAAAQ,IAAAtC,IAAAwC,IAAA;AAAAC,qBAAAH,IAAAO,KAAAD,iBAAAd,MAAA,SAAAQ,IAAAO,IAAAJ,IAAA;AAAAC,qBAAAJ,IAAAQ,KAAAC,UAAAjB,MAAAQ,IAAAQ,IAAAJ,IAAA;AAAA,mBAAAJ;AAAAA,UAAA,GAAA;AAAA,YAAA3B,GAAAqC;AAAAA,YAAAhD,GAAAgD;AAAAA,YAAAH,GAAAG;AAAAA,YAAAF,GAAAE;AAAAA,UAAAA,CAAA;AAAA,iBAAAlB;AAAAA,QAAA;AAAA,MAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAOvY;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PresentationFeedback — feedback on how a connector result was *presented*.
|
|
3
|
+
*
|
|
4
|
+
* @experimental
|
|
5
|
+
* @since v6.6.0 (R3 / D9 of ROADMAP-opendata-macro-mcpui)
|
|
6
|
+
*
|
|
7
|
+
* ## A separate axis from `FeedbackInline`
|
|
8
|
+
*
|
|
9
|
+
* MCP-UI has two distinct feedback widgets, kept separate on purpose
|
|
10
|
+
* (cf. R3) :
|
|
11
|
+
*
|
|
12
|
+
* - **`FeedbackInline`** — was the *answer* good? (response quality)
|
|
13
|
+
* - **`PresentationFeedback`** (this) — was the answer *shown well*?
|
|
14
|
+
* (layout / readability)
|
|
15
|
+
*
|
|
16
|
+
* They are separate components, separate exports, separate payloads — so
|
|
17
|
+
* the two axes never collapse into one in the UX or in the logs.
|
|
18
|
+
*
|
|
19
|
+
* ## Stateless — host owns persistence and re-render
|
|
20
|
+
*
|
|
21
|
+
* On submit the component calls `onSubmit(feedback)` with a
|
|
22
|
+
* `ConnectorRenderFeedback` payload and flips to its acknowledgement state.
|
|
23
|
+
* It does NOT persist anything and does NOT re-render the result itself
|
|
24
|
+
* (cf. D1 : adapter pure + host-owned state). The host persists the
|
|
25
|
+
* feedback and, if it wants to "close the loop", re-runs its adapter with
|
|
26
|
+
* the corrected `preferredLayout`.
|
|
27
|
+
*
|
|
28
|
+
* Submission is best-effort : a rejected `onSubmit` promise is swallowed,
|
|
29
|
+
* the UI still flips.
|
|
30
|
+
*
|
|
31
|
+
* ## Localization
|
|
32
|
+
*
|
|
33
|
+
* All labels ship in English and are overridable via the `labels` prop
|
|
34
|
+
* (partial). This component carries its own label bag rather than routing
|
|
35
|
+
* through `MCPUIStringsProvider` — its label set is large and specific to
|
|
36
|
+
* this one widget.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <PresentationFeedback
|
|
41
|
+
* connectorId="datagouv"
|
|
42
|
+
* toolName="datagouv.search"
|
|
43
|
+
* queryHash={result.queryHash}
|
|
44
|
+
* layoutType="table"
|
|
45
|
+
* preferredLayoutOptions={['table', 'bar', 'map']}
|
|
46
|
+
* onSubmit={(fb) => fetch('/api/render-feedback', {
|
|
47
|
+
* method: 'POST', body: JSON.stringify(fb),
|
|
48
|
+
* })}
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
import { Component } from 'solid-js';
|
|
53
|
+
import type { ConnectorRenderFeedback, ConnectorPreferredLayout } from '@seed-ship/mcp-ui-spec';
|
|
54
|
+
export interface PresentationFeedbackLabels {
|
|
55
|
+
/** Resting-state question. */
|
|
56
|
+
prompt: string;
|
|
57
|
+
/** Positive verdict button. */
|
|
58
|
+
readable: string;
|
|
59
|
+
/** Negative verdict button — opens the detail step. */
|
|
60
|
+
notReadable: string;
|
|
61
|
+
/** Heading of the detail step. */
|
|
62
|
+
problemsPrompt: string;
|
|
63
|
+
/** Per-problem chip labels. */
|
|
64
|
+
problemTooRaw: string;
|
|
65
|
+
problemWrongColumns: string;
|
|
66
|
+
problemWrongChart: string;
|
|
67
|
+
problemMissingContext: string;
|
|
68
|
+
problemWrongUnit: string;
|
|
69
|
+
problemBadGrouping: string;
|
|
70
|
+
problemMissingDatasetContext: string;
|
|
71
|
+
/** Heading of the optional layout picker. */
|
|
72
|
+
preferLayoutPrompt: string;
|
|
73
|
+
/** Free-text comment placeholder. */
|
|
74
|
+
commentPlaceholder: string;
|
|
75
|
+
/** Submit button of the detail step. */
|
|
76
|
+
submit: string;
|
|
77
|
+
/** Acknowledgement shown after submission. */
|
|
78
|
+
ack: string;
|
|
79
|
+
}
|
|
80
|
+
/** English defaults. Override via the `labels` prop for other locales. */
|
|
81
|
+
export declare const DEFAULT_PRESENTATION_FEEDBACK_LABELS: PresentationFeedbackLabels;
|
|
82
|
+
export interface PresentationFeedbackProps {
|
|
83
|
+
/** Connector whose result is being rated. */
|
|
84
|
+
connectorId: string;
|
|
85
|
+
/** Tool that produced the result. */
|
|
86
|
+
toolName: string;
|
|
87
|
+
/** Stable key tying feedback to a `ConnectorDynamicResultV1.queryHash`. */
|
|
88
|
+
queryHash?: string;
|
|
89
|
+
/** What is being rated (e.g. `'primary'`). Passed through to the payload. */
|
|
90
|
+
renderKind?: string;
|
|
91
|
+
/** The layout type currently shown (e.g. `'table'`). Passed through. */
|
|
92
|
+
layoutType?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Called once on submit with the assembled `ConnectorRenderFeedback`.
|
|
95
|
+
* Persistence + any re-render are the host's responsibility.
|
|
96
|
+
*/
|
|
97
|
+
onSubmit: (feedback: ConnectorRenderFeedback) => void | Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Layout alternatives offered in the detail step. Omit (or pass an empty
|
|
100
|
+
* array) to hide the layout picker entirely.
|
|
101
|
+
*/
|
|
102
|
+
preferredLayoutOptions?: ConnectorPreferredLayout[];
|
|
103
|
+
/** Partial label override (English defaults otherwise). */
|
|
104
|
+
labels?: Partial<PresentationFeedbackLabels>;
|
|
105
|
+
/** Extra Tailwind classes on the container. */
|
|
106
|
+
class?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @experimental
|
|
110
|
+
* Presentation-quality feedback widget (readable / not-readable + detail).
|
|
111
|
+
*/
|
|
112
|
+
export declare const PresentationFeedback: Component<PresentationFeedbackProps>;
|
|
@@ -110,4 +110,3 @@ export interface PresentationFeedbackProps {
|
|
|
110
110
|
* Presentation-quality feedback widget (readable / not-readable + detail).
|
|
111
111
|
*/
|
|
112
112
|
export declare const PresentationFeedback: Component<PresentationFeedbackProps>;
|
|
113
|
-
//# sourceMappingURL=PresentationFeedback.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderContext - Provides component rendering without circular dependencies
|
|
3
|
+
*
|
|
4
|
+
* This context breaks the circular dependency between:
|
|
5
|
+
* - UIResourceRenderer → CarouselRenderer/GridRenderer
|
|
6
|
+
* - CarouselRenderer/GridRenderer → UIResourceRenderer
|
|
7
|
+
*
|
|
8
|
+
* By providing the render function via context, child components can render
|
|
9
|
+
* nested components without importing UIResourceRenderer directly.
|
|
10
|
+
*/
|
|
11
|
+
import { JSX } from 'solid-js';
|
|
12
|
+
import type { UIComponent, RendererError } from "../types.cjs";
|
|
13
|
+
/**
|
|
14
|
+
* Render function type that renders a UIComponent
|
|
15
|
+
*/
|
|
16
|
+
export type RenderComponentFn = (component: UIComponent, onError?: (error: RendererError) => void) => JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Context value for component rendering
|
|
19
|
+
*/
|
|
20
|
+
export interface RenderContextValue {
|
|
21
|
+
/**
|
|
22
|
+
* Renders a single UIComponent
|
|
23
|
+
*/
|
|
24
|
+
renderComponent: RenderComponentFn;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Context for providing component rendering capability
|
|
28
|
+
*/
|
|
29
|
+
export declare const RenderContext: import("solid-js").Context<RenderContextValue>;
|
|
30
|
+
/**
|
|
31
|
+
* Hook to access the render context
|
|
32
|
+
* Used by CarouselRenderer and GridRenderer to render nested components
|
|
33
|
+
*/
|
|
34
|
+
export declare function useRenderContext(): RenderContextValue;
|
|
35
|
+
/**
|
|
36
|
+
* Provider component for render context
|
|
37
|
+
*/
|
|
38
|
+
export declare function RenderProvider(props: {
|
|
39
|
+
renderComponent: RenderComponentFn;
|
|
40
|
+
children: JSX.Element;
|
|
41
|
+
}): JSX.Element;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* nested components without importing UIResourceRenderer directly.
|
|
10
10
|
*/
|
|
11
11
|
import { JSX } from 'solid-js';
|
|
12
|
-
import type { UIComponent, RendererError } from
|
|
12
|
+
import type { UIComponent, RendererError } from "../types.js";
|
|
13
13
|
/**
|
|
14
14
|
* Render function type that renders a UIComponent
|
|
15
15
|
*/
|
|
@@ -39,4 +39,3 @@ export declare function RenderProvider(props: {
|
|
|
39
39
|
renderComponent: RenderComponentFn;
|
|
40
40
|
children: JSX.Element;
|
|
41
41
|
}): JSX.Element;
|
|
42
|
-
//# sourceMappingURL=RenderContext.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ResizeHandle Component
|
|
3
|
+
* Visual handle for resizing grid components
|
|
4
|
+
*
|
|
5
|
+
* Sprint Drag-Drop Feature
|
|
6
|
+
*/
|
|
7
|
+
import { Component } from 'solid-js';
|
|
8
|
+
/**
|
|
9
|
+
* Resize edge types
|
|
10
|
+
*/
|
|
11
|
+
export type ResizeEdge = 'left' | 'right' | 'top' | 'bottom';
|
|
12
|
+
/**
|
|
13
|
+
* Props for ResizeHandle
|
|
14
|
+
*/
|
|
15
|
+
export interface ResizeHandleProps {
|
|
16
|
+
/**
|
|
17
|
+
* Which edge this handle is on
|
|
18
|
+
*/
|
|
19
|
+
edge: ResizeEdge;
|
|
20
|
+
/**
|
|
21
|
+
* Callback when resize starts
|
|
22
|
+
*/
|
|
23
|
+
onResizeStart?: (edge: ResizeEdge, event: PointerEvent) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the handle is disabled
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether resize is active
|
|
30
|
+
*/
|
|
31
|
+
isActive?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Custom class
|
|
34
|
+
*/
|
|
35
|
+
class?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Handle size in pixels
|
|
38
|
+
*/
|
|
39
|
+
size?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Hit area size in pixels (larger than visible size for easier grabbing)
|
|
42
|
+
*/
|
|
43
|
+
hitAreaSize?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* ResizeHandle Component
|
|
47
|
+
*/
|
|
48
|
+
export declare const ResizeHandle: Component<ResizeHandleProps>;
|
|
49
|
+
export default ResizeHandle;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<SafeHtml>` — the only place in this package that binds a string to
|
|
3
|
+
* `innerHTML`.
|
|
4
|
+
*
|
|
5
|
+
* Two jobs:
|
|
6
|
+
*
|
|
7
|
+
* 1. Render the (already sanitized — see `sanitizeHtml`) markup through the
|
|
8
|
+
* `innerHTML` prop, so SSR still emits content and client renders/updates
|
|
9
|
+
* stay reactive.
|
|
10
|
+
* 2. Repair the hydration hole. `solid-js/web`'s `setProperty(node,
|
|
11
|
+
* 'innerHTML', v)` returns early while hydrating, so the server-rendered
|
|
12
|
+
* content (escaped plain text, per the SSR contract — block structure is
|
|
13
|
+
* lost until this fix-up runs) would otherwise stay in the DOM forever.
|
|
14
|
+
* `onMount` runs client-side only, after hydration, and re-applies
|
|
15
|
+
* `html()` when the live DOM disagrees with it.
|
|
16
|
+
*
|
|
17
|
+
* Every sink carrying untrusted markup goes through this component: `text`
|
|
18
|
+
* component content, table cells and `ui://` rawHtml resources. One sink is
|
|
19
|
+
* deliberately outside it — `CodeBlockRenderer` binds highlight.js output (or
|
|
20
|
+
* `escapeHtml(code)` when highlight.js is missing or throws) straight into its
|
|
21
|
+
* own `<code innerHTML>`, a string that is markup-safe by construction and
|
|
22
|
+
* never passes through `sanitizeHtml`.
|
|
23
|
+
*
|
|
24
|
+
* @see ../utils/sanitize-html
|
|
25
|
+
* @see ./CodeBlockRenderer for the one innerHTML sink outside this component
|
|
26
|
+
*/
|
|
27
|
+
import { type JSX } from 'solid-js';
|
|
28
|
+
export interface SafeHtmlProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
/**
|
|
30
|
+
* Accessor returning **already sanitized** HTML. Kept as an accessor (not a
|
|
31
|
+
* plain string) so the value stays reactive through `splitProps`.
|
|
32
|
+
*/
|
|
33
|
+
html: () => string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Apply `html` to `el` when the live DOM content differs.
|
|
37
|
+
*
|
|
38
|
+
* Exported for tests: the hydration path it exists for cannot be reproduced in
|
|
39
|
+
* jsdom, so the fix-up is unit-tested directly against a "stale" element.
|
|
40
|
+
*
|
|
41
|
+
* @returns `true` when the DOM was patched.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare function _applySafeHtml(el: HTMLElement | undefined, html: string): boolean;
|
|
45
|
+
export declare function SafeHtml(props: SafeHtmlProps): JSX.Element;
|
|
@@ -43,4 +43,3 @@ export interface SafeHtmlProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function _applySafeHtml(el: HTMLElement | undefined, html: string): boolean;
|
|
45
45
|
export declare function SafeHtml(props: SafeHtmlProps): JSX.Element;
|
|
46
|
-
//# sourceMappingURL=SafeHtml.d.ts.map
|