@xyflow/react 12.5.4 → 12.5.5
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/esm/components/Edges/SimpleBezierEdge.d.ts +10 -0
- package/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map +1 -1
- package/dist/esm/contexts/NodeIdContext.d.ts +1 -1
- package/dist/esm/hooks/useConnection.d.ts +4 -0
- package/dist/esm/hooks/useConnection.d.ts.map +1 -1
- package/dist/esm/hooks/useEdges.d.ts +1 -1
- package/dist/esm/hooks/useHandleConnections.d.ts +8 -8
- package/dist/esm/hooks/useHandleConnections.d.ts.map +1 -1
- package/dist/esm/hooks/useInternalNode.d.ts +2 -2
- package/dist/esm/hooks/useKeyPress.d.ts +23 -4
- package/dist/esm/hooks/useKeyPress.d.ts.map +1 -1
- package/dist/esm/hooks/useNodeConnections.d.ts +6 -6
- package/dist/esm/hooks/useNodeConnections.d.ts.map +1 -1
- package/dist/esm/hooks/useNodes.d.ts +1 -1
- package/dist/esm/hooks/useNodesData.d.ts +7 -5
- package/dist/esm/hooks/useNodesData.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesEdgesState.d.ts +32 -6
- package/dist/esm/hooks/useNodesEdgesState.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesInitialized.d.ts +3 -2
- package/dist/esm/hooks/useNodesInitialized.d.ts.map +1 -1
- package/dist/esm/hooks/useOnSelectionChange.d.ts +1 -2
- package/dist/esm/hooks/useOnSelectionChange.d.ts.map +1 -1
- package/dist/esm/hooks/useOnViewportChange.d.ts +5 -6
- package/dist/esm/hooks/useOnViewportChange.d.ts.map +1 -1
- package/dist/esm/hooks/useReactFlow.d.ts +0 -2
- package/dist/esm/hooks/useReactFlow.d.ts.map +1 -1
- package/dist/esm/hooks/useStore.d.ts +8 -5
- package/dist/esm/hooks/useStore.d.ts.map +1 -1
- package/dist/esm/hooks/useUpdateNodeInternals.d.ts +5 -4
- package/dist/esm/hooks/useUpdateNodeInternals.d.ts.map +1 -1
- package/dist/esm/hooks/useViewport.d.ts +3 -3
- package/dist/esm/index.js +93 -69
- package/dist/esm/index.mjs +93 -69
- package/dist/esm/types/component-props.d.ts +234 -116
- package/dist/esm/types/component-props.d.ts.map +1 -1
- package/dist/esm/types/edges.d.ts +11 -1
- package/dist/esm/types/edges.d.ts.map +1 -1
- package/dist/esm/utils/changes.d.ts +6 -6
- package/dist/esm/utils/general.d.ts +11 -7
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/umd/components/Edges/SimpleBezierEdge.d.ts +10 -0
- package/dist/umd/components/Edges/SimpleBezierEdge.d.ts.map +1 -1
- package/dist/umd/contexts/NodeIdContext.d.ts +1 -1
- package/dist/umd/hooks/useConnection.d.ts +4 -0
- package/dist/umd/hooks/useConnection.d.ts.map +1 -1
- package/dist/umd/hooks/useEdges.d.ts +1 -1
- package/dist/umd/hooks/useHandleConnections.d.ts +8 -8
- package/dist/umd/hooks/useHandleConnections.d.ts.map +1 -1
- package/dist/umd/hooks/useInternalNode.d.ts +2 -2
- package/dist/umd/hooks/useKeyPress.d.ts +23 -4
- package/dist/umd/hooks/useKeyPress.d.ts.map +1 -1
- package/dist/umd/hooks/useNodeConnections.d.ts +6 -6
- package/dist/umd/hooks/useNodeConnections.d.ts.map +1 -1
- package/dist/umd/hooks/useNodes.d.ts +1 -1
- package/dist/umd/hooks/useNodesData.d.ts +7 -5
- package/dist/umd/hooks/useNodesData.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesEdgesState.d.ts +32 -6
- package/dist/umd/hooks/useNodesEdgesState.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesInitialized.d.ts +3 -2
- package/dist/umd/hooks/useNodesInitialized.d.ts.map +1 -1
- package/dist/umd/hooks/useOnSelectionChange.d.ts +1 -2
- package/dist/umd/hooks/useOnSelectionChange.d.ts.map +1 -1
- package/dist/umd/hooks/useOnViewportChange.d.ts +5 -6
- package/dist/umd/hooks/useOnViewportChange.d.ts.map +1 -1
- package/dist/umd/hooks/useReactFlow.d.ts +0 -2
- package/dist/umd/hooks/useReactFlow.d.ts.map +1 -1
- package/dist/umd/hooks/useStore.d.ts +8 -5
- package/dist/umd/hooks/useStore.d.ts.map +1 -1
- package/dist/umd/hooks/useUpdateNodeInternals.d.ts +5 -4
- package/dist/umd/hooks/useUpdateNodeInternals.d.ts.map +1 -1
- package/dist/umd/hooks/useViewport.d.ts +3 -3
- package/dist/umd/index.js +2 -2
- package/dist/umd/types/component-props.d.ts +234 -116
- package/dist/umd/types/component-props.d.ts.map +1 -1
- package/dist/umd/types/edges.d.ts +11 -1
- package/dist/umd/types/edges.d.ts.map +1 -1
- package/dist/umd/utils/changes.d.ts +6 -6
- package/dist/umd/utils/general.d.ts +11 -7
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,CACxF,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD
|
|
1
|
+
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,CACxF,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,QAAQ,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AS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -99,7 +99,7 @@ export type EdgeProps<EdgeType extends Edge = Edge> = Pick<EdgeType, 'id' | 'ani
|
|
|
99
99
|
* @public
|
|
100
100
|
* @expand
|
|
101
101
|
*/
|
|
102
|
-
export type BaseEdgeProps = Omit<SVGAttributes<SVGPathElement>, 'd' | 'path'> & EdgeLabelOptions & {
|
|
102
|
+
export type BaseEdgeProps = Omit<SVGAttributes<SVGPathElement>, 'd' | 'path' | 'markerStart' | 'markerEnd'> & EdgeLabelOptions & {
|
|
103
103
|
/**
|
|
104
104
|
* The width of the invisible area around the edge that the user can interact with. This is
|
|
105
105
|
* useful for making the edge easier to click or hover over.
|
|
@@ -116,6 +116,16 @@ export type BaseEdgeProps = Omit<SVGAttributes<SVGPathElement>, 'd' | 'path'> &
|
|
|
116
116
|
* be used to generate this string for you.
|
|
117
117
|
*/
|
|
118
118
|
path: string;
|
|
119
|
+
/**
|
|
120
|
+
* The id of the SVG marker to use at the start of the edge. This should be defined in a
|
|
121
|
+
* `<defs>` element in a separate SVG document or element.
|
|
122
|
+
*/
|
|
123
|
+
markerStart?: string;
|
|
124
|
+
/**
|
|
125
|
+
* The id of the SVG marker to use at the end of the edge. This should be defined in a `<defs>`
|
|
126
|
+
* element in a separate SVG document or element.
|
|
127
|
+
*/
|
|
128
|
+
markerEnd?: string;
|
|
119
129
|
};
|
|
120
130
|
/**
|
|
121
131
|
* Helper type for edge components that get exported by the library
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,IAAI,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,QAA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G;AACH,MAAM,MAAM,4BAA4B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvE,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oDAAoD;IACpD,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACjC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,QAAQ,CAAC;IACvB,UAAU,EAAE,QAAQ,CAAC;IACrB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAC/E,4BAA4B,CAAC,QAAQ,CAAC,CACvC,CAAC"}
|
|
@@ -3,9 +3,9 @@ import type { Node, Edge, InternalNode } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Drop in function that applies node changes to an array of nodes.
|
|
5
5
|
* @public
|
|
6
|
-
* @param changes - Array of changes to apply
|
|
7
|
-
* @param nodes - Array of nodes to apply the changes to
|
|
8
|
-
* @returns Array of updated nodes
|
|
6
|
+
* @param changes - Array of changes to apply.
|
|
7
|
+
* @param nodes - Array of nodes to apply the changes to.
|
|
8
|
+
* @returns Array of updated nodes.
|
|
9
9
|
* @example
|
|
10
10
|
*```tsx
|
|
11
11
|
*import { useState, useCallback } from 'react';
|
|
@@ -35,9 +35,9 @@ export declare function applyNodeChanges<NodeType extends Node = Node>(changes:
|
|
|
35
35
|
/**
|
|
36
36
|
* Drop in function that applies edge changes to an array of edges.
|
|
37
37
|
* @public
|
|
38
|
-
* @param changes - Array of changes to apply
|
|
39
|
-
* @param edges - Array of edge to apply the changes to
|
|
40
|
-
* @returns Array of updated edges
|
|
38
|
+
* @param changes - Array of changes to apply.
|
|
39
|
+
* @param edges - Array of edge to apply the changes to.
|
|
40
|
+
* @returns Array of updated edges.
|
|
41
41
|
* @example
|
|
42
42
|
* ```tsx
|
|
43
43
|
*import { useState, useCallback } from 'react';
|
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
import { type Ref, type RefAttributes, JSX } from 'react';
|
|
2
2
|
import type { Edge, Node } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* Test whether an object is
|
|
4
|
+
* Test whether an object is usable as an [`Node`](/api-reference/types/node).
|
|
5
5
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
6
6
|
* [`Node`](/api-reference/types/node) if it returns `true`.
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
|
|
10
|
-
* @param element - The element to test
|
|
11
|
-
* @returns
|
|
10
|
+
* @param element - The element to test.
|
|
11
|
+
* @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript,
|
|
12
|
+
* this function acts as a type guard and will narrow the type of the value to `Node` if it returns
|
|
13
|
+
* `true`.
|
|
12
14
|
*
|
|
13
15
|
* @example
|
|
14
16
|
* ```js
|
|
15
17
|
*import { isNode } from '@xyflow/react';
|
|
16
18
|
*
|
|
17
19
|
*if (isNode(node)) {
|
|
18
|
-
* //
|
|
20
|
+
* // ...
|
|
19
21
|
*}
|
|
20
22
|
*```
|
|
21
23
|
*/
|
|
22
24
|
export declare const isNode: <NodeType extends Node = Node>(element: unknown) => element is NodeType;
|
|
23
25
|
/**
|
|
24
|
-
* Test whether an object is
|
|
26
|
+
* Test whether an object is usable as an [`Edge`](/api-reference/types/edge).
|
|
25
27
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
26
28
|
* [`Edge`](/api-reference/types/edge) if it returns `true`.
|
|
27
29
|
*
|
|
28
30
|
* @public
|
|
29
31
|
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
|
|
30
32
|
* @param element - The element to test
|
|
31
|
-
* @returns
|
|
33
|
+
* @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript,
|
|
34
|
+
* this function acts as a type guard and will narrow the type of the value to `Edge` if it returns
|
|
35
|
+
* `true`.
|
|
32
36
|
*
|
|
33
37
|
* @example
|
|
34
38
|
* ```js
|
|
35
39
|
*import { isEdge } from '@xyflow/react';
|
|
36
40
|
*
|
|
37
41
|
*if (isEdge(edge)) {
|
|
38
|
-
* //
|
|
42
|
+
* // ...
|
|
39
43
|
*}
|
|
40
44
|
*```
|
|
41
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAc,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAc,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,0CAA2C,OAAO,wBACtC,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,0CAA2C,OAAO,wBACtC,CAAC;AAGhC,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EACvC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,GAC7C,CAAC,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAG9C"}
|
|
@@ -4,15 +4,25 @@ import type { SimpleBezierEdgeProps } from '../../types';
|
|
|
4
4
|
export interface GetSimpleBezierPathParams {
|
|
5
5
|
sourceX: number;
|
|
6
6
|
sourceY: number;
|
|
7
|
+
/** @default Position.Bottom */
|
|
7
8
|
sourcePosition?: Position;
|
|
8
9
|
targetX: number;
|
|
9
10
|
targetY: number;
|
|
11
|
+
/** @default Position.Top */
|
|
10
12
|
targetPosition?: Position;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* The `getSimpleBezierPath` util returns everything you need to render a simple
|
|
14
16
|
* bezier edge between two nodes.
|
|
15
17
|
* @public
|
|
18
|
+
* @returns
|
|
19
|
+
* - `path`: the path to use in an SVG `<path>` element.
|
|
20
|
+
* - `labelX`: the `x` position you can use to render a label for this edge.
|
|
21
|
+
* - `labelY`: the `y` position you can use to render a label for this edge.
|
|
22
|
+
* - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
|
|
23
|
+
* middle of this path.
|
|
24
|
+
* - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
|
|
25
|
+
* middle of this path.
|
|
16
26
|
*/
|
|
17
27
|
export declare function getSimpleBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }: GetSimpleBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
18
28
|
declare const SimpleBezierEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: SimpleBezierEdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleBezierEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/SimpleBezierEdge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAG/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAkBD
|
|
1
|
+
{"version":3,"file":"SimpleBezierEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/SimpleBezierEdge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAG/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAkBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,GAC9B,EAAE,yBAAyB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAiC9G;AAyDD,QAAA,MAAM,gBAAgB,wPAlCf,qBAAqB,6CAkC0C,CAAC;AACvE,QAAA,MAAM,wBAAwB,wPAnCvB,qBAAqB,6CAmCiD,CAAC;AAK9E,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -7,6 +7,10 @@ import type { InternalNode, Node } from '../types';
|
|
|
7
7
|
* based on a certain condition (e.g. if the connection is valid or not).
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
|
+
* @param connectionSelector - An optional selector function used to extract a slice of the
|
|
11
|
+
* `ConnectionState` data. Using a selector can prevent component re-renders where data you don't
|
|
12
|
+
* otherwise care about might change. If a selector is not provided, the entire `ConnectionState`
|
|
13
|
+
* object is returned unchanged.
|
|
10
14
|
* @example
|
|
11
15
|
*
|
|
12
16
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAqBnE
|
|
1
|
+
{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAqBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAClH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,cAAc,GAC3F,cAAc,CAGhB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Connection, HandleConnection, HandleType } from '@xyflow/system';
|
|
2
|
-
type
|
|
2
|
+
type UseHandleConnectionsParams = {
|
|
3
|
+
/** What type of handle connections do you want to observe? */
|
|
3
4
|
type: HandleType;
|
|
5
|
+
/** The handle id (this is only needed if the node has multiple handles of the same type). */
|
|
4
6
|
id?: string | null;
|
|
7
|
+
/** If node id is not provided, the node id from the `NodeIdContext` is used. */
|
|
5
8
|
nodeId?: string;
|
|
9
|
+
/** Gets called when a connection is established. */
|
|
6
10
|
onConnect?: (connections: Connection[]) => void;
|
|
11
|
+
/** Gets called when a connection is removed. */
|
|
7
12
|
onDisconnect?: (connections: Connection[]) => void;
|
|
8
13
|
};
|
|
9
14
|
/**
|
|
@@ -11,13 +16,8 @@ type useHandleConnectionsParams = {
|
|
|
11
16
|
*
|
|
12
17
|
* @public
|
|
13
18
|
* @deprecated Use `useNodeConnections` instead.
|
|
14
|
-
* @
|
|
15
|
-
* @param param.nodeId - node id - if not provided, the node id from the NodeIdContext is used
|
|
16
|
-
* @param param.id - the handle id (this is only needed if the node has multiple handles of the same type)
|
|
17
|
-
* @param param.onConnect - gets called when a connection is established
|
|
18
|
-
* @param param.onDisconnect - gets called when a connection is removed
|
|
19
|
-
* @returns an array with handle connections
|
|
19
|
+
* @returns An array with handle connections.
|
|
20
20
|
*/
|
|
21
|
-
export declare function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }:
|
|
21
|
+
export declare function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }: UseHandleConnectionsParams): HandleConnection[];
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=useHandleConnections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHandleConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useHandleConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAKxB,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"useHandleConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useHandleConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAKxB,KAAK,0BAA0B,GAAG;IAChC,8DAA8D;IAC9D,IAAI,EAAE,UAAU,CAAC;IACjB,6FAA6F;IAC7F,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,EAAE,EACF,MAAM,EACN,SAAS,EACT,YAAY,GACb,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CA2BjD"}
|
|
@@ -5,8 +5,8 @@ import type { InternalNode, Node } from '../types';
|
|
|
5
5
|
* including when a node is selected or moved.
|
|
6
6
|
*
|
|
7
7
|
* @public
|
|
8
|
-
* @param id -
|
|
9
|
-
* @returns
|
|
8
|
+
* @param id - The ID of a node you want to observe.
|
|
9
|
+
* @returns The `InternalNode` object for the node with the given ID.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type KeyCode } from '@xyflow/system';
|
|
2
2
|
export type UseKeyPressOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Listen to key presses on a specific element.
|
|
5
|
+
* @default document
|
|
6
|
+
*/
|
|
3
7
|
target?: Window | Document | HTMLElement | ShadowRoot | null;
|
|
8
|
+
/**
|
|
9
|
+
* You can use this flag to prevent triggering the key press hook when an input field is focused.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
4
12
|
actInsideInputWithModifier?: boolean;
|
|
5
13
|
preventDefault?: boolean;
|
|
6
14
|
};
|
|
@@ -9,9 +17,7 @@ export type UseKeyPressOptions = {
|
|
|
9
17
|
* currently pressed or not.
|
|
10
18
|
*
|
|
11
19
|
* @public
|
|
12
|
-
* @param
|
|
13
|
-
* @param param.options - Options
|
|
14
|
-
* @returns boolean
|
|
20
|
+
* @param options - Options
|
|
15
21
|
*
|
|
16
22
|
* @example
|
|
17
23
|
* ```tsx
|
|
@@ -30,5 +36,18 @@ export type UseKeyPressOptions = {
|
|
|
30
36
|
*}
|
|
31
37
|
*```
|
|
32
38
|
*/
|
|
33
|
-
export declare function useKeyPress(
|
|
39
|
+
export declare function useKeyPress(
|
|
40
|
+
/**
|
|
41
|
+
* The key code (string or array of strings) specifies which key(s) should trigger
|
|
42
|
+
* an action.
|
|
43
|
+
*
|
|
44
|
+
* A **string** can represent:
|
|
45
|
+
* - A **single key**, e.g. `'a'`
|
|
46
|
+
* - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'`
|
|
47
|
+
*
|
|
48
|
+
* An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']`
|
|
49
|
+
* means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`.
|
|
50
|
+
* @default null
|
|
51
|
+
*/
|
|
52
|
+
keyCode?: KeyCode | null, options?: UseKeyPressOptions): boolean;
|
|
34
53
|
//# sourceMappingURL=useKeyPress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyPress.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAC7D,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAIF
|
|
1
|
+
{"version":3,"file":"useKeyPress.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAC7D;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW;AACzB;;;;;;;;;;;GAWG;AACH,OAAO,GAAE,OAAO,GAAG,IAAW,EAC9B,OAAO,GAAE,kBAA6E,GACrF,OAAO,CAsGT"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Connection, NodeConnection, HandleType } from '@xyflow/system';
|
|
2
2
|
type UseNodeConnectionsParams = {
|
|
3
|
+
/** ID of the node, filled in automatically if used inside custom node. */
|
|
3
4
|
id?: string;
|
|
5
|
+
/** What type of handle connections do you want to observe? */
|
|
4
6
|
handleType?: HandleType;
|
|
7
|
+
/** Filter by handle id (this is only needed if the node has multiple handles of the same type). */
|
|
5
8
|
handleId?: string;
|
|
9
|
+
/** Gets called when a connection is established. */
|
|
6
10
|
onConnect?: (connections: Connection[]) => void;
|
|
11
|
+
/** Gets called when a connection is removed. */
|
|
7
12
|
onDisconnect?: (connections: Connection[]) => void;
|
|
8
13
|
};
|
|
9
14
|
/**
|
|
10
15
|
* This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID.
|
|
11
16
|
*
|
|
12
17
|
* @public
|
|
13
|
-
* @
|
|
14
|
-
* @param param.handleType - filter by handle type 'source' or 'target'
|
|
15
|
-
* @param param.handleId - filter by handle id (this is only needed if the node has multiple handles of the same type)
|
|
16
|
-
* @param param.onConnect - gets called when a connection is established
|
|
17
|
-
* @param param.onDisconnect - gets called when a connection is removed
|
|
18
|
-
* @returns an array with connections
|
|
18
|
+
* @returns An array with connections.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```jsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodeConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodeConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,cAAc,EACd,UAAU,EAIX,MAAM,gBAAgB,CAAC;AAOxB,KAAK,wBAAwB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"useNodeConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodeConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,cAAc,EACd,UAAU,EAIX,MAAM,gBAAgB,CAAC;AAOxB,KAAK,wBAAwB,GAAG;IAC9B,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,EAAE,EACF,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,GACb,GAAE,wBAA6B,GAAG,cAAc,EAAE,CA8BlD"}
|
|
@@ -3,11 +3,9 @@ import type { Node } from '../types';
|
|
|
3
3
|
* This hook lets you subscribe to changes of a specific nodes `data` object.
|
|
4
4
|
*
|
|
5
5
|
* @public
|
|
6
|
-
* @
|
|
7
|
-
* @returns An object (or array of object) with {id, type, data} representing each node
|
|
6
|
+
* @returns An object (or array of object) with `id`, `type`, `data` representing each node.
|
|
8
7
|
*
|
|
9
8
|
* @example
|
|
10
|
-
*
|
|
11
9
|
*```jsx
|
|
12
10
|
*import { useNodesData } from '@xyflow/react';
|
|
13
11
|
*
|
|
@@ -19,6 +17,10 @@ import type { Node } from '../types';
|
|
|
19
17
|
*}
|
|
20
18
|
*```
|
|
21
19
|
*/
|
|
22
|
-
export declare function useNodesData<NodeType extends Node = Node>(
|
|
23
|
-
|
|
20
|
+
export declare function useNodesData<NodeType extends Node = Node>(
|
|
21
|
+
/** The id of the node to get the data from. */
|
|
22
|
+
nodeId: string): Pick<NodeType, 'id' | 'type' | 'data'> | null;
|
|
23
|
+
export declare function useNodesData<NodeType extends Node = Node>(
|
|
24
|
+
/** The ids of the nodes to get the data from. */
|
|
25
|
+
nodeIds: string[]): Pick<NodeType, 'id' | 'type' | 'data'>[];
|
|
24
26
|
//# sourceMappingURL=useNodesData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodesData.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"useNodesData.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI;AACvD,+CAA+C;AAC/C,MAAM,EAAE,MAAM,GACb,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;AACjD,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI;AACvD,iDAAiD;AACjD,OAAO,EAAE,MAAM,EAAE,GAChB,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC"}
|
|
@@ -6,8 +6,16 @@ import type { Node, Edge, OnNodesChange, OnEdgesChange } from '../types';
|
|
|
6
6
|
* like React's `useState` hook with an additional helper callback.
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
9
|
+
* @returns
|
|
10
|
+
* - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your
|
|
11
|
+
* `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,
|
|
12
|
+
* for example.
|
|
13
|
+
* - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of
|
|
14
|
+
* nodes or a callback that receives the current array of nodes and returns a new array of nodes.
|
|
15
|
+
* This is the same as the second element of the tuple returned by React's `useState` hook.
|
|
16
|
+
* - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes
|
|
17
|
+
* state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your
|
|
18
|
+
* `<ReactFlow />` component.
|
|
11
19
|
* @example
|
|
12
20
|
*
|
|
13
21
|
*```tsx
|
|
@@ -37,15 +45,29 @@ import type { Node, Edge, OnNodesChange, OnEdgesChange } from '../types';
|
|
|
37
45
|
* like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.
|
|
38
46
|
*
|
|
39
47
|
*/
|
|
40
|
-
export declare function useNodesState<NodeType extends Node>(initialNodes: NodeType[]): [
|
|
48
|
+
export declare function useNodesState<NodeType extends Node>(initialNodes: NodeType[]): [
|
|
49
|
+
nodes: NodeType[],
|
|
50
|
+
setNodes: Dispatch<SetStateAction<NodeType[]>>,
|
|
51
|
+
onNodesChange: OnNodesChange<NodeType>
|
|
52
|
+
];
|
|
41
53
|
/**
|
|
42
54
|
* This hook makes it easy to prototype a controlled flow where you manage the
|
|
43
55
|
* state of nodes and edges outside the `ReactFlowInstance`. You can think of it
|
|
44
56
|
* like React's `useState` hook with an additional helper callback.
|
|
45
57
|
*
|
|
46
58
|
* @public
|
|
47
|
-
* @
|
|
48
|
-
*
|
|
59
|
+
* @returns
|
|
60
|
+
* - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your
|
|
61
|
+
* `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,
|
|
62
|
+
* for example.
|
|
63
|
+
*
|
|
64
|
+
* - `setEdges`: A function that you can use to update the edges. You can pass it a new array of
|
|
65
|
+
* edges or a callback that receives the current array of edges and returns a new array of edges.
|
|
66
|
+
* This is the same as the second element of the tuple returned by React's `useState` hook.
|
|
67
|
+
*
|
|
68
|
+
* - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges
|
|
69
|
+
* state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your
|
|
70
|
+
* `<ReactFlow />` component.
|
|
49
71
|
* @example
|
|
50
72
|
*
|
|
51
73
|
*```tsx
|
|
@@ -75,5 +97,9 @@ export declare function useNodesState<NodeType extends Node>(initialNodes: NodeT
|
|
|
75
97
|
* like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.
|
|
76
98
|
*
|
|
77
99
|
*/
|
|
78
|
-
export declare function useEdgesState<EdgeType extends Edge = Edge>(initialEdges: EdgeType[]): [
|
|
100
|
+
export declare function useEdgesState<EdgeType extends Edge = Edge>(initialEdges: EdgeType[]): [
|
|
101
|
+
edges: EdgeType[],
|
|
102
|
+
setEdges: Dispatch<SetStateAction<EdgeType[]>>,
|
|
103
|
+
onEdgesChange: OnEdgesChange<EdgeType>
|
|
104
|
+
];
|
|
79
105
|
//# sourceMappingURL=useNodesEdgesState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodesEdgesState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesEdgesState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"useNodesEdgesState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesEdgesState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,EACjD,YAAY,EAAE,QAAQ,EAAE,GACvB;IAED,KAAK,EAAE,QAAQ,EAAE;IACjB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;CACvC,CAQA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACxD,YAAY,EAAE,QAAQ,EAAE,GACvB;IAED,KAAK,EAAE,QAAQ,EAAE;IACjB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;CACvC,CAQA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type UseNodesInitializedOptions = {
|
|
2
|
+
/** @default false */
|
|
2
3
|
includeHiddenNodes?: boolean;
|
|
3
4
|
};
|
|
4
5
|
/**
|
|
@@ -7,8 +8,8 @@ export type UseNodesInitializedOptions = {
|
|
|
7
8
|
*`false` and then `true` again once the node has been measured.
|
|
8
9
|
*
|
|
9
10
|
* @public
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
11
|
+
* @returns Whether or not the nodes have been initialized by the `<ReactFlow />` component and
|
|
12
|
+
* given a width and height.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```jsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodesInitialized.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesInitialized.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,0BAA0B,GAAG;IACvC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAkBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAER,GACA,OAAO,CAIT"}
|
|
1
|
+
{"version":3,"file":"useNodesInitialized.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesInitialized.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,0BAA0B,GAAG;IACvC,qBAAqB;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAkBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAER,GACA,OAAO,CAIT"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OnSelectionChangeFunc, Node, Edge } from '../types';
|
|
2
2
|
export type UseOnSelectionChangeOptions<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
3
|
+
/** The handler to register. */
|
|
3
4
|
onChange: OnSelectionChangeFunc<NodeType, EdgeType>;
|
|
4
5
|
};
|
|
5
6
|
/**
|
|
@@ -8,8 +9,6 @@ export type UseOnSelectionChangeOptions<NodeType extends Node = Node, EdgeType e
|
|
|
8
9
|
*_either_ nodes or edges changes.
|
|
9
10
|
*
|
|
10
11
|
* @public
|
|
11
|
-
* @param params.onChange - The handler to register
|
|
12
|
-
*
|
|
13
12
|
* @example
|
|
14
13
|
* ```jsx
|
|
15
14
|
*import { useState } from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnSelectionChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnSelectionChange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACpG,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACrD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"useOnSelectionChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnSelectionChange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACpG,+BAA+B;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC/F,QAAQ,GACT,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAYjD"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { OnViewportChange } from '@xyflow/system';
|
|
2
2
|
export type UseOnViewportChangeOptions = {
|
|
3
|
+
/** Gets called when the viewport starts changing. */
|
|
3
4
|
onStart?: OnViewportChange;
|
|
5
|
+
/** Gets called when the viewport changes. */
|
|
4
6
|
onChange?: OnViewportChange;
|
|
7
|
+
/** Gets called when the viewport stops changing. */
|
|
5
8
|
onEnd?: OnViewportChange;
|
|
6
9
|
};
|
|
7
10
|
/**
|
|
8
11
|
* The `useOnViewportChange` hook lets you listen for changes to the viewport such
|
|
9
|
-
*as panning and zooming. You can provide a callback for each phase of a viewport
|
|
10
|
-
*change: `onStart`, `onChange`, and `onEnd`.
|
|
12
|
+
* as panning and zooming. You can provide a callback for each phase of a viewport
|
|
13
|
+
* change: `onStart`, `onChange`, and `onEnd`.
|
|
11
14
|
*
|
|
12
15
|
* @public
|
|
13
|
-
* @param params.onStart - gets called when the viewport starts changing
|
|
14
|
-
* @param params.onChange - gets called when the viewport changes
|
|
15
|
-
* @param params.onEnd - gets called when the viewport stops changing
|
|
16
|
-
*
|
|
17
16
|
* @example
|
|
18
17
|
* ```jsx
|
|
19
18
|
*import { useCallback } from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnViewportChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnViewportChange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"useOnViewportChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnViewportChange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,qDAAqD;IACrD,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,oDAAoD;IACpD,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,0BAA0B,QAc3F"}
|
|
@@ -3,8 +3,6 @@ import type { ReactFlowInstance, Node, Edge } from '../types';
|
|
|
3
3
|
* This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.
|
|
4
4
|
*
|
|
5
5
|
* @public
|
|
6
|
-
* @returns ReactFlowInstance
|
|
7
|
-
*
|
|
8
6
|
* @example
|
|
9
7
|
* ```jsx
|
|
10
8
|
*import { useCallback, useState } from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactFlow.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,iBAAiB,EACjB,IAAI,EACJ,IAAI,EAKL,MAAM,UAAU,CAAC;AAIlB
|
|
1
|
+
{"version":3,"file":"useReactFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactFlow.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,iBAAiB,EACjB,IAAI,EACJ,IAAI,EAKL,MAAM,UAAU,CAAC;AAIlB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,iBAAiB,CAC3G,QAAQ,EACR,QAAQ,CACT,CAiPA"}
|