@charisol/plexo-sdk 1.4.41 → 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 (256) 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/components/SolMark.d.ts +8 -0
  11. package/dist/{iconSvgStatic-CGue7nyp.js → iconSvgStatic-Lnpg27U9.js} +66 -75
  12. package/dist/index.js +13129 -14500
  13. package/dist/legacy-71dHsiAM.js +16088 -0
  14. package/dist/lint-D-2x-Yeb.js +225 -0
  15. package/dist/{mjmlBrowser-DWk0mRD6.js → mjmlBrowser-wlHcAT8n.js} +2 -2
  16. package/dist/plexo-sdk.css +1 -1
  17. package/dist/rolldown-runtime-B1bRi_D7.js +27 -0
  18. package/dist/sanitize.js +1 -1
  19. package/dist/{sanitizeCompiledHtml-CNjUXlMK.js → sanitizeCompiledHtml-GgGsetm3.js} +673 -698
  20. package/dist/{zoom-in-DL4pfiLG.js → schemas-Bq5o5MfF.js} +916 -2120
  21. package/dist/utilities/aiHelper.d.ts +4 -0
  22. package/dist/utilities/colorUtils.d.ts +35 -0
  23. package/dist/utilities/playground.interfaces.d.ts +24 -1
  24. package/dist/v2/V2Editor.d.ts +25 -0
  25. package/dist/v2/compile/build.d.ts +38 -0
  26. package/dist/v2/compile/html.d.ts +18 -0
  27. package/dist/v2/compile/index.d.ts +28 -15
  28. package/dist/v2/compile/react.d.ts +17 -0
  29. package/dist/v2/compile/schema.d.ts +16 -0
  30. package/dist/v2/components/canvas/AlignmentGuidesOverlay.d.ts +7 -0
  31. package/dist/v2/components/canvas/CanvasArea.d.ts +2 -0
  32. package/dist/v2/components/canvas/CanvasControls.d.ts +2 -0
  33. package/dist/v2/components/canvas/ContextualToolbar.d.ts +7 -0
  34. package/dist/v2/components/canvas/DropIndicator.d.ts +6 -0
  35. package/dist/v2/components/canvas/IrView.d.ts +12 -0
  36. package/dist/v2/components/canvas/NodeRenderer.d.ts +12 -0
  37. package/dist/v2/components/canvas/PageFrame.d.ts +9 -0
  38. package/dist/v2/components/canvas/ResizeHandles.d.ts +8 -0
  39. package/dist/v2/components/canvas/SectionToolbar.d.ts +6 -0
  40. package/dist/v2/components/canvas/SpacingOverlay.d.ts +7 -0
  41. package/dist/v2/components/design/AutoUpdateWatcher.d.ts +7 -0
  42. package/dist/v2/components/design/DesignSystemPanel.d.ts +7 -0
  43. package/dist/v2/components/design/ReviewView.d.ts +7 -0
  44. package/dist/v2/components/design/StrataCard.d.ts +8 -0
  45. package/dist/v2/components/design/TidyView.d.ts +15 -0
  46. package/dist/v2/components/design/bits.d.ts +20 -0
  47. package/dist/v2/components/design/useStrataSync.d.ts +51 -0
  48. package/dist/v2/components/layout/ContextMenu.d.ts +2 -0
  49. package/dist/v2/components/layout/EditorShell.d.ts +2 -0
  50. package/dist/v2/components/layout/LeftToolRail.d.ts +2 -0
  51. package/dist/v2/components/layout/PreviewOverlay.d.ts +6 -0
  52. package/dist/v2/components/layout/TopToolbar.d.ts +2 -0
  53. package/dist/v2/components/modals/SettingsModal.d.ts +7 -0
  54. package/dist/v2/components/modals/ShortcutsModal.d.ts +7 -0
  55. package/dist/v2/components/properties/ColorField.d.ts +14 -0
  56. package/dist/v2/components/properties/ElementSettings.d.ts +39 -0
  57. package/dist/v2/components/properties/LinkField.d.ts +26 -0
  58. package/dist/v2/components/properties/PageInspector.d.ts +2 -0
  59. package/dist/v2/components/properties/PropertiesPanel.d.ts +2 -0
  60. package/dist/v2/components/properties/SectionSettings.d.ts +6 -0
  61. package/dist/v2/components/properties/sections/ConstraintsSection.d.ts +7 -0
  62. package/dist/v2/components/properties/sections/LayoutDiagnostics.d.ts +7 -0
  63. package/dist/v2/components/sections/BlockInspector.d.ts +9 -0
  64. package/dist/v2/components/sections/FieldForm.d.ts +14 -0
  65. package/dist/v2/components/sections/ManagedChildNotice.d.ts +7 -0
  66. package/dist/v2/components/sections/SectionThumb.d.ts +11 -0
  67. package/dist/v2/components/sidebar/FlyoutDrawer.d.ts +2 -0
  68. package/dist/v2/components/sidebar/InsertPanel.d.ts +2 -0
  69. package/dist/v2/components/sidebar/LayersPanel.d.ts +2 -0
  70. package/dist/v2/components/sidebar/LibraryPanel.d.ts +3 -0
  71. package/dist/v2/components/sidebar/PagesPanel.d.ts +2 -0
  72. package/dist/v2/components/sidebar/SectionsPanel.d.ts +6 -0
  73. package/dist/v2/components/sidebar/SolPanel.d.ts +3 -0
  74. package/dist/v2/components/sidebar/TemplateChooser.d.ts +13 -0
  75. package/dist/v2/context/BlockContext.d.ts +7 -0
  76. package/dist/v2/context/EditorContext.d.ts +213 -0
  77. package/dist/v2/context/FrameContext.d.ts +3 -0
  78. package/dist/v2/context/ParentLayoutContext.d.ts +10 -0
  79. package/dist/v2/context/PlacementContext.d.ts +4 -0
  80. package/dist/v2/data/blankPage.d.ts +3 -0
  81. package/dist/v2/data/insertableComponents.d.ts +17 -0
  82. package/dist/v2/data/samplePageData.d.ts +3 -0
  83. package/dist/v2/design/audit.d.ts +78 -0
  84. package/dist/v2/design/baseline.d.ts +3 -0
  85. package/dist/v2/design/baselineData.d.ts +3 -0
  86. package/dist/v2/design/components.d.ts +9 -0
  87. package/dist/v2/design/css.d.ts +16 -0
  88. package/dist/v2/design/fonts.d.ts +10 -0
  89. package/dist/v2/design/index.d.ts +11 -0
  90. package/dist/v2/design/lint.d.ts +22 -0
  91. package/dist/v2/design/shades.d.ts +15 -0
  92. package/dist/v2/design/textStyles.d.ts +29 -0
  93. package/dist/v2/design/themes.d.ts +35 -0
  94. package/dist/v2/design/tokens.d.ts +24 -0
  95. package/dist/v2/design/types.d.ts +81 -0
  96. package/dist/v2/host/HostContext.d.ts +176 -0
  97. package/dist/v2/host/SolMark.d.ts +8 -0
  98. package/dist/v2/index.d.ts +19 -10
  99. package/dist/v2/migrate/legacy.d.ts +26 -0
  100. package/dist/v2/render/adapt.d.ts +12 -0
  101. package/dist/v2/render/anchors.d.ts +7 -0
  102. package/dist/v2/render/elementCss.d.ts +7 -0
  103. package/dist/v2/render/elementProps.d.ts +92 -0
  104. package/dist/v2/render/elements.d.ts +32 -0
  105. package/dist/v2/render/formAction.d.ts +33 -0
  106. package/dist/v2/render/frames.d.ts +10 -0
  107. package/dist/v2/render/iconSet.d.ts +5 -0
  108. package/dist/v2/render/ir.d.ts +20 -0
  109. package/dist/v2/render/nodeStyle.d.ts +24 -0
  110. package/dist/v2/render/placement.d.ts +12 -0
  111. package/dist/v2/render/resolve.d.ts +3 -0
  112. package/dist/v2/render/runtime.d.ts +18 -0
  113. package/dist/v2/render/sanitize.d.ts +15 -0
  114. package/dist/v2/render/socialIcons.d.ts +83 -0
  115. package/dist/v2/sections/catalog/about.d.ts +2 -0
  116. package/dist/v2/sections/catalog/announcement.d.ts +2 -0
  117. package/dist/v2/sections/catalog/contact.d.ts +2 -0
  118. package/dist/v2/sections/catalog/cta.d.ts +2 -0
  119. package/dist/v2/sections/catalog/faq.d.ts +2 -0
  120. package/dist/v2/sections/catalog/features.d.ts +2 -0
  121. package/dist/v2/sections/catalog/footer.d.ts +5 -0
  122. package/dist/v2/sections/catalog/gallery.d.ts +2 -0
  123. package/dist/v2/sections/catalog/header.d.ts +2 -0
  124. package/dist/v2/sections/catalog/hero.d.ts +2 -0
  125. package/dist/v2/sections/catalog/logos.d.ts +2 -0
  126. package/dist/v2/sections/catalog/pricing.d.ts +2 -0
  127. package/dist/v2/sections/catalog/stats.d.ts +2 -0
  128. package/dist/v2/sections/catalog/steps.d.ts +2 -0
  129. package/dist/v2/sections/catalog/team.d.ts +2 -0
  130. package/dist/v2/sections/catalog/testimonials.d.ts +2 -0
  131. package/dist/v2/sections/catalog/video.d.ts +2 -0
  132. package/dist/v2/sections/kit.d.ts +64 -0
  133. package/dist/v2/sections/materialize.d.ts +72 -0
  134. package/dist/v2/sections/pageTemplates.d.ts +52 -0
  135. package/dist/v2/sections/registry.d.ts +5 -0
  136. package/dist/v2/sections/types.d.ts +103 -0
  137. package/dist/v2/sol/catalogSchema.d.ts +43 -0
  138. package/dist/v2/sol/commands.d.ts +21 -0
  139. package/dist/v2/sol/describe.d.ts +32 -0
  140. package/dist/v2/sol/index.d.ts +7 -0
  141. package/dist/v2/sol/parse.d.ts +10 -0
  142. package/dist/v2/sol/prompt.d.ts +5 -0
  143. package/dist/v2/sol/schema.d.ts +177 -0
  144. package/dist/v2/sol/summarize.d.ts +4 -0
  145. package/dist/v2/strata/autoUpdate.d.ts +37 -0
  146. package/dist/v2/strata/client.d.ts +38 -0
  147. package/dist/v2/strata/index.d.ts +8 -0
  148. package/dist/v2/strata/merge.d.ts +27 -0
  149. package/dist/v2/strata/types.d.ts +115 -0
  150. package/dist/v2/types/editor.d.ts +175 -0
  151. package/dist/v2/utils/css.d.ts +3 -0
  152. package/dist/v2/utils/id.d.ts +3 -0
  153. package/dist/v2-compile.js +138 -7
  154. package/dist/v2-strata.js +2 -0
  155. package/dist/v2.js +10979 -8145
  156. package/package.json +6 -1
  157. package/dist/toReact-BBzjWoFG.js +0 -595
  158. package/dist/v2/ai/commands.d.ts +0 -616
  159. package/dist/v2/ai/dispatch.d.ts +0 -24
  160. package/dist/v2/ai/nodeSchema.d.ts +0 -196
  161. package/dist/v2/brand/BrandColorSwatches.d.ts +0 -4
  162. package/dist/v2/brand/BrandPanel.d.ts +0 -4
  163. package/dist/v2/brand/ChangeSetGallery.d.ts +0 -10
  164. package/dist/v2/brand/StyleSetEditor.d.ts +0 -22
  165. package/dist/v2/canvas/CatalogDragContext.d.ts +0 -27
  166. package/dist/v2/canvas/ContextMenuContext.d.ts +0 -16
  167. package/dist/v2/canvas/DeviceModeContext.d.ts +0 -20
  168. package/dist/v2/canvas/DragEngineContext.d.ts +0 -13
  169. package/dist/v2/canvas/LayoutGuideContext.d.ts +0 -22
  170. package/dist/v2/canvas/PreviewModeContext.d.ts +0 -15
  171. package/dist/v2/canvas/SidebarContext.d.ts +0 -21
  172. package/dist/v2/canvas/StylePainterContext.d.ts +0 -19
  173. package/dist/v2/canvas/WorkspaceThemeContext.d.ts +0 -19
  174. package/dist/v2/canvas/aiTextTransforms.d.ts +0 -24
  175. package/dist/v2/canvas/animationPresets.d.ts +0 -12
  176. package/dist/v2/canvas/constants.d.ts +0 -6
  177. package/dist/v2/canvas/layoutRoles.d.ts +0 -12
  178. package/dist/v2/canvas/modelRect.d.ts +0 -4
  179. package/dist/v2/canvas/rectMath.d.ts +0 -34
  180. package/dist/v2/canvas/reorderMath.d.ts +0 -8
  181. package/dist/v2/canvas/resizeMath.d.ts +0 -16
  182. package/dist/v2/canvas/resolveBoxStyle.d.ts +0 -12
  183. package/dist/v2/canvas/resolveTargetSection.d.ts +0 -10
  184. package/dist/v2/canvas/sectionDividerShapes.d.ts +0 -12
  185. package/dist/v2/canvas/snapping.d.ts +0 -28
  186. package/dist/v2/canvas/useAlignNode.d.ts +0 -10
  187. package/dist/v2/canvas/useClipboardKeyBinding.d.ts +0 -7
  188. package/dist/v2/canvas/useDeleteKeyBinding.d.ts +0 -3
  189. package/dist/v2/canvas/useDragEngine.d.ts +0 -44
  190. package/dist/v2/canvas/useDraggableNode.d.ts +0 -30
  191. package/dist/v2/canvas/useInlineTextEdit.d.ts +0 -29
  192. package/dist/v2/canvas/usePointerEngine.d.ts +0 -22
  193. package/dist/v2/canvas/useResizeHandle.d.ts +0 -12
  194. package/dist/v2/canvas/useResolvedTextStyles.d.ts +0 -13
  195. package/dist/v2/canvas/useSelectionRects.d.ts +0 -13
  196. package/dist/v2/canvas/useUndoRedoKeyBinding.d.ts +0 -8
  197. package/dist/v2/catalog/elementCatalog.d.ts +0 -31
  198. package/dist/v2/catalog/imagePreset.d.ts +0 -7
  199. package/dist/v2/compile/toReact.d.ts +0 -32
  200. package/dist/v2/components/AdornmentLayer.d.ts +0 -20
  201. package/dist/v2/components/AskSolPanel.d.ts +0 -19
  202. package/dist/v2/components/CatalogDragGhost.d.ts +0 -6
  203. package/dist/v2/components/CellBoundary.d.ts +0 -14
  204. package/dist/v2/components/CenterCanvas.d.ts +0 -3
  205. package/dist/v2/components/ContentTabPanel.d.ts +0 -12
  206. package/dist/v2/components/ContextMenu.d.ts +0 -5
  207. package/dist/v2/components/ContextualToolbar.d.ts +0 -25
  208. package/dist/v2/components/ImagesTabPanel.d.ts +0 -15
  209. package/dist/v2/components/LayoutGuidePanel.d.ts +0 -10
  210. package/dist/v2/components/ManageLayersPanel.d.ts +0 -13
  211. package/dist/v2/components/NodeRenderer.d.ts +0 -8
  212. package/dist/v2/components/PreviewOverlay.d.ts +0 -11
  213. package/dist/v2/components/ResizeHandle.d.ts +0 -6
  214. package/dist/v2/components/RightRail.d.ts +0 -13
  215. package/dist/v2/components/SectionDividerOverlay.d.ts +0 -8
  216. package/dist/v2/components/SectionEdgeAddZone.d.ts +0 -17
  217. package/dist/v2/components/SectionGridOverlay.d.ts +0 -10
  218. package/dist/v2/components/SectionNamePill.d.ts +0 -6
  219. package/dist/v2/components/SectionNode.d.ts +0 -5
  220. package/dist/v2/components/SectionSideRail.d.ts +0 -17
  221. package/dist/v2/components/SelectionToolbar.d.ts +0 -11
  222. package/dist/v2/components/StylePainterToast.d.ts +0 -5
  223. package/dist/v2/components/V2Canvas.d.ts +0 -56
  224. package/dist/v2/components/nodes/ButtonNode.d.ts +0 -4
  225. package/dist/v2/components/nodes/ContainerNode.d.ts +0 -11
  226. package/dist/v2/components/nodes/EmbedNode.d.ts +0 -4
  227. package/dist/v2/components/nodes/ImageNode.d.ts +0 -4
  228. package/dist/v2/components/nodes/InputNode.d.ts +0 -4
  229. package/dist/v2/components/nodes/MenuNode.d.ts +0 -18
  230. package/dist/v2/components/nodes/TextNode.d.ts +0 -4
  231. package/dist/v2/inspector/AiQuickEditPanel.d.ts +0 -12
  232. package/dist/v2/inspector/AnimationPanel.d.ts +0 -11
  233. package/dist/v2/inspector/DesignAccordions.d.ts +0 -7
  234. package/dist/v2/inspector/FieldRenderer.d.ts +0 -9
  235. package/dist/v2/inspector/IconPopoverButton.d.ts +0 -9
  236. package/dist/v2/inspector/MenuIconPanel.d.ts +0 -7
  237. package/dist/v2/inspector/MenuManagePanel.d.ts +0 -8
  238. package/dist/v2/inspector/Popover.d.ts +0 -21
  239. package/dist/v2/inspector/SectionDividerPanel.d.ts +0 -9
  240. package/dist/v2/inspector/fieldStyles.d.ts +0 -15
  241. package/dist/v2/inspector/fields/ColorField.d.ts +0 -7
  242. package/dist/v2/inspector/fields/NumberField.d.ts +0 -7
  243. package/dist/v2/inspector/fields/SelectField.d.ts +0 -7
  244. package/dist/v2/inspector/fields/TextField.d.ts +0 -7
  245. package/dist/v2/inspector/fields/TextStyleField.d.ts +0 -11
  246. package/dist/v2/inspector/fields/TextareaField.d.ts +0 -7
  247. package/dist/v2/inspector/schema.d.ts +0 -25
  248. package/dist/v2/inspector/useFieldCommit.d.ts +0 -12
  249. package/dist/v2/store/brandDefaults.d.ts +0 -4
  250. package/dist/v2/store/brandTypes.d.ts +0 -40
  251. package/dist/v2/store/cloneSubtree.d.ts +0 -12
  252. package/dist/v2/store/createBrandStore.d.ts +0 -2
  253. package/dist/v2/store/createCanvasStore.d.ts +0 -2
  254. package/dist/v2/store/seed.d.ts +0 -17
  255. package/dist/v2/store/types.d.ts +0 -163
  256. package/dist/v2/ui/theme.d.ts +0 -85
@@ -22,6 +22,10 @@ export interface AIActionResponse {
22
22
  summary: string;
23
23
  result: ElementJSON | TemplateJSON;
24
24
  }
25
+ /** Thrown when the account has run out of AI credits for SOL (HTTP 402). */
26
+ export declare class AiCreditsExhaustedError extends Error {
27
+ }
28
+ export declare function setAiCreditsExhaustedHandler(handler: (() => void) | null): void;
25
29
  /**
26
30
  * All provider-specific logic (model resolution, structured-output handling, JSON
27
31
  * validation) lives server-side now — this is a thin HTTP client. The raw provider key
@@ -4,3 +4,38 @@
4
4
  * background can't be parsed (e.g. it's a CSS variable, gradient, or unsupported format).
5
5
  */
6
6
  export declare function getContrastTextColor(backgroundColor: string, fallback?: string): string;
7
+ export interface RGBA {
8
+ r: number;
9
+ g: number;
10
+ b: number;
11
+ a: number;
12
+ }
13
+ export interface HSV {
14
+ h: number;
15
+ s: number;
16
+ v: number;
17
+ }
18
+ export declare function hslToRgb(h: number, s: number, l: number): {
19
+ r: number;
20
+ g: number;
21
+ b: number;
22
+ };
23
+ /** Reads a color a person typed or pasted. Returns null when it isn't a color we understand. */
24
+ export declare function parseColor(input: string | undefined | null): RGBA | null;
25
+ export declare function toHex({ r, g, b, a }: RGBA): string;
26
+ export declare function toRgbaString({ r, g, b, a }: RGBA): string;
27
+ export declare function rgbToHsv(r: number, g: number, b: number): HSV;
28
+ export declare function hsvToRgb(h: number, s: number, v: number): {
29
+ r: number;
30
+ g: number;
31
+ b: number;
32
+ };
33
+ /**
34
+ * HSV for a color, keeping what the colour itself can't say: a grey, black or white has no hue (and black no
35
+ * saturation), so reading it back would snap the hue handle to 0. Carry the previous hue/saturation through instead.
36
+ */
37
+ export declare function hsvFor(rgb: {
38
+ r: number;
39
+ g: number;
40
+ b: number;
41
+ }, previous?: HSV): HSV;
@@ -166,6 +166,11 @@ export interface PlexoBuilderProps {
166
166
  * this id to know whose account to check/charge. Ignored for System AI/BYOK keys.
167
167
  */
168
168
  externalUserId?: string;
169
+ /**
170
+ * Called when an AI action (SOL) is refused because the account is out of AI credits —
171
+ * lets the host show its own top-up right away. The action still reports the error inline.
172
+ */
173
+ onAiCreditsExhausted?: () => void;
169
174
  /**
170
175
  * Subscription plan is resolved server-side from the apiKey.
171
176
  * External consumers should NOT pass this prop — it will be ignored.
@@ -379,11 +384,29 @@ export interface CustomSelectProps {
379
384
  closeOnSelect?: boolean;
380
385
  }
381
386
  export interface InlineColorPickerProps {
382
- label: string;
387
+ /** Row label. Omit it (with `compact`) when the surrounding panel already labels the field. */
388
+ label?: string;
383
389
  value: string;
384
390
  onChange: (val: string) => void;
385
391
  textColor?: string;
386
392
  backgroundColor?: string;
393
+ /** One tight row — swatch and colour code — for narrow inspectors, with no label or row padding. */
394
+ compact?: boolean;
395
+ /** Accent for focus rings and the active switch (defaults to the builder theme accent). */
396
+ accentColor?: string;
397
+ /** Ready-made colours to offer, such as a brand palette from the host. */
398
+ swatches?: string[];
399
+ /**
400
+ * Named design-system colours. Choosing one stores `value` (a reference like `var(--color-brand-primary-500)`) rather than
401
+ * a fixed colour, so changing the brand later restyles everything that used it. `color` is what to show for it.
402
+ */
403
+ tokens?: Array<{
404
+ label: string;
405
+ value: string;
406
+ color: string;
407
+ }>;
408
+ /** Turns a stored reference into a concrete colour for display and editing (needed when values may be references). */
409
+ resolve?: (value: string) => string | undefined;
387
410
  }
