chore: rename @nodes -> @nodarium for everything
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 3m33s

This commit is contained in:
Max Richter
2025-12-01 17:03:14 +01:00
parent e5658b8a7e
commit 1ea544e765
58 changed files with 909 additions and 882 deletions

View File

@@ -1,14 +1,11 @@
<script lang="ts">
import type {
NodeInput as NodeInputType,
Socket,
Node as NodeType,
} from "@nodes/types";
import { getContext } from "svelte";
} from "@nodarium/types";
import { createNodePath } from "../helpers/index.js";
import { getGraphManager } from "../graph/context.js";
import NodeInput from "./NodeInput.svelte";
import { getGraphState } from "../graph/state.svelte.js";
import { getGraphManager, getGraphState } from "../graph/state.svelte.js";
type Props = {
node: NodeType;
@@ -17,31 +14,26 @@
isLast?: boolean;
};
const graph = getGraphManager();
let { node = $bindable(), input, id, isLast }: Props = $props();
const inputType = node?.tmp?.type?.inputs?.[id]!;
const socketId = `${node.id}-${id}`;
const graph = getGraphManager();
const graphState = getGraphState();
const graphId = graph?.id;
const elementId = `input-${Math.random().toString(36).substring(7)}`;
const setDownSocket = getContext<(socket: Socket) => void>("setDownSocket");
const getSocketPosition =
getContext<(node: NodeType, index: string) => [number, number]>(
"getSocketPosition",
);
function handleMouseDown(ev: MouseEvent) {
ev.preventDefault();
ev.stopPropagation();
setDownSocket?.({
graphState.setDownSocket({
node,
index: id,
position: getSocketPosition?.(node, id),
position: graphState.getSocketPosition?.(node, id),
});
}
@@ -87,7 +79,7 @@
<label for={elementId}>{input.label || id}</label>
{/if}
{#if inputType.external !== true}
<NodeInput {elementId} bind:node {input} {id} />
<NodeInput {graph} {elementId} bind:node {input} {id} />
{/if}
</div>