@angflow/system 0.0.91 → 0.0.93

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 (184) hide show
  1. package/dist/esm/constants.d.ts +43 -0
  2. package/dist/esm/constants.d.ts.map +1 -0
  3. package/dist/esm/index.d.ts +9 -8
  4. package/dist/esm/index.d.ts.map +1 -0
  5. package/dist/esm/index.js +10 -7
  6. package/dist/esm/index.mjs +10 -7
  7. package/dist/esm/types/changes.d.ts +64 -0
  8. package/dist/esm/types/changes.d.ts.map +1 -0
  9. package/dist/esm/types/edges.d.ts +140 -0
  10. package/dist/esm/types/edges.d.ts.map +1 -0
  11. package/dist/esm/types/general.d.ts +296 -0
  12. package/dist/esm/types/general.d.ts.map +1 -0
  13. package/dist/esm/types/handles.d.ts +65 -0
  14. package/dist/esm/types/handles.d.ts.map +1 -0
  15. package/dist/esm/types/index.d.ts +8 -0
  16. package/dist/esm/types/index.d.ts.map +1 -0
  17. package/dist/esm/types/nodes.d.ts +157 -0
  18. package/dist/esm/types/nodes.d.ts.map +1 -0
  19. package/dist/esm/types/panzoom.d.ts +55 -0
  20. package/dist/esm/types/panzoom.d.ts.map +1 -0
  21. package/dist/esm/types/utils.d.ts +61 -0
  22. package/dist/esm/types/utils.d.ts.map +1 -0
  23. package/dist/esm/utils/connections.d.ts +13 -0
  24. package/dist/esm/utils/connections.d.ts.map +1 -0
  25. package/dist/esm/utils/dom.d.ts +21 -0
  26. package/dist/esm/utils/dom.d.ts.map +1 -0
  27. package/dist/esm/utils/edge-toolbar.d.ts +2 -0
  28. package/dist/esm/utils/edge-toolbar.d.ts.map +1 -0
  29. package/dist/esm/utils/edges/bezier-edge.d.ts +77 -0
  30. package/dist/esm/utils/edges/bezier-edge.d.ts.map +1 -0
  31. package/dist/esm/utils/edges/floating.d.ts +32 -0
  32. package/dist/esm/utils/edges/floating.d.ts.map +1 -0
  33. package/dist/esm/utils/edges/general.d.ts +91 -0
  34. package/dist/esm/utils/edges/general.d.ts.map +1 -0
  35. package/dist/esm/utils/edges/index.d.ts +7 -0
  36. package/dist/esm/utils/edges/index.d.ts.map +1 -0
  37. package/dist/esm/utils/edges/positions.d.ts +17 -0
  38. package/dist/esm/utils/edges/positions.d.ts.map +1 -0
  39. package/dist/esm/utils/edges/smoothstep-edge.d.ts +66 -0
  40. package/dist/esm/utils/edges/smoothstep-edge.d.ts.map +1 -0
  41. package/dist/esm/utils/edges/straight-edge.d.ts +41 -0
  42. package/dist/esm/utils/edges/straight-edge.d.ts.map +1 -0
  43. package/dist/esm/utils/general.d.ts +86 -0
  44. package/dist/esm/utils/general.d.ts.map +1 -0
  45. package/dist/esm/utils/graph.d.ts +191 -0
  46. package/dist/esm/utils/graph.d.ts.map +1 -0
  47. package/dist/esm/utils/index.d.ts +12 -0
  48. package/dist/esm/utils/index.d.ts.map +1 -0
  49. package/dist/esm/utils/marker.d.ts +9 -0
  50. package/dist/esm/utils/marker.d.ts.map +1 -0
  51. package/dist/esm/utils/node-toolbar.d.ts +3 -0
  52. package/dist/esm/utils/node-toolbar.d.ts.map +1 -0
  53. package/dist/esm/utils/shallow-node-data.d.ts +5 -0
  54. package/dist/esm/utils/shallow-node-data.d.ts.map +1 -0
  55. package/dist/esm/utils/store.d.ts +34 -0
  56. package/dist/esm/utils/store.d.ts.map +1 -0
  57. package/dist/esm/utils/types.d.ts +8 -0
  58. package/dist/esm/utils/types.d.ts.map +1 -0
  59. package/dist/esm/xydrag/XYDrag.d.ts +55 -0
  60. package/dist/esm/xydrag/XYDrag.d.ts.map +1 -0
  61. package/dist/esm/xydrag/index.d.ts +2 -0
  62. package/dist/esm/xydrag/index.d.ts.map +1 -0
  63. package/dist/esm/xydrag/utils.d.ts +24 -0
  64. package/dist/esm/xydrag/utils.d.ts.map +1 -0
  65. package/dist/esm/xyhandle/XYHandle.d.ts +3 -0
  66. package/dist/esm/xyhandle/XYHandle.d.ts.map +1 -0
  67. package/dist/esm/xyhandle/index.d.ts +2 -0
  68. package/dist/esm/xyhandle/index.d.ts.map +1 -0
  69. package/dist/esm/xyhandle/types.d.ts +51 -0
  70. package/dist/esm/xyhandle/types.d.ts.map +1 -0
  71. package/dist/esm/xyhandle/utils.d.ts +29 -0
  72. package/dist/esm/xyhandle/utils.d.ts.map +1 -0
  73. package/dist/esm/xyminimap/index.d.ts +28 -0
  74. package/dist/esm/xyminimap/index.d.ts.map +1 -0
  75. package/dist/esm/xypanzoom/XYPanZoom.d.ts +12 -0
  76. package/dist/esm/xypanzoom/XYPanZoom.d.ts.map +1 -0
  77. package/dist/esm/xypanzoom/eventhandler.d.ts +46 -0
  78. package/dist/esm/xypanzoom/eventhandler.d.ts.map +1 -0
  79. package/dist/esm/xypanzoom/filter.d.ts +15 -0
  80. package/dist/esm/xypanzoom/filter.d.ts.map +1 -0
  81. package/dist/esm/xypanzoom/index.d.ts +2 -0
  82. package/dist/esm/xypanzoom/index.d.ts.map +1 -0
  83. package/dist/esm/xypanzoom/utils.d.ts +9 -0
  84. package/dist/esm/xypanzoom/utils.d.ts.map +1 -0
  85. package/dist/esm/xyresizer/XYResizer.d.ts +49 -0
  86. package/dist/esm/xyresizer/XYResizer.d.ts.map +1 -0
  87. package/dist/esm/xyresizer/index.d.ts +3 -0
  88. package/dist/esm/xyresizer/index.d.ts.map +1 -0
  89. package/dist/esm/xyresizer/types.d.ts +59 -0
  90. package/dist/esm/xyresizer/types.d.ts.map +1 -0
  91. package/dist/esm/xyresizer/utils.d.ts +76 -0
  92. package/dist/esm/xyresizer/utils.d.ts.map +1 -0
  93. package/dist/umd/constants.d.ts +43 -0
  94. package/dist/umd/constants.d.ts.map +1 -0
  95. package/dist/umd/index.d.ts +9 -0
  96. package/dist/umd/index.d.ts.map +1 -0
  97. package/dist/umd/index.js +1 -1
  98. package/dist/umd/types/changes.d.ts +64 -0
  99. package/dist/umd/types/changes.d.ts.map +1 -0
  100. package/dist/umd/types/edges.d.ts +140 -0
  101. package/dist/umd/types/edges.d.ts.map +1 -0
  102. package/dist/umd/types/general.d.ts +296 -0
  103. package/dist/umd/types/general.d.ts.map +1 -0
  104. package/dist/umd/types/handles.d.ts +65 -0
  105. package/dist/umd/types/handles.d.ts.map +1 -0
  106. package/dist/umd/types/index.d.ts +8 -0
  107. package/dist/umd/types/index.d.ts.map +1 -0
  108. package/dist/umd/types/nodes.d.ts +157 -0
  109. package/dist/umd/types/nodes.d.ts.map +1 -0
  110. package/dist/umd/types/panzoom.d.ts +55 -0
  111. package/dist/umd/types/panzoom.d.ts.map +1 -0
  112. package/dist/umd/types/utils.d.ts +61 -0
  113. package/dist/umd/types/utils.d.ts.map +1 -0
  114. package/dist/umd/utils/connections.d.ts +13 -0
  115. package/dist/umd/utils/connections.d.ts.map +1 -0
  116. package/dist/umd/utils/dom.d.ts +21 -0
  117. package/dist/umd/utils/dom.d.ts.map +1 -0
  118. package/dist/umd/utils/edge-toolbar.d.ts +2 -0
  119. package/dist/umd/utils/edge-toolbar.d.ts.map +1 -0
  120. package/dist/umd/utils/edges/bezier-edge.d.ts +77 -0
  121. package/dist/umd/utils/edges/bezier-edge.d.ts.map +1 -0
  122. package/dist/umd/utils/edges/floating.d.ts +32 -0
  123. package/dist/umd/utils/edges/floating.d.ts.map +1 -0
  124. package/dist/umd/utils/edges/general.d.ts +91 -0
  125. package/dist/umd/utils/edges/general.d.ts.map +1 -0
  126. package/dist/umd/utils/edges/index.d.ts +7 -0
  127. package/dist/umd/utils/edges/index.d.ts.map +1 -0
  128. package/dist/umd/utils/edges/positions.d.ts +17 -0
  129. package/dist/umd/utils/edges/positions.d.ts.map +1 -0
  130. package/dist/umd/utils/edges/smoothstep-edge.d.ts +66 -0
  131. package/dist/umd/utils/edges/smoothstep-edge.d.ts.map +1 -0
  132. package/dist/umd/utils/edges/straight-edge.d.ts +41 -0
  133. package/dist/umd/utils/edges/straight-edge.d.ts.map +1 -0
  134. package/dist/umd/utils/general.d.ts +86 -0
  135. package/dist/umd/utils/general.d.ts.map +1 -0
  136. package/dist/umd/utils/graph.d.ts +191 -0
  137. package/dist/umd/utils/graph.d.ts.map +1 -0
  138. package/dist/umd/utils/index.d.ts +12 -0
  139. package/dist/umd/utils/index.d.ts.map +1 -0
  140. package/dist/umd/utils/marker.d.ts +9 -0
  141. package/dist/umd/utils/marker.d.ts.map +1 -0
  142. package/dist/umd/utils/node-toolbar.d.ts +3 -0
  143. package/dist/umd/utils/node-toolbar.d.ts.map +1 -0
  144. package/dist/umd/utils/shallow-node-data.d.ts +5 -0
  145. package/dist/umd/utils/shallow-node-data.d.ts.map +1 -0
  146. package/dist/umd/utils/store.d.ts +34 -0
  147. package/dist/umd/utils/store.d.ts.map +1 -0
  148. package/dist/umd/utils/types.d.ts +8 -0
  149. package/dist/umd/utils/types.d.ts.map +1 -0
  150. package/dist/umd/xydrag/XYDrag.d.ts +55 -0
  151. package/dist/umd/xydrag/XYDrag.d.ts.map +1 -0
  152. package/dist/umd/xydrag/index.d.ts +2 -0
  153. package/dist/umd/xydrag/index.d.ts.map +1 -0
  154. package/dist/umd/xydrag/utils.d.ts +24 -0
  155. package/dist/umd/xydrag/utils.d.ts.map +1 -0
  156. package/dist/umd/xyhandle/XYHandle.d.ts +3 -0
  157. package/dist/umd/xyhandle/XYHandle.d.ts.map +1 -0
  158. package/dist/umd/xyhandle/index.d.ts +2 -0
  159. package/dist/umd/xyhandle/index.d.ts.map +1 -0
  160. package/dist/umd/xyhandle/types.d.ts +51 -0
  161. package/dist/umd/xyhandle/types.d.ts.map +1 -0
  162. package/dist/umd/xyhandle/utils.d.ts +29 -0
  163. package/dist/umd/xyhandle/utils.d.ts.map +1 -0
  164. package/dist/umd/xyminimap/index.d.ts +28 -0
  165. package/dist/umd/xyminimap/index.d.ts.map +1 -0
  166. package/dist/umd/xypanzoom/XYPanZoom.d.ts +12 -0
  167. package/dist/umd/xypanzoom/XYPanZoom.d.ts.map +1 -0
  168. package/dist/umd/xypanzoom/eventhandler.d.ts +46 -0
  169. package/dist/umd/xypanzoom/eventhandler.d.ts.map +1 -0
  170. package/dist/umd/xypanzoom/filter.d.ts +15 -0
  171. package/dist/umd/xypanzoom/filter.d.ts.map +1 -0
  172. package/dist/umd/xypanzoom/index.d.ts +2 -0
  173. package/dist/umd/xypanzoom/index.d.ts.map +1 -0
  174. package/dist/umd/xypanzoom/utils.d.ts +9 -0
  175. package/dist/umd/xypanzoom/utils.d.ts.map +1 -0
  176. package/dist/umd/xyresizer/XYResizer.d.ts +49 -0
  177. package/dist/umd/xyresizer/XYResizer.d.ts.map +1 -0
  178. package/dist/umd/xyresizer/index.d.ts +3 -0
  179. package/dist/umd/xyresizer/index.d.ts.map +1 -0
  180. package/dist/umd/xyresizer/types.d.ts +59 -0
  181. package/dist/umd/xyresizer/types.d.ts.map +1 -0
  182. package/dist/umd/xyresizer/utils.d.ts +76 -0
  183. package/dist/umd/xyresizer/utils.d.ts.map +1 -0
  184. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ import { CoordinateExtent, HandleType } from './types';
