@pixerate/editor 0.22.0 → 0.24.0

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 (188) hide show
  1. package/README.md +175 -2
  2. package/THIRD_PARTY_NOTICES.md +139 -0
  3. package/dist/agent/index.cjs +87 -111
  4. package/dist/agent/index.cjs.map +1 -1
  5. package/dist/agent/index.d.cts +70 -211
  6. package/dist/agent/index.d.ts +70 -211
  7. package/dist/agent/index.js +78 -102
  8. package/dist/agent/index.js.map +1 -1
  9. package/dist/arrangeShortcuts-B8O3f8-P.d.cts +184 -0
  10. package/dist/arrangeShortcuts-sLlD2rSX.d.ts +184 -0
  11. package/dist/canvas/index.cjs +2075 -86
  12. package/dist/canvas/index.cjs.map +1 -1
  13. package/dist/canvas/index.d.cts +608 -186
  14. package/dist/canvas/index.d.ts +608 -186
  15. package/dist/canvas/index.js +2060 -71
  16. package/dist/canvas/index.js.map +1 -1
  17. package/dist/chunk-26BVFKHU.cjs +453 -0
  18. package/dist/chunk-26BVFKHU.cjs.map +1 -0
  19. package/dist/chunk-2H7ZHPEJ.js +762 -0
  20. package/dist/chunk-2H7ZHPEJ.js.map +1 -0
  21. package/dist/{chunk-DENSCKFC.js → chunk-3CN2WD3X.js} +1730 -189
  22. package/dist/chunk-3CN2WD3X.js.map +1 -0
  23. package/dist/{chunk-JJDLPEWL.js → chunk-3LV6RRPH.js} +2 -2
  24. package/dist/{chunk-MJZBNWG7.js → chunk-5S3Z4PPF.js} +78 -557
  25. package/dist/chunk-5S3Z4PPF.js.map +1 -0
  26. package/dist/chunk-664LQYFJ.js +115 -0
  27. package/dist/chunk-664LQYFJ.js.map +1 -0
  28. package/dist/chunk-7DWMJCAT.js +453 -0
  29. package/dist/chunk-7DWMJCAT.js.map +1 -0
  30. package/dist/chunk-ARRTP33I.js +101 -0
  31. package/dist/chunk-ARRTP33I.js.map +1 -0
  32. package/dist/chunk-CPOKFNBG.cjs +101 -0
  33. package/dist/chunk-CPOKFNBG.cjs.map +1 -0
  34. package/dist/{chunk-AA4ZEVCC.cjs → chunk-D27YFC46.cjs} +101 -580
  35. package/dist/chunk-D27YFC46.cjs.map +1 -0
  36. package/dist/chunk-D6FH2YAX.cjs +131 -0
  37. package/dist/chunk-D6FH2YAX.cjs.map +1 -0
  38. package/dist/{chunk-4SUNJZWB.cjs → chunk-FD4LPFAE.cjs} +48 -200
  39. package/dist/chunk-FD4LPFAE.cjs.map +1 -0
  40. package/dist/chunk-FODNLX5N.js +749 -0
  41. package/dist/chunk-FODNLX5N.js.map +1 -0
  42. package/dist/{chunk-OYXSKQFR.js → chunk-FPENXAEJ.js} +35 -187
  43. package/dist/chunk-FPENXAEJ.js.map +1 -0
  44. package/dist/chunk-G2I4QJOT.cjs +762 -0
  45. package/dist/chunk-G2I4QJOT.cjs.map +1 -0
  46. package/dist/chunk-HLIMTC6N.js +1 -0
  47. package/dist/chunk-HLIMTC6N.js.map +1 -0
  48. package/dist/{chunk-QGHGJ56O.js → chunk-ITBSKI26.js} +1483 -19
  49. package/dist/chunk-ITBSKI26.js.map +1 -0
  50. package/dist/{chunk-6M3BCTBD.cjs → chunk-MA2F5KHF.cjs} +470 -242
  51. package/dist/chunk-MA2F5KHF.cjs.map +1 -0
  52. package/dist/{chunk-SAZRENEZ.cjs → chunk-MCSJFWAO.cjs} +1733 -192
  53. package/dist/chunk-MCSJFWAO.cjs.map +1 -0
  54. package/dist/chunk-MKA3AHLV.cjs +256 -0
  55. package/dist/chunk-MKA3AHLV.cjs.map +1 -0
  56. package/dist/chunk-OLZJXL4R.cjs +749 -0
  57. package/dist/chunk-OLZJXL4R.cjs.map +1 -0
  58. package/dist/chunk-OXSV64JX.js +689 -0
  59. package/dist/chunk-OXSV64JX.js.map +1 -0
  60. package/dist/chunk-P3RQ5UJE.cjs +689 -0
  61. package/dist/chunk-P3RQ5UJE.cjs.map +1 -0
  62. package/dist/chunk-P6ODPZ4W.js +256 -0
  63. package/dist/chunk-P6ODPZ4W.js.map +1 -0
  64. package/dist/chunk-PGNZKFQS.js +685 -0
  65. package/dist/chunk-PGNZKFQS.js.map +1 -0
  66. package/dist/chunk-PL4JB3BF.cjs +1 -0
  67. package/dist/chunk-PL4JB3BF.cjs.map +1 -0
  68. package/dist/{chunk-GVSMRPHB.cjs → chunk-SBCZ6RN5.cjs} +1568 -104
  69. package/dist/chunk-SBCZ6RN5.cjs.map +1 -0
  70. package/dist/{chunk-CL37JGFW.cjs → chunk-SML64VJG.cjs} +4 -4
  71. package/dist/{chunk-CL37JGFW.cjs.map → chunk-SML64VJG.cjs.map} +1 -1
  72. package/dist/chunk-TNNJXF46.cjs +115 -0
  73. package/dist/chunk-TNNJXF46.cjs.map +1 -0
  74. package/dist/chunk-U5HZSFCS.js +131 -0
  75. package/dist/chunk-U5HZSFCS.js.map +1 -0
  76. package/dist/{chunk-RU52I7QO.js → chunk-U5KWZU4X.js} +388 -160
  77. package/dist/chunk-U5KWZU4X.js.map +1 -0
  78. package/dist/chunk-XNORY7M6.cjs +685 -0
  79. package/dist/chunk-XNORY7M6.cjs.map +1 -0
  80. package/dist/commands/index.cjs +860 -0
  81. package/dist/commands/index.cjs.map +1 -0
  82. package/dist/commands/index.d.cts +244 -0
  83. package/dist/commands/index.d.ts +244 -0
  84. package/dist/commands/index.js +860 -0
  85. package/dist/commands/index.js.map +1 -0
  86. package/dist/comment-store-BEMgVlAA.d.cts +135 -0
  87. package/dist/comment-store-BEMgVlAA.d.ts +135 -0
  88. package/dist/compare/index.cjs +15 -0
  89. package/dist/compare/index.cjs.map +1 -0
  90. package/dist/compare/index.d.cts +58 -0
  91. package/dist/compare/index.d.ts +58 -0
  92. package/dist/compare/index.js +15 -0
  93. package/dist/compare/index.js.map +1 -0
  94. package/dist/{controller-B7GIybc4.d.cts → controller-BhLLAoi8.d.cts} +119 -5
  95. package/dist/{controller-B7GIybc4.d.ts → controller-BhLLAoi8.d.ts} +119 -5
  96. package/dist/documents-BQjzJNe2.d.ts +76 -0
  97. package/dist/documents-KRTPhvst.d.cts +76 -0
  98. package/dist/extensions/index.cjs +53 -5
  99. package/dist/extensions/index.cjs.map +1 -1
  100. package/dist/extensions/index.d.cts +7 -3
  101. package/dist/extensions/index.d.ts +7 -3
  102. package/dist/extensions/index.js +52 -4
  103. package/dist/generation/index.cjs +1373 -0
  104. package/dist/generation/index.cjs.map +1 -0
  105. package/dist/generation/index.d.cts +554 -0
  106. package/dist/generation/index.d.ts +554 -0
  107. package/dist/generation/index.js +1373 -0
  108. package/dist/generation/index.js.map +1 -0
  109. package/dist/grammar/index.cjs +48 -3
  110. package/dist/grammar/index.cjs.map +1 -1
  111. package/dist/grammar/index.d.cts +322 -100
  112. package/dist/grammar/index.d.ts +322 -100
  113. package/dist/grammar/index.js +54 -9
  114. package/dist/history/index.cjs +12 -2
  115. package/dist/history/index.cjs.map +1 -1
  116. package/dist/history/index.d.cts +211 -7
  117. package/dist/history/index.d.ts +211 -7
  118. package/dist/history/index.js +13 -3
  119. package/dist/image-editor/index.cjs +2244 -38
  120. package/dist/image-editor/index.cjs.map +1 -1
  121. package/dist/image-editor/index.d.cts +742 -4
  122. package/dist/image-editor/index.d.ts +742 -4
  123. package/dist/image-editor/index.js +2222 -16
  124. package/dist/image-editor/index.js.map +1 -1
  125. package/dist/{index-CCr_z9kF.d.cts → index-BhJBSm2d.d.cts} +370 -4
  126. package/dist/{index-Ck6ajwXh.d.ts → index-fJrlkJCd.d.ts} +370 -4
  127. package/dist/index.cjs +193 -98
  128. package/dist/index.cjs.map +1 -1
  129. package/dist/index.d.cts +17 -48
  130. package/dist/index.d.ts +17 -48
  131. package/dist/index.js +198 -103
  132. package/dist/index.js.map +1 -1
  133. package/dist/migrate-iTlm3a8h.d.cts +112 -0
  134. package/dist/migrate-iTlm3a8h.d.ts +112 -0
  135. package/dist/persistence/index.cjs +676 -0
  136. package/dist/persistence/index.cjs.map +1 -0
  137. package/dist/persistence/index.d.cts +347 -0
  138. package/dist/persistence/index.d.ts +347 -0
  139. package/dist/persistence/index.js +676 -0
  140. package/dist/persistence/index.js.map +1 -0
  141. package/dist/registry-BDe-vlv3.d.ts +171 -0
  142. package/dist/registry-D32LpIc4.d.cts +354 -0
  143. package/dist/registry-DnzpgY27.d.cts +171 -0
  144. package/dist/registry-evKTP4ls.d.ts +354 -0
  145. package/dist/schema-DYDGdYL9.d.cts +41 -0
  146. package/dist/schema-DYDGdYL9.d.ts +41 -0
  147. package/dist/serializers/index.cjs +4 -3
  148. package/dist/serializers/index.cjs.map +1 -1
  149. package/dist/serializers/index.d.cts +2 -1
  150. package/dist/serializers/index.d.ts +2 -1
  151. package/dist/serializers/index.js +3 -2
  152. package/dist/sourcemap-C8AH3MBQ.d.cts +91 -0
  153. package/dist/sourcemap-DA1Evhrv.d.ts +91 -0
  154. package/dist/spreadsheet/index.cjs +53 -3
  155. package/dist/spreadsheet/index.cjs.map +1 -1
  156. package/dist/spreadsheet/index.d.cts +247 -18
  157. package/dist/spreadsheet/index.d.ts +247 -18
  158. package/dist/spreadsheet/index.js +58 -8
  159. package/dist/{tokens-CyLZmIei.d.cts → tokens-D7yXvUU6.d.cts} +15 -2
  160. package/dist/{tokens-CyLZmIei.d.ts → tokens-D7yXvUU6.d.ts} +15 -2
  161. package/dist/{track-changes-BSF58RK0.d.cts → track-changes-BK5sVf4_.d.cts} +18 -136
  162. package/dist/{track-changes-BSF58RK0.d.ts → track-changes-CDjCrwKe.d.ts} +18 -136
  163. package/dist/{types-CJ4U-HHI.d.ts → types-DX4Mh4SL.d.cts} +1 -1
  164. package/dist/{types-CJ4U-HHI.d.cts → types-DX4Mh4SL.d.ts} +1 -1
  165. package/dist/types-GT5a5YAX.d.cts +86 -0
  166. package/dist/types-GT5a5YAX.d.ts +86 -0
  167. package/package.json +23 -2
  168. package/dist/chunk-2TWGLC5K.cjs +0 -262
  169. package/dist/chunk-2TWGLC5K.cjs.map +0 -1
  170. package/dist/chunk-4SUNJZWB.cjs.map +0 -1
  171. package/dist/chunk-6M3BCTBD.cjs.map +0 -1
  172. package/dist/chunk-AA4ZEVCC.cjs.map +0 -1
  173. package/dist/chunk-AXV2ZW34.cjs +0 -118
  174. package/dist/chunk-AXV2ZW34.cjs.map +0 -1
  175. package/dist/chunk-B2ZRLN4S.js +0 -118
  176. package/dist/chunk-B2ZRLN4S.js.map +0 -1
  177. package/dist/chunk-DENSCKFC.js.map +0 -1
  178. package/dist/chunk-GVSMRPHB.cjs.map +0 -1
  179. package/dist/chunk-KAADNAPF.js +0 -262
  180. package/dist/chunk-KAADNAPF.js.map +0 -1
  181. package/dist/chunk-MJZBNWG7.js.map +0 -1
  182. package/dist/chunk-OYXSKQFR.js.map +0 -1
  183. package/dist/chunk-QGHGJ56O.js.map +0 -1
  184. package/dist/chunk-RU52I7QO.js.map +0 -1
  185. package/dist/chunk-SAZRENEZ.cjs.map +0 -1
  186. package/dist/types-BZgcDsC5.d.cts +0 -42
  187. package/dist/types-BZgcDsC5.d.ts +0 -42
  188. /package/dist/{chunk-JJDLPEWL.js.map → chunk-3LV6RRPH.js.map} +0 -0
