@dschz/solid-flow 0.2.2 → 0.3.0-next.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.
- package/dist/index/index.d.ts +1237 -1186
- package/dist/index/index.js +3982 -5120
- package/dist/index/index.jsx +2485 -4556
- package/dist/styles/index.css +20 -571
- package/package.json +20 -21
- package/dist/styles/index.d.ts +0 -2
package/dist/index/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { JSX
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { JSX } from "@solidjs/web";
|
|
2
|
+
import { Accessor, ParentComponent, ParentProps, Store, StoreSetter } from "solid-js";
|
|
3
|
+
import { Align, Align as Align$1, AriaLabelConfig, AriaLabelConfig as AriaLabelConfig$1, BezierPathOptions, BezierPathOptions as BezierPathOptions$1, Box, ColorMode, ColorMode as ColorMode$1, ColorModeClass, ColorModeClass as ColorModeClass$1, Connection, Connection as Connection$1, ConnectionLineType, ConnectionLineType as ConnectionLineType$1, ConnectionMode, ConnectionMode as ConnectionMode$1, ConnectionState, ControlLinePosition, ControlPosition, ControlPosition as ControlPosition$1, CoordinateExtent, CoordinateExtent as CoordinateExtent$1, DefaultEdgeOptionsBase, Dimensions, EdgeBase, EdgeMarker, EdgeMarkerType, EdgePosition, EdgeToolbarBaseProps, FinalConnectionState, FitBounds, FitBoundsOptions, FitBoundsOptions as FitBoundsOptions$1, FitViewOptionsBase, GetBezierPathParams, GetSmoothStepPathParams, GetStraightPathParams, Handle as Handle$1, HandleConnection, HandleConnection as HandleConnection$1, HandleProps, HandleType, InternalNodeBase, IsValidConnection, MarkerProps, MarkerType, NodeBase, NodeConnection, NodeConnection as NodeConnection$1, NodeOrigin, NodeOrigin as NodeOrigin$1, NodeProps as NodeProps$1, OnBeforeDeleteBase, OnConnect, OnConnectEnd, OnConnectEnd as OnConnectEnd$1, OnConnectStart, OnConnectStart as OnConnectStart$1, OnConnectStartParams, OnError, OnError as OnError$1, OnMove, OnMove as OnMove$1, OnMoveEnd, OnMoveEnd as OnMoveEnd$1, OnMoveStart, OnMoveStart as OnMoveStart$1, OnReconnect, OnReconnect as OnReconnect$1, OnReconnectEnd, OnReconnectEnd as OnReconnectEnd$1, OnReconnectStart, OnReconnectStart as OnReconnectStart$1, OnResize, OnResize as OnResize$1, OnResizeEnd, OnResizeEnd as OnResizeEnd$1, OnResizeStart, OnResizeStart as OnResizeStart$1, OnSelectionDrag, PanOnScrollMode, PanOnScrollMode as PanOnScrollMode$1, PanelPosition, PanelPosition as PanelPosition$1, Position as Position$1, Position as Position$2, ProOptions, ProOptions as ProOptions$1, Rect, Rect as Rect$1, ResizeControlVariant, ResizeControlVariant as ResizeControlVariant$1, ResizeDragEvent, ResizeParams, ResizeParamsWithDirection, SelectionMode, SelectionMode as SelectionMode$1, SelectionRect, SetCenter, SetCenterOptions, SetCenterOptions as SetCenterOptions$1, SetViewport, ShouldResize, ShouldResize as ShouldResize$1, SmoothStepPathOptions, SmoothStepPathOptions as SmoothStepPathOptions$1, SnapGrid, SnapGrid as SnapGrid$1, StepPathOptions, Transform, UpdateNodeInternals, Viewport, Viewport as Viewport$1, ViewportHelperFunctionOptions, ViewportHelperFunctionOptions as ViewportHelperFunctionOptions$1, XYPosition, XYPosition as XYPosition$1, XYZPosition, ZIndexMode, ZoomInOut, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from "@xyflow/system";
|
|
4
|
+
//#region src/types/node.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* The node data structure that gets used for internal nodes.
|
|
8
7
|
* There are some data structures added under node.internal
|
|
@@ -15,122 +14,122 @@ type InternalNode<NodeType extends Node = Node> = InternalNodeBase<NodeType>;
|
|
|
15
14
|
* @public
|
|
16
15
|
*/
|
|
17
16
|
type Node<NodeData extends UnknownStruct = UnknownStruct, NodeType extends string | undefined = string | undefined> = NodeBase<NodeData, NodeType> & {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
class?: string;
|
|
18
|
+
style?: JSX.CSSProperties;
|
|
19
|
+
focusable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The ARIA role attribute for the node element, used for accessibility.
|
|
22
|
+
* @default "group"
|
|
23
|
+
*/
|
|
24
|
+
ariaRole?: JSX.HTMLAttributes<HTMLDivElement>["role"];
|
|
25
|
+
/**
|
|
26
|
+
* General escape hatch for adding custom attributes to the node's DOM element.
|
|
27
|
+
*/
|
|
28
|
+
domAttributes?: Omit<JSX.HTMLAttributes<HTMLDivElement>, "id" | "style" | "class" | "draggable" | "role" | "aria-label" | keyof JSX.HTMLAttributes<HTMLDivElement>>;
|
|
30
29
|
};
|
|
31
30
|
type NodeProps<TData extends UnknownStruct = UnknownStruct, TType extends string | undefined = string | undefined> = NodeProps$1<Node<TData, TType>>;
|
|
32
31
|
/**
|
|
33
32
|
* Map of node types to their components.
|
|
34
33
|
*/
|
|
35
|
-
type NodeTypes = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}["bivarianceHack"];
|
|
39
|
-
};
|
|
34
|
+
type NodeTypes = { [K in string]: {
|
|
35
|
+
bivarianceHack(props: NodeProps<Record<string, unknown>, string | undefined>): JSX.Element;
|
|
36
|
+
}["bivarianceHack"]; };
|
|
40
37
|
type BuiltInNode = Node<{
|
|
41
|
-
|
|
38
|
+
label: string;
|
|
42
39
|
}, "input" | "output" | "default"> | Node<Record<string, never>, "group">;
|
|
43
40
|
type BuiltInNodeTypes = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
input: (props: NodeProps<{
|
|
42
|
+
label: string;
|
|
43
|
+
}, "input">) => JSX.Element;
|
|
44
|
+
output: (props: NodeProps<{
|
|
45
|
+
label: string;
|
|
46
|
+
}, "output">) => JSX.Element;
|
|
47
|
+
default: (props: NodeProps<{
|
|
48
|
+
label: string;
|
|
49
|
+
}, "default">) => JSX.Element;
|
|
50
|
+
group: (props: NodeProps<Record<string, never>, "group">) => JSX.Element;
|
|
54
51
|
};
|
|
55
|
-
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/types/custom.d.ts
|
|
56
54
|
type UnknownStruct = Record<string, unknown>;
|
|
57
|
-
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/types/edge.d.ts
|
|
58
57
|
/**
|
|
59
58
|
* An `Edge` is the complete description with everything Svelte Flow needs to know in order to
|
|
60
59
|
* render it.
|
|
61
60
|
* @public
|
|
62
61
|
*/
|
|
63
62
|
type Edge<EdgeData extends UnknownStruct = UnknownStruct, EdgeType extends string | undefined = string | undefined> = EdgeBase<EdgeData, EdgeType> & {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
label?: string;
|
|
64
|
+
labelStyle?: JSX.CSSProperties;
|
|
65
|
+
style?: JSX.CSSProperties;
|
|
66
|
+
class?: string;
|
|
67
|
+
focusable?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The ARIA role attribute for the edge, used for accessibility.
|
|
70
|
+
* @default "group"
|
|
71
|
+
*/
|
|
72
|
+
ariaRole?: JSX.HTMLAttributes<HTMLElement>["role"];
|
|
73
|
+
/**
|
|
74
|
+
* General escape hatch for adding custom attributes to the edge's DOM element.
|
|
75
|
+
*/
|
|
76
|
+
domAttributes?: Omit<JSX.SvgSVGAttributes<SVGGElement>, "id" | "style" | "class" | "role" | "aria-label">;
|
|
78
77
|
};
|
|
79
78
|
/**
|
|
80
79
|
* Props passed to edge components. This is the main interface that custom edge components should implement.
|
|
81
80
|
*/
|
|
82
81
|
type EdgeProps<EdgeData extends UnknownStruct = UnknownStruct, EdgeType extends string | undefined = string | undefined> = Omit<Edge<EdgeData, EdgeType>, "sourceHandle" | "targetHandle"> & EdgePosition & {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
markerStart?: string;
|
|
83
|
+
markerEnd?: string;
|
|
84
|
+
sourceHandleId?: string | null;
|
|
85
|
+
targetHandleId?: string | null;
|
|
87
86
|
};
|
|
88
87
|
/**
|
|
89
88
|
* Props for built-in edge components that render the actual SVG path.
|
|
90
89
|
*/
|
|
91
90
|
type BaseEdgeProps = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
91
|
+
/** SVG path of the edge */
|
|
92
|
+
path: string;
|
|
93
|
+
/** The x coordinate of the label */
|
|
94
|
+
labelX?: number;
|
|
95
|
+
/** The y coordinate of the label */
|
|
96
|
+
labelY?: number;
|
|
97
|
+
/** Marker at start of edge */
|
|
98
|
+
markerStart?: string;
|
|
99
|
+
/** Marker at end of edge */
|
|
100
|
+
markerEnd?: string;
|
|
101
|
+
/** CSS class for the edge */
|
|
102
|
+
class?: string;
|
|
103
|
+
/** Edge label */
|
|
104
|
+
label?: string;
|
|
105
|
+
/** Styles for the edge label */
|
|
106
|
+
labelStyle?: JSX.CSSProperties;
|
|
107
|
+
/** Styles for the edge path */
|
|
108
|
+
style?: JSX.CSSProperties;
|
|
109
|
+
/** Interaction width for edge selection */
|
|
110
|
+
interactionWidth?: number;
|
|
112
111
|
} & JSX.SvgSVGAttributes<SVGPathElement>;
|
|
113
112
|
/**
|
|
114
113
|
* Props for built-in edge components (these match the actual component implementations)
|
|
115
114
|
*/
|
|
116
115
|
type BezierEdgeProps = EdgeProps<Record<string, unknown>, "default"> & {
|
|
117
|
-
|
|
116
|
+
pathOptions?: BezierPathOptions$1;
|
|
118
117
|
};
|
|
119
118
|
type StraightEdgeProps = Omit<EdgeProps<Record<string, unknown>, "straight">, "sourcePosition" | "targetPosition">;
|
|
120
119
|
type StepEdgeProps = EdgeProps<Record<string, unknown>, "step"> & {
|
|
121
|
-
|
|
120
|
+
pathOptions?: StepPathOptions;
|
|
122
121
|
};
|
|
123
122
|
type SmoothStepEdgeProps = EdgeProps<Record<string, unknown>, "smoothstep"> & {
|
|
124
|
-
|
|
123
|
+
pathOptions?: SmoothStepPathOptions$1;
|
|
125
124
|
};
|
|
126
125
|
/**
|
|
127
126
|
* Built-in edge types with their component signatures
|
|
128
127
|
*/
|
|
129
128
|
type BuiltInEdgeTypes = {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
default: (props: BezierEdgeProps) => JSX.Element;
|
|
130
|
+
straight: (props: StraightEdgeProps) => JSX.Element;
|
|
131
|
+
step: (props: StepEdgeProps) => JSX.Element;
|
|
132
|
+
smoothstep: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
134
133
|
};
|
|
135
134
|
/**
|
|
136
135
|
* Union of all built-in edge props
|
|
@@ -139,132 +138,132 @@ type BuiltInEdge = BezierEdgeProps | StraightEdgeProps | StepEdgeProps | SmoothS
|
|
|
139
138
|
/**
|
|
140
139
|
* Map of edge types to their components.
|
|
141
140
|
*/
|
|
142
|
-
type EdgeTypes = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}["bivarianceHack"];
|
|
146
|
-
};
|
|
141
|
+
type EdgeTypes = { [K in string]: {
|
|
142
|
+
bivarianceHack(props: EdgeProps<Record<string, unknown>, string | undefined>): JSX.Element;
|
|
143
|
+
}["bivarianceHack"]; };
|
|
147
144
|
type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/types/events.d.ts
|
|
147
|
+
type NodeEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ node, event }: {
|
|
148
|
+
node: NodeType;
|
|
149
|
+
event: T;
|
|
152
150
|
}) => void;
|
|
153
|
-
type NodesEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ nodes, event
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
type NodesEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ nodes, event }: {
|
|
152
|
+
nodes: NodeType[];
|
|
153
|
+
event: T;
|
|
156
154
|
}) => void;
|
|
157
|
-
type NodeTargetEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ targetNode, nodes, event
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
type NodeTargetEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ targetNode, nodes, event }: {
|
|
156
|
+
targetNode: NodeType | null;
|
|
157
|
+
nodes: NodeType[];
|
|
158
|
+
event: T;
|
|
161
159
|
}) => void;
|
|
162
160
|
type NodeEvents<NodeType extends Node = Node> = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
161
|
+
/** This event handler is called when a user clicks on a node. */
|
|
162
|
+
onNodeClick?: NodeEventWithPointer<MouseEvent | TouchEvent, NodeType>;
|
|
163
|
+
/** This event handler is called when a user right-clicks on a node. */
|
|
164
|
+
onNodeContextMenu?: NodeEventWithPointer<MouseEvent, NodeType>;
|
|
165
|
+
/** This event handler is called when a user drags a node. */
|
|
166
|
+
onNodeDrag?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
|
|
167
|
+
/** This event handler is called when a user starts to drag a node. */
|
|
168
|
+
onNodeDragStart?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
|
|
169
|
+
/** This event handler is called when a user stops dragging a node. */
|
|
170
|
+
onNodeDragStop?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
|
|
171
|
+
/** This event handler is called when the pointer of a user enters a node. */
|
|
172
|
+
onNodePointerEnter?: NodeEventWithPointer<PointerEvent, NodeType>;
|
|
173
|
+
/** This event handler is called when the pointer of a user leaves a node. */
|
|
174
|
+
onNodePointerLeave?: NodeEventWithPointer<PointerEvent, NodeType>;
|
|
175
|
+
/** This event handler is called when the pointer of a user moves over a node. */
|
|
176
|
+
onNodePointerMove?: NodeEventWithPointer<PointerEvent, NodeType>;
|
|
179
177
|
};
|
|
180
178
|
type NodeSelectionEvents<NodeType extends Node = Node> = {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
179
|
+
/** This event handler is called when a user right-clicks the selection box. */
|
|
180
|
+
onSelectionContextMenu?: NodesEventWithPointer<PointerEvent, NodeType>;
|
|
181
|
+
/** This event handler is called when a user clicks the selection box. */
|
|
182
|
+
onSelectionClick?: NodesEventWithPointer<MouseEvent, NodeType>;
|
|
185
183
|
};
|
|
186
184
|
type PaneEvents = {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
/** This event handler is called when a user clicks the pane. */
|
|
186
|
+
onPaneClick?: ({ event }: {
|
|
187
|
+
event: MouseEvent;
|
|
188
|
+
}) => void;
|
|
189
|
+
/** This event handler is called when a user right-clicks the pane. */
|
|
190
|
+
onPaneContextMenu?: ({ event }: {
|
|
191
|
+
event: PointerEvent;
|
|
192
|
+
}) => void;
|
|
195
193
|
};
|
|
196
194
|
type EdgeEvents<EdgeType extends Edge = Edge> = {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
195
|
+
/** This event handler is called when a user clicks an edge. */
|
|
196
|
+
onEdgeClick?: ({ edge, event }: {
|
|
197
|
+
edge: EdgeType;
|
|
198
|
+
event: MouseEvent;
|
|
199
|
+
}) => void;
|
|
200
|
+
/** This event handler is called when a user right-clicks an edge. */
|
|
201
|
+
onEdgeContextMenu?: ({ edge, event }: {
|
|
202
|
+
edge: EdgeType;
|
|
203
|
+
event: PointerEvent;
|
|
204
|
+
}) => void;
|
|
205
|
+
/** This event handler is called when the pointer of a user enters an edge. */
|
|
206
|
+
onEdgePointerEnter?: ({ edge, event }: {
|
|
207
|
+
edge: EdgeType;
|
|
208
|
+
event: PointerEvent;
|
|
209
|
+
}) => void;
|
|
210
|
+
/** This event handler is called when the pointer of a user enters an edge. */
|
|
211
|
+
onEdgePointerLeave?: ({ edge, event }: {
|
|
212
|
+
edge: EdgeType;
|
|
213
|
+
event: PointerEvent;
|
|
214
|
+
}) => void;
|
|
217
215
|
};
|
|
218
216
|
type DeleteEvents<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
onNodesDelete?: (nodes: NodeType[]) => void;
|
|
218
|
+
onEdgesDelete?: (edges: EdgeType[]) => void;
|
|
221
219
|
};
|
|
222
220
|
type EdgeReconnectEvents<EdgeType extends Edge = Edge> = {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
221
|
+
/**
|
|
222
|
+
* This handler is called when the source or target of a reconnectable edge is dragged from the
|
|
223
|
+
* current node. It will fire even if the edge's source or target do not end up changing.
|
|
224
|
+
* You can use the `reconnectEdge` utility to convert the connection to a new edge.
|
|
225
|
+
*/
|
|
226
|
+
onReconnect?: OnReconnect$1<EdgeType>;
|
|
227
|
+
/**
|
|
228
|
+
* This event fires when the user begins dragging the source or target of an editable edge.
|
|
229
|
+
*/
|
|
230
|
+
onReconnectStart?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
|
|
231
|
+
/**
|
|
232
|
+
* This event fires when the user releases the source or target of an editable edge. It is called
|
|
233
|
+
* even if an edge update does not occur.
|
|
234
|
+
*/
|
|
235
|
+
onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void;
|
|
238
236
|
};
|
|
239
|
-
type OnSelectionDrag<NodeType extends Node = Node> = (event: MouseEvent, nodes: NodeType[]) => void;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
type
|
|
243
|
-
type
|
|
244
|
-
type
|
|
245
|
-
type
|
|
246
|
-
type
|
|
237
|
+
type OnSelectionDrag$1<NodeType extends Node = Node> = (event: MouseEvent, nodes: NodeType[]) => void;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/types/general.d.ts
|
|
240
|
+
type Position$3 = `${Position$2}`;
|
|
241
|
+
type ConnectionMode$2 = `${ConnectionMode$1}`;
|
|
242
|
+
type ConnectionLineType$3 = `${ConnectionLineType$1}`;
|
|
243
|
+
type SelectionMode$2 = `${SelectionMode$1}`;
|
|
244
|
+
type PanOnScrollMode$2 = `${PanOnScrollMode$1}`;
|
|
245
|
+
type ResizeControlVariant$2 = `${ResizeControlVariant$1}`;
|
|
247
246
|
type ShortcutModifier = "alt" | "ctrl" | "meta" | "shift";
|
|
248
247
|
type ShortcutModifierDefinition = null | false | ShortcutModifier | (ShortcutModifier | ShortcutModifier[])[];
|
|
249
248
|
type KeyModifier = ShortcutModifierDefinition;
|
|
250
249
|
type KeyDefinitionObject = {
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
key: string;
|
|
251
|
+
modifier?: KeyModifier;
|
|
253
252
|
};
|
|
254
253
|
type KeyDefinition = string | KeyDefinitionObject;
|
|
255
254
|
type ConnectionData = {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
connectionPosition: XYPosition$1 | null;
|
|
256
|
+
connectionStartHandle: Handle$1 | null;
|
|
257
|
+
connectionEndHandle: Handle$1 | null;
|
|
258
|
+
connectionStatus: string | null;
|
|
260
259
|
};
|
|
261
260
|
type FitViewOptions<NodeType extends Node = Node> = FitViewOptionsBase<NodeType>;
|
|
262
261
|
type OnDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
nodes: NodeType[];
|
|
263
|
+
edges: EdgeType[];
|
|
265
264
|
}) => void;
|
|
266
|
-
type EdgeConnection = Connection & {
|
|
267
|
-
|
|
265
|
+
type EdgeConnection = Connection$1 & {
|
|
266
|
+
id: string;
|
|
268
267
|
};
|
|
269
268
|
/** Callback that gets called before a handle connection is created. */
|
|
270
269
|
type OnBeforeEdgeConnect<EdgeType extends Edge = Edge> = (connection: EdgeConnection) => EdgeType | EdgeConnection | undefined;
|
|
@@ -272,71 +271,78 @@ type OnBeforeEdgeConnect<EdgeType extends Edge = Edge> = (connection: EdgeConnec
|
|
|
272
271
|
type OnEdgeConnect = (connection: EdgeConnection) => void;
|
|
273
272
|
type OnBeforeReconnect<EdgeType extends Edge = Edge> = (newEdge: EdgeType, oldEdge: EdgeType) => EdgeType | undefined;
|
|
274
273
|
type OnBeforeDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = OnBeforeDeleteBase<NodeType, EdgeType>;
|
|
275
|
-
type IsValidConnection<EdgeType extends Edge = Edge> = (edge: EdgeType | Connection) => boolean;
|
|
274
|
+
type IsValidConnection$1<EdgeType extends Edge = Edge> = (edge: EdgeType | Connection$1) => boolean;
|
|
276
275
|
type OnSelectionChange<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
nodes: NodeType[];
|
|
277
|
+
edges: EdgeType[];
|
|
279
278
|
}) => void;
|
|
280
279
|
type NodeGraph<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
readonly nodes: NodeType[];
|
|
281
|
+
readonly edges: EdgeType[];
|
|
283
282
|
};
|
|
284
|
-
type OnEdgeCreate<EdgeType extends Edge = Edge> = (connection: Connection) => EdgeType | Connection;
|
|
285
|
-
|
|
283
|
+
type OnEdgeCreate<EdgeType extends Edge = Edge> = (connection: Connection$1) => EdgeType | Connection$1;
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/components/container/EdgeRenderer.d.ts
|
|
286
286
|
type EdgeRendererProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
readonly defaultEdgeOptions?: DefaultEdgeOptions;
|
|
288
|
+
readonly reconnectRadius: number;
|
|
289
289
|
};
|
|
290
290
|
declare const EdgeRenderer: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeRendererProps<EdgeType>) => JSX.Element;
|
|
291
|
-
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/components/container/NodeRenderer.d.ts
|
|
292
293
|
type NodeRendererProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
|
|
293
|
-
|
|
294
|
+
readonly nodeClickDistance: number;
|
|
294
295
|
};
|
|
295
296
|
declare const NodeRenderer: <NodeType extends Node = Node>(props: NodeRendererProps<NodeType>) => JSX.Element;
|
|
296
|
-
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/components/container/Pane.d.ts
|
|
297
299
|
type PaneProps = PaneEvents & {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
readonly panOnDrag?: boolean | number[];
|
|
301
|
+
readonly selectionOnDrag?: boolean;
|
|
302
|
+
readonly paneClickDistance?: number;
|
|
303
|
+
readonly autoPanOnSelection?: boolean;
|
|
304
|
+
readonly onSelectionStart?: (event: PointerEvent) => void;
|
|
305
|
+
readonly onSelectionEnd?: (event: PointerEvent) => void;
|
|
304
306
|
};
|
|
305
307
|
declare const Pane: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<PaneProps>) => JSX.Element;
|
|
306
|
-
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/components/container/Panel.d.ts
|
|
307
310
|
type PanelProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
311
|
+
/** Set position of the panel
|
|
312
|
+
* @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
|
|
313
|
+
*/
|
|
314
|
+
readonly position?: PanelPosition$1;
|
|
315
|
+
readonly style?: JSX.CSSProperties;
|
|
316
|
+
readonly "data-testid"?: string;
|
|
317
|
+
readonly "data-message"?: string;
|
|
315
318
|
};
|
|
316
319
|
declare const Panel: (props: ParentProps<PanelProps>) => JSX.Element;
|
|
317
|
-
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/components/container/ViewportPortal.d.ts
|
|
318
322
|
declare const ViewportPortal: (props: ParentProps) => JSX.Element;
|
|
319
|
-
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/components/container/Zoom.d.ts
|
|
320
325
|
type ZoomProps = {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
326
|
+
readonly initialViewport?: Viewport$1;
|
|
327
|
+
readonly panOnScrollMode: PanOnScrollMode$2;
|
|
328
|
+
readonly onMove?: OnMove$1;
|
|
329
|
+
readonly onMoveStart?: OnMoveStart$1;
|
|
330
|
+
readonly onMoveEnd?: OnMoveEnd$1;
|
|
331
|
+
readonly onViewportInitialized?: () => void;
|
|
332
|
+
readonly preventScrolling: boolean;
|
|
333
|
+
readonly zoomOnScroll: boolean;
|
|
334
|
+
readonly zoomOnDoubleClick: boolean;
|
|
335
|
+
readonly zoomOnPinch: boolean;
|
|
336
|
+
readonly panOnScroll: boolean;
|
|
337
|
+
readonly panOnScrollSpeed: number;
|
|
338
|
+
readonly panOnDrag: boolean | number[];
|
|
339
|
+
readonly paneClickDistance: number;
|
|
340
|
+
readonly selectionOnDrag?: boolean;
|
|
336
341
|
};
|
|
337
342
|
declare const Zoom: (props: ParentProps<ZoomProps>) => JSX.Element;
|
|
338
|
-
|
|
339
|
-
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/components/graph/connection/types.d.ts
|
|
345
|
+
type ConnectionLineType$2 = `${ConnectionLineType$1}`;
|
|
340
346
|
/**
|
|
341
347
|
* If you want to render a custom component for connection lines, you can set the
|
|
342
348
|
* `connectionLineComponent` prop on the [`<SolidFlow />`](/api-reference/react-flow#connection-connectionLineComponent)
|
|
@@ -345,180 +351,207 @@ type ConnectionLineType = `${ConnectionLineType$2}`;
|
|
|
345
351
|
* @public
|
|
346
352
|
*/
|
|
347
353
|
type ConnectionLineComponentProps<NodeType extends Node = Node> = {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
354
|
+
readonly connectionLineStyle?: JSX.CSSProperties;
|
|
355
|
+
readonly connectionLineType: ConnectionLineType$2;
|
|
356
|
+
readonly fromNode: InternalNode<NodeType>;
|
|
357
|
+
readonly fromHandle: Handle$1;
|
|
358
|
+
readonly fromX: number;
|
|
359
|
+
readonly fromY: number;
|
|
360
|
+
readonly toX: number;
|
|
361
|
+
readonly toY: number;
|
|
362
|
+
readonly fromPosition: Position$3;
|
|
363
|
+
readonly toPosition: Position$3;
|
|
364
|
+
readonly connectionStatus: "valid" | "invalid" | null;
|
|
365
|
+
readonly toNode: InternalNode<NodeType> | null;
|
|
366
|
+
readonly toHandle: Handle$1 | null;
|
|
361
367
|
};
|
|
362
|
-
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/components/graph/connection/ConnectionLine.d.ts
|
|
363
370
|
type ConnectionLineProps<NodeType extends Node = Node> = {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
371
|
+
readonly style: JSX.CSSProperties;
|
|
372
|
+
readonly type: ConnectionLineType$2;
|
|
373
|
+
readonly component: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
|
|
374
|
+
readonly containerStyle: string | JSX.CSSProperties;
|
|
368
375
|
};
|
|
369
376
|
declare const ConnectionLine: <NodeType extends Node = Node>(props: ParentProps<Partial<ConnectionLineProps<NodeType>>>) => JSX.Element;
|
|
370
|
-
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/components/graph/edge/BaseEdge.d.ts
|
|
371
379
|
declare const BaseEdge: (props: ParentProps<BaseEdgeProps>) => JSX.Element;
|
|
372
|
-
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/components/graph/edge/BezierEdge.d.ts
|
|
373
382
|
declare const BezierEdge: (props: BezierEdgeProps) => JSX.Element;
|
|
374
|
-
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/components/graph/edge/BezierEdgeInternal.d.ts
|
|
375
385
|
declare const BezierEdgeInternal: (props: BezierEdgeProps) => JSX.Element;
|
|
376
|
-
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/components/graph/edge/EdgeLabel.d.ts
|
|
377
388
|
type EdgeLabelProps = {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
389
|
+
readonly x?: number;
|
|
390
|
+
readonly y?: number;
|
|
391
|
+
readonly width?: number;
|
|
392
|
+
readonly height?: number;
|
|
393
|
+
readonly selectEdgeOnClick?: boolean;
|
|
394
|
+
readonly transparent?: boolean;
|
|
395
|
+
readonly style?: JSX.CSSProperties;
|
|
385
396
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
386
397
|
declare const EdgeLabel: (props: ParentProps<EdgeLabelProps>) => JSX.Element;
|
|
387
|
-
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/components/graph/edge/EdgeLabelRenderer.d.ts
|
|
388
400
|
declare const EdgeLabelRenderer: (props: ParentProps) => JSX.Element;
|
|
389
|
-
|
|
401
|
+
//#endregion
|
|
402
|
+
//#region src/components/graph/edge/EdgeReconnectAnchor.d.ts
|
|
390
403
|
type EdgeReconnectAnchorProps = {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
404
|
+
readonly type: HandleType;
|
|
405
|
+
readonly class?: string;
|
|
406
|
+
readonly style?: JSX.CSSProperties;
|
|
407
|
+
readonly position?: XYPosition$1;
|
|
408
|
+
readonly size?: number;
|
|
409
|
+
readonly reconnecting?: boolean;
|
|
397
410
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
398
411
|
declare const EdgeReconnectAnchor: (props: ParentProps<EdgeReconnectAnchorProps>) => JSX.Element;
|
|
399
|
-
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/components/graph/edge/EdgeWrapper.d.ts
|
|
400
414
|
type EdgeWrapperProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
|
|
401
|
-
|
|
415
|
+
readonly edgeId: string;
|
|
402
416
|
};
|
|
403
417
|
declare const EdgeWrapper: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeWrapperProps<EdgeType>) => JSX.Element;
|
|
404
|
-
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/components/graph/edge/SmoothStepEdge.d.ts
|
|
405
420
|
declare const SmoothStepEdge: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
406
|
-
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/components/graph/edge/SmoothStepEdgeInternal.d.ts
|
|
407
423
|
declare const SmoothStepEdgeInternal: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
408
|
-
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/components/graph/edge/StepEdge.d.ts
|
|
409
426
|
declare const StepEdge: (props: StepEdgeProps) => JSX.Element;
|
|
410
|
-
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/components/graph/edge/StepEdgeInternal.d.ts
|
|
411
429
|
declare const StepEdgeInternal: (props: StepEdgeProps) => JSX.Element;
|
|
412
|
-
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/components/graph/edge/StraightEdge.d.ts
|
|
413
432
|
declare const StraightEdge: (props: StraightEdgeProps) => JSX.Element;
|
|
414
|
-
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/components/graph/edge/StraightEdgeInternal.d.ts
|
|
415
435
|
declare const StraightEdgeInternal: (props: Omit<StraightEdgeProps, "sourcePosition" | "targetPosition">) => JSX.Element;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/components/graph/handle/Handle.d.ts
|
|
438
|
+
type HandleProps$1 = Omit<HandleProps, "position"> & {
|
|
439
|
+
readonly position: Position$3;
|
|
440
|
+
readonly class?: string;
|
|
441
|
+
readonly style?: JSX.CSSProperties;
|
|
442
|
+
readonly onConnect?: (connections: Connection$1[]) => void;
|
|
443
|
+
readonly onDisconnect?: (connections: Connection$1[]) => void;
|
|
423
444
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
424
|
-
declare const Handle: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<HandleProps>) => JSX.Element;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
445
|
+
declare const Handle: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<HandleProps$1>) => JSX.Element;
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/components/graph/marker/Marker.d.ts
|
|
448
|
+
type MarkerProps$1 = MarkerProps & {
|
|
449
|
+
readonly markerUnits?: "strokeWidth" | "userSpaceOnUse";
|
|
450
|
+
readonly strokeWidth?: number;
|
|
429
451
|
};
|
|
430
|
-
declare const Marker: (props: MarkerProps) => JSX.Element;
|
|
431
|
-
|
|
452
|
+
declare const Marker: (props: MarkerProps$1) => JSX.Element;
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/components/graph/marker/MarkerDefinition.d.ts
|
|
432
455
|
declare const MarkerDefinition: () => JSX.Element;
|
|
433
|
-
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/components/graph/node/DefaultNode.d.ts
|
|
434
458
|
declare const DefaultNode: (props: NodeProps<{
|
|
435
|
-
|
|
459
|
+
label: string;
|
|
436
460
|
}, "default">) => JSX.Element;
|
|
437
|
-
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/components/graph/node/GroupNode.d.ts
|
|
438
463
|
declare const GroupNode: (props: NodeProps<Record<string, never>>) => JSX.Element;
|
|
439
|
-
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/components/graph/node/InputNode.d.ts
|
|
440
466
|
declare const InputNode: (props: NodeProps<{
|
|
441
|
-
|
|
467
|
+
label: string;
|
|
442
468
|
}>) => JSX.Element;
|
|
443
|
-
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/components/graph/node/NodeWrapper.d.ts
|
|
444
471
|
type NodeWrapperProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
472
|
+
readonly nodeId: string;
|
|
473
|
+
readonly resizeObserver: ResizeObserver | undefined;
|
|
474
|
+
readonly nodeClickDistance: number;
|
|
448
475
|
};
|
|
449
476
|
declare const NodeWrapper: <NodeType extends Node = Node>(props: NodeWrapperProps<NodeType>) => JSX.Element;
|
|
450
|
-
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/components/graph/node/OutputNode.d.ts
|
|
451
479
|
declare const OutputNode: (props: NodeProps<{
|
|
452
|
-
|
|
480
|
+
label: string;
|
|
453
481
|
}>) => JSX.Element;
|
|
454
|
-
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/components/graph/plugins/background/types.d.ts
|
|
455
484
|
type BackgroundVariant = "lines" | "dots" | "cross";
|
|
456
|
-
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/components/graph/plugins/background/Background.d.ts
|
|
457
487
|
type BackgroundProps = {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
488
|
+
readonly id?: string;
|
|
489
|
+
/** Variant of the pattern
|
|
490
|
+
* @example 'lines', 'dots', 'cross'
|
|
491
|
+
*/
|
|
492
|
+
readonly variant?: BackgroundVariant;
|
|
493
|
+
/** Color of the background */
|
|
494
|
+
readonly bgColor?: string;
|
|
495
|
+
/** Color of the pattern */
|
|
496
|
+
readonly patternColor?: string;
|
|
497
|
+
/** Class applied to the pattern */
|
|
498
|
+
readonly patternClass?: string;
|
|
499
|
+
/** Class applied to the container */
|
|
500
|
+
readonly class?: string;
|
|
501
|
+
/** Gap between repetitions of the pattern */
|
|
502
|
+
readonly gap?: number | [number, number];
|
|
503
|
+
/** Size of a single pattern element */
|
|
504
|
+
readonly size?: number;
|
|
505
|
+
/** Line width of the Line pattern */
|
|
506
|
+
readonly lineWidth?: number;
|
|
507
|
+
/** Style applied to the container */
|
|
508
|
+
readonly style?: JSX.CSSProperties;
|
|
479
509
|
};
|
|
480
510
|
declare const Background: (props: BackgroundProps) => JSX.Element;
|
|
481
|
-
|
|
511
|
+
//#endregion
|
|
512
|
+
//#region src/components/graph/plugins/controls/ControlButton.d.ts
|
|
482
513
|
type ControlButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
514
|
+
readonly class?: string;
|
|
515
|
+
readonly bgColor?: string;
|
|
516
|
+
readonly bgColorHover?: string;
|
|
517
|
+
readonly color?: string;
|
|
518
|
+
readonly colorHover?: string;
|
|
519
|
+
readonly borderColor?: string;
|
|
520
|
+
readonly onClick?: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
|
|
490
521
|
};
|
|
491
522
|
declare const ControlButton: (props: ParentProps<ControlButtonProps>) => JSX.Element;
|
|
492
|
-
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/components/graph/plugins/controls/Controls.d.ts
|
|
493
525
|
type ControlsOrientation = "horizontal" | "vertical";
|
|
494
526
|
type ControlsProps = {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
527
|
+
/** Position of the controls on the pane
|
|
528
|
+
* @example PanelPosition.TopLeft, PanelPosition.TopRight,
|
|
529
|
+
* PanelPosition.BottomLeft, PanelPosition.BottomRight
|
|
530
|
+
*/
|
|
531
|
+
readonly position?: PanelPosition$1;
|
|
532
|
+
/** Show button for zoom in/out */
|
|
533
|
+
readonly showZoom?: boolean;
|
|
534
|
+
/** Show button for fit view */
|
|
535
|
+
readonly showFitView?: boolean;
|
|
536
|
+
/** Show button for toggling interactivity */
|
|
537
|
+
readonly showLock?: boolean;
|
|
538
|
+
readonly buttonBgColor?: string;
|
|
539
|
+
readonly buttonBgColorHover?: string;
|
|
540
|
+
readonly buttonColor?: string;
|
|
541
|
+
readonly buttonColorHover?: string;
|
|
542
|
+
readonly buttonBorderColor?: string;
|
|
543
|
+
readonly style?: JSX.CSSProperties;
|
|
544
|
+
readonly orientation?: ControlsOrientation;
|
|
545
|
+
readonly fitViewOptions?: FitViewOptions;
|
|
546
|
+
readonly beforeControls?: JSX.Element;
|
|
547
|
+
readonly afterControls?: JSX.Element;
|
|
516
548
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
517
549
|
declare const Controls: (props: ParentProps<ControlsProps>) => JSX.Element;
|
|
518
|
-
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region src/components/graph/plugins/EdgeToolbar.d.ts
|
|
519
552
|
type EdgeToolbarProps = EdgeToolbarBaseProps & {
|
|
520
|
-
|
|
521
|
-
|
|
553
|
+
/** If `true`, clicking the toolbar selects the edge it belongs to. */
|
|
554
|
+
readonly selectEdgeOnClick?: boolean;
|
|
522
555
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
523
556
|
/**
|
|
524
557
|
* The `<EdgeToolbar />` component renders a toolbar or tooltip for an edge.
|
|
@@ -528,597 +561,606 @@ type EdgeToolbarProps = EdgeToolbarBaseProps & {
|
|
|
528
561
|
* The toolbar does not scale with the viewport so that its content is always legible.
|
|
529
562
|
*/
|
|
530
563
|
declare const EdgeToolbar: (props: ParentProps<EdgeToolbarProps>) => JSX.Element;
|
|
531
|
-
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region src/components/graph/plugins/minimap/MiniMap.d.ts
|
|
532
566
|
type GetMiniMapNodeAttribute<NodeType extends Node> = (node: NodeType) => string;
|
|
533
567
|
type MiniMapProps<NodeType extends Node> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
568
|
+
/** Background color of minimap */
|
|
569
|
+
readonly bgColor?: string;
|
|
570
|
+
/** Color of nodes on the minimap */
|
|
571
|
+
readonly nodeColor?: string | GetMiniMapNodeAttribute<NodeType>;
|
|
572
|
+
/** Stroke color of nodes on the minimap */
|
|
573
|
+
readonly nodeStrokeColor?: string | GetMiniMapNodeAttribute<NodeType>;
|
|
574
|
+
/** Class applied to nodes on the minimap */
|
|
575
|
+
readonly nodeClass?: string | GetMiniMapNodeAttribute<NodeType>;
|
|
576
|
+
/** Border radius of nodes on the minimap */
|
|
577
|
+
readonly nodeBorderRadius?: number;
|
|
578
|
+
/** Stroke width of nodes on the minimap */
|
|
579
|
+
readonly nodeStrokeWidth?: number;
|
|
580
|
+
/** Color of the mask representing viewport */
|
|
581
|
+
readonly maskColor?: string;
|
|
582
|
+
/** Stroke color of the mask representing viewport */
|
|
583
|
+
readonly maskStrokeColor?: string;
|
|
584
|
+
/** Stroke width of the mask representing viewport */
|
|
585
|
+
readonly maskStrokeWidth?: number;
|
|
586
|
+
/** Position of the minimap on the pane
|
|
587
|
+
* @example PanelPosition.TopLeft, PanelPosition.TopRight,
|
|
588
|
+
* PanelPosition.BottomLeft, PanelPosition.BottomRight
|
|
589
|
+
*/
|
|
590
|
+
readonly position?: PanelPosition$1;
|
|
591
|
+
/** Style applied to container */
|
|
592
|
+
readonly style?: JSX.CSSProperties;
|
|
593
|
+
/** The aria-label applied to container */
|
|
594
|
+
readonly ariaLabel?: string | null;
|
|
595
|
+
/** Width of minimap */
|
|
596
|
+
readonly width?: number;
|
|
597
|
+
/** Height of minimap */
|
|
598
|
+
readonly height?: number;
|
|
599
|
+
readonly pannable?: boolean;
|
|
600
|
+
readonly zoomable?: boolean;
|
|
601
|
+
/** Invert the direction when panning the minimap viewport */
|
|
602
|
+
readonly inversePan?: boolean;
|
|
603
|
+
/** Step size for zooming in/out */
|
|
604
|
+
readonly zoomStep?: number;
|
|
571
605
|
};
|
|
572
606
|
declare const MiniMap: <NodeType extends Node>(props: ParentProps<Partial<MiniMapProps<NodeType>>>) => JSX.Element;
|
|
573
|
-
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/components/graph/plugins/nodeResizer/NodeResizer.d.ts
|
|
574
609
|
type NodeResizerProps = {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
610
|
+
/** Id of the node it is resizing
|
|
611
|
+
* @remarks optional if used inside custom node
|
|
612
|
+
*/
|
|
613
|
+
readonly nodeId?: string;
|
|
614
|
+
/** Class applied to handle */
|
|
615
|
+
readonly handleClass?: string;
|
|
616
|
+
/** Style applied to handle */
|
|
617
|
+
readonly handleStyle?: JSX.CSSProperties;
|
|
618
|
+
/** Class applied to line */
|
|
619
|
+
readonly lineClass?: string;
|
|
620
|
+
/** Style applied to line */
|
|
621
|
+
readonly lineStyle?: JSX.CSSProperties;
|
|
622
|
+
/** Are the controls visible */
|
|
623
|
+
readonly visible?: boolean;
|
|
624
|
+
/** Minimum width of node */
|
|
625
|
+
readonly minWidth?: number;
|
|
626
|
+
/** Minimum height of node */
|
|
627
|
+
readonly minHeight?: number;
|
|
628
|
+
/** Maximum width of node */
|
|
629
|
+
readonly maxWidth?: number;
|
|
630
|
+
/** Maximum height of node */
|
|
631
|
+
readonly maxHeight?: number;
|
|
632
|
+
/** Keep aspect ratio when resizing */
|
|
633
|
+
readonly keepAspectRatio?: boolean;
|
|
634
|
+
/** Automatically scale the node when resizing */
|
|
635
|
+
readonly autoScale?: boolean;
|
|
636
|
+
/** Callback to determine if node should resize */
|
|
637
|
+
readonly shouldResize?: ShouldResize$1;
|
|
638
|
+
/** Callback called when resizing starts */
|
|
639
|
+
readonly onResizeStart?: OnResizeStart$1;
|
|
640
|
+
/** Callback called when resizing */
|
|
641
|
+
readonly onResize?: OnResize$1;
|
|
642
|
+
/** Callback called when resizing ends */
|
|
643
|
+
readonly onResizeEnd?: OnResizeEnd$1;
|
|
609
644
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
|
|
610
645
|
declare const NodeResizer: (props: Partial<NodeResizerProps>) => JSX.Element;
|
|
611
|
-
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/components/graph/plugins/nodeResizer/ResizeControl.d.ts
|
|
612
648
|
type NodeResizerSubProps = Pick<NodeResizerProps, "nodeId" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "autoScale" | "keepAspectRatio" | "shouldResize" | "onResizeStart" | "onResize" | "onResizeEnd">;
|
|
613
649
|
type ResizeControlProps = NodeResizerSubProps & {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
650
|
+
/** Position of control
|
|
651
|
+
* @example ControlPosition.TopLeft, ControlPosition.TopRight,
|
|
652
|
+
* ControlPosition.BottomLeft, ControlPosition.BottomRight
|
|
653
|
+
*/
|
|
654
|
+
readonly position?: ControlPosition$1;
|
|
655
|
+
/** Variant of control
|
|
656
|
+
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line
|
|
657
|
+
*/
|
|
658
|
+
readonly variant?: ResizeControlVariant$2;
|
|
659
|
+
readonly color?: string;
|
|
660
|
+
readonly style?: JSX.CSSProperties;
|
|
624
661
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
|
|
625
662
|
declare const ResizeControl: <NodeType extends Node = Node>(props: ParentProps<ResizeControlProps>) => JSX.Element;
|
|
626
|
-
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/components/graph/plugins/NodeToolbar.d.ts
|
|
627
665
|
type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
666
|
+
/** The id of the node, or array of ids the toolbar should be displayed at */
|
|
667
|
+
readonly nodeId: string | string[];
|
|
668
|
+
/** Position of the toolbar relative to the node
|
|
669
|
+
* @example Position.TopLeft, Position.TopRight,
|
|
670
|
+
* Position.BottomLeft, Position.BottomRight
|
|
671
|
+
*/
|
|
672
|
+
readonly position: Position$3;
|
|
673
|
+
/** Align the toolbar relative to the node
|
|
674
|
+
* @example Align.Start, Align.Center, Align.End
|
|
675
|
+
*/
|
|
676
|
+
readonly align: Align$1;
|
|
677
|
+
/** Offset the toolbar from the node */
|
|
678
|
+
readonly offset: number;
|
|
679
|
+
/** If true, node toolbar is visible even if node is not selected */
|
|
680
|
+
readonly isVisible: boolean;
|
|
681
|
+
/** Style of the toolbar */
|
|
682
|
+
readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
|
|
645
683
|
};
|
|
646
684
|
declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
|
|
647
|
-
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/components/graph/selection/NodeSelection.d.ts
|
|
648
687
|
type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
|
|
649
688
|
declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
|
|
650
|
-
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region src/components/graph/selection/Selection.d.ts
|
|
651
691
|
type SelectionProps = {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
692
|
+
readonly x?: number;
|
|
693
|
+
readonly y?: number;
|
|
694
|
+
readonly width?: number | string;
|
|
695
|
+
readonly height?: number | string;
|
|
696
|
+
readonly isVisible?: boolean;
|
|
657
697
|
};
|
|
658
698
|
declare const Selection: (props: SelectionProps) => JSX.Element;
|
|
659
|
-
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region src/components/SolidFlow/types.d.ts
|
|
660
701
|
type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = NodeEvents<NodeType> & NodeSelectionEvents<NodeType> & EdgeEvents<EdgeType> & DeleteEvents<NodeType, EdgeType> & PaneEvents & {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
702
|
+
/**
|
|
703
|
+
* The id of the flow. This is necessary if you want to render multiple flows.
|
|
704
|
+
*/
|
|
705
|
+
readonly id?: string;
|
|
706
|
+
/** Sets a fixed width for the flow */
|
|
707
|
+
readonly width?: number;
|
|
708
|
+
/** Sets a fixed height for the flow */
|
|
709
|
+
readonly height?: number;
|
|
710
|
+
/**
|
|
711
|
+
* An store of nodes to render in a flow.
|
|
712
|
+
* @example
|
|
713
|
+
* const [nodes] = createStore([
|
|
714
|
+
* {
|
|
715
|
+
* id: 'node-1',
|
|
716
|
+
* type: 'input',
|
|
717
|
+
* data: { label: 'Node 1' },
|
|
718
|
+
* position: { x: 250, y: 50 }
|
|
719
|
+
* }
|
|
720
|
+
* ]);
|
|
721
|
+
*/
|
|
722
|
+
readonly nodes?: Store<NodeType[]>;
|
|
723
|
+
/**
|
|
724
|
+
* An store of edges to render in a flow.
|
|
725
|
+
* @example
|
|
726
|
+
* const [edges] = createStore([
|
|
727
|
+
* {
|
|
728
|
+
* id: 'edge-1-2',
|
|
729
|
+
* source: 'node-1',
|
|
730
|
+
* target: 'node-2',
|
|
731
|
+
* }
|
|
732
|
+
* ]);
|
|
733
|
+
*/
|
|
734
|
+
readonly edges?: Store<EdgeType[]>;
|
|
735
|
+
/**
|
|
736
|
+
* Custom node types to be available in a flow.
|
|
737
|
+
* Solid Flow matches a node's type to a component in the nodeTypes object.
|
|
738
|
+
* @example
|
|
739
|
+
* import CustomNode from './CustomNode';
|
|
740
|
+
*
|
|
741
|
+
* const nodeTypes = { nameOfNodeType: CustomNode };
|
|
742
|
+
*/
|
|
743
|
+
readonly nodeTypes?: NodeTypes;
|
|
744
|
+
/**
|
|
745
|
+
* Custom edge types to be available in a flow.
|
|
746
|
+
* Solid Flow matches an edge's type to a component in the edgeTypes object.
|
|
747
|
+
* @example
|
|
748
|
+
* import CustomEdge from './CustomEdge';
|
|
749
|
+
*
|
|
750
|
+
* const edgeTypes = { nameOfEdgeType: CustomEdge };
|
|
751
|
+
*/
|
|
752
|
+
readonly edgeTypes?: EdgeTypes;
|
|
753
|
+
/** Pressing down this key you can select multiple elements with a selection box.
|
|
754
|
+
* @default 'Shift'
|
|
755
|
+
*/
|
|
756
|
+
readonly selectionKey?: KeyDefinition | KeyDefinition[] | null;
|
|
757
|
+
/** If a key is set, you can pan the viewport while that key is held down even if panOnScroll is set to false.
|
|
758
|
+
*
|
|
759
|
+
* By setting this prop to null you can disable this functionality.
|
|
760
|
+
* @default 'Space'
|
|
761
|
+
*/
|
|
762
|
+
readonly panActivationKey?: KeyDefinition | KeyDefinition[] | null;
|
|
763
|
+
/** Pressing down this key deletes all selected nodes & edges.
|
|
764
|
+
* @default 'Backspace'
|
|
765
|
+
*/
|
|
766
|
+
readonly deleteKey?: KeyDefinition | KeyDefinition[] | null;
|
|
767
|
+
/** Pressing down this key you can select multiple elements by clicking.
|
|
768
|
+
* @default 'Meta' for macOS, "Ctrl" for other systems
|
|
769
|
+
*/
|
|
770
|
+
readonly multiSelectionKey?: KeyDefinition | KeyDefinition[] | null;
|
|
771
|
+
/** If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
|
|
772
|
+
*
|
|
773
|
+
* By setting this prop to null you can disable this functionality.
|
|
774
|
+
* @default 'Meta' for macOS, "Ctrl" for other systems
|
|
775
|
+
* */
|
|
776
|
+
readonly zoomActivationKey?: KeyDefinition | KeyDefinition[] | null;
|
|
777
|
+
/** If set, initial viewport will show all nodes & edges */
|
|
778
|
+
readonly fitView?: boolean;
|
|
779
|
+
/**
|
|
780
|
+
* Options to be used in combination with fitView
|
|
781
|
+
* @example
|
|
782
|
+
* const fitViewOptions = {
|
|
783
|
+
* padding: 0.1,
|
|
784
|
+
* includeHiddenNodes: false,
|
|
785
|
+
* minZoom: 0.1,
|
|
786
|
+
* maxZoom: 1,
|
|
787
|
+
* duration: 200,
|
|
788
|
+
* nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit
|
|
789
|
+
* };
|
|
790
|
+
*/
|
|
791
|
+
readonly fitViewOptions?: FitViewOptions<NodeType>;
|
|
792
|
+
/**
|
|
793
|
+
* Defines nodes relative position to its coordinates
|
|
794
|
+
* @default [0, 0]
|
|
795
|
+
* @example
|
|
796
|
+
* [0, 0] // default, top left
|
|
797
|
+
* [0.5, 0.5] // center
|
|
798
|
+
* [1, 1] // bottom right
|
|
799
|
+
*/
|
|
800
|
+
readonly nodeOrigin?: NodeOrigin$1;
|
|
801
|
+
/**
|
|
802
|
+
* With a threshold greater than zero you can control the distinction between node drag and click events.
|
|
803
|
+
* If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
|
|
804
|
+
* @default 1
|
|
805
|
+
*/
|
|
806
|
+
readonly nodeDragThreshold?: number;
|
|
807
|
+
/**
|
|
808
|
+
* Distance that the mouse can move between mousedown/up that will trigger a click
|
|
809
|
+
* @default 0
|
|
810
|
+
*/
|
|
811
|
+
readonly paneClickDistance?: number;
|
|
812
|
+
/** Distance that the mouse can move between mousedown/up that will trigger a click
|
|
813
|
+
* @default 0
|
|
814
|
+
*/
|
|
815
|
+
readonly nodeClickDistance?: number;
|
|
816
|
+
/**
|
|
817
|
+
* The threshold in pixels that the mouse must move before a connection line starts to drag.
|
|
818
|
+
* This is useful to prevent accidental connections when clicking on a handle.
|
|
819
|
+
* @default 1
|
|
820
|
+
*/
|
|
821
|
+
readonly connectionDragThreshold?: number;
|
|
822
|
+
/** Minimum zoom level
|
|
823
|
+
* @default 0.5
|
|
824
|
+
*/
|
|
825
|
+
readonly minZoom?: number;
|
|
826
|
+
/** Maximum zoom level
|
|
827
|
+
* @default 2
|
|
828
|
+
*/
|
|
829
|
+
readonly maxZoom?: number;
|
|
830
|
+
/**
|
|
831
|
+
* Sets the initial position and zoom of the viewport.
|
|
832
|
+
* If a default viewport is provided but fitView is enabled, the default viewport will be ignored.
|
|
833
|
+
* @default { zoom: 1, position: { x: 0, y: 0 } }
|
|
834
|
+
* @example
|
|
835
|
+
* const initialViewport = {
|
|
836
|
+
* zoom: 0.5,
|
|
837
|
+
* position: { x: 0, y: 0 }
|
|
838
|
+
* };
|
|
839
|
+
*/
|
|
840
|
+
readonly initialViewport?: Viewport$1;
|
|
841
|
+
/** Custom viewport to be used instead of internal one */
|
|
842
|
+
readonly viewport?: Store<Viewport$1>;
|
|
843
|
+
/**
|
|
844
|
+
* The radius around a handle where you drop a connection line to create a new edge.
|
|
845
|
+
* @default 20
|
|
846
|
+
*/
|
|
847
|
+
readonly connectionRadius?: number;
|
|
848
|
+
/**
|
|
849
|
+
* 'strict' connection mode will only allow you to connect source handles to target handles.
|
|
850
|
+
* 'loose' connection mode will allow you to connect handles of any type to one another.
|
|
851
|
+
* @default 'strict'
|
|
852
|
+
*/
|
|
853
|
+
readonly connectionMode?: ConnectionMode$2;
|
|
854
|
+
/** Provide a custom snippet to be used insted of the default connection line */
|
|
855
|
+
readonly connectionLineComponent?: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
|
|
856
|
+
/** Styles to be applied to the connection line */
|
|
857
|
+
readonly connectionLineStyle?: JSX.CSSProperties;
|
|
858
|
+
/** Styles to be applied to the container of the connection line */
|
|
859
|
+
readonly connectionLineContainerStyle?: JSX.CSSProperties;
|
|
860
|
+
/**
|
|
861
|
+
* When set to "partial", when the user creates a selection box by click and dragging
|
|
862
|
+
* nodes that are only partially in the box are still selected.
|
|
863
|
+
* @default 'full'
|
|
864
|
+
*/
|
|
865
|
+
readonly selectionMode?: SelectionMode$2;
|
|
866
|
+
/**
|
|
867
|
+
* Controls if nodes should be automatically selected when being dragged
|
|
868
|
+
*/
|
|
869
|
+
readonly selectNodesOnDrag?: boolean;
|
|
870
|
+
/**
|
|
871
|
+
* Grid all nodes will snap to
|
|
872
|
+
* @example [20, 20]
|
|
873
|
+
*/
|
|
874
|
+
readonly snapGrid?: SnapGrid$1;
|
|
875
|
+
/** Color of edge markers
|
|
876
|
+
* You can pass `null` to use the CSS variable `--xy-edge-stroke` for the marker color.
|
|
877
|
+
* @example "#b1b1b7"
|
|
878
|
+
*/
|
|
879
|
+
readonly defaultMarkerColor?: string | null;
|
|
880
|
+
/**
|
|
881
|
+
* Controls if all nodes should be draggable
|
|
882
|
+
* @default true
|
|
883
|
+
*/
|
|
884
|
+
readonly nodesDraggable?: boolean;
|
|
885
|
+
/**
|
|
886
|
+
* When `true`, the viewport will pan when a node is focused.
|
|
887
|
+
* @default true
|
|
888
|
+
*/
|
|
889
|
+
readonly autoPanOnNodeFocus?: boolean;
|
|
890
|
+
/**
|
|
891
|
+
* When `true`, the viewport will pan when a drag selection approaches the edges of the flow container.
|
|
892
|
+
* @default true
|
|
893
|
+
*/
|
|
894
|
+
readonly autoPanOnSelection?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Controls if all nodes should be connectable to each other
|
|
897
|
+
* @default true
|
|
898
|
+
*/
|
|
899
|
+
readonly nodesConnectable?: boolean;
|
|
900
|
+
/** Controls if all elements should (nodes & edges) be selectable
|
|
901
|
+
* @default true
|
|
902
|
+
*/
|
|
903
|
+
readonly elementsSelectable?: boolean;
|
|
904
|
+
/**
|
|
905
|
+
* When `true`, focus between nodes can be cycled with the `Tab` key and selected with the `Enter`
|
|
906
|
+
* key. This option can be overridden by individual nodes by setting their `focusable` prop.
|
|
907
|
+
* @default true
|
|
908
|
+
*/
|
|
909
|
+
readonly nodesFocusable?: boolean;
|
|
910
|
+
/**
|
|
911
|
+
* When `true`, focus between edges can be cycled with the `Tab` key and selected with the `Enter`
|
|
912
|
+
* key. This option can be overridden by individual edges by setting their `focusable` prop.
|
|
913
|
+
* @default true
|
|
914
|
+
*/
|
|
915
|
+
readonly edgesFocusable?: boolean;
|
|
916
|
+
/**
|
|
917
|
+
* By default the viewport extends infinitely. You can use this prop to set a boundary.
|
|
918
|
+
* The first pair of coordinates is the top left boundary and the second pair is the bottom right.
|
|
919
|
+
* @default @default [[-∞, -∞], [+∞, +∞]]
|
|
920
|
+
* @example [[-1000, -10000], [1000, 1000]]
|
|
921
|
+
*/
|
|
922
|
+
readonly translateExtent?: CoordinateExtent$1;
|
|
923
|
+
/**
|
|
924
|
+
* By default the nodes can be placed anywhere. You can use this prop to set a boundary.
|
|
925
|
+
* The first pair of coordinates is the top left boundary and the second pair is the bottom right.
|
|
926
|
+
* @default [[-∞, -∞], [+∞, +∞]]
|
|
927
|
+
* @example [[-1000, -10000], [1000, 1000]]
|
|
928
|
+
*/
|
|
929
|
+
readonly nodeExtent?: CoordinateExtent$1;
|
|
930
|
+
/**
|
|
931
|
+
* Disabling this prop will allow the user to scroll the page even when their pointer is over the flow.
|
|
932
|
+
* @default true
|
|
933
|
+
*/
|
|
934
|
+
readonly preventScrolling?: boolean;
|
|
935
|
+
/**
|
|
936
|
+
* Controls if the viewport should zoom by scrolling inside the container.
|
|
937
|
+
* @default true
|
|
938
|
+
*/
|
|
939
|
+
readonly zoomOnScroll?: boolean;
|
|
940
|
+
/**
|
|
941
|
+
* Controls if the viewport should zoom by double clicking somewhere on the flow
|
|
942
|
+
* @default true
|
|
943
|
+
*/
|
|
944
|
+
readonly zoomOnDoubleClick?: boolean;
|
|
945
|
+
/**
|
|
946
|
+
* Controls if the viewport should zoom by pinching on a touch screen
|
|
947
|
+
* @default true
|
|
948
|
+
*/
|
|
949
|
+
readonly zoomOnPinch?: boolean;
|
|
950
|
+
/**
|
|
951
|
+
* Controls if the viewport should pan by scrolling inside the container
|
|
952
|
+
* Can be limited to a specific direction with panOnScrollMode
|
|
953
|
+
* @default false
|
|
954
|
+
*/
|
|
955
|
+
readonly panOnScroll?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* This prop is used to limit the direction of panning when panOnScroll is enabled.
|
|
958
|
+
* The "free" option allows panning in any direction.
|
|
959
|
+
* @default "free"
|
|
960
|
+
* @example "horizontal" | "vertical"
|
|
961
|
+
*/
|
|
962
|
+
readonly panOnScrollMode?: PanOnScrollMode$2;
|
|
963
|
+
/**
|
|
964
|
+
* Enableing this prop allows users to pan the viewport by clicking and dragging.
|
|
965
|
+
* You can also set this prop to an array of numbers to limit which mouse buttons can activate panning.
|
|
966
|
+
* @default true
|
|
967
|
+
* @example [0, 2] // allows panning with the left and right mouse buttons
|
|
968
|
+
* [0, 1, 2, 3, 4] // allows panning with all mouse buttons
|
|
969
|
+
*/
|
|
970
|
+
readonly panOnDrag?: boolean | number[];
|
|
971
|
+
/**
|
|
972
|
+
* Select multiple elements with a selection box, without pressing down selectionKey.
|
|
973
|
+
* @default false
|
|
974
|
+
*/
|
|
975
|
+
readonly selectionOnDrag?: boolean;
|
|
976
|
+
/**
|
|
977
|
+
* You can enable this optimization to instruct Solid Flow to only render nodes and edges that would be visible in the viewport.
|
|
978
|
+
* This might improve performance when you have a large number of nodes and edges but also adds an overhead.
|
|
979
|
+
* @default false
|
|
980
|
+
*/
|
|
981
|
+
readonly onlyRenderVisibleElements?: boolean;
|
|
982
|
+
/**
|
|
983
|
+
* You can enable this prop to automatically pan the viewport while making a new connection.
|
|
984
|
+
* @default true
|
|
985
|
+
*/
|
|
986
|
+
readonly autoPanOnConnect?: boolean;
|
|
987
|
+
/**
|
|
988
|
+
* You can enable this prop to automatically pan the viewport while dragging a node.
|
|
989
|
+
* @default true
|
|
990
|
+
*/
|
|
991
|
+
readonly autoPanOnNodeDrag?: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Defaults to be applied to all new edges that are added to the flow.
|
|
994
|
+
* Properties on a new edge will override these defaults if they exist.
|
|
995
|
+
* @example
|
|
996
|
+
* const defaultEdgeOptions = {
|
|
997
|
+
* type: 'customEdgeType',
|
|
998
|
+
* animated: true
|
|
999
|
+
* }
|
|
1000
|
+
*/
|
|
1001
|
+
readonly defaultEdgeOptions?: DefaultEdgeOptions;
|
|
1002
|
+
/**
|
|
1003
|
+
* Controls color scheme used for styling the flow
|
|
1004
|
+
* @default 'system'
|
|
1005
|
+
* @example 'system' | 'light' | 'dark'
|
|
1006
|
+
*/
|
|
1007
|
+
readonly colorMode?: ColorMode$1;
|
|
1008
|
+
/** Fallback color mode for SSR if colorMode is set to 'system' */
|
|
1009
|
+
readonly colorModeSSR?: Omit<ColorMode$1, "system">;
|
|
1010
|
+
/** Class to be applied to the flow container */
|
|
1011
|
+
readonly class?: string;
|
|
1012
|
+
/** Styles to be applied to the flow container */
|
|
1013
|
+
readonly style?: JSX.CSSProperties;
|
|
1014
|
+
/** Choose from the built-in edge types to be used for connections
|
|
1015
|
+
* @default 'default' | ConnectionLineType.Bezier
|
|
1016
|
+
* @example 'straight' | 'default' | 'step' | 'smoothstep' | 'bezier'
|
|
1017
|
+
* @example ConnectionLineType.Straight | ConnectionLineType.Default | ConnectionLineType.Step | ConnectionLineType.SmoothStep | ConnectionLineType.Bezier
|
|
1018
|
+
*/
|
|
1019
|
+
readonly connectionLineType?: ConnectionLineType$3;
|
|
1020
|
+
/** Enabling this option will raise the z-index of nodes when they are selected.
|
|
1021
|
+
* @default true
|
|
1022
|
+
*/
|
|
1023
|
+
readonly elevateNodesOnSelect?: boolean;
|
|
1024
|
+
/**
|
|
1025
|
+
* Controls how z-indexes are calculated for nodes and edges.
|
|
1026
|
+
* 'auto' automatically manages z-indexing for selections and sub flows,
|
|
1027
|
+
* 'basic' manages z-indexing for selections only, and
|
|
1028
|
+
* 'manual' does not apply any automatic z-indexing.
|
|
1029
|
+
* @default "basic"
|
|
1030
|
+
*/
|
|
1031
|
+
readonly zIndexMode?: ZIndexMode;
|
|
1032
|
+
/**
|
|
1033
|
+
* Enabling this option will raise the z-index of edges when they are selected,
|
|
1034
|
+
* or when the connected nodes are selected.
|
|
1035
|
+
* @default true
|
|
1036
|
+
*/
|
|
1037
|
+
readonly elevateEdgesOnSelect?: boolean;
|
|
1038
|
+
/**
|
|
1039
|
+
* You can use this prop to disable keyboard accessibility features such as selecting nodes or
|
|
1040
|
+
* moving selected nodes with the arrow keys.
|
|
1041
|
+
* @default false
|
|
1042
|
+
*/
|
|
1043
|
+
readonly disableKeyboardA11y?: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* If a node is draggable, clicking and dragging that node will move it around the canvas. Adding
|
|
1046
|
+
* the `"nodrag"` class prevents this behavior and this prop allows you to change the name of that
|
|
1047
|
+
* class.
|
|
1048
|
+
* @default "nodrag"
|
|
1049
|
+
*/
|
|
1050
|
+
readonly noDragClass?: string;
|
|
1051
|
+
/**
|
|
1052
|
+
* Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
|
|
1053
|
+
* Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop
|
|
1054
|
+
* allows you to change the name of that class.
|
|
1055
|
+
* @default "nowheel"
|
|
1056
|
+
*/
|
|
1057
|
+
readonly noWheelClass?: string;
|
|
1058
|
+
/**
|
|
1059
|
+
* If an element in the canvas does not stop mouse events from propagating, clicking and dragging
|
|
1060
|
+
* that element will pan the viewport. Adding the `"nopan"` class prevents this behavior and this
|
|
1061
|
+
* prop allows you to change the name of that class.
|
|
1062
|
+
* @default "nopan"
|
|
1063
|
+
*/
|
|
1064
|
+
readonly noPanClass?: string;
|
|
1065
|
+
/** Toggles ability to make connections via clicking the handles */
|
|
1066
|
+
readonly clickConnect?: boolean;
|
|
1067
|
+
/**
|
|
1068
|
+
* This callback can be used to validate a new connection.
|
|
1069
|
+
* If you return `false`, the edge will not be added to your flow.
|
|
1070
|
+
* If you have custom connection logic its preferred to use this callback over the
|
|
1071
|
+
* `isValidConnection` prop on the handle component for performance reasons.
|
|
1072
|
+
*/
|
|
1073
|
+
/**
|
|
1074
|
+
* Set position of the attribution
|
|
1075
|
+
* @default 'bottom-right'
|
|
1076
|
+
* @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
|
|
1077
|
+
*/
|
|
1078
|
+
readonly attributionPosition?: PanelPosition$1;
|
|
1079
|
+
/**
|
|
1080
|
+
* By default, we render a small attribution in the corner of your flows that links back to the project.
|
|
1081
|
+
* You are free to remove this attribution but we ask that you take a quick look at our
|
|
1082
|
+
* {@link https://svelteflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide}
|
|
1083
|
+
* before doing so.
|
|
1084
|
+
*/
|
|
1085
|
+
readonly proOptions?: ProOptions$1;
|
|
1086
|
+
readonly isValidConnection?: IsValidConnection$1<EdgeType>;
|
|
1087
|
+
/** This event handler is called when the user begins to pan or zoom the viewport */
|
|
1088
|
+
readonly onMoveStart?: OnMoveStart$1;
|
|
1089
|
+
/** This event handler is called when the user pans or zooms the viewport */
|
|
1090
|
+
readonly onMove?: OnMove$1;
|
|
1091
|
+
/** This event handler is called when the user stops panning or zooming the viewport */
|
|
1092
|
+
readonly onMoveEnd?: OnMoveEnd$1;
|
|
1093
|
+
/**
|
|
1094
|
+
* Ocassionally something may happen that causes Solid Flow to throw an error.
|
|
1095
|
+
* Instead of exploding your application, we log a message to the console and then call this event handler.
|
|
1096
|
+
* You might use it for additional logging or to show a message to the user.
|
|
1097
|
+
*/
|
|
1098
|
+
readonly onFlowError?: OnError$1;
|
|
1099
|
+
/** This handler gets called when the user deletes nodes or edges.
|
|
1100
|
+
* @example
|
|
1101
|
+
* onDelete={({nodes, edges}) => {
|
|
1102
|
+
* console.log('deleted nodes:', nodes);
|
|
1103
|
+
* console.log('deleted edges:', edges);
|
|
1104
|
+
* }}
|
|
1105
|
+
*/
|
|
1106
|
+
readonly onDelete?: OnDelete<NodeType, EdgeType>;
|
|
1107
|
+
/** This handler gets called before the user deletes nodes or edges and provides a way to abort the deletion by returning false. */
|
|
1108
|
+
readonly onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
|
|
1109
|
+
/** This handler gets called when a new edge is created. You can use it to modify the newly created edge. */
|
|
1110
|
+
readonly onBeforeConnect?: OnBeforeEdgeConnect<EdgeType>;
|
|
1111
|
+
/** This event gets fired when a connection successfully completes and an edge is created. */
|
|
1112
|
+
readonly onConnect?: OnEdgeConnect;
|
|
1113
|
+
/** When a user starts to drag a connection line, this event gets fired. */
|
|
1114
|
+
readonly onConnectStart?: OnConnectStart$1;
|
|
1115
|
+
/** When a user stops dragging a connection line, this event gets fired. */
|
|
1116
|
+
readonly onConnectEnd?: OnConnectEnd$1;
|
|
1117
|
+
/** This event gets fired when after an edge was reconnected*/
|
|
1118
|
+
readonly onReconnect?: OnReconnect$1<EdgeType>;
|
|
1119
|
+
/** This event gets fired when a user starts to reconnect an edge */
|
|
1120
|
+
readonly onReconnectStart?: OnReconnectStart$1<EdgeType>;
|
|
1121
|
+
/** This event gets fired when a user stops reconnecting an edge */
|
|
1122
|
+
readonly onReconnectEnd?: OnReconnectEnd$1<NodeType, EdgeType>;
|
|
1123
|
+
/** This handler gets called when an edge is reconnected. You can use it to modify the edge before the update is applied. */
|
|
1124
|
+
readonly onBeforeReconnect?: OnBeforeReconnect<EdgeType>;
|
|
1125
|
+
/** A connection is started by clicking on a handle */
|
|
1126
|
+
readonly onClickConnectStart?: OnConnectStart$1;
|
|
1127
|
+
/** A connection is finished by clicking on a handle */
|
|
1128
|
+
readonly onClickConnectEnd?: OnConnectEnd$1;
|
|
1129
|
+
/** This handler gets called when the flow is finished initializing */
|
|
1130
|
+
readonly onInit?: () => void;
|
|
1131
|
+
/** This event handler gets called when the selected nodes & edges change */
|
|
1132
|
+
readonly onSelectionChange?: OnSelectionChange<NodeType, EdgeType>;
|
|
1133
|
+
/** This event handler gets called when a user starts to drag a selection box. */
|
|
1134
|
+
readonly onSelectionDragStart?: OnSelectionDrag$1<NodeType>;
|
|
1135
|
+
/** This event handler gets called when a user drags a selection box. */
|
|
1136
|
+
readonly onSelectionDrag?: OnSelectionDrag$1<NodeType>;
|
|
1137
|
+
/** This event handler gets called when a user stops dragging a selection box. */
|
|
1138
|
+
readonly onSelectionDragStop?: OnSelectionDrag$1<NodeType>;
|
|
1139
|
+
/** This event handler gets called when the user starts to drag a selection box */
|
|
1140
|
+
readonly onSelectionStart?: (event: PointerEvent) => void;
|
|
1141
|
+
/** This event handler gets called when the user finishes dragging a selection box */
|
|
1142
|
+
readonly onSelectionEnd?: (event: PointerEvent) => void;
|
|
1143
|
+
/**
|
|
1144
|
+
* Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults.
|
|
1145
|
+
* Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings.
|
|
1146
|
+
*/
|
|
1147
|
+
readonly ariaLabelConfig?: Partial<AriaLabelConfig$1>;
|
|
1107
1148
|
};
|
|
1108
|
-
|
|
1149
|
+
//#endregion
|
|
1150
|
+
//#region src/components/SolidFlow/component.d.ts
|
|
1109
1151
|
type SolidFlowComponentProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ParentProps<SolidFlowProps<NodeType, EdgeType>> & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style" | "onselectionchange" | "onSelectionChange">;
|
|
1110
1152
|
declare const SolidFlow: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: SolidFlowComponentProps<NodeType, EdgeType>) => JSX.Element;
|
|
1111
|
-
|
|
1153
|
+
//#endregion
|
|
1154
|
+
//#region src/components/SolidFlow/provider.d.ts
|
|
1112
1155
|
declare const SolidFlowProvider: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<SolidFlowProps<NodeType, EdgeType>>) => JSX.Element;
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1156
|
+
//#endregion
|
|
1157
|
+
//#region src/data/createEdgeStore.d.ts
|
|
1158
|
+
type ExtractEdgeInfo<T> = T extends ((props: EdgeProps<infer TData, infer TType>) => unknown) ? {
|
|
1159
|
+
data: TData;
|
|
1160
|
+
type: TType;
|
|
1117
1161
|
} : never;
|
|
1118
1162
|
type AllEdgeTypes<TUserEdgeTypes extends EdgeTypes> = TUserEdgeTypes extends Record<string, never> ? BuiltInEdgeTypes : BuiltInEdgeTypes & TUserEdgeTypes;
|
|
1119
|
-
type EdgesInput<TUserEdgeTypes extends EdgeTypes> = {
|
|
1120
|
-
[K in keyof AllEdgeTypes<TUserEdgeTypes>]: Edge<ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["data"], ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["type"]>;
|
|
1121
|
-
}[keyof AllEdgeTypes<TUserEdgeTypes>];
|
|
1163
|
+
type EdgesInput<TUserEdgeTypes extends EdgeTypes> = { [K in keyof AllEdgeTypes<TUserEdgeTypes>]: Edge<ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["data"], ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["type"]>; }[keyof AllEdgeTypes<TUserEdgeTypes>];
|
|
1122
1164
|
/**
|
|
1123
1165
|
* Creates a type-safe reactive store of edges for use in Solid Flow.
|
|
1124
1166
|
*
|
|
@@ -1195,16 +1237,15 @@ type EdgesInput<TUserEdgeTypes extends EdgeTypes> = {
|
|
|
1195
1237
|
* - Works seamlessly with both built-in and custom node types
|
|
1196
1238
|
* - Type errors prevent invalid type names or incorrect data structures
|
|
1197
1239
|
*/
|
|
1198
|
-
declare const createEdgeStore: <TUserEdgeTypes extends EdgeTypes = Record<string, never>>(edges: EdgesInput<TUserEdgeTypes>[]) => readonly [Store<EdgesInput<TUserEdgeTypes>[]>,
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1240
|
+
declare const createEdgeStore: <TUserEdgeTypes extends EdgeTypes = Record<string, never>>(edges: EdgesInput<TUserEdgeTypes>[]) => readonly [Store<EdgesInput<TUserEdgeTypes>[]>, StoreSetter<EdgesInput<TUserEdgeTypes>[]>];
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region src/data/createNodeStore.d.ts
|
|
1243
|
+
type ExtractNodeInfo<T> = T extends ((props: NodeProps<infer TData, infer TType>) => unknown) ? {
|
|
1244
|
+
data: TData;
|
|
1245
|
+
type: TType;
|
|
1203
1246
|
} : never;
|
|
1204
1247
|
type AllNodeTypes<TUserNodeTypes extends NodeTypes> = TUserNodeTypes extends Record<string, never> ? BuiltInNodeTypes : BuiltInNodeTypes & TUserNodeTypes;
|
|
1205
|
-
type NodesInput<TUserNodeTypes extends NodeTypes> = {
|
|
1206
|
-
[K in keyof AllNodeTypes<TUserNodeTypes>]: Node<ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["data"], ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["type"]>;
|
|
1207
|
-
}[keyof AllNodeTypes<TUserNodeTypes>];
|
|
1248
|
+
type NodesInput<TUserNodeTypes extends NodeTypes> = { [K in keyof AllNodeTypes<TUserNodeTypes>]: Node<ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["data"], ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["type"]>; }[keyof AllNodeTypes<TUserNodeTypes>];
|
|
1208
1249
|
/**
|
|
1209
1250
|
* Creates a type-safe reactive store of nodes for use in Solid Flow.
|
|
1210
1251
|
*
|
|
@@ -1276,8 +1317,9 @@ type NodesInput<TUserNodeTypes extends NodeTypes> = {
|
|
|
1276
1317
|
* - Works seamlessly with both built-in and custom node types
|
|
1277
1318
|
* - Type errors prevent invalid type names or incorrect data structures
|
|
1278
1319
|
*/
|
|
1279
|
-
declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string, never>>(nodes: NodesInput<TUserNodeTypes>[]) => readonly [Store<NodesInput<TUserNodeTypes>[]>,
|
|
1280
|
-
|
|
1320
|
+
declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string, never>>(nodes: NodesInput<TUserNodeTypes>[]) => readonly [Store<NodesInput<TUserNodeTypes>[]>, StoreSetter<NodesInput<TUserNodeTypes>[]>];
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region src/hooks/useColorMode.d.ts
|
|
1281
1323
|
/**
|
|
1282
1324
|
* Hook for receiving the current color mode class ('dark' or 'light').
|
|
1283
1325
|
*
|
|
@@ -1287,8 +1329,9 @@ declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string
|
|
|
1287
1329
|
* @public
|
|
1288
1330
|
* @returns an accessor for the current color mode class
|
|
1289
1331
|
*/
|
|
1290
|
-
declare function useColorMode(): () => ColorModeClass;
|
|
1291
|
-
|
|
1332
|
+
declare function useColorMode(): () => ColorModeClass$1;
|
|
1333
|
+
//#endregion
|
|
1334
|
+
//#region src/hooks/useConnection.d.ts
|
|
1292
1335
|
/**
|
|
1293
1336
|
* Hook for receiving the current connection.
|
|
1294
1337
|
*
|
|
@@ -1296,7 +1339,8 @@ declare function useColorMode(): () => ColorModeClass;
|
|
|
1296
1339
|
* @returns current connection as a readable store
|
|
1297
1340
|
*/
|
|
1298
1341
|
declare function useConnection(): Accessor<ConnectionState>;
|
|
1299
|
-
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region src/hooks/useGraph.d.ts
|
|
1300
1344
|
/**
|
|
1301
1345
|
* Hook for getting the current nodes from the store.
|
|
1302
1346
|
*
|
|
@@ -1317,10 +1361,12 @@ declare function useEdges<EdgeType extends Edge = Edge>(): Accessor<EdgeType[]>;
|
|
|
1317
1361
|
* @public
|
|
1318
1362
|
* @returns store with the viewport object
|
|
1319
1363
|
*/
|
|
1320
|
-
declare function useViewport(): Accessor<Viewport>;
|
|
1321
|
-
|
|
1364
|
+
declare function useViewport(): Accessor<Viewport$1>;
|
|
1365
|
+
//#endregion
|
|
1366
|
+
//#region src/hooks/useHandleEdgeSelect.d.ts
|
|
1322
1367
|
declare function useHandleEdgeSelect(): (id: string) => void;
|
|
1323
|
-
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/hooks/useInitialized.d.ts
|
|
1324
1370
|
/**
|
|
1325
1371
|
* Hook for seeing if all nodes have been measured.
|
|
1326
1372
|
*
|
|
@@ -1340,7 +1386,8 @@ declare function useNodesInitialized(): Accessor<boolean>;
|
|
|
1340
1386
|
* @returns an accessor that indicates whether the viewport is initialized
|
|
1341
1387
|
*/
|
|
1342
1388
|
declare function useViewportInitialized(): Accessor<boolean>;
|
|
1343
|
-
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/hooks/useInternalNode.d.ts
|
|
1344
1391
|
/**
|
|
1345
1392
|
* Hook to get an internal node by id.
|
|
1346
1393
|
*
|
|
@@ -1349,11 +1396,12 @@ declare function useViewportInitialized(): Accessor<boolean>;
|
|
|
1349
1396
|
* @returns an accessor with an internal node or undefined
|
|
1350
1397
|
*/
|
|
1351
1398
|
declare function useInternalNode(id: Accessor<string>): Accessor<InternalNode | undefined>;
|
|
1352
|
-
|
|
1399
|
+
//#endregion
|
|
1400
|
+
//#region src/hooks/useNodeConnections.d.ts
|
|
1353
1401
|
type UseNodeConnectionsParams = {
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1402
|
+
id?: string;
|
|
1403
|
+
handleType?: HandleType;
|
|
1404
|
+
handleId?: string;
|
|
1357
1405
|
};
|
|
1358
1406
|
/**
|
|
1359
1407
|
* Hook to retrieve all edges connected to a node. Can be filtered by handle type and id.
|
|
@@ -1366,8 +1414,9 @@ type UseNodeConnectionsParams = {
|
|
|
1366
1414
|
* @todo @param param.onDisconnect - gets called when a connection is removed
|
|
1367
1415
|
* @returns an array with connections
|
|
1368
1416
|
*/
|
|
1369
|
-
declare const useNodeConnections: (params: Accessor<UseNodeConnectionsParams>) => Accessor<NodeConnection[]>;
|
|
1370
|
-
|
|
1417
|
+
declare const useNodeConnections: (params: Accessor<UseNodeConnectionsParams>) => Accessor<NodeConnection$1[]>;
|
|
1418
|
+
//#endregion
|
|
1419
|
+
//#region src/hooks/useNodesData.d.ts
|
|
1371
1420
|
type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
|
|
1372
1421
|
/**
|
|
1373
1422
|
* Hook for receiving data of one or multiple nodes
|
|
@@ -1377,7 +1426,8 @@ type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
|
|
|
1377
1426
|
*/
|
|
1378
1427
|
declare function useNodesData<NodeType extends Node = Node>(nodeId: Accessor<string | undefined | null>): Accessor<NodeData<NodeType> | undefined>;
|
|
1379
1428
|
declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<string[] | undefined | null>): Accessor<NodeData<NodeType>[]>;
|
|
1380
|
-
|
|
1429
|
+
//#endregion
|
|
1430
|
+
//#region src/hooks/useSolidFlow.d.ts
|
|
1381
1431
|
/**
|
|
1382
1432
|
* Hook for accessing the SvelteFlow instance.
|
|
1383
1433
|
*
|
|
@@ -1385,252 +1435,253 @@ declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<st
|
|
|
1385
1435
|
* @returns A set of helper functions
|
|
1386
1436
|
*/
|
|
1387
1437
|
declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1438
|
+
/**
|
|
1439
|
+
* Zooms viewport in by 1.2.
|
|
1440
|
+
*
|
|
1441
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
1442
|
+
*/
|
|
1443
|
+
zoomIn: ZoomInOut;
|
|
1444
|
+
/**
|
|
1445
|
+
* Zooms viewport out by 1 / 1.2.
|
|
1446
|
+
*
|
|
1447
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
1448
|
+
*/
|
|
1449
|
+
zoomOut: ZoomInOut;
|
|
1450
|
+
/**
|
|
1451
|
+
* Returns an internal node by id.
|
|
1452
|
+
*
|
|
1453
|
+
* @param id - the node id
|
|
1454
|
+
* @returns the node or undefined if no node was found
|
|
1455
|
+
*/
|
|
1456
|
+
getInternalNode: (id: string) => InternalNode<NodeType> | undefined;
|
|
1457
|
+
/**
|
|
1458
|
+
* Returns a node by id.
|
|
1459
|
+
*
|
|
1460
|
+
* @param id - the node id
|
|
1461
|
+
* @returns the node or undefined if no node was found
|
|
1462
|
+
*/
|
|
1463
|
+
getNode: (id: string) => NodeType | undefined;
|
|
1464
|
+
/**
|
|
1465
|
+
* Returns nodes.
|
|
1466
|
+
*
|
|
1467
|
+
* @returns nodes array
|
|
1468
|
+
*/
|
|
1469
|
+
getNodes: (ids?: string[]) => NodeType[];
|
|
1470
|
+
/**
|
|
1471
|
+
* Returns an edge by id.
|
|
1472
|
+
*
|
|
1473
|
+
* @param id - the edge id
|
|
1474
|
+
* @returns the edge or undefined if no edge was found
|
|
1475
|
+
*/
|
|
1476
|
+
getEdge: (id: string) => EdgeType | undefined;
|
|
1477
|
+
/**
|
|
1478
|
+
* Returns edges.
|
|
1479
|
+
*
|
|
1480
|
+
* @returns edges array
|
|
1481
|
+
*/
|
|
1482
|
+
getEdges: (ids?: string[]) => EdgeType[];
|
|
1483
|
+
/**
|
|
1484
|
+
* Add one or many nodes to your existing nodes array.
|
|
1485
|
+
*
|
|
1486
|
+
* @param payload - the nodes to add
|
|
1487
|
+
*/
|
|
1488
|
+
addNodes: (payload: NodeType[] | NodeType) => void;
|
|
1489
|
+
/**
|
|
1490
|
+
* Add one or many edges to your existing edges array.
|
|
1491
|
+
*
|
|
1492
|
+
* @param payload - the edges to add
|
|
1493
|
+
*/
|
|
1494
|
+
addEdges: (payload: EdgeType[] | EdgeType) => void;
|
|
1495
|
+
/**
|
|
1496
|
+
* Sets the current zoom level.
|
|
1497
|
+
*
|
|
1498
|
+
* @param zoomLevel - the zoom level to set
|
|
1499
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
1500
|
+
*/
|
|
1501
|
+
setZoom: (zoomLevel: number, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
|
|
1502
|
+
/**
|
|
1503
|
+
* Returns the current zoom level.
|
|
1504
|
+
*
|
|
1505
|
+
* @returns current zoom as a number
|
|
1506
|
+
*/
|
|
1507
|
+
getZoom: () => number;
|
|
1508
|
+
/**
|
|
1509
|
+
* Sets the center of the view to the given position.
|
|
1510
|
+
*
|
|
1511
|
+
* @param x - x position
|
|
1512
|
+
* @param y - y position
|
|
1513
|
+
* @param options.zoom - optional zoom
|
|
1514
|
+
*/
|
|
1515
|
+
setCenter: (x: number, y: number, options?: SetCenterOptions$1) => Promise<boolean>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Sets the current viewport.
|
|
1518
|
+
*
|
|
1519
|
+
* @param viewport - the viewport to set
|
|
1520
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
1521
|
+
*/
|
|
1522
|
+
setViewport: (viewport: Viewport$1, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
|
|
1523
|
+
/**
|
|
1524
|
+
* Returns the current viewport.
|
|
1525
|
+
*
|
|
1526
|
+
* @returns Viewport
|
|
1527
|
+
*/
|
|
1528
|
+
getViewport: () => Viewport$1;
|
|
1529
|
+
/**
|
|
1530
|
+
* Fits the view.
|
|
1531
|
+
*
|
|
1532
|
+
* @param options.padding - optional padding
|
|
1533
|
+
* @param options.includeHiddenNodes - optional includeHiddenNodes
|
|
1534
|
+
* @param options.minZoom - optional minZoom
|
|
1535
|
+
* @param options.maxZoom - optional maxZoom
|
|
1536
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
1537
|
+
* @param options.nodes - optional nodes to fit the view to
|
|
1538
|
+
*/
|
|
1539
|
+
fitView: (options?: FitViewOptions<NodeType>) => Promise<boolean>;
|
|
1540
|
+
/**
|
|
1541
|
+
* Returns all nodes that intersect with the given node or rect.
|
|
1542
|
+
*
|
|
1543
|
+
* @param node - the node or rect to check for intersections
|
|
1544
|
+
* @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect
|
|
1545
|
+
* @param nodes - optional nodes array to check for intersections
|
|
1546
|
+
*
|
|
1547
|
+
* @returns an array of intersecting nodes
|
|
1548
|
+
*/
|
|
1549
|
+
getIntersectingNodes: (nodeOrRect: NodeType | {
|
|
1550
|
+
id: NodeType["id"];
|
|
1551
|
+
} | Rect$1, partially?: boolean, nodesToIntersect?: NodeType[]) => NodeType[];
|
|
1552
|
+
/**
|
|
1553
|
+
* Checks if the given node or rect intersects with the passed rect.
|
|
1554
|
+
*
|
|
1555
|
+
* @param node - the node or rect to check for intersections
|
|
1556
|
+
* @param area - the rect to check for intersections
|
|
1557
|
+
* @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react
|
|
1558
|
+
*
|
|
1559
|
+
* @returns true if the node or rect intersects with the given area
|
|
1560
|
+
*/
|
|
1561
|
+
isNodeIntersecting: (nodeOrRect: NodeType | {
|
|
1562
|
+
id: NodeType["id"];
|
|
1563
|
+
} | Rect$1, area: Rect$1, partially?: boolean) => boolean;
|
|
1564
|
+
/**
|
|
1565
|
+
* Fits the view to the given bounds .
|
|
1566
|
+
*
|
|
1567
|
+
* @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
|
|
1568
|
+
* @param options.padding - optional padding
|
|
1569
|
+
*/
|
|
1570
|
+
fitBounds: (bounds: Rect$1, options?: FitBoundsOptions$1) => Promise<boolean>;
|
|
1571
|
+
/**
|
|
1572
|
+
* Deletes nodes and edges.
|
|
1573
|
+
*
|
|
1574
|
+
* @param params.nodes - optional nodes array to delete
|
|
1575
|
+
* @param params.edges - optional edges array to delete
|
|
1576
|
+
*
|
|
1577
|
+
* @returns a promise that resolves with the deleted nodes and edges
|
|
1578
|
+
*/
|
|
1579
|
+
deleteElements: ({ nodes, edges }: {
|
|
1580
|
+
nodes?: (Partial<NodeType> & {
|
|
1581
|
+
id: string;
|
|
1582
|
+
})[];
|
|
1583
|
+
edges?: (Partial<EdgeType> & {
|
|
1584
|
+
id: string;
|
|
1585
|
+
})[];
|
|
1586
|
+
}) => Promise<{
|
|
1587
|
+
deletedNodes: NodeType[];
|
|
1588
|
+
deletedEdges: EdgeType[];
|
|
1589
|
+
}>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Converts a screen / client position to a flow position.
|
|
1592
|
+
*
|
|
1593
|
+
* @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
|
|
1594
|
+
* @param options.snapToGrid - if true, the converted position will be snapped to the grid
|
|
1595
|
+
* @returns position as { x: number, y: number }
|
|
1596
|
+
*
|
|
1597
|
+
* @example
|
|
1598
|
+
* const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
|
|
1599
|
+
*/
|
|
1600
|
+
screenToFlowPosition: (clientPosition: XYPosition$1, options?: {
|
|
1601
|
+
snapToGrid: boolean;
|
|
1602
|
+
}) => XYPosition$1;
|
|
1603
|
+
/**
|
|
1604
|
+
* Converts a flow position to a screen / client position.
|
|
1605
|
+
*
|
|
1606
|
+
* @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
|
|
1607
|
+
* @returns position as { x: number, y: number }
|
|
1608
|
+
*
|
|
1609
|
+
* @example
|
|
1610
|
+
* const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y })
|
|
1611
|
+
*/
|
|
1612
|
+
flowToScreenPosition: (flowPosition: XYPosition$1) => XYPosition$1;
|
|
1613
|
+
/**
|
|
1614
|
+
* Updates a node.
|
|
1615
|
+
*
|
|
1616
|
+
* @param id - id of the node to update
|
|
1617
|
+
* @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update
|
|
1618
|
+
* @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged
|
|
1619
|
+
*
|
|
1620
|
+
* @example
|
|
1621
|
+
* updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
|
|
1622
|
+
*/
|
|
1623
|
+
updateNode: (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
|
|
1624
|
+
replace: boolean;
|
|
1625
|
+
}) => void;
|
|
1626
|
+
/**
|
|
1627
|
+
* Updates the data attribute of a node.
|
|
1628
|
+
*
|
|
1629
|
+
* @param id - id of the node to update
|
|
1630
|
+
* @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update
|
|
1631
|
+
* @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged
|
|
1632
|
+
*
|
|
1633
|
+
* @example
|
|
1634
|
+
* updateNodeData('node-1', { label: 'A new label' });
|
|
1635
|
+
*/
|
|
1636
|
+
updateNodeData: (id: string, dataUpdate: Partial<NodeType["data"]> | ((node: NodeType) => Partial<NodeType["data"]>), options?: {
|
|
1637
|
+
replace: boolean;
|
|
1638
|
+
}) => void;
|
|
1639
|
+
/**
|
|
1640
|
+
* Returns the nodes, edges and the viewport as a JSON object.
|
|
1641
|
+
*
|
|
1642
|
+
* @returns the nodes, edges and the viewport as a JSON object
|
|
1643
|
+
*/
|
|
1644
|
+
/**
|
|
1645
|
+
* Updates an edge.
|
|
1646
|
+
*
|
|
1647
|
+
* @param id - id of the edge to update
|
|
1648
|
+
* @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update
|
|
1649
|
+
* @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged
|
|
1650
|
+
*
|
|
1651
|
+
* @example
|
|
1652
|
+
* updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
|
|
1653
|
+
*/
|
|
1654
|
+
updateEdge: (id: string, edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>), options?: {
|
|
1655
|
+
replace: boolean;
|
|
1656
|
+
}) => void;
|
|
1657
|
+
toObject: () => {
|
|
1658
|
+
nodes: NodeType[];
|
|
1659
|
+
edges: EdgeType[];
|
|
1660
|
+
viewport: Viewport$1;
|
|
1661
|
+
};
|
|
1662
|
+
/**
|
|
1663
|
+
* Returns the bounds of the given nodes or node ids.
|
|
1664
|
+
*
|
|
1665
|
+
* @param nodes - the nodes or node ids to calculate the bounds for
|
|
1666
|
+
*
|
|
1667
|
+
* @returns the bounds of the given nodes
|
|
1668
|
+
*/
|
|
1669
|
+
getNodesBounds: (nodes: (NodeType | InternalNode<NodeType> | string)[]) => Rect$1;
|
|
1670
|
+
/** Gets all connections for a given handle belonging to a specific node.
|
|
1671
|
+
*
|
|
1672
|
+
* @param type - handle type 'source' or 'target'
|
|
1673
|
+
* @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle)
|
|
1674
|
+
* @param nodeId - the node id the handle belongs to
|
|
1675
|
+
* @returns an array with handle connections
|
|
1676
|
+
*/
|
|
1677
|
+
getHandleConnections: ({ type, id, nodeId }: {
|
|
1678
|
+
type: HandleType;
|
|
1679
|
+
nodeId: string;
|
|
1680
|
+
id?: string | null;
|
|
1681
|
+
}) => HandleConnection$1[];
|
|
1632
1682
|
};
|
|
1633
|
-
|
|
1683
|
+
//#endregion
|
|
1684
|
+
//#region src/hooks/useUpdateNodeInternals.d.ts
|
|
1634
1685
|
/**
|
|
1635
1686
|
* Hook for updating node internals.
|
|
1636
1687
|
*
|
|
@@ -1638,5 +1689,5 @@ declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edg
|
|
|
1638
1689
|
* @returns function for updating node internals
|
|
1639
1690
|
*/
|
|
1640
1691
|
declare function useUpdateNodeInternals(): UpdateNodeInternals;
|
|
1641
|
-
|
|
1642
|
-
export { Background, type BackgroundProps, type BackgroundVariant, BaseEdge, BezierEdge, BezierEdgeInternal, type BezierEdgeProps, type BuiltInEdge, type BuiltInNode, type BuiltInNodeTypes, type ConnectionData, ConnectionLine, type ConnectionLineComponentProps, ControlButton, Controls, type DefaultEdgeOptions, DefaultNode, type
|
|
1692
|
+
//#endregion
|
|
1693
|
+
export { type Align, type AriaLabelConfig, Background, type BackgroundProps, type BackgroundVariant, BaseEdge, BezierEdge, BezierEdgeInternal, type BezierEdgeProps, type BezierPathOptions, type Box, type BuiltInEdge, type BuiltInNode, type BuiltInNodeTypes, type ColorMode, type ColorModeClass, type Connection, ConnectionData, ConnectionLine, type ConnectionLineComponentProps, ConnectionLineType, ConnectionMode, ControlButton, type ControlLinePosition, type ControlPosition, Controls, type CoordinateExtent, type DefaultEdgeOptions, DefaultNode, DeleteEvents, type Dimensions, type Edge, EdgeConnection, EdgeEvents, EdgeLabel, EdgeLabelRenderer, type EdgeMarker, type EdgeMarkerType, type EdgeProps, EdgeReconnectAnchor, EdgeReconnectEvents, EdgeRenderer, EdgeToolbar, EdgeToolbarProps, type EdgeTypes, EdgeWrapper, type FitBounds, type FitBoundsOptions, FitViewOptions, type GetBezierPathParams, type GetSmoothStepPathParams, type GetStraightPathParams, GroupNode, Handle, type HandleConnection, InputNode, type InternalNode, IsValidConnection, KeyDefinition, KeyDefinitionObject, KeyModifier, Marker, MarkerDefinition, MarkerType, MiniMap, type Node, type NodeConnection, NodeEvents, NodeGraph, type NodeOrigin, type NodeProps, NodeRenderer, NodeResizer, NodeSelection, NodeSelectionEvents, NodeToolbar, NodeToolbarProps, type NodeTypes, NodeWrapper, OnBeforeDelete, OnBeforeEdgeConnect, OnBeforeReconnect, type OnConnect, type OnConnectEnd, type OnConnectStart, type OnConnectStartParams, OnDelete, OnEdgeConnect, OnEdgeCreate, type OnError, type OnMove, type OnMoveEnd, type OnMoveStart, type OnReconnect, type OnReconnectEnd, type OnReconnectStart, type OnResize, type OnResizeEnd, type OnResizeStart, OnSelectionChange, OnSelectionDrag, OutputNode, PanOnScrollMode, Pane, PaneEvents, Panel, type PanelPosition, Position$1 as Position, type ProOptions, type Rect, ResizeControl, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Selection, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, type SetViewport, ShortcutModifier, ShortcutModifierDefinition, type ShouldResize, SmoothStepEdge, SmoothStepEdgeInternal, type SmoothStepEdgeProps, type SmoothStepPathOptions, type SnapGrid, SolidFlow, SolidFlowProvider, StepEdge, StepEdgeInternal, type StepEdgeProps, StraightEdge, StraightEdgeInternal, type StraightEdgeProps, type Transform, Viewport, type ViewportHelperFunctionOptions, ViewportPortal, type XYPosition, type XYZPosition, Zoom, addEdge, createEdgeStore, createNodeStore, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, useColorMode, useConnection, useEdges, useHandleEdgeSelect, useInternalNode, useNodeConnections, useNodes, useNodesData, useNodesInitialized, useSolidFlow, useUpdateNodeInternals, useViewport, useViewportInitialized };
|