@charisol/plexo-sdk 1.4.42 → 2.0.1

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 (254) hide show
  1. package/README.md +72 -0
  2. package/dist/InlineColorPicker-8ewm1Asx.js +2912 -0
  3. package/dist/client-DlVJt_6V.js +339 -0
  4. package/dist/colorUtils-ohNG3v1i.js +222 -0
  5. package/dist/columnOrder-f5-VOg2T.js +11 -0
  6. package/dist/{compiler-BvseEhDC.js → compiler-Dhpsq71h.js} +121 -120
  7. package/dist/compiler.js +1 -1
  8. package/dist/{compilerClient-BIrZIgfG.js → compilerClient-BC4TGAr9.js} +93 -92
  9. package/dist/compilerClient.js +1 -1
  10. package/dist/{iconSvgStatic-CGue7nyp.js → iconSvgStatic-Lnpg27U9.js} +66 -75
  11. package/dist/index.js +14042 -15423
  12. package/dist/legacy-71dHsiAM.js +16088 -0
  13. package/dist/lint-D-2x-Yeb.js +225 -0
  14. package/dist/{mjmlBrowser-DWk0mRD6.js → mjmlBrowser-wlHcAT8n.js} +2 -2
  15. package/dist/plexo-sdk.css +1 -1
  16. package/dist/rolldown-runtime-B1bRi_D7.js +27 -0
  17. package/dist/sanitize.js +1 -1
  18. package/dist/{sanitizeCompiledHtml-CNjUXlMK.js → sanitizeCompiledHtml-GgGsetm3.js} +673 -698
  19. package/dist/{zoom-in-DL4pfiLG.js → schemas-Bq5o5MfF.js} +916 -2120
  20. package/dist/utilities/colorUtils.d.ts +35 -0
  21. package/dist/utilities/playground.interfaces.d.ts +19 -1
  22. package/dist/v2/V2Editor.d.ts +25 -0
  23. package/dist/v2/compile/build.d.ts +38 -0
  24. package/dist/v2/compile/html.d.ts +18 -0
  25. package/dist/v2/compile/index.d.ts +28 -15
  26. package/dist/v2/compile/react.d.ts +17 -0
  27. package/dist/v2/compile/schema.d.ts +16 -0
  28. package/dist/v2/components/canvas/AlignmentGuidesOverlay.d.ts +7 -0
  29. package/dist/v2/components/canvas/CanvasArea.d.ts +2 -0
  30. package/dist/v2/components/canvas/CanvasControls.d.ts +2 -0
  31. package/dist/v2/components/canvas/ContextualToolbar.d.ts +7 -0
  32. package/dist/v2/components/canvas/DropIndicator.d.ts +6 -0
  33. package/dist/v2/components/canvas/IrView.d.ts +12 -0
  34. package/dist/v2/components/canvas/NodeRenderer.d.ts +12 -0
  35. package/dist/v2/components/canvas/PageFrame.d.ts +9 -0
  36. package/dist/v2/components/canvas/ResizeHandles.d.ts +8 -0
  37. package/dist/v2/components/canvas/SectionToolbar.d.ts +6 -0
  38. package/dist/v2/components/canvas/SpacingOverlay.d.ts +7 -0
  39. package/dist/v2/components/design/AutoUpdateWatcher.d.ts +7 -0
  40. package/dist/v2/components/design/DesignSystemPanel.d.ts +7 -0
  41. package/dist/v2/components/design/ReviewView.d.ts +7 -0
  42. package/dist/v2/components/design/StrataCard.d.ts +8 -0
  43. package/dist/v2/components/design/TidyView.d.ts +15 -0
  44. package/dist/v2/components/design/bits.d.ts +20 -0
  45. package/dist/v2/components/design/useStrataSync.d.ts +51 -0
  46. package/dist/v2/components/layout/ContextMenu.d.ts +2 -0
  47. package/dist/v2/components/layout/EditorShell.d.ts +2 -0
  48. package/dist/v2/components/layout/LeftToolRail.d.ts +2 -0
  49. package/dist/v2/components/layout/PreviewOverlay.d.ts +6 -0
  50. package/dist/v2/components/layout/TopToolbar.d.ts +2 -0
  51. package/dist/v2/components/modals/SettingsModal.d.ts +7 -0
  52. package/dist/v2/components/modals/ShortcutsModal.d.ts +7 -0
  53. package/dist/v2/components/properties/ColorField.d.ts +14 -0
  54. package/dist/v2/components/properties/ElementSettings.d.ts +39 -0
  55. package/dist/v2/components/properties/LinkField.d.ts +26 -0
  56. package/dist/v2/components/properties/PageInspector.d.ts +2 -0
  57. package/dist/v2/components/properties/PropertiesPanel.d.ts +2 -0
  58. package/dist/v2/components/properties/SectionSettings.d.ts +6 -0
  59. package/dist/v2/components/properties/sections/ConstraintsSection.d.ts +7 -0
  60. package/dist/v2/components/properties/sections/LayoutDiagnostics.d.ts +7 -0
  61. package/dist/v2/components/sections/BlockInspector.d.ts +9 -0
  62. package/dist/v2/components/sections/FieldForm.d.ts +14 -0
  63. package/dist/v2/components/sections/ManagedChildNotice.d.ts +7 -0
  64. package/dist/v2/components/sections/SectionThumb.d.ts +11 -0
  65. package/dist/v2/components/sidebar/FlyoutDrawer.d.ts +2 -0
  66. package/dist/v2/components/sidebar/InsertPanel.d.ts +2 -0
  67. package/dist/v2/components/sidebar/LayersPanel.d.ts +2 -0
  68. package/dist/v2/components/sidebar/LibraryPanel.d.ts +3 -0
  69. package/dist/v2/components/sidebar/PagesPanel.d.ts +2 -0
  70. package/dist/v2/components/sidebar/SectionsPanel.d.ts +6 -0
  71. package/dist/v2/components/sidebar/SolPanel.d.ts +3 -0
  72. package/dist/v2/components/sidebar/TemplateChooser.d.ts +13 -0
  73. package/dist/v2/context/BlockContext.d.ts +7 -0
  74. package/dist/v2/context/EditorContext.d.ts +213 -0
  75. package/dist/v2/context/FrameContext.d.ts +3 -0
  76. package/dist/v2/context/ParentLayoutContext.d.ts +10 -0
  77. package/dist/v2/context/PlacementContext.d.ts +4 -0
  78. package/dist/v2/data/blankPage.d.ts +3 -0
  79. package/dist/v2/data/insertableComponents.d.ts +17 -0
  80. package/dist/v2/data/samplePageData.d.ts +3 -0
  81. package/dist/v2/design/audit.d.ts +78 -0
  82. package/dist/v2/design/baseline.d.ts +3 -0
  83. package/dist/v2/design/baselineData.d.ts +3 -0
  84. package/dist/v2/design/components.d.ts +9 -0
  85. package/dist/v2/design/css.d.ts +16 -0
  86. package/dist/v2/design/fonts.d.ts +10 -0
  87. package/dist/v2/design/index.d.ts +11 -0
  88. package/dist/v2/design/lint.d.ts +22 -0
  89. package/dist/v2/design/shades.d.ts +15 -0
  90. package/dist/v2/design/textStyles.d.ts +29 -0
  91. package/dist/v2/design/themes.d.ts +35 -0
  92. package/dist/v2/design/tokens.d.ts +24 -0
  93. package/dist/v2/design/types.d.ts +81 -0
  94. package/dist/v2/host/HostContext.d.ts +176 -0
  95. package/dist/v2/host/SolMark.d.ts +8 -0
  96. package/dist/v2/index.d.ts +19 -11
  97. package/dist/v2/migrate/legacy.d.ts +26 -0
  98. package/dist/v2/render/adapt.d.ts +12 -0
  99. package/dist/v2/render/anchors.d.ts +7 -0
  100. package/dist/v2/render/elementCss.d.ts +7 -0
  101. package/dist/v2/render/elementProps.d.ts +92 -0
  102. package/dist/v2/render/elements.d.ts +32 -0
  103. package/dist/v2/render/formAction.d.ts +33 -0
  104. package/dist/v2/render/frames.d.ts +10 -0
  105. package/dist/v2/render/iconSet.d.ts +5 -0
  106. package/dist/v2/render/ir.d.ts +20 -0
  107. package/dist/v2/render/nodeStyle.d.ts +24 -0
  108. package/dist/v2/render/placement.d.ts +12 -0
  109. package/dist/v2/render/resolve.d.ts +3 -0
  110. package/dist/v2/render/runtime.d.ts +18 -0
  111. package/dist/v2/render/sanitize.d.ts +15 -0
  112. package/dist/v2/render/socialIcons.d.ts +83 -0
  113. package/dist/v2/sections/catalog/about.d.ts +2 -0
  114. package/dist/v2/sections/catalog/announcement.d.ts +2 -0
  115. package/dist/v2/sections/catalog/contact.d.ts +2 -0
  116. package/dist/v2/sections/catalog/cta.d.ts +2 -0
  117. package/dist/v2/sections/catalog/faq.d.ts +2 -0
  118. package/dist/v2/sections/catalog/features.d.ts +2 -0
  119. package/dist/v2/sections/catalog/footer.d.ts +5 -0
  120. package/dist/v2/sections/catalog/gallery.d.ts +2 -0
  121. package/dist/v2/sections/catalog/header.d.ts +2 -0
  122. package/dist/v2/sections/catalog/hero.d.ts +2 -0
  123. package/dist/v2/sections/catalog/logos.d.ts +2 -0
  124. package/dist/v2/sections/catalog/pricing.d.ts +2 -0
  125. package/dist/v2/sections/catalog/stats.d.ts +2 -0
  126. package/dist/v2/sections/catalog/steps.d.ts +2 -0
  127. package/dist/v2/sections/catalog/team.d.ts +2 -0
  128. package/dist/v2/sections/catalog/testimonials.d.ts +2 -0
  129. package/dist/v2/sections/catalog/video.d.ts +2 -0
  130. package/dist/v2/sections/kit.d.ts +64 -0
  131. package/dist/v2/sections/materialize.d.ts +72 -0
  132. package/dist/v2/sections/pageTemplates.d.ts +52 -0
  133. package/dist/v2/sections/registry.d.ts +5 -0
  134. package/dist/v2/sections/types.d.ts +103 -0
  135. package/dist/v2/sol/catalogSchema.d.ts +43 -0
  136. package/dist/v2/sol/commands.d.ts +21 -0
  137. package/dist/v2/sol/describe.d.ts +32 -0
  138. package/dist/v2/sol/index.d.ts +7 -0
  139. package/dist/v2/sol/parse.d.ts +10 -0
  140. package/dist/v2/sol/prompt.d.ts +5 -0
  141. package/dist/v2/sol/schema.d.ts +177 -0
  142. package/dist/v2/sol/summarize.d.ts +4 -0
  143. package/dist/v2/strata/autoUpdate.d.ts +37 -0
  144. package/dist/v2/strata/client.d.ts +38 -0
  145. package/dist/v2/strata/index.d.ts +8 -0
  146. package/dist/v2/strata/merge.d.ts +27 -0
  147. package/dist/v2/strata/types.d.ts +115 -0
  148. package/dist/v2/types/editor.d.ts +175 -0
  149. package/dist/v2/utils/css.d.ts +3 -0
  150. package/dist/v2/utils/id.d.ts +3 -0
  151. package/dist/v2-compile.js +138 -7
  152. package/dist/v2-strata.js +2 -0
  153. package/dist/v2.js +10993 -8186
  154. package/package.json +6 -1
  155. package/dist/toReact-BBzjWoFG.js +0 -595
  156. package/dist/v2/ai/commands.d.ts +0 -616
  157. package/dist/v2/ai/dispatch.d.ts +0 -24
  158. package/dist/v2/ai/nodeSchema.d.ts +0 -196
  159. package/dist/v2/brand/BrandColorSwatches.d.ts +0 -4
  160. package/dist/v2/brand/BrandPanel.d.ts +0 -4
  161. package/dist/v2/brand/ChangeSetGallery.d.ts +0 -10
  162. package/dist/v2/brand/StyleSetEditor.d.ts +0 -22
  163. package/dist/v2/canvas/CatalogDragContext.d.ts +0 -27
  164. package/dist/v2/canvas/ContextMenuContext.d.ts +0 -16
  165. package/dist/v2/canvas/DeviceModeContext.d.ts +0 -20
  166. package/dist/v2/canvas/DragEngineContext.d.ts +0 -13
  167. package/dist/v2/canvas/LayoutGuideContext.d.ts +0 -22
  168. package/dist/v2/canvas/PreviewModeContext.d.ts +0 -15
  169. package/dist/v2/canvas/SidebarContext.d.ts +0 -21
  170. package/dist/v2/canvas/StylePainterContext.d.ts +0 -19
  171. package/dist/v2/canvas/WorkspaceThemeContext.d.ts +0 -19
  172. package/dist/v2/canvas/aiTextTransforms.d.ts +0 -24
  173. package/dist/v2/canvas/animationPresets.d.ts +0 -12
  174. package/dist/v2/canvas/constants.d.ts +0 -6
  175. package/dist/v2/canvas/layoutRoles.d.ts +0 -12
  176. package/dist/v2/canvas/modelRect.d.ts +0 -4
  177. package/dist/v2/canvas/rectMath.d.ts +0 -34
  178. package/dist/v2/canvas/reorderMath.d.ts +0 -8
  179. package/dist/v2/canvas/resizeMath.d.ts +0 -16
  180. package/dist/v2/canvas/resolveBoxStyle.d.ts +0 -12
  181. package/dist/v2/canvas/resolveTargetSection.d.ts +0 -10
  182. package/dist/v2/canvas/sectionDividerShapes.d.ts +0 -12
  183. package/dist/v2/canvas/snapping.d.ts +0 -28
  184. package/dist/v2/canvas/useAlignNode.d.ts +0 -10
  185. package/dist/v2/canvas/useClipboardKeyBinding.d.ts +0 -7
  186. package/dist/v2/canvas/useDeleteKeyBinding.d.ts +0 -3
  187. package/dist/v2/canvas/useDragEngine.d.ts +0 -44
  188. package/dist/v2/canvas/useDraggableNode.d.ts +0 -30
  189. package/dist/v2/canvas/useInlineTextEdit.d.ts +0 -29
  190. package/dist/v2/canvas/usePointerEngine.d.ts +0 -22
  191. package/dist/v2/canvas/useResizeHandle.d.ts +0 -12
  192. package/dist/v2/canvas/useResolvedTextStyles.d.ts +0 -13
  193. package/dist/v2/canvas/useSelectionRects.d.ts +0 -13
  194. package/dist/v2/canvas/useUndoRedoKeyBinding.d.ts +0 -8
  195. package/dist/v2/catalog/elementCatalog.d.ts +0 -31
  196. package/dist/v2/catalog/imagePreset.d.ts +0 -7
  197. package/dist/v2/compile/toReact.d.ts +0 -32
  198. package/dist/v2/components/AdornmentLayer.d.ts +0 -20
  199. package/dist/v2/components/AskSolPanel.d.ts +0 -25
  200. package/dist/v2/components/CatalogDragGhost.d.ts +0 -6
  201. package/dist/v2/components/CellBoundary.d.ts +0 -14
  202. package/dist/v2/components/CenterCanvas.d.ts +0 -3
  203. package/dist/v2/components/ContentTabPanel.d.ts +0 -12
  204. package/dist/v2/components/ContextMenu.d.ts +0 -5
  205. package/dist/v2/components/ContextualToolbar.d.ts +0 -25
  206. package/dist/v2/components/ImagesTabPanel.d.ts +0 -15
  207. package/dist/v2/components/LayoutGuidePanel.d.ts +0 -10
  208. package/dist/v2/components/ManageLayersPanel.d.ts +0 -13
  209. package/dist/v2/components/NodeRenderer.d.ts +0 -8
  210. package/dist/v2/components/PreviewOverlay.d.ts +0 -11
  211. package/dist/v2/components/ResizeHandle.d.ts +0 -6
  212. package/dist/v2/components/RightRail.d.ts +0 -13
  213. package/dist/v2/components/SectionDividerOverlay.d.ts +0 -8
  214. package/dist/v2/components/SectionEdgeAddZone.d.ts +0 -17
  215. package/dist/v2/components/SectionGridOverlay.d.ts +0 -10
  216. package/dist/v2/components/SectionNamePill.d.ts +0 -6
  217. package/dist/v2/components/SectionNode.d.ts +0 -5
  218. package/dist/v2/components/SectionSideRail.d.ts +0 -17
  219. package/dist/v2/components/SelectionToolbar.d.ts +0 -11
  220. package/dist/v2/components/StylePainterToast.d.ts +0 -5
  221. package/dist/v2/components/V2Canvas.d.ts +0 -59
  222. package/dist/v2/components/nodes/ButtonNode.d.ts +0 -4
  223. package/dist/v2/components/nodes/ContainerNode.d.ts +0 -11
  224. package/dist/v2/components/nodes/EmbedNode.d.ts +0 -4
  225. package/dist/v2/components/nodes/ImageNode.d.ts +0 -4
  226. package/dist/v2/components/nodes/InputNode.d.ts +0 -4
  227. package/dist/v2/components/nodes/MenuNode.d.ts +0 -18
  228. package/dist/v2/components/nodes/TextNode.d.ts +0 -4
  229. package/dist/v2/inspector/AiQuickEditPanel.d.ts +0 -12
  230. package/dist/v2/inspector/AnimationPanel.d.ts +0 -11
  231. package/dist/v2/inspector/DesignAccordions.d.ts +0 -7
  232. package/dist/v2/inspector/FieldRenderer.d.ts +0 -9
  233. package/dist/v2/inspector/IconPopoverButton.d.ts +0 -9
  234. package/dist/v2/inspector/MenuIconPanel.d.ts +0 -7
  235. package/dist/v2/inspector/MenuManagePanel.d.ts +0 -8
  236. package/dist/v2/inspector/Popover.d.ts +0 -21
  237. package/dist/v2/inspector/SectionDividerPanel.d.ts +0 -9
  238. package/dist/v2/inspector/fieldStyles.d.ts +0 -15
  239. package/dist/v2/inspector/fields/ColorField.d.ts +0 -7
  240. package/dist/v2/inspector/fields/NumberField.d.ts +0 -7
  241. package/dist/v2/inspector/fields/SelectField.d.ts +0 -7
  242. package/dist/v2/inspector/fields/TextField.d.ts +0 -7
  243. package/dist/v2/inspector/fields/TextStyleField.d.ts +0 -11
  244. package/dist/v2/inspector/fields/TextareaField.d.ts +0 -7
  245. package/dist/v2/inspector/schema.d.ts +0 -25
  246. package/dist/v2/inspector/useFieldCommit.d.ts +0 -12
  247. package/dist/v2/store/brandDefaults.d.ts +0 -4
  248. package/dist/v2/store/brandTypes.d.ts +0 -40
  249. package/dist/v2/store/cloneSubtree.d.ts +0 -12
  250. package/dist/v2/store/createBrandStore.d.ts +0 -2
  251. package/dist/v2/store/createCanvasStore.d.ts +0 -2
  252. package/dist/v2/store/seed.d.ts +0 -17
  253. package/dist/v2/store/types.d.ts +0 -163
  254. package/dist/v2/ui/theme.d.ts +0 -85
