@xyflow/react 12.5.3 → 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/base.css +2 -2
- package/dist/esm/additional-components/Background/types.d.ts +9 -9
- package/dist/esm/additional-components/Background/types.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/types.d.ts +65 -19
- package/dist/esm/additional-components/MiniMap/types.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/types.d.ts +37 -18
- package/dist/esm/additional-components/NodeResizer/types.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeToolbar/types.d.ts +6 -5
- package/dist/esm/additional-components/NodeToolbar/types.d.ts.map +1 -1
- package/dist/esm/components/Edges/SimpleBezierEdge.d.ts +10 -0
- package/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map +1 -1
- package/dist/esm/components/Panel/index.d.ts +5 -5
- package/dist/esm/components/Panel/index.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 +103 -74
- package/dist/esm/index.mjs +103 -74
- 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 +26 -8
- package/dist/esm/types/edges.d.ts.map +1 -1
- package/dist/esm/types/general.d.ts +11 -6
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/types/instance.d.ts +23 -8
- package/dist/esm/types/instance.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/style.css +2 -2
- package/dist/umd/additional-components/Background/types.d.ts +9 -9
- package/dist/umd/additional-components/Background/types.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/types.d.ts +65 -19
- package/dist/umd/additional-components/MiniMap/types.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/types.d.ts +37 -18
- package/dist/umd/additional-components/NodeResizer/types.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeToolbar/types.d.ts +6 -5
- package/dist/umd/additional-components/NodeToolbar/types.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/components/Panel/index.d.ts +5 -5
- package/dist/umd/components/Panel/index.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 +26 -8
- package/dist/umd/types/edges.d.ts.map +1 -1
- package/dist/umd/types/general.d.ts +11 -6
- package/dist/umd/types/general.d.ts.map +1 -1
- package/dist/umd/types/instance.d.ts +23 -8
- package/dist/umd/types/instance.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
package/dist/base.css
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
--xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);
|
|
14
14
|
|
|
15
15
|
--xy-minimap-background-color-default: #fff;
|
|
16
|
-
--xy-minimap-mask-background-color-default:
|
|
16
|
+
--xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
|
|
17
17
|
--xy-minimap-mask-stroke-color-default: transparent;
|
|
18
18
|
--xy-minimap-mask-stroke-width-default: 1;
|
|
19
19
|
--xy-minimap-node-background-color-default: #e2e2e2;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
--xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);
|
|
46
46
|
|
|
47
47
|
--xy-minimap-background-color-default: #141414;
|
|
48
|
-
--xy-minimap-mask-background-color-default:
|
|
48
|
+
--xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);
|
|
49
49
|
--xy-minimap-mask-stroke-color-default: transparent;
|
|
50
50
|
--xy-minimap-mask-stroke-width-default: 1;
|
|
51
51
|
--xy-minimap-node-background-color-default: #2b2b2b;
|
|
@@ -16,18 +16,18 @@ export declare enum BackgroundVariant {
|
|
|
16
16
|
export type BackgroundProps = {
|
|
17
17
|
/** When multiple backgrounds are present on the page, each one should have a unique id. */
|
|
18
18
|
id?: string;
|
|
19
|
-
/** Color of the pattern */
|
|
19
|
+
/** Color of the pattern. */
|
|
20
20
|
color?: string;
|
|
21
|
-
/** Color of the background */
|
|
21
|
+
/** Color of the background. */
|
|
22
22
|
bgColor?: string;
|
|
23
|
-
/** Class applied to the container */
|
|
23
|
+
/** Class applied to the container. */
|
|
24
24
|
className?: string;
|
|
25
|
-
/** Class applied to the pattern */
|
|
25
|
+
/** Class applied to the pattern. */
|
|
26
26
|
patternClassName?: string;
|
|
27
27
|
/**
|
|
28
28
|
* The gap between patterns. Passing in a tuple allows you to control the x and y gap
|
|
29
29
|
* independently.
|
|
30
|
-
* @default
|
|
30
|
+
* @default 20
|
|
31
31
|
*/
|
|
32
32
|
gap?: number | [number, number];
|
|
33
33
|
/**
|
|
@@ -37,8 +37,8 @@ export type BackgroundProps = {
|
|
|
37
37
|
*/
|
|
38
38
|
size?: number;
|
|
39
39
|
/**
|
|
40
|
-
* Offset of the pattern
|
|
41
|
-
* @default
|
|
40
|
+
* Offset of the pattern.
|
|
41
|
+
* @default 0
|
|
42
42
|
*/
|
|
43
43
|
offset?: number | [number, number];
|
|
44
44
|
/**
|
|
@@ -47,13 +47,13 @@ export type BackgroundProps = {
|
|
|
47
47
|
*/
|
|
48
48
|
lineWidth?: number;
|
|
49
49
|
/**
|
|
50
|
-
* Variant of the pattern
|
|
50
|
+
* Variant of the pattern.
|
|
51
51
|
* @default BackgroundVariant.Dots
|
|
52
52
|
* @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross
|
|
53
53
|
* 'lines', 'dots', 'cross'
|
|
54
54
|
*/
|
|
55
55
|
variant?: BackgroundVariant;
|
|
56
|
-
/** Style applied to the container */
|
|
56
|
+
/** Style applied to the container. */
|
|
57
57
|
style?: CSSProperties;
|
|
58
58
|
};
|
|
59
59
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,sCAAsC;IACtC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiniMapNodes.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMapNodes.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAkB,IAAI,
|
|
1
|
+
{"version":3,"file":"MiniMapNodes.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMapNodes.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAA6C,MAAM,SAAS,CAAC;AAQ5G,iBAAS,YAAY,CAAC,QAAQ,SAAS,IAAI,EAAE,EAC3C,eAAe,EACf,SAAS,EACT,aAAkB,EAClB,gBAAoB,EACpB,eAAe,EAKf,aAAa,EAAE,aAA2B,EAC1C,OAAO,GACR,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CAiC7B;;AAgED,wBAAyD"}
|
|
@@ -6,47 +6,93 @@ export type GetMiniMapNodeAttribute<NodeType extends Node = Node> = (node: NodeT
|
|
|
6
6
|
* @expand
|
|
7
7
|
*/
|
|
8
8
|
export type MiniMapProps<NodeType extends Node = Node> = Omit<HTMLAttributes<SVGSVGElement>, 'onClick'> & {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Color of nodes on minimap.
|
|
11
|
+
* @default "#e2e2e2"
|
|
12
|
+
*/
|
|
10
13
|
nodeColor?: string | GetMiniMapNodeAttribute<NodeType>;
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Stroke color of nodes on minimap.
|
|
16
|
+
* @default "transparent"
|
|
17
|
+
*/
|
|
12
18
|
nodeStrokeColor?: string | GetMiniMapNodeAttribute<NodeType>;
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Class name applied to nodes on minimap.
|
|
21
|
+
* @default ""
|
|
22
|
+
*/
|
|
14
23
|
nodeClassName?: string | GetMiniMapNodeAttribute<NodeType>;
|
|
15
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Border radius of nodes on minimap.
|
|
26
|
+
* @default 5
|
|
27
|
+
*/
|
|
16
28
|
nodeBorderRadius?: number;
|
|
17
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Stroke width of nodes on minimap.
|
|
31
|
+
* @default 2
|
|
32
|
+
*/
|
|
18
33
|
nodeStrokeWidth?: number;
|
|
19
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* A custom component to render the nodes in the minimap. This component must render an SVG
|
|
36
|
+
* element!
|
|
37
|
+
*/
|
|
20
38
|
nodeComponent?: ComponentType<MiniMapNodeProps>;
|
|
21
|
-
/** Background color of minimap */
|
|
39
|
+
/** Background color of minimap. */
|
|
22
40
|
bgColor?: string;
|
|
23
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The color of the mask that covers the portion of the minimap not currently visible in the
|
|
43
|
+
* viewport.
|
|
44
|
+
* @default "rgba(240, 240, 240, 0.6)"
|
|
45
|
+
*/
|
|
24
46
|
maskColor?: string;
|
|
25
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Stroke color of mask representing viewport.
|
|
49
|
+
* @default transparent
|
|
50
|
+
*/
|
|
26
51
|
maskStrokeColor?: string;
|
|
27
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Stroke width of mask representing viewport.
|
|
54
|
+
* @default 1
|
|
55
|
+
*/
|
|
28
56
|
maskStrokeWidth?: number;
|
|
29
57
|
/**
|
|
30
|
-
* Position of minimap on pane
|
|
58
|
+
* Position of minimap on pane.
|
|
59
|
+
* @default PanelPosition.BottomRight
|
|
31
60
|
* @example PanelPosition.TopLeft, PanelPosition.TopRight,
|
|
32
61
|
* PanelPosition.BottomLeft, PanelPosition.BottomRight
|
|
33
62
|
*/
|
|
34
63
|
position?: PanelPosition;
|
|
35
|
-
/** Callback
|
|
64
|
+
/** Callback called when minimap is clicked. */
|
|
36
65
|
onClick?: (event: MouseEvent, position: XYPosition) => void;
|
|
37
|
-
/** Callback called when node on minimap is clicked */
|
|
66
|
+
/** Callback called when node on minimap is clicked. */
|
|
38
67
|
onNodeClick?: (event: MouseEvent, node: NodeType) => void;
|
|
39
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Determines whether you can pan the viewport by dragging inside the minimap.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
40
72
|
pannable?: boolean;
|
|
41
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Determines whether you can zoom the viewport by scrolling inside the minimap.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
42
77
|
zoomable?: boolean;
|
|
43
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* There is no text inside the minimap for a screen reader to use as an accessible name, so it's
|
|
80
|
+
* important we provide one to make the minimap accessible. The default is sufficient, but you may
|
|
81
|
+
* want to replace it with something more relevant to your app or product.
|
|
82
|
+
* @default "React Flow mini map"
|
|
83
|
+
*/
|
|
44
84
|
ariaLabel?: string | null;
|
|
45
|
-
/** Invert direction when panning the minimap viewport */
|
|
85
|
+
/** Invert direction when panning the minimap viewport. */
|
|
46
86
|
inversePan?: boolean;
|
|
47
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Step size for zooming in/out on minimap.
|
|
89
|
+
* @default 10
|
|
90
|
+
*/
|
|
48
91
|
zoomStep?: number;
|
|
49
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Offset the viewport on the minimap, acts like a padding.
|
|
94
|
+
* @default 5
|
|
95
|
+
*/
|
|
50
96
|
offsetScale?: number;
|
|
51
97
|
};
|
|
52
98
|
export type MiniMapNodes<NodeType extends Node = Node> = Pick<MiniMapProps<NodeType>, 'nodeColor' | 'nodeStrokeColor' | 'nodeClassName' | 'nodeBorderRadius' | 'nodeStrokeWidth' | 'nodeComponent'> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,GAAG;IACxG
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeResizeControl.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizeControl.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE1E,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAqC,EACrC,SAAS,EACT,KAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"NodeResizeControl.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizeControl.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE1E,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAqC,EACrC,SAAS,EACT,KAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,kBAAkB,2CAqKpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2DAAsB,CAAC"}
|
|
@@ -5,39 +5,57 @@ import type { ControlPosition, ControlLinePosition, ResizeControlVariant, Should
|
|
|
5
5
|
*/
|
|
6
6
|
export type NodeResizerProps = {
|
|
7
7
|
/**
|
|
8
|
-
* Id of the node it is resizing
|
|
8
|
+
* Id of the node it is resizing.
|
|
9
9
|
* @remarks optional if used inside custom node
|
|
10
10
|
*/
|
|
11
11
|
nodeId?: string;
|
|
12
|
-
/** Color of the resize handle */
|
|
12
|
+
/** Color of the resize handle. */
|
|
13
13
|
color?: string;
|
|
14
|
-
/**
|
|
14
|
+
/** Class name applied to handle. */
|
|
15
15
|
handleClassName?: string;
|
|
16
|
-
/** Style applied to handle */
|
|
16
|
+
/** Style applied to handle. */
|
|
17
17
|
handleStyle?: CSSProperties;
|
|
18
|
-
/**
|
|
18
|
+
/** Class name applied to line. */
|
|
19
19
|
lineClassName?: string;
|
|
20
|
-
/** Style applied to line */
|
|
20
|
+
/** Style applied to line. */
|
|
21
21
|
lineStyle?: CSSProperties;
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Are the controls visible.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
23
26
|
isVisible?: boolean;
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Minimum width of node.
|
|
29
|
+
* @default 10
|
|
30
|
+
*/
|
|
25
31
|
minWidth?: number;
|
|
26
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Minimum height of node.
|
|
34
|
+
* @default 10
|
|
35
|
+
*/
|
|
27
36
|
minHeight?: number;
|
|
28
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Maximum width of node.
|
|
39
|
+
* @default Number.MAX_VALUE
|
|
40
|
+
*/
|
|
29
41
|
maxWidth?: number;
|
|
30
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Maximum height of node.
|
|
44
|
+
* @default Number.MAX_VALUE
|
|
45
|
+
*/
|
|
31
46
|
maxHeight?: number;
|
|
32
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Keep aspect ratio when resizing.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
33
51
|
keepAspectRatio?: boolean;
|
|
34
|
-
/** Callback to determine if node should resize */
|
|
52
|
+
/** Callback to determine if node should resize. */
|
|
35
53
|
shouldResize?: ShouldResize;
|
|
36
|
-
/** Callback called when resizing starts */
|
|
54
|
+
/** Callback called when resizing starts. */
|
|
37
55
|
onResizeStart?: OnResizeStart;
|
|
38
|
-
/** Callback called when resizing */
|
|
56
|
+
/** Callback called when resizing. */
|
|
39
57
|
onResize?: OnResize;
|
|
40
|
-
/** Callback called when resizing ends */
|
|
58
|
+
/** Callback called when resizing ends. */
|
|
41
59
|
onResizeEnd?: OnResizeEnd;
|
|
42
60
|
};
|
|
43
61
|
/**
|
|
@@ -45,13 +63,14 @@ export type NodeResizerProps = {
|
|
|
45
63
|
*/
|
|
46
64
|
export type ResizeControlProps = Pick<NodeResizerProps, 'nodeId' | 'color' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight' | 'keepAspectRatio' | 'shouldResize' | 'onResizeStart' | 'onResize' | 'onResizeEnd'> & {
|
|
47
65
|
/**
|
|
48
|
-
* Position of the control
|
|
66
|
+
* Position of the control.
|
|
49
67
|
* @example ControlPosition.TopLeft, ControlPosition.TopRight,
|
|
50
68
|
* ControlPosition.BottomLeft, ControlPosition.BottomRight
|
|
51
69
|
*/
|
|
52
70
|
position?: ControlPosition;
|
|
53
71
|
/**
|
|
54
|
-
* Variant of the control
|
|
72
|
+
* Variant of the control.
|
|
73
|
+
* @default "handle"
|
|
55
74
|
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line
|
|
56
75
|
*/
|
|
57
76
|
variant?: ResizeControlVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mDAAmD;IACnD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,gBAAgB,EACd,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,UAAU,GACV,aAAa,CAChB,GAAG;IACF;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACxD,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,CAAC"}
|
|
@@ -9,12 +9,12 @@ export type NodeToolbarProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
9
9
|
* of nodes.
|
|
10
10
|
*/
|
|
11
11
|
nodeId?: string | string[];
|
|
12
|
-
/** If true
|
|
12
|
+
/** If `true`, node toolbar is visible even if node is not selected. */
|
|
13
13
|
isVisible?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
* Position of the toolbar relative to the node
|
|
16
|
-
* @
|
|
17
|
-
* Position.BottomLeft, Position.BottomRight
|
|
15
|
+
* Position of the toolbar relative to the node.
|
|
16
|
+
* @default Position.Top
|
|
17
|
+
* @example Position.TopLeft, Position.TopRight, Position.BottomLeft, Position.BottomRight
|
|
18
18
|
*/
|
|
19
19
|
position?: Position;
|
|
20
20
|
/**
|
|
@@ -23,7 +23,8 @@ export type NodeToolbarProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
23
23
|
*/
|
|
24
24
|
offset?: number;
|
|
25
25
|
/**
|
|
26
|
-
* Align the toolbar relative to the node
|
|
26
|
+
* Align the toolbar relative to the node.
|
|
27
|
+
* @default "center"
|
|
27
28
|
* @example Align.Start, Align.Center, Align.End
|
|
28
29
|
*/
|
|
29
30
|
align?: Align;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"}
|
|
@@ -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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
import type { PanelPosition } from '@xyflow/system';
|
|
3
3
|
/**
|
|
4
4
|
* @expand
|
|
5
5
|
*/
|
|
6
6
|
export type PanelProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
7
|
/**
|
|
8
|
-
* The position of the panel
|
|
8
|
+
* The position of the panel.
|
|
9
|
+
* @default "top-left"
|
|
9
10
|
*/
|
|
10
11
|
position?: PanelPosition;
|
|
11
|
-
children: ReactNode;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* The `<Panel />` component helps you position content above the viewport.
|
|
@@ -37,9 +37,9 @@ export type PanelProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const Panel: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
39
39
|
/**
|
|
40
|
-
* The position of the panel
|
|
40
|
+
* The position of the panel.
|
|
41
|
+
* @default "top-left"
|
|
41
42
|
*/
|
|
42
43
|
position?: PanelPosition | undefined;
|
|
43
|
-
children: ReactNode;
|
|
44
44
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
45
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACxD;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,KAAK;IAlChB;;;OAGG;;kDA+CJ,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"}
|