feat: load props from node store

This commit is contained in:
2024-04-24 01:40:04 +02:00
parent f1e537d596
commit f0ccbf808e
13 changed files with 109 additions and 132 deletions

View File

@@ -796,11 +796,19 @@
my += parseInt(nodeOffsetY);
}
let props = {};
let rawNodeProps = event.dataTransfer.getData("data/node-props");
if (rawNodeProps) {
try {
props = JSON.parse(rawNodeProps);
} catch (e) {}
}
const pos = projectScreenToWorld(mx, my);
graph.loadNode(nodeId).then(() => {
graph.createNode({
type: nodeId,
props: {},
props,
position: pos,
});
});