388
411
  export interface InlineAlignmentProps {
389
412
  label: string;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { type EditorProviderProps } from './context/EditorContext';
3
+ import { type V2HostConfig } from './host/HostContext';
4
+ import type { PageDefinition } from './types/editor';
5
+ import type { DesignSystem } from './design/types';
6
+ export type V2EditorProps = Omit<EditorProviderProps, 'children'> & V2HostConfig & {
7
+ className?: string;
8
+ };
9
+ /** Imperative handle, mirroring V1's PlexoBuilderRef. */
10
+ export interface V2EditorRef {
11
+ /** Every page, including edits not yet reported through onChange. */
12
+ getPages: () => PageDefinition[];
13
+ /** The design system as it is now. */
14
+ getDesignSystem: () => DesignSystem;
15
+ /** On-screen rect of a node by id (null if not rendered) — for host UI anchored to the canvas, e.g. comment pins. */
16
+ getNodeRect: (nodeId: string) => DOMRect | null;
17
+ }
18
+ /**
19
+ * The V2 visual editor. With no props it opens a blank page and works offline; pass `pages` to edit
20
+ * an existing design and `onChange`/`onSave` to persist it. Mounted under `.plexo-editor` so the SDK's
21
+ * scoped styles apply and nothing leaks into (or out of) the host page. Fills its container.
22
+ */
23
+ export declare const V2Editor: React.ForwardRefExoticComponent<Omit<EditorProviderProps, "children"> & V2HostConfig & {
24
+ className?: string;
25
+ } & React.RefAttributes<V2EditorRef>>;
@@ -0,0 +1,38 @@
1
+ import type { PageDefinition } from '../types/editor';
2
+ import { type FormDestinationConfig } from '../render/formAction';
3
+ import { type HNode } from '../render/ir';
4
+ import type { DesignSystem } from '../design/types';
5
+ export interface CompileOptions extends FormDestinationConfig {
6
+ /** `<title>` of the full document. */
7
+ title?: string;
8
+ lang?: string;
9
+ /**
10
+ * 'inline' (default) adds the small script behind carousel autoplay, the live timer and in-page form sending.
11
+ * 'none' leaves it out — everything still works as plain HTML (links, menus, accordions, forms post normally) —
12
+ * for hosts that don't allow scripts on published pages.
13
+ */
14
+ runtime?: 'inline' | 'none';
15
+ /** May an HTML embed run scripts (inside its own sandbox)? Default true. */
16
+ allowEmbedScripts?: boolean;
17
+ /** Clock for the timer's first paint (ms); defaults to now. */
18
+ now?: number;
19
+ /** The site's design system — the colours, fonts and shapes the page's tokens resolve to. Defaults to the built-in one. */
20
+ designSystem?: DesignSystem;
21
+ }
22
+ export interface BuiltPage {
23
+ tree: HNode;
24
+ css: string;
25
+ usesRuntime: boolean;
26
+ fonts: string[];
27
+ warnings: string[];
28
+ }
29
+ /**
30
+ * Turns one page into markup and CSS. This is the single compile step both outputs share (HTML and React print the
31
+ * same tree), and it is where the visible canvas of each screen is enforced:
32
+ * - an element that sits completely outside a screen's frame is not shown on that screen (and is left out of the
33
+ * page entirely if no screen shows it), so working-area content never reaches a visitor;
34
+ * - an element partly outside is clipped at its section's edge;
35
+ * - the same box model and constraints the editor uses (computeNodeCss) decide where everything lands.
36
+ */
37
+ export declare function buildPage(page: PageDefinition, opts?: CompileOptions): BuiltPage;
38
+ export declare function googleFontsHref(fonts: string[]): string | null;
@@ -0,0 +1,18 @@
1
+ import type { PageDefinition } from '../types/editor';
2
+ import { type HChild } from '../render/ir';
3
+ import { type CompileOptions } from './build';
4
+ export interface CompiledHtml {
5
+ /** The page's markup, ready to place inside a host page's body. */
6
+ html: string;
7
+ /** Its stylesheet. */
8
+ css: string;
9
+ /** The optional runtime as a script body ('' when the page doesn't need one or `runtime: 'none'`). */
10
+ script: string;
11
+ /** A complete standalone document with all of the above (fonts included). */
12
+ document: string;
13
+ /** Things the owner should fix, in plain words (e.g. a form with nowhere to send messages). */
14
+ warnings: string[];
15
+ }
16
+ export declare function printHtml(c: HChild): string;
17
+ /** Compiles a page to HTML + CSS (and a full standalone document). Pure and React-free, so servers can call it. */
18
+ export declare function compilePageToHtml(page: PageDefinition, opts?: CompileOptions): CompiledHtml;
@@ -1,15 +1,28 @@
1
- import type { TextStyleSlots } from './toReact';
2
- export { compilePageToReact, componentNameFor, DESIGN_WIDTH, type CompileOptions, type TextStyleSlots } from './toReact';
3
- export { buildSeedNodes } from '../store/seed';
4
- export { BUTTON_SETS as DEFAULT_BUTTON_SETS, BOX_SETS as DEFAULT_BOX_SETS, TEXT_STYLE_SETS as DEFAULT_TEXT_STYLE_SETS } from '../store/brandDefaults';
5
- export type { PlexoNode, PlexoNodeType, SectionNode } from '../store/types';
6
- export type { StyleSet, StyleSlot } from '../store/brandTypes';
7
- /** The text style slots of a brand's active text style set (the built-in set when none is
8
- * given), in the shape compilePageToReact's `textStyles` option takes. */
9
- export declare function textStyleSlots(sets?: Array<{
10
- id: string;
11
- slots: Array<{
12
- id: string;
13
- styles: Record<string, string | number>;
14
- }>;
15
- }>, activeId?: string): TextStyleSlots;
1
+ /**
2
+ * `@charisol/plexo-sdk/v2/compile` — the V2 compilers on their own, free of React and the editor UI, so servers can
3
+ * import them. The editor itself is at `@charisol/plexo-sdk/v2`.
4
+ *
5
+ * compilePageToHtml(page, opts) → { html, css, script, document, warnings } landing pages, templates
6
+ * compilePageToReact(page, opts) → { code, warnings } app projects
7
+ * parsePages(json) → validates untrusted design JSON before compiling
8
+ * convertLegacyDesign(doc, meta) → upgrades a design saved by the previous V2 (nodes + pageOrder) to a page
9
+ *
10
+ * Both compilers draw the same markup from the same style rules as the editor canvas, show only what is inside each
11
+ * screen's visible canvas, and treat the design as untrusted input.
12
+ */
13
+ export { compilePageToHtml, printHtml, type CompiledHtml } from './html';
14
+ export { compilePageToReact, componentNameFor, type CompileReactOptions } from './react';
15
+ export type { CompileOptions } from './build';
16
+ export { parsePages, MAX_NODES, MAX_DEPTH, type ParseResult } from './schema';
17
+ export { FRAME_WIDTH, MEDIA_QUERY } from '../render/frames';
18
+ export { computePlacements, type Placement } from '../render/placement';
19
+ export { resolveFormDestination, type FormDestination, type FormDestinationConfig } from '../render/formAction';
20
+ export { convertLegacyDesign, isLegacyDesign, type LegacyDesign } from '../migrate/legacy';
21
+ export { blankPages } from '../data/blankPage';
22
+ export { createDefaultDesignSystem, repairDesignSystem, lintDesignSystem, type DesignSystem, type DesignSystemIssue } from '../design';
23
+ export { parseVideoUrl } from '../render/elements';
24
+ export type { DocumentNode, PageDefinition, ElementStyles, ViewportMode } from '../types/editor';
25
+ export { PAGE_TEMPLATES, listPageTemplates, buildPageFromTemplate, buildTemplateSections, templateSeed, getPageTemplate, isPageEmpty } from '../sections/pageTemplates';
26
+ export type { PageTemplate, PageTemplateSection, PageTemplateSummary } from '../sections/pageTemplates';
27
+ export { catalogSchema, describeDesign, describeSection, applyCommands, setPageTemplateResolver, solCommandSchema, parseSolReply, describeCommand, SOL_SYSTEM_PROMPT } from '../sol';
28
+ export type { SolCatalog, SolDesignSummary, SolCommand, CommandResult, ApplyResult, ParsedSolReply } from '../sol';
@@ -0,0 +1,17 @@
1
+ import type { PageDefinition } from '../types/editor';
2
+ import { type CompileOptions } from './build';
3
+ export interface CompileReactOptions extends CompileOptions {
4
+ /** Exported component's name (a valid identifier). */
5
+ componentName: string;
6
+ }
7
+ /** "Hero banner" → "HeroBanner" — a component name from a design's title. */
8
+ export declare function componentNameFor(title: string): string;
9
+ /**
10
+ * Compiles a page into a self-contained React component (TSX source) for a Plexo app project: it imports only
11
+ * `react`, carries its own CSS, and is responsive by itself. Same output tree as the HTML compiler, so the app
12
+ * page looks exactly like the canvas.
13
+ */
14
+ export declare function compilePageToReact(page: PageDefinition, opts: CompileReactOptions): {
15
+ code: string;
16
+ warnings: string[];
17
+ };
@@ -0,0 +1,16 @@
1
+ import type { PageDefinition } from '../types/editor';
2
+ /**
3
+ * Validates design JSON before it is compiled or loaded. A design can come from a database, an AI, or a third-party
4
+ * app, so this is the front door: unknown element types, absurd sizes, and malformed trees are rejected with a message
5
+ * a person can act on. (Values inside a valid design are separately made safe when it is compiled.)
6
+ */
7
+ export declare const MAX_NODES = 5000;
8
+ export declare const MAX_DEPTH = 40;
9
+ export type ParseResult = {
10
+ ok: true;
11
+ pages: PageDefinition[];
12
+ } | {
13
+ ok: false;
14
+ error: string;
15
+ };
16
+ export declare function parsePages(input: unknown): ParseResult;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type AlignmentGuide } from '../../types/editor';
3
+ interface AlignmentGuidesOverlayProps {
4
+ guides: AlignmentGuide[];
5
+ }
6
+ export declare const AlignmentGuidesOverlay: React.FC<AlignmentGuidesOverlayProps>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CanvasArea: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CanvasControls: React.FC;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type DocumentNode } from '../../types/editor';
3
+ interface ContextualToolbarProps {
4
+ node: DocumentNode;
5
+ }
6
+ export declare const ContextualToolbar: React.FC<ContextualToolbarProps>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface DropIndicatorProps {
3
+ position: 'before' | 'after' | 'inside';
4
+ }
5
+ export declare const DropIndicator: React.FC<DropIndicatorProps>;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { DocumentNode } from '../../types/editor';
3
+ /** The element stylesheet, once per editor. Published pages carry the same CSS in their own <style>. */
4
+ export declare const ElementStyles: React.FC;
5
+ /**
6
+ * One of the nine rich elements on the canvas, built from the same tree the published page uses. While editing it
7
+ * is inert (clicks select the element); in preview it behaves like the real thing — except forms, which never send.
8
+ */
9
+ export declare const RichElement: React.FC<{
10
+ node: DocumentNode;
11
+ preview: boolean;
12
+ }>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { type DocumentNode } from '../../types/editor';
3
+ interface NodeRendererProps {
4
+ node: DocumentNode;
5
+ }
6
+ /**
7
+ * Decides whether a node is drawn at all, *before* any of the heavy per-node hooks run. (It used to return early
8
+ * halfway through them, so a node flipping between hidden and visible — the layer eye, the Preview toggle —
9
+ * changed the hook count and crashed the whole editor.)
10
+ */
11
+ export declare const NodeRenderer: React.FC<NodeRendererProps>;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type ViewportMode } from '../../types/editor';
3
+ interface PageFrameProps {
4
+ breakpoint: ViewportMode;
5
+ width: number;
6
+ isFocusedMode?: boolean;
7
+ }
8
+ export declare const PageFrame: React.FC<PageFrameProps>;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { type DocumentNode } from '../../types/editor';
3
+ interface ResizeHandlesProps {
4
+ node: DocumentNode;
5
+ elementRef: React.RefObject<HTMLElement>;
6
+ }
7
+ export declare const ResizeHandles: React.FC<ResizeHandlesProps>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { DocumentNode } from '../../types/editor';
3
+ /** The small bar above a selected ready-made section: what it is, and the things people do to a whole section. */
4
+ export declare const SectionToolbar: React.FC<{
5
+ section: DocumentNode;
6
+ }>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type DocumentNode } from '../../types/editor';
3
+ interface SpacingOverlayProps {
4
+ node: DocumentNode;
5
+ }
6
+ export declare const SpacingOverlay: React.FC<SpacingOverlayProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * When "Keep my website up to date with Strata" is on, the editor looks at Strata once as it opens and quietly brings in
4
+ * changes that can't clash with anything here. A small notice says so, with Undo. Anything that needs a decision is left
5
+ * alone (and mentioned) rather than applied.
6
+ */
7
+ export declare const AutoUpdateWatcher: React.FC;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * "Brand & style": the site's design system in plain terms. One-click looks, a primary and secondary colour, fonts, corners
4
+ * and spacing; a live preview of the buttons, alerts and badges those choices produce; and the Strata card that keeps all of
5
+ * it in one place across every product.
6
+ */
7
+ export declare const DesignSystemPanel: React.FC;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { StrataSync } from './useStrataSync';
3
+ /** What a sync would do, in plain terms — and a choice wherever both sides changed the same thing. */
4
+ export declare const ReviewView: React.FC<{
5
+ sync: StrataSync;
6
+ onBack: () => void;
7
+ }>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { useStrataSync } from './useStrataSync';
3
+ /** The Strata card: one place to sign in, pick or create a project, and keep the brand in step both ways. */
4
+ export declare const StrataCard: React.FC<{
5
+ sync: ReturnType<typeof useStrataSync>;
6
+ syncedAt?: string;
7
+ onReview: () => void;
8
+ }>;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { type AuditDecisions, type AuditReport } from '../../design';
3
+ /** Nothing to tidy: say so, kindly. */
4
+ export declare const TidyEmpty: React.FC;
5
+ /** The card that offers the clean-up. */
6
+ export declare const TidyCard: React.FC<{
7
+ report: AuditReport;
8
+ onOpen: () => void;
9
+ }>;
10
+ /** Every loose value, with a clear choice for each, and one button to take our suggestions. */
11
+ export declare const TidyView: React.FC<{
12
+ report: AuditReport;
13
+ onBack: () => void;
14
+ onApply: (decisions: AuditDecisions) => void;
15
+ }>;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ export declare const field = "w-full bg-[#1F1F1F] border border-[#2C2C2C] rounded px-2 py-1.5 text-xs text-[#EDEDED] focus:outline-none focus:border-[#96F02E]";
3
+ export declare const Section: React.FC<{
4
+ title: string;
5
+ hint?: string;
6
+ defaultOpen?: boolean;
7
+ children: React.ReactNode;
8
+ }>;
9
+ export declare const Row: React.FC<{
10
+ label: string;
11
+ children: React.ReactNode;
12
+ }>;
13
+ export declare function Segmented<T extends string>({ value, options, onChange, label }: {
14
+ value: T;
15
+ options: Array<[T, string]>;
16
+ onChange: (v: T) => void;
17
+ label: string;
18
+ }): React.JSX.Element;
19
+ export declare const PrimaryButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
20
+ export declare const GhostButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
@@ -0,0 +1,51 @@
1
+ import { hasAnything } from '../../strata/merge';
2
+ import type { Resolutions, StrataProjectSummary, StrataStatus, SyncPlan } from '../../strata/types';
3
+ export type SyncPhase = 'unknown' | 'disconnected' | 'expired' | 'connected';
4
+ export interface StrataSync {
5
+ available: boolean;
6
+ phase: SyncPhase;
7
+ user?: StrataStatus['user'];
8
+ /** The linked project, if any. */
9
+ project?: {
10
+ id: string;
11
+ name?: string;
12
+ };
13
+ projects: StrataProjectSummary[] | null;
14
+ plan: SyncPlan | null;
15
+ counts: {
16
+ incoming: number;
17
+ outgoing: number;
18
+ conflicts: number;
19
+ };
20
+ busy: string | null;
21
+ error: string | null;
22
+ notice: string | null;
23
+ connect(): Promise<void>;
24
+ disconnect(): Promise<void>;
25
+ loadProjects(): Promise<void>;
26
+ link(project: StrataProjectSummary): Promise<void>;
27
+ unlink(): void;
28
+ create(input: {
29
+ name: string;
30
+ template: 'blank' | 'base';
31
+ }): Promise<void>;
32
+ check(): Promise<void>;
33
+ pull(resolutions?: Resolutions): Promise<void>;
34
+ push(resolutions?: Resolutions): Promise<void>;
35
+ /** Keep the site up to date with Strata on its own (see `planAutoUpdate`). */
36
+ autoUpdate: boolean;
37
+ setAutoUpdate(on: boolean): void;
38
+ /** What the host's server last did about automatic updates, in plain words (empty when there's nothing to say). */
39
+ autoUpdateNote?: {
40
+ ok: boolean;
41
+ message: string;
42
+ };
43
+ clearMessages(): void;
44
+ }
45
+ /**
46
+ * Drives the Strata card: signing in, choosing or creating a project, and exchanging changes in either direction. All the
47
+ * real work (network, tokens) is the host's adapter; this decides what to do and keeps the design system and the
48
+ * "what would change" summary in step.
49
+ */
50
+ export declare function useStrataSync(): StrataSync;
51
+ export { hasAnything };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ContextMenu: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const EditorShell: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const LeftToolRail: React.FC;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Full-screen preview of the page exactly as visitors will get it: the same compiler the published site uses, shown on its own
4
+ * (no editing handles, nothing outside the visible canvas of each screen). Forms can't send from here — it's a look, not a live site.
5
+ */
6
+ export declare const PreviewOverlay: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const TopToolbar: React.FC;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface SettingsModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ }
6
+ export declare const SettingsModal: React.FC<SettingsModalProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface ShortcutsModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ }
6
+ export declare const ShortcutsModal: React.FC<ShortcutsModalProps>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ /** The colours of the design system worth offering by name, in the order people reach for them. */
3
+ export declare const COLOR_CHOICES: Array<[label: string, key: string]>;
4
+ /**
5
+ * A colour control for the inspector: the SDK's colour picker in its one-row form (swatch + colour code you can type or
6
+ * paste into), offering the design system's colours by name. Picking "Primary" instead of a hex keeps the link, so
7
+ * changing the brand later restyles everything that used it.
8
+ */
9
+ export declare const ColorField: React.FC<{
10
+ value: string;
11
+ onChange: (value: string) => void;
12
+ label?: string;
13
+ className?: string;
14
+ }>;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import type { DocumentNode } from '../../types/editor';
3
+ export declare const input = "w-full bg-[#1F1F1F] border border-[#2C2C2C] rounded px-2 py-1 text-xs text-[#EDEDED] placeholder-[#6B7280] focus:outline-none focus:border-[#96F02E]";
4
+ export declare const smallBtn = "w-6 h-6 rounded flex items-center justify-center text-[#9CA3AF] hover:text-white hover:bg-[#2A2A2A] disabled:opacity-30 disabled:hover:bg-transparent cursor-pointer";
5
+ export declare const Group: React.FC<{
6
+ title: string;
7
+ children: React.ReactNode;
8
+ }>;
9
+ export declare const Row: React.FC<{
10
+ label: string;
11
+ children: React.ReactNode;
12
+ }>;
13
+ export declare const Toggle: React.FC<{
14
+ label: string;
15
+ checked: boolean;
16
+ onChange: (v: boolean) => void;
17
+ hint?: string;
18
+ }>;
19
+ /** A reorderable list: rows can be moved, removed, and added. */
20
+ export declare function List<T>({ items, onChange, render, blank, addLabel, min }: {
21
+ items: T[];
22
+ onChange: (next: T[]) => void;
23
+ render: (item: T, update: (patch: Partial<T>) => void) => React.ReactNode;
24
+ blank: () => T;
25
+ addLabel: string;
26
+ min?: number;
27
+ }): React.JSX.Element;
28
+ export declare const ImagePicker: React.FC<{
29
+ value: string;
30
+ onChange: (url: string) => void;
31
+ }>;
32
+ export declare const IconSvg: React.FC<{
33
+ name: string;
34
+ size?: number;
35
+ }>;
36
+ /** The settings for a rich element — what the element shows and does (its size, spacing and colour live in the other sections). */
37
+ export declare const ElementSettings: React.FC<{
38
+ node: DocumentNode;
39
+ }>;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export type LinkKind = 'none' | 'page' | 'section' | 'web' | 'email' | 'phone';
3
+ export interface LinkChoice {
4
+ label: string;
5
+ href: string;
6
+ }
7
+ /** What kind of destination a saved link is — so the picker can open on the right choice for links written by hand or by SOL. */
8
+ export declare function linkKindOf(value: string | undefined | null): LinkKind;
9
+ /**
10
+ * The pages a link can go to. The host's own pages come first (Plexo web is the reference: it knows every page and its address);
11
+ * then any extra places the host offers; then, for a standalone editor, its own pages.
12
+ */
13
+ export declare function usePageChoices(): LinkChoice[];
14
+ /** The sections on the page being edited, as places a link can scroll to. */
15
+ export declare function useSectionChoices(): LinkChoice[];
16
+ /**
17
+ * The one way to say where something goes when it's clicked: choose the kind of place, then pick or type it. Pages and
18
+ * sections come as lists (no addresses to remember); websites, emails and phone numbers take what you type and are
19
+ * written in the right form for you. Saves a plain link, so old designs and SOL's changes read the same.
20
+ */
21
+ export declare const LinkField: React.FC<{
22
+ value: string | undefined;
23
+ onChange: (href: string) => void;
24
+ label?: string;
25
+ compact?: boolean;
26
+ }>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const PageInspector: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const PropertiesPanel: React.FC;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { DocumentNode } from '../../types/editor';
3
+ /** Settings that belong to a whole section (as opposed to an element on it). */
4
+ export declare const SectionSettings: React.FC<{
5
+ node: DocumentNode;
6
+ }>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type DocumentNode } from '../../../types/editor';
3
+ interface ConstraintsSectionProps {
4
+ node: DocumentNode;
5
+ }
6
+ export declare const ConstraintsSection: React.FC<ConstraintsSectionProps>;
7
+ export {};