Support for copying nodes between workflows (This feature is unrelated to remove functions. When using the copy function, the browser will permanently retain the last copied node)." (#19687)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
FyhSky 2025-05-14 19:03:11 +08:00 committed by GitHub
parent 17b929124f
commit e040f8069b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,8 +37,13 @@ export type WorkflowSliceShape = {
export const createWorkflowSlice: StateCreator<WorkflowSliceShape> = set => ({
workflowRunningData: undefined,
setWorkflowRunningData: workflowRunningData => set(() => ({ workflowRunningData })),
clipboardElements: [],
setClipboardElements: clipboardElements => set(() => ({ clipboardElements })),
clipboardElements: (() => {
const storedElements = localStorage.getItem('clipboard_elements')
return storedElements ? JSON.parse(storedElements) : []
})(),
setClipboardElements: (clipboardElements) => {
localStorage.setItem('clipboard_elements', JSON.stringify(clipboardElements))
},
selection: null,
setSelection: selection => set(() => ({ selection })),
bundleNodeSize: null,