feat: load props from node store
This commit is contained in:
@ -384,8 +384,6 @@ export class GraphManager extends EventEmitter<{ "save": Graph, "result": any, "
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const node: Node = { id: this.createNodeId(), type, position, tmp: { type: nodeType }, props };
|
||||
|
||||
this.nodes.update((nodes) => {
|
||||
|
@ -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,
|
||||
});
|
||||
});
|
||||
|
@ -15,6 +15,7 @@ const diff = create({
|
||||
})
|
||||
|
||||
const log = createLogger("history")
|
||||
log.mute();
|
||||
|
||||
export class HistoryManager {
|
||||
|
||||
|
Reference in New Issue
Block a user