@xyflow/react 12.3.4 → 12.3.6

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 (40) hide show
  1. package/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -1
  2. package/dist/esm/components/BatchProvider/useQueue.d.ts.map +1 -1
  3. package/dist/esm/components/Edges/BaseEdge.d.ts +1 -1
  4. package/dist/esm/components/Edges/BaseEdge.d.ts.map +1 -1
  5. package/dist/esm/components/NodeWrapper/index.d.ts.map +1 -1
  6. package/dist/esm/components/NodesSelection/index.d.ts.map +1 -1
  7. package/dist/esm/components/Panel/index.d.ts +8 -2
  8. package/dist/esm/components/Panel/index.d.ts.map +1 -1
  9. package/dist/esm/container/EdgeRenderer/index.d.ts.map +1 -1
  10. package/dist/esm/hooks/useKeyPress.d.ts.map +1 -1
  11. package/dist/esm/hooks/useReactFlow.d.ts.map +1 -1
  12. package/dist/esm/index.js +34 -33
  13. package/dist/esm/index.mjs +34 -33
  14. package/dist/esm/store/index.d.ts.map +1 -1
  15. package/dist/esm/types/component-props.d.ts +1 -1
  16. package/dist/esm/types/component-props.d.ts.map +1 -1
  17. package/dist/esm/types/edges.d.ts +3 -15
  18. package/dist/esm/types/edges.d.ts.map +1 -1
  19. package/dist/esm/types/nodes.d.ts +1 -1
  20. package/dist/esm/types/nodes.d.ts.map +1 -1
  21. package/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -1
  22. package/dist/umd/components/BatchProvider/useQueue.d.ts.map +1 -1
  23. package/dist/umd/components/Edges/BaseEdge.d.ts +1 -1
  24. package/dist/umd/components/Edges/BaseEdge.d.ts.map +1 -1
  25. package/dist/umd/components/NodeWrapper/index.d.ts.map +1 -1
  26. package/dist/umd/components/NodesSelection/index.d.ts.map +1 -1
  27. package/dist/umd/components/Panel/index.d.ts +8 -2
  28. package/dist/umd/components/Panel/index.d.ts.map +1 -1
  29. package/dist/umd/container/EdgeRenderer/index.d.ts.map +1 -1
  30. package/dist/umd/hooks/useKeyPress.d.ts.map +1 -1
  31. package/dist/umd/hooks/useReactFlow.d.ts.map +1 -1
  32. package/dist/umd/index.js +2 -2
  33. package/dist/umd/store/index.d.ts.map +1 -1
  34. package/dist/umd/types/component-props.d.ts +1 -1
  35. package/dist/umd/types/component-props.d.ts.map +1 -1
  36. package/dist/umd/types/edges.d.ts +3 -15
  37. package/dist/umd/types/edges.d.ts.map +1 -1
  38. package/dist/umd/types/nodes.d.ts +1 -1
  39. package/dist/umd/types/nodes.d.ts.map +1 -1
  40. package/package.json +2 -2
@@ -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,2CA8JpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D;AAED,eAAO,MAAM,iBAAiB,2DAAsB,CAAC"}
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,2CA+JpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D;AAED,eAAO,MAAM,iBAAiB,2DAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useQueue.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/useQueue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,YAsCpE"}
1
+ {"version":3,"file":"useQueue.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/useQueue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,YA2BpE"}
@@ -1,3 +1,3 @@
1
1
  import type { BaseEdgeProps } from '../../types';
