@dschz/solid-flow 0.3.0-next.2 → 0.3.0-next.3
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 +177 -8
- package/dist/index/index.js +23 -2
- package/dist/index/index.jsx +6 -2
- package/package.json +1 -1
package/dist/index/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from "@solidjs/web";
|
|
2
|
-
import { Align
|
|
2
|
+
import { Align as Align$1, AriaLabelConfig as AriaLabelConfig$1, BezierPathOptions as BezierPathOptions$1, Box as Box$1, ColorMode as ColorMode$1, 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 as Dimensions$1, EdgeBase, EdgeMarker, EdgeMarkerType as EdgeMarkerType$1, EdgePosition, EdgeToolbarBaseProps, FinalConnectionState, FitBounds, FitBoundsOptions as FitBoundsOptions$1, FitViewOptionsBase, GetBezierPathParams as GetBezierPathParams$1, GetSmoothStepPathParams as GetSmoothStepPathParams$1, GetStraightPathParams as GetStraightPathParams$1, Handle as Handle$1, HandleConnection, HandleConnection as HandleConnection$1, HandleProps, HandleType, InternalNodeBase, IsValidConnection as IsValidConnection$1, MarkerProps, MarkerType, NodeBase, NodeConnection, NodeConnection as NodeConnection$1, NodeOrigin, NodeOrigin as NodeOrigin$1, NodeProps as NodeProps$1, OnBeforeDeleteBase, OnConnect as OnConnect$1, OnConnectEnd as OnConnectEnd$1, OnConnectStart as OnConnectStart$1, OnConnectStartParams as OnConnectStartParams$1, OnError as OnError$1, OnMove, OnMove as OnMove$1, OnMoveEnd as OnMoveEnd$1, OnMoveStart as OnMoveStart$1, OnReconnect as OnReconnect$1, OnReconnectEnd as OnReconnectEnd$1, OnReconnectStart as OnReconnectStart$1, OnResize as OnResize$1, OnResizeEnd as OnResizeEnd$1, OnResizeStart as OnResizeStart$1, OnSelectionDrag as OnSelectionDrag$1, PanOnScrollMode, PanOnScrollMode as PanOnScrollMode$1, PanelPosition, PanelPosition as PanelPosition$1, Position, Position as Position$1, ProOptions as ProOptions$1, Rect as Rect$1, ResizeControlVariant, ResizeControlVariant as ResizeControlVariant$1, ResizeDragEvent as ResizeDragEvent$1, ResizeParams as ResizeParams$1, ResizeParamsWithDirection as ResizeParamsWithDirection$1, SelectionMode as SelectionMode$1, SelectionRect as SelectionRect$1, SetCenter, SetCenterOptions as SetCenterOptions$1, SetViewport, ShouldResize, ShouldResize as ShouldResize$1, SmoothStepPathOptions as SmoothStepPathOptions$1, SnapGrid as SnapGrid$1, StepPathOptions, Transform as Transform$1, UpdateNodeInternals, Viewport, Viewport as Viewport$1, ViewportHelperFunctionOptions as ViewportHelperFunctionOptions$1, XYPosition, XYPosition as XYPosition$1, XYZPosition as XYZPosition$1, ZIndexMode, ZoomInOut, addEdge, getBezierEdgeCenter as getBezierEdgeCenter$1, getBezierPath, getConnectedEdges, getEdgeCenter as getEdgeCenter$1, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from "@xyflow/system";
|
|
3
3
|
import { Accessor, ParentComponent, ParentProps, Store, StoreSetter } from "solid-js";
|
|
4
4
|
//#region src/types/custom.d.ts
|
|
5
5
|
type UnknownStruct = Record<string, unknown>;
|
|
@@ -30,6 +30,7 @@ type Node<NodeData extends UnknownStruct = UnknownStruct, NodeType extends strin
|
|
|
30
30
|
*/
|
|
31
31
|
domAttributes?: Omit<JSX.HTMLAttributes<HTMLDivElement>, "id" | "style" | "class" | "draggable" | "role" | "aria-label" | keyof JSX.HTMLAttributes<HTMLDivElement>>;
|
|
32
32
|
};
|
|
33
|
+
/** Props passed to a node component (custom or built-in). */
|
|
33
34
|
type NodeProps<TData extends UnknownStruct = UnknownStruct, TType extends string | undefined = string | undefined> = NodeProps$1<Node<TData, TType>>;
|
|
34
35
|
/**
|
|
35
36
|
* Map of node types to their components.
|
|
@@ -37,9 +38,11 @@ type NodeProps<TData extends UnknownStruct = UnknownStruct, TType extends string
|
|
|
37
38
|
type NodeTypes = { [K in string]: {
|
|
38
39
|
bivarianceHack(props: NodeProps<Record<string, unknown>, string | undefined>): JSX.Element;
|
|
39
40
|
}["bivarianceHack"]; };
|
|
41
|
+
/** Union of the built-in node shapes (input, output, default, group). */
|
|
40
42
|
type BuiltInNode = Node<{
|
|
41
43
|
label: string;
|
|
42
44
|
}, "input" | "output" | "default"> | Node<Record<string, never>, "group">;
|
|
45
|
+
/** The built-in node renderer map, keyed by node type. */
|
|
43
46
|
type BuiltInNodeTypes = {
|
|
44
47
|
input: (props: NodeProps<{
|
|
45
48
|
label: string;
|
|
@@ -115,10 +118,13 @@ type BaseEdgeProps = {
|
|
|
115
118
|
type BezierEdgeProps = EdgeProps<Record<string, unknown>, "default"> & {
|
|
116
119
|
pathOptions?: BezierPathOptions$1;
|
|
117
120
|
};
|
|
121
|
+
/** Props for the built-in straight edge. */
|
|
118
122
|
type StraightEdgeProps = Omit<EdgeProps<Record<string, unknown>, "straight">, "sourcePosition" | "targetPosition">;
|
|
123
|
+
/** Props for the built-in step edge. */
|
|
119
124
|
type StepEdgeProps = EdgeProps<Record<string, unknown>, "step"> & {
|
|
120
125
|
pathOptions?: StepPathOptions;
|
|
121
126
|
};
|
|
127
|
+
/** Props for the built-in smooth-step edge. */
|
|
122
128
|
type SmoothStepEdgeProps = EdgeProps<Record<string, unknown>, "smoothstep"> & {
|
|
123
129
|
pathOptions?: SmoothStepPathOptions$1;
|
|
124
130
|
};
|
|
@@ -141,6 +147,7 @@ type BuiltInEdge = BezierEdgeProps | StraightEdgeProps | StepEdgeProps | SmoothS
|
|
|
141
147
|
type EdgeTypes = { [K in string]: {
|
|
142
148
|
bivarianceHack(props: EdgeProps<Record<string, unknown>, string | undefined>): JSX.Element;
|
|
143
149
|
}["bivarianceHack"]; };
|
|
150
|
+
/** Defaults applied to every new edge added to the flow. */
|
|
144
151
|
type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
|
|
145
152
|
type EdgeLayouted<EdgeType extends Edge = Edge> = EdgeType & EdgePosition & {
|
|
146
153
|
sourceNode?: Node;
|
|
@@ -164,6 +171,7 @@ type NodeTargetEventWithPointer<T = PointerEvent, NodeType extends Node = Node>
|
|
|
164
171
|
nodes: NodeType[];
|
|
165
172
|
event: T;
|
|
166
173
|
}) => void;
|
|
174
|
+
/** Node pointer and drag event handlers accepted by the flow. */
|
|
167
175
|
type NodeEvents<NodeType extends Node = Node> = {
|
|
168
176
|
/** This event handler is called when a user clicks on a node. */
|
|
169
177
|
onNodeClick?: NodeEventWithPointer<MouseEvent | TouchEvent, NodeType>;
|
|
@@ -182,12 +190,14 @@ type NodeEvents<NodeType extends Node = Node> = {
|
|
|
182
190
|
/** This event handler is called when the pointer of a user moves over a node. */
|
|
183
191
|
onNodePointerMove?: NodeEventWithPointer<PointerEvent, NodeType>;
|
|
184
192
|
};
|
|
193
|
+
/** Selection-box event handlers. */
|
|
185
194
|
type NodeSelectionEvents<NodeType extends Node = Node> = {
|
|
186
195
|
/** This event handler is called when a user right-clicks the selection box. */
|
|
187
196
|
onSelectionContextMenu?: NodesEventWithPointer<PointerEvent, NodeType>;
|
|
188
197
|
/** This event handler is called when a user clicks the selection box. */
|
|
189
198
|
onSelectionClick?: NodesEventWithPointer<MouseEvent, NodeType>;
|
|
190
199
|
};
|
|
200
|
+
/** Pane (background) event handlers. */
|
|
191
201
|
type PaneEvents = {
|
|
192
202
|
/** This event handler is called when a user clicks the pane. */
|
|
193
203
|
onPaneClick?: ({ event }: {
|
|
@@ -198,6 +208,7 @@ type PaneEvents = {
|
|
|
198
208
|
event: PointerEvent;
|
|
199
209
|
}) => void;
|
|
200
210
|
};
|
|
211
|
+
/** Edge pointer event handlers. */
|
|
201
212
|
type EdgeEvents<EdgeType extends Edge = Edge> = {
|
|
202
213
|
/** This event handler is called when a user clicks an edge. */
|
|
203
214
|
onEdgeClick?: ({ edge, event }: {
|
|
@@ -220,10 +231,12 @@ type EdgeEvents<EdgeType extends Edge = Edge> = {
|
|
|
220
231
|
event: PointerEvent;
|
|
221
232
|
}) => void;
|
|
222
233
|
};
|
|
234
|
+
/** Handlers fired after node/edge deletions. */
|
|
223
235
|
type DeleteEvents<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
224
236
|
onNodesDelete?: (nodes: NodeType[]) => void;
|
|
225
237
|
onEdgesDelete?: (edges: EdgeType[]) => void;
|
|
226
238
|
};
|
|
239
|
+
/** Handlers for edge reconnection gestures. */
|
|
227
240
|
type EdgeReconnectEvents<EdgeType extends Edge = Edge> = {
|
|
228
241
|
/**
|
|
229
242
|
* This handler is called when the source or target of a reconnectable edge is dragged from the
|
|
@@ -241,7 +254,7 @@ type EdgeReconnectEvents<EdgeType extends Edge = Edge> = {
|
|
|
241
254
|
*/
|
|
242
255
|
onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void;
|
|
243
256
|
};
|
|
244
|
-
type OnSelectionDrag$
|
|
257
|
+
type OnSelectionDrag$2<NodeType extends Node = Node> = (event: MouseEvent, nodes: NodeType[]) => void;
|
|
245
258
|
//#endregion
|
|
246
259
|
//#region src/types/general.d.ts
|
|
247
260
|
type Position$2 = `${Position$1}`;
|
|
@@ -272,25 +285,34 @@ type ConnectionLineComponentProps<NodeType extends Node = Node> = {
|
|
|
272
285
|
type SelectionMode$2 = `${SelectionMode$1}`;
|
|
273
286
|
type PanOnScrollMode$2 = `${PanOnScrollMode$1}`;
|
|
274
287
|
type ResizeControlVariant$2 = `${ResizeControlVariant$1}`;
|
|
288
|
+
/** A single keyboard modifier key. */
|
|
275
289
|
type ShortcutModifier = "alt" | "ctrl" | "meta" | "shift";
|
|
290
|
+
/** Modifier requirement for a shortcut: none (`null`/`false`), one modifier, or a list that must all be held. */
|
|
276
291
|
type ShortcutModifierDefinition = null | false | ShortcutModifier | (ShortcutModifier | ShortcutModifier[])[];
|
|
292
|
+
/** Alias of `ShortcutModifierDefinition`. */
|
|
277
293
|
type KeyModifier = ShortcutModifierDefinition;
|
|
294
|
+
/** A key name plus an optional modifier requirement. */
|
|
278
295
|
type KeyDefinitionObject = {
|
|
279
296
|
key: string;
|
|
280
297
|
modifier?: KeyModifier;
|
|
281
298
|
};
|
|
299
|
+
/** A shortcut key: a plain key name or a `KeyDefinitionObject`. */
|
|
282
300
|
type KeyDefinition = string | KeyDefinitionObject;
|
|
301
|
+
/** Live state of an in-progress connection gesture. */
|
|
283
302
|
type ConnectionData = {
|
|
284
303
|
connectionPosition: XYPosition$1 | null;
|
|
285
304
|
connectionStartHandle: Handle$1 | null;
|
|
286
305
|
connectionEndHandle: Handle$1 | null;
|
|
287
306
|
connectionStatus: string | null;
|
|
288
307
|
};
|
|
308
|
+
/** Options for `fitView`: padding, zoom bounds, duration, and the node subset to fit. */
|
|
289
309
|
type FitViewOptions<NodeType extends Node = Node> = FitViewOptionsBase<NodeType>;
|
|
310
|
+
/** Handler called after nodes and/or edges are deleted. */
|
|
290
311
|
type OnDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
|
|
291
312
|
nodes: NodeType[];
|
|
292
313
|
edges: EdgeType[];
|
|
293
314
|
}) => void;
|
|
315
|
+
/** A connection together with the id of the edge it produced. */
|
|
294
316
|
type EdgeConnection = Connection$1 & {
|
|
295
317
|
id: string;
|
|
296
318
|
};
|
|
@@ -298,17 +320,22 @@ type EdgeConnection = Connection$1 & {
|
|
|
298
320
|
type OnBeforeEdgeConnect<EdgeType extends Edge = Edge> = (connection: EdgeConnection) => EdgeType | EdgeConnection | undefined;
|
|
299
321
|
/** Callback that gets called after a handle connection is created. */
|
|
300
322
|
type OnEdgeConnect = (connection: EdgeConnection) => void;
|
|
323
|
+
/** Callback fired before a reconnect is applied; return the modified edge, or `undefined` to cancel. */
|
|
301
324
|
type OnBeforeReconnect<EdgeType extends Edge = Edge> = (newEdge: EdgeType, oldEdge: EdgeType) => EdgeType | undefined;
|
|
325
|
+
/** Callback fired before nodes/edges are deleted; can abort or narrow the deletion. */
|
|
302
326
|
type OnBeforeDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = OnBeforeDeleteBase<NodeType, EdgeType>;
|
|
303
|
-
type IsValidConnection$
|
|
327
|
+
type IsValidConnection$2<EdgeType extends Edge = Edge> = (edge: EdgeType | Connection$1) => boolean;
|
|
328
|
+
/** Handler called when the set of selected nodes and edges changes. */
|
|
304
329
|
type OnSelectionChange<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
|
|
305
330
|
nodes: NodeType[];
|
|
306
331
|
edges: EdgeType[];
|
|
307
332
|
}) => void;
|
|
333
|
+
/** A nodes + edges pair describing a (sub)graph. */
|
|
308
334
|
type NodeGraph<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
309
335
|
readonly nodes: NodeType[];
|
|
310
336
|
readonly edges: EdgeType[];
|
|
311
337
|
};
|
|
338
|
+
/** Callback that maps a completed connection to the edge to create. */
|
|
312
339
|
type OnEdgeCreate<EdgeType extends Edge = Edge> = (connection: Connection$1) => EdgeType | Connection$1;
|
|
313
340
|
//#endregion
|
|
314
341
|
//#region src/components/connection/ConnectionLine.d.ts
|
|
@@ -318,6 +345,7 @@ type ConnectionLineProps<NodeType extends Node = Node> = {
|
|
|
318
345
|
readonly component: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
|
|
319
346
|
readonly containerStyle: string | JSX.CSSProperties;
|
|
320
347
|
};
|
|
348
|
+
/** Internal component rendering the in-progress connection line. */
|
|
321
349
|
declare const ConnectionLine: <NodeType extends Node = Node>(props: ParentProps<Partial<ConnectionLineProps<NodeType>>>) => JSX.Element;
|
|
322
350
|
//#endregion
|
|
323
351
|
//#region src/components/container/EdgeRenderer.d.ts
|
|
@@ -325,12 +353,14 @@ type EdgeRendererProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
|
|
|
325
353
|
readonly defaultEdgeOptions?: DefaultEdgeOptions;
|
|
326
354
|
readonly reconnectRadius: number;
|
|
327
355
|
};
|
|
356
|
+
/** Internal renderer iterating the edge id list into `EdgeWrapper`s. */
|
|
328
357
|
declare const EdgeRenderer: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeRendererProps<EdgeType>) => JSX.Element;
|
|
329
358
|
//#endregion
|
|
330
359
|
//#region src/components/container/NodeRenderer.d.ts
|
|
331
360
|
type NodeRendererProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
|
|
332
361
|
readonly nodeClickDistance: number;
|
|
333
362
|
};
|
|
363
|
+
/** Internal renderer iterating the node id list into `NodeWrapper`s; owns the shared measurement `ResizeObserver`. */
|
|
334
364
|
declare const NodeRenderer: <NodeType extends Node = Node>(props: NodeRendererProps<NodeType>) => JSX.Element;
|
|
335
365
|
//#endregion
|
|
336
366
|
//#region src/components/container/Pane.d.ts
|
|
@@ -342,6 +372,7 @@ type PaneProps = PaneEvents & {
|
|
|
342
372
|
readonly onSelectionStart?: (event: PointerEvent) => void;
|
|
343
373
|
readonly onSelectionEnd?: (event: PointerEvent) => void;
|
|
344
374
|
};
|
|
375
|
+
/** Internal interaction surface handling pane clicks, the selection box, and pan gestures. */
|
|
345
376
|
declare const Pane: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<PaneProps>) => JSX.Element;
|
|
346
377
|
//#endregion
|
|
347
378
|
//#region src/components/container/Panel.d.ts
|
|
@@ -354,9 +385,11 @@ type PanelProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
|
354
385
|
readonly "data-testid"?: string;
|
|
355
386
|
readonly "data-message"?: string;
|
|
356
387
|
};
|
|
388
|
+
/** Positioned overlay container for UI placed above the flow (used by `Controls`, `MiniMap`, attribution). */
|
|
357
389
|
declare const Panel: (props: ParentProps<PanelProps>) => JSX.Element;
|
|
358
390
|
//#endregion
|
|
359
391
|
//#region src/components/container/ViewportPortal.d.ts
|
|
392
|
+
/** Portals children into graph coordinate space so they pan and zoom with the viewport. */
|
|
360
393
|
declare const ViewportPortal: (props: ParentProps) => JSX.Element;
|
|
361
394
|
//#endregion
|
|
362
395
|
//#region src/components/container/Zoom.d.ts
|
|
@@ -377,15 +410,19 @@ type ZoomProps = {
|
|
|
377
410
|
readonly paneClickDistance: number;
|
|
378
411
|
readonly selectionOnDrag?: boolean;
|
|
379
412
|
};
|
|
413
|
+
/** Internal viewport controller wiring pan/zoom gestures (XYPanZoom) to the flow. */
|
|
380
414
|
declare const Zoom: (props: ParentProps<ZoomProps>) => JSX.Element;
|
|
381
415
|
//#endregion
|
|
382
416
|
//#region src/components/edge/BaseEdge.d.ts
|
|
417
|
+
/** Lowest-level edge primitive: renders the SVG path, label, and interaction width. */
|
|
383
418
|
declare const BaseEdge: (props: ParentProps<BaseEdgeProps>) => JSX.Element;
|
|
384
419
|
//#endregion
|
|
385
420
|
//#region src/components/edge/BezierEdge.d.ts
|
|
421
|
+
/** Built-in bezier edge component. */
|
|
386
422
|
declare const BezierEdge: (props: BezierEdgeProps) => JSX.Element;
|
|
387
423
|
//#endregion
|
|
388
424
|
//#region src/components/edge/BezierEdgeInternal.d.ts
|
|
425
|
+
/** Renderer-internal bezier edge variant. */
|
|
389
426
|
declare const BezierEdgeInternal: (props: BezierEdgeProps) => JSX.Element;
|
|
390
427
|
//#endregion
|
|
391
428
|
//#region src/components/edge/EdgeLabel.d.ts
|
|
@@ -398,9 +435,11 @@ type EdgeLabelProps = {
|
|
|
398
435
|
readonly transparent?: boolean;
|
|
399
436
|
readonly style?: JSX.CSSProperties;
|
|
400
437
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
438
|
+
/** Renders an edge label positioned in graph coordinates. */
|
|
401
439
|
declare const EdgeLabel: (props: ParentProps<EdgeLabelProps>) => JSX.Element;
|
|
402
440
|
//#endregion
|
|
403
441
|
//#region src/components/edge/EdgeLabelRenderer.d.ts
|
|
442
|
+
/** Portals edge labels into a shared HTML layer rendered above the edge SVG. */
|
|
404
443
|
declare const EdgeLabelRenderer: (props: ParentProps) => JSX.Element;
|
|
405
444
|
//#endregion
|
|
406
445
|
//#region src/components/edge/EdgeReconnectAnchor.d.ts
|
|
@@ -412,30 +451,38 @@ type EdgeReconnectAnchorProps = {
|
|
|
412
451
|
readonly size?: number;
|
|
413
452
|
readonly reconnecting?: boolean;
|
|
414
453
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
454
|
+
/** Grab area that lets an edge end be dragged off its handle and reconnected. */
|
|
415
455
|
declare const EdgeReconnectAnchor: (props: ParentProps<EdgeReconnectAnchorProps>) => JSX.Element;
|
|
416
456
|
//#endregion
|
|
417
457
|
//#region src/components/edge/EdgeWrapper.d.ts
|
|
418
458
|
type EdgeWrapperProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
|
|
419
459
|
readonly edgeId: string;
|
|
420
460
|
};
|
|
461
|
+
/** Internal per-edge wrapper: interaction, a11y, viewport culling, and the dynamic edge component. */
|
|
421
462
|
declare const EdgeWrapper: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeWrapperProps<EdgeType>) => JSX.Element;
|
|
422
463
|
//#endregion
|
|
423
464
|
//#region src/components/edge/SmoothStepEdge.d.ts
|
|
465
|
+
/** Built-in smooth-step edge component. */
|
|
424
466
|
declare const SmoothStepEdge: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
425
467
|
//#endregion
|
|
426
468
|
//#region src/components/edge/SmoothStepEdgeInternal.d.ts
|
|
469
|
+
/** Renderer-internal smooth-step edge variant. */
|
|
427
470
|
declare const SmoothStepEdgeInternal: (props: SmoothStepEdgeProps) => JSX.Element;
|
|
428
471
|
//#endregion
|
|
429
472
|
//#region src/components/edge/StepEdge.d.ts
|
|
473
|
+
/** Built-in step edge component. */
|
|
430
474
|
declare const StepEdge: (props: StepEdgeProps) => JSX.Element;
|
|
431
475
|
//#endregion
|
|
432
476
|
//#region src/components/edge/StepEdgeInternal.d.ts
|
|
477
|
+
/** Renderer-internal step edge variant. */
|
|
433
478
|
declare const StepEdgeInternal: (props: StepEdgeProps) => JSX.Element;
|
|
434
479
|
//#endregion
|
|
435
480
|
//#region src/components/edge/StraightEdge.d.ts
|
|
481
|
+
/** Built-in straight edge component. */
|
|
436
482
|
declare const StraightEdge: (props: StraightEdgeProps) => JSX.Element;
|
|
437
483
|
//#endregion
|
|
438
484
|
//#region src/components/edge/StraightEdgeInternal.d.ts
|
|
485
|
+
/** Renderer-internal straight edge variant. */
|
|
439
486
|
declare const StraightEdgeInternal: (props: Omit<StraightEdgeProps, "sourcePosition" | "targetPosition">) => JSX.Element;
|
|
440
487
|
//#endregion
|
|
441
488
|
//#region src/components/handle/Handle.d.ts
|
|
@@ -446,6 +493,7 @@ type HandleProps$1 = Omit<HandleProps, "position"> & {
|
|
|
446
493
|
readonly onConnect?: (connections: Connection$1[]) => void;
|
|
447
494
|
readonly onDisconnect?: (connections: Connection$1[]) => void;
|
|
448
495
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
496
|
+
/** Connection point on a node; place inside custom nodes to make them connectable. */
|
|
449
497
|
declare const Handle: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<HandleProps$1>) => JSX.Element;
|
|
450
498
|
//#endregion
|
|
451
499
|
//#region src/components/marker/Marker.d.ts
|
|
@@ -453,20 +501,25 @@ type MarkerProps$1 = MarkerProps & {
|
|
|
453
501
|
readonly markerUnits?: "strokeWidth" | "userSpaceOnUse";
|
|
454
502
|
readonly strokeWidth?: number;
|
|
455
503
|
};
|
|
504
|
+
/** Internal SVG `<marker>` definition for one edge marker configuration. */
|
|
456
505
|
declare const Marker: (props: MarkerProps$1) => JSX.Element;
|
|
457
506
|
//#endregion
|
|
458
507
|
//#region src/components/marker/MarkerDefinition.d.ts
|
|
508
|
+
/** Internal collector rendering every unique edge marker into one SVG defs block. */
|
|
459
509
|
declare const MarkerDefinition: () => JSX.Element;
|
|
460
510
|
//#endregion
|
|
461
511
|
//#region src/components/node/DefaultNode.d.ts
|
|
512
|
+
/** Built-in default node: label with source and target handles. */
|
|
462
513
|
declare const DefaultNode: (props: NodeProps<{
|
|
463
514
|
label: string;
|
|
464
515
|
}, "default">) => JSX.Element;
|
|
465
516
|
//#endregion
|
|
466
517
|
//#region src/components/node/GroupNode.d.ts
|
|
518
|
+
/** Built-in group node: a plain container for child nodes. */
|
|
467
519
|
declare const GroupNode: (props: NodeProps<Record<string, never>>) => JSX.Element;
|
|
468
520
|
//#endregion
|
|
469
521
|
//#region src/components/node/InputNode.d.ts
|
|
522
|
+
/** Built-in input node: label with a source handle only. */
|
|
470
523
|
declare const InputNode: (props: NodeProps<{
|
|
471
524
|
label: string;
|
|
472
525
|
}>) => JSX.Element;
|
|
@@ -477,15 +530,18 @@ type NodeWrapperProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
|
|
|
477
530
|
readonly resizeObserver: ResizeObserver | undefined;
|
|
478
531
|
readonly nodeClickDistance: number;
|
|
479
532
|
};
|
|
533
|
+
/** Internal per-node wrapper: dragging, selection, a11y, measurement, viewport culling, and the dynamic node component. */
|
|
480
534
|
declare const NodeWrapper: <NodeType extends Node = Node>(props: NodeWrapperProps<NodeType>) => JSX.Element;
|
|
481
535
|
//#endregion
|
|
482
536
|
//#region src/components/node/OutputNode.d.ts
|
|
537
|
+
/** Built-in output node: label with a target handle only. */
|
|
483
538
|
declare const OutputNode: (props: NodeProps<{
|
|
484
539
|
label: string;
|
|
485
540
|
}>) => JSX.Element;
|
|
486
541
|
//#endregion
|
|
487
542
|
//#region src/components/selection/NodeSelection.d.ts
|
|
488
543
|
type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
|
|
544
|
+
/** Internal draggable bounding box rendered around multi-selected nodes. */
|
|
489
545
|
declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
|
|
490
546
|
//#endregion
|
|
491
547
|
//#region src/components/selection/Selection.d.ts
|
|
@@ -496,9 +552,11 @@ type SelectionProps = {
|
|
|
496
552
|
readonly height?: number | string;
|
|
497
553
|
readonly isVisible?: boolean;
|
|
498
554
|
};
|
|
555
|
+
/** Internal selection-rectangle visual. */
|
|
499
556
|
declare const Selection: (props: SelectionProps) => JSX.Element;
|
|
500
557
|
//#endregion
|
|
501
558
|
//#region src/core/flowProps.d.ts
|
|
559
|
+
/** Initial (uncontrolled) values used to seed a flow before the first measure/fit. */
|
|
502
560
|
type SolidFlowInitialProps = {
|
|
503
561
|
readonly initialNodes: Node[];
|
|
504
562
|
readonly initialEdges: Edge[];
|
|
@@ -507,6 +565,10 @@ type SolidFlowInitialProps = {
|
|
|
507
565
|
readonly fitView: boolean;
|
|
508
566
|
readonly nodeOrigin: NodeOrigin$1;
|
|
509
567
|
};
|
|
568
|
+
/**
|
|
569
|
+
* Props accepted by the `SolidFlow` component — the full configuration surface
|
|
570
|
+
* of a flow, and the config contract of the headless core (`createFlowState`).
|
|
571
|
+
*/
|
|
510
572
|
type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = NodeEvents<NodeType> & NodeSelectionEvents<NodeType> & EdgeEvents<EdgeType> & DeleteEvents<NodeType, EdgeType> & PaneEvents & {
|
|
511
573
|
/**
|
|
512
574
|
* The id of the flow. This is necessary if you want to render multiple flows.
|
|
@@ -896,7 +958,7 @@ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>
|
|
|
896
958
|
* before doing so.
|
|
897
959
|
*/
|
|
898
960
|
readonly proOptions?: ProOptions$1;
|
|
899
|
-
readonly isValidConnection?: IsValidConnection$
|
|
961
|
+
readonly isValidConnection?: IsValidConnection$2<EdgeType>;
|
|
900
962
|
/** This event handler is called when the user begins to pan or zoom the viewport */
|
|
901
963
|
readonly onMoveStart?: OnMoveStart$1;
|
|
902
964
|
/** This event handler is called when the user pans or zooms the viewport */
|
|
@@ -944,11 +1006,11 @@ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>
|
|
|
944
1006
|
/** This event handler gets called when the selected nodes & edges change */
|
|
945
1007
|
readonly onSelectionChange?: OnSelectionChange<NodeType, EdgeType>;
|
|
946
1008
|
/** This event handler gets called when a user starts to drag a selection box. */
|
|
947
|
-
readonly onSelectionDragStart?: OnSelectionDrag$
|
|
1009
|
+
readonly onSelectionDragStart?: OnSelectionDrag$2<NodeType>;
|
|
948
1010
|
/** This event handler gets called when a user drags a selection box. */
|
|
949
|
-
readonly onSelectionDrag?: OnSelectionDrag$
|
|
1011
|
+
readonly onSelectionDrag?: OnSelectionDrag$2<NodeType>;
|
|
950
1012
|
/** This event handler gets called when a user stops dragging a selection box. */
|
|
951
|
-
readonly onSelectionDragStop?: OnSelectionDrag$
|
|
1013
|
+
readonly onSelectionDragStop?: OnSelectionDrag$2<NodeType>;
|
|
952
1014
|
/** This event handler gets called when the user starts to drag a selection box */
|
|
953
1015
|
readonly onSelectionStart?: (event: PointerEvent) => void;
|
|
954
1016
|
/** This event handler gets called when the user finishes dragging a selection box */
|
|
@@ -962,9 +1024,11 @@ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>
|
|
|
962
1024
|
//#endregion
|
|
963
1025
|
//#region src/components/SolidFlow/component.d.ts
|
|
964
1026
|
type SolidFlowComponentProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ParentProps<SolidFlowProps<NodeType, EdgeType>> & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style" | "onselectionchange" | "onSelectionChange">;
|
|
1027
|
+
/** The flow canvas component: renders nodes and edges and wires up viewport and interactions. */
|
|
965
1028
|
declare const SolidFlow: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: SolidFlowComponentProps<NodeType, EdgeType>) => JSX.Element;
|
|
966
1029
|
//#endregion
|
|
967
1030
|
//#region src/components/SolidFlow/provider.d.ts
|
|
1031
|
+
/** Hoists flow state above `SolidFlow` so hooks work outside the component (multi-panel UIs). */
|
|
968
1032
|
declare const SolidFlowProvider: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<SolidFlowProps<NodeType, EdgeType>>) => JSX.Element;
|
|
969
1033
|
//#endregion
|
|
970
1034
|
//#region src/core/createEdgeStore.d.ts
|
|
@@ -1060,6 +1124,7 @@ declare const createEdgeStore: <TUserEdgeTypes extends EdgeTypes = Record<string
|
|
|
1060
1124
|
* `${nodeId}` · `${nodeId}-${type}` · `${nodeId}-${type}-${handleId}`
|
|
1061
1125
|
*/
|
|
1062
1126
|
declare const connectionKey: (nodeId: string, type?: HandleType, handleId?: string | null) => string;
|
|
1127
|
+
/** The connections index: a handle's `connectionKey` mapped to its live `HandleConnection`s. */
|
|
1063
1128
|
type ConnectionsRecord = Record<string, Record<string, HandleConnection$1>>;
|
|
1064
1129
|
//#endregion
|
|
1065
1130
|
//#region src/core/flowState.d.ts
|
|
@@ -1329,6 +1394,7 @@ declare function useEdges<EdgeType extends Edge = Edge>(): Accessor<EdgeType[]>;
|
|
|
1329
1394
|
declare function useViewport(): Accessor<Viewport$1>;
|
|
1330
1395
|
//#endregion
|
|
1331
1396
|
//#region src/hooks/useHandleEdgeSelect.d.ts
|
|
1397
|
+
/** Returns a callback applying edge-selection semantics for the given edge id. */
|
|
1332
1398
|
declare function useHandleEdgeSelect(): (id: string) => void;
|
|
1333
1399
|
//#endregion
|
|
1334
1400
|
//#region src/hooks/useInitialized.d.ts
|
|
@@ -1390,6 +1456,7 @@ type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
|
|
|
1390
1456
|
* @returns A memo with an array of data objects
|
|
1391
1457
|
*/
|
|
1392
1458
|
declare function useNodesData<NodeType extends Node = Node>(nodeId: Accessor<string | undefined | null>): Accessor<NodeData<NodeType> | undefined>;
|
|
1459
|
+
/** Reactive accessor for the `data` of one or many nodes by id. */
|
|
1393
1460
|
declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<string[] | undefined | null>): Accessor<NodeData<NodeType>[]>;
|
|
1394
1461
|
//#endregion
|
|
1395
1462
|
//#region src/hooks/useSolidFlow.d.ts
|
|
@@ -1453,9 +1520,11 @@ declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edg
|
|
|
1453
1520
|
declare function useUpdateNodeInternals(): UpdateNodeInternals;
|
|
1454
1521
|
//#endregion
|
|
1455
1522
|
//#region src/plugins/background/types.d.ts
|
|
1523
|
+
/** Available background pattern styles. */
|
|
1456
1524
|
type BackgroundVariant = "lines" | "dots" | "cross";
|
|
1457
1525
|
//#endregion
|
|
1458
1526
|
//#region src/plugins/background/Background.d.ts
|
|
1527
|
+
/** Props for the `Background` plugin. */
|
|
1459
1528
|
type BackgroundProps = {
|
|
1460
1529
|
readonly id?: string;
|
|
1461
1530
|
/** Variant of the pattern
|
|
@@ -1479,6 +1548,7 @@ type BackgroundProps = {
|
|
|
1479
1548
|
/** Style applied to the container */
|
|
1480
1549
|
readonly style?: JSX.CSSProperties;
|
|
1481
1550
|
};
|
|
1551
|
+
/** Canvas background pattern (lines, dots, or cross) rendered beneath the graph. */
|
|
1482
1552
|
declare const Background: (props: BackgroundProps) => JSX.Element;
|
|
1483
1553
|
//#endregion
|
|
1484
1554
|
//#region src/plugins/controls/ControlButton.d.ts
|
|
@@ -1491,6 +1561,7 @@ type ControlButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onC
|
|
|
1491
1561
|
readonly borderColor?: string;
|
|
1492
1562
|
readonly onClick?: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
|
|
1493
1563
|
};
|
|
1564
|
+
/** A styled button for use inside `Controls`. */
|
|
1494
1565
|
declare const ControlButton: (props: ParentProps<ControlButtonProps>) => JSX.Element;
|
|
1495
1566
|
//#endregion
|
|
1496
1567
|
//#region src/plugins/controls/Controls.d.ts
|
|
@@ -1518,6 +1589,7 @@ type ControlsProps = {
|
|
|
1518
1589
|
readonly beforeControls?: JSX.Element;
|
|
1519
1590
|
readonly afterControls?: JSX.Element;
|
|
1520
1591
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
|
|
1592
|
+
/** Viewport control panel: zoom in/out, fit view, and interactivity lock. */
|
|
1521
1593
|
declare const Controls: (props: ParentProps<ControlsProps>) => JSX.Element;
|
|
1522
1594
|
//#endregion
|
|
1523
1595
|
//#region src/plugins/minimap/MiniMap.d.ts
|
|
@@ -1561,6 +1633,7 @@ type MiniMapProps<NodeType extends Node> = Omit<JSX.HTMLAttributes<HTMLDivElemen
|
|
|
1561
1633
|
/** Step size for zooming in/out */
|
|
1562
1634
|
readonly zoomStep?: number;
|
|
1563
1635
|
};
|
|
1636
|
+
/** Miniature overview map of the whole flow, with optional pan/zoom interaction. */
|
|
1564
1637
|
declare const MiniMap: <NodeType extends Node>(props: ParentProps<Partial<MiniMapProps<NodeType>>>) => JSX.Element;
|
|
1565
1638
|
//#endregion
|
|
1566
1639
|
//#region src/plugins/nodeResizer/NodeResizer.d.ts
|
|
@@ -1600,6 +1673,7 @@ type NodeResizerProps = {
|
|
|
1600
1673
|
/** Callback called when resizing ends */
|
|
1601
1674
|
readonly onResizeEnd?: OnResizeEnd$1;
|
|
1602
1675
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
|
|
1676
|
+
/** Resize handles and lines around a node; place inside a custom node to make it resizable. */
|
|
1603
1677
|
declare const NodeResizer: (props: Partial<NodeResizerProps>) => JSX.Element;
|
|
1604
1678
|
//#endregion
|
|
1605
1679
|
//#region src/plugins/nodeResizer/ResizeControl.d.ts
|
|
@@ -1617,9 +1691,11 @@ type ResizeControlProps = NodeResizerSubProps & {
|
|
|
1617
1691
|
readonly color?: string;
|
|
1618
1692
|
readonly style?: JSX.CSSProperties;
|
|
1619
1693
|
} & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
|
|
1694
|
+
/** A single resize handle or line — the building block of `NodeResizer`. */
|
|
1620
1695
|
declare const ResizeControl: <NodeType extends Node = Node>(props: ParentProps<ResizeControlProps>) => JSX.Element;
|
|
1621
1696
|
//#endregion
|
|
1622
1697
|
//#region src/plugins/toolbar/EdgeToolbar.d.ts
|
|
1698
|
+
/** Props for the `EdgeToolbar` plugin. */
|
|
1623
1699
|
type EdgeToolbarProps = EdgeToolbarBaseProps & {
|
|
1624
1700
|
/** If `true`, clicking the toolbar selects the edge it belongs to. */
|
|
1625
1701
|
readonly selectEdgeOnClick?: boolean;
|
|
@@ -1634,6 +1710,7 @@ type EdgeToolbarProps = EdgeToolbarBaseProps & {
|
|
|
1634
1710
|
declare const EdgeToolbar: (props: ParentProps<EdgeToolbarProps>) => JSX.Element;
|
|
1635
1711
|
//#endregion
|
|
1636
1712
|
//#region src/plugins/toolbar/NodeToolbar.d.ts
|
|
1713
|
+
/** Props for the `NodeToolbar` plugin. */
|
|
1637
1714
|
type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
1638
1715
|
/** The id of the node, or array of ids the toolbar should be displayed at */
|
|
1639
1716
|
readonly nodeId: string | string[];
|
|
@@ -1653,6 +1730,98 @@ type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
|
1653
1730
|
/** Style of the toolbar */
|
|
1654
1731
|
readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
|
|
1655
1732
|
};
|
|
1733
|
+
/** Toolbar attached to a node, rendered above the graph so it does not scale with zoom. */
|
|
1656
1734
|
declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
|
|
1657
1735
|
//#endregion
|
|
1658
|
-
|
|
1736
|
+
//#region src/types/system.d.ts
|
|
1737
|
+
/** Alignment of an attached element (e.g. a toolbar) along its side: 'start' | 'center' | 'end'. */
|
|
1738
|
+
type Align = Align$1;
|
|
1739
|
+
/** Configurable UI strings and ARIA descriptions (localization / a11y overrides). */
|
|
1740
|
+
type AriaLabelConfig = AriaLabelConfig$1;
|
|
1741
|
+
/** Options controlling bezier edge path curvature. */
|
|
1742
|
+
type BezierPathOptions = BezierPathOptions$1;
|
|
1743
|
+
/** A rectangle expressed as top-left position plus bottom-right extent. */
|
|
1744
|
+
type Box = Box$1;
|
|
1745
|
+
/** Color scheme for the flow: an explicit class or 'system' (media-query resolved). */
|
|
1746
|
+
type ColorMode = ColorMode$1;
|
|
1747
|
+
/** A resolved color scheme class: 'light' | 'dark'. */
|
|
1748
|
+
type ColorModeClass = ColorModeClass$1;
|
|
1749
|
+
/** A width/height pair. */
|
|
1750
|
+
type Dimensions = Dimensions$1;
|
|
1751
|
+
/** An edge marker reference: a marker type string or a full `EdgeMarker` config. */
|
|
1752
|
+
type EdgeMarkerType = EdgeMarkerType$1;
|
|
1753
|
+
/** Options for fitting the viewport to a set of bounds. */
|
|
1754
|
+
type FitBoundsOptions = FitBoundsOptions$1;
|
|
1755
|
+
/** Parameters accepted by `getBezierPath`. */
|
|
1756
|
+
type GetBezierPathParams = GetBezierPathParams$1;
|
|
1757
|
+
/** Parameters accepted by `getSmoothStepPath`. */
|
|
1758
|
+
type GetSmoothStepPathParams = GetSmoothStepPathParams$1;
|
|
1759
|
+
/** Parameters accepted by `getStraightPath`. */
|
|
1760
|
+
type GetStraightPathParams = GetStraightPathParams$1;
|
|
1761
|
+
/** Predicate deciding whether a pending connection may become an edge. */
|
|
1762
|
+
type IsValidConnection<EdgeType extends EdgeBase = EdgeBase> = IsValidConnection$1<EdgeType>;
|
|
1763
|
+
/** Handler called when a connection successfully completes. */
|
|
1764
|
+
type OnConnect = OnConnect$1;
|
|
1765
|
+
/** Handler called when a connection gesture ends (whether or not an edge was made). */
|
|
1766
|
+
type OnConnectEnd<NodeType extends NodeBase = NodeBase> = OnConnectEnd$1<NodeType>;
|
|
1767
|
+
/** Handler called when a user starts dragging a connection from a handle. */
|
|
1768
|
+
type OnConnectStart = OnConnectStart$1;
|
|
1769
|
+
/** The handle a connection gesture started from. */
|
|
1770
|
+
type OnConnectStartParams = OnConnectStartParams$1;
|
|
1771
|
+
/** Handler for internal, non-fatal flow errors (logged instead of thrown). */
|
|
1772
|
+
type OnError = OnError$1;
|
|
1773
|
+
/** Handler called when the user starts panning or zooming the viewport. */
|
|
1774
|
+
type OnMoveStart = OnMove$1;
|
|
1775
|
+
/** Handler called when the user stops panning or zooming the viewport. */
|
|
1776
|
+
type OnMoveEnd = OnMove$1;
|
|
1777
|
+
/** Handler called after an edge has been reconnected to a different handle. */
|
|
1778
|
+
type OnReconnect<EdgeType extends EdgeBase = EdgeBase> = OnReconnect$1<EdgeType>;
|
|
1779
|
+
/** Handler called when an edge reconnection gesture ends. */
|
|
1780
|
+
type OnReconnectEnd<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = OnReconnectEnd$1<NodeType, EdgeType>;
|
|
1781
|
+
/** Handler called when the user starts dragging an edge end off its handle. */
|
|
1782
|
+
type OnReconnectStart<EdgeType extends EdgeBase = EdgeBase> = OnReconnectStart$1<EdgeType>;
|
|
1783
|
+
/** Handler called while a node is being resized. */
|
|
1784
|
+
type OnResize = OnResize$1;
|
|
1785
|
+
/** Handler called when a node resize gesture ends. */
|
|
1786
|
+
type OnResizeEnd = OnResizeEnd$1;
|
|
1787
|
+
/** Handler called when a node resize gesture starts. */
|
|
1788
|
+
type OnResizeStart = OnResizeStart$1;
|
|
1789
|
+
/** Handler called while a selection of nodes is dragged. */
|
|
1790
|
+
type OnSelectionDrag<NodeType extends NodeBase = NodeBase> = OnSelectionDrag$1<NodeType>;
|
|
1791
|
+
/** Pro/attribution options (`hideAttribution`). */
|
|
1792
|
+
type ProOptions = ProOptions$1;
|
|
1793
|
+
/** A rectangle: position plus dimensions. */
|
|
1794
|
+
type Rect = Rect$1;
|
|
1795
|
+
/** The drag event delivered to resize handlers. */
|
|
1796
|
+
type ResizeDragEvent = ResizeDragEvent$1;
|
|
1797
|
+
/** Geometry of a resize step: position and dimensions. */
|
|
1798
|
+
type ResizeParams = ResizeParams$1;
|
|
1799
|
+
/** Resize geometry plus the direction of the drag. */
|
|
1800
|
+
type ResizeParamsWithDirection = ResizeParamsWithDirection$1;
|
|
1801
|
+
/** The user-drawn selection rectangle in flow coordinates. */
|
|
1802
|
+
type SelectionRect = SelectionRect$1;
|
|
1803
|
+
/** Options for `setCenter`: zoom and transition behavior. */
|
|
1804
|
+
type SetCenterOptions = SetCenterOptions$1;
|
|
1805
|
+
/** Options controlling smooth-step edge path geometry. */
|
|
1806
|
+
type SmoothStepPathOptions = SmoothStepPathOptions$1;
|
|
1807
|
+
/** Grid nodes snap to while dragging: `[x, y]` step sizes. */
|
|
1808
|
+
type SnapGrid = SnapGrid$1;
|
|
1809
|
+
/** The viewport transform as `[translateX, translateY, zoom]`. */
|
|
1810
|
+
type Transform = Transform$1;
|
|
1811
|
+
/** Common options for viewport helper functions (e.g. transition duration). */
|
|
1812
|
+
type ViewportHelperFunctionOptions = ViewportHelperFunctionOptions$1;
|
|
1813
|
+
/** An x/y position with a z-index. */
|
|
1814
|
+
type XYZPosition = XYZPosition$1;
|
|
1815
|
+
/**
|
|
1816
|
+
* How drag-selection decides membership: 'full' requires nodes to be fully
|
|
1817
|
+
* inside the selection box, 'partial' selects on any overlap.
|
|
1818
|
+
*/
|
|
1819
|
+
declare const SelectionMode: typeof SelectionMode$1;
|
|
1820
|
+
/** See {@link SelectionMode}. */
|
|
1821
|
+
type SelectionMode = SelectionMode$1;
|
|
1822
|
+
/** Returns the center `[x, y]` of a straight edge between two points. */
|
|
1823
|
+
declare const getEdgeCenter: typeof getEdgeCenter$1;
|
|
1824
|
+
/** Returns the label center and offsets for a bezier edge. */
|
|
1825
|
+
declare const getBezierEdgeCenter: typeof getBezierEdgeCenter$1;
|
|
1826
|
+
//#endregion
|
|
1827
|
+
export { Align, AriaLabelConfig, Background, type BackgroundProps, type BackgroundVariant, BaseEdge, BezierEdge, BezierEdgeInternal, type BezierEdgeProps, BezierPathOptions, Box, type BuiltInEdge, type BuiltInNode, type BuiltInNodeTypes, ColorMode, ColorModeClass, type Connection, ConnectionData, ConnectionLine, ConnectionLineComponentProps, ConnectionLineType, ConnectionMode, type ConnectionsRecord, ControlButton, type ControlLinePosition, type ControlPosition, Controls, type CoordinateExtent, type DefaultEdgeOptions, DefaultNode, DeleteEvents, Dimensions, type Edge, EdgeConnection, EdgeEvents, EdgeLabel, EdgeLabelRenderer, type EdgeMarker, EdgeMarkerType, type EdgeProps, EdgeReconnectAnchor, EdgeReconnectEvents, EdgeRenderer, EdgeToolbar, EdgeToolbarProps, type EdgeTypes, EdgeWrapper, type FitBounds, FitBoundsOptions, FitViewOptions, type FlowCommands, type FlowSelection, type FlowState, GetBezierPathParams, GetSmoothStepPathParams, 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, OnConnect, OnConnectEnd, OnConnectStart, OnConnectStartParams, OnDelete, OnEdgeConnect, OnEdgeCreate, OnError, type OnMove, OnMoveEnd, OnMoveStart, OnReconnect, OnReconnectEnd, OnReconnectStart, OnResize, OnResizeEnd, OnResizeStart, OnSelectionChange, OnSelectionDrag, OutputNode, PanOnScrollMode, Pane, PaneEvents, Panel, type PanelPosition, Position, ProOptions, Rect, ResizeControl, ResizeControlVariant, ResizeDragEvent, ResizeParams, ResizeParamsWithDirection, Selection, SelectionMode, SelectionRect, type SetCenter, SetCenterOptions, type SetViewport, ShortcutModifier, ShortcutModifierDefinition, type ShouldResize, SmoothStepEdge, SmoothStepEdgeInternal, type SmoothStepEdgeProps, SmoothStepPathOptions, SnapGrid, SolidFlow, type SolidFlowInitialProps, type SolidFlowProps, SolidFlowProvider, StepEdge, StepEdgeInternal, type StepEdgeProps, StraightEdge, StraightEdgeInternal, type StraightEdgeProps, Transform, UseSolidFlowReturn, Viewport, ViewportHelperFunctionOptions, ViewportPortal, type XYPosition, XYZPosition, Zoom, addEdge, connectionKey, 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 };
|
package/dist/index/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dynamic, Portal, addEvent, claimElement, className, createComponent, delegateEvents, effect, insert, isServer, memo, mergeProps, ref, setAttribute, setStyleProperty, spread, style, template } from "@solidjs/web";
|
|
2
|
-
import { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, Position as Position$1, ResizeControlVariant, SelectionMode
|
|
2
|
+
import { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, Position as Position$1, ResizeControlVariant, SelectionMode as SelectionMode$1, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, addEdge as addEdge$1, areConnectionMapsEqual, calcAutoPan, calculateNodePosition, clampPosition, clampPositionToParent, createDevWarn, createMarkerIds, elementSelectionKeys, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter as getBezierEdgeCenter$1, getBezierPath, getBezierPath as getBezierPath$1, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter as getEdgeCenter$1, getEdgePosition, getEdgeToolbarTransform, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesBounds as getNodesBounds$1, getNodesInside, getOutgoers, getOverlappingArea, getSmoothStepPath, getSmoothStepPath as getSmoothStepPath$1, getStraightPath, getStraightPath as getStraightPath$1, getViewportForBounds, getViewportForBounds as getViewportForBounds$1, handleConnectionChange, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isInputDOMNode, isMacOs, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToRect, panBy, pointToRendererPoint, rendererPointToPoint, shallowNodeData, snapPosition } from "@xyflow/system";
|
|
3
3
|
import { For, Show, createContext, createEffect, createMemo, createProjection, createSignal, createStore, flush, mapArray, merge, omit, onCleanup, onSettled, snapshot, untrack, useContext } from "solid-js";
|
|
4
4
|
import { createMediaQuery } from "@solid-primitives/media";
|
|
5
5
|
import { createEventListener, createEventListenerMap } from "@solid-primitives/event-listener";
|
|
@@ -75,6 +75,7 @@ const getEdgeId = (connection) => {
|
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/components/edge/EdgeLabel.tsx
|
|
77
77
|
var _tmpl$$34 = /* @__PURE__ */ template("<div>");
|
|
78
|
+
/** Renders an edge label positioned in graph coordinates. */
|
|
78
79
|
const EdgeLabel = (props) => {
|
|
79
80
|
let _props = propDefaults(props, {
|
|
80
81
|
x: 0,
|
|
@@ -115,6 +116,7 @@ const EdgeLabel = (props) => {
|
|
|
115
116
|
//#endregion
|
|
116
117
|
//#region src/components/edge/BaseEdge.tsx
|
|
117
118
|
var _tmpl$$33 = /* @__PURE__ */ template("<svg><path></svg>", 2), _tmpl$2$4 = /* @__PURE__ */ template("<svg><path stroke-opacity=0 fill=none class=solid-flow__edge-interaction></svg>", 2);
|
|
119
|
+
/** Lowest-level edge primitive: renders the SVG path, label, and interaction width. */
|
|
118
120
|
const BaseEdge = (props) => {
|
|
119
121
|
let _props = propDefaults(props, { interactionWidth: 20 }), rest = omit(_props, "class", "style", "path", "interactionWidth", "label", "labelStyle", "labelX", "labelY", "markerStart", "markerEnd");
|
|
120
122
|
return [
|
|
@@ -273,6 +275,7 @@ const BaseEdge = (props) => {
|
|
|
273
275
|
//#endregion
|
|
274
276
|
//#region src/components/edge/EdgeReconnectAnchor.tsx
|
|
275
277
|
var _tmpl$$32 = /* @__PURE__ */ template("<div style=background:transparent;border:none;cursor:move>");
|
|
278
|
+
/** Grab area that lets an edge end be dragged off its handle and reconnected. */
|
|
276
279
|
const EdgeReconnectAnchor = (props) => {
|
|
277
280
|
let _props = propDefaults(props, {
|
|
278
281
|
size: 25,
|
|
@@ -1420,6 +1423,7 @@ const createLayoutedEdges = (source) => {
|
|
|
1420
1423
|
//#endregion
|
|
1421
1424
|
//#region src/components/edge/EdgeWrapper.tsx
|
|
1422
1425
|
var _tmpl$$30 = /* @__PURE__ */ template("<svg class=solid-flow__edge-wrapper><g>");
|
|
1426
|
+
/** Internal per-edge wrapper: interaction, a11y, viewport culling, and the dynamic edge component. */
|
|
1423
1427
|
const EdgeWrapper = (props) => {
|
|
1424
1428
|
let edgeRef, { store, actions } = useInternalSolidFlow(), edgeId = () => props.edgeId, edge = () => actions.getEdge(edgeId()), edgeType = () => edge().type ?? "default", selectable = () => edge().selectable ?? store.elementsSelectable, focusable = () => edge().focusable ?? store.edgesFocusable, edgeComponent = () => store.edgeTypes[edgeType()], markerStartUrl = () => edge().markerStart ? `url('#${getMarkerId(edge().markerStart, store.id)}')` : void 0, markerEndUrl = () => edge().markerEnd ? `url('#${getMarkerId(edge().markerEnd, store.id)}')` : void 0, onClick = (event) => {
|
|
1425
1429
|
selectable() && actions.handleEdgeSelection(edgeId()), props.onEdgeClick?.({
|
|
@@ -1854,6 +1858,7 @@ function useNodeConnectable() {
|
|
|
1854
1858
|
//#endregion
|
|
1855
1859
|
//#region src/components/handle/Handle.tsx
|
|
1856
1860
|
var _tmpl$$29 = /* @__PURE__ */ template("<div>");
|
|
1861
|
+
/** Connection point on a node; place inside custom nodes to make them connectable. */
|
|
1857
1862
|
const Handle = (props) => {
|
|
1858
1863
|
let _props = propDefaults(props, {
|
|
1859
1864
|
type: "source",
|
|
@@ -2021,6 +2026,7 @@ const Handle = (props) => {
|
|
|
2021
2026
|
//#endregion
|
|
2022
2027
|
//#region src/components/node/GroupNode.tsx
|
|
2023
2028
|
var _tmpl$$28 = /* @__PURE__ */ template("<div style=position:absolute;left:0;top:0>");
|
|
2029
|
+
/** Built-in group node: a plain container for child nodes. */
|
|
2024
2030
|
const GroupNode = (props) => (() => {
|
|
2025
2031
|
var _el$ = _tmpl$$28();
|
|
2026
2032
|
return effect(() => ({
|
|
@@ -2097,6 +2103,7 @@ function useNodeId() {
|
|
|
2097
2103
|
//#endregion
|
|
2098
2104
|
//#region src/components/node/NodeWrapper.tsx
|
|
2099
2105
|
var _tmpl$$27 = /* @__PURE__ */ template("<div>");
|
|
2106
|
+
/** Internal per-node wrapper: dragging, selection, a11y, measurement, viewport culling, and the dynamic node component. */
|
|
2100
2107
|
const NodeWrapper = (props) => {
|
|
2101
2108
|
let { store, nodeLookup, parentIds, actions } = useInternalSolidFlow(), [nodeRef, setNodeRef] = createSignal(), node = () => nodeLookup.get(props.nodeId), nodeId = () => node().id, nodeType = () => node().type ?? "default", deletable = () => node().deletable ?? !0, selectable = () => node().selectable ?? store.elementsSelectable, focusable = () => node().focusable ?? store.nodesFocusable, draggable = () => node().draggable ?? store.nodesDraggable, connectable = () => node().connectable ?? store.nodesConnectable, userNode = () => node().internals.userNode, nodeTypeValid = () => nodeType() in store.nodeTypes, nodeComponent = () => store.nodeTypes[nodeType()], isParentNode = () => !!parentIds[node().id], transform = () => {
|
|
2102
2109
|
let { x, y } = node().internals.positionAbsolute;
|
|
@@ -2494,6 +2501,7 @@ function useInternalSolidFlow() {
|
|
|
2494
2501
|
//#endregion
|
|
2495
2502
|
//#region src/components/connection/ConnectionLine.tsx
|
|
2496
2503
|
var _tmpl$$26 = /* @__PURE__ */ template("<svg class=\"solid-flow__container solid-flow__connectionline\"><g>"), _tmpl$2$2 = /* @__PURE__ */ template("<svg><path class=solid-flow__connection-path fill=none></svg>", 2);
|
|
2504
|
+
/** Internal component rendering the in-progress connection line. */
|
|
2497
2505
|
const ConnectionLine = (props) => {
|
|
2498
2506
|
let { store } = useInternalSolidFlow(), connectionStatus = () => getConnectionStatus(store.connection.isValid);
|
|
2499
2507
|
return createComponent(Show, {
|
|
@@ -2606,6 +2614,7 @@ const ConnectionLine = (props) => {
|
|
|
2606
2614
|
//#endregion
|
|
2607
2615
|
//#region src/components/marker/Marker.tsx
|
|
2608
2616
|
var _tmpl$$25 = /* @__PURE__ */ template("<svg><polyline class=arrow fill=none stroke-linecap=round stroke-linejoin=round points=\"-5,-4 0,0 -5,4\"></svg>", 2), _tmpl$2$1 = /* @__PURE__ */ template("<svg><marker class=solid-flow__arrowhead viewBox=\"-10 -10 20 20\"refX=0 refY=0></svg>", 2), _tmpl$3$1 = /* @__PURE__ */ template("<svg><polyline class=arrowclosed stroke-linecap=round stroke-linejoin=round points=\"-5,-4 0,0 -5,4 -5,-4\"></svg>", 2);
|
|
2617
|
+
/** Internal SVG `<marker>` definition for one edge marker configuration. */
|
|
2609
2618
|
const Marker = (props) => {
|
|
2610
2619
|
let _props = propDefaults(props, {
|
|
2611
2620
|
markerUnits: "strokeWidth",
|
|
@@ -2651,6 +2660,7 @@ const Marker = (props) => {
|
|
|
2651
2660
|
//#endregion
|
|
2652
2661
|
//#region src/components/marker/MarkerDefinition.tsx
|
|
2653
2662
|
var _tmpl$$24 = /* @__PURE__ */ template("<svg class=solid-flow__marker><defs>");
|
|
2663
|
+
/** Internal collector rendering every unique edge marker into one SVG defs block. */
|
|
2654
2664
|
const MarkerDefinition = () => {
|
|
2655
2665
|
let { store } = useInternalSolidFlow(), markers = createMemo(() => createMarkerIds(store.edges, {
|
|
2656
2666
|
id: store.id,
|
|
@@ -2676,6 +2686,7 @@ const MarkerDefinition = () => {
|
|
|
2676
2686
|
//#endregion
|
|
2677
2687
|
//#region src/components/container/EdgeRenderer.tsx
|
|
2678
2688
|
var _tmpl$$23 = /* @__PURE__ */ template("<div class=solid-flow__edges><!><!>");
|
|
2689
|
+
/** Internal renderer iterating the edge id list into `EdgeWrapper`s. */
|
|
2679
2690
|
const EdgeRenderer = (props) => {
|
|
2680
2691
|
let { store } = useInternalSolidFlow();
|
|
2681
2692
|
var _el$ = _tmpl$$23(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
@@ -2703,6 +2714,7 @@ const EdgeRenderer = (props) => {
|
|
|
2703
2714
|
//#endregion
|
|
2704
2715
|
//#region src/components/container/NodeRenderer.tsx
|
|
2705
2716
|
var _tmpl$$22 = /* @__PURE__ */ template("<div class=\"solid-flow__container solid-flow__nodes\">");
|
|
2717
|
+
/** Internal renderer iterating the node id list into `NodeWrapper`s; owns the shared measurement `ResizeObserver`. */
|
|
2706
2718
|
const NodeRenderer = (props) => {
|
|
2707
2719
|
let { actions, store } = useInternalSolidFlow(), resizeObserver = isServer ? void 0 : new ResizeObserver((entries) => {
|
|
2708
2720
|
actions.requestUpdateNodeInternals(entries.map((entry) => {
|
|
@@ -2907,6 +2919,7 @@ delegateEvents([
|
|
|
2907
2919
|
//#endregion
|
|
2908
2920
|
//#region src/components/container/Panel.tsx
|
|
2909
2921
|
var _tmpl$$20 = /* @__PURE__ */ template("<div>");
|
|
2922
|
+
/** Positioned overlay container for UI placed above the flow (used by `Controls`, `MiniMap`, attribution). */
|
|
2910
2923
|
const Panel = (props) => {
|
|
2911
2924
|
let { store } = useInternalSolidFlow(), _props = propDefaults(props, {
|
|
2912
2925
|
position: "top-right",
|
|
@@ -2957,6 +2970,7 @@ const Viewport = (props) => {
|
|
|
2957
2970
|
//#endregion
|
|
2958
2971
|
//#region src/components/container/Zoom.tsx
|
|
2959
2972
|
var _tmpl$$18 = /* @__PURE__ */ template("<div class=\"solid-flow__container solid-flow__zoom\">");
|
|
2973
|
+
/** Internal viewport controller wiring pan/zoom gestures (XYPanZoom) to the flow. */
|
|
2960
2974
|
const Zoom = (props) => {
|
|
2961
2975
|
let [ref$3, setRef] = createSignal(), { store, actions } = useInternalSolidFlow(), viewPort = () => props.initialViewport || {
|
|
2962
2976
|
x: 0,
|
|
@@ -3021,6 +3035,7 @@ const Zoom = (props) => {
|
|
|
3021
3035
|
//#endregion
|
|
3022
3036
|
//#region src/components/selection/Selection.tsx
|
|
3023
3037
|
var _tmpl$$17 = /* @__PURE__ */ template("<div class=solid-flow__selection>");
|
|
3038
|
+
/** Internal selection-rectangle visual. */
|
|
3024
3039
|
const Selection = (props) => {
|
|
3025
3040
|
let _props = propDefaults(props, { isVisible: !0 }), styles = () => ({
|
|
3026
3041
|
..._props.width != null && { width: typeof _props.width == "string" ? _props.width : toPxString(_props.width) },
|
|
@@ -3042,6 +3057,7 @@ const Selection = (props) => {
|
|
|
3042
3057
|
//#endregion
|
|
3043
3058
|
//#region src/components/selection/NodeSelection.tsx
|
|
3044
3059
|
var _tmpl$$16 = /* @__PURE__ */ template("<div>");
|
|
3060
|
+
/** Internal draggable bounding box rendered around multi-selected nodes. */
|
|
3045
3061
|
const NodeSelection = (props) => {
|
|
3046
3062
|
let { store, nodeLookup, actions } = useInternalSolidFlow(), [ref$2, setRef] = createSignal(), bounds = () => store.selectionRectMode === "nodes" ? getInternalNodesBounds(nodeLookup, { filter: (node) => !!node.selected }) : null;
|
|
3047
3063
|
createEffect(() => ({
|
|
@@ -3248,6 +3264,7 @@ const KeyHandler = (props) => {
|
|
|
3248
3264
|
//#endregion
|
|
3249
3265
|
//#region src/components/SolidFlow/component.tsx
|
|
3250
3266
|
var _tmpl$$14 = /* @__PURE__ */ template("<div class=\"solid-flow__container solid-flow__viewport-back\">"), _tmpl$2 = /* @__PURE__ */ template("<div class=\"solid-flow__container solid-flow__edge-labels\">"), _tmpl$3 = /* @__PURE__ */ template("<div>");
|
|
3267
|
+
/** The flow canvas component: renders nodes and edges and wires up viewport and interactions. */
|
|
3251
3268
|
const SolidFlow = (props) => {
|
|
3252
3269
|
let [domNodeRef, setDomNodeRef] = createSignal(), domNode, _props = merge({
|
|
3253
3270
|
...getDefaultFlowStateProps(),
|
|
@@ -3611,6 +3628,7 @@ function useViewport() {
|
|
|
3611
3628
|
}
|
|
3612
3629
|
//#endregion
|
|
3613
3630
|
//#region src/hooks/useHandleEdgeSelect.ts
|
|
3631
|
+
/** Returns a callback applying edge-selection semantics for the given edge id. */
|
|
3614
3632
|
function useHandleEdgeSelect() {
|
|
3615
3633
|
let { store, edgeLookup, actions } = useInternalSolidFlow();
|
|
3616
3634
|
return (id) => {
|
|
@@ -3822,6 +3840,7 @@ const DEFAULT_SIZE = {
|
|
|
3822
3840
|
//#endregion
|
|
3823
3841
|
//#region src/plugins/controls/ControlButton.tsx
|
|
3824
3842
|
var _tmpl$$10 = /* @__PURE__ */ template("<button>");
|
|
3843
|
+
/** A styled button for use inside `Controls`. */
|
|
3825
3844
|
const ControlButton = (props) => {
|
|
3826
3845
|
let rest = omit(props, "class", "bgColor", "bgColorHover", "color", "colorHover", "borderColor", "onClick", "children"), style = () => Object.entries({
|
|
3827
3846
|
"--xy-controls-button-background-color-props": props.bgColor,
|
|
@@ -4178,6 +4197,7 @@ const getAttrFunction = (func) => func instanceof Function ? func : () => func,
|
|
|
4178
4197
|
//#endregion
|
|
4179
4198
|
//#region src/plugins/nodeResizer/ResizeControl.tsx
|
|
4180
4199
|
var _tmpl$$2 = /* @__PURE__ */ template("<div>");
|
|
4200
|
+
/** A single resize handle or line — the building block of `NodeResizer`. */
|
|
4181
4201
|
const ResizeControl = (props) => {
|
|
4182
4202
|
let _props = propDefaults(props, {
|
|
4183
4203
|
variant: "handle",
|
|
@@ -4349,6 +4369,7 @@ const EdgeToolbar = (props) => {
|
|
|
4349
4369
|
//#endregion
|
|
4350
4370
|
//#region src/plugins/toolbar/NodeToolbar.tsx
|
|
4351
4371
|
var _tmpl$ = /* @__PURE__ */ template("<div>");
|
|
4372
|
+
/** Toolbar attached to a node, rendered above the graph so it does not scale with zoom. */
|
|
4352
4373
|
const NodeToolbar = (props) => {
|
|
4353
4374
|
let { store } = useInternalSolidFlow(), { getNodes, getNodesBounds, getInternalNode } = useSolidFlow(), _props = propDefaults(props, {
|
|
4354
4375
|
offset: 10,
|
|
@@ -4400,6 +4421,6 @@ const NodeToolbar = (props) => {
|
|
|
4400
4421
|
});
|
|
4401
4422
|
}
|
|
4402
4423
|
});
|
|
4403
|
-
};
|
|
4424
|
+
}, SelectionMode = SelectionMode$1, getEdgeCenter = getEdgeCenter$1, getBezierEdgeCenter = getBezierEdgeCenter$1;
|
|
4404
4425
|
//#endregion
|
|
4405
4426
|
export { Background, BaseEdge, BezierEdge, BezierEdgeInternal, ConnectionLine, ConnectionLineType, ConnectionMode, ControlButton, Controls, DefaultNode, EdgeLabel, EdgeLabelRenderer, EdgeReconnectAnchor, EdgeRenderer, EdgeToolbar, EdgeWrapper, GroupNode, Handle, InputNode, Marker, MarkerDefinition, MarkerType, MiniMap, NodeRenderer, NodeResizer, NodeSelection, NodeToolbar, NodeWrapper, OutputNode, PanOnScrollMode, Pane, Panel, Position, ResizeControl, ResizeControlVariant, Selection, SelectionMode, SmoothStepEdge, SmoothStepEdgeInternal, SolidFlow, SolidFlowProvider, StepEdge, StepEdgeInternal, StraightEdge, StraightEdgeInternal, Viewport, ViewportPortal, Zoom, addEdge, connectionKey, 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 };
|
package/dist/index/index.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, Position as Position$1, ResizeControlVariant, SelectionMode
|
|
1
|
+
import { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, Position as Position$1, ResizeControlVariant, SelectionMode as SelectionMode$1, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, addEdge as addEdge$1, areConnectionMapsEqual, calcAutoPan, calculateNodePosition, clampPosition, clampPositionToParent, createDevWarn, createMarkerIds, elementSelectionKeys, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter as getBezierEdgeCenter$1, getBezierPath, getBezierPath as getBezierPath$1, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter as getEdgeCenter$1, getEdgePosition, getEdgeToolbarTransform, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesBounds as getNodesBounds$1, getNodesInside, getOutgoers, getOverlappingArea, getSmoothStepPath, getSmoothStepPath as getSmoothStepPath$1, getStraightPath, getStraightPath as getStraightPath$1, getViewportForBounds, getViewportForBounds as getViewportForBounds$1, handleConnectionChange, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isInputDOMNode, isMacOs, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToRect, panBy, pointToRendererPoint, rendererPointToPoint, shallowNodeData, snapPosition } from "@xyflow/system";
|
|
2
2
|
import { For, Show, createContext, createEffect, createMemo, createProjection, createSignal, createStore, flush, mapArray, merge, omit, onCleanup, onSettled, snapshot, untrack, useContext } from "solid-js";
|
|
3
3
|
import { createMediaQuery } from "@solid-primitives/media";
|
|
4
4
|
import { Dynamic, Portal, isServer } from "@solidjs/web";
|
|
@@ -1390,6 +1390,7 @@ function useNodeConnectable() {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
//#endregion
|
|
1392
1392
|
//#region src/components/handle/Handle.tsx
|
|
1393
|
+
/** Connection point on a node; place inside custom nodes to make them connectable. */
|
|
1393
1394
|
const Handle = (props) => {
|
|
1394
1395
|
let _props = propDefaults(props, {
|
|
1395
1396
|
type: "source",
|
|
@@ -1578,6 +1579,7 @@ function useNodeId() {
|
|
|
1578
1579
|
}
|
|
1579
1580
|
//#endregion
|
|
1580
1581
|
//#region src/components/node/NodeWrapper.tsx
|
|
1582
|
+
/** Internal per-node wrapper: dragging, selection, a11y, measurement, viewport culling, and the dynamic node component. */
|
|
1581
1583
|
const NodeWrapper = (props) => {
|
|
1582
1584
|
let { store, nodeLookup, parentIds, actions } = useInternalSolidFlow(), [nodeRef, setNodeRef] = createSignal(), node = () => nodeLookup.get(props.nodeId), nodeId = () => node().id, nodeType = () => node().type ?? "default", deletable = () => node().deletable ?? !0, selectable = () => node().selectable ?? store.elementsSelectable, focusable = () => node().focusable ?? store.nodesFocusable, draggable = () => node().draggable ?? store.nodesDraggable, connectable = () => node().connectable ?? store.nodesConnectable, userNode = () => node().internals.userNode, nodeTypeValid = () => nodeType() in store.nodeTypes, nodeComponent = () => store.nodeTypes[nodeType()], isParentNode = () => !!parentIds[node().id], transform = () => {
|
|
1583
1585
|
let { x, y } = node().internals.positionAbsolute;
|
|
@@ -1874,6 +1876,7 @@ function useInternalSolidFlow() {
|
|
|
1874
1876
|
}
|
|
1875
1877
|
//#endregion
|
|
1876
1878
|
//#region src/components/connection/ConnectionLine.tsx
|
|
1879
|
+
/** Internal component rendering the in-progress connection line. */
|
|
1877
1880
|
const ConnectionLine = (props) => {
|
|
1878
1881
|
let { store } = useInternalSolidFlow(), connectionStatus = () => getConnectionStatus(store.connection.isValid);
|
|
1879
1882
|
return <Show when={store.connection.inProgress}>
|
|
@@ -2532,6 +2535,7 @@ function useViewport() {
|
|
|
2532
2535
|
}
|
|
2533
2536
|
//#endregion
|
|
2534
2537
|
//#region src/hooks/useHandleEdgeSelect.ts
|
|
2538
|
+
/** Returns a callback applying edge-selection semantics for the given edge id. */
|
|
2535
2539
|
function useHandleEdgeSelect() {
|
|
2536
2540
|
let { store, edgeLookup, actions } = useInternalSolidFlow();
|
|
2537
2541
|
return (id) => {
|
|
@@ -2993,6 +2997,6 @@ const DotPattern = (props) => {
|
|
|
2993
2997
|
</div>
|
|
2994
2998
|
</Portal>
|
|
2995
2999
|
</Show>;
|
|
2996
|
-
};
|
|
3000
|
+
}, SelectionMode = SelectionMode$1, getEdgeCenter = getEdgeCenter$1, getBezierEdgeCenter = getBezierEdgeCenter$1;
|
|
2997
3001
|
//#endregion
|
|
2998
3002
|
export { Background, BaseEdge, BezierEdge, BezierEdgeInternal, ConnectionLine, ConnectionLineType, ConnectionMode, ControlButton, Controls, DefaultNode, EdgeLabel, EdgeLabelRenderer, EdgeReconnectAnchor, EdgeRenderer, EdgeToolbar, EdgeWrapper, GroupNode, Handle, InputNode, Marker, MarkerDefinition, MarkerType, MiniMap, NodeRenderer, NodeResizer, NodeSelection, NodeToolbar, NodeWrapper, OutputNode, PanOnScrollMode, Pane, Panel, Position, ResizeControl, ResizeControlVariant, Selection, SelectionMode, SmoothStepEdge, SmoothStepEdgeInternal, SolidFlow, SolidFlowProvider, StepEdge, StepEdgeInternal, StraightEdge, StraightEdgeInternal, Viewport, ViewportPortal, Zoom, addEdge, connectionKey, 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 };
|
package/package.json
CHANGED