collections + unify color picker
This commit is contained in:
@@ -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')
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user