2
- export declare function BaseEdge({ id, path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, className, interactionWidth, }: BaseEdgeProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth, ...props }: BaseEdgeProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=BaseEdge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/BaseEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAqB,GACtB,EAAE,aAAa,2CAmCf"}
1
+ {"version":3,"file":"BaseEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/BaseEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,gBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,aAAa,2CA2Bf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAgB,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAExE,wBAAgB,WAAW,CAAC,QAAQ,SAAS,IAAI,EAAE,EACjD,EAAE,EACF,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,GACR,EAAE,gBAAgB,CAAC,QAAQ,CAAC,kDA+K5B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAgB,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAExE,wBAAgB,WAAW,CAAC,QAAQ,SAAS,IAAI,EAAE,EACjD,EAAE,EACF,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,GACR,EAAE,gBAAgB,CAAC,QAAQ,CAAC,kDAkL5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodesSelection/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqB,KAAK,UAAU,EAAsB,MAAM,OAAO,CAAC;AAS/E,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,IAAI;IAC1C,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAeF,wBAAgB,cAAc,CAAC,QAAQ,SAAS,IAAI,EAAE,EACpD,sBAAsB,EACtB,cAAc,EACd,mBAAmB,GACpB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,kDA2D/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodesSelection/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqB,KAAK,UAAU,EAAsB,MAAM,OAAO,CAAC;AAS/E,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,IAAI;IAC1C,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAeF,wBAAgB,cAAc,CAAC,QAAQ,SAAS,IAAI,EAAE,EACpD,sBAAsB,EACtB,cAAc,EACd,mBAAmB,GACpB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,kDA6D/B"}
@@ -1,4 +1,4 @@
1
- import type { HTMLAttributes, ReactNode } from 'react';
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  import type { PanelPosition } from '@xyflow/system';
3
3
  export type PanelProps = HTMLAttributes<HTMLDivElement> & {
4
4
  /** Set position of the panel
@@ -7,5 +7,11 @@ export type PanelProps = HTMLAttributes<HTMLDivElement> & {
7
7
  position?: PanelPosition;
8
8
  children: ReactNode;
9
9
  };
10
- export declare function Panel({ position, children, className, style, ...rest }: PanelProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare const Panel: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
11
+ /** Set position of the panel
12
+ * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
13
+ */
14
+ position?: PanelPosition | undefined;
15
+ children: ReactNode;
16
+ } & import("react").RefAttributes<HTMLDivElement>>;
11
17
  //# 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,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACxD;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAIF,wBAAgB,KAAK,CAAC,EAAE,QAAqB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,2CAa/F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACxD;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,KAAK;IAThB;;OAEG;;cAEO,SAAS;kDAqBpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAE9D,KAAK,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACzD,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC5B,aAAa,GACb,mBAAmB,GACnB,oBAAoB,GACpB,2BAA2B,GAC3B,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,MAAM,GACN,qBAAqB,GACrB,WAAW,CACd,GAAG;IACF,QAAQ,CAA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AAe,EACf,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GACpB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CAoC7B;kBArDQ,qBAAqB;;;AAyD9B,eAAO,MAAM,YAAY,8BAA8D,CAAC"}
@@ -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;CACtC,CAAC;AAIF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAKzB,OAAO,GAAE,OAAO,GAAG,IAAW,EAC9B,OAAO,GAAE,kBAA6E,GACrF,OAAO,CA8FT"}
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;CACtC,CAAC;AAIF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAKzB,OAAO,GAAE,OAAO,GAAG,IAAW,EAC9B,OAAO,GAAE,kBAA6E,GACrF,OAAO,CAmGT"}
@@ -1 +1 @@
1
- {"version":3,"file":"useReactFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactFlow.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAgD,MAAM,UAAU,CAAC;AAI5G;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,iBAAiB,CAC3G,QAAQ,EACR,QAAQ,CACT,CAgOA"}
1
+ {"version":3,"file":"useReactFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactFlow.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAgD,MAAM,UAAU,CAAC;AAI5G;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,iBAAiB,CAC3G,QAAQ,EACR,QAAQ,CACT,CA+NA"}
package/dist/esm/index.js CHANGED
@@ -3,7 +3,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import cc from 'classcat';
4
4
  import { errorMessages, infiniteExtent, isInputDOMNode, getFitViewNodes, getDimensions, fitView, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds, evaluateAbsolutePosition, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, updateNodeInternals, updateAbsolutePositions, handleExpandParent, panBy, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform } from '@xyflow/system';
5
5
  export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system';
6
- import { createContext, useContext, useMemo, useEffect, useRef, useState, forwardRef, useLayoutEffect, useCallback, memo } from 'react';
6
+ import { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react';
7
7
  import { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';
8
8
  import { shallow } from 'zustand/shallow';
9
9
  import { createPortal } from 'react-dom';
@@ -68,11 +68,11 @@ function A11yDescriptions({ rfId, disableKeyboardA11y }) {
68
68
  }
69
69
 
70
70
  const selector$n = (s) => (s.userSelectionActive ? 'none' : 'all');
71
- function Panel({ position = 'top-left', children, className, style, ...rest }) {
71
+ const Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => {
72
72
  const pointerEvents = useStore(selector$n);
73
73
  const positionClasses = `${position}`.split('-');
74
- return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ...rest, children: children }));
75
- }
74
+ return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ref: ref, ...rest, children: children }));
75
+ });
76
76
 
