From aa44a70a0255e8b1572bd289258a45a149844b14 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 4 Jan 2024 16:36:46 -0300 Subject: [PATCH] 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 --- src/frontend/src/stores/flowManagerStore.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/frontend/src/stores/flowManagerStore.ts b/src/frontend/src/stores/flowManagerStore.ts index cb07be88f..dc6342338 100644 --- a/src/frontend/src/stores/flowManagerStore.ts +++ b/src/frontend/src/stores/flowManagerStore.ts @@ -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((set, get) => ({ edges: get().edges.filter((edge) => edge.id !== edgeId), }); }, + paste: (selection, position) => {}, + lastCopiedSelection: { nodes: [], edges: [] }, })); export default useStore;