From 69021e8bbe41d892536d7421126499322a5e1ad4 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 14 May 2025 11:45:58 +0200 Subject: [PATCH] chore(react): use OnReconnet from system --- packages/react/src/index.ts | 1 + packages/react/src/types/component-props.ts | 2 +- packages/react/src/types/edges.ts | 4 +--- packages/system/src/types/general.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index eb106f18..3397a677 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -107,6 +107,7 @@ export { type ConnectionInProgress, type NoConnection, type NodeConnection, + type OnReconnect, } from '@xyflow/system'; // we need this workaround to prevent a duplicate identifier error diff --git a/packages/react/src/types/component-props.ts b/packages/react/src/types/component-props.ts index e1bf01e1..9bea9004 100644 --- a/packages/react/src/types/component-props.ts +++ b/packages/react/src/types/component-props.ts @@ -20,6 +20,7 @@ import type { OnError, ColorMode, SnapGrid, + OnReconnect, } from '@xyflow/system'; import type { @@ -29,7 +30,6 @@ import type { Node, Edge, ConnectionLineComponent, - OnReconnect, OnInit, DefaultEdgeOptions, FitViewOptions, diff --git a/packages/react/src/types/edges.ts b/packages/react/src/types/edges.ts index ca3f91fe..a5c22c75 100644 --- a/packages/react/src/types/edges.ts +++ b/packages/react/src/types/edges.ts @@ -8,12 +8,12 @@ import type { SmoothStepPathOptions, DefaultEdgeOptionsBase, HandleType, - Connection, ConnectionLineType, Handle, EdgePosition, StepPathOptions, OnError, + OnReconnect, FinalConnectionState, } from '@xyflow/system'; @@ -233,8 +233,6 @@ export type StraightEdgeProps = Omit = (oldEdge: EdgeType, newConnection: Connection) => void; - /** * If you want to render a custom component for connection lines, you can set the * `connectionLineComponent` prop on the [``](/api-reference/react-flow#connection-connectionLineComponent) diff --git a/packages/system/src/types/general.ts b/packages/system/src/types/general.ts index 3444fdaf..d15a4b54 100644 --- a/packages/system/src/types/general.ts +++ b/packages/system/src/types/general.ts @@ -81,7 +81,7 @@ export type OnConnect = (connection: Connection) => void; export type OnConnectEnd = (event: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void; export type OnReconnect = (oldEdge: EdgeType, newConnection: Connection) => void; -export type OnRecoonnectStart = ( +export type OnReconnectStart = ( event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType