feat: initial working version of project manager
This commit is contained in:
@@ -109,6 +109,7 @@ export class GraphManager extends EventEmitter<{
|
||||
const serialized = {
|
||||
id: this.graph.id,
|
||||
settings: $state.snapshot(this.settings),
|
||||
meta: this.graph.meta,
|
||||
nodes,
|
||||
edges
|
||||
};
|
||||
@@ -304,7 +305,7 @@ export class GraphManager extends EventEmitter<{
|
||||
this.status = 'loading';
|
||||
this.id = graph.id;
|
||||
|
||||
logger.info('loading graph', $state.snapshot(graph));
|
||||
logger.info('loading graph', graph);
|
||||
|
||||
const nodeIds = Array.from(new Set([...graph.nodes.map((n) => n.type)]));
|
||||
await this.registry.load(nodeIds);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import { setupKeymaps } from "../keymaps";
|
||||
|
||||
type Props = {
|
||||
graph: Graph;
|
||||
graph?: Graph;
|
||||
registry: NodeRegistry;
|
||||
|
||||
settings?: Record<string, any>;
|
||||
@@ -85,7 +85,11 @@
|
||||
|
||||
manager.on("save", (save) => onsave?.(save));
|
||||
|
||||
manager.load(graph);
|
||||
$effect(() => {
|
||||
if (graph) {
|
||||
manager.load(graph);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<GraphEl {keymap} />
|
||||
|
||||
Reference in New Issue
Block a user