feat(network): add connect tool and middle-pan
This commit is contained in:
@@ -47,7 +47,7 @@ export function useCanvasShortcuts({
|
||||
onUndo: () => void
|
||||
onRedo: () => void
|
||||
onNudge: (dx: number, dy: number) => void
|
||||
onSetMode: (mode: 'select' | 'pan') => void
|
||||
onSetMode: (mode: 'select' | 'pan' | 'connect') => void
|
||||
}) {
|
||||
const { getNodes, fitView, screenToFlowPosition, setNodes: rfSetNodes } = useReactFlow()
|
||||
const clipboardRef = useRef<ClipboardData | null>(null)
|
||||
@@ -244,7 +244,7 @@ export function useCanvasShortcuts({
|
||||
return
|
||||
}
|
||||
|
||||
// Mode shortcuts: V = select, H = pan
|
||||
// Mode shortcuts: V = select, H = pan, C = connect
|
||||
if (!ctrl && e.key === 'v') {
|
||||
onSetMode('select')
|
||||
return
|
||||
@@ -253,6 +253,10 @@ export function useCanvasShortcuts({
|
||||
onSetMode('pan')
|
||||
return
|
||||
}
|
||||
if (!ctrl && e.key === 'c') {
|
||||
onSetMode('connect')
|
||||
return
|
||||
}
|
||||
|
||||
if (ctrl && e.key === 'c') {
|
||||
e.preventDefault()
|
||||
|
||||
Reference in New Issue
Block a user