chore(handle): cleanup
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// Reconnectable edges have a anchors around their handles to reconnect the edge.
|
||||
import {
|
||||
XYHandle,
|
||||
type EdgePosition,
|
||||
type FinalConnectionState,
|
||||
type HandleType,
|
||||
type OnConnectStart,
|
||||
type Connection,
|
||||
EdgePosition,
|
||||
FinalConnectionState,
|
||||
HandleType,
|
||||
OnConnectStart,
|
||||
} from '@xyflow/system';
|
||||
|
||||
import { EdgeAnchor } from '../Edges/EdgeAnchor';
|
||||
@@ -79,7 +79,7 @@ export function EdgeUpdateAnchors<EdgeType extends Edge = Edge>({
|
||||
onConnectStart?.(_event, params);
|
||||
};
|
||||
|
||||
XYHandle.onPointerDown(event.nativeEvent, event.currentTarget, {
|
||||
XYHandle.onPointerDown(event.nativeEvent, {
|
||||
autoPanOnConnect,
|
||||
connectionMode,
|
||||
connectionRadius,
|
||||
@@ -102,6 +102,7 @@ export function EdgeUpdateAnchors<EdgeType extends Edge = Edge>({
|
||||
getTransform: () => store.getState().transform,
|
||||
getFromHandle: () => store.getState().connection.fromHandle,
|
||||
dragThreshold: store.getState().connectionDragThreshold,
|
||||
handleDomNode: event.currentTarget,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -114,13 +114,11 @@ function HandleComponent(
|
||||
onConnectAction?.(edgeParams);
|
||||
onConnect?.(edgeParams);
|
||||
};
|
||||
|
||||
const onPointerDown = (event: ReactMouseEvent<HTMLDivElement> | ReactTouchEvent<HTMLDivElement>) => {
|
||||
if (!nodeId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handleElement = event.currentTarget
|
||||
const isMouseTriggered = isMouseEvent(event.nativeEvent);
|
||||
|
||||
if (
|
||||
@@ -129,7 +127,8 @@ function HandleComponent(
|
||||
) {
|
||||
const currentStore = store.getState();
|
||||
|
||||
XYHandle.onPointerDown(event.nativeEvent, handleElement, {
|
||||
XYHandle.onPointerDown(event.nativeEvent, {
|
||||
handleDomNode: event.currentTarget,
|
||||
autoPanOnConnect: currentStore.autoPanOnConnect,
|
||||
connectionMode: currentStore.connectionMode,
|
||||
connectionRadius: currentStore.connectionRadius,
|
||||
|
||||
Reference in New Issue
Block a user