@@ -0,0 +1,177 @@
1
+ import { z } from 'zod';
2
+ export declare const addSectionSchema: z.ZodObject<{
3
+ index: z.ZodOptional<z.ZodNumber>;
4
+ afterSectionId: z.ZodOptional<z.ZodString>;
5
+ op: z.ZodLiteral<"addSection">;
6
+ pageId: z.ZodString;
7
+ kind: z.ZodString;
8
+ variant: z.ZodOptional<z.ZodString>;
9
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10
+ style: z.ZodOptional<z.ZodObject<{
11
+ background: z.ZodOptional<z.ZodEnum<{
12
+ image: "image";
13
+ canvas: "canvas";
14
+ primary: "primary";
15
+ surface: "surface";
16
+ sunken: "sunken";
17
+ inverted: "inverted";
18
+ gradient: "gradient";
19
+ }>>;
20
+ image: z.ZodOptional<z.ZodString>;
21
+ align: z.ZodOptional<z.ZodEnum<{
22
+ left: "left";
23
+ center: "center";
24
+ }>>;
25
+ spacing: z.ZodOptional<z.ZodEnum<{
26
+ normal: "normal";
27
+ tight: "tight";
28
+ airy: "airy";
29
+ }>>;
30
+ pinned: z.ZodOptional<z.ZodBoolean>;
31
+ }, z.core.$strict>>;
32
+ id: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>;
34
+ export declare const updateSectionSchema: z.ZodObject<{
35
+ op: z.ZodLiteral<"updateSection">;
36
+ sectionId: z.ZodString;
37
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
38
+ variant: z.ZodOptional<z.ZodString>;
39
+ style: z.ZodOptional<z.ZodObject<{
40
+ background: z.ZodOptional<z.ZodEnum<{
41
+ image: "image";
42
+ canvas: "canvas";
43
+ primary: "primary";
44
+ surface: "surface";
45
+ sunken: "sunken";
46
+ inverted: "inverted";
47
+ gradient: "gradient";
48
+ }>>;
49
+ image: z.ZodOptional<z.ZodString>;
50
+ align: z.ZodOptional<z.ZodEnum<{
51
+ left: "left";
52
+ center: "center";
53
+ }>>;
54
+ spacing: z.ZodOptional<z.ZodEnum<{
55
+ normal: "normal";
56
+ tight: "tight";
57
+ airy: "airy";
58
+ }>>;
59
+ pinned: z.ZodOptional<z.ZodBoolean>;
60
+ }, z.core.$strict>>;
61
+ }, z.core.$strip>;
62
+ export declare const removeSectionSchema: z.ZodObject<{
63
+ op: z.ZodLiteral<"removeSection">;
64
+ sectionId: z.ZodString;
65
+ }, z.core.$strip>;
66
+ export declare const moveSectionSchema: z.ZodObject<{
67
+ index: z.ZodOptional<z.ZodNumber>;
68
+ afterSectionId: z.ZodOptional<z.ZodString>;
69
+ op: z.ZodLiteral<"moveSection">;
70
+ sectionId: z.ZodString;
71
+ }, z.core.$strip>;
72
+ export declare const duplicateSectionSchema: z.ZodObject<{
73
+ op: z.ZodLiteral<"duplicateSection">;
74
+ sectionId: z.ZodString;
75
+ }, z.core.$strip>;
76
+ export declare const setBrandSchema: z.ZodObject<{
77
+ op: z.ZodLiteral<"setBrand">;
78
+ tokens: z.ZodRecord<z.ZodString, z.ZodString>;
79
+ }, z.core.$strip>;
80
+ export declare const addPageSchema: z.ZodObject<{
81
+ op: z.ZodLiteral<"addPage">;
82
+ name: z.ZodString;
83
+ templateId: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ export declare const renamePageSchema: z.ZodObject<{
86
+ op: z.ZodLiteral<"renamePage">;
87
+ pageId: z.ZodString;
88
+ name: z.ZodString;
89
+ }, z.core.$strip>;
90
+ export declare const solCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
91
+ index: z.ZodOptional<z.ZodNumber>;
92
+ afterSectionId: z.ZodOptional<z.ZodString>;
93
+ op: z.ZodLiteral<"addSection">;
94
+ pageId: z.ZodString;
95
+ kind: z.ZodString;
96
+ variant: z.ZodOptional<z.ZodString>;
97
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
98
+ style: z.ZodOptional<z.ZodObject<{
99
+ background: z.ZodOptional<z.ZodEnum<{
100
+ image: "image";
101
+ canvas: "canvas";
102
+ primary: "primary";
103
+ surface: "surface";
104
+ sunken: "sunken";
105
+ inverted: "inverted";
106
+ gradient: "gradient";
107
+ }>>;
108
+ image: z.ZodOptional<z.ZodString>;
109
+ align: z.ZodOptional<z.ZodEnum<{
110
+ left: "left";
111
+ center: "center";
112
+ }>>;
113
+ spacing: z.ZodOptional<z.ZodEnum<{
114
+ normal: "normal";
115
+ tight: "tight";
116
+ airy: "airy";
117
+ }>>;
118
+ pinned: z.ZodOptional<z.ZodBoolean>;
119
+ }, z.core.$strict>>;
120
+ id: z.ZodOptional<z.ZodString>;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ op: z.ZodLiteral<"updateSection">;
123
+ sectionId: z.ZodString;
124
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
125
+ variant: z.ZodOptional<z.ZodString>;
126
+ style: z.ZodOptional<z.ZodObject<{
127
+ background: z.ZodOptional<z.ZodEnum<{
128
+ image: "image";
129
+ canvas: "canvas";
130
+ primary: "primary";
131
+ surface: "surface";
132
+ sunken: "sunken";
133
+ inverted: "inverted";
134
+ gradient: "gradient";
135
+ }>>;
136
+ image: z.ZodOptional<z.ZodString>;
137
+ align: z.ZodOptional<z.ZodEnum<{
138
+ left: "left";
139
+ center: "center";
140
+ }>>;
141
+ spacing: z.ZodOptional<z.ZodEnum<{
142
+ normal: "normal";
143
+ tight: "tight";
144
+ airy: "airy";
145
+ }>>;
146
+ pinned: z.ZodOptional<z.ZodBoolean>;
147
+ }, z.core.$strict>>;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ op: z.ZodLiteral<"removeSection">;
150
+ sectionId: z.ZodString;
151
+ }, z.core.$strip>, z.ZodObject<{
152
+ index: z.ZodOptional<z.ZodNumber>;
153
+ afterSectionId: z.ZodOptional<z.ZodString>;
154
+ op: z.ZodLiteral<"moveSection">;
155
+ sectionId: z.ZodString;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ op: z.ZodLiteral<"duplicateSection">;
158
+ sectionId: z.ZodString;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ op: z.ZodLiteral<"setBrand">;
161
+ tokens: z.ZodRecord<z.ZodString, z.ZodString>;
162
+ }, z.core.$strip>, z.ZodObject<{
163
+ op: z.ZodLiteral<"addPage">;
164
+ name: z.ZodString;
165
+ templateId: z.ZodOptional<z.ZodString>;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ op: z.ZodLiteral<"renamePage">;
168
+ pageId: z.ZodString;
169
+ name: z.ZodString;
170
+ }, z.core.$strip>], "op">;
171
+ export type SolCommand = z.infer<typeof solCommandSchema>;
172
+ export type SolCommandOp = SolCommand['op'];
173
+ export interface CommandResult {
174
+ ok: boolean;
175
+ message: string; /** The section a command added or copied, so later steps can find it. */
176
+ sectionId?: string;
177
+ }
@@ -0,0 +1,4 @@
1
+ import type { PageDefinition } from '../types/editor';
2
+ import type { SolCommand } from './schema';
3
+ /** One plain-language line describing a suggested change, for the owner to read before agreeing to it. */
4
+ export declare function describeCommand(cmd: SolCommand, pages: PageDefinition[]): string;
@@ -0,0 +1,37 @@
1
+ import type { DesignSystem } from '../design/types';
2
+ import type { StrataSnapshot, SyncPlan } from './types';
3
+ export type AutoUpdateStatus = 'up-to-date' | 'safe-to-apply' | 'needs-review';
4
+ export interface AutoUpdateConflict {
5
+ id: string;
6
+ kind: 'token' | 'component';
7
+ /** Plain words for what disagrees. */
8
+ label: string;
9
+ }
10
+ export interface AutoUpdatePlan {
11
+ status: AutoUpdateStatus;
12
+ /** The design system with Strata's changes folded in. Only when `status` is `safe-to-apply`. */
13
+ merged?: DesignSystem;
14
+ /** Where Plexo and Strata disagree (a person has to choose). */
15
+ conflicts: AutoUpdateConflict[];
16
+ /** How many things Strata changed since the last sync. */
17
+ incoming: number;
18
+ /** Changes made here that Strata hasn't seen yet. */
19
+ unsynced: number;
20
+ /** Why it needs a review, in plain words. */
21
+ reason?: string;
22
+ plan: SyncPlan;
23
+ }
24
+ /**
25
+ * Decides whether Strata's latest can be applied without anyone looking, using the same three-way merge as a normal sync.
26
+ * `safe-to-apply` only when Strata changed something, nothing disagrees, and nothing made here and not yet sent would be
27
+ * lost or surprised; anything else is `needs-review` (or `up-to-date` when Strata has nothing new). Pure: a host's server
28
+ * job and the editor both call it.
29
+ *
30
+ * `base` is what both sides agreed on at the last sync (`design.strata.base`). Without one there is no common ancestor, so
31
+ * a first-time link always needs a person's eyes.
32
+ */
33
+ export declare function planAutoUpdate(input: {
34
+ local: DesignSystem;
35
+ base: NonNullable<DesignSystem['strata']>['base'] | undefined;
36
+ remote: StrataSnapshot;
37
+ }): AutoUpdatePlan;
@@ -0,0 +1,38 @@
1
+ import type { DesignComponent, DesignToken } from '../design/types';
2
+ import type { StrataProjectSummary, StrataPushPayload, StrataPushResult, StrataSnapshot } from './types';
3
+ export type StrataErrorKind = 'expired' | 'forbidden' | 'not_found' | 'conflict' | 'invalid' | 'network' | 'server';
4
+ /** An error from Strata, already in words a site owner can act on. */
5
+ export declare class StrataError extends Error {
6
+ readonly kind: StrataErrorKind;
7
+ readonly status: number;
8
+ readonly details?: unknown;
9
+ constructor(message: string, kind: StrataErrorKind, status?: number, details?: unknown);
10
+ }
11
+ export interface StrataClientOptions {
12
+ /** Strata's API root including the version, e.g. `https://api.strata.charisol.io/v1`. */
13
+ baseUrl: string;
14
+ /** The person's Strata session token. Called per request so a host can refresh it. */
15
+ getToken: () => string | null | Promise<string | null>;
16
+ fetch?: typeof fetch;
17
+ }
18
+ type Json = Record<string, any>;
19
+ export declare function tokenFromStrata(v: Json): DesignToken;
20
+ export declare function componentFromStrata(c: Json): DesignComponent;
21
+ export declare function projectFromStrata(p: Json): StrataProjectSummary;
22
+ /** Strata's REST API, for a host that holds the person's Strata session. React-free; works in a browser or on a server. */
23
+ export declare function createStrataClient(opts: StrataClientOptions): {
24
+ listProjects(): Promise<StrataProjectSummary[]>;
25
+ createProject(input: {
26
+ name: string;
27
+ template: "blank" | "base";
28
+ brandPrimary?: string;
29
+ }): Promise<StrataProjectSummary>;
30
+ pull(projectId: string): Promise<StrataSnapshot>;
31
+ push(projectId: string, payload: StrataPushPayload, baseRevision?: string): Promise<StrataPushResult>;
32
+ me(): Promise<{
33
+ email?: string;
34
+ name?: string;
35
+ }>;
36
+ };
37
+ export type StrataClient = ReturnType<typeof createStrataClient>;
38
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `@charisol/plexo-sdk/v2/strata` — keeping a Plexo design system in step with Strata. React-free: the editor uses the
3
+ * merge logic, and a host's server uses the REST client.
4
+ */
5
+ export * from './types';
6
+ export { planSync, applySync, hasAnything, summarize, baseOf } from './merge';
7
+ export { createStrataClient, StrataError, tokenFromStrata, componentFromStrata, projectFromStrata, type StrataClient, type StrataClientOptions, type StrataErrorKind } from './client';
8
+ export { planAutoUpdate, type AutoUpdatePlan, type AutoUpdateStatus, type AutoUpdateConflict } from './autoUpdate';
@@ -0,0 +1,27 @@
1
+ import type { DesignSystem } from '../design/types';
2
+ import type { AppliedSync, Resolutions, StrataSnapshot, SyncPlan } from './types';
3
+ export declare function baseOf(ds: DesignSystem): {
4
+ tokens: Record<string, string>;
5
+ components: Record<string, string>;
6
+ };
7
+ /**
8
+ * Compares Plexo's design system with Strata's, using what both had at the last sync as the common ancestor — which is
9
+ * what separates "you changed it" from "they changed it" from "you both did". Pure: it changes nothing.
10
+ */
11
+ export declare function planSync(local: DesignSystem, remote: StrataSnapshot): SyncPlan;
12
+ export declare const hasAnything: (p: SyncPlan) => boolean;
13
+ /** Counts for a one-line summary ("3 updates from Strata, 5 new in Plexo"). */
14
+ export declare function summarize(p: SyncPlan): {
15
+ incoming: number;
16
+ outgoing: number;
17
+ conflicts: number;
18
+ };
19
+ /**
20
+ * Carries out a plan. `direction` limits it: 'pull' takes only what came from Strata, 'push' only sends what's new here,
21
+ * 'both' does both. Conflicts go to Strata's side unless the person chose Plexo's (and on a first sync, Strata wins
22
+ * disagreements unless told otherwise — Strata is the source of truth).
23
+ */
24
+ export declare function applySync(local: DesignSystem, remote: StrataSnapshot, plan: SyncPlan, direction: 'pull' | 'push' | 'both', resolutions?: Resolutions, link?: {
25
+ projectId: string;
26
+ projectName?: string;
27
+ }): AppliedSync;
@@ -0,0 +1,115 @@
1
+ import type { DesignComponent, DesignSystem, DesignToken } from '../design/types';
2
+ /**
3
+ * What the editor needs from "Strata". The editor never talks to Strata itself — sign-in and tokens live on the host's
4
+ * server — it talks to this interface, which a host implements (plexo-web does, using the REST client in ./client).
5
+ */
6
+ export interface StrataProjectSummary {
7
+ id: string;
8
+ name: string;
9
+ description?: string | null;
10
+ /** What the signed-in person may do there. Absent = unknown (treated as able to edit; a refusal is explained when it happens). */
11
+ role?: 'owner' | 'editor' | 'viewer';
12
+ updatedAt?: string;
13
+ color?: string | null;
14
+ logo?: string | null;
15
+ }
16
+ export interface StrataStatus {
17
+ connected: boolean;
18
+ /** Signed in once, but the session ran out — one click to renew. */
19
+ expired?: boolean;
20
+ user?: {
21
+ email?: string;
22
+ name?: string;
23
+ };
24
+ }
25
+ /** A design system as Strata holds it. */
26
+ export interface StrataSnapshot {
27
+ /** Changes whenever the project's tokens or components do; sent back on a push to catch someone else's change. */
28
+ revision?: string;
29
+ tokens: DesignToken[];
30
+ components: DesignComponent[];
31
+ }
32
+ export interface StrataPushPayload {
33
+ variables: DesignToken[];
34
+ components: DesignComponent[];
35
+ deleteVariables?: string[];
36
+ }
37
+ export interface StrataPushResult {
38
+ revision?: string;
39
+ warnings?: Array<{
40
+ key?: string;
41
+ message: string;
42
+ }>;
43
+ }
44
+ export interface StrataAdapter {
45
+ status(): Promise<StrataStatus>;
46
+ /** Runs the sign-in (a popup that is silent when the person is already signed in to Charisol) and resolves once done. */
47
+ connect(): Promise<StrataStatus>;
48
+ disconnect(): Promise<void>;
49
+ listProjects(): Promise<StrataProjectSummary[]>;
50
+ /** `blank` = an empty project; `base` = Strata's starter set (optionally in the given brand colour). */
51
+ createProject(input: {
52
+ name: string;
53
+ template: 'blank' | 'base';
54
+ brandPrimary?: string;
55
+ }): Promise<StrataProjectSummary>;
56
+ pull(projectId: string): Promise<StrataSnapshot>;
57
+ push(projectId: string, payload: StrataPushPayload, baseRevision?: string): Promise<StrataPushResult>;
58
+ /**
59
+ * The host keeps the site up to date on its own server (the editor can't — it isn't open). Called when the person flips
60
+ * "Keep my website up to date with Strata"; reject with a plain-language message if it can't be turned on. Absent → the
61
+ * switch only applies each time the editor is opened.
62
+ */
63
+ setAutoUpdate?(projectId: string, enabled: boolean): Promise<void>;
64
+ /** How that server-side updating is going, in words for the owner ("Strata has changes that need your review…"). */
65
+ autoUpdateStatus?(): Promise<{
66
+ enabled: boolean;
67
+ ok: boolean;
68
+ message?: string;
69
+ }>;
70
+ }
71
+ /** A change to one token or component, for showing a person what a sync would do. */
72
+ export interface TokenChange {
73
+ key: string;
74
+ local?: DesignToken;
75
+ remote?: DesignToken;
76
+ }
77
+ export interface ComponentChange {
78
+ id: string;
79
+ name: string;
80
+ variant: string;
81
+ local?: DesignComponent;
82
+ remote?: DesignComponent;
83
+ }
84
+ export interface SyncPlan {
85
+ /** True when this design system has never been synced with this project (Strata then wins disagreements by default). */
86
+ firstSync: boolean;
87
+ tokens: {
88
+ /** Only changed in Strata: bring them into Plexo. */
89
+ incoming: TokenChange[];
90
+ /** Only changed (or added) in Plexo: send them to Strata. */
91
+ outgoing: TokenChange[];
92
+ /** Changed on both sides, differently. */
93
+ conflicts: TokenChange[];
94
+ /** Removed in Strata since the last sync (and untouched here). */
95
+ removedRemotely: TokenChange[];
96
+ /** Removed in Plexo since the last sync (and untouched in Strata). */
97
+ removedLocally: TokenChange[];
98
+ same: number;
99
+ };
100
+ components: {
101
+ incoming: ComponentChange[];
102
+ outgoing: ComponentChange[];
103
+ conflicts: ComponentChange[];
104
+ same: number;
105
+ };
106
+ }
107
+ export type Resolution = 'plexo' | 'strata';
108
+ export type Resolutions = Record<string, Resolution>;
109
+ export interface AppliedSync {
110
+ /** The design system after taking what came from Strata (and any conflicts resolved towards Strata). */
111
+ designSystem: DesignSystem;
112
+ /** What to send to Strata (and any conflicts resolved towards Plexo). Empty when nothing is outgoing. */
113
+ push: StrataPushPayload;
114
+ hasOutgoing: boolean;
115
+ }
@@ -0,0 +1,175 @@
1
+ import type { TextStyleId } from '../design/textStyles';
2
+ export type NodeType = 'page' | 'section' | 'container' | 'columns' | 'column' | 'heading' | 'paragraph' | 'button' | 'image' | 'badge' | 'divider' | 'spacer' | 'card' | 'icon' | 'carousel' | 'video' | 'social' | 'menu' | 'html' | 'table' | 'timer' | 'form' | 'accordion';
3
+ export type SizingMode = 'hug' | 'fill' | 'fixed';
4
+ export type LayoutMode = 'flow' | 'grid' | 'free';
5
+ export type HorizontalConstraint = 'left' | 'right' | 'center' | 'stretch' | 'scale';
6
+ export type VerticalConstraint = 'top' | 'bottom' | 'center' | 'stretch' | 'scale';
7
+ export interface ElementStyles {
8
+ layoutMode?: LayoutMode;
9
+ position?: 'static' | 'relative' | 'absolute';
10
+ x?: number;
11
+ y?: number;
12
+ zIndex?: number;
13
+ horizontalConstraint?: HorizontalConstraint;
14
+ verticalConstraint?: VerticalConstraint;
15
+ rightOffset?: number;
16
+ bottomOffset?: number;
17
+ centerOffsetX?: number;
18
+ centerOffsetY?: number;
19
+ scaleLeft?: number;
20
+ scaleWidth?: number;
21
+ scaleTop?: number;
22
+ scaleHeight?: number;
23
+ gridColumns?: number;
24
+ /** Unequal columns (`1.2fr 1fr`); overrides gridColumns' equal split. */
25
+ gridTemplateColumns?: string;
26
+ gridRows?: number;
27
+ gridColumnSpan?: number;
28
+ gridRowSpan?: number;
29
+ gridGap?: string;
30
+ widthSizing?: SizingMode;
31
+ heightSizing?: SizingMode;
32
+ stackOnMobile?: boolean;
33
+ flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
34
+ flexShrink?: number | string;
35
+ /** Sections only: stays at the top of the screen while the visitor scrolls (a sticky header). */
36
+ pinned?: boolean;
37
+ flexGrow?: number;
38
+ flexBasis?: string;
39
+ pointerEvents?: 'auto' | 'none' | 'inherit';
40
+ display?: 'block' | 'flex' | 'grid' | 'inline-block' | 'inline-flex';
41
+ flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
42
+ justifyContent?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around';
43
+ alignItems?: 'flex-start' | 'center' | 'flex-end' | 'stretch';
44
+ gap?: string;
45
+ width?: string;
46
+ customWidth?: string;
47
+ isFullWidth?: boolean;
48
+ maxWidth?: string;
49
+ height?: string;
50
+ minHeight?: string;
51
+ maxHeight?: string;
52
+ padding?: string;
53
+ paddingTop?: string;
54
+ paddingBottom?: string;
55
+ paddingLeft?: string;
56
+ paddingRight?: string;
57
+ margin?: string;
58
+ marginTop?: string;
59
+ marginBottom?: string;
60
+ marginLeft?: string;
61
+ marginRight?: string;
62
+ fontFamily?: string;
63
+ fontWeight?: string;
64
+ fontSize?: string;
65
+ fontSizeUnit?: string;
66
+ lineHeight?: string;
67
+ letterSpacing?: string;
68
+ textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
69
+ /** A named text style from the design system ("h1", "body"…). Explicit font settings on the element still win. */
70
+ textStyle?: TextStyleId;
71
+ textColor?: string;
72
+ textAlign?: 'left' | 'center' | 'right' | 'justify';
73
+ isBold?: boolean;
74
+ isItalic?: boolean;
75
+ isUnderline?: boolean;
76
+ backgroundColor?: string;
77
+ darkModeBackgroundColor?: string;
78
+ backgroundImage?: string;
79
+ /** A CSS gradient (e.g. `linear-gradient(135deg, var(--color-brand-primary-500), var(--color-brand-secondary-500))`). */
80
+ backgroundGradient?: string;
81
+ /** `16 / 9`, `1 / 1`… — keeps a box's shape while its width changes. */
82
+ aspectRatio?: string;
83
+ backgroundSize?: 'cover' | 'contain' | 'auto';
84
+ backgroundPosition?: string;
85
+ opacity?: number;
86
+ borderRadius?: string;
87
+ borderWidth?: string;
88
+ borderStyle?: 'solid' | 'dashed' | 'dotted' | 'none';
89
+ borderColor?: string;
90
+ boxShadow?: string;
91
+ linkColor?: string;
92
+ linkHoverColor?: string;
93
+ underlineLinks?: boolean;
94
+ underlineOnHover?: boolean;
95
+ horizontalAlign?: 'left' | 'center' | 'right';
96
+ customClasses?: string;
97
+ }
98
+ export interface ResponsiveOverrides {
99
+ tablet?: Partial<ElementStyles>;
100
+ mobile?: Partial<ElementStyles>;
101
+ }
102
+ export interface ResponsiveVisibility {
103
+ hideOnDesktop?: boolean;
104
+ hideOnTablet?: boolean;
105
+ hideOnMobile?: boolean;
106
+ }
107
+ export interface DocumentNode {
108
+ id: string;
109
+ type: NodeType;
110
+ name: string;
111
+ content?: string;
112
+ props?: {
113
+ href?: string;
114
+ alt?: string;
115
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
116
+ iconName?: string;
117
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
118
+ highlightText?: string;
119
+ [key: string]: any;
120
+ };
121
+ styles: ElementStyles;
122
+ responsive?: ResponsiveOverrides;
123
+ responsiveVisibility?: ResponsiveVisibility;
124
+ children?: DocumentNode[];
125
+ locked?: boolean;
126
+ hidden?: boolean;
127
+ }
128
+ export interface PageDefinition {
129
+ id: string;
130
+ name: string;
131
+ slug: string;
132
+ isHome?: boolean;
133
+ rootNode: DocumentNode;
134
+ }
135
+ export type ViewportMode = 'desktop' | 'tablet' | 'mobile';
136
+ export type LeftSidebarTab = 'sections' | 'add' | 'layers' | 'pages' | 'strata' | 'library' | 'sol' | 'insert';
137
+ export type ViewMode = 'design' | 'code' | 'json' | 'html' | 'plaintext';
138
+ export interface DragDropState {
139
+ draggingNodeId: string | null;
140
+ dropTargetId: string | null;
141
+ dropPosition: 'before' | 'after' | 'inside' | null;
142
+ isValidTarget: boolean;
143
+ }
144
+ export type CanvasToolMode = 'select' | 'hand';
145
+ export type CanvasViewMode = 'focused' | 'all';
146
+ export interface CanvasTransform {
147
+ panX: number;
148
+ panY: number;
149
+ zoom: number;
150
+ }
151
+ export interface AlignmentGuide {
152
+ type: 'x' | 'y';
153
+ position: number;
154
+ start: number;
155
+ end: number;
156
+ }
157
+ export interface ContextMenuState {
158
+ isOpen: boolean;
159
+ x: number;
160
+ y: number;
161
+ nodeId: string | null;
162
+ }
163
+ export interface MarqueeState {
164
+ isActive: boolean;
165
+ startX: number;
166
+ startY: number;
167
+ currentX: number;
168
+ currentY: number;
169
+ box: {
170
+ left: number;
171
+ top: number;
172
+ width: number;
173
+ height: number;
174
+ } | null;
175
+ }
@@ -0,0 +1,3 @@
1
+ /** A CSS `url("…")` that can't be broken out of: quotes, backslashes and newlines are escaped, so a
2
+ * hostile or just unusual address (parentheses, spaces) stays one value instead of adding declarations. */
3
+ export declare function cssUrl(address: string): string;
@@ -0,0 +1,3 @@
1
+ /** A node id that can't collide — not within one click (a duplicated subtree mints dozens in
2
+ * the same millisecond), nor across two editors or sessions editing the same design. */
3
+ export declare function newId(prefix?: string): string;