add onselectiondrag events

This commit is contained in:
peterkogo
2025-05-13 15:54:25 +02:00
parent e6aeff4acb
commit 17646123de
5 changed files with 30 additions and 2 deletions
@@ -60,7 +60,8 @@ import type {
EdgeLayouted,
InternalNode,
OnBeforeReconnect,
OnSelectionChange
OnSelectionChange,
OnSelectionDrag
} from '$lib/types';
import type { StoreSignals } from './types';
@@ -359,6 +360,10 @@ export function getInitialStore<NodeType extends Node = Node, EdgeType extends E
onclickconnectend?: OnConnectEnd = $derived(signals.props.onclickconnectend);
clickConnectStartHandle: Pick<Handle, 'id' | 'nodeId' | 'type'> | null = $state(null);
onselectiondrag?: OnSelectionDrag<NodeType> = $derived(signals.props.onselectiondrag);
onselectiondragstart?: OnSelectionDrag<NodeType> = $derived(signals.props.onselectiondragstart);
onselectiondragstop?: OnSelectionDrag<NodeType> = $derived(signals.props.onselectiondragstop);
resolveFitView = async () => {
if (!this.panZoom) {
return;