@squeed/flow-sdk 2.0.22 → 2.0.25

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.
package/dist/index.d.cts CHANGED
@@ -51,7 +51,9 @@ export declare type BackgroundVariant = BackgroundPattern | "transparent";
51
51
  export declare function bindSqueedCallbacks(json: SqueedJson, compiledEdges: FlowDiagramEdge[], callbacks: FlowDiagramCallbacks, onJsonChange?: (json: SqueedJson, change: SqueedChange) => void, formSchema?: FormSchema): FlowDiagramCallbacks;
52
52
 
53
53
  export declare const BottomBar: MemoExoticComponent< {
54
- (): JSX_2.Element;
54
+ ({ nodeGridControlsTarget, }?: {
55
+ nodeGridControlsTarget?: HTMLElement | null;
56
+ }): JSX_2.Element;
55
57
  displayName: string;
56
58
  }>;
57
59
 
@@ -169,6 +171,8 @@ export declare type ContractType = {
169
171
  ports?: Record<string, ContractPort>;
170
172
  };
171
173
 
174
+ export declare function copySelection(json: SqueedJson, ids: string[]): SqueedJson;
175
+
172
176
  export declare function createFlowDiagram(jsnObjct: any, path?: string, nodes?: any[], edges?: any[], activeLabel?: string, flowConfig?: any, nodeConfig?: any): {
173
177
  nodes: any[];
174
178
  edges: any[];
@@ -243,6 +247,11 @@ export declare function DiagramAppearanceControls(): JSX_2.Element;
243
247
 
244
248
  export declare function downloadSvg(canvas: HTMLElement, filename?: string): Promise<void>;
245
249
 
250
+ export declare function duplicateSelection(json: SqueedJson, ids: string[]): {
251
+ json: SqueedJson;
252
+ ids: string[];
253
+ };
254
+
246
255
  export declare const DynamicIcon: ({ name, svg, ...props }: {
247
256
  [x: string]: any;
248
257
  name: any;
@@ -284,6 +293,8 @@ export declare function FlowDiagram({ loading, loader, ...props }: FlowDiagramPr
284
293
 
285
294
  /** Event callbacks for the flow diagram */
286
295
  export declare interface FlowDiagramCallbacks {
296
+ onNodesCopy?: (ids: string[]) => boolean | void | Promise<boolean | void>;
297
+ onNodesDuplicate?: (ids: string[]) => boolean | void;
287
298
  onGraphEdgeColorChange?: (color: string) => void;
288
299
  onAllNodesIconLabelChange?: (enabled: boolean) => void;
289
300
  onNodeCreateRequest?: (request: FlowNodeCreationRequest) => boolean;
@@ -295,6 +306,13 @@ export declare interface FlowDiagramCallbacks {
295
306
  onEdgeRadiusChange?: (radius: number) => void;
296
307
  onCompactPropertyLayoutChange?: (enabled: boolean) => void;
297
308
  onBackgroundVariantChange?: (variant: BackgroundVariant) => void;
309
+ onNodeGridZoomOut?: (options: NodeGridOptions) => boolean;
310
+ onNodeGridFillRequest?: (options: NodeGridOptions) => boolean;
311
+ onNodeGridModeRequest?: (enabled: boolean, options: NodeGridOptions) => boolean;
312
+ onNodeGridDrop?: (nodeId: string, point: {
313
+ x: number;
314
+ y: number;
315
+ }, modifiers?: NodeSelectionModifiers) => boolean;
298
316
  /** Fires when a node is clicked/selected */
299
317
  onNodeSelect?: (nodeId: string, nodeData: any, modifiers?: NodeSelectionModifiers) => void;
300
318
  onBackgroundClick?: () => void;
@@ -312,14 +330,16 @@ export declare interface FlowDiagramCallbacks {
312
330
  position: any;
313
331
  sourceNodeId?: string;
314
332
  isArrayMode?: boolean;
315
- }) => void;
333
+ }) => boolean | void;
316
334
  /** Fires when a node is deleted */
317
335
  onNodeDelete?: (nodeId: string, nodeData: any) => void;
318
336
  /** Fires when a node label is edited inline */
319
337
  onNodeLabelChange?: (nodeId: string, newLabel: string) => void;
320
- onNodeContentChange?: (nodeId: string, content: string) => void;
338
+ onNodeSubtitleChange?: (nodeId: string, subtitle: string) => void;
339
+ onNodeContentChange?: (nodeId: string, content: NodeContent) => void;
321
340
  /** Fires when a node's collapse toggle is clicked */
322
341
  onNodeCollapse?: (nodeId: string, collapsed: boolean) => void;
342
+ onNodeParentChange?: (nodeId: string, parentId: string) => void;
323
343
  /** Fires when a node's color is changed via the toolbar */
324
344
  onNodeColorChange?: (nodeId: string, colorType: "text" | "bg", color: string) => void;
325
345
  /** Fires when a node's icon is changed via the toolbar */
@@ -383,6 +403,7 @@ export declare interface FlowDiagramCallbacks {
383
403
  export declare interface FlowDiagramConfig {
384
404
  bottomBarExtra?: React.ReactNode;
385
405
  bottomBarCollapsed?: boolean;
406
+ bottomBarNavigation?: boolean;
386
407
  /** Animate fit/center/focus actions for 300ms by default. Per-action flags override this; reduced motion stays instant. */
387
408
  animateViewport?: boolean;
388
409
  disableAnimations?: boolean;
@@ -403,6 +424,7 @@ export declare interface FlowDiagramConfig {
403
424
  edgeMode?: EdgeMode;
404
425
  compactPropertyLayout?: boolean;
405
426
  nodeViewModes?: Record<string, NodeViewMode>;
427
+ allNodesIconLabel?: boolean;
406
428
  workflowContract?: WorkflowContract;
407
429
  /** Layout algorithm */
408
430
  layout?: LayoutAlgorithm;
@@ -420,6 +442,10 @@ export declare interface FlowDiagramConfig {
420
442
  parentNodeStyle?: ParentNodeStyle;
421
443
  /** Min zoom level (default: 0.01) */
422
444
  minZoom?: number;
445
+ nodeGridSpacing?: "collision" | "layout";
446
+ nodeGridConnections?: boolean;
447
+ bottomBarCollision?: boolean;
448
+ bottomBarFill?: boolean;
423
449
  /** Max zoom level (default: 1.5) */
424
450
  maxZoom?: number;
425
451
  /** Initial viewport position and zoom */
@@ -448,7 +474,7 @@ export declare interface FlowDiagramConfig {
448
474
  renderBottomBar?: (props: BottomBarRenderProps) => React.ReactNode;
449
475
  /** Built-in node/edge selection toolbars (bottom bar swaps to them on select). `false` disables. */
450
476
  selectionToolbar?: SelectionToolbarConfig | false;
451
- /** Custom node view components to override SDK defaults. Keys: objectView, arrayView, text, parentContainer */
477
+ /** Custom views: objectView, arrayView, text, parentContainer; jsxContent receives JsxContentRendererProps. */
452
478
  customViews?: Record<string, React.ComponentType<any>>;
453
479
  /** Disable built-in keyboard shortcuts (Z/M/D) when the consumer handles its own */
454
480
  disableKeyboardShortcuts?: boolean;
@@ -467,6 +493,8 @@ export declare interface FlowDiagramContextValue {
467
493
  setAllNodesIconLabel: (enabled: boolean) => void;
468
494
  nodeViewModes: Record<string, NodeViewMode>;
469
495
  setNodeViewMode: (nodeId: string, mode: NodeViewMode) => void;
496
+ nodeRadiusPreviews: Record<string, number>;
497
+ setNodeRadiusPreview: (ids: string[], radius: number | undefined) => void;
470
498
  spacing: number;
471
499
  edgeRadius: number | undefined;
472
500
  setEdgeRadius: (radius: number) => void;
@@ -507,6 +535,11 @@ export declare interface FlowDiagramContextValue {
507
535
  setIsPinned: (v: boolean) => void;
508
536
  isPerformanceMode: boolean;
509
537
  setIsPerformanceMode: (v: boolean) => void;
538
+ nodeGridOptions: NodeGridOptions | null;
539
+ setNodeGridOptions: (options: NodeGridOptions | null) => void;
540
+ lastNodeGridOptions: NodeGridOptions;
541
+ fillRadiusEditedIds: ReadonlySet<string>;
542
+ setFillRadiusEditedIds: (ids: Set<string>) => void;
510
543
  engineRef: React.MutableRefObject<FlowEngine | null>;
511
544
  callbacks: FlowDiagramCallbacks;
512
545
  config: FlowDiagramConfig;
@@ -639,6 +672,11 @@ export declare interface FlowEngine {
639
672
  clientToModel(clientX: number, clientY: number): Point;
640
673
  modelToClient(p: Point): Point;
641
674
  getNodeBox(id: string): Box | undefined;
675
+ detectNodeCollisions(options?: NodeCollisionOptions): NodeCollision[];
676
+ resolveNodeCollisions(options?: ResolveNodeCollisionsOptions): NodeCollisionResolution;
677
+ arrangeNodesInGrid(options?: NodeGridOptions): NodeGridArrangement;
678
+ setNodeGridMode(enabled: boolean, options?: NodeGridOptions): void;
679
+ swapGridNodes(source: string, target: string, animate?: boolean): boolean;
642
680
  setNodePosition(id: string, position: Point | undefined, options?: {
643
681
  persist?: boolean;
644
682
  }): boolean;
@@ -807,6 +845,18 @@ export declare function getInteractionSurface(surface: string, border: string):
807
845
 
808
846
  export declare function getNode(json: SqueedJson, address: string): any;
809
847
 
848
+ export declare function getSelectionRoots(json: SqueedJson, ids: string[]): string[];
849
+
850
+ declare interface GridDivider {
851
+ section: string;
852
+ axis: "x" | "y";
853
+ row: number;
854
+ index: number;
855
+ weights: number[];
856
+ length: number;
857
+ position: Point;
858
+ }
859
+
810
860
  export declare interface JsonPlaybackState {
811
861
  position: number;
812
862
  total: number;
@@ -822,11 +872,26 @@ export declare interface JsonStreamOptions<Document> {
822
872
  maxBytes?: number;
823
873
  }
824
874
 
875
+ export declare interface JsxContentRendererProps {
876
+ components: {
877
+ type: string;
878
+ [key: string]: unknown;
879
+ }[];
880
+ colorMode?: "light" | "dark";
881
+ fillHeight?: boolean;
882
+ }
883
+
825
884
  export declare type LayoutAlgorithm = "dagre" | "elk" | "tidytree" | "concentric" | "cose";
826
885
 
827
886
  export declare const LIGHT_BLACK = "#c6c6c6";
828
887
 
829
- export declare const NODE_TYPE_VIEWS: readonly ["", "icon-label", "object", "text"];
888
+ export declare function LoadingBorder({ active, label, radius, }: {
889
+ active?: boolean;
890
+ label?: string;
891
+ radius?: number;
892
+ }): JSX_2.Element;
893
+
894
+ export declare const NODE_TYPE_VIEWS: readonly ["", "icon-label", "object", "text", "grid", "parent"];
830
895
 
831
896
  export declare type NodeAlignment = "leading" | "center" | "trailing";
832
897
 
@@ -837,11 +902,31 @@ export declare function NodeBorderRadiusControl({ ids, showDivider, }: {
837
902
  showDivider?: boolean;
838
903
  }): JSX_2.Element;
839
904
 
905
+ export declare interface NodeCollision {
906
+ source: string;
907
+ target: string;
908
+ overlap: Point;
909
+ }
910
+
911
+ export declare interface NodeCollisionOptions {
912
+ margin?: number;
913
+ }
914
+
915
+ export declare interface NodeCollisionResolution {
916
+ positions: Map<string, Point>;
917
+ movedNodeIds: string[];
918
+ collisions: NodeCollision[];
919
+ iterations: number;
920
+ resolved: boolean;
921
+ }
922
+
840
923
  export declare function NodeConfigSummary({ nodeAddress, expanded, }: {
841
924
  nodeAddress: string;
842
925
  expanded?: boolean;
843
926
  }): JSX_2.Element;
844
927
 
928
+ export declare type NodeContent = string | Record<string, unknown>[];
929
+
845
930
  export declare function NodeForm({ nodeAddress, structured, }: {
846
931
  nodeAddress: string;
847
932
  structured?: boolean;
@@ -859,6 +944,38 @@ export declare function NodeFormPopover({ nodeAddress, active, label, open, onCl
859
944
  width?: number;
860
945
  }): JSX_2.Element;
861
946
 
947
+ export declare interface NodeGridArrangement {
948
+ dividers?: GridDivider[];
949
+ positions: Map<string, Point>;
950
+ movedNodeIds: string[];
951
+ skippedNodeIds: string[];
952
+ collisions: NodeCollision[];
953
+ bounds?: Rect;
954
+ sizes?: Map<string, {
955
+ w: number;
956
+ h: number;
957
+ }>;
958
+ }
959
+
960
+ export declare interface NodeGridOptions extends NodeCollisionOptions {
961
+ adjustment?: {
962
+ enabled?: boolean;
963
+ sections?: Record<string, {
964
+ rows?: number[];
965
+ columns?: number[][];
966
+ }>;
967
+ };
968
+ order?: string[];
969
+ columns?: number;
970
+ animate?: boolean;
971
+ gaps?: number | {
972
+ x: number;
973
+ y: number;
974
+ };
975
+ fill?: boolean;
976
+ padding?: number;
977
+ }
978
+
862
979
  export declare function NodeIconPicker({ nodeId, edgeId, value, open: requestedOpen, onOpenChange, }: {
863
980
  nodeId?: string;
864
981
  edgeId?: string;
@@ -894,9 +1011,10 @@ export declare interface NodeSelectionModifiers {
894
1011
  export declare type NodeSpacing = number | "compact" | "normal" | "spacious";
895
1012
 
896
1013
  /** Bottom-bar contents while one or more nodes are selected */
897
- export declare function NodeTools({ ids, onClose, }: {
1014
+ export declare function NodeTools({ ids, onClose, afterLabel, }: {
898
1015
  ids: string[];
899
1016
  onClose: () => void;
1017
+ afterLabel?: ReactNode;
900
1018
  }): JSX_2.Element;
901
1019
 
902
1020
  export declare type NodeTypeView = Exclude<(typeof NODE_TYPE_VIEWS)[number], "">;
@@ -976,6 +1094,13 @@ export declare function readFormSchema(file: Pick<File, "name" | "size" | "text"
976
1094
 
977
1095
  export declare function readWorkflowContract(file: File): Promise<WorkflowContract>;
978
1096
 
1097
+ declare interface Rect {
1098
+ x1: number;
1099
+ y1: number;
1100
+ x2: number;
1101
+ y2: number;
1102
+ }
1103
+
979
1104
  /** Removes explicit edges or suppresses a hierarchy edge without deleting its child. */
980
1105
  export declare function removeEdge(json: SqueedJson, edge: RenderedEdgeRef): {
981
1106
  json: SqueedJson;
@@ -995,6 +1120,8 @@ export declare interface RenderedEdgeRef extends FlowEdgeProperties {
995
1120
  };
996
1121
  }
997
1122
 
1123
+ export declare function reparentNode(json: SqueedJson, nodeId: string, parentId: string): SqueedJson;
1124
+
998
1125
  /**
999
1126
  * Resolve which JSON node carries an edge's keys.
1000
1127
  * parent→child edges (implicit hierarchy) are configured on the child;
@@ -1005,6 +1132,11 @@ export declare function resolveEdgeOwner(edge: RenderedEdgeRef): {
1005
1132
  kind: "hierarchy" | "target" | "connection";
1006
1133
  };
1007
1134
 
1135
+ export declare interface ResolveNodeCollisionsOptions extends NodeCollisionOptions {
1136
+ animate?: boolean;
1137
+ maxIterations?: number;
1138
+ }
1139
+
1008
1140
  export declare function resolveStateView(view: SqueedJson, state: SqueedJson): SqueedJson;
1009
1141
 
1010
1142
  declare interface RuntimeReference {
@@ -1180,11 +1312,14 @@ rememberAction?: boolean;
1180
1312
 
1181
1313
  export declare const ToolbarRangeInput: ForwardRefExoticComponent<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & RefAttributes<HTMLInputElement>>;
1182
1314
 
1183
- export declare function ToolbarScrollContainer({ children, background, border, endElement, }: {
1315
+ export declare function ToolbarScrollContainer({ children, background, border, endElement, startElement, startElementWidth, framed, }: {
1184
1316
  children: ReactNode;
1185
1317
  background: string;
1186
1318
  border: string;
1187
1319
  endElement?: ReactNode;
1320
+ startElement?: ReactNode;
1321
+ startElementWidth?: number;
1322
+ framed?: boolean;
1188
1323
  }): JSX_2.Element;
1189
1324
 
1190
1325
  export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, labelCase, "aria-label": label, ...triggerProps }: {
@@ -1294,6 +1429,8 @@ export declare function useThemeContentColors(color: any): {
1294
1429
  highlightColorFaint: string;
1295
1430
  };
1296
1431
 
1432
+ export declare function validateGridAdjustment(adjustment: NodeGridOptions["adjustment"]): void;
1433
+
1297
1434
  declare interface ViewportState {
1298
1435
  pan: Point;
1299
1436
  zoom: number;
package/dist/index.d.ts CHANGED
@@ -51,7 +51,9 @@ export declare type BackgroundVariant = BackgroundPattern | "transparent";
51
51
  export declare function bindSqueedCallbacks(json: SqueedJson, compiledEdges: FlowDiagramEdge[], callbacks: FlowDiagramCallbacks, onJsonChange?: (json: SqueedJson, change: SqueedChange) => void, formSchema?: FormSchema): FlowDiagramCallbacks;
52
52
 
53
53
  export declare const BottomBar: MemoExoticComponent< {
54
- (): JSX_2.Element;
54
+ ({ nodeGridControlsTarget, }?: {
55
+ nodeGridControlsTarget?: HTMLElement | null;
56
+ }): JSX_2.Element;
55
57
  displayName: string;
56
58
  }>;
57
59
 
@@ -169,6 +171,8 @@ export declare type ContractType = {
169
171
  ports?: Record<string, ContractPort>;
170
172
  };
171
173
 
174
+ export declare function copySelection(json: SqueedJson, ids: string[]): SqueedJson;
175
+
172
176
  export declare function createFlowDiagram(jsnObjct: any, path?: string, nodes?: any[], edges?: any[], activeLabel?: string, flowConfig?: any, nodeConfig?: any): {
173
177
  nodes: any[];
174
178
  edges: any[];
@@ -243,6 +247,11 @@ export declare function DiagramAppearanceControls(): JSX_2.Element;
243
247
 
244
248
  export declare function downloadSvg(canvas: HTMLElement, filename?: string): Promise<void>;
245
249
 
250
+ export declare function duplicateSelection(json: SqueedJson, ids: string[]): {
251
+ json: SqueedJson;
252
+ ids: string[];
253
+ };
254
+
246
255
  export declare const DynamicIcon: ({ name, svg, ...props }: {
247
256
  [x: string]: any;
248
257
  name: any;
@@ -284,6 +293,8 @@ export declare function FlowDiagram({ loading, loader, ...props }: FlowDiagramPr
284
293
 
285
294
  /** Event callbacks for the flow diagram */
286
295
  export declare interface FlowDiagramCallbacks {
296
+ onNodesCopy?: (ids: string[]) => boolean | void | Promise<boolean | void>;
297
+ onNodesDuplicate?: (ids: string[]) => boolean | void;
287
298
  onGraphEdgeColorChange?: (color: string) => void;
288
299
  onAllNodesIconLabelChange?: (enabled: boolean) => void;
289
300
  onNodeCreateRequest?: (request: FlowNodeCreationRequest) => boolean;
@@ -295,6 +306,13 @@ export declare interface FlowDiagramCallbacks {
295
306
  onEdgeRadiusChange?: (radius: number) => void;
296
307
  onCompactPropertyLayoutChange?: (enabled: boolean) => void;
297
308
  onBackgroundVariantChange?: (variant: BackgroundVariant) => void;
309
+ onNodeGridZoomOut?: (options: NodeGridOptions) => boolean;
310
+ onNodeGridFillRequest?: (options: NodeGridOptions) => boolean;
311
+ onNodeGridModeRequest?: (enabled: boolean, options: NodeGridOptions) => boolean;
312
+ onNodeGridDrop?: (nodeId: string, point: {
313
+ x: number;
314
+ y: number;
315
+ }, modifiers?: NodeSelectionModifiers) => boolean;
298
316
  /** Fires when a node is clicked/selected */
299
317
  onNodeSelect?: (nodeId: string, nodeData: any, modifiers?: NodeSelectionModifiers) => void;
300
318
  onBackgroundClick?: () => void;
@@ -312,14 +330,16 @@ export declare interface FlowDiagramCallbacks {
312
330
  position: any;
313
331
  sourceNodeId?: string;
314
332
  isArrayMode?: boolean;
315
- }) => void;
333
+ }) => boolean | void;
316
334
  /** Fires when a node is deleted */
317
335
  onNodeDelete?: (nodeId: string, nodeData: any) => void;
318
336
  /** Fires when a node label is edited inline */
319
337
  onNodeLabelChange?: (nodeId: string, newLabel: string) => void;
320
- onNodeContentChange?: (nodeId: string, content: string) => void;
338
+ onNodeSubtitleChange?: (nodeId: string, subtitle: string) => void;
339
+ onNodeContentChange?: (nodeId: string, content: NodeContent) => void;
321
340
  /** Fires when a node's collapse toggle is clicked */
322
341
  onNodeCollapse?: (nodeId: string, collapsed: boolean) => void;
342
+ onNodeParentChange?: (nodeId: string, parentId: string) => void;
323
343
  /** Fires when a node's color is changed via the toolbar */
324
344
  onNodeColorChange?: (nodeId: string, colorType: "text" | "bg", color: string) => void;
325
345
  /** Fires when a node's icon is changed via the toolbar */
@@ -383,6 +403,7 @@ export declare interface FlowDiagramCallbacks {
383
403
  export declare interface FlowDiagramConfig {
384
404
  bottomBarExtra?: React.ReactNode;
385
405
  bottomBarCollapsed?: boolean;
406
+ bottomBarNavigation?: boolean;
386
407
  /** Animate fit/center/focus actions for 300ms by default. Per-action flags override this; reduced motion stays instant. */
387
408
  animateViewport?: boolean;
388
409
  disableAnimations?: boolean;
@@ -403,6 +424,7 @@ export declare interface FlowDiagramConfig {
403
424
  edgeMode?: EdgeMode;
404
425
  compactPropertyLayout?: boolean;
405
426
  nodeViewModes?: Record<string, NodeViewMode>;
427
+ allNodesIconLabel?: boolean;
406
428
  workflowContract?: WorkflowContract;
407
429
  /** Layout algorithm */
408
430
  layout?: LayoutAlgorithm;
@@ -420,6 +442,10 @@ export declare interface FlowDiagramConfig {
420
442
  parentNodeStyle?: ParentNodeStyle;
421
443
  /** Min zoom level (default: 0.01) */
422
444
  minZoom?: number;
445
+ nodeGridSpacing?: "collision" | "layout";
446
+ nodeGridConnections?: boolean;
447
+ bottomBarCollision?: boolean;
448
+ bottomBarFill?: boolean;
423
449
  /** Max zoom level (default: 1.5) */
424
450
  maxZoom?: number;
425
451
  /** Initial viewport position and zoom */
@@ -448,7 +474,7 @@ export declare interface FlowDiagramConfig {
448
474
  renderBottomBar?: (props: BottomBarRenderProps) => React.ReactNode;
449
475
  /** Built-in node/edge selection toolbars (bottom bar swaps to them on select). `false` disables. */
450
476
  selectionToolbar?: SelectionToolbarConfig | false;
451
- /** Custom node view components to override SDK defaults. Keys: objectView, arrayView, text, parentContainer */
477
+ /** Custom views: objectView, arrayView, text, parentContainer; jsxContent receives JsxContentRendererProps. */
452
478
  customViews?: Record<string, React.ComponentType<any>>;
453
479
  /** Disable built-in keyboard shortcuts (Z/M/D) when the consumer handles its own */
454
480
  disableKeyboardShortcuts?: boolean;
@@ -467,6 +493,8 @@ export declare interface FlowDiagramContextValue {
467
493
  setAllNodesIconLabel: (enabled: boolean) => void;
468
494
  nodeViewModes: Record<string, NodeViewMode>;
469
495
  setNodeViewMode: (nodeId: string, mode: NodeViewMode) => void;
496
+ nodeRadiusPreviews: Record<string, number>;
497
+ setNodeRadiusPreview: (ids: string[], radius: number | undefined) => void;
470
498
  spacing: number;
471
499
  edgeRadius: number | undefined;
472
500
  setEdgeRadius: (radius: number) => void;
@@ -507,6 +535,11 @@ export declare interface FlowDiagramContextValue {
507
535
  setIsPinned: (v: boolean) => void;
508
536
  isPerformanceMode: boolean;
509
537
  setIsPerformanceMode: (v: boolean) => void;
538
+ nodeGridOptions: NodeGridOptions | null;
539
+ setNodeGridOptions: (options: NodeGridOptions | null) => void;
540
+ lastNodeGridOptions: NodeGridOptions;
541
+ fillRadiusEditedIds: ReadonlySet<string>;
542
+ setFillRadiusEditedIds: (ids: Set<string>) => void;
510
543
  engineRef: React.MutableRefObject<FlowEngine | null>;
511
544
  callbacks: FlowDiagramCallbacks;
512
545
  config: FlowDiagramConfig;
@@ -639,6 +672,11 @@ export declare interface FlowEngine {
639
672
  clientToModel(clientX: number, clientY: number): Point;
640
673
  modelToClient(p: Point): Point;
641
674
  getNodeBox(id: string): Box | undefined;
675
+ detectNodeCollisions(options?: NodeCollisionOptions): NodeCollision[];
676
+ resolveNodeCollisions(options?: ResolveNodeCollisionsOptions): NodeCollisionResolution;
677
+ arrangeNodesInGrid(options?: NodeGridOptions): NodeGridArrangement;
678
+ setNodeGridMode(enabled: boolean, options?: NodeGridOptions): void;
679
+ swapGridNodes(source: string, target: string, animate?: boolean): boolean;
642
680
  setNodePosition(id: string, position: Point | undefined, options?: {
643
681
  persist?: boolean;
644
682
  }): boolean;
@@ -807,6 +845,18 @@ export declare function getInteractionSurface(surface: string, border: string):
807
845
 
808
846
  export declare function getNode(json: SqueedJson, address: string): any;
809
847
 
848
+ export declare function getSelectionRoots(json: SqueedJson, ids: string[]): string[];
849
+
850
+ declare interface GridDivider {
851
+ section: string;
852
+ axis: "x" | "y";
853
+ row: number;
854
+ index: number;
855
+ weights: number[];
856
+ length: number;
857
+ position: Point;
858
+ }
859
+
810
860
  export declare interface JsonPlaybackState {
811
861
  position: number;
812
862
  total: number;
@@ -822,11 +872,26 @@ export declare interface JsonStreamOptions<Document> {
822
872
  maxBytes?: number;
823
873
  }
824
874
 
875
+ export declare interface JsxContentRendererProps {
876
+ components: {
877
+ type: string;
878
+ [key: string]: unknown;
879
+ }[];
880
+ colorMode?: "light" | "dark";
881
+ fillHeight?: boolean;
882
+ }
883
+
825
884
  export declare type LayoutAlgorithm = "dagre" | "elk" | "tidytree" | "concentric" | "cose";
826
885
 
827
886
  export declare const LIGHT_BLACK = "#c6c6c6";
828
887
 
829
- export declare const NODE_TYPE_VIEWS: readonly ["", "icon-label", "object", "text"];
888
+ export declare function LoadingBorder({ active, label, radius, }: {
889
+ active?: boolean;
890
+ label?: string;
891
+ radius?: number;
892
+ }): JSX_2.Element;
893
+
894
+ export declare const NODE_TYPE_VIEWS: readonly ["", "icon-label", "object", "text", "grid", "parent"];
830
895
 
831
896
  export declare type NodeAlignment = "leading" | "center" | "trailing";
832
897
 
@@ -837,11 +902,31 @@ export declare function NodeBorderRadiusControl({ ids, showDivider, }: {
837
902
  showDivider?: boolean;
838
903
  }): JSX_2.Element;
839
904
 
905
+ export declare interface NodeCollision {
906
+ source: string;
907
+ target: string;
908
+ overlap: Point;
909
+ }
910
+
911
+ export declare interface NodeCollisionOptions {
912
+ margin?: number;
913
+ }
914
+
915
+ export declare interface NodeCollisionResolution {
916
+ positions: Map<string, Point>;
917
+ movedNodeIds: string[];
918
+ collisions: NodeCollision[];
919
+ iterations: number;
920
+ resolved: boolean;
921
+ }
922
+
840
923
  export declare function NodeConfigSummary({ nodeAddress, expanded, }: {
841
924
  nodeAddress: string;
842
925
  expanded?: boolean;
843
926
  }): JSX_2.Element;
844
927
 
928
+ export declare type NodeContent = string | Record<string, unknown>[];
929
+
845
930
  export declare function NodeForm({ nodeAddress, structured, }: {
846
931
  nodeAddress: string;
847
932
  structured?: boolean;
@@ -859,6 +944,38 @@ export declare function NodeFormPopover({ nodeAddress, active, label, open, onCl
859
944
  width?: number;
860
945
  }): JSX_2.Element;
861
946
 
947
+ export declare interface NodeGridArrangement {
948
+ dividers?: GridDivider[];
949
+ positions: Map<string, Point>;
950
+ movedNodeIds: string[];
951
+ skippedNodeIds: string[];
952
+ collisions: NodeCollision[];
953
+ bounds?: Rect;
954
+ sizes?: Map<string, {
955
+ w: number;
956
+ h: number;
957
+ }>;
958
+ }
959
+
960
+ export declare interface NodeGridOptions extends NodeCollisionOptions {
961
+ adjustment?: {
962
+ enabled?: boolean;
963
+ sections?: Record<string, {
964
+ rows?: number[];
965
+ columns?: number[][];
966
+ }>;
967
+ };
968
+ order?: string[];
969
+ columns?: number;
970
+ animate?: boolean;
971
+ gaps?: number | {
972
+ x: number;
973
+ y: number;
974
+ };
975
+ fill?: boolean;
976
+ padding?: number;
977
+ }
978
+
862
979
  export declare function NodeIconPicker({ nodeId, edgeId, value, open: requestedOpen, onOpenChange, }: {
863
980
  nodeId?: string;
864
981
  edgeId?: string;
@@ -894,9 +1011,10 @@ export declare interface NodeSelectionModifiers {
894
1011
  export declare type NodeSpacing = number | "compact" | "normal" | "spacious";
895
1012
 
896
1013
  /** Bottom-bar contents while one or more nodes are selected */
897
- export declare function NodeTools({ ids, onClose, }: {
1014
+ export declare function NodeTools({ ids, onClose, afterLabel, }: {
898
1015
  ids: string[];
899
1016
  onClose: () => void;
1017
+ afterLabel?: ReactNode;
900
1018
  }): JSX_2.Element;
901
1019
 
902
1020
  export declare type NodeTypeView = Exclude<(typeof NODE_TYPE_VIEWS)[number], "">;
@@ -976,6 +1094,13 @@ export declare function readFormSchema(file: Pick<File, "name" | "size" | "text"
976
1094
 
977
1095
  export declare function readWorkflowContract(file: File): Promise<WorkflowContract>;
978
1096
 
1097
+ declare interface Rect {
1098
+ x1: number;
1099
+ y1: number;
1100
+ x2: number;
1101
+ y2: number;
1102
+ }
1103
+
979
1104
  /** Removes explicit edges or suppresses a hierarchy edge without deleting its child. */
980
1105
  export declare function removeEdge(json: SqueedJson, edge: RenderedEdgeRef): {
981
1106
  json: SqueedJson;
@@ -995,6 +1120,8 @@ export declare interface RenderedEdgeRef extends FlowEdgeProperties {
995
1120
  };
996
1121
  }
997
1122
 
1123
+ export declare function reparentNode(json: SqueedJson, nodeId: string, parentId: string): SqueedJson;
1124
+
998
1125
  /**
999
1126
  * Resolve which JSON node carries an edge's keys.
1000
1127
  * parent→child edges (implicit hierarchy) are configured on the child;
@@ -1005,6 +1132,11 @@ export declare function resolveEdgeOwner(edge: RenderedEdgeRef): {
1005
1132
  kind: "hierarchy" | "target" | "connection";
1006
1133
  };
1007
1134
 
1135
+ export declare interface ResolveNodeCollisionsOptions extends NodeCollisionOptions {
1136
+ animate?: boolean;
1137
+ maxIterations?: number;
1138
+ }
1139
+
1008
1140
  export declare function resolveStateView(view: SqueedJson, state: SqueedJson): SqueedJson;
1009
1141
 
1010
1142
  declare interface RuntimeReference {
@@ -1180,11 +1312,14 @@ rememberAction?: boolean;
1180
1312
 
1181
1313
  export declare const ToolbarRangeInput: ForwardRefExoticComponent<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & RefAttributes<HTMLInputElement>>;
1182
1314
 
1183
- export declare function ToolbarScrollContainer({ children, background, border, endElement, }: {
1315
+ export declare function ToolbarScrollContainer({ children, background, border, endElement, startElement, startElementWidth, framed, }: {
1184
1316
  children: ReactNode;
1185
1317
  background: string;
1186
1318
  border: string;
1187
1319
  endElement?: ReactNode;
1320
+ startElement?: ReactNode;
1321
+ startElementWidth?: number;
1322
+ framed?: boolean;
1188
1323
  }): JSX_2.Element;
1189
1324
 
1190
1325
  export declare function ToolbarSelect({ children, value, onValueChange, disabled, style, title, icon, popupContent, footer, labelCase, "aria-label": label, ...triggerProps }: {
@@ -1294,6 +1429,8 @@ export declare function useThemeContentColors(color: any): {
1294
1429
  highlightColorFaint: string;
1295
1430
  };
1296
1431
 
1432
+ export declare function validateGridAdjustment(adjustment: NodeGridOptions["adjustment"]): void;
1433
+
1297
1434
  declare interface ViewportState {
1298
1435
  pan: Point;
1299
1436
  zoom: number;