@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,196 @@
1
+ import { z } from 'zod';
2
+ export declare const SectionNodeSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ parentId: z.ZodNullable<z.ZodString>;
5
+ children: z.ZodArray<z.ZodString>;
6
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
7
+ type: z.ZodLiteral<"Section">;
8
+ props: z.ZodObject<{
9
+ name: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ }, z.core.$strip>;
12
+ export declare const TextNodeSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ parentId: z.ZodNullable<z.ZodString>;
15
+ children: z.ZodArray<z.ZodString>;
16
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
17
+ type: z.ZodLiteral<"Text">;
18
+ props: z.ZodObject<{
19
+ content: z.ZodString;
20
+ }, z.core.$strip>;
21
+ }, z.core.$strip>;
22
+ export declare const ImageNodeSchema: 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>;
33
+ export declare const ButtonNodeSchema: z.ZodObject<{
34
+ id: z.ZodString;
35
+ parentId: z.ZodNullable<z.ZodString>;
36
+ children: z.ZodArray<z.ZodString>;
37
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
38
+ type: z.ZodLiteral<"Button">;
39
+ props: z.ZodObject<{
40
+ label: z.ZodString;
41
+ href: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ }, z.core.$strip>;
44
+ export declare const ContainerNodeSchema: z.ZodObject<{
45
+ id: z.ZodString;
46
+ parentId: z.ZodNullable<z.ZodString>;
47
+ children: z.ZodArray<z.ZodString>;
48
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
49
+ type: z.ZodLiteral<"Container">;
50
+ props: z.ZodRecord<z.ZodString, z.ZodNever>;
51
+ }, z.core.$strip>;
52
+ export declare const InputNodeSchema: z.ZodObject<{
53
+ id: z.ZodString;
54
+ parentId: z.ZodNullable<z.ZodString>;
55
+ children: z.ZodArray<z.ZodString>;
56
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
57
+ type: z.ZodLiteral<"Input">;
58
+ props: z.ZodObject<{
59
+ label: z.ZodString;
60
+ placeholder: z.ZodOptional<z.ZodString>;
61
+ fieldType: z.ZodEnum<{
62
+ text: "text";
63
+ textarea: "textarea";
64
+ email: "email";
65
+ tel: "tel";
66
+ }>;
67
+ required: z.ZodOptional<z.ZodBoolean>;
68
+ }, z.core.$strip>;
69
+ }, z.core.$strip>;
70
+ export declare const EmbedNodeSchema: z.ZodObject<{
71
+ id: z.ZodString;
72
+ parentId: z.ZodNullable<z.ZodString>;
73
+ children: z.ZodArray<z.ZodString>;
74
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
75
+ type: z.ZodLiteral<"Embed">;
76
+ props: z.ZodObject<{
77
+ kind: z.ZodEnum<{
78
+ video: "video";
79
+ html: "html";
80
+ }>;
81
+ url: z.ZodOptional<z.ZodString>;
82
+ html: z.ZodOptional<z.ZodString>;
83
+ coverImage: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ }, z.core.$strip>;
86
+ export declare const MenuNodeSchema: z.ZodObject<{
87
+ id: z.ZodString;
88
+ parentId: z.ZodNullable<z.ZodString>;
89
+ children: z.ZodArray<z.ZodString>;
90
+ styles: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
91
+ type: z.ZodLiteral<"Menu">;
92
+ props: z.ZodObject<{
93
+ links: z.ZodArray<z.ZodObject<{
94
+ label: z.ZodString;
95
+ href: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ layout: z.ZodEnum<{
98
+ horizontal: "horizontal";
99
+ vertical: "vertical";
100
+ }>;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ export declare const PlexoNodeSchema: 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">;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const BrandColorSwatches: React.FC<{
3
+ onPick?: (hex: string) => void;
4
+ }>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ /** Site Brand — Colors / Text / Buttons / Boxes. Lines can follow the same
3
+ * StyleSetEditor pattern later (see the plan's fidelity-bar section). */
4
+ export declare const BrandPanel: React.FC;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { StyleSet } from '../store/brandTypes';
3
+ /** Reusable "wholesale style swap" gallery — the same interaction for Buttons, Boxes,
4
+ * and (later) Text/Lines: pick a whole pre-made set, not a single property. */
5
+ export declare const ChangeSetGallery: React.FC<{
6
+ sets: StyleSet[];
7
+ activeId: string;
8
+ onSelect: (id: string) => void;
9
+ renderPreview: (set: StyleSet) => React.ReactNode;
10
+ }>;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import type { StyleSet } from '../store/brandTypes';
3
+ /**
4
+ * The Buttons/Boxes half of the Brand Kit: a "Change Set" gallery to swap the whole
5
+ * style language, plus the active set's named slots (Primary/Secondary/… or Box 1/Box
6
+ * 2/…) each independently editable. Same three-part pattern the reference shows for
7
+ * every brand category (set gallery + named slots + a place to store custom variants —
8
+ * "Saved [buttons/boxes]" lands as a later enhancement once slots can be duplicated).
9
+ */
10
+ type SlotUpdater = (patch: Record<string, string | number>) => void;
11
+ export declare const StyleSetEditor: React.FC<{
12
+ sets: StyleSet[];
13
+ activeId: string;
14
+ onSelectSet: (id: string) => void;
15
+ onUpdateSlot: (setId: string, slotId: string, patch: Record<string, string | number>) => void;
16
+ renderSetPreview: (set: StyleSet) => React.ReactNode;
17
+ renderSlotPreview: (slot: StyleSet['slots'][number]) => React.ReactNode;
18
+ /** Defaults to a background-color + corner-radius pair (Buttons/Boxes); pass this to
19
+ * edit different fields (e.g. Text Styles' font size/weight). */
20
+ renderSlotEditor?: (slot: StyleSet['slots'][number], update: SlotUpdater) => React.ReactNode;
21
+ }>;
22
+ export {};
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import type { ElementPreset } from '../catalog/elementCatalog';
3
+ interface CatalogDragState {
4
+ preset: ElementPreset | null;
5
+ clientX: number;
6
+ clientY: number;
7
+ hoveredSectionId: string | null;
8
+ }
9
+ interface CatalogDragValue {
10
+ state: CatalogDragState;
11
+ /** Call from a preset tile's own onPointerDown. Does nothing visible until the
12
+ * pointer actually moves past a small threshold — short of that, an ordinary click
13
+ * on the tile still fires its own onClick (tap-to-add at the end of the page), so
14
+ * drag and tap coexist on the same tile without one stealing the other's gesture. */
15
+ armDrag: (preset: ElementPreset, e: React.PointerEvent) => void;
16
+ }
17
+ /**
18
+ * Real drag-and-drop from the Content tab onto the canvas — pick up a catalog preset,
19
+ * drop it into whichever section is under the pointer, positioned where you dropped it.
20
+ * Ephemeral UI-mode state, same pattern as ContextMenuContext/StylePainterContext/etc.
21
+ * Lives above both the sidebar (the drag source) and CenterCanvas (the drop target).
22
+ */
23
+ export declare const CatalogDragProvider: React.FC<{
24
+ children: React.ReactNode;
25
+ }>;
26
+ export declare function useCatalogDrag(): CatalogDragValue;
27
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export interface ContextMenuTarget {
3
+ nodeId: string;
4
+ x: number;
5
+ y: number;
6
+ }
7
+ interface ContextMenuContextValue {
8
+ target: ContextMenuTarget | null;
9
+ open: (nodeId: string, x: number, y: number) => void;
10
+ close: () => void;
11
+ }
12
+ export declare const ContextMenuProvider: React.FC<{
13
+ children: React.ReactNode;
14
+ }>;
15
+ export declare function useContextMenu(): ContextMenuContextValue;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ export type DeviceMode = 'desktop' | 'mobile';
3
+ interface DeviceModeValue {
4
+ mode: DeviceMode;
5
+ setMode: (m: DeviceMode) => void;
6
+ }
7
+ /** The canvas's current device-preview mode (desktop/mobile — the top bar's device
8
+ * switch), owned here (not CenterCanvas's own local state) so the switch itself — in
9
+ * the top toolbar, a sibling of CenterCanvas — can control it, and so any node whose
10
+ * *rendering itself* needs to change per device (a `Menu` node collapsing into a
11
+ * hamburger on mobile) can read it no matter how deep it sits in the tree. Provided
12
+ * with a sensible default at module scope so a node rendered outside the provider
13
+ * (e.g. PreviewOverlay, which has its own explicit width slider instead) still gets a
14
+ * safe 'desktop' read rather than needing its own guard. */
15
+ export declare const DeviceModeProvider: React.FC<{
16
+ children: React.ReactNode;
17
+ }>;
18
+ export declare function useDeviceMode(): DeviceMode;
19
+ export declare function useDeviceModeControl(): DeviceModeValue;
20
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface DragEngineContextValue {
3
+ startDrag: (id: string, e: {
4
+ clientX: number;
5
+ clientY: number;
6
+ }) => void;
7
+ }
8
+ export declare const DragEngineProvider: React.FC<{
9
+ value: DragEngineContextValue;
10
+ children: React.ReactNode;
11
+ }>;
12
+ /** Every draggable node (Text/Image/Button/Container, not Section) calls this on pointerdown. */
13
+ export declare function useDragEngineContext(): DragEngineContextValue;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export type GuideType = 'none' | 'columns' | 'blocks' | 'dots';
3
+ export type GuideVisibility = 'always' | 'drag';
4
+ interface LayoutGuideValue {
5
+ guideType: GuideType;
6
+ guideVisibility: GuideVisibility;
7
+ setGuideType: (t: GuideType) => void;
8
+ setGuideVisibility: (v: GuideVisibility) => void;
9
+ /** True whenever a pointer is held down anywhere on the canvas — the practical proxy
10
+ * for "a drag is happening" used by "Show guides: On drag only", without threading
11
+ * the move/resize drag engines' own local state through every Section. */
12
+ isPointerDown: boolean;
13
+ }
14
+ /** Editor-chrome preference (like ContextMenu/StylePainter's own ephemeral UI state) —
15
+ * not part of the document, so it doesn't touch undo history or get persisted with the
16
+ * page. Matches the reference's "Layout Guides" panel: None/Columns/Blocks/Dots, shown
17
+ * Always or only while dragging. */
18
+ export declare const LayoutGuideProvider: React.FC<{
19
+ children: React.ReactNode;
20
+ }>;
21
+ export declare function useLayoutGuide(): LayoutGuideValue;
22
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface PreviewModeValue {
3
+ active: boolean;
4
+ toggle: () => void;
5
+ exit: () => void;
6
+ }
7
+ /** Distraction-free preview: hides every piece of editor chrome (toolbars, rails, the
8
+ * Ask SOL panel, selection/resize adornments, section hover affordances) so what's left
9
+ * is exactly what a visitor would see. Ephemeral UI state, same pattern as
10
+ * ContextMenuContext/StylePainterContext/AskSolContext — not part of the document. */
11
+ export declare const PreviewModeProvider: React.FC<{
12
+ children: React.ReactNode;
13
+ }>;
14
+ export declare function usePreviewMode(): PreviewModeValue;
15
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export type SidebarTab = 'content' | 'sol' | 'images' | 'layers' | 'guides' | 'brand' | null;
3
+ interface SidebarValue {
4
+ activeTab: SidebarTab;
5
+ /** Set once by openTab's optional second argument, read (and cleared) by
6
+ * ContentTabPanel — lets a control outside the sidebar (e.g. Menu's "Explore
7
+ * Designs") jump the Content tab straight to a specific category. */
8
+ pendingCategory: string | null;
9
+ openTab: (tab: Exclude<SidebarTab, null>, category?: string) => void;
10
+ closeTab: () => void;
11
+ consumePendingCategory: () => void;
12
+ }
13
+ /** Which sidebar tab (Content/Layers/Layout Guides/Brand) is open — lifted above
14
+ * LeftRail so other chrome (ContextualToolbar's "Explore Designs") can open a
15
+ * specific tab/category without owning the sidebar's own state. Ephemeral UI mode,
16
+ * same pattern as ContextMenuContext/StylePainterContext/etc. */
17
+ export declare const SidebarProvider: React.FC<{
18
+ children: React.ReactNode;
19
+ }>;
20
+ export declare function useSidebar(): SidebarValue;
21
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ interface StylePainterValue {
3
+ isPainting: boolean;
4
+ copyStyle: (nodeId: string) => void;
5
+ applyTo: (nodeId: string) => void;
6
+ cancel: () => void;
7
+ }
8
+ /**
9
+ * Wix/Figma-style "format painter": Copy style on a node, then the next click on any
10
+ * other node applies that node's visual styles to it (one commit, one undo step) —
11
+ * matching the "Copy style" context-menu item shown in the reference. Lives as its own
12
+ * ephemeral UI-mode context (like ContextMenuContext) rather than in the canvas store,
13
+ * since "currently painting" isn't part of the document.
14
+ */
15
+ export declare const StylePainterProvider: React.FC<{
16
+ children: React.ReactNode;
17
+ }>;
18
+ export declare function useStylePainter(): StylePainterValue;
19
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ interface WorkspaceThemeValue {
3
+ dark: boolean;
4
+ toggle: () => void;
5
+ }
6
+ /**
7
+ * Light/dark toggle for the whole editor chrome — RightRail, its tabs and their
8
+ * active states, the top toolbar, every popover — plus the canvas workspace backdrop
9
+ * (the checkered artboard area behind the page card, see CenterCanvas.tsx). `ui/theme.
10
+ * ts`'s `color` tokens resolve through `var(--plexo-*)` custom properties; this
11
+ * provider is what actually sets those variables (via `getThemeStyle()`) on a root
12
+ * element, so every component that already reads `color.bg`/`color.text`/etc. becomes
13
+ * theme-reactive automatically, with no per-component changes needed.
14
+ */
15
+ export declare const WorkspaceThemeProvider: React.FC<{
16
+ children: React.ReactNode;
17
+ }>;
18
+ export declare function useWorkspaceTheme(): WorkspaceThemeValue;
19
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Deterministic, local text transforms backing Ask SOL's "Quick actions" on a Text
3
+ * node — genuinely applied to the node's real content (not a chat reply describing
4
+ * what to do), but honestly just heuristic string manipulation, not a real model call.
5
+ * Framed in the UI as "Quick edit", not "AI rewrite", for exactly that reason — see
6
+ * AskSolPanel.tsx's QUICK_ACTIONS. Pure and exported so they're unit-testable without
7
+ * mounting the panel.
8
+ */
9
+ declare const TONE_TEMPLATES: {
10
+ readonly friendly: (s: string) => string;
11
+ readonly professional: (s: string) => string;
12
+ readonly playful: (s: string) => string;
13
+ };
14
+ export type ToneKey = keyof typeof TONE_TEMPLATES;
15
+ /** 2-3 shortened variants, each a genuinely different cut (first clause, first N words,
16
+ * first sentence) rather than the same truncation three times. */
17
+ export declare function shortenVariants(text: string): string[];
18
+ /** 2-3 lengthened variants, each appending a different plausible closing clause. */
19
+ export declare function lengthenVariants(text: string): string[];
20
+ /** One cleaned-up variant: trims whitespace, fixes casing, ensures terminal punctuation. */
21
+ export declare function grammarFixVariants(text: string): string[];
22
+ /** One variant per requested tone. */
23
+ export declare function toneVariants(text: string, tones: ToneKey[]): string[];
24
+ export {};
@@ -0,0 +1,12 @@
1
+ export type AnimationType = 'none' | 'fade' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'zoom';
2
+ export type AnimationIntensity = 'gentle' | 'moderate' | 'intense';
3
+ /**
4
+ * Real Web Animations API keyframes (not a CSS class toggle) — played imperatively via
5
+ * `element.animate()` so "Preview" can replay on demand without needing a re-mount or a
6
+ * key-change hack. `null` for 'none' means "nothing to play," not "play a no-op."
7
+ */
8
+ export declare function getAnimationKeyframes(type: AnimationType, intensity: AnimationIntensity): {
9
+ keyframes: Keyframe[];
10
+ options: KeyframeAnimationOptions;
11
+ } | null;
12
+ export declare const ANIMATION_TYPE_LABELS: Record<AnimationType, string>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Deliberately distinct from V1's `data-plexo-id` (used by src/components/editor/frame/*
3
+ * for compiled-HTML overlays) even though the two never mount at once in the playground —
4
+ * keeps grep/DOM-query results unambiguous about which engine a hit belongs to.
5
+ */
6
+ export declare const V2_NODE_ID_ATTR = "data-plexo-v2-id";
@@ -0,0 +1,4 @@
1
+ import type { PlexoNode } from '../store/types';
2
+ import type { ModelRect } from './snapping';
3
+ /** Coerces a node's loose `styles` bag into the numeric rect the drag/snap engine needs. */
4
+ export declare function getModelRect(node: PlexoNode): ModelRect;
@@ -0,0 +1,34 @@
1
+ /** Minimal subset of DOMRect actually needed — keeps the math testable without a real DOM. */
2
+ export interface RectLike {
3
+ left: number;
4
+ top: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ /**
9
+ * Converts a node's viewport-relative rect into one relative to its canvas container.
10
+ * `getBoundingClientRect()` is always viewport-relative regardless of scroll position, so
11
+ * subtracting the container's own viewport-relative rect yields a value that already
12
+ * accounts for the container's current scroll offset with no manual scrollTop math —
13
+ * this is why the caller only needs to re-run this on scroll/resize, not track scroll
14
+ * position itself.
15
+ */
16
+ export declare function toRelativeRect(nodeRect: RectLike, containerRect: RectLike): RectLike;
17
+ declare const HANDLE_SIZE = 7;
18
+ export type HandleKey = 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se';
19
+ export interface HandlePosition {
20
+ key: HandleKey;
21
+ left: number;
22
+ top: number;
23
+ /** 'nwse' / 'nesw' corners resize both axes; 'ns' / 'ew' edges resize one axis only —
24
+ * Phase 3 uses this to decide which axis (or both) a given handle drag should affect,
25
+ * and it doubles as the CSS cursor family for that handle today. */
26
+ axis: 'both' | 'ns' | 'ew';
27
+ }
28
+ /**
29
+ * The 8 standard Figma/Wix resize handles — 4 corners (free resize) plus 4 edge
30
+ * midpoints (single-axis resize, e.g. dragging the left/right edge of a text box to
31
+ * change its width only) — in the same coordinate space as `rect`.
32
+ */
33
+ export declare function getResizeHandlePositions(rect: RectLike): HandlePosition[];
34
+ export { HANDLE_SIZE };
@@ -0,0 +1,8 @@
1
+ export type ZOrderDirection = 'forward' | 'backward' | 'front' | 'back';
2
+ /**
3
+ * Pure list reorder for z-order commands — operates on whichever list actually holds
4
+ * the id (a Section's `pageOrder`, or a non-Section node's parent.children). Returns
5
+ * null when the move is a no-op (already at that extreme), mirroring
6
+ * moveSectionUp/Down's boundary behavior so callers can skip an empty history commit.
7
+ */
8
+ export declare function reorderInList(list: string[], id: string, direction: ZOrderDirection): string[] | null;
@@ -0,0 +1,16 @@
1
+ import type { ModelRect } from './snapping';
2
+ import type { HandleKey } from './rectMath';
3
+ /**
4
+ * Given the node's rect at drag-start and the raw pointer delta since then, returns the
5
+ * patch to apply. Corners resize both axes and reposition x/y as needed (dragging the
6
+ * top-left corner right+down shrinks the box while sliding its origin); edges resize a
7
+ * single axis. Clamped to MIN_SIZE so a fast drag can't collapse a node to nothing or
8
+ * flip it inside-out.
9
+ */
10
+ export declare function computeResizePatch(handleKey: HandleKey, origin: ModelRect, dx: number, dy: number): Partial<Record<'x' | 'y' | 'width' | 'height', number>>;
11
+ /** Sections only resize vertically (they don't have a movable x/y — see AdornmentLayer),
12
+ * and only ever from the bottom edge: there's no y-coordinate for the top of a section
13
+ * to reposition against, unlike a freeform leaf/container node. */
14
+ export declare function computeSectionHeightPatch(originHeight: number, dy: number): {
15
+ height: number;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ import type { PlexoNode } from '../store/types';
3
+ export declare const SHADOW_PRESETS: Record<string, string>;
4
+ export declare const SHADOW_PRESET_OPTIONS: readonly ["none", "sm", "md", "lg"];
5
+ export declare const BORDER_STYLE_OPTIONS: readonly ["solid", "dashed", "dotted"];
6
+ /**
7
+ * Real Borders / Corners / Shadow support, shared by every leaf node component instead
8
+ * of each one reinventing its own subset — backs the Design popover's three accordion
9
+ * sections (see DesignAccordions.tsx). Reads the same loose `styles` bag every other
10
+ * style field already uses, so no schema change was needed to add this.
11
+ */
12
+ export declare function resolveBoxStyle(styles: PlexoNode['styles']): React.CSSProperties;
@@ -0,0 +1,10 @@
1
+ /** Where a tap-to-add item lands: the nearest Cell if the current selection is a cell
2
+ * or something living inside one (so it becomes a flex-item child of that cell, not
3
+ * an absolutely-positioned sibling stacked on top of the row — the two used to be
4
+ * conflated, which silently overlapped newly-added elements on top of a Cells row and
5
+ * made whichever one was selected impossible to click), else the Section the
6
+ * selection lives under, else the last section on the page, else a freshly-inserted
7
+ * blank one. Dragging an item instead lands exactly where dropped (see
8
+ * CatalogDragContext). Shared by every "tap to add" surface — the Content tab, the
9
+ * Images gallery. */
10
+ export declare function resolveTargetParentId(): string;
@@ -0,0 +1,12 @@
1
+ export type DividerShape = 'none' | 'ellipse' | 'tilt' | 'liquid' | 'leftWave' | 'paintScribble' | 'invertedEllipse';
2
+ export type DividerPlacement = 'top' | 'bottom';
3
+ /** One SVG path per shape, in a fixed 1200x120 viewBox scaled with
4
+ * `preserveAspectRatio="none"` to fill the section's full width — the standard
5
+ * approach for CSS/SVG "shape dividers". Approximations of the named shapes, not
6
+ * pixel-matches for a specific reference, but each one is visually distinct and
7
+ * recognizable as what its name says. */
8
+ export declare const DIVIDER_PATHS: Record<Exclude<DividerShape, 'none'>, string>;
9
+ export declare const DIVIDER_OPTIONS: Array<{
10
+ shape: DividerShape;
11
+ label: string;
12
+ }>;
@@ -0,0 +1,28 @@
1
+ export interface ModelRect {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export interface GuideLine {
8
+ orientation: 'vertical' | 'horizontal';
9
+ /** The x (vertical guide) or y (horizontal guide) position, in the same model space as ModelRect. */
10
+ position: number;
11
+ /** Span of the guide line, along the perpendicular axis. */
12
+ start: number;
13
+ end: number;
14
+ }
15
+ export interface SnapResult {
16
+ x: number;
17
+ y: number;
18
+ guides: GuideLine[];
19
+ }
20
+ /** How close (in model-space px) an edge/center needs to be to a sibling's before it snaps. */
21
+ export declare const SNAP_THRESHOLD = 5;
22
+ /**
23
+ * Compares the dragged node's candidate position against every sibling's edges/centers.
24
+ * The first sibling edge within SNAP_THRESHOLD on a given axis wins and overrides the
25
+ * mouse coordinate on that axis (the "Gravity Threshold" from the spec) — axes are
26
+ * independent, so a drag can snap horizontally without snapping vertically or vice versa.
27
+ */
28
+ export declare function findSnap(candidate: ModelRect, siblings: ModelRect[], threshold?: number): SnapResult;
@@ -0,0 +1,10 @@
1
+ import type { AlignDirection } from '../store/types';
2
+ /**
3
+ * Aligns a node relative to its parent's bounds. Sections don't store an explicit pixel
4
+ * width (they're 100%-wide by design), so there's no model-space value to align a
5
+ * Section's own children against — this reads the parent's *rendered* size via the DOM
6
+ * instead (querying by V2_NODE_ID_ATTR, the same identity attribute the rest of the
7
+ * canvas measurement code uses). Since the canvas has no zoom/scale applied, a DOM
8
+ * pixel is a model-space pixel, so this is exact, not an approximation.
9
+ */
10
+ export declare function useAlignNode(): (id: string, direction: AlignDirection) => void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Cmd/Ctrl+X/C/V/D on the current selection — matching the shortcut hints shown in the
3
+ * right-click menu (see ContextMenu.tsx). Skipped while focus is inside an editable
4
+ * Inspector field for the same reason as undo/redo: the browser's own cut/copy/paste on
5
+ * text input should win there, not a whole-node clipboard op.
6
+ */
7
+ export declare function useClipboardKeyBinding(): void;
@@ -0,0 +1,3 @@
1
+ /** Delete/Backspace removes the current selection — guarded against firing while the
2
+ * user is typing in an Inspector field (or anything else editable/contenteditable). */
3
+ export declare function useDeleteKeyBinding(): void;