@aloudata/ink-flow 1.0.7 → 1.0.8

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 (191) hide show
  1. package/dist/components/A11yDescriptions/index.d.ts +8 -0
  2. package/dist/components/A11yDescriptions/index.d.ts.map +1 -0
  3. package/dist/components/BatchProvider/index.d.ts +17 -0
  4. package/dist/components/BatchProvider/index.d.ts.map +1 -0
  5. package/dist/components/BatchProvider/types.d.ts +7 -0
  6. package/dist/components/BatchProvider/types.d.ts.map +1 -0
  7. package/dist/components/BatchProvider/useQueue.d.ts +11 -0
  8. package/dist/components/BatchProvider/useQueue.d.ts.map +1 -0
  9. package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +17 -0
  10. package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -0
  11. package/dist/components/EdgeWrapper/index.d.ts +3 -0
  12. package/dist/components/EdgeWrapper/index.d.ts.map +1 -0
  13. package/dist/components/EdgeWrapper/utils.d.ts +11 -0
  14. package/dist/components/EdgeWrapper/utils.d.ts.map +1 -0
  15. package/dist/components/Edges/BaseEdge.d.ts +3 -0
  16. package/dist/components/Edges/BaseEdge.d.ts.map +1 -0
  17. package/dist/components/Edges/BezierEdge.d.ts +5 -0
  18. package/dist/components/Edges/BezierEdge.d.ts.map +1 -0
  19. package/dist/components/Edges/EdgeAnchor.d.ts +14 -0
  20. package/dist/components/Edges/EdgeAnchor.d.ts.map +1 -0
  21. package/dist/components/Edges/EdgeText.d.ts +8 -0
  22. package/dist/components/Edges/EdgeText.d.ts.map +1 -0
  23. package/dist/components/Edges/SimpleBezierEdge.d.ts +21 -0
  24. package/dist/components/Edges/SimpleBezierEdge.d.ts.map +1 -0
  25. package/dist/components/Edges/SmoothStepEdge.d.ts +5 -0
  26. package/dist/components/Edges/SmoothStepEdge.d.ts.map +1 -0
  27. package/dist/components/Edges/StepEdge.d.ts +5 -0
  28. package/dist/components/Edges/StepEdge.d.ts.map +1 -0
  29. package/dist/components/Edges/StraightEdge.d.ts +5 -0
  30. package/dist/components/Edges/StraightEdge.d.ts.map +1 -0
  31. package/dist/components/Edges/index.d.ts +6 -0
  32. package/dist/components/Edges/index.d.ts.map +1 -0
  33. package/dist/components/Handle/index.d.ts +11 -0
  34. package/dist/components/Handle/index.d.ts.map +1 -0
  35. package/dist/components/InkFlowProvider/index.d.ts +14 -0
  36. package/dist/components/InkFlowProvider/index.d.ts.map +1 -0
  37. package/dist/components/NodeWrapper/index.d.ts +3 -0
  38. package/dist/components/NodeWrapper/index.d.ts.map +1 -0
  39. package/dist/components/NodeWrapper/useNodeObserver.d.ts +14 -0
  40. package/dist/components/NodeWrapper/useNodeObserver.d.ts.map +1 -0
  41. package/dist/components/NodeWrapper/utils.d.ts +9 -0
  42. package/dist/components/NodeWrapper/utils.d.ts.map +1 -0
  43. package/dist/components/Nodes/DefaultNode.d.ts +3 -0
  44. package/dist/components/Nodes/DefaultNode.d.ts.map +1 -0
  45. package/dist/components/Nodes/GroupNode.d.ts +2 -0
  46. package/dist/components/Nodes/GroupNode.d.ts.map +1 -0
  47. package/dist/components/Nodes/InputNode.d.ts +3 -0
  48. package/dist/components/Nodes/InputNode.d.ts.map +1 -0
  49. package/dist/components/Nodes/OutputNode.d.ts +3 -0
  50. package/dist/components/Nodes/OutputNode.d.ts.map +1 -0
  51. package/dist/components/Nodes/utils.d.ts +13 -0
  52. package/dist/components/Nodes/utils.d.ts.map +1 -0
  53. package/dist/components/Panel/index.d.ts +11 -0
  54. package/dist/components/Panel/index.d.ts.map +1 -0
  55. package/dist/components/StoreUpdater/index.d.ts +9 -0
  56. package/dist/components/StoreUpdater/index.d.ts.map +1 -0
  57. package/dist/components/UserSelection/index.d.ts +2 -0
  58. package/dist/components/UserSelection/index.d.ts.map +1 -0
  59. package/dist/container/EdgeRenderer/MarkerDefinitions.d.ts +10 -0
  60. package/dist/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -0
  61. package/dist/container/EdgeRenderer/MarkerSymbols.d.ts +9 -0
  62. package/dist/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -0
  63. package/dist/container/EdgeRenderer/index.d.ts +13 -0
  64. package/dist/container/EdgeRenderer/index.d.ts.map +1 -0
  65. package/dist/container/FlowRenderer/index.d.ts +14 -0
  66. package/dist/container/FlowRenderer/index.d.ts.map +1 -0
  67. package/dist/container/GraphView/index.d.ts +11 -0
  68. package/dist/container/GraphView/index.d.ts.map +1 -0
  69. package/dist/container/InkFlow/Wrapper.d.ts +13 -0
  70. package/dist/container/InkFlow/Wrapper.d.ts.map +1 -0
  71. package/dist/container/InkFlow/index.d.ts +4 -0
  72. package/dist/container/InkFlow/index.d.ts.map +1 -0
  73. package/dist/container/InkFlow/init-values.d.ts +4 -0
  74. package/dist/container/InkFlow/init-values.d.ts.map +1 -0
  75. package/dist/container/NodeRenderer/index.d.ts +10 -0
  76. package/dist/container/NodeRenderer/index.d.ts.map +1 -0
  77. package/dist/container/NodeRenderer/useResizeObserver.d.ts +2 -0
  78. package/dist/container/NodeRenderer/useResizeObserver.d.ts.map +1 -0
  79. package/dist/container/Pane/index.d.ts +12 -0
  80. package/dist/container/Pane/index.d.ts.map +1 -0
  81. package/dist/container/Viewport/index.d.ts +7 -0
  82. package/dist/container/Viewport/index.d.ts.map +1 -0
  83. package/dist/container/ZoomPane/index.d.ts +7 -0
  84. package/dist/container/ZoomPane/index.d.ts.map +1 -0
  85. package/dist/contexts/NodeIdContext.d.ts +6 -0
  86. package/dist/contexts/NodeIdContext.d.ts.map +1 -0
  87. package/dist/contexts/StoreContext.d.ts +4 -0
  88. package/dist/contexts/StoreContext.d.ts.map +1 -0
  89. package/dist/hooks/index.d.ts +5 -0
  90. package/dist/hooks/index.d.ts.map +1 -0
  91. package/dist/hooks/useDrag.d.ts +12 -0
  92. package/dist/hooks/useDrag.d.ts.map +1 -0
  93. package/dist/hooks/useEdgesState.d.ts +4 -0
  94. package/dist/hooks/useEdgesState.d.ts.map +1 -0
  95. package/dist/hooks/useGlobalKeyHandler.d.ts +11 -0
  96. package/dist/hooks/useGlobalKeyHandler.d.ts.map +1 -0
  97. package/dist/hooks/useInkFlow.d.ts +10 -0
  98. package/dist/hooks/useInkFlow.d.ts.map +1 -0
  99. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  100. package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  101. package/dist/hooks/useKeyPress.d.ts +15 -0
  102. package/dist/hooks/useKeyPress.d.ts.map +1 -0
  103. package/dist/hooks/useMoveSelectedNodes.d.ts +12 -0
  104. package/dist/hooks/useMoveSelectedNodes.d.ts.map +1 -0
  105. package/dist/hooks/useNodesState.d.ts +4 -0
  106. package/dist/hooks/useNodesState.d.ts.map +1 -0
  107. package/dist/hooks/useResizeHandler.d.ts +8 -0
  108. package/dist/hooks/useResizeHandler.d.ts.map +1 -0
  109. package/dist/hooks/useStore.d.ts +21 -0
  110. package/dist/hooks/useStore.d.ts.map +1 -0
  111. package/dist/hooks/useViewportHelper.d.ts +10 -0
  112. package/dist/hooks/useViewportHelper.d.ts.map +1 -0
  113. package/dist/hooks/useVisibleEdgeIds.d.ts +9 -0
  114. package/dist/hooks/useVisibleEdgeIds.d.ts.map +1 -0
  115. package/dist/hooks/useVisibleNodeIds.d.ts +9 -0
  116. package/dist/hooks/useVisibleNodeIds.d.ts.map +1 -0
  117. package/dist/index.cjs.js +17 -0
  118. package/dist/index.cjs.js.map +1 -0
  119. package/dist/index.d.ts +11 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.esm.js +17 -0
  122. package/dist/index.esm.js.map +1 -0
  123. package/dist/plugins/Controls/ControlButton.d.ts +3 -0
  124. package/dist/plugins/Controls/ControlButton.d.ts.map +1 -0
  125. package/dist/plugins/Controls/Controls.d.ts +8 -0
  126. package/dist/plugins/Controls/Controls.d.ts.map +1 -0
  127. package/dist/plugins/Controls/Icons/FitView.d.ts +2 -0
  128. package/dist/plugins/Controls/Icons/FitView.d.ts.map +1 -0
  129. package/dist/plugins/Controls/Icons/Lock.d.ts +2 -0
  130. package/dist/plugins/Controls/Icons/Lock.d.ts.map +1 -0
  131. package/dist/plugins/Controls/Icons/Minus.d.ts +2 -0
  132. package/dist/plugins/Controls/Icons/Minus.d.ts.map +1 -0
  133. package/dist/plugins/Controls/Icons/Plus.d.ts +2 -0
  134. package/dist/plugins/Controls/Icons/Plus.d.ts.map +1 -0
  135. package/dist/plugins/Controls/Icons/Unlock.d.ts +2 -0
  136. package/dist/plugins/Controls/Icons/Unlock.d.ts.map +1 -0
  137. package/dist/plugins/Controls/index.d.ts +4 -0
  138. package/dist/plugins/Controls/index.d.ts.map +1 -0
  139. package/dist/plugins/Controls/types.d.ts +35 -0
  140. package/dist/plugins/Controls/types.d.ts.map +1 -0
  141. package/dist/plugins/index.d.ts +2 -0
  142. package/dist/plugins/index.d.ts.map +1 -0
  143. package/dist/store/index.d.ts +12 -0
  144. package/dist/store/index.d.ts.map +1 -0
  145. package/dist/store/initialState.d.ts +12 -0
  146. package/dist/store/initialState.d.ts.map +1 -0
  147. package/dist/styles/utils.d.ts +3 -0
  148. package/dist/styles/utils.d.ts.map +1 -0
  149. package/dist/types/edges.d.ts +114 -0
  150. package/dist/types/edges.d.ts.map +1 -0
  151. package/dist/types/general.d.ts +123 -0
  152. package/dist/types/general.d.ts.map +1 -0
  153. package/dist/types/index.d.ts +7 -0
  154. package/dist/types/index.d.ts.map +1 -0
  155. package/dist/types/instance.d.ts +149 -0
  156. package/dist/types/instance.d.ts.map +1 -0
  157. package/dist/types/nodes.d.ts +40 -0
  158. package/dist/types/nodes.d.ts.map +1 -0
  159. package/dist/types/props.d.ts +151 -0
  160. package/dist/types/props.d.ts.map +1 -0
  161. package/dist/types/store.d.ts +105 -0
  162. package/dist/types/store.d.ts.map +1 -0
  163. package/dist/types/utils/types.d.ts +8 -0
  164. package/dist/types/utils/types.d.ts.map +1 -0
  165. package/dist/utils/changes.d.ts +16 -0
  166. package/dist/utils/changes.d.ts.map +1 -0
  167. package/dist/utils/dom.d.ts +20 -0
  168. package/dist/utils/dom.d.ts.map +1 -0
  169. package/dist/utils/edges/bezier-edge.d.ts +59 -0
  170. package/dist/utils/edges/bezier-edge.d.ts.map +1 -0
  171. package/dist/utils/edges/general.d.ts +46 -0
  172. package/dist/utils/edges/general.d.ts.map +1 -0
  173. package/dist/utils/edges/index.d.ts +6 -0
  174. package/dist/utils/edges/index.d.ts.map +1 -0
  175. package/dist/utils/edges/positions.d.ts +12 -0
  176. package/dist/utils/edges/positions.d.ts.map +1 -0
  177. package/dist/utils/edges/smoothstep-edge.d.ts +43 -0
  178. package/dist/utils/edges/smoothstep-edge.d.ts.map +1 -0
  179. package/dist/utils/edges/straight-edge.d.ts +28 -0
  180. package/dist/utils/edges/straight-edge.d.ts.map +1 -0
  181. package/dist/utils/general.d.ts +61 -0
  182. package/dist/utils/general.d.ts.map +1 -0
  183. package/dist/utils/graph.d.ts +113 -0
  184. package/dist/utils/graph.d.ts.map +1 -0
  185. package/dist/utils/marker.d.ts +9 -0
  186. package/dist/utils/marker.d.ts.map +1 -0
  187. package/dist/utils/positions.d.ts +12 -0
  188. package/dist/utils/positions.d.ts.map +1 -0
  189. package/dist/utils/store.d.ts +30 -0
  190. package/dist/utils/store.d.ts.map +1 -0
  191. package/package.json +1 -1
