Merge branch 'main' into handle-lookup
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user