@seed-ship/mcp-ui-solid 2.1.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChartJSRenderer.cjs +79 -36
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +80 -37
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/CodeBlockRenderer.cjs +79 -56
- package/dist/components/CodeBlockRenderer.cjs.map +1 -1
- package/dist/components/CodeBlockRenderer.d.ts.map +1 -1
- package/dist/components/CodeBlockRenderer.js +80 -57
- package/dist/components/CodeBlockRenderer.js.map +1 -1
- package/dist/components/ExpandableWrapper.cjs +136 -0
- package/dist/components/ExpandableWrapper.cjs.map +1 -0
- package/dist/components/ExpandableWrapper.d.ts +31 -0
- package/dist/components/ExpandableWrapper.d.ts.map +1 -0
- package/dist/components/ExpandableWrapper.js +136 -0
- package/dist/components/ExpandableWrapper.js.map +1 -0
- package/dist/components/UIResourceRenderer.cjs +369 -242
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts +4 -0
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +370 -243
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/{dompurify@3.3.0 → dompurify@3.3.3}/node_modules/dompurify/dist/purify.es.cjs +19 -4
- package/dist/node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.cjs.map +1 -0
- package/dist/node_modules/.pnpm/{dompurify@3.3.0 → dompurify@3.3.3}/node_modules/dompurify/dist/purify.es.js +19 -4
- package/dist/node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.js.map +1 -0
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts +1 -0
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js.map +1 -1
- package/dist/services/validation.cjs +29 -5
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +29 -5
- package/dist/services/validation.js.map +1 -1
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +17 -0
- package/dist/types.d.ts +17 -0
- package/package.json +4 -4
- package/src/components/ChartJSRenderer.tsx +71 -42
- package/src/components/CodeBlockRenderer.tsx +33 -14
- package/src/components/ExpandableWrapper.test.tsx +229 -0
- package/src/components/ExpandableWrapper.tsx +201 -0
- package/src/components/UIResourceRenderer.tsx +165 -62
- package/src/components/renderCellValue.test.ts +122 -0
- package/src/index.ts +2 -0
- package/src/services/component-registry.test.ts +81 -0
- package/src/services/component-registry.ts +3 -2
- package/src/services/validation.test.ts +134 -0
- package/src/services/validation.ts +21 -5
- package/src/types/index.ts +17 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.cjs.map +0 -1
- package/dist/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js.map +0 -1
|
@@ -18,8 +18,19 @@ import type {
|
|
|
18
18
|
FormFieldParams,
|
|
19
19
|
IframePolicy,
|
|
20
20
|
ValidationOptions,
|
|
21
|
+
ComponentType,
|
|
21
22
|
} from '../types'
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* All known ComponentType values — used to distinguish known-but-unvalidated
|
|
26
|
+
* types (pass through) from truly unknown strings (reject).
|
|
27
|
+
*/
|
|
28
|
+
const KNOWN_COMPONENT_TYPES: Set<string> = new Set<ComponentType>([
|
|
29
|
+
'chart', 'table', 'metric', 'text', 'grid', 'iframe', 'image', 'link',
|
|
30
|
+
'action', 'footer', 'carousel', 'artifact', 'form', 'modal',
|
|
31
|
+
'action-group', 'image-gallery', 'video', 'code', 'map',
|
|
32
|
+
])
|
|
33
|
+
|
|
23
34
|
/**
|
|
24
35
|
* Default resource limits (configurable via env)
|
|
25
36
|
*/
|
|
@@ -544,11 +555,16 @@ export function validateComponent(
|
|
|
544
555
|
}
|
|
545
556
|
|
|
546
557
|
default:
|
|
547
|
-
errors
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
558
|
+
// Known types without specific validation pass through — renderer handles errors
|
|
559
|
+
// Truly unknown types (e.g. typos in streamed JSON) are rejected
|
|
560
|
+
if (!KNOWN_COMPONENT_TYPES.has(component.type)) {
|
|
561
|
+
errors.push({
|
|
562
|
+
path: 'type',
|
|
563
|
+
message: `Unknown component type: ${component.type}`,
|
|
564
|
+
code: 'UNKNOWN_COMPONENT_TYPE',
|
|
565
|
+
})
|
|
566
|
+
}
|
|
567
|
+
break
|
|
552
568
|
}
|
|
553
569
|
|
|
554
570
|
return {
|
package/src/types/index.ts
CHANGED
|
@@ -114,6 +114,14 @@ export interface ChartComponentParams {
|
|
|
114
114
|
* - 'auto': Use native if Chart.js is available, otherwise iframe (default)
|
|
115
115
|
*/
|
|
116
116
|
renderer?: 'native' | 'iframe' | 'auto'
|
|
117
|
+
/**
|
|
118
|
+
* Enable PNG export button (v2.2.0)
|
|
119
|
+
*/
|
|
120
|
+
exportable?: boolean
|
|
121
|
+
/**
|
|
122
|
+
* Chart container height as CSS value (v2.2.0, default '250px')
|
|
123
|
+
*/
|
|
124
|
+
height?: string
|
|
117
125
|
/**
|
|
118
126
|
* Custom CSS class (Sprint 7)
|
|
119
127
|
*/
|
|
@@ -170,6 +178,15 @@ export interface TableComponentParams {
|
|
|
170
178
|
* - TableVirtualizeOptions: Enable with custom options
|
|
171
179
|
*/
|
|
172
180
|
virtualize?: boolean | TableVirtualizeOptions
|
|
181
|
+
/**
|
|
182
|
+
* Enable table export (v2.2.0)
|
|
183
|
+
* - true: Enable all formats (csv, tsv, json)
|
|
184
|
+
* - object: Configure formats and filename
|
|
185
|
+
*/
|
|
186
|
+
exportable?: boolean | {
|
|
187
|
+
formats?: ('csv' | 'tsv' | 'json')[]
|
|
188
|
+
filename?: string
|
|
189
|
+
}
|
|
173
190
|
/**
|
|
174
191
|
* Custom CSS class (Sprint 7)
|
|
175
192
|
*/
|