Merge branch 'main' into handle-lookup

This commit is contained in:
Moritz Klack
2024-08-14 12:28:44 +02:00
committed by GitHub
7 changed files with 36 additions and 6 deletions
+4 -1
View File
@@ -50,7 +50,10 @@ export type OnConnectStartParams = {
export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
export type OnConnect = (connection: Connection) => void;
export type OnConnectEnd = (event: MouseEvent | TouchEvent) => void;
export type OnConnectEnd = (
event: MouseEvent | TouchEvent,
connectionState: Omit<ConnectionState, 'inProgress'>
) => void;
export type IsValidConnection = (edge: EdgeBase | Connection) => boolean;
+6 -1
View File
@@ -192,7 +192,12 @@ function onPointerDown(
// it's important to get a fresh reference from the store here
// in order to get the latest state of onConnectEnd
onConnectEnd?.(event);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { inProgress, ...connectionState } = previousConnection;
onConnectEnd?.(event, {
...connectionState,
toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,
});
if (edgeUpdaterType) {
onReconnectEnd?.(event);