77
77
  function Attribution({ proOptions, position = 'bottom-right' }) {
78
78
  if (proOptions?.hideAttribution) {
@@ -322,7 +322,12 @@ keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true
322
322
  const [keyCodes, keysToWatch] = useMemo(() => {
323
323
  if (keyCode !== null) {
324
324
  const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode];
325
- const keys = keyCodeArr.filter((kc) => typeof kc === 'string').map((kc) => kc.split('+'));
325
+ const keys = keyCodeArr
326
+ .filter((kc) => typeof kc === 'string')
327
+ // we first replace all '+' with '\n' which we will use to split the keys on
328
+ // then we replace '\n\n' with '\n+', this way we can also support the combination 'key++'
329
+ // in the end we simply split on '\n' to get the key array
330
+ .map((kc) => kc.replace('+', '\n').replace('\n\n', '\n+').split('\n'));
326
331
  const keysFlat = keys.reduce((res, item) => res.concat(...item), []);
327
332
  return [keys, keysFlat];
328
333
  }
@@ -741,34 +746,25 @@ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffec
741
746
  */
742
747
  function useQueue(runQueue) {
743
748
  // Because we're using a ref above, we need some way to let React know when to
744
- // actually process the queue. We flip this bit of state to `true` any time we
745
- // mutate the queue and then flip it back to `false` after flushing the queue.
746
- const [shouldFlush, setShouldFlush] = useState(false);
749
+ // actually process the queue. We increment this number any time we mutate the
750
+ // queue, creating a new state to trigger the layout effect below.
751
+ // Using a boolean dirty flag here instead would lead to issues related to
752
+ // automatic batching. (https://github.com/xyflow/xyflow/issues/4779)
753
+ const [serial, setSerial] = useState(BigInt(0));
747
754
  // A reference of all the batched updates to process before the next render. We
748
755
  // want a reference here so multiple synchronous calls to `setNodes` etc can be
749
756
  // batched together.
750
- const [queue] = useState(() => createQueue(() => setShouldFlush(true)));
757
+ const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1))));
751
758
  // Layout effects are guaranteed to run before the next render which means we
752
759
  // shouldn't run into any issues with stale state or weird issues that come from
753
760
  // rendering things one frame later than expected (we used to use `setTimeout`).
754
761
  useIsomorphicLayoutEffect(() => {
755
- // Because we need to flip the state back to false after flushing, this should
756
- // trigger the hook again (!). If the hook is being run again we know that any
757
- // updates should have been processed by now and we can safely clear the queue
758
- // and bail early.
759
- if (!shouldFlush) {
760
- queue.reset();
761
- return;
762
- }
763
762
  const queueItems = queue.get();
764
763
  if (queueItems.length) {
765
764
  runQueue(queueItems);
766
765
  queue.reset();
767
766
  }
768
- // Because we're using reactive state to trigger this effect, we need to flip
769
- // it back to false.
770
- setShouldFlush(false);
771
- }, [shouldFlush]);
767
+ }, [serial]);
772
768
  return queue;
773
769
  }
774
770
  function createQueue(cb) {
@@ -869,11 +865,10 @@ function useReactFlow() {
869
865
  ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin)
870
866
  : nodeToUse.position;
871
867
  const nodeWithPosition = {
872
- id: nodeToUse.id,
868
+ ...nodeToUse,
873
869
  position,
874
870
  width: nodeToUse.measured?.width ?? nodeToUse.width,
875
871
  height: nodeToUse.measured?.height ?? nodeToUse.height,
876
- data: nodeToUse.data,
877
872
  };
878
873
  return nodeToRect(nodeWithPosition);
879
874
  };
@@ -1689,6 +1684,7 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
1689
1684
  : undefined;
1690
1685
  const onKeyDown = (event) => {
1691
1686
  if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
1687
+ event.preventDefault();
1692
1688
  moveSelectedNodes({
1693
1689
  direction: arrowKeyDiffs[event.key],
1694
1690
  factor: event.shiftKey ? 4 : 1,
@@ -1901,6 +1897,8 @@ function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onC
1901
1897
  });
1902
1898
  }
1903
1899
  else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
1900
+ // prevent default scrolling behavior on arrow key press when node is moved
1901
+ event.preventDefault();
1904
1902
  store.setState({
1905
1903
  ariaLiveMessage: `Moved selected node ${event.key
1906
1904
  .replace('Arrow', '')
@@ -2097,8 +2095,8 @@ function EdgeTextComponent({ x, y, label, labelStyle = {}, labelShowBg = true, l
2097
2095
  EdgeTextComponent.displayName = 'EdgeText';
2098
2096
  const EdgeText = memo(EdgeTextComponent);
2099
2097
 
2100
- function BaseEdge({ id, path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, className, interactionWidth = 20, }) {
2101
- return (jsxs(Fragment, { children: [jsx("path", { id: id, style: style, d: path, fill: "none", className: cc(['react-flow__edge-path', className]), markerEnd: markerEnd, markerStart: markerStart }), interactionWidth && (jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" })), label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));
2098
+ function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) {
2099
+ return (jsxs(Fragment, { children: [jsx("path", { ...props, d: path, fill: "none", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth && (jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" })), label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));
2102
2100
  }
2103
2101
 
2104
2102
  function getControl({ pos, x1, y1, x2, y2 }) {
@@ -2434,8 +2432,6 @@ function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectabl
2434
2432
  }
2435
2433
 
2436
2434
  const selector$a = (s) => ({
2437
- width: s.width,
2438
- height: s.height,
2439
2435
  edgesFocusable: s.edgesFocusable,
2440
2436
  edgesReconnectable: s.edgesReconnectable,
2441
2437
  elementsSelectable: s.elementsSelectable,
@@ -2779,13 +2775,19 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
2779
2775
  const parentExpandChildren = [];
2780
2776
  const changes = [];
2781
2777
  for (const [id, dragItem] of nodeDragItems) {
2778
+ const expandParent = !!(dragItem?.expandParent && dragItem?.parentId && dragItem?.position);
2782
2779
  const change = {
2783
2780
  id,
2784
2781
  type: 'position',
2785
- position: dragItem.position,
2782
+ position: expandParent
2783
+ ? {
2784
+ x: Math.max(0, dragItem.position.x),
2785
+ y: Math.max(0, dragItem.position.y),
2786
+ }
2787
+ : dragItem.position,
2786
2788
  dragging,
2787
2789
  };
2788
- if (dragItem?.expandParent && dragItem?.parentId && change.position) {
2790
+ if (expandParent) {
2789
2791
  parentExpandChildren.push({
2790
2792
  id,
2791
2793
  parentId: dragItem.parentId,
@@ -2795,8 +2797,6 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
2795
2797
  height: dragItem.measured.height,
2796
2798
  },
2797
2799
  });
2798
- change.position.x = Math.max(0, change.position.x);
2799
- change.position.y = Math.max(0, change.position.y);
2800
2800
  }
2801
2801
  changes.push(change);
2802
2802
  }
@@ -2993,7 +2993,7 @@ const wrapperStyle = {
2993
2993
  function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, ...rest }, ref) {
2994
2994
  const rfId = id || '1';
2995
2995
  const colorModeClassName = useColorModeClass(colorMode);
2996
- return (jsx("div", { ...rest, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), "data-testid": "rf__wrapper", id: id, children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
2996
+ return (jsx("div", { "data-testid": "rf__wrapper", ...rest, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
2997
2997
  }
2998
2998
  var index = fixedForwardRef(ReactFlow);
2999
2999
 
@@ -3501,13 +3501,14 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
3501
3501
  domNode: resizeControlRef.current,
3502
3502
  nodeId: id,
3503
3503
  getStoreItems: () => {
3504
- const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin } = store.getState();
3504
+ const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState();
3505
3505
  return {
3506
3506
  nodeLookup,
3507
3507
  transform,
3508
3508
  snapGrid,
3509
3509
  snapToGrid,
3510
3510
  nodeOrigin,
3511
+ paneDomNode: domNode,
3511
3512
  };
3512
3513
  },
3513
3514
  onChange: (change, childChanges) => {
@@ -3,7 +3,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import cc from 'classcat';
4
4
  import { errorMessages, infiniteExtent, isInputDOMNode, getFitViewNodes, getDimensions, fitView, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds, evaluateAbsolutePosition, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, updateNodeInternals, updateAbsolutePositions, handleExpandParent, panBy, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform } from '@xyflow/system';
5
5
  export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system';
6
- import { createContext, useContext, useMemo, useEffect, useRef, useState, forwardRef, useLayoutEffect, useCallback, memo } from 'react';
6
+ import { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react';
7
7
  import { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';
8
8
  import { shallow } from 'zustand/shallow';
9
9
  import { createPortal } from 'react-dom';
@@ -68,11 +68,11 @@ function A11yDescriptions({ rfId, disableKeyboardA11y }) {
68
68
  }
69
69
 
70
70
  const selector$n = (s) => (s.userSelectionActive ? 'none' : 'all');
71
- function Panel({ position = 'top-left', children, className, style, ...rest }) {
71
+ const Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => {
72
72
  const pointerEvents = useStore(selector$n);
73
73
  const positionClasses = `${position}`.split('-');
74
- return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ...rest, children: children }));
75
- }
74
+ return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ref: ref, ...rest, children: children }));
75
+ });
76
76
 
77
77
  function Attribution({ proOptions, position = 'bottom-right' }) {
78
78
  if (proOptions?.hideAttribution) {
@@ -322,7 +322,12 @@ keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true
322
322
  const [keyCodes, keysToWatch] = useMemo(() => {
323
323
  if (keyCode !== null) {
324
324
  const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode];
325
- const keys = keyCodeArr.filter((kc) => typeof kc === 'string').map((kc) => kc.split('+'));
325
+ const keys = keyCodeArr
326
+ .filter((kc) => typeof kc === 'string')
327
+ // we first replace all '+' with '\n' which we will use to split the keys on
328
+ // then we replace '\n\n' with '\n+', this way we can also support the combination 'key++'
329
+ // in the end we simply split on '\n' to get the key array
330
+ .map((kc) => kc.replace('+', '\n').replace('\n\n', '\n+').split('\n'));
326
331
  const keysFlat = keys.reduce((res, item) => res.concat(...item), []);
327
332
  return [keys, keysFlat];
328
333
  }
@@ -741,34 +746,25 @@ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffec
741
746
  */
742
747
  function useQueue(runQueue) {
743
748
  // Because we're using a ref above, we need some way to let React know when to
744
- // actually process the queue. We flip this bit of state to `true` any time we
745
- // mutate the queue and then flip it back to `false` after flushing the queue.
746
- const [shouldFlush, setShouldFlush] = useState(false);
749
+ // actually process the queue. We increment this number any time we mutate the
750
+ // queue, creating a new state to trigger the layout effect below.
751
+ // Using a boolean dirty flag here instead would lead to issues related to
752
+ // automatic batching. (https://github.com/xyflow/xyflow/issues/4779)
753
+ const [serial, setSerial] = useState(BigInt(0));
747
754
  // A reference of all the batched updates to process before the next render. We
748
755
  // want a reference here so multiple synchronous calls to `setNodes` etc can be
749
756
  // batched together.
750
- const [queue] = useState(() => createQueue(() => setShouldFlush(true)));
757
+ const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1))));
751
758
  // Layout effects are guaranteed to run before the next render which means we
752
759
  // shouldn't run into any issues with stale state or weird issues that come from
753
760
  // rendering things one frame later than expected (we used to use `setTimeout`).
754
761
  useIsomorphicLayoutEffect(() => {
755
- // Because we need to flip the state back to false after flushing, this should
756
- // trigger the hook again (!). If the hook is being run again we know that any
757
- // updates should have been processed by now and we can safely clear the queue
758
- // and bail early.
759
- if (!shouldFlush) {
760
- queue.reset();
761
- return;
762
- }
763
762
  const queueItems = queue.get();
764
763
  if (queueItems.length) {
765
764
  runQueue(queueItems);
766
765
  queue.reset();
767
766
  }
768
- // Because we're using reactive state to trigger this effect, we need to flip
769
- // it back to false.
770
- setShouldFlush(false);
771
- }, [shouldFlush]);
767
+ }, [serial]);
772
768
  return queue;
773
769
  }
774
770
  function createQueue(cb) {
@@ -869,11 +865,10 @@ function useReactFlow() {
869
865
  ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin)
870
866
  : nodeToUse.position;
871
867
  const nodeWithPosition = {
872
- id: nodeToUse.id,
868
+ ...nodeToUse,
873
869
  position,
874
870
  width: nodeToUse.measured?.width ?? nodeToUse.width,
875
871
  height: nodeToUse.measured?.height ?? nodeToUse.height,
876
- data: nodeToUse.data,
877
872
  };
878
873
  return nodeToRect(nodeWithPosition);
879
874
  };
@@ -1689,6 +1684,7 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
1689
1684
  : undefined;
1690
1685
  const onKeyDown = (event) => {
1691
1686
  if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
1687
+ event.preventDefault();
1692
1688
  moveSelectedNodes({
1693
1689
  direction: arrowKeyDiffs[event.key],
1694
1690
  factor: event.shiftKey ? 4 : 1,
@@ -1901,6 +1897,8 @@ function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onC
1901
1897
  });
1902
1898
  }
1903
1899
  else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
1900
+ // prevent default scrolling behavior on arrow key press when node is moved
1901
+ event.preventDefault();
1904
1902
  store.setState({
1905
1903
  ariaLiveMessage: `Moved selected node ${event.key
1906
1904
  .replace('Arrow', '')
@@ -2097,8 +2095,8 @@ function EdgeTextComponent({ x, y, label, labelStyle = {}, labelShowBg = true, l
2097
2095
  EdgeTextComponent.displayName = 'EdgeText';
2098
2096
  const EdgeText = memo(EdgeTextComponent);
2099
2097
 
2100
- function BaseEdge({ id, path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, className, interactionWidth = 20, }) {
2101
- return (jsxs(Fragment, { children: [jsx("path", { id: id, style: style, d: path, fill: "none", className: cc(['react-flow__edge-path', className]), markerEnd: markerEnd, markerStart: markerStart }), interactionWidth && (jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" })), label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));
2098
+ function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) {
2099
+ return (jsxs(Fragment, { children: [jsx("path", { ...props, d: path, fill: "none", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth && (jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" })), label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));
2102
2100
  }
2103
2101
 
2104
2102
  function getControl({ pos, x1, y1, x2, y2 }) {
@@ -2434,8 +2432,6 @@ function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectabl
2434
2432
  }
2435
2433
 
2436
2434
  const selector$a = (s) => ({
2437
- width: s.width,
2438
- height: s.height,
2439
2435
  edgesFocusable: s.edgesFocusable,
2440
2436
  edgesReconnectable: s.edgesReconnectable,
2441
2437
  elementsSelectable: s.elementsSelectable,
@@ -2779,13 +2775,19 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
2779
2775
  const parentExpandChildren = [];
2780
2776
  const changes = [];
2781
2777
  for (const [id, dragItem] of nodeDragItems) {
2778
+ const expandParent = !!(dragItem?.expandParent && dragItem?.parentId && dragItem?.position);
2782
2779
  const change = {
2783
2780
  id,
2784
2781
  type: 'position',
2785
- position: dragItem.position,
2782
+ position: expandParent
2783
+ ? {
2784
+ x: Math.max(0, dragItem.position.x),
2785
+ y: Math.max(0, dragItem.position.y),
2786
+ }
2787
+ : dragItem.position,
2786
2788
  dragging,
2787
2789
  };
2788
- if (dragItem?.expandParent && dragItem?.parentId && change.position) {
2790
+ if (expandParent) {
2789
2791
  parentExpandChildren.push({
2790
2792
  id,
2791
2793
  parentId: dragItem.parentId,
@@ -2795,8 +2797,6 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
2795
2797
  height: dragItem.measured.height,
2796
2798
  },
2797
2799
  });
2798
- change.position.x = Math.max(0, change.position.x);
2799
- change.position.y = Math.max(0, change.position.y);
2800
2800
  }
2801
2801
  changes.push(change);
2802
2802
  }
@@ -2993,7 +2993,7 @@ const wrapperStyle = {
2993
2993
  function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, ...rest }, ref) {
2994
2994
  const rfId = id || '1';
2995
2995
  const colorModeClassName = useColorModeClass(colorMode);
2996
- return (jsx("div", { ...rest, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), "data-testid": "rf__wrapper", id: id, children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
2996
+ return (jsx("div", { "data-testid": "rf__wrapper", ...rest, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
2997
2997
  }
2998
2998
  var index = fixedForwardRef(ReactFlow);
2999
2999
 
@@ -3501,13 +3501,14 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
3501
3501
  domNode: resizeControlRef.current,
3502
3502
  nodeId: id,
3503
3503
  getStoreItems: () => {
3504
- const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin } = store.getState();
3504
+ const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState();
3505
3505
  return {
3506
3506
  nodeLookup,
3507
3507
  transform,
3508
3508
  snapGrid,
3509
3509
  snapToGrid,
3510
3510
  nodeOrigin,
3511
+ paneDomNode: domNode,
3511
3512
  };
3512
3513
  },
3513
3514
  onChange: (change, childChanges) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAcL,UAAU,EACV,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+C,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW;;;;;;;;;;2GAkWd,CAAC;AAEJ,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAcL,UAAU,EACV,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+C,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW;;;;;;;;;;2GAsWd,CAAC;AAEJ,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -453,7 +453,7 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
453
453
  * If you have custom connection logic its preferred to use this callback over the isValidConnection prop on the handle component for performance reasons.
454
454
  * @default (connection: Connection) => true
455
455
  */
456
- isValidConnection?: IsValidConnection;
456
+ isValidConnection?: IsValidConnection<EdgeType>;
457
457
  /** With a threshold greater than zero you can control the distinction between node drag and click events.
458
458
  *
459
459
  * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
@@ -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,CAA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CAAC;IACxB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -1,4 +1,4 @@
1
- import type { CSSProperties, HTMLAttributes, ReactNode, MouseEvent as ReactMouseEvent, ComponentType } from 'react';
1
+ import type { CSSProperties, SVGAttributes, ReactNode, MouseEvent as ReactMouseEvent, ComponentType } from 'react';
2
2
  import type { EdgeBase, BezierPathOptions, Position, SmoothStepPathOptions, DefaultEdgeOptionsBase, HandleType, Connection, ConnectionLineType, Handle, EdgePosition, StepPathOptions, OnError, FinalConnectionState } from '@xyflow/system';
3
3
  import { EdgeTypes, InternalNode, Node } from '.';
4
4
  export type EdgeLabelOptions = {
@@ -53,7 +53,7 @@ export type EdgeWrapperProps<EdgeType extends Edge = Edge> = {
53
53
  disableKeyboardA11y?: boolean;
54
54
  };
55
55
  export type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
56
- export type EdgeTextProps = HTMLAttributes<SVGElement> & EdgeLabelOptions & {
56
+ export type EdgeTextProps = SVGAttributes<SVGElement> & EdgeLabelOptions & {
57
57
  x: number;
58
58
  y: number;
59
59
  };
@@ -73,27 +73,15 @@ export type EdgeProps<EdgeType extends Edge = Edge> = Pick<EdgeType, 'id' | 'ani
73
73
  * BaseEdge component props
74
74
  * @public
75
75
  */
76
- export type BaseEdgeProps = EdgeLabelOptions & {
77
- /** Unique id of edge */
78
- id?: string;
76
+ export type BaseEdgeProps = Omit<SVGAttributes<SVGPathElement>, 'd'> & EdgeLabelOptions & {
79
77
  /** Additional padding where interacting with an edge is still possible */
80
78
  interactionWidth?: number;
81
- className?: string;
82
79
  /** The x position of edge label */
83
80
  labelX?: number;
84
81
  /** The y position of edge label */
85
82
  labelY?: number;
86
- /** Marker at start of edge
87
- * @example 'url(#arrow)'
88
- */
89
- markerStart?: string;
90
- /** Marker at end of edge
91
- * @example 'url(#arrow)'
92
- */
93
- markerEnd?: string;
94
83
  /** SVG path of the edge */
95
84
  path: string;
96
- style?: CSSProperties;
97
85
  };
98
86
  /**
99
87
  * Helper type for edge components that get exported by the library