@@ -1,6 +1,8 @@
1
- import { R as Rect, C as CanvasNode, X as XYPosition, a as CanvasEdge, I as IncrementalLayoutOptions, S as Side, b as CanvasLayoutOptions, P as PlaceBesideOptions, T as TrajectoryFunction, F as FanOutTrajectoryOptions, N as NodeTransition, c as CanvasNodeStyle, d as ReflowDisplacementOptions, D as DirectionalDisplacementOptions, e as CanvasClipboardPayload, f as Position, g as Point } from '../types-CJ4U-HHI.cjs';
2
- export { h as CanvasDockingCallbacks, i as CollapseNodeOptions, j as DisplacementDirection, k as DockStrategy, E as ExplodeNodeOptions, l as ExplosionSnapshot, G as GraphDifferences, m as TrajectoryPoint } from '../types-CJ4U-HHI.cjs';
3
- import { C as Command } from '../types-BZgcDsC5.cjs';
1
+ import { R as Rect, C as CanvasNode, X as XYPosition, b as CanvasEdge, I as IncrementalLayoutOptions, S as Side, c as CanvasLayoutOptions, P as PlaceBesideOptions, T as TrajectoryFunction, F as FanOutTrajectoryOptions, N as NodeTransition, a as CanvasNodeStyle, d as ReflowDisplacementOptions, D as DirectionalDisplacementOptions, e as CanvasClipboardPayload, f as Position, g as Point } from '../types-DX4Mh4SL.cjs';
2
+ export { h as CanvasDockingCallbacks, i as CollapseNodeOptions, j as DisplacementDirection, k as DockStrategy, E as ExplodeNodeOptions, l as ExplosionSnapshot, G as GraphDifferences, m as TrajectoryPoint } from '../types-DX4Mh4SL.cjs';
3
+ import { b as CanvasNodeUpdate, N as NodeRectOptions, A as AlignEdge, c as AlignNodesOptions, D as DistributeAxis, a as DistributeMode, d as DistributeNodesOptions, S as SizeDimension, M as MatchSizeOptions, Z as ZOrderOperation, C as CanvasArrangeAction } from '../arrangeShortcuts-B8O3f8-P.cjs';
4
+ export { e as ArrangeShortcutBinding, f as DEFAULT_ARRANGE_SHORTCUTS, L as LOCKED_DATA_KEY, g as LOCKED_PREVIOUS_FLAGS_KEY, h as alignNodes, i as applyNodeUpdates, j as createNodeLookup, k as distributeNodes, l as getAbsolutePosition, m as getNodeRect, n as getNodeSize, o as invertNodeUpdates, p as isLocked, q as lockNodes, r as matchArrangeShortcut, s as matchSize, t as readStyleSize, u as reorderNodes, v as toggleLockNodes, w as unlockNodes, x as withStyleSize } from '../arrangeShortcuts-B8O3f8-P.cjs';
5
+ import { C as Command } from '../types-GT5a5YAX.cjs';
4
6
 
5
7
  declare const DEFAULT_NODE_WIDTH = 200;
6
8
  declare const DEFAULT_NODE_HEIGHT = 60;
