feat: add validation to include_definition macro

This commit is contained in:
2024-04-18 15:40:41 +02:00
parent c33e2642e1
commit e7f43020dc
27 changed files with 466 additions and 147 deletions

View File

@ -514,9 +514,7 @@
}
function handleKeyDown(event: KeyboardEvent) {
const bodyIsFocused =
document.activeElement === document.body ||
document?.activeElement?.id === "graph";
const bodyIsFocused = document?.activeElement?.nodeName !== "INPUT";
if (event.key === "l") {
const activeNode = graph.getNode($activeNodeId);
@ -538,7 +536,7 @@
addMenuPosition = [mousePosition[0], mousePosition[1]];
}
if (event.key === ".") {
if (event.key === "." && bodyIsFocused) {
const average = [0, 0];
for (const node of $nodes.values()) {
average[0] += node.position[0];

View File

@ -15,6 +15,8 @@
export let id: string;
export let isLast = false;
const inputType = node?.tmp?.type?.inputs?.[id]!;
const socketId = `${node.id}-${id}`;
const graph = getGraphManager();
@ -75,8 +77,10 @@
>
{#key id && graphId}
<div class="content" class:disabled={$inputSockets.has(socketId)}>
<label for={elementId}>{input.label || id}</label>
{#if node?.tmp?.type?.inputs?.[id]?.external !== true}
{#if inputType.label !== false}
<label for={elementId}>{input.label || id}</label>
{/if}
{#if inputType.external !== true}
<NodeInput {elementId} {node} {input} {id} />
{/if}
</div>

View File

@ -1,5 +1,5 @@
<script lang="ts">
import "./app.css";
import "@nodes/ui/app.css";
</script>
<slot />

View File

@ -1,68 +0,0 @@
/* fira-code-300 - latin */
@font-face {
font-display: swap;
/* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Fira Code';
font-style: normal;
font-weight: 300;
src: url('/fonts/fira-code-v22-latin-300.woff2') format('woff2');
/* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* fira-code-600 - latin */
@font-face {
font-display: swap;
/* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Fira Code';
font-style: normal;
font-weight: 600;
src: url('/fonts/fira-code-v22-latin-600.woff2') format('woff2');
/* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
:root {
--font-family: 'Fira Code', monospace;
font-family: var(--font-family);
/* Spacing */
--spacing-xs: 4px;
/* Extra small spacing */
--spacing-sm: 8px;
/* Small spacing */
--spacing-md: 16px;
/* Medium spacing */
--spacing-lg: 24px;
/* Large spacing */
--spacing-xl: 32px;
/* Extra large spacing */
}
body {
overflow: hidden;
/* Secondary color */
--secondary-color: #6c757d;
/* Background color */
--background-color-lighter: #202020;
--background-color: #151515;
--background-color-darker: #101010;
--text-color: #aeaeae;
background-color: var(--background-color-darker);
}
body.theme-catppuccin {
--text-color: #CDD6F4;
--background-color-lighter: #313244;
--background-color: #1E1E2E;
--background-color-darker: #11111b;
}
body {
margin: 0;
}
/* canvas { */
/* display: none !important; */
/* } */