feat: did some stuff

This commit is contained in:
2024-04-05 18:03:23 +02:00
parent 8035b26750
commit b3780fdf96
34 changed files with 355 additions and 54 deletions

View File

@ -5,17 +5,19 @@
export let node: Node;
export let input: NodeInput;
export let label: string;
export let id: string;
export let label: string | undefined;
const graph = getGraphManager();
let value = node?.props?.[label] ?? input.value;
let value = node?.props?.[id] ?? input.value;
$: if (node?.props?.[label] !== value) {
node.props = { ...node.props, [label]: value };
$: if (node?.props?.[id] !== value) {
node.props = { ...node.props, [id]: value };
graph.save();
graph.execute();
}
</script>
<label for="asd">{label}</label>
<label for="asd">{label || id}</label>
<Input {input} bind:value />

View File

@ -5,6 +5,7 @@
import { possibleSocketIds } from "../graph/stores";
import { getGraphManager } from "../graph/context";
import NodeInput from "./NodeInput.svelte";
import Node from "./Node.svelte";
export let node: Node;
export let input: NodeInputType;
@ -68,9 +69,11 @@
class:disabled={$possibleSocketIds && !$possibleSocketIds.has(socketId)}
>
{#key id && graphId}
<div class="content" class:disabled={$inputSockets.has(socketId)}>
<NodeInput {node} {input} label={input?.title || id} />
</div>
{#if node?.tmp?.type?.inputs?.[id]?.external !== true}
<div class="content" class:disabled={$inputSockets.has(socketId)}>
<NodeInput {node} {input} {id} label={input.title} />
</div>
{/if}
{#if node?.tmp?.type?.inputs?.[id]?.internal !== true}
<div