@barefootjs/xyflow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +117 -0
  2. package/dist/classes.d.ts +31 -0
  3. package/dist/classes.d.ts.map +1 -0
  4. package/dist/compat.d.ts +67 -0
  5. package/dist/compat.d.ts.map +1 -0
  6. package/dist/connection.d.ts +20 -0
  7. package/dist/connection.d.ts.map +1 -0
  8. package/dist/constants.d.ts +4 -0
  9. package/dist/constants.d.ts.map +1 -0
  10. package/dist/context.d.ts +7 -0
  11. package/dist/context.d.ts.map +1 -0
  12. package/dist/edge-path.d.ts +14 -0
  13. package/dist/edge-path.d.ts.map +1 -0
  14. package/dist/flow-subsystems.d.ts +28 -0
  15. package/dist/flow-subsystems.d.ts.map +1 -0
  16. package/dist/hooks.d.ts +34 -0
  17. package/dist/hooks.d.ts.map +1 -0
  18. package/dist/index.d.ts +19 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +6572 -0
  21. package/dist/node-resizer.d.ts +52 -0
  22. package/dist/node-resizer.d.ts.map +1 -0
  23. package/dist/node-type-dispatch.d.ts +34 -0
  24. package/dist/node-type-dispatch.d.ts.map +1 -0
  25. package/dist/selection.d.ts +32 -0
  26. package/dist/selection.d.ts.map +1 -0
  27. package/dist/store.d.ts +8 -0
  28. package/dist/store.d.ts.map +1 -0
  29. package/dist/types.d.ts +214 -0
  30. package/dist/types.d.ts.map +1 -0
  31. package/dist/utils.d.ts +6 -0
  32. package/dist/utils.d.ts.map +1 -0
  33. package/dist/xyflow.browser.min.js +95 -0
  34. package/dist/xyflow.browser.min.js.map +129 -0
  35. package/package.json +58 -0
  36. package/src/__tests__/clamp-drag-position.test.ts +111 -0
  37. package/src/__tests__/compat.test.ts +157 -0
  38. package/src/__tests__/host-element-store.test.ts +33 -0
  39. package/src/__tests__/jsx-smoke.test.ts +33 -0
  40. package/src/__tests__/jsx-smoke.tsx +23 -0
  41. package/src/__tests__/node-type-dispatch.test.ts +104 -0
  42. package/src/__tests__/store.test.ts +399 -0
  43. package/src/__tests__/tsconfig.json +23 -0
  44. package/src/classes.ts +41 -0
  45. package/src/compat.ts +237 -0
  46. package/src/connection.ts +459 -0
  47. package/src/constants.ts +8 -0
  48. package/src/context.ts +8 -0
  49. package/src/edge-path.ts +89 -0
  50. package/src/flow-subsystems.ts +506 -0
  51. package/src/hooks.ts +72 -0
  52. package/src/index.ts +134 -0
  53. package/src/node-resizer.ts +276 -0
  54. package/src/node-type-dispatch.ts +46 -0
  55. package/src/selection.ts +407 -0
  56. package/src/store.ts +526 -0
  57. package/src/types.ts +329 -0
  58. package/src/utils.ts +13 -0
