Describe every value kind in one table instead of spreading it over the code

A kind like colour or texture used to be spelled out in five parallel
lists, its port type, its empty value, its glyph, its label and its list
tag - 22 literal places for texture alone. core/properties/kinds.ts now
holds one row per kind and the rest is derived from it, so adding a kind
is one row. The five literal nodes collapse into literals.ts, the six
kind menus into one helper.

Number, Text, Boolean is now the one order everywhere; the variable and
port menus used to list Boolean before Text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5 committed 2026-09-12 14:47:17 +02:00
1 parent 8a7185948d
commit 3ed8b68ecf
39 files changed
+699 -565

No files matched your search

+6 -5
View File
@@ -1,12 +1,13 @@
import { type DeclaredPortKind, isKindWith, KIND, plainKindOf } from '../properties/kinds';
import { itemKindOf, structItemFields } from '../properties/listItems';
import type { PropertyDef, StructFieldDef } from '../properties/PropertySchema';
import { DECLARED_PORT_KINDS, type DeclaredPort, type DeclaredPortKind, type GraphNode } from './Graph';
import type { DeclaredPort, GraphNode } from './Graph';
/** The port a variable or property travels on. An enum, a key or an asset is text. */
/** The port a variable or property travels on. A kind no port declares (an enum, a key) is what it travels as. */
export function portKindOf(def: PropertyDef): DeclaredPortKind {
return (DECLARED_PORT_KINDS as readonly string[]).includes(def.kind)
? (def.kind as DeclaredPortKind)
: 'text';
if (isKindWith('port', def.kind)) return def.kind;
const plain = plainKindOf(KIND[def.kind].travels);
return plain !== undefined && isKindWith('port', plain) ? plain : 'text';
}
/**