@seed-ship/mcp-ui-solid 2.1.3 → 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.
Files changed (62) hide show
  1. package/dist/components/ChartJSRenderer.cjs +79 -36
  2. package/dist/components/ChartJSRenderer.cjs.map +1 -1
  3. package/dist/components/ChartJSRenderer.d.ts.map +1 -1
  4. package/dist/components/ChartJSRenderer.js +80 -37
  5. package/dist/components/ChartJSRenderer.js.map +1 -1
  6. package/dist/components/CodeBlockRenderer.cjs +79 -56
  7. package/dist/components/CodeBlockRenderer.cjs.map +1 -1
  8. package/dist/components/CodeBlockRenderer.d.ts.map +1 -1
  9. package/dist/components/CodeBlockRenderer.js +80 -57
  10. package/dist/components/CodeBlockRenderer.js.map +1 -1
  11. package/dist/components/ExpandableWrapper.cjs +136 -0
  12. package/dist/components/ExpandableWrapper.cjs.map +1 -0
  13. package/dist/components/ExpandableWrapper.d.ts +31 -0
  14. package/dist/components/ExpandableWrapper.d.ts.map +1 -0
  15. package/dist/components/ExpandableWrapper.js +136 -0
  16. package/dist/components/ExpandableWrapper.js.map +1 -0
  17. package/dist/components/UIResourceRenderer.cjs +369 -242
  18. package/dist/components/UIResourceRenderer.cjs.map +1 -1
  19. package/dist/components/UIResourceRenderer.d.ts +4 -0
  20. package/dist/components/UIResourceRenderer.d.ts.map +1 -1
  21. package/dist/components/UIResourceRenderer.js +370 -243
  22. package/dist/components/UIResourceRenderer.js.map +1 -1
  23. package/dist/index.cjs +3 -0
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +2 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +3 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/node_modules/.pnpm/{dompurify@3.3.0 → dompurify@3.3.3}/node_modules/dompurify/dist/purify.es.cjs +19 -4
  31. package/dist/node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.cjs.map +1 -0
  32. package/dist/node_modules/.pnpm/{dompurify@3.3.0 → dompurify@3.3.3}/node_modules/dompurify/dist/purify.es.js +19 -4
  33. package/dist/node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.js.map +1 -0
  34. package/dist/services/component-registry.cjs.map +1 -1
  35. package/dist/services/component-registry.d.ts +1 -0
  36. package/dist/services/component-registry.d.ts.map +1 -1
  37. package/dist/services/component-registry.js.map +1 -1
  38. package/dist/services/validation.cjs +29 -5
  39. package/dist/services/validation.cjs.map +1 -1
  40. package/dist/services/validation.d.ts.map +1 -1
  41. package/dist/services/validation.js +29 -5
  42. package/dist/services/validation.js.map +1 -1
  43. package/dist/types/index.d.ts +17 -0
  44. package/dist/types/index.d.ts.map +1 -1
  45. package/dist/types.d.cts +17 -0
  46. package/dist/types.d.ts +17 -0
  47. package/package.json +3 -3
  48. package/src/components/ChartJSRenderer.tsx +71 -42
  49. package/src/components/CodeBlockRenderer.tsx +33 -14
  50. package/src/components/ExpandableWrapper.test.tsx +229 -0
  51. package/src/components/ExpandableWrapper.tsx +201 -0
  52. package/src/components/UIResourceRenderer.tsx +165 -62
  53. package/src/components/renderCellValue.test.ts +122 -0
  54. package/src/index.ts +2 -0
  55. package/src/services/component-registry.test.ts +81 -0
  56. package/src/services/component-registry.ts +3 -2
  57. package/src/services/validation.test.ts +134 -0
  58. package/src/services/validation.ts +21 -5
  59. package/src/types/index.ts +17 -0
  60. package/tsconfig.tsbuildinfo +1 -1
  61. package/dist/node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.cjs.map +0 -1
  62. 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.push({
548
- path: 'type',
549
- message: `Unknown component type: ${component.type}`,
550
- code: 'UNKNOWN_COMPONENT_TYPE',
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 {
@@ -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
  */