@@ -0,0 +1,52 @@
1
+ import { ResizeControlVariant } from '@xyflow/system';
2
+ import type { NodeBase, ControlPosition, ControlLinePosition, OnResize, OnResizeStart, OnResizeEnd, ShouldResize, ResizeControlDirection } from '@xyflow/system';
3
+ import type { FlowStore } from './types';
4
+ /**
5
+ * Options for initNodeResizer.
6
+ */
7
+ export type NodeResizerOptions = {
8
+ /** Minimum width the node can be resized to (default: 10) */
9
+ minWidth?: number;
10
+ /** Minimum height the node can be resized to (default: 10) */
11
+ minHeight?: number;
12
+ /** Maximum width the node can be resized to (default: Infinity) */
13
+ maxWidth?: number;
14
+ /** Maximum height the node can be resized to (default: Infinity) */
15
+ maxHeight?: number;
16
+ /** Whether to keep the aspect ratio during resize (default: false) */
17
+ keepAspectRatio?: boolean;
18
+ /** Which variant of resize controls to use: 'handle' (corners) or 'line' (edges) */
19
+ variant?: ResizeControlVariant | 'handle' | 'line';
20
+ /** Callback fired when resize starts */
21
+ onResizeStart?: OnResizeStart;
22
+ /** Callback fired during resize with new dimensions */
23
+ onResize?: OnResize;
24
+ /** Callback fired when resize ends */
25
+ onResizeEnd?: OnResizeEnd;
26
+ /** Callback to determine if resize should proceed */
27
+ shouldResize?: ShouldResize;
28
+ /** Whether the node is resizable (default: true) */
29
+ isVisible?: boolean;
30
+ /** CSS color for the resize handle lines/corners */
31
+ color?: string;
32
+ };
33
+ /**
34
+ * Initialize resize handles on a node element.
35
+ *
36
+ * Creates resize handle elements (corners and/or lines) and attaches
37
+ * XYResizer from @xyflow/system for the resize logic.
38
+ *
39
+ * Usage:
40
+ * // Inside a custom node type function:
41
+ * initNodeResizer(this.parentElement, {
42
+ * nodeId: props.id,
43
+ * store,
44
+ * minWidth: 100,
45
+ * minHeight: 50,
46
+ * onResize: (event, params) => console.log('Resized:', params),
47
+ * })
48
+ */
49
+ export declare function initNodeResizer<NodeType extends NodeBase>(nodeEl: HTMLElement, nodeId: string, store: FlowStore<NodeType>, options?: NodeResizerOptions): () => void;
50
+ export { ResizeControlVariant };
51
+ export type { ControlPosition, ControlLinePosition, OnResize, OnResizeStart, OnResizeEnd, ShouldResize, ResizeControlDirection, };
52
+ //# sourceMappingURL=node-resizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-resizer.d.ts","sourceRoot":"","sources":["../src/node-resizer.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,oBAAoB,EAErB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EACV,QAAQ,EAER,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,WAAW,EACX,YAAY,EACZ,sBAAsB,EACvB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,oFAAoF;IACpF,OAAO,CAAC,EAAE,oBAAoB,GAAG,QAAQ,GAAG,MAAM,CAAA;IAClD,wCAAwC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,sCAAsC;IACtC,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,qDAAqD;IACrD,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,QAAQ,EACvD,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC1B,OAAO,GAAE,kBAAuB,GAC/B,MAAM,IAAI,CA8LZ;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAC/B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,WAAW,EACX,YAAY,EACZ,sBAAsB,GACvB,CAAA"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Node-type dispatch — the helper that funnels `<Flow nodeTypes={...}>`
3
+ * entries into the host `<div>` produced by `FlowNodeTypeBridge`.
4
+ *
5
+ * `nodeTypes` accepts two entry shapes through the same map so projects
6
+ * can migrate custom nodes from imperative to JSX one file at a time
7
+ * without touching every `<Flow>` call site:
8
+ *
9
+ * 1. Imperative: `function MyNode(this: HTMLElement, props): void`
10
+ * — mutates `this` (the host element) and returns nothing.
11
+ * 2. JSX-component shim: post-`'use client'` `.tsx` compile output
12
+ * — ignores `this` and returns a real DOM `Node`. The bridge
13
+ * appends that returned node into the host so subsequent
14
+ * wipe+rebuild cycles see it.
15
+ *
16
+ * See piconic-ai/barefootjs#1236 for the migration motivation.
17
+ */
18
+ import type { NodeBase } from './types';
19
+ import type { NodeComponentProps } from './types';
20
+ /**
21
+ * Cross-shape `nodeTypes` entry. The return type covers both supported
22
+ * shapes — imperative entries return `void`, JSX-component shim
23
+ * entries return a `Node`.
24
+ */
25
+ export type NodeInitFn<NodeType extends NodeBase = NodeBase> = (this: HTMLElement, props: NodeComponentProps<NodeType>) => void | Node | undefined;
26
+ /**
27
+ * Dispatch a `nodeTypes` entry into the host element. Invokes `initFn`
28
+ * with `el` bound as `this` (imperative path) and appends its return
29
+ * value when it is a `Node` (JSX-component shim path). The
30
+ * `instanceof Node` guard is harmless on the imperative path: `void`
31
+ * is not an instance of `Node`, so the branch is skipped.
32
+ */
33
+ export declare function dispatchNodeType<NT extends NodeBase>(el: HTMLElement, initFn: NodeInitFn<NT>, props: NodeComponentProps<NT>): void;
34
+ //# sourceMappingURL=node-type-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-type-dispatch.d.ts","sourceRoot":"","sources":["../src/node-type-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAC7D,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,kBAAkB,CAAC,QAAQ,CAAC,KAChC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAE5B;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,QAAQ,EAClD,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,EACtB,KAAK,EAAE,kBAAkB,CAAC,EAAE,CAAC,GAC5B,IAAI,CAGN"}
@@ -0,0 +1,32 @@
1
+ import type { NodeBase, EdgeBase } from '@xyflow/system';
2
+ import type { FlowStore, InternalFlowStore, SelectionMode } from './types';
3
+ /**
4
+ * Set up keyboard handlers for the flow container.
5
+ * Needs InternalFlowStore for setMultiSelectionActive (Shift key).
6
+ */
7
+ export declare function setupKeyboardHandlers<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(store: InternalFlowStore<NodeType, EdgeType>, container: HTMLElement): void;
8
+ /**
9
+ * Set up click-to-select on node elements.
10
+ * Called from node-wrapper when creating each node.
11
+ */
12
+ export declare function setupNodeSelection<NodeType extends NodeBase>(nodeElement: HTMLElement, nodeId: string, store: FlowStore<NodeType>): void;
13
+ /**
14
+ * Options for the selection rectangle behavior.
15
+ */
16
+ export type SelectionRectOptions = {
17
+ /** When true, drag on pane starts selection without Shift key */
18
+ selectionOnDrag?: boolean;
19
+ /** 'partial' selects overlapping nodes; 'full' requires full containment */
20
+ selectionMode?: SelectionMode;
21
+ };
22
+ /**
23
+ * Set up selection rectangle (rubber-band / lasso) on the flow container.
24
+ *
25
+ * The rectangle is drawn when:
26
+ * - Shift+drag on empty pane, OR
27
+ * - Drag on empty pane when `selectionOnDrag` is true
28
+ *
29
+ * Nodes inside the rectangle are selected on mouse up.
30
+ */
31
+ export declare function setupSelectionRectangle<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(store: InternalFlowStore<NodeType, EdgeType>, container: HTMLElement, options?: SelectionRectOptions): void;
32
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAA+B,MAAM,gBAAgB,CAAA;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE1E;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAEpC,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC5C,SAAS,EAAE,WAAW,GACrB,IAAI,CA8DN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,EAC1D,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,GACzB,IAAI,CA2BN;AAiGD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,iEAAiE;IACjE,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAEpC,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC5C,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,oBAAyB,GACjC,IAAI,CA0KN"}
@@ -0,0 +1,8 @@
1
+ import type { NodeBase, EdgeBase } from '@xyflow/system';
2
+ import type { FlowStoreOptions, InternalFlowStore } from './types';
3
+ /**
4
+ * Create a signal-based reactive store that bridges @xyflow/system
5
+ * with BarefootJS reactivity.
6
+ */
7
+ export declare function createFlowStore<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(options?: FlowStoreOptions<NodeType, EdgeType>): InternalFlowStore<NodeType, EdgeType>;
8
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EAaT,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAA;AAKlF;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,OAAO,GAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAoe3F"}
@@ -0,0 +1,214 @@
1
+ import type { NodeBase, EdgeBase, InternalNodeBase, Viewport, NodeLookup, ParentLookup, EdgeLookup, ConnectionLookup, CoordinateExtent, SnapGrid, NodeOrigin, Transform, PanZoomInstance, XYPosition, FitViewOptionsBase, OnConnect, OnConnectStart, OnConnectEnd, IsValidConnection, NodeDragItem, ConnectionMode, Connection } from '@xyflow/system';
2
+ import type { Signal, Memo } from '@barefootjs/client';
3
+ import type { ComponentDef } from '@barefootjs/client/runtime';
4
+ export type FitViewOptions = FitViewOptionsBase;
5
+ export type { NodeBase, EdgeBase, InternalNodeBase, Viewport, NodeLookup, ParentLookup, EdgeLookup, ConnectionLookup, CoordinateExtent, SnapGrid, NodeOrigin, Transform, PanZoomInstance, XYPosition, OnConnect, OnConnectStart, OnConnectEnd, IsValidConnection, NodeDragItem, ConnectionMode, Connection, };
6
+ /**
7
+ * Callback fired when an edge is reconnected to a new handle.
8
+ */
9
+ export type OnReconnect<EdgeType extends EdgeBase = EdgeBase> = (oldEdge: EdgeType, newConnection: Connection) => void;
10
+ /**
11
+ * Options for creating a flow store.
12
+ */
13
+ export type FlowStoreOptions<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = {
14
+ nodes?: NodeType[];
15
+ edges?: EdgeType[];
16
+ defaultViewport?: Viewport;
17
+ minZoom?: number;
18
+ maxZoom?: number;
19
+ nodeOrigin?: NodeOrigin;
20
+ nodeExtent?: CoordinateExtent;
21
+ snapToGrid?: boolean;
22
+ snapGrid?: SnapGrid;
23
+ fitView?: boolean;
24
+ fitViewOptions?: FitViewOptions;
25
+ nodeTypes?: Record<string, ComponentDef | ((props: NodeComponentProps<NodeType>) => void)>;
26
+ edgeTypes?: Record<string, ComponentDef | ((props: EdgeComponentProps<EdgeType>) => void)>;
27
+ edgesReconnectable?: boolean;
28
+ onReconnect?: OnReconnect<EdgeType>;
29
+ onConnect?: OnConnect;
30
+ onConnectStart?: OnConnectStart;
31
+ onConnectEnd?: OnConnectEnd;
32
+ isValidConnection?: IsValidConnection;
33
+ onInit?: (store: FlowStore<NodeType, EdgeType>) => void;
34
+ onNodeDragStart?: (event: MouseEvent, node: NodeType, nodes: NodeType[]) => void;
35
+ onNodeDragStop?: (event: MouseEvent, node: NodeType, nodes: NodeType[]) => void;
36
+ onMoveEnd?: (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
37
+ onPaneClick?: (event: MouseEvent) => void;
38
+ onPaneMouseMove?: (event: MouseEvent) => void;
39
+ onNodesDelete?: (nodes: NodeType[]) => void;
40
+ onEdgesDelete?: (edges: EdgeType[]) => void;
41
+ panOnDrag?: boolean;
42
+ panOnScroll?: boolean;
43
+ zoomOnScroll?: boolean;
44
+ zoomOnDoubleClick?: boolean;
45
+ zoomActivationKeyCode?: string | null;
46
+ nodesDraggable?: boolean;
47
+ nodesConnectable?: boolean;
48
+ elementsSelectable?: boolean;
49
+ deleteKeyCode?: string[] | null;
50
+ selectionKeyCode?: string | null;
51
+ connectionLineStyle?: Record<string, string>;
52
+ defaultEdgeOptions?: Partial<EdgeBase>;
53
+ elevateNodesOnSelect?: boolean;
54
+ reconnectRadius?: number;
55
+ };
56
+ /**
57
+ * The reactive flow store — all state exposed as signal getters.
58
+ */
59
+ export type FlowStore<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = {
60
+ nodes: Signal<NodeType[]>[0];
61
+ edges: Signal<EdgeType[]>[0];
62
+ viewport: Signal<Viewport>[0];
63
+ width: Signal<number>[0];
64
+ height: Signal<number>[0];
65
+ dragging: Signal<boolean>[0];
66
+ nodesInitialized: Memo<boolean>;
67
+ nodeLookup: Signal<NodeLookup<InternalNodeBase<NodeType>>>[0];
68
+ parentLookup: Signal<ParentLookup<InternalNodeBase<NodeType>>>[0];
69
+ edgeLookup: Signal<EdgeLookup<EdgeType>>[0];
70
+ connectionLookup: Signal<ConnectionLookup>[0];
71
+ /**
72
+ * Fine-grained per-node subscription. Returns the current internal
73
+ * entry for the given id, and tracks it for reactivity — the
74
+ * surrounding effect / memo will re-run only when **this** node's
75
+ * entry changes (data, selected, position via setNodes, or in-place
76
+ * drag updates), not on changes to sibling nodes.
77
+ *
78
+ * Use this in per-node consumers (data / selected / position
79
+ * observers). For iteration-style consumers that walk all nodes,
80
+ * keep using `nodeLookup()`.
81
+ */
82
+ nodeSignal: (id: string) => InternalNodeBase<NodeType> | undefined;
83
+ positionEpoch: Signal<number>[0];
84
+ triggerPositionUpdate: () => void;
85
+ panZoom: Signal<PanZoomInstance | null>[0];
86
+ domNode: Signal<HTMLElement | null>[0];
87
+ setNodes: Signal<NodeType[]>[1];
88
+ setEdges: Signal<EdgeType[]>[1];
89
+ setViewport: Signal<Viewport>[1];
90
+ setWidth: Signal<number>[1];
91
+ setHeight: Signal<number>[1];
92
+ multiSelectionActive: Signal<boolean>[0];
93
+ nodesDraggable: Signal<boolean>[0];
94
+ setNodesDraggable: Signal<boolean>[1];
95
+ fitView: (options?: FitViewOptions) => void;
96
+ updateNodePositions: (dragItems: Map<string, NodeDragItem | InternalNodeBase<NodeType>>, dragging?: boolean) => void;
97
+ unselectNodesAndEdges: (params?: {
98
+ nodes?: NodeType[];
99
+ edges?: EdgeType[];
100
+ }) => void;
101
+ panByDelta: (delta: XYPosition) => Promise<boolean>;
102
+ addEdge: (edge: EdgeType) => void;
103
+ deleteElements: (params: {
104
+ nodes?: NodeType[];
105
+ edges?: EdgeType[];
106
+ }) => void;
107
+ minZoom: number;
108
+ maxZoom: number;
109
+ nodeOrigin: NodeOrigin;
110
+ nodeExtent: CoordinateExtent;
111
+ snapToGrid: boolean;
112
+ snapGrid: SnapGrid;
113
+ getTransform: () => Transform;
114
+ nodeTypes?: Record<string, ComponentDef | ((props: NodeComponentProps<NodeType>) => void)>;
115
+ edgeTypes?: Record<string, ComponentDef | ((props: EdgeComponentProps<EdgeType>) => void)>;
116
+ edgesReconnectable: boolean;
117
+ onReconnect?: OnReconnect<EdgeType>;
118
+ onConnect?: OnConnect;
119
+ onConnectStart?: OnConnectStart;
120
+ onConnectEnd?: OnConnectEnd;
121
+ isValidConnection?: IsValidConnection;
122
+ onInit?: (store: FlowStore<NodeType, EdgeType>) => void;
123
+ onNodeDragStart?: (event: MouseEvent, node: NodeType, nodes: NodeType[]) => void;
124
+ onNodeDragStop?: (event: MouseEvent, node: NodeType, nodes: NodeType[]) => void;
125
+ onMoveEnd?: (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
126
+ onPaneClick?: (event: MouseEvent) => void;
127
+ onPaneMouseMove?: (event: MouseEvent) => void;
128
+ onNodesDelete?: (nodes: NodeType[]) => void;
129
+ onEdgesDelete?: (edges: EdgeType[]) => void;
130
+ nodesConnectable: Signal<boolean>[0];
131
+ setNodesConnectable: Signal<boolean>[1];
132
+ elementsSelectable: Signal<boolean>[0];
133
+ setElementsSelectable: Signal<boolean>[1];
134
+ panOnDrag: Signal<boolean>[0];
135
+ setPanOnDrag: Signal<boolean>[1];
136
+ panOnScroll: Signal<boolean>[0];
137
+ setPanOnScroll: Signal<boolean>[1];
138
+ zoomOnScroll: Signal<boolean>[0];
139
+ setZoomOnScroll: Signal<boolean>[1];
140
+ deleteKeyCode: string[] | null;
141
+ selectionKeyCode: string | null;
142
+ connectionLineStyle?: Record<string, string>;
143
+ defaultEdgeOptions?: Partial<EdgeBase>;
144
+ elevateNodesOnSelect: boolean;
145
+ reconnectRadius: number;
146
+ };
147
+ /**
148
+ * Internal setters exposed by createFlowStore but not part of the public API.
149
+ * Used only by initFlow during initialization.
150
+ */
151
+ export type InternalFlowStore<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = FlowStore<NodeType, EdgeType> & {
152
+ setDragging: Signal<boolean>[1];
153
+ setPanZoom: Signal<PanZoomInstance | null>[1];
154
+ setDomNode: Signal<HTMLElement | null>[1];
155
+ setMultiSelectionActive: Signal<boolean>[1];
156
+ updatePanZoomConfig: () => void;
157
+ };
158
+ /**
159
+ * Props passed to custom node components.
160
+ */
161
+ export type NodeComponentProps<NodeType extends NodeBase = NodeBase> = {
162
+ id: string;
163
+ data: NodeType['data'];
164
+ type: string;
165
+ /**
166
+ * Reactive getter for this node's selected state. Call inside a
167
+ * createEffect to observe selection changes at runtime — reading it once
168
+ * at mount time only yields the initial value.
169
+ */
170
+ selected: () => boolean;
171
+ dragging: boolean;
172
+ positionAbsoluteX: number;
173
+ positionAbsoluteY: number;
174
+ width?: number;
175
+ height?: number;
176
+ isConnectable: boolean;
177
+ };
178
+ /**
179
+ * Props passed to custom edge components.
180
+ */
181
+ export type EdgeComponentProps<EdgeType extends EdgeBase = EdgeBase> = {
182
+ id: string;
183
+ source: string;
184
+ target: string;
185
+ sourceX: number;
186
+ sourceY: number;
187
+ targetX: number;
188
+ targetY: number;
189
+ sourcePosition: string;
190
+ targetPosition: string;
191
+ data: EdgeType['data'];
192
+ selected: boolean;
193
+ animated: boolean;
194
+ label?: string;
195
+ /** SVG group element to render custom edge content into */
196
+ svgGroup: SVGGElement;
197
+ };
198
+ /**
199
+ * Selection mode for rectangle selection.
200
+ * - 'partial': selects nodes that partially overlap the rectangle (default)
201
+ * - 'full': only selects nodes fully contained in the rectangle
202
+ */
203
+ export type SelectionMode = 'partial' | 'full';
204
+ /**
205
+ * Props for the Flow init function.
206
+ */
207
+ export type FlowProps<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = FlowStoreOptions<NodeType, EdgeType> & {
208
+ class?: string;
209
+ /** When true, dragging on empty pane starts selection without Shift key */
210
+ selectionOnDrag?: boolean;
211
+ /** Selection mode: 'partial' (default) or 'full' */
212
+ selectionMode?: SelectionMode;
213
+ };
214
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,UAAU,EACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAA;AAE/C,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,UAAU,GACX,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAC9D,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,UAAU,KACtB,IAAI,CAAA;AAET;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC1B,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAClC;IACF,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;I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Q,CAAC,MAAM,CAAC,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,QAAQ,EAAE,WAAW,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,SAAS,CACnB,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAClC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,oDAAoD;IACpD,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Apply position styling to an absolutely-positioned container element.
3
+ * Parses a position string like 'top-left' or 'bottom-right'.
4
+ */
5
+ export declare function applyPositionStyle(el: HTMLElement, position: string, offset?: string): void;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAS,GACd,IAAI,CAIN"}