@@ -0,0 +1,151 @@
1
+ import type { HTMLAttributes, MouseEvent as ReactMouseEvent, WheelEvent } from 'react';
2
+ import { DefaultEdgeOptions, Edge, FitViewOptions, Node, NodeTypes, OnEdgeUpdateFunc, OnEdgesChange, OnNodesChange, SelectionDragHandler } from '.';
3
+ import { KeyCode, NodeOrigin, Viewport, CoordinateExtent, PanOnScrollMode } from '@aloudata/ink-core';
4
+ export interface InkFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> extends Omit<HTMLAttributes<HTMLDivElement>, 'onError'> {
5
+ /** An array of nodes to render in a controlled flow.
6
+ * @example
7
+ * const nodes = [
8
+ * {
9
+ * id: 'node-1',
10
+ * type: 'input',
11
+ * data: { label: 'Node 1' },
12
+ * position: { x: 250, y: 50 }
13
+ * }
14
+ * ];
15
+ */
16
+ nodes?: NodeType[];
17
+ /** An array of edges to render in a controlled flow.
18
+ * @example
19
+ * const edges = [
20
+ * {
21
+ * id: 'edge-1-2',
22
+ * source: 'node-1',
23
+ * target: 'node-2',
24
+ * }
25
+ * ];
26
+ */
27
+ edges?: EdgeType[];
28
+ /** The initial nodes to render in an uncontrolled flow. */
29
+ defaultNodes?: NodeType[];
30
+ /** The initial edges to render in an uncontrolled flow. */
31
+ defaultEdges?: EdgeType[];
32
+ /** Defaults to be applied to all new edges that are added to the flow.
33
+ *
34
+ * Properties on a new edge will override these defaults if they exist.
35
+ * @example
36
+ * const defaultEdgeOptions = {
37
+ * type: 'customEdgeType',
38
+ * animated: true,
39
+ * interactionWidth: 10,
40
+ * data: { label: 'custom label' },
41
+ * hidden: false,
42
+ * deletable: true,
43
+ * selected: false,
44
+ * focusable: true,
45
+ * markerStart: EdgeMarker.ArrowClosed,
46
+ * markerEnd: EdgeMarker.ArrowClosed,
47
+ * zIndex: 12,
48
+ * ariaLabel: 'custom aria label'
49
+ * }
50
+ */
51
+ defaultEdgeOptions?: DefaultEdgeOptions;
52
+ onEdgeUpdate?: OnEdgeUpdateFunc<EdgeType>;
53
+ onNodesChange?: OnNodesChange<NodeType>;
54
+ onEdgesChange?: OnEdgesChange<EdgeType>;
55
+ /** This event handler gets called when a Node is deleted */
56
+ /** This event handler gets called when a Edge is deleted */
57
+ /** This event handler gets called when a Node or Edge is deleted */
58
+ /** This event handler gets called when a user starts to drag a selection box */
59
+ onSelectionDragStart?: SelectionDragHandler<NodeType>;
60
+ /** This event handler gets called when a user drags a selection box */
61
+ onSelectionDrag?: SelectionDragHandler<NodeType>;
62
+ /** This event handler gets called when a user stops dragging a selection box */
63
+ onSelectionDragStop?: SelectionDragHandler<NodeType>;
64
+ onSelectionStart?: (event: ReactMouseEvent) => void;
65
+ onSelectionEnd?: (event: ReactMouseEvent) => void;
66
+ onSelectionContextMenu?: (event: ReactMouseEvent, nodes: NodeType[]) => void;
67
+ /** This event handler gets called when user scroll inside the pane */
68
+ onPaneScroll?: (event?: WheelEvent) => void;
69
+ /** This event handler gets called when user clicks inside the pane */
70
+ onPaneClick?: (event: ReactMouseEvent) => void;
71
+ /** This event handler gets called when user right clicks inside the pane */
72
+ onPaneContextMenu?: (event: ReactMouseEvent | MouseEvent) => void;
73
+ /** This event handler gets called when mouse enters the pane */
74
+ onPaneMouseEnter?: (event: ReactMouseEvent) => void;
75
+ /** This event handler gets called when mouse moves over the pane */
76
+ onPaneMouseMove?: (event: ReactMouseEvent) => void;
77
+ /** This event handler gets called when mouse leaves the pane */
78
+ onPaneMouseLeave?: (event: ReactMouseEvent) => void;
79
+ nodeTypes?: NodeTypes;
80
+ deleteKeyCode?: KeyCode | null;
81
+ selectionKeyCode?: KeyCode | null;
82
+ selectionOnDrag?: boolean;
83
+ selectionMode?: SelectionMode;
84
+ panActivationKeyCode?: KeyCode | null;
85
+ multiSelectionKeyCode?: KeyCode | null;
86
+ zoomActivationKeyCode?: KeyCode | null;
87
+ /** Controls if all nodes should be draggable
88
+ * @default true
89
+ */
90
+ nodesDraggable?: boolean;
91
+ nodeOrigin?: NodeOrigin;
92
+ elementsSelectable?: boolean;
93
+ panOnDrag?: boolean | number[];
94
+ minZoom?: number;
95
+ maxZoom?: number;
96
+ viewport?: Viewport;
97
+ /** Sets the initial position and zoom of the viewport.
98
+ *
99
+ * If a default viewport is provided but fitView is enabled, the default viewport will be ignored.
100
+ * @example
101
+ * const initialViewport = {
102
+ * zoom: 0.5,
103
+ * position: { x: 0, y: 0 }
104
+ * };
105
+ */
106
+ defaultViewport?: Viewport;
107
+ onViewportChange?: (viewport: Viewport) => void;
108
+ translateExtent?: CoordinateExtent;
109
+ preventScrolling?: boolean;
110
+ /** By default nodes can be placed on an infinite flow. You can use this prop to set a boundary.
111
+ *
112
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
113
+ * @example [[-1000, -10000], [1000, 1000]]
114
+ */
115
+ nodeExtent?: CoordinateExtent;
116
+ zoomOnScroll?: boolean;
117
+ zoomOnPinch?: boolean;
118
+ panOnScroll?: boolean;
119
+ panOnScrollSpeed?: number;
120
+ panOnScrollMode?: PanOnScrollMode;
121
+ zoomOnDoubleClick?: boolean;
122
+ noDragClassName?: string;
123
+ noWheelClassName?: string;
124
+ noPanClassName?: string;
125
+ /** If set, initial viewport will show all nodes & edges */
126
+ fitView?: boolean;
127
+ /** Options to be used in combination with fitView
128
+ * @example
129
+ * const fitViewOptions = {
130
+ * padding: 0.1,
131
+ * includeHiddenNodes: false,
132
+ * minZoom: 0.1,
133
+ * maxZoom: 1,
134
+ * duration: 200,
135
+ * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit
136
+ * };
137
+ */
138
+ fitViewOptions?: FitViewOptions;
139
+ /**The connectOnClick option lets you click or tap on a source handle to start a connection
140
+ * and then click on a target handle to complete the connection.
141
+ *
142
+ * If you set this option to false, users will need to drag the connection line to the target
143
+ * handle to create a connection.
144
+ */
145
+ disableKeyboardA11y?: boolean;
146
+ /** Sets a fixed width for the flow */
147
+ width?: number;
148
+ /** Sets a fixed height for the flow */
149
+ height?: number;
150
+ }
151
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/types/props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EACd,UAAU,IAAI,eAAe,EAC7B,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,oBAAoB,EACrB,MAAM,GAAG,CAAC;AACX,OAAO,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EAChB,MAAM,oBAAo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,KAAK,IAAI,CAAC;IAMhD,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAInC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAM9B,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,WAAW,CAAC,EAAE,OAAO,CAAC;IAKtB,WAAW,CAAC,EAAE,OAAO,CAAC;IAKtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAO1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;OAKG;IA0BH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAgC9B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CAWjB"}
@@ -0,0 +1,105 @@
1
+ import { Transform, NodeLookup, EdgeLookup, ConnectionLookup, PanZoomInstance, CoordinateExtent, NodeOrigin, SelectionRect, XYPosition, ConnectionStatus, ConnectionMode, SnapGrid, ConnectingHandle, OnSelectionDrag, OnMoveStart, OnMove, OnMoveEnd, OnConnect, OnConnectStart, OnConnectEnd, OnError, OnViewportChange, InternalNodeUpdate, UpdateNodePositions, UpdateConnection, NodeChange, EdgeChange, PanBy } from '@aloudata/ink-core';
2
+ import type { Edge, Node, OnNodesChange, OnEdgesChange, InternalNode, FitViewOptions, IsValidConnection, OnSelectionChangeFunc, UnselectNodesAndEdgesParams, DefaultEdgeOptions, OnDelete, OnEdgesDelete, OnNodesDelete, OnBeforeDelete } from '.';
3
+ export type InkFlowStore<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
4
+ rfId: string;
5
+ width: number;
6
+ height: number;
7
+ transform: Transform;
8
+ nodes: NodeType[];
9
+ nodeLookup: NodeLookup<InternalNode<NodeType>>;
10
+ parentLookup: Map<string, InternalNode<NodeType>[]>;
11
+ edges: Edge[];
12
+ edgeLookup: EdgeLookup<EdgeType>;
13
+ connectionLookup: ConnectionLookup;
14
+ onNodesChange: OnNodesChange<NodeType> | null;
15
+ onEdgesChange: OnEdgesChange<EdgeType> | null;
16
+ hasDefaultNodes: boolean;
17
+ hasDefaultEdges: boolean;
18
+ domNode: HTMLDivElement | null;
19
+ paneDragging: boolean;
20
+ noPanClassName: string;
21
+ panZoom: PanZoomInstance | null;
22
+ minZoom: number;
23
+ maxZoom: number;
24
+ translateExtent: CoordinateExtent;
25
+ nodeExtent: CoordinateExtent;
26
+ nodeOrigin: NodeOrigin;
27
+ nodeDragThreshold: number;
28
+ nodesSelectionActive: boolean;
29
+ userSelectionActive: boolean;
30
+ userSelectionRect: SelectionRect | null;
31
+ connectionPosition: XYPosition;
32
+ connectionStatus: ConnectionStatus | null;
33
+ connectionMode: ConnectionMode;
34
+ snapToGrid: boolean;
35
+ snapGrid: SnapGrid;
36
+ nodesDraggable: boolean;
37
+ nodesConnectable: boolean;
38
+ nodesFocusable: boolean;
39
+ edgesFocusable: boolean;
40
+ edgesUpdatable: boolean;
41
+ elementsSelectable: boolean;
42
+ elevateNodesOnSelect: boolean;
43
+ elevateEdgesOnSelect: boolean;
44
+ selectNodesOnDrag: boolean;
45
+ multiSelectionActive: boolean;
46
+ connectionStartHandle: ConnectingHandle | null;
47
+ connectionEndHandle: ConnectingHandle | null;
48
+ connectionClickStartHandle: ConnectingHandle | null;
49
+ onSelectionDragStart?: OnSelectionDrag;
50
+ onSelectionDrag?: OnSelectionDrag;
51
+ onSelectionDragStop?: OnSelectionDrag;
52
+ onMoveStart?: OnMoveStart;
53
+ onMove?: OnMove;
54
+ onMoveEnd?: OnMoveEnd;
55
+ onConnect?: OnConnect;
56
+ onConnectStart?: OnConnectStart;
57
+ onConnectEnd?: OnConnectEnd;
58
+ onClickConnectStart?: OnConnectStart;
59
+ onClickConnectEnd?: OnConnectEnd;
60
+ connectOnClick: boolean;
61
+ defaultEdgeOptions?: DefaultEdgeOptions;
62
+ fitViewOnInit: boolean;
63
+ fitViewDone: boolean;
64
+ fitViewOnInitOptions: FitViewOptions | undefined;
65
+ onNodesDelete?: OnNodesDelete<NodeType>;
66
+ onEdgesDelete?: OnEdgesDelete<EdgeType>;
67
+ onDelete?: OnDelete;
68
+ onError?: OnError;
69
+ onViewportChangeStart?: OnViewportChange;
70
+ onViewportChange?: OnViewportChange;
71
+ onViewportChangeEnd?: OnViewportChange;
72
+ onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
73
+ onSelectionChangeHandlers: OnSelectionChangeFunc[];
74
+ ariaLiveMessage: string;
75
+ autoPanOnConnect: boolean;
76
+ autoPanOnNodeDrag: boolean;
77
+ connectionRadius: number;
78
+ isValidConnection?: IsValidConnection<EdgeType>;
79
+ lib: string;
80
+ debug: boolean;
81
+ };
82
+ export type InkFlowActions<NodeType extends Node, EdgeType extends Edge> = {
83
+ setNodes: (nodes: NodeType[]) => void;
84
+ setEdges: (edges: EdgeType[]) => void;
85
+ setDefaultNodesAndEdges: (nodes?: NodeType[], edges?: EdgeType[]) => void;
86
+ updateNodeInternals: (updates: Map<string, InternalNodeUpdate>) => void;
87
+ updateNodePositions: UpdateNodePositions;
88
+ resetSelectedElements: () => void;
89
+ unselectNodesAndEdges: (params?: UnselectNodesAndEdgesParams) => void;
90
+ addSelectedNodes: (nodeIds: string[]) => void;
91
+ addSelectedEdges: (edgeIds: string[]) => void;
92
+ setMinZoom: (minZoom: number) => void;
93
+ setMaxZoom: (maxZoom: number) => void;
94
+ setTranslateExtent: (translateExtent: CoordinateExtent) => void;
95
+ setNodeExtent: (nodeExtent: CoordinateExtent) => void;
96
+ cancelConnection: () => void;
97
+ updateConnection: UpdateConnection;
98
+ reset: () => void;
99
+ triggerNodeChanges: (changes: NodeChange<NodeType>[]) => void;
100
+ triggerEdgeChanges: (changes: EdgeChange<EdgeType>[]) => void;
101
+ panBy: PanBy;
102
+ fitView: (options?: FitViewOptions) => boolean;
103
+ };
104
+ export type InkFlowState<NodeType extends Node = Node, EdgeType extends Edge = Edge> = InkFlowStore<NodeType, EdgeType> & InkFlowActions<NodeType, EdgeType>;
105
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChb,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EAWb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,EACf,MAAM,GAAG,CAAC;AAEX,MAAM,MAAM,YAAY,CACtB,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC5B,QAAQ,SAAS,IAAI,GAAG,IAAI,IAC1B;IACF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS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CAAC;IACtC,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,YAAY,CACtB,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC5B,QAAQ,SAAS,IAAI,GAAG,IAAI,IAC1B,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Rect } from '@aloudata/ink-core';
2
+ export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
3
+ export type ParentExpandChild = {
4
+ id: string;
5
+ parentId: string;
6
+ rect: Rect;
7
+ };
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { EdgeChange, NodeChange, NodeSelectionChange, EdgeSelectionChange, NodeLookup, EdgeLookup, NodeRemoveChange, EdgeRemoveChange } from '@aloudata/ink-core';
2
+ import { Edge, InternalNode, Node } from '../types';
3
+ export declare function applyEdgeChanges<EdgeType extends Edge = Edge>(changes: EdgeChange<EdgeType>[], edges: EdgeType[]): EdgeType[];
4
+ export declare function applyNodeChanges<NodeType extends Node = Node>(changes: NodeChange<NodeType>[], nodes: NodeType[]): NodeType[];
5
+ export declare function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange;
6
+ export declare function getSelectionChanges(items: Map<string, any>, selectedIds?: Set<string>, mutateItem?: boolean): NodeSelectionChange[] | EdgeSelectionChange[];
7
+ export declare function getElementsDiffChanges({ items, lookup, }: {
8
+ items: Node[] | undefined;
9
+ lookup: NodeLookup<InternalNode<Node>>;
10
+ }): NodeChange[];
11
+ export declare function getElementsDiffChanges({ items, lookup, }: {
12
+ items: Edge[] | undefined;
13
+ lookup: EdgeLookup;
14
+ }): EdgeChange[];
15
+ export declare function elementToRemoveChange<T extends Node | Edge>(item: T): NodeRemoveChange | EdgeRemoveChange;
16
+ //# sourceMappingURL=changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/utils/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAwGpD,wBAAg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 transform: Transform;
4
+ snapGrid?: SnapGrid;
5
+ snapToGrid?: boolean;
6
+ };
7
+ export declare function getPointerPosition(event: MouseEvent | TouchEvent, { snapGrid, snapToGrid, transform, }: GetPointerPositionParams): XYPosition & {
8
+ xSnapped: number;
9
+ ySnapped: number;
10
+ };
11
+ export declare const getDimensions: (node: HTMLDivElement) => Dimensions;
12
+ export declare const getHostForElement: (element: HTMLElement) => Document | ShadowRoot;
13
+ export declare function isInputDOMNode(event: KeyboardEvent): boolean;
14
+ export declare const isMouseEvent: (event: MouseEvent | TouchEvent) => event is MouseEvent;
15
+ export declare const getEventPosition: (event: MouseEvent | TouchEvent, bounds?: DOMRect) => {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ export declare const getHandleBounds: (selector: string, nodeElement: HTMLDivElement, zoom: number, nodeOrigin?: NodeOrigin) => HandleElement[] | null;
20
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,EACE,QAAiB,EACjB,UAAkB,EAClB,SAAS,GACV,EAAE,wBAAwB,GAC1B,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAarD;AAED,eAAO,MAAM,aAAa,SAAU,cAAc,KAAG,UAGnD,CAAC;AAEH,eAAO,MAAM,iBAAiB,YACnB,WAAW,KACnB,QAAQ,GAAG,UAC0D,CAAC;AAIzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAS5D;AAED,eAAO,MAAM,YAAY,UAChB,UAAU,GAAG,UAAU,wBACY,CAAC;AAE7C,eAAO,MAAM,gBAAgB,UACpB,UAAU,GAAG,UAAU,WACrB,OAAO;;;CAUjB,CAAC;AAKF,eAAO,MAAM,eAAe,aAChB,MAAM,eACH,cAAc,QACrB,MAAM,8BAEX,aAAa,EAAE,GAAG,IA2BpB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { Position } from '@aloudata/ink-core';
2
+ export type GetBezierPathParams = {
3
+ sourceX: number;
4
+ sourceY: number;
5
+ sourcePosition?: Position;
6
+ targetX: number;
7
+ targetY: number;
8
+ targetPosition?: Position;
9
+ curvature?: number;
10
+ };
11
+ export type GetControlWithCurvatureParams = {
12
+ pos: Position;
13
+ x1: number;
14
+ y1: number;
15
+ x2: number;
16
+ y2: number;
17
+ c: number;
18
+ };
19
+ export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: {
20
+ sourceX: number;
21
+ sourceY: number;
22
+ targetX: number;
23
+ targetY: number;
24
+ sourceControlX: number;
25
+ sourceControlY: number;
26
+ targetControlX: number;
27
+ targetControlY: number;
28
+ }): [number, number, number, number];
29
+ /**
30
+ * Get a bezier path from source to target handle
31
+ * @param params.sourceX - The x position of the source handle
32
+ * @param params.sourceY - The y position of the source handle
33
+ * @param params.sourcePosition - The position of the source handle (default: Position.Bottom)
34
+ * @param params.targetX - The x position of the target handle
35
+ * @param params.targetY - The y position of the target handle
36
+ * @param params.targetPosition - The position of the target handle (default: Position.Top)
37
+ * @param params.curvature - The curvature of the bezier edge
38
+ * @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
39
+ * @example
40
+ * const source = { x: 0, y: 20 };
41
+ const target = { x: 150, y: 100 };
42
+
43
+ const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({
44
+ sourceX: source.x,
45
+ sourceY: source.y,
46
+ sourcePosition: Position.Right,
47
+ targetX: target.x,
48
+ targetY: target.y,
49
+ targetPosition: Position.Left,
50
+ });
51
+ */
52
+ export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [
53
+ path: string,
54
+ labelX: number,
55
+ labelY: number,
56
+ offsetX: number,
57
+ offsetY: number
58
+ ];
59
+ //# sourceMappingURL=bezier-edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bezier-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/bezier-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,GACf,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAiBnC;AA8BD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,SAAgB,GACjB,EAAE,mBAAmB,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;CAChB,CAmCA"}
@@ -0,0 +1,46 @@
1
+ import { InternalNodeBase, Transform, Connection, EdgeBase } from '@aloudata/ink-core';
2
+ export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: {
3
+ sourceX: number;
4
+ sourceY: number;
5
+ targetX: number;
6
+ targetY: number;
7
+ }): [number, number, number, number];
8
+ export type GetEdgeZIndexParams = {
9
+ sourceNode: InternalNodeBase;
10
+ targetNode: InternalNodeBase;
11
+ selected?: boolean;
12
+ zIndex?: number;
13
+ elevateOnSelect?: boolean;
14
+ };
15
+ export declare function getElevatedEdgeZIndex({ sourceNode, targetNode, selected, zIndex, elevateOnSelect, }: GetEdgeZIndexParams): number;
16
+ type IsEdgeVisibleParams = {
17
+ sourceNode: InternalNodeBase;
18
+ targetNode: InternalNodeBase;
19
+ width: number;
20
+ height: number;
21
+ transform: Transform;
22
+ };
23
+ export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform, }: IsEdgeVisibleParams): boolean;
24
+ /**
25
+ * This util is a convenience function to add a new Edge to an array of edges
26
+ * @remarks It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.
27
+ * @public
28
+ * @param edgeParams - Either an Edge or a Connection you want to add
29
+ * @param edges - The array of all current edges
30
+ * @returns A new array of edges with the new edge added
31
+ */
32
+ export declare const addEdge: <EdgeType extends EdgeBase>(edgeParams: EdgeType | Connection, edges: EdgeType[]) => EdgeType[];
33
+ export type UpdateEdgeOptions = {
34
+ shouldReplaceId?: boolean;
35
+ };
36
+ /**
37
+ * A handy utility to update an existing Edge with new properties
38
+ * @param oldEdge - The edge you want to update
39
+ * @param newConnection - The new connection you want to update the edge with
40
+ * @param edges - The array of all current edges
41
+ * @param options.shouldReplaceId - should the id of the old edge be replaced with the new connection id
42
+ * @returns the updated edges array
43
+ */
44
+ export declare const updateEdge: <EdgeType extends EdgeBase>(oldEdge: EdgeType, newConnection: Connection, edges: EdgeType[], options?: UpdateEdgeOptions) => EdgeType[];
45
+ export {};
46
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/general.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,QAAQ,EAET,MAAM,oBAAoB,CAAC;AAW5B,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQnC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,UAAU,EACV,QAAgB,EAChB,MAAU,EACV,eAAuB,GACxB,EAAE,mBAAmB,GAAG,MAAM,CAc9B;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,mBAAmB,GAAG,OAAO,CAsB/B;AAsBD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,0CACN,QAAQ,GAAG,UAAU,SAC1B,QAAQ,EAAE,KAChB,QAAQ,EA8BV,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,uCACZ,QAAQ,iBACF,UAAU,SAClB,QAAQ,EAAE,YACR,iBAAiB,KACzB,QAAQ,EA4BV,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './bezier-edge';
2
+ export * from './straight-edge';
3
+ export * from './smoothstep-edge';
4
+ export * from './general';
5
+ export * from './positions';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { InternalNodeBase, ConnectionMode, OnError, EdgePosition } from '@aloudata/ink-core';
2
+ export type GetEdgePositionParams = {
3
+ id: string;
4
+ sourceNode: InternalNodeBase;
5
+ sourceHandle: string | null;
6
+ targetNode: InternalNodeBase;
7
+ targetHandle: string | null;
8
+ connectionMode: ConnectionMode;
9
+ onError?: OnError;
10
+ };
11
+ export declare function getEdgePosition(params: GetEdgePositionParams): EdgePosition | null;
12
+ //# sourceMappingURL=positions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,YAAY,EAKb,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAUF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,qBAAqB,GAC5B,YAAY,GAAG,IAAI,CA4DrB"}
@@ -0,0 +1,43 @@
1
+ import { Position } from '@aloudata/ink-core';
2
+ export interface GetSmoothStepPathParams {
3
+ sourceX: number;
4
+ sourceY: number;
5
+ sourcePosition?: Position;
6
+ targetX: number;
7
+ targetY: number;
8
+ targetPosition?: Position;
9
+ borderRadius?: number;
10
+ centerX?: number;
11
+ centerY?: number;
12
+ offset?: number;
13
+ }
14
+ /**
15
+ * Get a smooth step path from source to target handle
16
+ * @param params.sourceX - The x position of the source handle
17
+ * @param params.sourceY - The y position of the source handle
18
+ * @param params.sourcePosition - The position of the source handle (default: Position.Bottom)
19
+ * @param params.targetX - The x position of the target handle
20
+ * @param params.targetY - The y position of the target handle
21
+ * @param params.targetPosition - The position of the target handle (default: Position.Top)
22
+ * @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
23
+ * @example
24
+ * const source = { x: 0, y: 20 };
25
+ const target = { x: 150, y: 100 };
26
+
27
+ const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({
28
+ sourceX: source.x,
29
+ sourceY: source.y,
30
+ sourcePosition: Position.Right,
31
+ targetX: target.x,
32
+ targetY: target.y,
33
+ targetPosition: Position.Left,
34
+ });
35
+ */
36
+ export declare function getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, borderRadius, centerX, centerY, offset, }: GetSmoothStepPathParams): [
37
+ path: string,
38
+ labelX: number,
39
+ labelY: number,
40
+ offsetX: number,
41
+ offsetY: number
42
+ ];
43
+ //# sourceMappingURL=smoothstep-edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoothstep-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/smoothstep-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,oBAAoB,CAAC;AAG1D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkOD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;CAChB,CAyBA"}
@@ -0,0 +1,28 @@
1
+ export type GetStraightPathParams = {
2
+ sourceX: number;
3
+ sourceY: number;
4
+ targetX: number;
5
+ targetY: number;
6
+ };
7
+ /**
8
+ * Get a straight path from source to target handle
9
+ * @param params.sourceX - The x position of the source handle
10
+ * @param params.sourceY - The y position of the source handle
11
+ * @param params.targetX - The x position of the target handle
12
+ * @param params.targetY - The y position of the target handle
13
+ * @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
14
+ * @example
15
+ * const source = { x: 0, y: 20 };
16
+ const target = { x: 150, y: 100 };
17
+
18
+ const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({
19
+ sourceX: source.x,
20
+ sourceY: source.y,
21
+ sourcePosition: Position.Right,
22
+ targetX: target.x,
23
+ targetY: target.y,
24
+ targetPosition: Position.Left,
25
+ });
26
+ */
27
+ export declare function getStraightPath({ sourceX, sourceY, targetX, targetY, }: GetStraightPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
28
+ //# sourceMappingURL=straight-edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"straight-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/straight-edge.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAS1G"}
@@ -0,0 +1,61 @@
1
+ import { Ref, RefAttributes } from 'react';
2
+ import { Node } from '../types';
3
+ import { XYPosition, CoordinateExtent, SnapGrid, Transform, InternalNodeBase, NodeBase, NodeOrigin, Rect, Box, Viewport, Dimensions, NodeLookup } from '@aloudata/ink-core';
4
+ export declare const clamp: (val: number, min?: number, max?: number) => number;
5
+ export declare const clampPosition: (position: XYPosition, extent: CoordinateExtent) => {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ export declare function getNodeDimensions(node: {
10
+ measured?: {
11
+ width?: number;
12
+ height?: number;
13
+ };
14
+ width?: number;
15
+ height?: number;
16
+ initialWidth?: number;
17
+ initialHeight?: number;
18
+ }): {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ export declare const isNumeric: (n: any) => n is number;
23
+ export declare const snapPosition: (position: XYPosition, snapGrid?: SnapGrid) => XYPosition;
24
+ export declare const pointToRendererPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform, snapToGrid?: boolean, snapGrid?: SnapGrid) => XYPosition;
25
+ export declare const nodeToRect: (node: InternalNodeBase | NodeBase, nodeOrigin?: NodeOrigin) => Rect;
26
+ export declare const getBoundsOfBoxes: (box1: Box, box2: Box) => Box;
27
+ export declare const rectToBox: ({ x, y, width, height }: Rect) => Box;
28
+ export declare const boxToRect: ({ x, y, x2, y2 }: Box) => Rect;
29
+ export declare const nodeToBox: (node: InternalNodeBase | NodeBase, nodeOrigin?: NodeOrigin) => Box;
30
+ export declare const getBoundsOfRects: (rect1: Rect, rect2: Rect) => Rect;
31
+ export declare function fixedForwardRef<T, P = {}>(render: (props: P, ref: Ref<T>) => JSX.Element): (props: P & RefAttributes<T>) => JSX.Element;
32
+ export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number;
33
+ export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: number) => Viewport;
34
+ export declare function isCoordinateExtent(extent?: CoordinateExtent | 'parent'): extent is CoordinateExtent;
35
+ export declare function nodeHasDimensions<NodeType extends NodeBase = NodeBase>(node: NodeType): boolean;
36
+ export declare const calcAutoPan: (pos: XYPosition, bounds: Dimensions) => number[];
37
+ export declare const getPositionWithOrigin: ({ x, y, width, height, origin, }: {
38
+ x: number;
39
+ y: number;
40
+ width: number;
41
+ height: number;
42
+ origin?: NodeOrigin;
43
+ }) => XYPosition;
44
+ export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition;
45
+ export declare const isMacOs: () => boolean;
46
+ export declare const isNode: <NodeType extends Node = Node>(element: unknown) => element is NodeType;
47
+ export declare const isNodeBase: <NodeType extends NodeBase = NodeBase>(element: any) => element is NodeType;
48
+ /**
49
+ * Convert child position to aboslute position
50
+ *
51
+ * @internal
52
+ * @param position
53
+ * @param parentId
54
+ * @param nodeLookup
55
+ * @param nodeOrigin
56
+ * @returns an internal node with an absolute position
57
+ */
58
+ export declare function evaluateAbsolutePosition(position: XYPosition, parentId: string, nodeLookup: NodeLookup, nodeOrigin?: NodeOrigin): XYPosition;
59
+ export declare const isRectObject: (obj: any) => obj is Rect;
60
+ export declare const devWarn: (id: string, message: string) => void;
61
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,aAAa,EAAc,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,UAAU,EACV,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MACnB,CAAC;AAE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