2
+ export declare const errorMessages: {
3
+ error001: () => string;
4
+ error002: () => string;
5
+ error003: (nodeType: string) => string;
6
+ error004: () => string;
7
+ error005: () => string;
8
+ error006: () => string;
9
+ error007: (id: string) => string;
10
+ error009: (type: string) => string;
11
+ error008: (handleType: HandleType, { id, sourceHandle, targetHandle }: {
12
+ id: string;
13
+ sourceHandle: string | null;
14
+ targetHandle: string | null;
15
+ }) => string;
16
+ error010: () => string;
17
+ error011: (edgeType: string) => string;
18
+ error012: (id: string) => string;
19
+ error013: (lib?: string) => string;
20
+ error014: () => string;
21
+ error015: () => string;
22
+ };
23
+ export declare const infiniteExtent: CoordinateExtent;
24
+ export declare const elementSelectionKeys: string[];
25
+ export declare const defaultAriaLabelConfig: {
26
+ 'node.a11yDescription.default': string;
27
+ 'node.a11yDescription.keyboardDisabled': string;
28
+ 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }: {
29
+ direction: string;
30
+ x: number;
31
+ y: number;
32
+ }) => string;
33
+ 'edge.a11yDescription.default': string;
34
+ 'controls.ariaLabel': string;
35
+ 'controls.zoomIn.ariaLabel': string;
36
+ 'controls.zoomOut.ariaLabel': string;
37
+ 'controls.fitView.ariaLabel': string;
38
+ 'controls.interactive.ariaLabel': string;
39
+ 'minimap.ariaLabel': string;
40
+ 'handle.ariaLabel': string;
41
+ };
42
+ export type AriaLabelConfig = typeof defaultAriaLabelConfig;
43
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU,sCACc;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;yBAMzF,MAAM;mBACZ,MAAM;qBAEL,MAAM;;;CAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAA2B,CAAC;AAE7D,eAAO,MAAM,sBAAsB;;;kEAK6B;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;CAiB1G,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,sBAAsB,CAAC"}
@@ -1,8 +1,9 @@
1
- export * from './src/constants';
2
- export * from './src/types';
3
- export * from './src/utils';
4
- export * from './src/xydrag';
5
- export * from './src/xyhandle';
6
- export * from './src/xyminimap';
7
- export * from './src/xypanzoom';
8
- export * from './src/xyresizer';
1
+ export * from './constants';
2
+ export * from './types';
3
+ export * from './utils';
4
+ export * from './xydrag';
5
+ export * from './xyhandle';
6
+ export * from './xyminimap';
7
+ export * from './xypanzoom';
8
+ export * from './xyresizer';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1478,17 +1478,20 @@ function getFloatingEndpoint(nodeRect, referencePoint) {
1478
1478
  * Used to choose sourcePosition/targetPosition for path-shape helpers (bezier, step)
1479
1479
  * when the endpoint is floating rather than anchored to a handle with a declared position.
1480
1480
  *
1481
- * Tiebreak: at exact corners (|dx| === |dy|), the Y axis wins via strict `>`, so the
1482
- * function returns Top or Bottom rather than Left or Right.
1481
+ * Tiebreak: at exact corners (normalized |dx| === |dy|), the Y axis wins via strict `>`,
1482
+ * so the function returns Top or Bottom rather than Left or Right.
1483
1483
  */
1484
1484
  function inferSide(intersection, nodeRect) {
1485
1485
  const cx = nodeRect.x + nodeRect.width / 2;
1486
1486
  const cy = nodeRect.y + nodeRect.height / 2;
1487
- const dx = intersection.x - cx;
1488
- const dy = intersection.y - cy;
1489
- return Math.abs(dx) > Math.abs(dy)
1490
- ? (dx > 0 ? Position.Right : Position.Left)
1491
- : (dy > 0 ? Position.Bottom : Position.Top);
1487
+ // Normalize by half-extents so the comparison identifies the border segment
1488
+ // the point actually lies on (matches getFloatingEndpoint's crossing-axis
1489
+ // choice); raw deltas misclassify top/bottom points on non-square nodes.
1490
+ const nx = (intersection.x - cx) / (nodeRect.width / 2);
1491
+ const ny = (intersection.y - cy) / (nodeRect.height / 2);
1492
+ return Math.abs(nx) > Math.abs(ny)
1493
+ ? (nx > 0 ? Position.Right : Position.Left)
1494
+ : (ny > 0 ? Position.Bottom : Position.Top);
1492
1495
  }
1493
1496
 
1494
1497
  function getMarkerId(marker, id) {
@@ -1478,17 +1478,20 @@ function getFloatingEndpoint(nodeRect, referencePoint) {
1478
1478
  * Used to choose sourcePosition/targetPosition for path-shape helpers (bezier, step)
1479
1479
  * when the endpoint is floating rather than anchored to a handle with a declared position.
1480
1480
  *
1481
- * Tiebreak: at exact corners (|dx| === |dy|), the Y axis wins via strict `>`, so the
1482
- * function returns Top or Bottom rather than Left or Right.
1481
+ * Tiebreak: at exact corners (normalized |dx| === |dy|), the Y axis wins via strict `>`,
1482
+ * so the function returns Top or Bottom rather than Left or Right.
1483
1483
  */
1484
1484
  function inferSide(intersection, nodeRect) {
1485
1485
  const cx = nodeRect.x + nodeRect.width / 2;
1486
1486
  const cy = nodeRect.y + nodeRect.height / 2;
1487
- const dx = intersection.x - cx;
1488
- const dy = intersection.y - cy;
1489
- return Math.abs(dx) > Math.abs(dy)
1490
- ? (dx > 0 ? Position.Right : Position.Left)
1491
- : (dy > 0 ? Position.Bottom : Position.Top);
1487
+ // Normalize by half-extents so the comparison identifies the border segment
1488
+ // the point actually lies on (matches getFloatingEndpoint's crossing-axis
1489
+ // choice); raw deltas misclassify top/bottom points on non-square nodes.
1490
+ const nx = (intersection.x - cx) / (nodeRect.width / 2);
1491
+ const ny = (intersection.y - cy) / (nodeRect.height / 2);
1492
+ return Math.abs(nx) > Math.abs(ny)
1493
+ ? (nx > 0 ? Position.Right : Position.Left)
1494
+ : (ny > 0 ? Position.Bottom : Position.Top);
1492
1495
  }
1493
1496
 
1494
1497
  function getMarkerId(marker, id) {
@@ -0,0 +1,64 @@
1
+ import type { XYPosition, Dimensions, NodeBase, EdgeBase } from '.';
2
+ export type NodeDimensionChange = {
3
+ id: string;
4
+ type: 'dimensions';
5
+ dimensions?: Dimensions;
6
+ resizing?: boolean;
7
+ setAttributes?: boolean | 'width' | 'height';
8
+ };
9
+ export type NodePositionChange = {
10
+ id: string;
11
+ type: 'position';
12
+ position?: XYPosition;
13
+ positionAbsolute?: XYPosition;
14
+ dragging?: boolean;
15
+ };
16
+ export type NodeSelectionChange = {
17
+ id: string;
18
+ type: 'select';
19
+ selected: boolean;
20
+ };
21
+ export type NodeRemoveChange = {
22
+ id: string;
23
+ type: 'remove';
24
+ };
25
+ export type NodeAddChange<NodeType extends NodeBase = NodeBase> = {
26
+ item: NodeType;
27
+ type: 'add';
28
+ index?: number;
29
+ };
30
+ export type NodeReplaceChange<NodeType extends NodeBase = NodeBase> = {
31
+ id: string;
32
+ item: NodeType;
33
+ type: 'replace';
34
+ };
35
+ /**
36
+ * The [`onNodesChange`](/api-reference/react-flow#on-nodes-change) callback takes
37
+ *an array of `NodeChange` objects that you should use to update your flow's state.
38
+ *The `NodeChange` type is a union of six different object types that represent that
39
+ *various ways an node can change in a flow.
40
+ * @public
41
+ */
42
+ export type NodeChange<NodeType extends NodeBase = NodeBase> = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange<NodeType> | NodeReplaceChange<NodeType>;
43
+ export type EdgeSelectionChange = NodeSelectionChange;
44
+ export type EdgeRemoveChange = NodeRemoveChange;
45
+ export type EdgeAddChange<EdgeType extends EdgeBase = EdgeBase> = {
46
+ item: EdgeType;
47
+ type: 'add';
48
+ index?: number;
49
+ };
50
+ export type EdgeReplaceChange<EdgeType extends EdgeBase = EdgeBase> = {
51
+ id: string;
52
+ item: EdgeType;
53
+ type: 'replace';
54
+ };
55
+ /**
56
+ * The [`onEdgesChange`](/api-reference/react-flow#on-edges-change) callback takes
57
+ *an array of `EdgeChange` objects that you should use to update your flow's state.
58
+ *The `EdgeChange` type is a union of four different object types that represent that
59
+ *various ways an edge can change in a flow.
60
+ *
61
+ * @public
62
+ */
63
+ export type EdgeChange<EdgeType extends EdgeBase = EdgeBase> = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange<EdgeType> | EdgeReplaceChange<EdgeType>;
64
+ //# sourceMappingURL=changes.d.ts.map
@@ -0,0 +1 @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AMG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IACvD,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,CAAC,QAAQ,CAAC,GACvB,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEhC,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAChD,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAChE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IACvD,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,CAAC,QAAQ,CAAC,GACvB,iBAAiB,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { Position } from './utils';
2
+ export type EdgeBase<EdgeData extends Record<string, unknown> = Record<string, unknown>, EdgeType extends string | undefined = string | undefined> = {
3
+ /** Unique id of an edge. */
4
+ id: string;
5
+ /** Type of edge defined in `edgeTypes`. */
6
+ type?: EdgeType;
7
+ /** Id of source node. */
8
+ source: string;
9
+ /** Id of target node. */
10
+ target: string;
11
+ /** Id of source handle, only needed if there are multiple handles per node. */
12
+ sourceHandle?: string | null;
13
+ /** Id of target handle, only needed if there are multiple handles per node. */
14
+ targetHandle?: string | null;
15
+ animated?: boolean;
16
+ hidden?: boolean;
17
+ deletable?: boolean;
18
+ selectable?: boolean;
19
+ /** Arbitrary data passed to an edge. */
20
+ data?: EdgeData;
21
+ selected?: boolean;
22
+ /**
23
+ * Set the marker on the beginning of an edge.
24
+ * @example 'arrow', 'arrowclosed' or custom marker
25
+ */
26
+ markerStart?: EdgeMarkerType;
27
+ /**
28
+ * Set the marker on the end of an edge.
29
+ * @example 'arrow', 'arrowclosed' or custom marker
30
+ */
31
+ markerEnd?: EdgeMarkerType;
32
+ zIndex?: number;
33
+ ariaLabel?: string;
34
+ /**
35
+ * ReactFlow renders an invisible path around each edge to make them easier to click or tap on.
36
+ * This property sets the width of that invisible path.
37
+ */
38
+ interactionWidth?: number;
39
+ };
40
+ export type SmoothStepPathOptions = {
41
+ offset?: number;
42
+ borderRadius?: number;
43
+ stepPosition?: number;
44
+ };
45
+ export type StepPathOptions = {
46
+ offset?: number;
47
+ };
48
+ export type BezierPathOptions = {
49
+ curvature?: number;
50
+ };
51
+ /**
52
+ * @inline
53
+ */
54
+ export type DefaultEdgeOptionsBase<EdgeType extends EdgeBase> = Omit<EdgeType, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'selected'>;
55
+ /**
56
+ * If you set the `connectionLineType` prop on your [`<ReactFlow />`](/api-reference/react-flow#connection-connectionLineType)
57
+ *component, it will dictate the style of connection line rendered when creating
58
+ *new edges.
59
+ *
60
+ * @public
61
+ *
62
+ * @remarks If you choose to render a custom connection line component, this value will be
63
+ *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props).
64
+ */
65
+ export declare enum ConnectionLineType {
66
+ Bezier = "default",
67
+ Straight = "straight",
68
+ Step = "step",
69
+ SmoothStep = "smoothstep",
70
+ SimpleBezier = "simplebezier"
71
+ }
72
+ /**
73
+ * Edges can optionally have markers at the start and end of an edge. The `EdgeMarker`
74
+ *type is used to configure those markers! Check the docs for [`MarkerType`](/api-reference/types/marker-type)
75
+ *for details on what types of edge marker are available.
76
+ *
77
+ * @public
78
+ */
79
+ export type EdgeMarker = {
80
+ type: MarkerType | `${MarkerType}`;
81
+ color?: string | null;
82
+ width?: number;
83
+ height?: number;
84
+ markerUnits?: string;
85
+ orient?: string;
86
+ strokeWidth?: number;
87
+ };
88
+ export type EdgeMarkerType = string | EdgeMarker;
89
+ /**
90
+ * Edges may optionally have a marker on either end. The MarkerType type enumerates
91
+ * the options available to you when configuring a given marker.
92
+ *
93
+ * @public
94
+ */
95
+ export declare enum MarkerType {
96
+ Arrow = "arrow",
97
+ ArrowClosed = "arrowclosed"
98
+ }
99
+ export type MarkerProps = EdgeMarker & {
100
+ id: string;
101
+ };
102
+ /**
103
+ * @inline
104
+ */
105
+ export type EdgePosition = {
106
+ sourceX: number;
107
+ sourceY: number;
108
+ targetX: number;
109
+ targetY: number;
110
+ sourcePosition: Position;
111
+ targetPosition: Position;
112
+ };
113
+ export type EdgeLookup<EdgeType extends EdgeBase = EdgeBase> = Map<string, EdgeType>;
114
+ export type EdgeToolbarBaseProps = {
115
+ /**
116
+ * The `x` position of the edge toolbar.
117
+ */
118
+ x: number;
119
+ /**
120
+ * The `y` position of the edge toolbar.
121
+ */
122
+ y: number;
123
+ /** If `true`, edge toolbar is visible even if edge is not selected.
124
+ * @default false
125
+ */
126
+ isVisible?: boolean;
127
+ /**
128
+ * Align the vertical toolbar position relative to the passed x position.
129
+ * @default "center"
130
+ * @example 'left', 'center', 'right'
131
+ */
132
+ alignX?: 'left' | 'center' | 'right';
133
+ /**
134
+ * Align the horizontal toolbar position relative to the passed y position.
135
+ * @default "center"
136
+ * @example 'top', 'center', 'bottom'
137
+ */
138
+ alignY?: 'top' | 'center' | 'bottom';
139
+ };
140
+ //# sourceMappingURL=edges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAA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AErF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACtC,CAAC"}
@@ -0,0 +1,296 @@
1
+ import type { Selection as D3Selection } from 'd3-selection';
2
+ import type { D3DragEvent, SubjectPosition } from 'd3-drag';
3
+ import type { ZoomBehavior } from 'd3-zoom';
4
+ import type { XYPosition, Rect, Position } from './utils';
5
+ import type { InternalNodeBase, NodeBase, NodeDragItem } from './nodes';
6
+ import type { Handle, HandleType } from './handles';
7
+ import { PanZoomInstance } from './panzoom';
8
+ import { EdgeBase } from '..';
9
+ export type Project = (position: XYPosition) => XYPosition;
10
+ /**
11
+ * This type is used to define the `onMove` handler.
12
+ */
13
+ export type OnMove = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
14
+ export type OnMoveStart = OnMove;
15
+ export type OnMoveEnd = OnMove;
16
+ /**
17
+ * @inline
18
+ */
19
+ export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => Promise<boolean>;
20
+ /**
21
+ * @inline
22
+ */
23
+ export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise<boolean>;
24
+ /**
25
+ * @inline
26
+ */
27
+ export type GetZoom = () => number;
28
+ /**
29
+ * @inline
30
+ */
31
+ export type GetViewport = () => Viewport;
32
+ /**
33
+ * The `SetViewport` function is used to set the viewport of the flow.
34
+ *
35
+ * @inline
36
+ * @param viewport - The viewport to set.
37
+ * @param options - Optional parameters to control the animation and easing of the viewport change.
38
+ */
39
+ export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise<boolean>;
40
+ /**
41
+ * The `SetCenter` function is used to set the center of the flow viewport to a specific position
42
+ *
43
+ * @inline
44
+ * @param x - x coordinate
45
+ * @param y - y coordinate
46
+ * @param options - Optional parameters to control the animation and easing of the viewport change.
47
+ */
48
+ export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise<boolean>;
49
+ /**
50
+ * The `FitBounds` function is used to fit the flow viewport to the bounds of the nodes.
51
+ *
52
+ * @inline
53
+ * @param bounds - The bounds to fit the viewport to.
54
+ * @param options - Optional parameters to control the animation and easing of the viewport change.
55
+ */
56
+ export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise<boolean>;
57
+ /**
58
+ * The `Connection` type is the basic minimal description of an [`Edge`](/api-reference/types/edge)
59
+ * between two nodes. The [`addEdge`](/api-reference/utils/add-edge) util can be used to upgrade
60
+ * a `Connection` to an [`Edge`](/api-reference/types/edge).
61
+ *
62
+ * @public
63
+ */
64
+ export type Connection = {
65
+ /** The id of the node this connection originates from. */
66
+ source: string;
67
+ /** The id of the node this connection terminates at. */
68
+ target: string;
69
+ /** When not `null`, the id of the handle on the source node that this connection originates from. */
70
+ sourceHandle: string | null;
71
+ /** When not `null`, the id of the handle on the target node that this connection terminates at. */
72
+ targetHandle: string | null;
73
+ };
74
+ /**
75
+ * The `HandleConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`.
76
+ */
77
+ export type HandleConnection = Connection & {
78
+ edgeId: string;
79
+ };
80
+ /**
81
+ * The `NodeConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`.
82
+ *
83
+ */
84
+ export type NodeConnection = Connection & {
85
+ edgeId: string;
86
+ };
87
+ /**
88
+ * The `ConnectionMode` is used to set the mode of connection between nodes.
89
+ * The `Strict` mode is the default one and only allows source to target edges.
90
+ * `Loose` mode allows source to source and target to target edges as well.
91
+ *
92
+ * @public
93
+ */
94
+ export declare enum ConnectionMode {
95
+ Strict = "strict",
96
+ Loose = "loose"
97
+ }
98
+ export type OnConnectStartParams = {
99
+ nodeId: string | null;
100
+ handleId: string | null;
101
+ handleType: HandleType | null;
102
+ };
103
+ export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
104
+ export type OnConnect = (connection: Connection) => void;
105
+ export type OnConnectEnd = (event: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void;
106
+ export type OnReconnect<EdgeType extends EdgeBase = EdgeBase> = (oldEdge: EdgeType, newConnection: Connection) => void;
107
+ export type OnReconnectStart<EdgeType extends EdgeBase = EdgeBase> = (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
108
+ export type OnReconnectEnd<EdgeType extends EdgeBase = EdgeBase> = (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void;
109
+ export type IsValidConnection = (edge: EdgeBase | Connection) => boolean;
110
+ /**
111
+ * @inline
112
+ */
113
+ export type FitViewParamsBase<NodeType extends NodeBase> = {
114
+ nodes: Map<string, InternalNodeBase<NodeType>>;
115
+ width: number;
116
+ height: number;
117
+ panZoom: PanZoomInstance;
118
+ minZoom: number;
119
+ maxZoom: number;
120
+ };
121
+ export type PaddingUnit = 'px' | '%';
122
+ export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
123
+ export type Padding = PaddingWithUnit | {
124
+ top?: PaddingWithUnit;
125
+ right?: PaddingWithUnit;
126
+ bottom?: PaddingWithUnit;
127
+ left?: PaddingWithUnit;
128
+ x?: PaddingWithUnit;
129
+ y?: PaddingWithUnit;
130
+ };
131
+ /**
132
+ * @inline
133
+ */
134
+ export type FitViewOptionsBase<NodeType extends NodeBase = NodeBase> = {
135
+ padding?: Padding;
136
+ includeHiddenNodes?: boolean;
137
+ minZoom?: number;
138
+ maxZoom?: number;
139
+ duration?: number;
140
+ ease?: (t: number) => number;
141
+ interpolate?: 'smooth' | 'linear';
142
+ nodes?: (NodeType | {
143
+ id: string;
144
+ })[];
145
+ };
146
+ /**
147
+ * Internally, React Flow maintains a coordinate system that is independent of the
148
+ * rest of the page. The `Viewport` type tells you where in that system your flow
149
+ * is currently being display at and how zoomed in or out it is.
150
+ *
151
+ * @public
152
+ * @remarks A `Transform` has the same properties as the viewport, but they represent
153
+ * different things. Make sure you don't get them muddled up or things will start
154
+ * to look weird!
155
+ *
156
+ */
157
+ export type Viewport = {
158
+ x: number;
159
+ y: number;
160
+ zoom: number;
161
+ };
162
+ export type KeyCode = string | Array<string>;
163
+ export type SnapGrid = [number, number];
164
+ /**
165
+ * This enum is used to set the different modes of panning the viewport when the
166
+ * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling
167
+ * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict
168
+ * scroll panning to only the vertical or horizontal axis, respectively.
169
+ *
170
+ * @public
171
+ */
172
+ export declare enum PanOnScrollMode {
173
+ Free = "free",
174
+ Vertical = "vertical",
175
+ Horizontal = "horizontal"
176
+ }
177
+ /**
178
+ * @inline
179
+ */
180
+ export type ViewportHelperFunctionOptions = {
181
+ duration?: number;
182
+ ease?: (t: number) => number;
183
+ interpolate?: 'smooth' | 'linear';
184
+ };
185
+ /**
186
+ * @inline
187
+ */
188
+ export type SetCenterOptions = ViewportHelperFunctionOptions & {
189
+ zoom?: number;
190
+ };
191
+ /**
192
+ * @inline
193
+ */
194
+ export type FitBoundsOptions = ViewportHelperFunctionOptions & {
195
+ padding?: number;
196
+ };
197
+ export type OnViewportChange = (viewport: Viewport) => void;
198
+ export type D3ZoomInstance = ZoomBehavior<Element, unknown>;
199
+ export type D3SelectionInstance = D3Selection<Element, unknown, null, undefined>;
200
+ export type D3ZoomHandler = (this: Element, event: any, d: unknown) => void;
201
+ export type UpdateNodeInternals = (nodeId: string | string[]) => void;
202
+ /**
203
+ * This type is mostly used to help position things on top of the flow viewport. For
204
+ * example both the [`<MiniMap />`](/api-reference/components/minimap) and
205
+ * [`<Controls />`](/api-reference/components/controls) components take a `position`
206
+ * prop of this type.
207
+ *
208
+ * @public
209
+ */
210
+ export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-right';
211
+ export type ProOptions = {
212
+ account?: string;
213
+ hideAttribution: boolean;
214
+ };
215
+ export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
216
+ export declare enum SelectionMode {
217
+ Partial = "partial",
218
+ Full = "full"
219
+ }
220
+ export type SelectionRect = Rect & {
221
+ startX: number;
222
+ startY: number;
223
+ };
224
+ export type OnError = (id: string, message: string) => void;
225
+ export type UpdateNodePositions = (dragItems: Map<string, NodeDragItem | InternalNodeBase>, dragging?: boolean) => void;
226
+ export type PanBy = (delta: XYPosition) => Promise<boolean>;
227
+ export declare const initialConnection: NoConnection;
228
+ export type NoConnection = {
229
+ inProgress: false;
230
+ isValid: null;
231
+ from: null;
232
+ fromHandle: null;
233
+ fromPosition: null;
234
+ fromNode: null;
235
+ to: null;
236
+ toHandle: null;
237
+ toPosition: null;
238
+ toNode: null;
239
+ pointer: null;
240
+ };
241
+ export type ConnectionInProgress<NodeType extends InternalNodeBase = InternalNodeBase> = {
242
+ /** Indicates whether a connection is currently in progress. */
243
+ inProgress: true;
244
+ /**
245
+ * If an ongoing connection is above a handle or inside the connection radius, this will be `true`
246
+ * or `false`, otherwise `null`.
247
+ */
248
+ isValid: boolean | null;
249
+ /** Returns the xy start position or `null` if no connection is in progress. */
250
+ from: XYPosition;
251
+ /** Returns the start handle or `null` if no connection is in progress. */
252
+ fromHandle: Handle;
253
+ /** Returns the side (called position) of the start handle or `null` if no connection is in progress. */
254
+ fromPosition: Position;
255
+ /** Returns the start node or `null` if no connection is in progress. */
256
+ fromNode: NodeType;
257
+ /** Returns the xy end position or `null` if no connection is in progress. */
258
+ to: XYPosition;
259
+ /** Returns the end handle or `null` if no connection is in progress. */
260
+ toHandle: Handle | null;
261
+ /** Returns the side (called position) of the end handle or `null` if no connection is in progress. */
262
+ toPosition: Position;
263
+ /** Returns the end node or `null` if no connection is in progress. */
264
+ toNode: NodeType | null;
265
+ /** Returns the pointer position or `null` if no connection is in progress. */
266
+ pointer: XYPosition;
267
+ };
268
+ /**
269
+ * The `ConnectionState` type bundles all information about an ongoing connection.
270
+ * It is returned by the [`useConnection`](/api-reference/hooks/use-connection) hook.
271
+ *
272
+ * @public
273
+ */
274
+ export type ConnectionState<NodeType extends InternalNodeBase = InternalNodeBase> = ConnectionInProgress<NodeType> | NoConnection;
275
+ export type FinalConnectionState<NodeType extends InternalNodeBase = InternalNodeBase> = Omit<ConnectionState<NodeType>, 'inProgress'>;
276
+ export type UpdateConnection<NodeType extends InternalNodeBase = InternalNodeBase> = (params: ConnectionState<NodeType>) => void;
277
+ export type ColorModeClass = 'light' | 'dark';
278
+ export type ColorMode = ColorModeClass | 'system';
279
+ export type ConnectionLookup = Map<string, Map<string, HandleConnection>>;
280
+ export type OnBeforeDeleteBase<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = ({ nodes, edges, }: {
281
+ nodes: NodeType[];
282
+ edges: EdgeType[];
283
+ }) => Promise<boolean | {
284
+ nodes: NodeType[];
285
+ edges: EdgeType[];
286
+ }>;
287
+ /**
288
+ * The `ZIndexMode` type is used to define how z-indexing is calculated for nodes and edges.
289
+ * `auto` mode will automatically manage z-indexing for selections and sub flows.
290
+ * `basic` mode will only manage z-indexing for selections.
291
+ * `manual` mode does not apply any automatic z-indexing.
292
+ *
293
+ * @public
294
+ */
295
+ export type ZIndexMode = 'auto' | 'basic' | 'manual';
296
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CA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