feat(flowManagerStore.ts): add paste function to allow pasting copied nodes and edges at a specified position
feat(flowManagerStore.ts): add lastCopiedSelection object to store the last copied nodes and edges for pasting
This commit is contained in:
parent
c32a7f9f11
commit
aa44a70a02
1 changed files with 7 additions and 0 deletions
|
|
@ -22,6 +22,11 @@ type RFState = {
|
|||
deleteNode: (nodeId: string) => void;
|
||||
deleteEdge: (edgeId: string) => void;
|
||||
isBuilt: boolean;
|
||||
paste: (
|
||||
selection: { nodes: any; edges: any },
|
||||
position: { x: number; y: number; paneX?: number; paneY?: number }
|
||||
) => void;
|
||||
lastCopiedSelection: { nodes: any; edges: any };
|
||||
};
|
||||
|
||||
// this is our useStore hook that we can use in our components to get parts of the store and call actions
|
||||
|
|
@ -56,6 +61,8 @@ const useStore = create<RFState>((set, get) => ({
|
|||
edges: get().edges.filter((edge) => edge.id !== edgeId),
|
||||
});
|
||||
},
|
||||
paste: (selection, position) => {},
|
||||
lastCopiedSelection: { nodes: [], edges: [] },
|
||||
}));
|
||||
|
||||
export default useStore;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue