@charisol/plexo-sdk 1.4.38 → 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 +13475 -17824
  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,44 @@
1
+ import type { RefObject } from 'react';
2
+ import type { PointerEngine } from './usePointerEngine';
3
+ import { type RectLike } from './rectMath';
4
+ export interface ScreenGuide {
5
+ orientation: 'vertical' | 'horizontal';
6
+ position: number;
7
+ start: number;
8
+ end: number;
9
+ }
10
+ export interface DragState {
11
+ draggingId: string | null;
12
+ /** Container-relative screen rect of the node being dragged, refreshed every frame. */
13
+ liveRect: RectLike | null;
14
+ /** Magenta alignment guides, already converted into container-relative screen space. */
15
+ guides: ScreenGuide[];
16
+ /** Model-space x/y (distance from the parent's left/top) of the node's current
17
+ * snapped position — the live numbers a "Y: 240 X: 48" badge reads while dragging. */
18
+ modelPos: {
19
+ x: number;
20
+ y: number;
21
+ } | null;
22
+ /** Container-relative screen rect of the dragged node's *parent* — lets
23
+ * AdornmentLayer draw a real ruler/dimension line from the node's edge back to the
24
+ * parent's edge alongside the X/Y badge, not just float a number with nothing to
25
+ * visually anchor it to. Null for a node with no parent (shouldn't happen in
26
+ * practice — Section's own direct children always have one). */
27
+ parentRect: RectLike | null;
28
+ }
29
+ /**
30
+ * Ghost Drag, per the spec: reads the pointer engine's ref each animation frame (no
31
+ * per-pointermove React state), imperatively transforms the real dragged element, and
32
+ * only commits x/y to the Zustand store on pointer-up. Model-space snapping math
33
+ * (snapping.ts) happens in the dragged node's own parent-local coordinate frame; guide
34
+ * lines are converted to container-relative screen space here (by measuring the
35
+ * parent's own screen rect) purely for AdornmentLayer to draw them — everything stays
36
+ * a 1:1 translation, no scale/zoom handling yet.
37
+ */
38
+ export declare function useDragEngine(containerRef: RefObject<HTMLElement | null>, pointerEngine: PointerEngine): {
39
+ startDrag: (id: string, e: {
40
+ clientX: number;
41
+ clientY: number;
42
+ }) => void;
43
+ dragState: DragState;
44
+ };
@@ -0,0 +1,40 @@
1
+ import type React from 'react';
2
+ import type { PlexoNode, PlexoNodeType } from '../store/types';
3
+ /** A Container is only a full-bleed "row" (spanning its section edge-to-edge like a Wix
4
+ * Strip, x/width ignored) when it's explicitly marked `styles.containerRole === 'row'`
5
+ * — set by the "Cell row" seed/preset builders (rowContainer() in elementCatalog.tsx,
6
+ * the seed fixture). Any other Container parented directly to a Section (a "Box"/
7
+ * "Card"/"Divider" preset, or a freeform box the user just drew) keeps its own x/y/
8
+ * width/height — the two used to be conflated (any Container-child-of-Section was
9
+ * forced full-bleed), which silently broke every non-row Container preset by
10
+ * stretching it to the full section width and ignoring its intended position/size. A
11
+ * nested Container (a "cell" living inside a row) is unaffected either way — it always
12
+ * gets ordinary flex-item sizing from its row parent regardless of this flag. */
13
+ export declare function isFullBleedRow(nodeType: PlexoNodeType | undefined, parentType: PlexoNodeType | undefined, styles?: PlexoNode['styles']): boolean;
14
+ /**
15
+ * Shared wiring for every draggable node type (Text/Image/Button/Container — anything
16
+ * but Section, which isn't pointer-draggable in Phase 3). Centralizes the placement
17
+ * math, the pointerdown-starts-drag/click-selects contract, and
18
+ * right-click-opens-the-context-menu so the 4 leaf components don't each re-implement
19
+ * it.
20
+ *
21
+ * Layout mode depends on the *parent*: a Section is the freeform canvas root, so its
22
+ * direct children get Phase 3's absolute x/y positioning and are draggable. A Container
23
+ * is a "Cell row" — its children lay out via flexbox (see ContainerNode.tsx) and their
24
+ * position is governed by flex order, not x/y, so dragging is disabled for them
25
+ * (reordering happens via the Cell row's flip/add-cell controls instead); only their
26
+ * width is still meaningful, as a fixed flex-basis.
27
+ *
28
+ * `node` may be `undefined` for one render (e.g. the id briefly outliving its node
29
+ * during a delete) — hooks must still run unconditionally, so this stays safe rather
30
+ * than asserting non-null and crashing on that render.
31
+ */
32
+ export declare function useDraggableNode(node: PlexoNode | undefined): {
33
+ attrProps: {
34
+ "data-plexo-v2-id": string | undefined;
35
+ onPointerDown: (e: React.PointerEvent) => void;
36
+ onClick: (e: React.MouseEvent) => void;
37
+ onContextMenu: (e: React.MouseEvent) => void;
38
+ };
39
+ positionStyle: React.CSSProperties;
40
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Double-click-to-edit for Text/Button content, directly in the canvas — there was no
3
+ * way to edit a node's own text short of opening the Design popover's Content field.
4
+ * A single click still selects/drags (useDraggableNode's normal contract); double-click
5
+ * switches the same element into a real `contentEditable` region, focused with the
6
+ * caret at the end, and commits one undo step on blur (or Escape/Enter, depending on
7
+ * `commitOnEnter`) — not on every keystroke, matching every other field's edit contract
8
+ * in this app.
9
+ */
10
+ export declare function useInlineTextEdit(nodeId: string, currentText: string, field: 'content' | 'label', commitOnEnter: boolean): {
11
+ editing: boolean;
12
+ ref: import("react").RefObject<HTMLElement | null>;
13
+ startEditing: (e: React.MouseEvent) => void;
14
+ editableProps: {
15
+ contentEditable: boolean;
16
+ suppressContentEditableWarning: boolean;
17
+ onBlur: () => void;
18
+ onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
19
+ onPointerDown: (e: React.PointerEvent) => void;
20
+ onClick: (e: React.MouseEvent) => void;
21
+ } | {
22
+ contentEditable?: undefined;
23
+ suppressContentEditableWarning?: undefined;
24
+ onBlur?: undefined;
25
+ onKeyDown?: undefined;
26
+ onPointerDown?: undefined;
27
+ onClick?: undefined;
28
+ };
29
+ };
@@ -0,0 +1,22 @@
1
+ export interface PointerPoint {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface PointerEngine {
6
+ /** Current pointer position — a ref read, not state, so consumers checking it inside a
7
+ * rAF loop (Phase 3's drag ghost) never trigger a React re-render just by reading it. */
8
+ getPointer: () => PointerPoint;
9
+ isDown: () => boolean;
10
+ /** Fires on every pointerup, after the up-state is already recorded — for consumers
11
+ * (Phase 2's AdornmentLayer) that need to re-measure layout once an interaction ends,
12
+ * without subscribing to every intermediate pointermove. */
13
+ onPointerUp: (cb: () => void) => () => void;
14
+ }
15
+ /**
16
+ * One set of window-level pointer listeners, mounted once at the canvas root. Phase 3's
17
+ * drag/snap engine builds directly on this instead of each draggable node adding its own
18
+ * listeners — the whole point of a "global pointer engine" per the spec is a single
19
+ * source of truth for pointer state during a drag that spans past any one element's
20
+ * boundaries.
21
+ */
22
+ export declare function usePointerEngine(): PointerEngine;
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ import type { HandleKey } from './rectMath';
3
+ /**
4
+ * Per-handle pointerdown wiring: live setNodeStyles on every pointermove (instant canvas
5
+ * repaint, matching the "debounced AST dispatch" pattern from the Inspector's scrub
6
+ * fields — see useFieldCommit), one commitSnapshot on pointerup so the whole drag is a
7
+ * single undo step. No rAF ghost here unlike Phase 3's move-drag: resize changes
8
+ * width/height, which need a real re-layout anyway, so there's nothing to gain from an
9
+ * imperative transform — a direct store write each tick is simpler and just as fast at
10
+ * this node count.
11
+ */
12
+ export declare function useResizeHandlePointerDown(nodeId: string, handleKey: HandleKey): (e: React.PointerEvent) => void;
@@ -0,0 +1,13 @@
1
+ import type { TextNode } from '../store/types';
2
+ export interface ResolvedTypography {
3
+ fontSize?: string | number;
4
+ fontWeight?: string | number;
5
+ lineHeight?: string | number;
6
+ }
7
+ /**
8
+ * When a Text node is linked to a global Text Style slot (via styles.textStyleRef), its
9
+ * typography comes from that slot instead of its own local styles — that's what makes
10
+ * editing the slot in the Brand panel a real "Change All", not just a copy-on-select.
11
+ * Unlinked ("Custom") nodes fall back to their own local fontSize/fontWeight.
12
+ */
13
+ export declare function useResolvedTextStyles(node: TextNode | undefined): ResolvedTypography;
@@ -0,0 +1,13 @@
1
+ import type { RefObject } from 'react';
2
+ import { type RectLike } from './rectMath';
3
+ /**
4
+ * Recomputes on every trigger that could move content relative to the container: the
5
+ * selection itself changing, the container resizing, the window resizing, and the inner
6
+ * canvas scrolling (see rectMath.ts's toRelativeRect doc for why scroll needs a recompute
7
+ * but not manual scroll-offset math).
8
+ */
9
+ export declare function useSelectionRects(containerRef: RefObject<HTMLElement | null>, scrollRef: RefObject<HTMLElement | null>, selectedIds: string[], pointerUpTick: number,
10
+ /** Any extra value that can reposition content without resizing the container or any
11
+ * selected element itself — e.g. toggling Desktop/Mobile preview re-centers the whole
12
+ * page, which neither a ResizeObserver nor a scroll/resize listener would catch. */
13
+ layoutKey?: unknown): Map<string, RectLike>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Cmd/Ctrl+Z to undo, Cmd/Ctrl+Shift+Z (or Ctrl+Y) to redo — the canvas's own history
3
+ * stack, not the browser's native text-field undo. Deliberately skipped while focus is
4
+ * inside an editable element (Inspector fields): the user's Cmd+Z there should undo
5
+ * their last keystroke in that field via the browser's native input undo, not jump the
6
+ * whole canvas back a step, which would be surprising and could undo unrelated edits.
7
+ */
8
+ export declare function useUndoRedoKeyBinding(): void;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import type { PlexoNode } from '../store/types';
3
+ export interface BuiltPreset {
4
+ /** The subtree to insert — one dispatchAiCommand({type:'insertNode', ...}) call. */
5
+ nodes: Record<string, PlexoNode>;
6
+ rootId: string;
7
+ }
8
+ export interface ElementPreset {
9
+ id: string;
10
+ label: string;
11
+ /** A small, real (if simplified) illustrative markup — not the live canvas renderer,
12
+ * just enough for the catalog grid to look like the reference's populated previews
13
+ * instead of a bare icon. */
14
+ preview: React.ReactNode;
15
+ /** Shown under the label in the preset list row. Optional — falls back to a generic
16
+ * "drag or tap to add" hint (see ContentTabPanel's PresetRow) when omitted, so this
17
+ * is worth writing only where a short, specific description actually helps someone
18
+ * scanning the list tell presets apart. */
19
+ description?: string;
20
+ build: (parentId: string) => BuiltPreset;
21
+ }
22
+ export interface ElementCategory {
23
+ id: string;
24
+ label: string;
25
+ /** Omitted/empty on a category that's a real workstream of its own (Popup's overlay
26
+ * system, Apps' plugin marketplace) — shown honestly as "coming soon" rather than
27
+ * faking presets that don't do anything. */
28
+ presets?: ElementPreset[];
29
+ comingSoon?: string;
30
+ }
31
+ export declare const ELEMENT_CATEGORIES: ElementCategory[];
@@ -0,0 +1,7 @@
1
+ import type { ElementPreset } from './elementCatalog';
2
+ /** Builds an insertable preset for an arbitrary image URL — shared by the Images
3
+ * gallery (images already used somewhere in the document) and the Uploads tab (a
4
+ * freshly uploaded file's URL), both of which need the exact same "drop this image
5
+ * onto a section" behavior the Content tab's own presets already have (same
6
+ * CatalogDragContext, same tap-to-add path). */
7
+ export declare function buildImagePreset(url: string, label?: string): ElementPreset;
@@ -0,0 +1,32 @@
1
+ import type { PlexoNode } from '../store/types';
2
+ /**
3
+ * Compiles a V2 canvas page (nodes + pageOrder) into a self-contained React component (TSX
4
+ * source) for a Plexo app project — how a visually designed page becomes ordinary code the
5
+ * app imports, the AI can edit, and Plexo builds and serves like any other file.
6
+ *
7
+ * Layout fidelity: the canvas is a freeform artboard (absolute x/y inside each Section, flex
8
+ * "cell rows" for Containers) designed at up to DESIGN_WIDTH px. The output reproduces that
9
+ * exactly at the design width and scales each section proportionally on narrower screens
10
+ * (a small fit-to-width hook), so nothing overlaps or reflows unexpectedly on a phone.
11
+ *
12
+ * Same style resolution as the canvas itself (resolveBoxStyle, Text Style slots) so the
13
+ * compiled page looks like the design. Text is emitted as JS string literals, never raw
14
+ * JSX text, so content can't break out of the markup; Embed HTML stays sandboxed.
15
+ */
16
+ export declare const DESIGN_WIDTH = 1400;
17
+ export type TextStyleSlots = Record<string, {
18
+ fontSize?: string | number;
19
+ fontWeight?: string | number;
20
+ lineHeight?: string | number;
21
+ }>;
22
+ export interface CompileOptions {
23
+ /** Exported component name (a valid identifier). */
24
+ componentName: string;
25
+ /** Brand Text Style slots, so text linked to a slot (styles.textStyleRef) gets its typography. */
26
+ textStyles?: TextStyleSlots;
27
+ }
28
+ type Nodes = Record<string, PlexoNode>;
29
+ export declare function compilePageToReact(nodes: Nodes, pageOrder: string[], opts: CompileOptions): string;
30
+ /** "Hero banner" → "HeroBanner" — a component name from a design's title. */
31
+ export declare function componentNameFor(title: string): string;
32
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { RectLike } from '../canvas/rectMath';
3
+ import type { ScreenGuide } from '../canvas/useDragEngine';
4
+ export declare const AdornmentLayer: React.FC<{
5
+ rects: Map<string, RectLike>;
6
+ guides?: ScreenGuide[];
7
+ /** Live X/Y readout shown near the dragged node's rect — "distance from top and
8
+ * left" while dragging, per the reference. `rect` here is whichever entry in `rects`
9
+ * is currently being dragged (CenterCanvas already knows which); `parentRect` (when
10
+ * known) lets a faint ruler/dimension line get drawn back to the actual edge being
11
+ * measured from, rather than floating a bare number with nothing to anchor it to. */
12
+ dragBadge?: {
13
+ rect: RectLike;
14
+ modelPos: {
15
+ x: number;
16
+ y: number;
17
+ };
18
+ parentRect: RectLike | null;
19
+ };
20
+ }>;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export interface AskSolMessage {
3
+ id: string;
4
+ from: 'user' | 'sol';
5
+ text: string;
6
+ timestamp: number;
7
+ }
8
+ /**
9
+ * The Ask SOL conversation screen — a dedicated sidebar tab (not a popup panel), with
10
+ * a Back control that returns to the Content tab. History is host-persistable: pass
11
+ * `history`/`onMessage` (see V2CanvasProps) and a real backend (plexo-web) can save and
12
+ * restore the conversation per template; omit both and it's just in-memory for the
13
+ * session. Replies are honestly canned/heuristic (see aiTextTransforms.ts) since no
14
+ * real model is connected in this build.
15
+ */
16
+ export declare const AskSolPanel: React.FC<{
17
+ history?: AskSolMessage[];
18
+ onMessage?: (message: AskSolMessage) => void;
19
+ }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /** Follows the cursor while a Content-tab preset is being dragged — portaled to
3
+ * document.body for the same reason Popover is (see its own doc comment): a
4
+ * fixed-position overlay needs to escape any ancestor's stacking context to reliably
5
+ * render above the canvas's own selection/adornment layer. */
6
+ export declare const CatalogDragGhost: React.FC;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ /**
3
+ * Sits between two adjacent Cells in a Container's flex row (or at the very start/end
4
+ * as an edge insert zone). Between two real cells it IS the gap itself — sized to the
5
+ * container's actual `styles.gap`, draggable horizontally to resize it, with hover
6
+ * controls to flip the two neighboring cells' order or insert a new one right there.
7
+ * At the row's edges there's no gap to drag, just an insert affordance.
8
+ */
9
+ export declare const CellBoundary: React.FC<{
10
+ containerId: string;
11
+ index: number;
12
+ leftChildId?: string;
13
+ rightChildId?: string;
14
+ }>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { V2CanvasProps } from './V2Canvas';
3
+ export declare const CenterCanvas: React.FC<V2CanvasProps>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ /**
3
+ * The Content tab — a two-level drill-down: a clean grid of standalone category tiles
4
+ * first (icon + label, same bordered-card language every preset tile already uses —
5
+ * matching V1's own flat category grid rather than a cramped icon strip or a list of
6
+ * menu rows), and tapping one opens that category's own preset grid as a proper
7
+ * "sub-menu" screen with a Back control and its own header. Every tile is both
8
+ * tap-to-add (click — lands at the end of the page) *and* drag-to-drop (pointer-drag
9
+ * onto any section, lands exactly where you drop it — see CatalogDragContext/
10
+ * CatalogDragGhost).
11
+ */
12
+ export declare const ContentTabPanel: React.FC;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ /** Right-click menu: Cut/Copy/Paste/Duplicate/Copy style/Delete, then Pin to screen
3
+ * (Sections), then Arrange and Align to as nested flyouts — matching the reference's
4
+ * exact grouping rather than one long flat list. */
5
+ export declare const ContextMenu: React.FC;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ export type SaveState = 'idle' | 'saving' | 'saved';
3
+ export interface ContextualToolbarProps {
4
+ /** Left/right header slots — named to match V1's own `headerLeftContent`/
5
+ * `headerRightContent` props (PlexoBuilder.tsx) so a host already integrating V1
6
+ * can drop the same content in here with no naming translation. Neither owns any
7
+ * layout beyond "render it in this column" — page nav, domain, whatever the host
8
+ * wants is entirely its own call. Per-element editing controls never live here
9
+ * (see SelectionToolbar.tsx, docked inside the canvas panel instead). */
10
+ headerLeftContent?: React.ReactNode;
11
+ headerRightContent?: React.ReactNode;
12
+ /** Same shape as V1: the Save button only renders when a handler is actually
13
+ * supplied (or `showSaveButton` is explicitly true) — no dead button that silently
14
+ * does nothing. */
15
+ onSave?: () => void;
16
+ showSaveButton?: boolean;
17
+ saveState?: SaveState;
18
+ }
19
+ /**
20
+ * The app-wide top bar. Deliberately minimal — header slots for whoever mounts this
21
+ * SDK on the left and right, the Desktop/Mobile device switch centered, and the
22
+ * editor's own global (not per-element) controls — Undo/Redo, Save, workspace
23
+ * dark-mode toggle, Preview, Help.
24
+ */
25
+ export declare const ContextualToolbar: React.FC<ContextualToolbarProps>;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { StockImageProvider, StockImageResult } from './V2Canvas';
3
+ /**
4
+ * One consolidated Images tab — replaces the earlier split Images/Uploads tabs, which
5
+ * the user correctly called out as a redundant extra step. Three sources feed the same
6
+ * grid/insert path: a stock photo search (Unsplash/Pixabay/etc — host-supplied, since
7
+ * the SDK holds no API keys of its own), the host's own upload handler, and every image
8
+ * already used somewhere in this document. Any source the host doesn't wire up simply
9
+ * doesn't render its section, rather than showing a dead button.
10
+ */
11
+ export declare const ImagesTabPanel: React.FC<{
12
+ onUploadImage?: (file: File) => Promise<string>;
13
+ stockImageProviders?: StockImageProvider[];
14
+ onSearchStockImages?: (query: string, providerId: string) => Promise<StockImageResult[]>;
15
+ }>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ /** "Layout Guides" panel: None / Columns / Blocks / Dots, plus an Always / On drag
3
+ * only visibility toggle — see LayoutGuideContext for how these actually change what
4
+ * renders behind a selected section (SectionGridOverlay.tsx). Floats beside its
5
+ * trigger by default, or fills a docked sidebar tab's panel when `docked` (see
6
+ * ManageLayersPanel's doc comment — same pattern). */
7
+ export declare const LayoutGuidePanel: React.FC<{
8
+ onClose: () => void;
9
+ docked?: boolean;
10
+ }>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ /**
3
+ * "Manage Layers" — a titled card with a close button, rows carrying a thumbnail,
4
+ * expand/collapse chevron, pin indicator (for pinned sections), and a per-row "..."
5
+ * opening the same context menu used everywhere else in the canvas. Renders either as
6
+ * a floating card beside its trigger (`docked` false/omitted) or filling a docked
7
+ * sidebar tab's own panel (`docked` true, per the V1-style consolidated sidebar in
8
+ * LeftRail.tsx) — same content either way, just the outer chrome differs.
9
+ */
10
+ export declare const ManageLayersPanel: React.FC<{
11
+ onClose: () => void;
12
+ docked?: boolean;
13
+ }>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /**
3
+ * Single dispatch point from a node id to its rendered leaf component. Adding a new
4
+ * PlexoNodeType later only touches this switch and its own nodes/*.tsx file.
5
+ */
6
+ export declare const NodeRenderer: React.FC<{
7
+ id: string;
8
+ }>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * A distraction-free, read-only preview — matches the user's own reference exactly:
4
+ * an exit control, a device-width slider with a live pixel readout, Desktop/Tablet/
5
+ * Mobile quick-set buttons, and a "Fit to screen" auto-scale toggle. The page itself is
6
+ * the real rendered node tree (not a separate compiled-HTML path), wrapped in
7
+ * `pointer-events: none` so it's genuinely inert — no accidental selection, no hover
8
+ * affordances firing — without needing every node/section component to grow its own
9
+ * "am I in preview mode" branch.
10
+ */
11
+ export declare const PreviewOverlay: React.FC;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { HandlePosition } from '../canvas/rectMath';
3
+ export declare const ResizeHandle: React.FC<{
4
+ nodeId: string;
5
+ handle: HandlePosition;
6
+ }>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { V2CanvasProps } from './V2Canvas';
3
+ /**
4
+ * The right-hand sidebar: a docked content panel plus a slim icon tab rail along the
5
+ * far edge — matching the reference's own shape, mirrored from V1's left-side
6
+ * SidebarContainer/SidebarTabsRail rather than V2's earlier floating-popover rail.
7
+ * Content is the default/first tab; Ask SOL is a dedicated conversation screen (not a
8
+ * bottom composer bar) that replaces the panel's content when open, with its own Back
9
+ * control returning to Content. Images/Uploads give real, honest image-gallery
10
+ * management — Images reflects what's actually used in the document, Uploads calls a
11
+ * host-supplied `onUploadImage` hook (no fake upload button when one isn't wired up).
12
+ */
13
+ export declare const RightRail: React.FC<V2CanvasProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /** Renders a Section's configured shape divider (if any) at its top or bottom edge —
3
+ * a plain absolutely-positioned SVG, `pointer-events: none`, rendered before the
4
+ * section's real children in DOM order so ordinary content (no explicit z-index)
5
+ * naturally stacks above it without needing an explicit z-index war. */
6
+ export declare const SectionDividerOverlay: React.FC<{
7
+ sectionId: string;
8
+ }>;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ /**
3
+ * A thin hover band sitting fully *inside* one edge of a Section (top or bottom) — not
4
+ * straddling the seam between sections (which clipped/crowded the pill against the
5
+ * browser-chrome bar above the first section, and read as visually "hidden" behind the
6
+ * layout-guide column lines right at that boundary), and not a separate block sitting
7
+ * between sections either — that used to add a permanent visible gap after every
8
+ * section regardless of whether anyone was hovering it. Zero footprint when idle
9
+ * (position: absolute takes no layout space), and "+ Add Section" only appears while the
10
+ * cursor is actually over that specific edge — top inserts before this section, bottom
11
+ * inserts after, matching "the Add Section button shows up depending on where your
12
+ * cursor is, top or bottom".
13
+ */
14
+ export declare const SectionEdgeAddZone: React.FC<{
15
+ edge: 'top' | 'bottom';
16
+ index: number;
17
+ }>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ /**
3
+ * Purely visual — a background guide behind a Section's children, never enforced as
4
+ * real layout on the elements themselves (per the spec: freeform absolute-position
5
+ * elements, guided but not constrained by the grid). pointer-events: none so it never
6
+ * intercepts clicks meant for the section or its children underneath. Shape (Columns /
7
+ * Blocks / Dots / off) and visibility (Always / On drag only) come from the shared
8
+ * LayoutGuideContext, driven by the "Layout Guides" popover in LeftRail.
9
+ */
10
+ export declare const SectionGridOverlay: React.FC;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /** Click-to-edit label shown on a selected section — reads/writes props.name, which
3
+ * existed on the node since Phase 1 but had no UI surface until now. */
4
+ export declare const SectionNamePill: React.FC<{
5
+ id: string;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const SectionNode: React.FC<{
3
+ id: string;
4
+ index: number;
5
+ }>;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { RectLike } from '../canvas/rectMath';
3
+ /**
4
+ * The selected section's 4-icon control cluster (select/move up/move down/more) —
5
+ * floats just outside the section's left edge when there's room in the margin to its
6
+ * left (sidebar collapsed to just its icon rail); when a sidebar tab is docked open
7
+ * and there's no margin to float into, it clamps to sit just *inside* the canvas's own
8
+ * left edge instead of overlapping the docked panel's content. Rendered as a sibling of
9
+ * the scrolling canvas content (inside CenterCanvas's non-scrolling containerRef, same
10
+ * as AdornmentLayer) rather than inside the Section itself: the scroll container clips
11
+ * horizontal overflow, so a negative-left child of the Section would be invisible —
12
+ * being a sibling of the scroller sidesteps that entirely, the same reasoning
13
+ * AdornmentLayer already relies on for its own overlay.
14
+ */
15
+ export declare const SectionSideRail: React.FC<{
16
+ rects: Map<string, RectLike>;
17
+ }>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * The per-element settings toolbar — lives docked inside the canvas panel (top of
4
+ * CenterCanvas, above the scrolling artboard), not in the app-wide top bar. That bar
5
+ * (ContextualToolbar.tsx) is reserved for whatever's mounting this SDK to put its own
6
+ * chrome in, so per-type editing controls (Design/Animation/Text style/Background/
7
+ * quick actions) live here instead — scoped to "the canvas panel", scrollable
8
+ * left/right with arrow buttons once a type's control set overflows the available
9
+ * width, rather than fighting the host's own bar for space.
10
+ */
11
+ export declare const SelectionToolbar: React.FC;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ /** Visible feedback while a "Copy style" pick is armed — otherwise clicking an element
3
+ * would silently do something different than usual (apply the copied style instead of
4
+ * selecting), with no way to tell why. */
5
+ export declare const StylePainterToast: React.FC;
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import { type SaveState } from './ContextualToolbar';
3
+ import type { AskSolMessage } from './AskSolPanel';
4
+ /**
5
+ * Everything a host app (plexo-web in production, PlaygroundHost.tsx in dev) can hand
6
+ * in rather than the SDK hardcoding or faking it. Persistence, uploads, and Ask SOL
7
+ * conversation history are all host concerns the SDK has no backend of its own for.
8
+ */
9
+ /** One stock-photo provider the host wires up (Unsplash/Pixabay/Pexels/…) — labels only,
10
+ * the actual API keys and fetch logic live on the host's side. */
11
+ export interface StockImageProvider {
12
+ id: string;
13
+ label: string;
14
+ }
15
+ /** One stock-photo search result, in the shape the Images tab needs to render a tile
16
+ * and give the source photographer/provider proper credit. */
17
+ export interface StockImageResult {
18
+ id: string;
19
+ src: string;
20
+ alt?: string;
21
+ credit?: string;
22
+ photographerUrl?: string;
23
+ provider: string;
24
+ }
25
+ export interface V2CanvasProps {
26
+ /** Uploading a file needs real storage the SDK doesn't have — given, the Images tab's
27
+ * Upload section calls this with the picked/dropped file and expects the hosted URL
28
+ * back; omitted, that section doesn't render (no dead button pretending to work). */
29
+ onUploadImage?: (file: File) => Promise<string>;
30
+ /** Stock photo search (Unsplash/Pixabay/…), consolidated into the same Images tab as
31
+ * uploads and document images per the user's own explicit request — the SDK has no
32
+ * API keys of its own, so both the provider list and the actual search call are the
33
+ * host's job. Omit both to just show uploads + images already used in the document. */
34
+ stockImageProviders?: StockImageProvider[];
35
+ onSearchStockImages?: (query: string, providerId: string) => Promise<StockImageResult[]>;
36
+ /** Ask SOL's conversation, scoped to "the particular template" by whatever the host
37
+ * passes in — the SDK has no concept of which template/document this is beyond the
38
+ * canvas store's own contents, so persisting history across sessions is the host's
39
+ * job. Omit both to get a normal in-memory-only conversation. */
40
+ askSolHistory?: AskSolMessage[];
41
+ onAskSolMessage?: (message: AskSolMessage) => void;
42
+ /** Left/right header slots — named to match V1's own `headerLeftContent`/
43
+ * `headerRightContent` props (PlexoBuilder.tsx) so a host already integrating V1
44
+ * can carry the same content over with no naming translation. The SDK renders each
45
+ * as-is and owns nothing about its content; per-element editing controls never live
46
+ * here (see SelectionToolbar.tsx, docked inside the canvas panel instead). */
47
+ headerLeftContent?: React.ReactNode;
48
+ headerRightContent?: React.ReactNode;
49
+ /** Also matching V1's naming: the Save button only renders when a handler is
50
+ * actually supplied (and `showSaveButton` isn't explicitly false) — no dead button
51
+ * that silently does nothing. */
52
+ onSave?: () => void;
53
+ showSaveButton?: boolean;
54
+ saveState?: SaveState;
55
+ }
56
+ export declare const V2Canvas: React.FC<V2CanvasProps>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const ButtonNode: React.FC<{
3
+ id: string;
4
+ }>;