collections + unify color picker

This commit is contained in:
wass08
2026-03-06 13:08:23 +01:00
parent 8f65daa853
commit bc57afb8fa
12 changed files with 526 additions and 116 deletions
+14
View File
@@ -0,0 +1,14 @@
import { generateId } from './base'
import type { AnyNodeId } from './types'
export type CollectionId = `collection_${string}`
export type Collection = {
id: CollectionId
name: string
color?: string
nodeIds: AnyNodeId[]
controlNodeId?: AnyNodeId
}
export const generateCollectionId = (): CollectionId => generateId('collection')
+2
View File
@@ -1,5 +1,7 @@
// Base
export { BaseNode, generateId, Material, nodeType, objectId } from './base'
// Collections
export { generateCollectionId, type Collection, type CollectionId } from './collections'
// Camera
export { CameraSchema } from './camera'
export type { AnimationEffect, Asset, AssetInput, Control, Effect, Interactive, LightEffect, SliderControl, TemperatureControl, ToggleControl } from './nodes/item'
+4
View File
@@ -1,6 +1,7 @@
import dedent from 'dedent'
import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
import type { CollectionId } from '../collections'
// --- Control descriptors ---
@@ -110,6 +111,9 @@ export const ItemNode = BaseNode.extend({
wallId: z.string().optional(),
wallT: z.number().optional(), // 0-1 parametric position along wall
// Denormalized references to collections this node belongs to
collectionIds: z.array(z.custom<CollectionId>()).optional(),
asset: assetSchema,
}).describe(dedent`Item node - used to represent a item in the building
- position: position in level coordinate system (or parent coordinate system if attached)