@charisol/plexo-sdk 1.4.39 → 1.4.40

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 (103) hide show
  1. package/dist/index.js +13431 -17791
  2. package/dist/plexo-sdk.css +1 -1
  3. package/dist/v2/ai/commands.d.ts +616 -0
  4. package/dist/v2/ai/dispatch.d.ts +24 -0
  5. package/dist/v2/ai/nodeSchema.d.ts +196 -0
  6. package/dist/v2/brand/BrandColorSwatches.d.ts +4 -0
  7. package/dist/v2/brand/BrandPanel.d.ts +4 -0
  8. package/dist/v2/brand/ChangeSetGallery.d.ts +10 -0
  9. package/dist/v2/brand/StyleSetEditor.d.ts +22 -0
  10. package/dist/v2/canvas/CatalogDragContext.d.ts +27 -0
  11. package/dist/v2/canvas/ContextMenuContext.d.ts +16 -0
  12. package/dist/v2/canvas/DeviceModeContext.d.ts +20 -0
  13. package/dist/v2/canvas/DragEngineContext.d.ts +13 -0
  14. package/dist/v2/canvas/LayoutGuideContext.d.ts +22 -0
  15. package/dist/v2/canvas/PreviewModeContext.d.ts +15 -0
  16. package/dist/v2/canvas/SidebarContext.d.ts +21 -0
  17. package/dist/v2/canvas/StylePainterContext.d.ts +19 -0
  18. package/dist/v2/canvas/WorkspaceThemeContext.d.ts +19 -0
  19. package/dist/v2/canvas/aiTextTransforms.d.ts +24 -0
  20. package/dist/v2/canvas/animationPresets.d.ts +12 -0
  21. package/dist/v2/canvas/constants.d.ts +6 -0
  22. package/dist/v2/canvas/modelRect.d.ts +4 -0
  23. package/dist/v2/canvas/rectMath.d.ts +34 -0
  24. package/dist/v2/canvas/reorderMath.d.ts +8 -0
  25. package/dist/v2/canvas/resizeMath.d.ts +16 -0
  26. package/dist/v2/canvas/resolveBoxStyle.d.ts +12 -0
  27. package/dist/v2/canvas/resolveTargetSection.d.ts +10 -0
  28. package/dist/v2/canvas/sectionDividerShapes.d.ts +12 -0
  29. package/dist/v2/canvas/snapping.d.ts +28 -0
  30. package/dist/v2/canvas/useAlignNode.d.ts +10 -0
  31. package/dist/v2/canvas/useClipboardKeyBinding.d.ts +7 -0
  32. package/dist/v2/canvas/useDeleteKeyBinding.d.ts +3 -0
  33. package/dist/v2/canvas/useDragEngine.d.ts +44 -0
  34. package/dist/v2/canvas/useDraggableNode.d.ts +40 -0
  35. package/dist/v2/canvas/useInlineTextEdit.d.ts +29 -0
  36. package/dist/v2/canvas/usePointerEngine.d.ts +22 -0
  37. package/dist/v2/canvas/useResizeHandle.d.ts +12 -0
  38. package/dist/v2/canvas/useResolvedTextStyles.d.ts +13 -0
  39. package/dist/v2/canvas/useSelectionRects.d.ts +13 -0
  40. package/dist/v2/canvas/useUndoRedoKeyBinding.d.ts +8 -0
  41. package/dist/v2/catalog/elementCatalog.d.ts +31 -0
  42. package/dist/v2/catalog/imagePreset.d.ts +7 -0
  43. package/dist/v2/compile/toReact.d.ts +32 -0
  44. package/dist/v2/components/AdornmentLayer.d.ts +20 -0
  45. package/dist/v2/components/AskSolPanel.d.ts +19 -0
  46. package/dist/v2/components/CatalogDragGhost.d.ts +6 -0
  47. package/dist/v2/components/CellBoundary.d.ts +14 -0
  48. package/dist/v2/components/CenterCanvas.d.ts +3 -0
  49. package/dist/v2/components/ContentTabPanel.d.ts +12 -0
  50. package/dist/v2/components/ContextMenu.d.ts +5 -0
  51. package/dist/v2/components/ContextualToolbar.d.ts +25 -0
  52. package/dist/v2/components/ImagesTabPanel.d.ts +15 -0
  53. package/dist/v2/components/LayoutGuidePanel.d.ts +10 -0
  54. package/dist/v2/components/ManageLayersPanel.d.ts +13 -0
  55. package/dist/v2/components/NodeRenderer.d.ts +8 -0
  56. package/dist/v2/components/PreviewOverlay.d.ts +11 -0
  57. package/dist/v2/components/ResizeHandle.d.ts +6 -0
  58. package/dist/v2/components/RightRail.d.ts +13 -0
  59. package/dist/v2/components/SectionDividerOverlay.d.ts +8 -0
  60. package/dist/v2/components/SectionEdgeAddZone.d.ts +17 -0
  61. package/dist/v2/components/SectionGridOverlay.d.ts +10 -0
  62. package/dist/v2/components/SectionNamePill.d.ts +6 -0
  63. package/dist/v2/components/SectionNode.d.ts +5 -0
  64. package/dist/v2/components/SectionSideRail.d.ts +17 -0
  65. package/dist/v2/components/SelectionToolbar.d.ts +11 -0
  66. package/dist/v2/components/StylePainterToast.d.ts +5 -0
  67. package/dist/v2/components/V2Canvas.d.ts +56 -0
  68. package/dist/v2/components/nodes/ButtonNode.d.ts +4 -0
  69. package/dist/v2/components/nodes/ContainerNode.d.ts +11 -0
  70. package/dist/v2/components/nodes/EmbedNode.d.ts +4 -0
  71. package/dist/v2/components/nodes/ImageNode.d.ts +4 -0
  72. package/dist/v2/components/nodes/InputNode.d.ts +4 -0
  73. package/dist/v2/components/nodes/MenuNode.d.ts +18 -0
  74. package/dist/v2/components/nodes/TextNode.d.ts +4 -0
  75. package/dist/v2/index.d.ts +12 -0
  76. package/dist/v2/inspector/AiQuickEditPanel.d.ts +12 -0
  77. package/dist/v2/inspector/AnimationPanel.d.ts +11 -0
  78. package/dist/v2/inspector/DesignAccordions.d.ts +7 -0
  79. package/dist/v2/inspector/FieldRenderer.d.ts +9 -0
  80. package/dist/v2/inspector/IconPopoverButton.d.ts +9 -0
  81. package/dist/v2/inspector/MenuIconPanel.d.ts +7 -0
  82. package/dist/v2/inspector/MenuManagePanel.d.ts +8 -0
  83. package/dist/v2/inspector/Popover.d.ts +21 -0
  84. package/dist/v2/inspector/SectionDividerPanel.d.ts +9 -0
  85. package/dist/v2/inspector/fieldStyles.d.ts +15 -0
  86. package/dist/v2/inspector/fields/ColorField.d.ts +7 -0
  87. package/dist/v2/inspector/fields/NumberField.d.ts +7 -0
  88. package/dist/v2/inspector/fields/SelectField.d.ts +7 -0
  89. package/dist/v2/inspector/fields/TextField.d.ts +7 -0
  90. package/dist/v2/inspector/fields/TextStyleField.d.ts +11 -0
  91. package/dist/v2/inspector/fields/TextareaField.d.ts +7 -0
  92. package/dist/v2/inspector/schema.d.ts +25 -0
  93. package/dist/v2/inspector/useFieldCommit.d.ts +12 -0
  94. package/dist/v2/store/brandTypes.d.ts +40 -0
  95. package/dist/v2/store/cloneSubtree.d.ts +12 -0
  96. package/dist/v2/store/createBrandStore.d.ts +2 -0
  97. package/dist/v2/store/createCanvasStore.d.ts +2 -0
  98. package/dist/v2/store/seed.d.ts +17 -0
  99. package/dist/v2/store/types.d.ts +163 -0
  100. package/dist/v2/ui/theme.d.ts +85 -0
  101. package/dist/v2.js +9093 -0
  102. package/dist/zoom-in-DL4pfiLG.js +4461 -0
  103. package/package.json +6 -1
