mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 04:55:54 +08:00
### What problem does this PR solve? feat: Support shortcut keys to delete nodes #3283 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
f16ef57979
commit
a2153d61ce
@ -11,7 +11,6 @@ import { Operator } from '../constant';
|
|||||||
import FlowDrawer from '../flow-drawer';
|
import FlowDrawer from '../flow-drawer';
|
||||||
import {
|
import {
|
||||||
useHandleDrop,
|
useHandleDrop,
|
||||||
useHandleKeyUp,
|
|
||||||
useSelectCanvasData,
|
useSelectCanvasData,
|
||||||
useShowDrawer,
|
useShowDrawer,
|
||||||
useValidateConnection,
|
useValidateConnection,
|
||||||
@ -87,7 +86,6 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {
|
|||||||
|
|
||||||
const { onDrop, onDragOver, setReactFlowInstance } = useHandleDrop();
|
const { onDrop, onDragOver, setReactFlowInstance } = useHandleDrop();
|
||||||
|
|
||||||
const { handleKeyUp } = useHandleKeyUp();
|
|
||||||
useWatchNodeFormDataChange();
|
useWatchNodeFormDataChange();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -127,7 +125,7 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {
|
|||||||
onNodeClick={onNodeClick}
|
onNodeClick={onNodeClick}
|
||||||
onPaneClick={onPaneClick}
|
onPaneClick={onPaneClick}
|
||||||
onInit={setReactFlowInstance}
|
onInit={setReactFlowInstance}
|
||||||
onKeyUp={handleKeyUp}
|
// onKeyUp={handleKeyUp}
|
||||||
onSelectionChange={onSelectionChange}
|
onSelectionChange={onSelectionChange}
|
||||||
nodeOrigin={[0.5, 0]}
|
nodeOrigin={[0.5, 0]}
|
||||||
isValidConnection={isValidConnection}
|
isValidConnection={isValidConnection}
|
||||||
@ -142,6 +140,7 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {
|
|||||||
stroke: 'rgb(202 197 245)',
|
stroke: 'rgb(202 197 245)',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
deleteKeyCode={['Delete', 'Backspace']}
|
||||||
>
|
>
|
||||||
<Background />
|
<Background />
|
||||||
<Controls />
|
<Controls />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user