From 850f54aebd745fe445e4de2d932595112d5fa249 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:41:40 +0200 Subject: [PATCH] chore(core): cleanup unused event arg (#1475) chore(core): cleanup unused `event` arg --- packages/core/src/composables/useHandle.ts | 3 +-- packages/core/src/store/actions.ts | 2 +- packages/core/src/types/store.ts | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/core/src/composables/useHandle.ts b/packages/core/src/composables/useHandle.ts index ae23fb12..27a5fd86 100644 --- a/packages/core/src/composables/useHandle.ts +++ b/packages/core/src/composables/useHandle.ts @@ -134,7 +134,6 @@ export function useHandle({ x: x - containerBounds.left, y: y - containerBounds.top, }, - event, ) emits.connectStart({ event, nodeId: toValue(nodeId), handleId: toValue(handleId), handleType }) @@ -256,7 +255,7 @@ export function useHandle({ if (!connectionClickStartHandle.value) { emits.clickConnectStart({ event, nodeId: toValue(nodeId), handleId: toValue(handleId) }) - startConnection({ nodeId: toValue(nodeId), type: toValue(type), handleId: toValue(handleId) }, undefined, event, true) + startConnection({ nodeId: toValue(nodeId), type: toValue(type), handleId: toValue(handleId) }, undefined, true) } else { let isValidConnectionHandler = toValue(isValidConnection) || isValidConnectionProp.value || alwaysValid diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index 736d1c7c..106538eb 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -615,7 +615,7 @@ export function useActions( node.data = options.replace ? nextData : { ...node.data, ...nextData } } - const startConnection: Actions['startConnection'] = (startHandle, position, event, isClick = false) => { + const startConnection: Actions['startConnection'] = (startHandle, position, isClick = false) => { if (isClick) { state.connectionClickStartHandle = startHandle } else { diff --git a/packages/core/src/types/store.ts b/packages/core/src/types/store.ts index e96f2c42..358d598a 100644 --- a/packages/core/src/types/store.ts +++ b/packages/core/src/types/store.ts @@ -289,12 +289,7 @@ export interface Actions extends Omit { /** force update node internal data, if handle bounds are incorrect, you might want to use this */ updateNodeInternals: UpdateNodeInternals /** start a connection */ - startConnection: ( - startHandle: ConnectingHandle, - position?: XYPosition, - event?: MouseEvent | TouchEvent, - isClick?: boolean, - ) => void + startConnection: (startHandle: ConnectingHandle, position?: XYPosition, isClick?: boolean) => void /** update connection position */ updateConnection: (position: XYPosition, result?: ConnectingHandle | null, status?: ConnectionStatus | null) => void /** end (or cancel) a connection */