feat: add "*"/any type input for dev page

This commit is contained in:
Max Richter
2026-01-22 15:54:08 +01:00
committed by Max Richter
parent 8d403ba803
commit 2a14ed7202
9 changed files with 124 additions and 44 deletions

View File

@@ -169,11 +169,14 @@ export class GraphState {
(node?.state?.y ?? node.position[1]) + 2.5 + 10 * index
];
} else {
const _index = Object.keys(node.state?.type?.inputs || {}).indexOf(index);
return [
const inputs = node.state.type?.inputs || this.graph.registry.getNode(node.type)?.inputs
|| {};
const _index = Object.keys(inputs).indexOf(index);
const pos = [
node?.state?.x ?? node.position[0],
(node?.state?.y ?? node.position[1]) + 10 + 10 * _index
];
] as [number, number];
return pos;
}
}
@@ -259,7 +262,7 @@ export class GraphState {
let { node, index, position } = socket;
// remove existing edge
// if the socket is an input socket -> remove existing edges
if (typeof index === 'string') {
const edges = this.graph.getEdgesToNode(node);
for (const edge of edges) {