fix native and web screenshot rendering
This commit is contained in:
24
frontend/src/workflowSerialization.js
Normal file
24
frontend/src/workflowSerialization.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export function serializeWorkflowState(nodes, edges) {
|
||||
return {
|
||||
version: 1,
|
||||
nodes: nodes.map((node) => ({
|
||||
id: node.id,
|
||||
type: node.type || 'custom',
|
||||
position: node.position,
|
||||
dragHandle: node.dragHandle || '.drag-handle',
|
||||
data: {
|
||||
label: node.data?.label || node.data?.className || 'Node',
|
||||
className: node.data?.className || '',
|
||||
widgetValues: node.data?.widgetValues || {},
|
||||
},
|
||||
})),
|
||||
edges: edges.map((edge) => ({
|
||||
id: edge.id,
|
||||
source: edge.source,
|
||||
sourceHandle: edge.sourceHandle,
|
||||
target: edge.target,
|
||||
targetHandle: edge.targetHandle,
|
||||
style: edge.style,
|
||||
})),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user