feat(connections): support touch

This commit is contained in:
moklick
2023-01-23 17:58:15 +01:00
parent 24e8b8adc0
commit 0a2c96fe3e
10 changed files with 82 additions and 67 deletions
@@ -1,5 +1,3 @@
import { MouseEvent as ReactMouseEvent } from 'react';
import { ConnectionMode } from '../../types';
import type { Connection, HandleType, XYPosition, Node, NodeHandleBounds } from '../../types';
import { internalsSymbol } from '../../utils';
@@ -134,10 +132,3 @@ export function getHandleLookup({ nodes, nodeId, handleId, handleType }: GetHand
return res;
}, []);
}
export function getConnectionPosition(event: MouseEvent | ReactMouseEvent, bounds: DOMRect): XYPosition {
return {
x: event.clientX - bounds.left,
y: event.clientY - bounds.top,
};
}