@@ -0,0 +1,616 @@
1
+ import { z } from 'zod';
2
+ export declare const InsertSectionCommandSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"insertSection">;
4
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ id: z.ZodString;
6
+ parentId: z.ZodNullable<z.ZodString>;
7
+ children: z.ZodArray<z.ZodString>;
8
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
9
+ type: z.ZodLiteral<"Section">;
10
+ props: z.ZodObject<{
11
+ name: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ }, z.core.$strip>, z.ZodObject<{
14
+ id: z.ZodString;
15
+ parentId: z.ZodNullable<z.ZodString>;
16
+ children: z.ZodArray<z.ZodString>;
17
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
18
+ type: z.ZodLiteral<"Text">;
19
+ props: z.ZodObject<{
20
+ content: z.ZodString;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ id: z.ZodString;
24
+ parentId: z.ZodNullable<z.ZodString>;
25
+ children: z.ZodArray<z.ZodString>;
26
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
27
+ type: z.ZodLiteral<"Image">;
28
+ props: z.ZodObject<{
29
+ src: z.ZodString;
30
+ alt: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>;
32
+ }, z.core.$strip>, z.ZodObject<{
33
+ id: z.ZodString;
34
+ parentId: z.ZodNullable<z.ZodString>;
35
+ children: z.ZodArray<z.ZodString>;
36
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
37
+ type: z.ZodLiteral<"Button">;
38
+ props: z.ZodObject<{
39
+ label: z.ZodString;
40
+ href: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ id: z.ZodString;
44
+ parentId: z.ZodNullable<z.ZodString>;
45
+ children: z.ZodArray<z.ZodString>;
46
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
47
+ type: z.ZodLiteral<"Container">;
48
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ id: z.ZodString;
51
+ parentId: z.ZodNullable<z.ZodString>;
52
+ children: z.ZodArray<z.ZodString>;
53
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
54
+ type: z.ZodLiteral<"Input">;
55
+ props: z.ZodObject<{
56
+ label: z.ZodString;
57
+ placeholder: z.ZodOptional<z.ZodString>;
58
+ fieldType: z.ZodEnum<{
59
+ text: "text";
60
+ textarea: "textarea";
61
+ email: "email";
62
+ tel: "tel";
63
+ }>;
64
+ required: z.ZodOptional<z.ZodBoolean>;
65
+ }, z.core.$strip>;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ id: z.ZodString;
68
+ parentId: z.ZodNullable<z.ZodString>;
69
+ children: z.ZodArray<z.ZodString>;
70
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
71
+ type: z.ZodLiteral<"Embed">;
72
+ props: z.ZodObject<{
73
+ kind: z.ZodEnum<{
74
+ video: "video";
75
+ html: "html";
76
+ }>;
77
+ url: z.ZodOptional<z.ZodString>;
78
+ html: z.ZodOptional<z.ZodString>;
79
+ coverImage: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ id: z.ZodString;
83
+ parentId: z.ZodNullable<z.ZodString>;
84
+ children: z.ZodArray<z.ZodString>;
85
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
86
+ type: z.ZodLiteral<"Menu">;
87
+ props: z.ZodObject<{
88
+ links: z.ZodArray<z.ZodObject<{
89
+ label: z.ZodString;
90
+ href: z.ZodString;
91
+ }, z.core.$strip>>;
92
+ layout: z.ZodEnum<{
93
+ horizontal: "horizontal";
94
+ vertical: "vertical";
95
+ }>;
96
+ }, z.core.$strip>;
97
+ }, z.core.$strip>], "type">>;
98
+ sectionId: z.ZodString;
99
+ index: z.ZodOptional<z.ZodNumber>;
100
+ }, z.core.$strip>;
101
+ export declare const InsertNodeCommandSchema: z.ZodObject<{
102
+ type: z.ZodLiteral<"insertNode">;
103
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
104
+ id: z.ZodString;
105
+ parentId: z.ZodNullable<z.ZodString>;
106
+ children: z.ZodArray<z.ZodString>;
107
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
108
+ type: z.ZodLiteral<"Section">;
109
+ props: z.ZodObject<{
110
+ name: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strip>;
112
+ }, z.core.$strip>, z.ZodObject<{
113
+ id: z.ZodString;
114
+ parentId: z.ZodNullable<z.ZodString>;
115
+ children: z.ZodArray<z.ZodString>;
116
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
117
+ type: z.ZodLiteral<"Text">;
118
+ props: z.ZodObject<{
119
+ content: z.ZodString;
120
+ }, z.core.$strip>;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ id: z.ZodString;
123
+ parentId: z.ZodNullable<z.ZodString>;
124
+ children: z.ZodArray<z.ZodString>;
125
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
126
+ type: z.ZodLiteral<"Image">;
127
+ props: z.ZodObject<{
128
+ src: z.ZodString;
129
+ alt: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>;
131
+ }, z.core.$strip>, z.ZodObject<{
132
+ id: z.ZodString;
133
+ parentId: z.ZodNullable<z.ZodString>;
134
+ children: z.ZodArray<z.ZodString>;
135
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
136
+ type: z.ZodLiteral<"Button">;
137
+ props: z.ZodObject<{
138
+ label: z.ZodString;
139
+ href: z.ZodOptional<z.ZodString>;
140
+ }, z.core.$strip>;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ id: z.ZodString;
143
+ parentId: z.ZodNullable<z.ZodString>;
144
+ children: z.ZodArray<z.ZodString>;
145
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
146
+ type: z.ZodLiteral<"Container">;
147
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ id: z.ZodString;
150
+ parentId: z.ZodNullable<z.ZodString>;
151
+ children: z.ZodArray<z.ZodString>;
152
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
153
+ type: z.ZodLiteral<"Input">;
154
+ props: z.ZodObject<{
155
+ label: z.ZodString;
156
+ placeholder: z.ZodOptional<z.ZodString>;
157
+ fieldType: z.ZodEnum<{
158
+ text: "text";
159
+ textarea: "textarea";
160
+ email: "email";
161
+ tel: "tel";
162
+ }>;
163
+ required: z.ZodOptional<z.ZodBoolean>;
164
+ }, z.core.$strip>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ id: z.ZodString;
167
+ parentId: z.ZodNullable<z.ZodString>;
168
+ children: z.ZodArray<z.ZodString>;
169
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
170
+ type: z.ZodLiteral<"Embed">;
171
+ props: z.ZodObject<{
172
+ kind: z.ZodEnum<{
173
+ video: "video";
174
+ html: "html";
175
+ }>;
176
+ url: z.ZodOptional<z.ZodString>;
177
+ html: z.ZodOptional<z.ZodString>;
178
+ coverImage: z.ZodOptional<z.ZodString>;
179
+ }, z.core.$strip>;
180
+ }, z.core.$strip>, z.ZodObject<{
181
+ id: z.ZodString;
182
+ parentId: z.ZodNullable<z.ZodString>;
183
+ children: z.ZodArray<z.ZodString>;
184
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
185
+ type: z.ZodLiteral<"Menu">;
186
+ props: z.ZodObject<{
187
+ links: z.ZodArray<z.ZodObject<{
188
+ label: z.ZodString;
189
+ href: z.ZodString;
190
+ }, z.core.$strip>>;
191
+ layout: z.ZodEnum<{
192
+ horizontal: "horizontal";
193
+ vertical: "vertical";
194
+ }>;
195
+ }, z.core.$strip>;
196
+ }, z.core.$strip>], "type">>;
197
+ nodeId: z.ZodString;
198
+ parentId: z.ZodString;
199
+ index: z.ZodOptional<z.ZodNumber>;
200
+ }, z.core.$strip>;
201
+ export declare const UpdateNodeCommandSchema: z.ZodObject<{
202
+ type: z.ZodLiteral<"updateNode">;
203
+ id: z.ZodString;
204
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
205
+ styles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
206
+ }, z.core.$strip>;
207
+ export declare const DeleteNodeCommandSchema: z.ZodObject<{
208
+ type: z.ZodLiteral<"deleteNode">;
209
+ id: z.ZodString;
210
+ }, z.core.$strip>;
211
+ export declare const ReplacePageCommandSchema: z.ZodObject<{
212
+ type: z.ZodLiteral<"replacePage">;
213
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
214
+ id: z.ZodString;
215
+ parentId: z.ZodNullable<z.ZodString>;
216
+ children: z.ZodArray<z.ZodString>;
217
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
218
+ type: z.ZodLiteral<"Section">;
219
+ props: z.ZodObject<{
220
+ name: z.ZodOptional<z.ZodString>;
221
+ }, z.core.$strip>;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ id: z.ZodString;
224
+ parentId: z.ZodNullable<z.ZodString>;
225
+ children: z.ZodArray<z.ZodString>;
226
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
227
+ type: z.ZodLiteral<"Text">;
228
+ props: z.ZodObject<{
229
+ content: z.ZodString;
230
+ }, z.core.$strip>;
231
+ }, z.core.$strip>, z.ZodObject<{
232
+ id: z.ZodString;
233
+ parentId: z.ZodNullable<z.ZodString>;
234
+ children: z.ZodArray<z.ZodString>;
235
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
236
+ type: z.ZodLiteral<"Image">;
237
+ props: z.ZodObject<{
238
+ src: z.ZodString;
239
+ alt: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strip>;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ id: z.ZodString;
243
+ parentId: z.ZodNullable<z.ZodString>;
244
+ children: z.ZodArray<z.ZodString>;
245
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
246
+ type: z.ZodLiteral<"Button">;
247
+ props: z.ZodObject<{
248
+ label: z.ZodString;
249
+ href: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strip>;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ id: z.ZodString;
253
+ parentId: z.ZodNullable<z.ZodString>;
254
+ children: z.ZodArray<z.ZodString>;
255
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
256
+ type: z.ZodLiteral<"Container">;
257
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
258
+ }, z.core.$strip>, z.ZodObject<{
259
+ id: z.ZodString;
260
+ parentId: z.ZodNullable<z.ZodString>;
261
+ children: z.ZodArray<z.ZodString>;
262
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
263
+ type: z.ZodLiteral<"Input">;
264
+ props: z.ZodObject<{
265
+ label: z.ZodString;
266
+ placeholder: z.ZodOptional<z.ZodString>;
267
+ fieldType: z.ZodEnum<{
268
+ text: "text";
269
+ textarea: "textarea";
270
+ email: "email";
271
+ tel: "tel";
272
+ }>;
273
+ required: z.ZodOptional<z.ZodBoolean>;
274
+ }, z.core.$strip>;
275
+ }, z.core.$strip>, z.ZodObject<{
276
+ id: z.ZodString;
277
+ parentId: z.ZodNullable<z.ZodString>;
278
+ children: z.ZodArray<z.ZodString>;
279
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
280
+ type: z.ZodLiteral<"Embed">;
281
+ props: z.ZodObject<{
282
+ kind: z.ZodEnum<{
283
+ video: "video";
284
+ html: "html";
285
+ }>;
286
+ url: z.ZodOptional<z.ZodString>;
287
+ html: z.ZodOptional<z.ZodString>;
288
+ coverImage: z.ZodOptional<z.ZodString>;
289
+ }, z.core.$strip>;
290
+ }, z.core.$strip>, z.ZodObject<{
291
+ id: z.ZodString;
292
+ parentId: z.ZodNullable<z.ZodString>;
293
+ children: z.ZodArray<z.ZodString>;
294
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
295
+ type: z.ZodLiteral<"Menu">;
296
+ props: z.ZodObject<{
297
+ links: z.ZodArray<z.ZodObject<{
298
+ label: z.ZodString;
299
+ href: z.ZodString;
300
+ }, z.core.$strip>>;
301
+ layout: z.ZodEnum<{
302
+ horizontal: "horizontal";
303
+ vertical: "vertical";
304
+ }>;
305
+ }, z.core.$strip>;
306
+ }, z.core.$strip>], "type">>;
307
+ pageOrder: z.ZodArray<z.ZodString>;
308
+ }, z.core.$strip>;
309
+ export declare const AiCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
310
+ type: z.ZodLiteral<"insertSection">;
311
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
312
+ id: z.ZodString;
313
+ parentId: z.ZodNullable<z.ZodString>;
314
+ children: z.ZodArray<z.ZodString>;
315
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
316
+ type: z.ZodLiteral<"Section">;
317
+ props: z.ZodObject<{
318
+ name: z.ZodOptional<z.ZodString>;
319
+ }, z.core.$strip>;
320
+ }, z.core.$strip>, z.ZodObject<{
321
+ id: z.ZodString;
322
+ parentId: z.ZodNullable<z.ZodString>;
323
+ children: z.ZodArray<z.ZodString>;
324
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
325
+ type: z.ZodLiteral<"Text">;
326
+ props: z.ZodObject<{
327
+ content: z.ZodString;
328
+ }, z.core.$strip>;
329
+ }, z.core.$strip>, z.ZodObject<{
330
+ id: z.ZodString;
331
+ parentId: z.ZodNullable<z.ZodString>;
332
+ children: z.ZodArray<z.ZodString>;
333
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
334
+ type: z.ZodLiteral<"Image">;
335
+ props: z.ZodObject<{
336
+ src: z.ZodString;
337
+ alt: z.ZodOptional<z.ZodString>;
338
+ }, z.core.$strip>;
339
+ }, z.core.$strip>, z.ZodObject<{
340
+ id: z.ZodString;
341
+ parentId: z.ZodNullable<z.ZodString>;
342
+ children: z.ZodArray<z.ZodString>;
343
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
344
+ type: z.ZodLiteral<"Button">;
345
+ props: z.ZodObject<{
346
+ label: z.ZodString;
347
+ href: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ }, z.core.$strip>, z.ZodObject<{
350
+ id: z.ZodString;
351
+ parentId: z.ZodNullable<z.ZodString>;
352
+ children: z.ZodArray<z.ZodString>;
353
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
354
+ type: z.ZodLiteral<"Container">;
355
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
356
+ }, z.core.$strip>, z.ZodObject<{
357
+ id: z.ZodString;
358
+ parentId: z.ZodNullable<z.ZodString>;
359
+ children: z.ZodArray<z.ZodString>;
360
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
361
+ type: z.ZodLiteral<"Input">;
362
+ props: z.ZodObject<{
363
+ label: z.ZodString;
364
+ placeholder: z.ZodOptional<z.ZodString>;
365
+ fieldType: z.ZodEnum<{
366
+ text: "text";
367
+ textarea: "textarea";
368
+ email: "email";
369
+ tel: "tel";
370
+ }>;
371
+ required: z.ZodOptional<z.ZodBoolean>;
372
+ }, z.core.$strip>;
373
+ }, z.core.$strip>, z.ZodObject<{
374
+ id: z.ZodString;
375
+ parentId: z.ZodNullable<z.ZodString>;
376
+ children: z.ZodArray<z.ZodString>;
377
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
378
+ type: z.ZodLiteral<"Embed">;
379
+ props: z.ZodObject<{
380
+ kind: z.ZodEnum<{
381
+ video: "video";
382
+ html: "html";
383
+ }>;
384
+ url: z.ZodOptional<z.ZodString>;
385
+ html: z.ZodOptional<z.ZodString>;
386
+ coverImage: z.ZodOptional<z.ZodString>;
387
+ }, z.core.$strip>;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ id: z.ZodString;
390
+ parentId: z.ZodNullable<z.ZodString>;
391
+ children: z.ZodArray<z.ZodString>;
392
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
393
+ type: z.ZodLiteral<"Menu">;
394
+ props: z.ZodObject<{
395
+ links: z.ZodArray<z.ZodObject<{
396
+ label: z.ZodString;
397
+ href: z.ZodString;
398
+ }, z.core.$strip>>;
399
+ layout: z.ZodEnum<{
400
+ horizontal: "horizontal";
401
+ vertical: "vertical";
402
+ }>;
403
+ }, z.core.$strip>;
404
+ }, z.core.$strip>], "type">>;
405
+ sectionId: z.ZodString;
406
+ index: z.ZodOptional<z.ZodNumber>;
407
+ }, z.core.$strip>, z.ZodObject<{
408
+ type: z.ZodLiteral<"insertNode">;
409
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
410
+ id: z.ZodString;
411
+ parentId: z.ZodNullable<z.ZodString>;
412
+ children: z.ZodArray<z.ZodString>;
413
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
414
+ type: z.ZodLiteral<"Section">;
415
+ props: z.ZodObject<{
416
+ name: z.ZodOptional<z.ZodString>;
417
+ }, z.core.$strip>;
418
+ }, z.core.$strip>, z.ZodObject<{
419
+ id: z.ZodString;
420
+ parentId: z.ZodNullable<z.ZodString>;
421
+ children: z.ZodArray<z.ZodString>;
422
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
423
+ type: z.ZodLiteral<"Text">;
424
+ props: z.ZodObject<{
425
+ content: z.ZodString;
426
+ }, z.core.$strip>;
427
+ }, z.core.$strip>, z.ZodObject<{
428
+ id: z.ZodString;
429
+ parentId: z.ZodNullable<z.ZodString>;
430
+ children: z.ZodArray<z.ZodString>;
431
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
432
+ type: z.ZodLiteral<"Image">;
433
+ props: z.ZodObject<{
434
+ src: z.ZodString;
435
+ alt: z.ZodOptional<z.ZodString>;
436
+ }, z.core.$strip>;
437
+ }, z.core.$strip>, z.ZodObject<{
438
+ id: z.ZodString;
439
+ parentId: z.ZodNullable<z.ZodString>;
440
+ children: z.ZodArray<z.ZodString>;
441
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
442
+ type: z.ZodLiteral<"Button">;
443
+ props: z.ZodObject<{
444
+ label: z.ZodString;
445
+ href: z.ZodOptional<z.ZodString>;
446
+ }, z.core.$strip>;
447
+ }, z.core.$strip>, z.ZodObject<{
448
+ id: z.ZodString;
449
+ parentId: z.ZodNullable<z.ZodString>;
450
+ children: z.ZodArray<z.ZodString>;
451
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
452
+ type: z.ZodLiteral<"Container">;
453
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ id: z.ZodString;
456
+ parentId: z.ZodNullable<z.ZodString>;
457
+ children: z.ZodArray<z.ZodString>;
458
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
459
+ type: z.ZodLiteral<"Input">;
460
+ props: z.ZodObject<{
461
+ label: z.ZodString;
462
+ placeholder: z.ZodOptional<z.ZodString>;
463
+ fieldType: z.ZodEnum<{
464
+ text: "text";
465
+ textarea: "textarea";
466
+ email: "email";
467
+ tel: "tel";
468
+ }>;
469
+ required: z.ZodOptional<z.ZodBoolean>;
470
+ }, z.core.$strip>;
471
+ }, z.core.$strip>, z.ZodObject<{
472
+ id: z.ZodString;
473
+ parentId: z.ZodNullable<z.ZodString>;
474
+ children: z.ZodArray<z.ZodString>;
475
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
476
+ type: z.ZodLiteral<"Embed">;
477
+ props: z.ZodObject<{
478
+ kind: z.ZodEnum<{
479
+ video: "video";
480
+ html: "html";
481
+ }>;
482
+ url: z.ZodOptional<z.ZodString>;
483
+ html: z.ZodOptional<z.ZodString>;
484
+ coverImage: z.ZodOptional<z.ZodString>;
485
+ }, z.core.$strip>;
486
+ }, z.core.$strip>, z.ZodObject<{
487
+ id: z.ZodString;
488
+ parentId: z.ZodNullable<z.ZodString>;
489
+ children: z.ZodArray<z.ZodString>;
490
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
491
+ type: z.ZodLiteral<"Menu">;
492
+ props: z.ZodObject<{
493
+ links: z.ZodArray<z.ZodObject<{
494
+ label: z.ZodString;
495
+ href: z.ZodString;
496
+ }, z.core.$strip>>;
497
+ layout: z.ZodEnum<{
498
+ horizontal: "horizontal";
499
+ vertical: "vertical";
500
+ }>;
501
+ }, z.core.$strip>;
502
+ }, z.core.$strip>], "type">>;
503
+ nodeId: z.ZodString;
504
+ parentId: z.ZodString;
505
+ index: z.ZodOptional<z.ZodNumber>;
506
+ }, z.core.$strip>, z.ZodObject<{
507
+ type: z.ZodLiteral<"updateNode">;
508
+ id: z.ZodString;
509
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
510
+ styles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
511
+ }, z.core.$strip>, z.ZodObject<{
512
+ type: z.ZodLiteral<"deleteNode">;
513
+ id: z.ZodString;
514
+ }, z.core.$strip>, z.ZodObject<{
515
+ type: z.ZodLiteral<"replacePage">;
516
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
517
+ id: z.ZodString;
518
+ parentId: z.ZodNullable<z.ZodString>;
519
+ children: z.ZodArray<z.ZodString>;
520
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
521
+ type: z.ZodLiteral<"Section">;
522
+ props: z.ZodObject<{
523
+ name: z.ZodOptional<z.ZodString>;
524
+ }, z.core.$strip>;
525
+ }, z.core.$strip>, z.ZodObject<{
526
+ id: z.ZodString;
527
+ parentId: z.ZodNullable<z.ZodString>;
528
+ children: z.ZodArray<z.ZodString>;
529
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
530
+ type: z.ZodLiteral<"Text">;
531
+ props: z.ZodObject<{
532
+ content: z.ZodString;
533
+ }, z.core.$strip>;
534
+ }, z.core.$strip>, z.ZodObject<{
535
+ id: z.ZodString;
536
+ parentId: z.ZodNullable<z.ZodString>;
537
+ children: z.ZodArray<z.ZodString>;
538
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
539
+ type: z.ZodLiteral<"Image">;
540
+ props: z.ZodObject<{
541
+ src: z.ZodString;
542
+ alt: z.ZodOptional<z.ZodString>;
543
+ }, z.core.$strip>;
544
+ }, z.core.$strip>, z.ZodObject<{
545
+ id: z.ZodString;
546
+ parentId: z.ZodNullable<z.ZodString>;
547
+ children: z.ZodArray<z.ZodString>;
548
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
549
+ type: z.ZodLiteral<"Button">;
550
+ props: z.ZodObject<{
551
+ label: z.ZodString;
552
+ href: z.ZodOptional<z.ZodString>;
553
+ }, z.core.$strip>;
554
+ }, z.core.$strip>, z.ZodObject<{
555
+ id: z.ZodString;
556
+ parentId: z.ZodNullable<z.ZodString>;
557
+ children: z.ZodArray<z.ZodString>;
558
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
559
+ type: z.ZodLiteral<"Container">;
560
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
561
+ }, z.core.$strip>, z.ZodObject<{
562
+ id: z.ZodString;
563
+ parentId: z.ZodNullable<z.ZodString>;
564
+ children: z.ZodArray<z.ZodString>;
565
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
566
+ type: z.ZodLiteral<"Input">;
567
+ props: z.ZodObject<{
568
+ label: z.ZodString;
569
+ placeholder: z.ZodOptional<z.ZodString>;
570
+ fieldType: z.ZodEnum<{
571
+ text: "text";
572
+ textarea: "textarea";
573
+ email: "email";
574
+ tel: "tel";
575
+ }>;
576
+ required: z.ZodOptional<z.ZodBoolean>;
577
+ }, z.core.$strip>;
578
+ }, z.core.$strip>, z.ZodObject<{
579
+ id: z.ZodString;
580
+ parentId: z.ZodNullable<z.ZodString>;
581
+ children: z.ZodArray<z.ZodString>;
582
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
583
+ type: z.ZodLiteral<"Embed">;
584
+ props: z.ZodObject<{
585
+ kind: z.ZodEnum<{
586
+ video: "video";
587
+ html: "html";
588
+ }>;
589
+ url: z.ZodOptional<z.ZodString>;
590
+ html: z.ZodOptional<z.ZodString>;
591
+ coverImage: z.ZodOptional<z.ZodString>;
592
+ }, z.core.$strip>;
593
+ }, z.core.$strip>, z.ZodObject<{
594
+ id: z.ZodString;
595
+ parentId: z.ZodNullable<z.ZodString>;
596
+ children: z.ZodArray<z.ZodString>;
597
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
598
+ type: z.ZodLiteral<"Menu">;
599
+ props: z.ZodObject<{
600
+ links: z.ZodArray<z.ZodObject<{
601
+ label: z.ZodString;
602
+ href: z.ZodString;
603
+ }, z.core.$strip>>;
604
+ layout: z.ZodEnum<{
605
+ horizontal: "horizontal";
606
+ vertical: "vertical";
607
+ }>;
608
+ }, z.core.$strip>;
609
+ }, z.core.$strip>], "type">>;
610
+ pageOrder: z.ZodArray<z.ZodString>;
611
+ }, z.core.$strip>], "type">;
612
+ export type AiCommand = z.infer<typeof AiCommandSchema>;
613
+ export interface AiDispatchResult {
614
+ ok: boolean;
615
+ error?: string;
616
+ }
@@ -0,0 +1,24 @@
1
+ import type { CanvasState, PlexoNode } from '../store/types';
2
+ import { type AiCommand, type AiDispatchResult } from './commands';
3
+ export declare function collectDescendantIds(nodes: Record<string, PlexoNode>, id: string): string[];
4
+ /**
5
+ * Pure reducer: (current state, validated command) -> next state, or an error. No store
6
+ * access here — keeps this testable without Zustand and reusable if a future host
7
+ * (e.g. an MCP tool) wants to dry-run a command before committing it.
8
+ */
9
+ export declare function applyAiCommand(state: CanvasState, command: AiCommand): {
10
+ nodes: Record<string, PlexoNode>;
11
+ pageOrder: string[];
12
+ } | {
13
+ error: string;
14
+ };
15
+ /** Validates raw (untyped) JSON before it ever reaches applyAiCommand — this is the
16
+ * actual boundary an external AI agent's output crosses. */
17
+ export declare function parseAiCommand(raw: unknown): {
18
+ command: AiCommand;
19
+ } | {
20
+ error: string;
21
+ };
22
+ export declare function isDispatchError(result: AiDispatchResult): result is AiDispatchResult & {
23
+ error: string;
24
+ };