@@ -328,172 +330,30 @@ declare function blendLayout<TNode extends CanvasNode = CanvasNode>(from: TNode[
328
330
  */
329
331
  declare function connectedOnly<TNode extends CanvasNode = CanvasNode, TEdge extends CanvasEdge = CanvasEdge>(nodes: TNode[], edges: TEdge[]): TNode[];
330
332
 
331
- /**
332
- * Edge (or centre line) used by `alignNodes`.
333
- * `center` aligns horizontal centres (a vertical line); `middle` aligns vertical centres.
334
- */
335
- type AlignEdge = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
336
- /** Axis used by `distributeNodes`. `both` distributes horizontally and vertically. */
337
- type DistributeAxis = 'horizontal' | 'vertical' | 'both';
338
- /**
339
- * `gaps` leaves equal space between neighbouring nodes, `centres` spaces their centres equally.
340
- */
341
- type DistributeMode = 'gaps' | 'centres';
342
- /** Dimension(s) copied by `matchSize`. */
343
- type SizeDimension = 'width' | 'height' | 'both';
344
- /**
345
- * Partial node change produced by the arrange helpers. `position` is in the node's own
346
- * coordinate space (relative to its `parentId` parent when it has one).
347
- */
348
- interface CanvasNodeUpdate {
349
- id: string;
350
- position?: XYPosition;
351
- width?: number;
352
- height?: number;
353
- zIndex?: number;
354
- }
355
- interface NodeRectOptions {
356
- /** Width used when a node has no measured, explicit or style size and estimation is off. */
357
- defaultWidth?: number;
358
- /** Height used when a node has no measured, explicit or style size and estimation is off. */
359
- defaultHeight?: number;
360
- /** Estimate unmeasured node sizes from their label via `estimateNodeSize` (default `true`). */
361
- estimate?: boolean;
362
- }
363
- /** Data key marking a node as locked. See `lockNodes`. */
364
- declare const LOCKED_DATA_KEY = "locked";
365
- /** Data key holding the interaction flags a node had before it was locked. */
366
- declare const LOCKED_PREVIOUS_FLAGS_KEY = "lockedPrevious";
367
- /**
368
- * Reads a pixel `width` / `height` from a node style, which may be a CSS string (SvelteFlow)
369
- * or a style object (React Flow). Non-pixel values (`%`, `auto`, ...) are ignored.
370
- */
371
- declare function readStyleSize(style: CanvasNodeStyle | undefined | null): {
372
- width?: number;
373
- height?: number;
374
- };
375
- /**
376
- * Returns `style` with its pixel `width` / `height` replaced, keeping its representation
377
- * (string or object). Only dimensions already present in the style are rewritten, because
378
- * xyflow applies the node's own `width` / `height` props otherwise.
379
- */
380
- declare function withStyleSize(style: CanvasNodeStyle | undefined | null, size: {
381
- width?: number;
382
- height?: number;
383
- }): CanvasNodeStyle | undefined;
384
- /**
385
- * Resolves a node's size: measured DOM size, then explicit `width` / `height`, then a pixel
386
- * size in `style`, then a label-based estimate (or the defaults when `estimate` is `false`).
387
- */
388
- declare function getNodeSize(node: CanvasNode, options?: NodeRectOptions): {
389
- width: number;
390
- height: number;
391
- };
392
- /**
393
- * Absolute (flow-space) position of a node, following its `parentId` chain.
394
- * Cycles and missing parents are tolerated.
395
- */
396
- declare function getAbsolutePosition(node: CanvasNode, lookup: ReadonlyMap<string, CanvasNode>): XYPosition;
397
- /** Builds an id lookup for a node array. */
398
- declare function createNodeLookup<TNode extends CanvasNode>(nodes: TNode[]): Map<string, TNode>;
399
- /** Absolute flow-space rectangle of a node. */
400
- declare function getNodeRect(node: CanvasNode, lookup?: ReadonlyMap<string, CanvasNode>, options?: NodeRectOptions): Rect;
401
- /**
402
- * Whether a node has been locked with `lockNodes`.
403
- */
404
- declare function isLocked(node: CanvasNode | undefined | null): boolean;
405
- /**
406
- * Locks nodes: marks `data.locked = true` and sets `draggable: false` and `deletable: false`
407
- * so both SvelteFlow and React Flow stop dragging and deleting them. Nodes stay `selectable`
408
- * so they can be unlocked again. The previous flags are kept in `data.lockedPrevious` and
409
- * restored by `unlockNodes`. Returns a new array; untouched nodes keep their identity.
410
- */
411
- declare function lockNodes<TNode extends CanvasNode>(nodes: TNode[], ids: Iterable<string>): TNode[];
412
- /**
413
- * Reverses `lockNodes`, restoring the `draggable` / `deletable` flags the node had before.
414
- */
415
- declare function unlockNodes<TNode extends CanvasNode>(nodes: TNode[], ids: Iterable<string>): TNode[];
416
- /** Locks the given nodes if any of them is unlocked, otherwise unlocks them all. */
417
- declare function toggleLockNodes<TNode extends CanvasNode>(nodes: TNode[], ids: Iterable<string>): TNode[];
418
- interface AlignNodesOptions extends NodeRectOptions {
419
- /**
420
- * What to align to: the selection bounding box (default) or a fixed rectangle.
421
- * Locked nodes never move but still count towards the selection bounds, so they act as anchors.
422
- */
423
- to?: 'selection' | Rect;
424
- }
425
- /**
426
- * Aligns nodes to a shared edge or centre line of their bounding box (Freeform's
427
- * Align Left / Center / Right / Top / Middle / Bottom). Needs at least two nodes unless
428
- * `options.to` is a rectangle. Locked nodes are not moved.
429
- */
430
- declare function alignNodes(nodes: CanvasNode[], ids: Iterable<string>, edge: AlignEdge, options?: AlignNodesOptions): CanvasNodeUpdate[];
431
- interface DistributeNodesOptions extends NodeRectOptions {
432
- /** Explicit gap between neighbours for `gaps` mode. Default: spread evenly between the outer nodes. */
433
- gap?: number;
434
- }
435
- /**
436
- * Distributes nodes along an axis (Freeform's Distribute Horizontally / Vertically / Evenly).
437
- * The outermost nodes stay put and the others are spaced with equal gaps (`gaps`, default)
438
- * or equally spaced centres (`centres`). Needs at least three nodes (two with an explicit
439
- * `gap`). Locked nodes keep their place in the order but are not moved.
440
- */
441
- declare function distributeNodes(nodes: CanvasNode[], ids: Iterable<string>, axis: DistributeAxis, mode?: DistributeMode, options?: DistributeNodesOptions): CanvasNodeUpdate[];
442
- interface MatchSizeOptions extends NodeRectOptions {
443
- /**
444
- * Size source: the `largest` (default) or `smallest` node, the `first` id given,
445
- * or a specific node id.
446
- */
447
- reference?: 'largest' | 'smallest' | 'first' | {
448
- id: string;
449
- };
450
- /** Keep each node's centre in place instead of its top-left corner (default `false`). */
451
- keepCentre?: boolean;
452
- }
453
- /**
454
- * Makes nodes the same width, height or both (Freeform's Make Same Size). Returns size
455
- * updates (plus position updates with `keepCentre`). Locked nodes are not resized but can
456
- * be the reference.
457
- */
458
- declare function matchSize(nodes: CanvasNode[], ids: Iterable<string>, dimension: SizeDimension, options?: MatchSizeOptions): CanvasNodeUpdate[];
459
- /** Z-order operation. */
460
- type ZOrderOperation = 'bringForward' | 'sendBackward' | 'bringToFront' | 'sendToBack';
461
- /**
462
- * Restacks nodes (Bring Forward / Send Backward / Bring to Front / Send to Back).
463
- *
464
- * Both SvelteFlow and React Flow stack nodes by `zIndex` (missing = 0) and, for equal
465
- * `zIndex`, by array order. This computes that effective order for the siblings that share
466
- * the targets' parent, applies the operation, and returns `zIndex` updates assigning each
467
- * sibling its new rank. The array order is left alone, because xyflow requires parents to
468
- * precede their children. Locked nodes are not restacked. "Forward" moves past the next
469
- * sibling the node overlaps, falling back to the next sibling when nothing overlaps.
470
- */
471
- declare function reorderNodes(nodes: CanvasNode[], ids: Iterable<string>, operation: ZOrderOperation, options?: NodeRectOptions): CanvasNodeUpdate[];
472
- /**
473
- * Applies `CanvasNodeUpdate`s to a node array, returning a new array. Unchanged nodes keep
474
- * their identity. Size updates set `width` / `height` and rewrite pixel sizes already present
475
- * in `style` (string or object). An existing `measured` size is updated too, so geometry
476
- * helpers see the new size before xyflow re-measures the node.
477
- */
478
- declare function applyNodeUpdates<TNode extends CanvasNode>(nodes: TNode[], updates: CanvasNodeUpdate[]): TNode[];
479
- /**
480
- * Inverse of a set of updates against the current nodes, for undo. Restores the previous
481
- * position / size / zIndex of every node an update touches.
482
- */
483
- declare function invertNodeUpdates(nodes: CanvasNode[], updates: CanvasNodeUpdate[]): CanvasNodeUpdate[];
484
-
485
333
  /**
486
334
  * A guide line to render while dragging, in flow coordinates.
487
335
  * `edge` and `centre` guides are alignment lines; `spacing` guides mark equal gaps.
336
+ * `measure` lines (with a distance `label`) and dashed `extension` lines come from the
337
+ * distance measuring helpers (`measureBetween`, `measureSelection`).
488
338
  */
489
339
  interface GuideLine {
490
340
  orientation: 'vertical' | 'horizontal';
491
- kind: 'edge' | 'centre' | 'spacing';
341
+ kind: 'edge' | 'centre' | 'spacing' | 'measure' | 'extension';
492
342
  x1: number;
493
343
  y1: number;
494
344
  x2: number;
495
345
  y2: number;
346
+ /** Text drawn at the middle of the line (measuring distances). */
347
+ label?: string;
496
348
  }
349
+ /**
350
+ * Snaps `value` to a grid with the given `spacing` and `origin`. A spacing of 0 or less
351
+ * (or a non-finite one) leaves the value unchanged.
352
+ *
353
+ * Ported from vectorcraft-main/crates/geom/src/snap.rs (MIT OR Apache-2.0, © ArtCraft Team
354
+ * and contributors). See THIRD_PARTY_NOTICES.md.
355
+ */
356
+ declare function snapToGrid(value: number, spacing: number, origin?: number): number;
497
357
  interface SnapGuidesOptions {
498
358
  /** Current viewport zoom; the threshold is in screen pixels and divided by it (default 1). */
499
359
  zoom?: number;
@@ -505,6 +365,13 @@ interface SnapGuidesOptions {
505
365
  centres?: boolean;
506
366
  /** Snap to equal spacing between neighbouring shapes in the same row / column (default `true`). */
507
367
  spacing?: boolean;
368
+ /**
369
+ * Grid spacing in flow units (default 0, off). An axis that does not snap to a shape snaps
370
+ * its top-left (drag) or moving edge (resize) to the grid; grid snaps draw no guides.
371
+ */
372
+ gridSize?: number;
373
+ /** Grid origin in flow units (default `{ x: 0, y: 0 }`). */
374
+ gridOrigin?: XYPosition;
508
375
  }
509
376
  interface SnapResult {
510
377
  /** Snapped top-left of the moving rectangle. */
@@ -513,6 +380,7 @@ interface SnapResult {
513
380
  offset: XYPosition;
514
381
  /** Guide segments to draw for the snap that was applied. */
515
382
  guides: GuideLine[];
383
+ /** Whether x snapped to a shape (grid snaps do not count). */
516
384
  snappedX: boolean;
517
385
  snappedY: boolean;
518
386
  }
@@ -738,33 +606,6 @@ declare function fitViewportToNodes(nodes: CanvasNode[], size: {
738
606
  height: number;
739
607
  }, ids?: Iterable<string>, options?: FitViewportOptions & NodeRectOptions): CanvasViewport | null;
740
608
 
741
- /**
742
- * Canvas arrangement actions that have keyboard shortcuts.
743
- */
744
- type CanvasArrangeAction = 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignTop' | 'alignMiddle' | 'alignBottom' | 'distributeHorizontal' | 'distributeVertical' | 'lock' | 'unlock' | 'bringForward' | 'sendBackward' | 'bringToFront' | 'sendToBack' | 'nextScene' | 'previousScene';
745
- interface ArrangeShortcutBinding {
746
- action: CanvasArrangeAction;
747
- /** `KeyboardEvent.code` (layout- and Option-independent, e.g. `KeyA`, `BracketRight`). */
748
- code: string;
749
- mod?: boolean;
750
- alt?: boolean;
751
- shift?: boolean;
752
- /** Human readable label, e.g. for menus. `Mod` is ⌘ on macOS and Ctrl elsewhere. */
753
- label: string;
754
- }
755
- /**
756
- * Default bindings. Align/distribute follow Figma (Option/Alt + letter), layer order follows
757
- * the common `Mod+]` / `Mod+[` convention, lock follows Keynote/Freeform (`Mod+L`,
758
- * `Mod+Alt+L` to unlock) and scenes step with PageDown / PageUp.
759
- */
760
- declare const DEFAULT_ARRANGE_SHORTCUTS: readonly ArrangeShortcutBinding[];
761
- /**
762
- * Resolves a keydown event to an arrange action, or `null`. Events from text inputs,
763
- * textareas, selects, contenteditable and ProseMirror are ignored (see `isEventFromTextInput`).
764
- * `Mod` is ⌘ or Ctrl.
765
- */
766
- declare function matchArrangeShortcut(event: KeyboardEvent, bindings?: readonly ArrangeShortcutBinding[]): CanvasArrangeAction | null;
767
-
768
609
  /**
769
610
  * Polygon boolean operations (union, intersection, difference, xor and divide) on
770
611
  * multi-polygons with holes.
@@ -1040,6 +881,16 @@ interface PolygonToPathOptions {
1040
881
  x: number;
1041
882
  y: number;
1042
883
  };
884
+ /**
885
+ * `'lines'` (default) writes every ring as `M`/`L`/`Z`. `'fit'` fits cubic Béziers to each
886
+ * ring (`fitPathData`), so flattened curves come back as smooth `C` curves while sharp
887
+ * corners (turning more than `cornerAngleDeg`) and straight edges stay as they are.
888
+ */
889
+ curves?: 'lines' | 'fit';
890
+ /** Curve-fitting tolerance in path units for `curves: 'fit'` (default 0.25). */
891
+ curveTolerance?: number;
892
+ /** Corner threshold in degrees for `curves: 'fit'` (default 30). */
893
+ cornerAngleDeg?: number;
1043
894
  }
1044
895
  /**
1045
896
  * Converts a multi-polygon (or a list of rings) to SVG path data using `M`/`L`/`Z`. Holes
@@ -1103,6 +954,16 @@ interface CombineShapeNodesOptions extends ShapeNodePolygonOptions {
1103
954
  precision?: number;
1104
955
  /** Ramer–Douglas–Peucker simplification tolerance for the result (default 0, off). */
1105
956
  simplify?: number;
957
+ /**
958
+ * How the result's outline is written: `'fit'` (default) fits smooth cubic curves to the
959
+ * flattened result, so booleans of curved shapes stay curved (sharp corners and straight
960
+ * edges are kept); `'lines'` writes the polygon as straight segments.
961
+ */
962
+ curves?: 'lines' | 'fit';
963
+ /** Curve-fitting tolerance in flow units for `curves: 'fit'` (default: `tolerance`, 0.25). */
964
+ curveTolerance?: number;
965
+ /** Corner threshold in degrees for `curves: 'fit'` (default 30). */
966
+ cornerAngleDeg?: number;
1106
967
  /** Point-merge tolerance passed to the boolean engine. */
1107
968
  epsilon?: number;
1108
969
  /** Select the new nodes (default `true`). */
@@ -1169,6 +1030,284 @@ declare function revertShapeCombination<TNode extends CanvasNode>(nodes: TNode[]
1169
1030
  nodes: TNode[];
1170
1031
  }, previous: TNode[]): TNode[];
1171
1032
 
1033
+ /** A resize handle, named like xyflow's `ControlPosition`. */
1034
+ type ResizeHandle = 'top-left' | 'top' | 'top-right' | 'right' | 'bottom-right' | 'bottom' | 'bottom-left' | 'left';
1035
+ declare const RESIZE_HANDLES: readonly ResizeHandle[];
1036
+ /** Which edge of each axis a handle moves: -1 the start (left / top), 1 the end, 0 none. */
1037
+ declare function resizeHandleAxes(handle: ResizeHandle): {
1038
+ x: -1 | 0 | 1;
1039
+ y: -1 | 0 | 1;
1040
+ };
1041
+ /**
1042
+ * The handle a resize from `start` to `next` was made with, from the edges that moved, or
1043
+ * `null` when no edge moved.
1044
+ */
1045
+ declare function inferResizeHandle(start: Rect, next: Rect, eps?: number): ResizeHandle | null;
1046
+ interface SnapResizeOptions extends Omit<SnapGuidesOptions, 'spacing'> {
1047
+ /**
1048
+ * Keep the input box's aspect ratio. A corner snaps whichever axis is closer to a target
1049
+ * and the other follows; a side scales the other axis about its centre.
1050
+ */
1051
+ keepAspectRatio?: boolean;
1052
+ /** Smallest width a snap may leave (default: anything above 0). */
1053
+ minWidth?: number;
1054
+ /** Smallest height a snap may leave (default: anything above 0). */
1055
+ minHeight?: number;
1056
+ }
1057
+ interface SnapResizeResult {
1058
+ /** The snapped box. */
1059
+ rect: Rect;
1060
+ /** Guide segments for the shape snaps that were applied (grid snaps draw none). */
1061
+ guides: GuideLine[];
1062
+ /** Whether the moving x edge snapped to a shape. */
1063
+ snappedX: boolean;
1064
+ /** Whether the moving y edge snapped to a shape. */
1065
+ snappedY: boolean;
1066
+ /** Whether `rect` differs from the input. */
1067
+ changed: boolean;
1068
+ }
1069
+ /**
1070
+ * Snaps a resize of the axis-aligned box `rect` made with `handle` against `targets`. The
1071
+ * opposite edge (side handles) or corner (corner handles) stays fixed:
1072
+ *
1073
+ * - A **side** handle snaps its one moving edge to the nearest target edge or centre within
1074
+ * `threshold` screen pixels.
1075
+ * - A **corner** handle snaps x and y independently (unless `keepAspectRatio`).
1076
+ * - A snap that would collapse or flip the box (or go below `minWidth` / `minHeight`) is
1077
+ * rejected; the next nearest target is tried, else the edge stays where it was dragged.
1078
+ * - With `gridSize`, an axis without a shape snap snaps its moving edge to the grid.
1079
+ *
1080
+ * Returns the snapped box and the guides to draw (same shape as drag snapping).
1081
+ */
1082
+ declare function snapResize(rect: Rect, handle: ResizeHandle, targets: Rect[] | GuideIndex, options?: SnapResizeOptions): SnapResizeResult;
1083
+ interface SnapNodeResizeOptions extends SnapResizeOptions, NodeRectOptions {
1084
+ /** Index from `createNodeGuideIndex(nodes, [id])`, reused across resize frames. */
1085
+ index?: GuideIndex;
1086
+ }
1087
+ interface SnapNodeResizeResult extends SnapResizeResult {
1088
+ /** Position / size update for the node (parent-relative position), or none. */
1089
+ updates: CanvasNodeUpdate[];
1090
+ }
1091
+ /**
1092
+ * Snaps a node that is being resized. `rect` is the node's proposed absolute box (e.g. from
1093
+ * a resize event) and `handle` the handle being dragged. Locked nodes are never snapped.
1094
+ * The node itself and its descendants are not snap targets.
1095
+ */
1096
+ declare function snapNodeResize(nodes: CanvasNode[], id: string, rect: Rect, handle: ResizeHandle, options?: SnapNodeResizeOptions): SnapNodeResizeResult;
1097
+ /**
1098
+ * Absolute box of a node while it is being resized: flow libraries write the new size to
1099
+ * `width` / `height` before the DOM is re-measured, so those win over `measured` here.
1100
+ */
1101
+ declare function getResizingNodeRect(node: CanvasNode, lookup: ReadonlyMap<string, CanvasNode>, options?: NodeRectOptions): Rect;
1102
+
1103
+ /**
1104
+ * Figma-style auto layout for xyflow sub-flows.
1105
+ *
1106
+ * A *frame* is any node with `data.layout` (an {@link AutoLayout}); its children are the nodes
1107
+ * whose `parentId` is the frame, in node-array order. Children may carry `data.childLayout`
1108
+ * (an {@link AutoLayoutChild}) for their own sizing, min / max, absolute positioning,
1109
+ * constraints and grid cell. The functions here are pure: they return `CanvasNodeUpdate`s
1110
+ * (positions relative to the parent, sizes) for `applyNodeUpdates`.
1111
+ */
1112
+ /** Data key holding a frame's {@link AutoLayout}. */
1113
+ declare const AUTO_LAYOUT_DATA_KEY = "layout";
1114
+ /** Data key holding a child's {@link AutoLayoutChild}. */
1115
+ declare const CHILD_LAYOUT_DATA_KEY = "childLayout";
1116
+ type AutoLayoutMode = 'horizontal' | 'vertical' | 'grid';
1117
+ /** `fixed` keeps the size, `hug` fits the content (frames and text), `fill` shares the parent's free space. */
1118
+ type AutoLayoutSizing = 'fixed' | 'hug' | 'fill';
1119
+ type AutoLayoutAlignMain = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
1120
+ type AutoLayoutAlignCross = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
1121
+ /** How wrapped lines share the free cross space: packed by `alignCross` (`auto`) or spread (`space-between`). */
1122
+ type AutoLayoutAlignContent = 'auto' | 'space-between';
1123
+ /** `number` (all sides), `[vertical, horizontal]`, `[top, right, bottom, left]` or per side. */
1124
+ type AutoLayoutPadding = number | [number, number] | [number, number, number, number] | {
1125
+ top?: number;
1126
+ right?: number;
1127
+ bottom?: number;
1128
+ left?: number;
1129
+ };
1130
+ interface AutoLayoutSize {
1131
+ width?: number;
1132
+ height?: number;
1133
+ }
1134
+ interface AutoLayoutSizingPair {
1135
+ width?: AutoLayoutSizing;
1136
+ height?: AutoLayoutSizing;
1137
+ }
1138
+ /** A grid track: pixels, `'hug'` (fits its content), `'2fr'` or `{ fr: 2 }` (shares the rest like CSS `fr`). */
1139
+ type AutoLayoutGridTrack = number | 'hug' | `${number}fr` | {
1140
+ fr: number;
1141
+ };
1142
+ interface AutoLayoutGrid {
1143
+ /** Column count (all `1fr`) or the column tracks (default 2 columns). */
1144
+ columns?: number | AutoLayoutGridTrack[];
1145
+ /** Minimum row count or the row tracks (default 1); rows are added to fit the children. Missing tracks are `1fr`. */
1146
+ rows?: number | AutoLayoutGridTrack[];
1147
+ }
1148
+ /** A frame's auto layout (`node.data.layout`). */
1149
+ interface AutoLayout {
1150
+ mode: AutoLayoutMode;
1151
+ /** Main-axis gap (grid: column gap). Negative gaps overlap. Default 0. */
1152
+ gap?: number;
1153
+ /** Gap between wrapped lines (grid: row gap). Default: `gap`. */
1154
+ rowGap?: number;
1155
+ /** Default 0. */
1156
+ padding?: AutoLayoutPadding;
1157
+ /** Horizontal / vertical: wrap into lines when the main axis runs out (ignored while hugging it). */
1158
+ wrap?: boolean;
1159
+ /** Default `start`. Grid: the cell alignment along x (`start`, `center`, `end`). */
1160
+ alignMain?: AutoLayoutAlignMain;
1161
+ /** Default `start`. `baseline` applies to horizontal layouts. Grid: the cell alignment along y. */
1162
+ alignCross?: AutoLayoutAlignCross;
1163
+ alignContent?: AutoLayoutAlignContent;
1164
+ /** The frame's own sizing (`childLayout.sizing` wins when both are set). Default `fixed`. */
1165
+ sizing?: AutoLayoutSizingPair;
1166
+ /** The frame's own limits (`childLayout.min` / `max` win when set). */
1167
+ min?: AutoLayoutSize;
1168
+ max?: AutoLayoutSize;
1169
+ grid?: AutoLayoutGrid;
1170
+ }
1171
+ type AutoLayoutHorizontalConstraint = 'left' | 'right' | 'leftRight' | 'center' | 'scale';
1172
+ type AutoLayoutVerticalConstraint = 'top' | 'bottom' | 'topBottom' | 'center' | 'scale';
1173
+ interface AutoLayoutConstraints {
1174
+ horizontal?: AutoLayoutHorizontalConstraint;
1175
+ vertical?: AutoLayoutVerticalConstraint;
1176
+ }
1177
+ type AutoLayoutCellAlign = 'start' | 'center' | 'end';
1178
+ /** A grid child's cell. Column / row are 0-based anchors; unanchored children flow in reading order. */
1179
+ interface AutoLayoutGridArea {
1180
+ column?: number;
1181
+ row?: number;
1182
+ columnSpan?: number;
1183
+ rowSpan?: number;
1184
+ /** The child's own alignment in its cell (wins over the frame's). */
1185
+ alignX?: AutoLayoutCellAlign;
1186
+ alignY?: AutoLayoutCellAlign;
1187
+ }
1188
+ /** A child's layout properties (`node.data.childLayout`). */
1189
+ interface AutoLayoutChild {
1190
+ sizing?: AutoLayoutSizingPair;
1191
+ min?: AutoLayoutSize;
1192
+ max?: AutoLayoutSize;
1193
+ /** Ignore auto layout: keep its place and follow `constraints` when the frame resizes. */
1194
+ absolute?: boolean;
1195
+ /** How the child follows its parent's resizes (default left / top). */
1196
+ constraints?: AutoLayoutConstraints;
1197
+ gridArea?: AutoLayoutGridArea;
1198
+ }
1199
+ /**
1200
+ * Measuring hooks. `size` defaults to `getNodeSize` (xyflow `measured` size, then `width` /
1201
+ * `height`, then style). Nodes for which `textSize` returns a size are *text-like*: they can
1202
+ * hug, and wrap (`textHeight`) when their width is set by the layout.
1203
+ */
1204
+ interface AutoLayoutMeasure {
1205
+ size?: (node: CanvasNode) => {
1206
+ width: number;
1207
+ height: number;
1208
+ } | undefined;
1209
+ /** Natural (unwrapped) size of a text-like node. */
1210
+ textSize?: (node: CanvasNode) => {
1211
+ width: number;
1212
+ height: number;
1213
+ } | undefined;
1214
+ /** Height of a text-like node wrapped at `width`. */
1215
+ textHeight?: (node: CanvasNode, width: number) => number | undefined;
1216
+ /** Distance from the node's top to its first text baseline (for `alignCross: 'baseline'`). */
1217
+ textBaseline?: (node: CanvasNode) => number | undefined;
1218
+ }
1219
+ interface AutoLayoutOptions {
1220
+ measure?: AutoLayoutMeasure;
1221
+ /** Size resolution for unmeasured nodes when `measure.size` is not given. */
1222
+ rectOptions?: NodeRectOptions;
1223
+ }
1224
+ type Axis = 'width' | 'height';
1225
+ /** Clamps a size to `[min, max]`; non-finite or negative sizes become 0 and min wins over a smaller max. */
1226
+ declare function clampLayoutSize(value: number, min?: number, max?: number): number;
1227
+ /** The node's auto layout, or `undefined` when it is not an auto layout frame. */
1228
+ declare function getAutoLayout(node: CanvasNode | undefined | null): AutoLayout | undefined;
1229
+ /** Whether the node is an auto layout frame. */
1230
+ declare function isAutoLayoutFrame(node: CanvasNode | undefined | null): boolean;
1231
+ /** The node's child layout properties (empty when unset). */
1232
+ declare function getChildLayout(node: CanvasNode | undefined | null): AutoLayoutChild;
1233
+ /** Effective sizing of a node on one axis: `childLayout.sizing`, then `layout.sizing`, then `fixed`. */
1234
+ declare function getLayoutSizing(node: CanvasNode, axis: Axis): AutoLayoutSizing;
1235
+ /** Padding as `[top, right, bottom, left]`, sanitised (non-finite and negative values become 0). */
1236
+ declare function resolvePadding(padding: AutoLayoutPadding | undefined): [number, number, number, number];
1237
+ /** A grid child's cell (0-based column / row and spans). */
1238
+ interface AutoLayoutGridCell {
1239
+ id: string;
1240
+ column: number;
1241
+ row: number;
1242
+ columnSpan: number;
1243
+ rowSpan: number;
1244
+ }
1245
+ /** A grid frame's resolved geometry (frame-local): column x ranges, row y ranges, cells and the size it wants. */
1246
+ interface AutoLayoutGridGeometry {
1247
+ columns: [number, number][];
1248
+ rows: [number, number][];
1249
+ cells: AutoLayoutGridCell[];
1250
+ width: number;
1251
+ height: number;
1252
+ }
1253
+ /**
1254
+ * Lays out one auto layout frame's children and sizes the frame when it hugs (nested frames
1255
+ * that are resized by the layout are laid out again). Returns the position / size updates.
1256
+ */
1257
+ declare function layoutFrame(nodes: CanvasNode[], frameId: string, options?: AutoLayoutOptions): CanvasNodeUpdate[];
1258
+ /** Lays out every auto layout frame, children before parents, so nested hugging settles in one pass. */
1259
+ declare function layoutAll(nodes: CanvasNode[], options?: AutoLayoutOptions): CanvasNodeUpdate[];
1260
+ /**
1261
+ * Lays out `changedId` (when it is a frame) and then each of its auto layout ancestors,
1262
+ * innermost first. Use it after a node inside a frame was added, removed, resized or moved.
1263
+ */
1264
+ declare function layoutUp(nodes: CanvasNode[], changedId: string, options?: AutoLayoutOptions): CanvasNodeUpdate[];
1265
+ /** {@link layoutUp} for several changed nodes at once (each chain once, innermost frames first). */
1266
+ declare function layoutUpMany(nodes: CanvasNode[], changedIds: Iterable<string>, options?: AutoLayoutOptions): CanvasNodeUpdate[];
1267
+ /**
1268
+ * Children of `parentId` follow their constraints after the parent was resized from
1269
+ * `previousSize` to its current size. In an auto layout frame only absolute children move
1270
+ * (the layout places the others). Returns the updates.
1271
+ */
1272
+ declare function applyConstraints(nodes: CanvasNode[], parentId: string, previousSize: {
1273
+ width: number;
1274
+ height: number;
1275
+ }, options?: AutoLayoutOptions): CanvasNodeUpdate[];
1276
+ /** The resolved grid of a grid frame (frame-local), from its children's current sizes. */
1277
+ declare function getAutoLayoutGrid(nodes: CanvasNode[], frameId: string, options?: AutoLayoutOptions): AutoLayoutGridGeometry | undefined;
1278
+ /** Ids of the children a frame places (visible, not absolute), in order. */
1279
+ declare function getFlowChildren(nodes: CanvasNode[], frameId: string): string[];
1280
+ /** The nearest auto layout frame that places `id` (its parent, when `id` is a flow child). */
1281
+ declare function getLayoutParent(nodes: CanvasNode[], id: string): CanvasNode | undefined;
1282
+ /**
1283
+ * Makes a node's sizing coherent with where it sits, and that of its children: `fill` needs an
1284
+ * auto layout parent that does not hug that axis (and a flow child), `hug` needs an auto layout
1285
+ * frame or a text-like node (see `measure.textSize`); otherwise the axis becomes `fixed`.
1286
+ * Writes `data.childLayout.sizing`. Returns a new array (unchanged nodes keep their identity).
1287
+ */
1288
+ declare function makeSizingCoherent<TNode extends CanvasNode>(nodes: TNode[], id: string, options?: AutoLayoutOptions): TNode[];
1289
+ interface AutoLayoutInsertTarget {
1290
+ frameId: string;
1291
+ /** Index among the frame's flow children, not counting the dragged node. */
1292
+ index: number;
1293
+ /** Insertion marker (absolute flow coordinates) for `<CanvasGuidesLayer>`. */
1294
+ guide: GuideLine;
1295
+ }
1296
+ /**
1297
+ * Where a node dropped at `point` (absolute flow coordinates) goes among the flow children of
1298
+ * auto layout frame `frameId`: the reading-order index of the slot under the point. `excludeId`
1299
+ * (the dragged node) is left out of the siblings.
1300
+ */
1301
+ declare function getAutoLayoutInsertTarget(nodes: CanvasNode[], frameId: string, point: XYPosition, options?: AutoLayoutOptions & {
1302
+ excludeId?: string;
1303
+ }): AutoLayoutInsertTarget | undefined;
1304
+ /**
1305
+ * Moves child `childId` of an auto layout frame to flow index `index` (among its flow siblings)
1306
+ * by reordering the node array; parents still precede their children. Returns a new array
1307
+ * (the same array when nothing moves).
1308
+ */
1309
+ declare function moveLayoutChild<TNode extends CanvasNode>(nodes: TNode[], childId: string, index: number): TNode[];
1310
+
1172
1311
  /** Minimal history surface (`HistoryManager` satisfies it). */
1173
1312
  interface ArrangeHistoryTarget {
1174
1313
  execute(command: Command): void;
@@ -1186,10 +1325,23 @@ interface CanvasArrangeControllerOptions<TNode extends CanvasNode = CanvasNode>
1186
1325
  guides?: Omit<SnapGuidesOptions, 'zoom'>;
1187
1326
  /** Turns drag snapping off while keeping the arrange actions (default `true`). */
1188
1327
  snapping?: boolean;
1328
+ /** Turns resize snapping off (default: follows `snapping`). */
1329
+ resizeSnapping?: boolean;
1330
+ /** Resize options passed to `snapResize` (`keepAspectRatio`, `minWidth`, `minHeight`). */
1331
+ resize?: {
1332
+ keepAspectRatio?: boolean;
1333
+ minWidth?: number;
1334
+ minHeight?: number;
1335
+ };
1189
1336
  /** Size resolution for unmeasured nodes. */
1190
1337
  rectOptions?: NodeRectOptions;
1191
1338
  /** Called whenever the guide segments change (set while dragging, cleared on drop). */
1192
1339
  onGuidesChange?: (guides: GuideLine[]) => void;
1340
+ /**
1341
+ * Re-run auto layout (`data.layout` frames) around the nodes an arrange action moves or
1342
+ * resizes, in the same undoable step. `true` uses the default measuring.
1343
+ */
1344
+ autoLayout?: boolean | AutoLayoutOptions;
1193
1345
  }
1194
1346
  /**
1195
1347
  * A React Flow / SvelteFlow style node change; only `position` changes are inspected.
@@ -1256,6 +1408,31 @@ declare function createCanvasArrangeController<TNode extends CanvasNode = Canvas
1256
1408
  * A batch without a dragging position change ends the drag and clears the guides.
1257
1409
  */
1258
1410
  snapPositionChanges<TChange extends PositionChangeLike>(changes: TChange[]): TChange[];
1411
+ /**
1412
+ * Starts resize snapping for node `id`: records its box (to tell which handle is
1413
+ * dragged) and caches the snap targets. Optional: `resize` starts lazily.
1414
+ */
1415
+ beginResize(id: string): void;
1416
+ /**
1417
+ * Snaps node `id` as currently sized in `getNodes()` (call it after the flow wrote the
1418
+ * new size, e.g. SvelteFlow's `NodeResizer` `onResize`, deferred by a microtask) and
1419
+ * writes the snapped box back through `setNodes` (not recorded in history). `handle`
1420
+ * defaults to the one inferred from the edges that moved since `beginResize`. A locked
1421
+ * node is restored to its starting box.
1422
+ */
1423
+ resize(id: string, handle?: ResizeHandle): SnapNodeResizeResult | null;
1424
+ /**
1425
+ * Ends resize snapping: clears guides and re-applies the last snapped box if the flow
1426
+ * wrote the raw pointer size afterwards.
1427
+ */
1428
+ endResize(): void;
1429
+ /**
1430
+ * React Flow style: snaps the `dimensions` (and matching `position`) changes a
1431
+ * `NodeResizer` emits in an `onNodesChange` batch and updates `guides`. The resize-end
1432
+ * change (`resizing: false`) carries the raw pointer size, so the last snapped size is
1433
+ * kept. Resize changes of locked nodes are dropped. Returns the (possibly new) changes.
1434
+ */
1435
+ snapResizeChanges<TChange extends PositionChangeLike>(changes: TChange[]): TChange[];
1259
1436
  /**
1260
1437
  * Clears guides and the cached snap targets. Call it from the flow's drag-stop
1261
1438
  * handler: flow libraries write the raw pointer position when a drag ends, so the
@@ -1265,4 +1442,249 @@ declare function createCanvasArrangeController<TNode extends CanvasNode = Canvas
1265
1442
  };
1266
1443
  type CanvasArrangeController<TNode extends CanvasNode = CanvasNode> = ReturnType<typeof createCanvasArrangeController<TNode>>;
1267
1444
 
1268
- export { type AlignEdge, type AlignNodesOptions, type ArrangeHistoryTarget, type ArrangeShortcutBinding, CONNECTION_LINE_TYPES, type CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, CanvasClipboardPayload, type CanvasConnectionLineType, CanvasEdge, type CanvasHeightOptions, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, type CanvasNodeUpdate, type CanvasScene, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, type CanvasViewport, type Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, DEFAULT_ARRANGE_SHORTCUTS, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DirectionalDisplacementOptions, type DistributeAxis, type DistributeMode, type DistributeNodesOptions, type EllipseShape, FanOutTrajectoryOptions, type FitViewportOptions, type FlattenOptions, type GuideIndex, type GuideLine, IncrementalLayoutOptions, LOCKED_DATA_KEY, LOCKED_PREVIOUS_FLAGS_KEY, ManualClock, type MatchSizeOptions, type MultiNodeTransitionOptions, type MultiPolygon, type NodeRectOptions, NodeTransition, type PathCommand, type PathShape, PlaceBesideOptions, Point, type PolygonBooleanOperation, type PolygonBooleanOptions, type PolygonFillRule, type PolygonInput, type PolygonOperand, type PolygonPiece, type PolygonRing, type PolygonToPathOptions, type PolygonWithHoles, Position, type PositionChangeLike, Rect, type RectShape, ReflowDisplacementOptions, type RegularPolygonShape, SHAPE_DATA_KEY, SHAPE_KINDS, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SerializedCanvasScenes, type ShapeDescription, type ShapeKind, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePaint, type ShapeRenderData, type ShapeSize, Side, type SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapResult, type StarShape, StreamingLayoutManager, type StreamingLayoutManagerOptions, TrajectoryFunction, XYPosition, type ZOrderOperation, alignNodes, applyNodeUpdates, applyShapeCombination, blendLayout, boundsOf, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canvasHeight, centerNodes, centre, collectDescendantIds, combineShapeNodes, computeNodesBoundingBox, computeSnapGuides, connectedOnly, createBezierTrajectory, createCanvasArrangeController, createCanvasScenesStore, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, createNodeLookup, defaultEasing, distributeNodes, dividePolygons, ensureLayout, estimateCanvasHeight, estimateNodeSize, findConnectorSnap, fitViewportToNodes, fitViewportToRect, flattenSvgPath, flowSide, formatNumber, getAbsolutePosition, getCenteredNodePosition, getLayoutedNodes, getNodeRect, getNodeShape, getNodeSize, getShapeRenderData, getShapeSvg, handlePoint, intersectPolygons, invertNodeUpdates, isEventFromTextInput, isLocked, isShapeDescription, isShapeNode, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, layoutBounds, linearPositionTrajectory, linearTrajectory, lockNodes, matchArrangeShortcut, matchSize, multiPolygonArea, multiPolygonBounds, nearestHandlePositions, oppositePosition, overlaps, pageHidden, parseCanvasClipboardData, parseCanvasScenes, parseSvgPath, placeBeside, pointInMultiPolygon, pointInRings, polygonArea, polygonBoolean, polygonToSvgPath, positionToSide, readStyleSize, realClock, remapPastedNodes, reorderNodes, repositionNodesTo, revertShapeCombination, ringSignedArea, runMultiNodeTransition, serializeCanvasNodes, shapeNodeToPolygon, shapeToPolygon, sideToPosition, simplifyRing, snapNodeDrag, subtractPolygons, toggleLockNodes, unionPolygons, unlockNodes, withStyleOpacity, withStyleSize, xorPolygons };
1445
+ /**
1446
+ * A measuring line in flow coordinates. `measure` lines carry a `label` (the distance);
1447
+ * `extension` lines are dashed, unlabelled lines that carry a gap over to the measured box
1448
+ * when the gap line passes beside it.
1449
+ */
1450
+ interface MeasureGuide extends GuideLine {
1451
+ kind: 'measure' | 'extension';
1452
+ /** The distance as shown on the label (`measure` lines only). */
1453
+ label?: string;
1454
+ }
1455
+ /** A distance as shown on a label: absolute value, up to two decimals, no trailing zeros. */
1456
+ declare function measureLabel(distance: number): string;
1457
+ /**
1458
+ * Distance lines from box `a` (the selection) to box `b` (the hovered shape):
1459
+ *
1460
+ * - **One inside the other**: from the inner box to each edge of the outer one, along the
1461
+ * inner box's centre lines (the same lines either way round).
1462
+ * - **Overlapping**: between the matching edges (left to left, right to right, ...).
1463
+ * - **Apart**: the horizontal and/or vertical gap, across the shared rows / columns, or from
1464
+ * the middle of `a` with a dashed `extension` line to `b` when the gap line passes beside it.
1465
+ * Touching boxes have no gap to draw.
1466
+ */
1467
+ declare function measureBetween(a: Rect, b: Rect): MeasureGuide[];
1468
+ /**
1469
+ * Distance lines from box `a` to an infinite guide line (`vertical` at x = `at`, otherwise
1470
+ * horizontal at y = `at`): to the nearer side, or to both sides when the line crosses the box.
1471
+ */
1472
+ declare function measureToLine(a: Rect, orientation: 'vertical' | 'horizontal', at: number): MeasureGuide[];
1473
+ interface MeasureSelectionResult {
1474
+ /** Measuring lines in flow coordinates. */
1475
+ guides: MeasureGuide[];
1476
+ /** The box measured to (to outline), or `null` when nothing is measured. */
1477
+ target: Rect | null;
1478
+ /** The selection's bounding box, or `null` without a selection. */
1479
+ selection: Rect | null;
1480
+ }
1481
+ interface MeasureSelectionOptions extends NodeRectOptions {
1482
+ }
1483
+ /**
1484
+ * Alt-hover measuring on canvas nodes: from the bounding box of `selectedIds` (absolute,
1485
+ * union of several nodes) to the hovered node. Hovering the selection itself, or nothing
1486
+ * (`hoveredId` null), measures to the selection's parent (`parentId`) when it has one;
1487
+ * a top-level selection then measures nothing. Hidden nodes are ignored.
1488
+ */
1489
+ declare function measureSelection(nodes: CanvasNode[], selectedIds: Iterable<string>, hoveredId: string | null | undefined, options?: MeasureSelectionOptions): MeasureSelectionResult;
1490
+ /**
1491
+ * Whether the measuring modifier (Alt / Option) is held after a keyboard or pointer event.
1492
+ * `keyup` of Alt releases it; `keydown` of Alt or any event with `altKey` holds it.
1493
+ */
1494
+ declare function isMeasureModifierHeld(event: {
1495
+ type?: string;
1496
+ key?: string;
1497
+ altKey?: boolean;
1498
+ } | null | undefined): boolean;
1499
+
1500
+ /**
1501
+ * Least-squares cubic Bézier fitting of point sequences (Schneider-style: fit one cubic with
1502
+ * fixed end tangents, reparameterise with Newton steps, split at the worst point), with
1503
+ * corner preservation by a turning-angle test.
1504
+ *
1505
+ * Portions ported from vectorcraft-main/crates/pathops/src/fit.rs and
1506
+ * vectorcraft-main/crates/pathops/src/edit.rs (MIT OR Apache-2.0, © ArtCraft Team and
1507
+ * contributors). See THIRD_PARTY_NOTICES.md.
1508
+ */
1509
+
1510
+ /** One cubic Bézier segment. */
1511
+ interface CubicSegment {
1512
+ p0: Point;
1513
+ p1: Point;
1514
+ p2: Point;
1515
+ p3: Point;
1516
+ }
1517
+ interface FitCubicsOptions {
1518
+ /**
1519
+ * Vertices where the polyline turns by more than this many degrees stay sharp corners
1520
+ * (default 30). Use 180 to smooth through every vertex.
1521
+ */
1522
+ cornerAngleDeg?: number;
1523
+ /** Treat the points as a closed ring (the last point connects back to the first). */
1524
+ closed?: boolean;
1525
+ }
1526
+ /** Evaluates a cubic segment at `t` ∈ [0, 1]. */
1527
+ declare function cubicPointAt(c: CubicSegment, t: number): Point;
1528
+ /**
1529
+ * Fits a G1-continuous chain of cubics through `points` (an open run) with the unit
1530
+ * tangents `t0` (leaving the first point) and `t1` (arriving at the last point, forward);
1531
+ * both are estimated from the end points when omitted. Every point lies within `tolerance`
1532
+ * of the curve at its fitted parameter.
1533
+ */
1534
+ declare function fitCubicRun(points: readonly Point[], tolerance: number, t0?: Point, t1?: Point): CubicSegment[];
1535
+ /**
1536
+ * Fits cubic Bézier segments to a polyline (`closed` for a ring), keeping vertices that turn
1537
+ * by more than `cornerAngleDeg` (default 30°) as sharp corners. Each stretch between corners
1538
+ * is fitted Schneider-style so that every input point is within `tolerance` of the result.
1539
+ *
1540
+ * Returns the segments in order (consecutive segments share end points; a closed result ends
1541
+ * where it starts). Fewer than two distinct points give an empty array.
1542
+ */
1543
+ declare function fitCubics(points: readonly Point[], tolerance: number, options?: FitCubicsOptions): CubicSegment[];
1544
+ /** Whether a cubic is (within `tol`) the straight line from `p0` to `p3`. */
1545
+ declare function isStraightCubic(c: CubicSegment, tol: number): boolean;
1546
+ interface FitPathDataOptions extends FitCubicsOptions {
1547
+ /** Fitting tolerance in path units (default 0.5). */
1548
+ tolerance?: number;
1549
+ /** Decimal places (default 3). */
1550
+ precision?: number;
1551
+ /** Added to every point before formatting. */
1552
+ offset?: {
1553
+ x: number;
1554
+ y: number;
1555
+ };
1556
+ /**
1557
+ * Keep the original polyline when fitting would need more segments than it has edges
1558
+ * (default `true`), so fitting never makes a path heavier.
1559
+ */
1560
+ noWorse?: boolean;
1561
+ }
1562
+ /** SVG `d` for fitted segments (`L` for straight ones, `C` otherwise). */
1563
+ declare function cubicsToPathData(segments: readonly CubicSegment[], options?: {
1564
+ precision?: number;
1565
+ offset?: {
1566
+ x: number;
1567
+ y: number;
1568
+ };
1569
+ closed?: boolean;
1570
+ straightTolerance?: number;
1571
+ }): string;
1572
+ /**
1573
+ * Fits smooth curves to a polygon ring (closed by default) and returns SVG path data with
1574
+ * `C` curves for smooth stretches, `L` lines for straight ones and sharp corners kept.
1575
+ * Use it for boolean results of curved shapes or to smooth freehand strokes
1576
+ * (`{ closed: false }`, see `fitFreehandPath`).
1577
+ */
1578
+ declare function fitPathData(ring: readonly Point[], options?: FitPathDataOptions): string;
1579
+ /**
1580
+ * Smooths a freehand stroke (pointer samples) into an open SVG path of cubic curves.
1581
+ * `tolerance` is the largest distance (in the points' units) a sample may be from the
1582
+ * curve (default 1); sharp turns above `cornerAngleDeg` (default 30) stay corners.
1583
+ */
1584
+ declare function fitFreehandPath(points: readonly Point[], options?: Omit<FitPathDataOptions, 'closed'>): string;
1585
+
1586
+ interface CanvasAutoLayoutControllerOptions<TNode extends CanvasNode = CanvasNode> extends AutoLayoutOptions {
1587
+ getNodes: () => TNode[];
1588
+ setNodes: (nodes: TNode[]) => void;
1589
+ /** When set, controller actions (add / remove / resize / reorder / apply) are one undoable step each. */
1590
+ history?: ArrangeHistoryTarget;
1591
+ /** Turns automatic relayout off (explicit `applyAutoLayout` still works). Default `true`. */
1592
+ enabled?: boolean;
1593
+ /** Reorder flow children by dragging them inside their frame (default `true`). */
1594
+ dragReorder?: boolean;
1595
+ /** Called when the drop marker of a reorder drag changes (empty when none). */
1596
+ onGuidesChange?: (guides: GuideLine[]) => void;
1597
+ }
1598
+ /**
1599
+ * Merges the updates of several layout passes (later ones win per field).
1600
+ */
1601
+ declare function mergeNodeUpdates(...lists: CanvasNodeUpdate[][]): CanvasNodeUpdate[];
1602
+ /**
1603
+ * Updates that re-run auto layout around `ids` after a change: each id's own layout (if a
1604
+ * frame) and its auto layout ancestors, plus the frames that lost removed children
1605
+ * (`parentIds`). Pure helper used by the controllers.
1606
+ */
1607
+ declare function relayoutUpdates(nodes: CanvasNode[], ids: Iterable<string>, options?: AutoLayoutOptions): CanvasNodeUpdate[];
1608
+ /**
1609
+ * Framework-agnostic auto layout controller shared by the React hook and the Svelte rune.
1610
+ * Applies auto layout to frames (`data.layout`) after nodes inside them are added, removed,
1611
+ * resized or reordered, either through its own (undoable) actions or by watching the flow's
1612
+ * node changes (`noteChanges` + `flush`), and reorders flow children dragged within a frame.
1613
+ */
1614
+ declare function createCanvasAutoLayoutController<TNode extends CanvasNode = CanvasNode>(options: CanvasAutoLayoutControllerOptions<TNode>): {
1615
+ /** Drop marker of the active reorder drag (flow coordinates); empty otherwise. */
1616
+ readonly guides: GuideLine[];
1617
+ /**
1618
+ * Lays out frame `frameId` and its auto layout ancestors (default: every frame) as one
1619
+ * (optionally undoable) step. Returns the updates.
1620
+ */
1621
+ applyAutoLayout(frameId?: string): CanvasNodeUpdate[];
1622
+ /** Updates that relayout around `ids` on the current nodes, without applying them. */
1623
+ layoutUpdates(ids: Iterable<string>): CanvasNodeUpdate[];
1624
+ /**
1625
+ * Applies the relayout around `ids` (frames, or nodes inside frames) directly, not
1626
+ * recorded in history: auto layout is derived state, re-run after any change.
1627
+ */
1628
+ relayout(ids: Iterable<string>): CanvasNodeUpdate[];
1629
+ /**
1630
+ * Adds `node` (into the frame named by its `parentId`, at flow `index` when given) and
1631
+ * lays out its frame, as one step.
1632
+ */
1633
+ addNode(node: TNode, addOptions?: {
1634
+ index?: number;
1635
+ }): CanvasNodeUpdate[];
1636
+ /** Removes nodes (and their descendants) and lays out the frames they leave, as one step. */
1637
+ removeNodes(ids: Iterable<string>): CanvasNodeUpdate[];
1638
+ /**
1639
+ * Resizes node `id` (its children follow their constraints) and lays out around it,
1640
+ * as one step.
1641
+ */
1642
+ resizeNode(id: string, size: {
1643
+ width?: number;
1644
+ height?: number;
1645
+ }): CanvasNodeUpdate[];
1646
+ /** Moves flow child `childId` to flow index `index` in its frame and lays it out, as one step. */
1647
+ moveChild(childId: string, index: number): CanvasNodeUpdate[];
1648
+ /** Where flow child `id` would drop if released at `point` (default: its centre). */
1649
+ getInsertTarget(id: string, point?: XYPosition): AutoLayoutInsertTarget | undefined;
1650
+ /** Records the start position of a reorder drag. Optional: `dragReorder` records it lazily. */
1651
+ beginReorderDrag(id: string): void;
1652
+ /**
1653
+ * While flow child `id` is dragged (as currently positioned in `getNodes()`): updates the
1654
+ * drop marker. Returns the insert target.
1655
+ */
1656
+ dragReorder(id: string, point?: XYPosition): AutoLayoutInsertTarget | undefined;
1657
+ /**
1658
+ * Ends a reorder drag: moves `id` to the slot under `point` (default: its centre) and lays
1659
+ * the frame out, as one undoable step whose undo puts the node back where the drag began.
1660
+ */
1661
+ endReorderDrag(id: string, point?: XYPosition): CanvasNodeUpdate[];
1662
+ /**
1663
+ * Notes a batch of React Flow / SvelteFlow style node changes (before or after they are
1664
+ * applied) so `flush` can relayout: dimension changes (measured sizes, resize ends),
1665
+ * added and removed nodes, and position changes of flow children (reorder drags).
1666
+ * Returns the changes unchanged.
1667
+ */
1668
+ noteChanges<TChange extends PositionChangeLike>(changes: TChange[]): TChange[];
1669
+ /**
1670
+ * Notes nodes that were already removed (e.g. SvelteFlow's `ondelete`), so `flush`
1671
+ * relayouts the frames they left. The nodes must still carry their `parentId`.
1672
+ */
1673
+ noteRemoved(removed: Iterable<{
1674
+ id: string;
1675
+ parentId?: string;
1676
+ }>): void;
1677
+ /** Whether `noteChanges` left work for `flush`. */
1678
+ readonly hasPending: boolean;
1679
+ /**
1680
+ * Applies the work noted by `noteChanges` to the current nodes: drop markers while
1681
+ * dragging, committed reorders on drop (undoable), and a relayout (not recorded) for
1682
+ * size, add and remove changes. Call it once the changes are applied.
1683
+ */
1684
+ flush(): CanvasNodeUpdate[];
1685
+ /** Whether `id` is an auto layout frame. */
1686
+ isFrame: (id: string) => boolean;
1687
+ };
1688
+ type CanvasAutoLayoutController<TNode extends CanvasNode = CanvasNode> = ReturnType<typeof createCanvasAutoLayoutController<TNode>>;
1689
+
1690
+ export { AUTO_LAYOUT_DATA_KEY, AlignEdge, AlignNodesOptions, type ArrangeHistoryTarget, type AutoLayout, type AutoLayoutAlignContent, type AutoLayoutAlignCross, type AutoLayoutAlignMain, type AutoLayoutCellAlign, type AutoLayoutChild, type AutoLayoutConstraints, type AutoLayoutGrid, type AutoLayoutGridArea, type AutoLayoutGridCell, type AutoLayoutGridGeometry, type AutoLayoutGridTrack, type AutoLayoutHorizontalConstraint, type AutoLayoutInsertTarget, type AutoLayoutMeasure, type AutoLayoutMode, type AutoLayoutOptions, type AutoLayoutPadding, type AutoLayoutSize, type AutoLayoutSizing, type AutoLayoutSizingPair, type AutoLayoutVerticalConstraint, CHILD_LAYOUT_DATA_KEY, CONNECTION_LINE_TYPES, CanvasArrangeAction, type CanvasArrangeController, type CanvasArrangeControllerOptions, type CanvasAutoLayoutController, type CanvasAutoLayoutControllerOptions, CanvasClipboardPayload, type CanvasConnectionLineType, CanvasEdge, type CanvasHeightOptions, CanvasLayoutOptions, CanvasNode, CanvasNodeStyle, CanvasNodeUpdate, type CanvasScene, type CanvasScenesOptions, type CanvasScenesState, CanvasScenesStore, type CanvasViewport, type Clock, type CombineShapeNodesOptions, type CombineShapeNodesRefusal, type CombineShapeNodesResult, type ConnectorSnap, type ConnectorSnapOptions, type ConnectorSnapTarget, type CubicSegment, DEFAULT_NODE_HEIGHT, DEFAULT_NODE_WIDTH, DEFAULT_PLACEMENT_GAP, DirectionalDisplacementOptions, DistributeAxis, DistributeMode, DistributeNodesOptions, type EllipseShape, FanOutTrajectoryOptions, type FitCubicsOptions, type FitPathDataOptions, type FitViewportOptions, type FlattenOptions, type GuideIndex, type GuideLine, IncrementalLayoutOptions, ManualClock, MatchSizeOptions, type MeasureGuide, type MeasureSelectionOptions, type MeasureSelectionResult, type MultiNodeTransitionOptions, type MultiPolygon, NodeRectOptions, NodeTransition, type PathCommand, type PathShape, PlaceBesideOptions, Point, type PolygonBooleanOperation, type PolygonBooleanOptions, type PolygonFillRule, type PolygonInput, type PolygonOperand, type PolygonPiece, type PolygonRing, type PolygonToPathOptions, type PolygonWithHoles, Position, type PositionChangeLike, RESIZE_HANDLES, Rect, type RectShape, ReflowDisplacementOptions, type RegularPolygonShape, type ResizeHandle, SHAPE_DATA_KEY, SHAPE_KINDS, SHAPE_NODE_TYPE, SHAPE_OPERATIONS, type SerializedCanvasScenes, type ShapeDescription, type ShapeKind, type ShapeNodePolygonOptions, type ShapeOperation, type ShapePaint, type ShapeRenderData, type ShapeSize, Side, SizeDimension, type SnapGuidesOptions, type SnapNodeDragOptions, type SnapNodeDragResult, type SnapNodeResizeOptions, type SnapNodeResizeResult, type SnapResizeOptions, type SnapResizeResult, type SnapResult, type StarShape, StreamingLayoutManager, type StreamingLayoutManagerOptions, TrajectoryFunction, XYPosition, ZOrderOperation, applyConstraints, applyShapeCombination, blendLayout, boundsOf, calculateDagreReflowDisplacement, calculateDirectionalDisplacement, canCombineShapeNodes, canvasHeight, centerNodes, centre, clampLayoutSize, collectDescendantIds, combineShapeNodes, computeNodesBoundingBox, computeSnapGuides, connectedOnly, createBezierTrajectory, createCanvasArrangeController, createCanvasAutoLayoutController, createCanvasScenesStore, createFanOutTrajectory, createGuideIndex, createNodeGuideIndex, cubicPointAt, cubicsToPathData, defaultEasing, dividePolygons, ensureLayout, estimateCanvasHeight, estimateNodeSize, findConnectorSnap, fitCubicRun, fitCubics, fitFreehandPath, fitPathData, fitViewportToNodes, fitViewportToRect, flattenSvgPath, flowSide, formatNumber, getAutoLayout, getAutoLayoutGrid, getAutoLayoutInsertTarget, getCenteredNodePosition, getChildLayout, getFlowChildren, getLayoutParent, getLayoutSizing, getLayoutedNodes, getNodeShape, getResizingNodeRect, getShapeRenderData, getShapeSvg, handlePoint, inferResizeHandle, intersectPolygons, isAutoLayoutFrame, isEventFromTextInput, isMeasureModifierHeld, isShapeDescription, isShapeNode, isStraightCubic, isValidCanvasEdge, isValidCanvasNode, isValidCanvasScene, isValidUrl, layoutAll, layoutBounds, layoutFrame, layoutUp, layoutUpMany, linearPositionTrajectory, linearTrajectory, makeSizingCoherent, measureBetween, measureLabel, measureSelection, measureToLine, mergeNodeUpdates, moveLayoutChild, multiPolygonArea, multiPolygonBounds, nearestHandlePositions, oppositePosition, overlaps, pageHidden, parseCanvasClipboardData, parseCanvasScenes, parseSvgPath, placeBeside, pointInMultiPolygon, pointInRings, polygonArea, polygonBoolean, polygonToSvgPath, positionToSide, realClock, relayoutUpdates, remapPastedNodes, repositionNodesTo, resizeHandleAxes, resolvePadding, revertShapeCombination, ringSignedArea, runMultiNodeTransition, serializeCanvasNodes, shapeNodeToPolygon, shapeToPolygon, sideToPosition, simplifyRing, snapNodeDrag, snapNodeResize, snapResize, snapToGrid, subtractPolygons, unionPolygons, withStyleOpacity, xorPolygons };