@kaskad/component-tree 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/kaskad-component-tree.mjs +2380 -0
- package/fesm2022/kaskad-component-tree.mjs.map +1 -0
- package/package.json +10 -10
- package/types/kaskad-component-tree.d.ts +582 -0
- package/esm2022/index.js +0 -12
- package/esm2022/index.js.map +0 -1
- package/esm2022/kaskad-component-tree.js +0 -5
- package/esm2022/kaskad-component-tree.js.map +0 -1
- package/esm2022/lib/component-lookup/index.js +0 -68
- package/esm2022/lib/component-lookup/index.js.map +0 -1
- package/esm2022/lib/component-lookup/traverses/array-traverser.js +0 -18
- package/esm2022/lib/component-lookup/traverses/array-traverser.js.map +0 -1
- package/esm2022/lib/component-lookup/traverses/component-traverser.js +0 -120
- package/esm2022/lib/component-lookup/traverses/component-traverser.js.map +0 -1
- package/esm2022/lib/component-lookup/traverses/index.js +0 -29
- package/esm2022/lib/component-lookup/traverses/index.js.map +0 -1
- package/esm2022/lib/component-lookup/traverses/object-traverser.js +0 -22
- package/esm2022/lib/component-lookup/traverses/object-traverser.js.map +0 -1
- package/esm2022/lib/component-lookup/types.js +0 -1
- package/esm2022/lib/component-lookup/types.js.map +0 -1
- package/esm2022/lib/component-tree-api.js +0 -121
- package/esm2022/lib/component-tree-api.js.map +0 -1
- package/esm2022/lib/computation/computation-frame.js +0 -27
- package/esm2022/lib/computation/computation-frame.js.map +0 -1
- package/esm2022/lib/computation/computation-stack.js +0 -83
- package/esm2022/lib/computation/computation-stack.js.map +0 -1
- package/esm2022/lib/computation/index.js +0 -3
- package/esm2022/lib/computation/index.js.map +0 -1
- package/esm2022/lib/config.js +0 -6
- package/esm2022/lib/config.js.map +0 -1
- package/esm2022/lib/mobx/component.js +0 -110
- package/esm2022/lib/mobx/component.js.map +0 -1
- package/esm2022/lib/mobx/create-root-node.js +0 -21
- package/esm2022/lib/mobx/create-root-node.js.map +0 -1
- package/esm2022/lib/mobx/ref-space.js +0 -25
- package/esm2022/lib/mobx/ref-space.js.map +0 -1
- package/esm2022/lib/mobx/store.js +0 -827
- package/esm2022/lib/mobx/store.js.map +0 -1
- package/esm2022/lib/node/create-node-options.js +0 -16
- package/esm2022/lib/node/create-node-options.js.map +0 -1
- package/esm2022/lib/node/creators/array-creator.js +0 -9
- package/esm2022/lib/node/creators/array-creator.js.map +0 -1
- package/esm2022/lib/node/creators/command-creator.js +0 -16
- package/esm2022/lib/node/creators/command-creator.js.map +0 -1
- package/esm2022/lib/node/creators/component-creator.js +0 -58
- package/esm2022/lib/node/creators/component-creator.js.map +0 -1
- package/esm2022/lib/node/creators/leaf-creator.js +0 -5
- package/esm2022/lib/node/creators/leaf-creator.js.map +0 -1
- package/esm2022/lib/node/creators/map-creator.js +0 -14
- package/esm2022/lib/node/creators/map-creator.js.map +0 -1
- package/esm2022/lib/node/creators/object-creator.js +0 -17
- package/esm2022/lib/node/creators/object-creator.js.map +0 -1
- package/esm2022/lib/node/creators/set-creator.js +0 -13
- package/esm2022/lib/node/creators/set-creator.js.map +0 -1
- package/esm2022/lib/node/creators/shape-creator.js +0 -15
- package/esm2022/lib/node/creators/shape-creator.js.map +0 -1
- package/esm2022/lib/node/creators/variant-shape-creator.js +0 -23
- package/esm2022/lib/node/creators/variant-shape-creator.js.map +0 -1
- package/esm2022/lib/node/guards.js +0 -5
- package/esm2022/lib/node/guards.js.map +0 -1
- package/esm2022/lib/node/node-creation.js +0 -47
- package/esm2022/lib/node/node-creation.js.map +0 -1
- package/esm2022/lib/node/node-type.js +0 -1
- package/esm2022/lib/node/node-type.js.map +0 -1
- package/esm2022/lib/node/node.js +0 -305
- package/esm2022/lib/node/node.js.map +0 -1
- package/esm2022/lib/parsers/index.js +0 -3
- package/esm2022/lib/parsers/index.js.map +0 -1
- package/esm2022/lib/parsers/node-selector.types.js +0 -1
- package/esm2022/lib/parsers/node-selector.types.js.map +0 -1
- package/esm2022/lib/parsers/parse-component-selector.js +0 -43
- package/esm2022/lib/parsers/parse-component-selector.js.map +0 -1
- package/esm2022/lib/parsers/parse-node-selector.js +0 -263
- package/esm2022/lib/parsers/parse-node-selector.js.map +0 -1
- package/esm2022/lib/types/command.js +0 -1
- package/esm2022/lib/types/command.js.map +0 -1
- package/esm2022/lib/types/index.js +0 -5
- package/esm2022/lib/types/index.js.map +0 -1
- package/esm2022/lib/types/node.guards.js +0 -7
- package/esm2022/lib/types/node.guards.js.map +0 -1
- package/esm2022/lib/types/schema.js +0 -1
- package/esm2022/lib/types/schema.js.map +0 -1
- package/esm2022/lib/util/extract-node-value.js +0 -45
- package/esm2022/lib/util/extract-node-value.js.map +0 -1
- package/esm2022/lib/util/format-source.js +0 -7
- package/esm2022/lib/util/format-source.js.map +0 -1
- package/esm2022/lib/util/get-component.js +0 -8
- package/esm2022/lib/util/get-component.js.map +0 -1
- package/esm2022/lib/util/id-generator.js +0 -10
- package/esm2022/lib/util/id-generator.js.map +0 -1
- package/esm2022/lib/util/traverse-node.js +0 -50
- package/esm2022/lib/util/traverse-node.js.map +0 -1
- package/index.d.ts +0 -11
- package/kaskad-component-tree.d.ts +0 -5
- package/lib/component-lookup/index.d.ts +0 -8
- package/lib/component-lookup/traverses/array-traverser.d.ts +0 -3
- package/lib/component-lookup/traverses/component-traverser.d.ts +0 -3
- package/lib/component-lookup/traverses/index.d.ts +0 -9
- package/lib/component-lookup/traverses/object-traverser.d.ts +0 -3
- package/lib/component-lookup/types.d.ts +0 -13
- package/lib/component-tree-api.d.ts +0 -21
- package/lib/computation/computation-frame.d.ts +0 -14
- package/lib/computation/computation-stack.d.ts +0 -48
- package/lib/computation/index.d.ts +0 -2
- package/lib/config.d.ts +0 -4
- package/lib/mobx/component.d.ts +0 -45
- package/lib/mobx/create-root-node.d.ts +0 -3
- package/lib/mobx/ref-space.d.ts +0 -10
- package/lib/mobx/store.d.ts +0 -238
- package/lib/node/create-node-options.d.ts +0 -12
- package/lib/node/creators/array-creator.d.ts +0 -4
- package/lib/node/creators/command-creator.d.ts +0 -4
- package/lib/node/creators/component-creator.d.ts +0 -4
- package/lib/node/creators/leaf-creator.d.ts +0 -4
- package/lib/node/creators/map-creator.d.ts +0 -4
- package/lib/node/creators/object-creator.d.ts +0 -4
- package/lib/node/creators/set-creator.d.ts +0 -4
- package/lib/node/creators/shape-creator.d.ts +0 -4
- package/lib/node/creators/variant-shape-creator.d.ts +0 -4
- package/lib/node/guards.d.ts +0 -3
- package/lib/node/node-creation.d.ts +0 -4
- package/lib/node/node-type.d.ts +0 -49
- package/lib/node/node.d.ts +0 -107
- package/lib/parsers/index.d.ts +0 -5
- package/lib/parsers/node-selector.types.d.ts +0 -25
- package/lib/parsers/parse-component-selector.d.ts +0 -8
- package/lib/parsers/parse-node-selector.d.ts +0 -87
- package/lib/types/command.d.ts +0 -3
- package/lib/types/index.d.ts +0 -4
- package/lib/types/node.guards.d.ts +0 -4
- package/lib/types/schema.d.ts +0 -13
- package/lib/util/extract-node-value.d.ts +0 -3
- package/lib/util/format-source.d.ts +0 -1
- package/lib/util/get-component.d.ts +0 -4
- package/lib/util/id-generator.d.ts +0 -5
- package/lib/util/traverse-node.d.ts +0 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kaskad-component-tree.mjs","sources":["../../../../libs/component-tree/src/lib/types/node.guards.ts","../../../../libs/component-tree/src/lib/computation/computation-frame.ts","../../../../libs/component-tree/src/lib/computation/computation-stack.ts","../../../../libs/component-tree/src/lib/config.ts","../../../../libs/component-tree/src/lib/node/guards.ts","../../../../libs/component-tree/src/lib/node/node.ts","../../../../libs/component-tree/src/lib/parsers/parse-component-selector.ts","../../../../libs/component-tree/src/lib/parsers/parse-node-selector.ts","../../../../libs/component-tree/src/lib/util/format-source.ts","../../../../libs/component-tree/src/lib/util/traverse-node.ts","../../../../libs/component-tree/src/lib/mobx/component.ts","../../../../libs/component-tree/src/lib/mobx/ref-space.ts","../../../../libs/component-tree/src/lib/component-lookup/traverses/array-traverser.ts","../../../../libs/component-tree/src/lib/component-lookup/traverses/component-traverser.ts","../../../../libs/component-tree/src/lib/component-lookup/traverses/object-traverser.ts","../../../../libs/component-tree/src/lib/component-lookup/traverses/index.ts","../../../../libs/component-tree/src/lib/component-lookup/index.ts","../../../../libs/component-tree/src/lib/node/create-node-options.ts","../../../../libs/component-tree/src/lib/node/creators/array-creator.ts","../../../../libs/component-tree/src/lib/node/creators/command-creator.ts","../../../../libs/component-tree/src/lib/util/id-generator.ts","../../../../libs/component-tree/src/lib/node/creators/component-creator.ts","../../../../libs/component-tree/src/lib/node/creators/leaf-creator.ts","../../../../libs/component-tree/src/lib/node/creators/map-creator.ts","../../../../libs/component-tree/src/lib/node/creators/object-creator.ts","../../../../libs/component-tree/src/lib/node/creators/set-creator.ts","../../../../libs/component-tree/src/lib/node/creators/shape-creator.ts","../../../../libs/component-tree/src/lib/node/creators/variant-shape-creator.ts","../../../../libs/component-tree/src/lib/node/node-creation.ts","../../../../libs/component-tree/src/lib/util/extract-node-value.ts","../../../../libs/component-tree/src/lib/util/get-component.ts","../../../../libs/component-tree/src/lib/mobx/store.ts","../../../../libs/component-tree/src/lib/mobx/create-root-node.ts","../../../../libs/component-tree/src/lib/component-tree-api.ts","../../../../libs/component-tree/src/kaskad-component-tree.ts"],"sourcesContent":["import { ValueType } from '@kaskad/types';\n\nimport { AbstractNode, ArrayNode, CommandNode } from '../node/node';\n\nexport function isArrayNode(node: AbstractNode<ValueType>): node is ArrayNode {\n return node.valueType.type === 'array';\n}\n\nexport function isCommandNode(node: AbstractNode<ValueType>): node is CommandNode {\n return node.valueType.type === 'command';\n}\n","import { ComputationSchema } from '@kaskad/types';\nimport { IReactionDisposer, makeObservable, observable, runInAction } from 'mobx';\n\nexport class ComputationFrame {\n readonly schema: ComputationSchema;\n readonly disposers: IReactionDisposer[];\n activated = false;\n\n constructor(schema: ComputationSchema, disposers: IReactionDisposer[] = [], activated = false) {\n this.schema = schema;\n this.disposers = disposers;\n this.activated = activated;\n\n makeObservable(this, {\n activated: observable.ref,\n });\n }\n\n /**\n * Mark this computation frame as activated.\n * This is an action that ensures MobX compliance.\n */\n markActivated(): void {\n runInAction(() => {\n this.activated = true;\n });\n }\n\n dispose(): void {\n this.disposers.forEach((d) => d());\n }\n}\n","import { ComputationSchema } from '@kaskad/types';\nimport { observable, runInAction } from 'mobx';\n\nimport { ComputationFrame } from './computation-frame';\n\n/**\n * Manages a stack of computation frames for nested computations.\n * For example: formula → formula → template chain.\n */\nexport class ComputationStack {\n /**\n * Maximum allowed stack depth to prevent infinite recursion.\n */\n static readonly MAX_DEPTH = 10;\n\n private readonly _frames: ComputationFrame[];\n\n constructor() {\n this._frames = observable.array([], { deep: false, name: 'computation-stack' });\n }\n\n /**\n * Get the topmost computation frame from the stack.\n * Returns null if stack is empty.\n */\n get top(): ComputationFrame | null {\n return this._frames[this._frames.length - 1] ?? null;\n }\n\n /**\n * Returns true if all frames in the stack are activated.\n * Empty stack returns true (vacuously).\n */\n get allActivated(): boolean {\n return this._frames.length === 0 || this._frames.every((f) => f.activated);\n }\n\n /**\n * Get the current stack depth.\n */\n get depth(): number {\n return this._frames.length;\n }\n\n /**\n * Check if the stack is empty.\n */\n get isEmpty(): boolean {\n return this._frames.length === 0;\n }\n\n /**\n * Push a new computation frame onto the stack.\n * Throws if depth limit is exceeded.\n */\n push(schema: ComputationSchema): ComputationFrame {\n if (this._frames.length >= ComputationStack.MAX_DEPTH) {\n throw new Error(\n `Computation stack overflow: depth ${this._frames.length + 1} exceeds maximum ${ComputationStack.MAX_DEPTH}. ` +\n `This may indicate infinite recursion in computation chain.`,\n );\n }\n\n return runInAction(() => {\n const frame = new ComputationFrame(schema, [], false);\n this._frames.push(frame);\n return frame;\n });\n }\n\n /**\n * Pop all frames from the given depth onward.\n * For example, if depth=2, this removes frames at indices 2, 3, 4, etc.\n * Useful when a computation at a specific depth re-evaluates and needs\n * to clear its results without affecting parent computations.\n */\n popFrom(depth: number): void {\n runInAction(() => {\n while (this._frames.length > depth) {\n const frame = this._frames.pop();\n frame?.dispose();\n }\n });\n }\n\n /**\n * Dispose all frames in the stack.\n */\n dispose(): void {\n runInAction(() => {\n while (this._frames.length > 0) {\n const frame = this._frames.pop();\n frame?.dispose();\n }\n });\n }\n}\n","import { CommandNode } from './node/node';\n\nexport const componentTreeConfig = {\n runCommand: (_node: CommandNode, ..._args: unknown[]): Promise<unknown> => {\n throw new Error('runCommand is not implemented. Please provide an implementation.');\n },\n};\n","import { isObject } from '@kaskad/schema';\nimport { ValueType } from '@kaskad/types';\n\nimport { AbstractNode } from './node';\n\nexport function isNode(value: unknown): value is AbstractNode<ValueType> {\n return isObject(value) && 'nodeType' in value;\n}\n","import {\n ArrayValueType,\n BindingSchema,\n CommandValueType,\n MapValueType,\n NodePosition,\n ObjectValueType,\n SetValueType,\n ShapeValueType,\n ValueType,\n VariantShapeValueType,\n} from '@kaskad/types';\nimport { computed, IReactionDisposer, makeObservable, observable, runInAction } from 'mobx';\n\nimport { ComputationStack } from '../computation';\nimport { componentTreeConfig } from '../config';\nimport { isNode } from './guards';\nimport { NodeExtractedValue, NodeStructure, NodeViewModel } from './node-type';\n\nexport abstract class AbstractNode<T extends ValueType> {\n readonly nodeType: T['type'];\n public readonly computationStack = new ComputationStack();\n bindingSchema: BindingSchema | null = null;\n extraBinding?: BindingSchema | null = null;\n disposers: IReactionDisposer[] = [];\n protected selfEvaluating = false;\n protected selfFailed = false;\n protected selfActivated = false;\n\n protected constructor(\n public readonly valueType: T,\n structure: NodeStructure<T> | null,\n public position: NodePosition,\n ) {\n if (structure === undefined) {\n throw new Error(`Node structure cannot be undefined`);\n }\n\n this._structure = structure;\n this.nodeType = valueType.type;\n\n makeObservable<AbstractNode<T>, '_structure' | 'selfEvaluating' | 'selfFailed' | 'selfActivated'>(\n this,\n {\n _structure: observable.ref,\n selfEvaluating: observable.ref,\n selfFailed: observable.ref,\n selfActivated: observable.ref,\n evaluating: computed,\n failed: computed,\n fullyActivated: computed,\n computationActivated: computed,\n isSelfActivated: computed,\n extractedValue: computed,\n viewModel: computed,\n },\n { name: `Node-${this.valueType.type}` },\n );\n }\n\n private _structure!: NodeStructure<T> | null;\n\n get structure(): NodeStructure<T> | null {\n return this._structure;\n }\n\n set structure(value: NodeStructure<T>) {\n if (value === undefined) {\n throw new Error(`Node structure cannot be undefined`);\n }\n\n runInAction(() => (this._structure = value));\n }\n\n abstract get extractedValue(): NodeExtractedValue<T> | null;\n\n get evaluating(): boolean {\n return this.selfEvaluating || this.childrenEvaluating;\n }\n\n set evaluating(evaluating: boolean) {\n this.selfEvaluating = evaluating;\n }\n\n get failed(): boolean {\n return this.selfFailed || this.childrenFailed;\n }\n\n set failed(failed: boolean) {\n this.selfFailed = failed;\n }\n\n get fullyActivated(): boolean {\n return this.selfActivated && this.computationActivated && this.childrenActivated;\n }\n\n get computationActivated(): boolean {\n return this.computationStack.allActivated;\n }\n\n get isSelfActivated(): boolean {\n return this.selfActivated;\n }\n\n get viewModel(): NodeViewModel<T> | null {\n return this.extractedValue as NodeViewModel<T> | null;\n }\n\n protected abstract get childrenEvaluating(): boolean;\n\n protected abstract get childrenFailed(): boolean;\n\n protected abstract get childrenActivated(): boolean;\n\n markActivated(): void {\n runInAction(() => (this.selfActivated = true));\n }\n\n public dispose(): void {\n runInAction(() => {\n // Dispose all computation frames in the stack\n this.computationStack.dispose();\n\n // run self-level disposers\n this.disposers.forEach((disposer) => disposer());\n this.disposers.length = 0; // reset array\n });\n\n // delegate to subclass for the child walk\n this.disposeChildren();\n }\n\n /**\n * Find a sub-node by following a path of segments.\n * @param path Array of strings/numbers representing the path to traverse\n * @returns The found node or null if not found/traversal not possible\n */\n abstract getNodeByPath(path: (string | number)[]): AbstractNode<ValueType> | null;\n\n protected abstract disposeChildren(): void;\n}\n\nexport class LeafNode<T extends ValueType> extends AbstractNode<T> {\n constructor(valueType: T, structure: NodeStructure<T> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n get extractedValue(): NodeExtractedValue<T> | null {\n return this.structure;\n }\n\n protected get childrenEvaluating() {\n return false;\n }\n\n protected get childrenFailed() {\n return false;\n }\n\n protected get childrenActivated() {\n return true;\n }\n\n getNodeByPath(path: (string | number)[]): AbstractNode<ValueType> | null {\n // Leaf nodes cannot be traversed further\n return path.length === 0 ? (this as AbstractNode<ValueType>) : null;\n }\n\n protected disposeChildren(): void {\n return;\n }\n}\n\nexport class CommandNode extends LeafNode<CommandValueType> {\n inFlight = 0;\n\n constructor(valueType: CommandValueType, structure: NodeStructure<CommandValueType> | null, position: NodePosition) {\n super(valueType, structure, position);\n makeObservable(this, {\n inFlight: observable,\n executing: computed,\n });\n }\n\n get executing() {\n return this.inFlight > 0;\n }\n\n override get viewModel(): NodeViewModel<CommandValueType> {\n return {\n execute: this.#execute,\n executing: this.executing,\n failed: this.failed,\n };\n }\n\n #execute = async (...args: unknown[]) => {\n runInAction(() => this.inFlight++);\n this.failed = false; // Reset failed state before execution\n try {\n return await componentTreeConfig.runCommand(this, ...args);\n } catch (error) {\n this.failed = true; // Set failed state on error\n throw error;\n } finally {\n runInAction(() => this.inFlight--);\n }\n };\n}\n\nexport class ArrayNode extends AbstractNode<ArrayValueType> {\n constructor(valueType: ArrayValueType, structure: NodeStructure<ArrayValueType> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n get extractedValue(): NodeExtractedValue<ArrayValueType> | null {\n const value = this.structure;\n if (!value) return null;\n return value.map((item) => item.extractedValue);\n }\n\n protected get childrenEvaluating(): boolean {\n return this.structure ? this.structure.some((n) => n.evaluating) : false;\n }\n\n protected get childrenFailed(): boolean {\n return this.structure ? this.structure.some((n) => n.failed) : false;\n }\n\n protected get childrenActivated(): boolean {\n return this.structure ? this.structure.every((n) => n.fullyActivated) : true;\n }\n\n getNodeByPath(path: (string | number)[]): AbstractNode<ValueType> | null {\n if (path.length === 0) {\n return this;\n }\n\n const [head, ...tail] = path;\n if (!this.structure) return null;\n\n const found = this.structure[head as number];\n if (!found) return null;\n\n return found.getNodeByPath(tail);\n }\n\n protected disposeChildren(): void {\n this.structure?.forEach((child) => isNode(child) && child.dispose());\n }\n}\n\nexport abstract class AbstractObjectLikeNode<T extends ValueType> extends AbstractNode<T> {\n protected constructor(valueType: T, structure: NodeStructure<T> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n protected get childrenEvaluating(): boolean {\n const obj = this.object();\n return !!obj && Object.values(obj).some((n) => n.evaluating);\n }\n\n protected get childrenFailed(): boolean {\n const obj = this.object();\n return !!obj && Object.values(obj).some((n) => n.failed);\n }\n\n protected get childrenActivated(): boolean {\n const obj = this.object();\n return obj ? Object.values(obj).every((n) => n.fullyActivated) : true;\n }\n\n getNodeByPath(path: (string | number)[]): AbstractNode<ValueType> | null {\n if (path.length === 0) {\n return this as AbstractNode<ValueType>;\n }\n\n const [head, ...tail] = path;\n const obj = this.object();\n if (!obj) return null;\n\n const found = obj[head as string];\n if (!found) return null;\n\n return found.getNodeByPath(tail);\n }\n\n protected abstract object(): Record<string, AbstractNode<ValueType>> | null;\n\n protected disposeChildren(): void {\n const obj = this.object();\n if (!obj) return;\n Object.values(obj).forEach((n) => n.dispose());\n }\n\n protected mapObjectExtracted(): Record<string, unknown> | null {\n const obj = this.object();\n if (!obj) return null;\n return Object.fromEntries(Object.entries(obj).map(([k, n]) => [k, n.extractedValue]));\n }\n}\n\nexport class MapNode extends AbstractObjectLikeNode<MapValueType> {\n constructor(valueType: MapValueType, structure: NodeStructure<MapValueType> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n get extractedValue() {\n return this.mapObjectExtracted();\n }\n\n protected object() {\n return this.structure;\n }\n}\n\nexport class SetNode extends AbstractNode<SetValueType> {\n constructor(valueType: SetValueType, structure: NodeStructure<SetValueType> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n get extractedValue(): NodeExtractedValue<SetValueType> | null {\n const value = this.structure;\n if (!value) return null;\n const extractedValues = new Set<unknown>();\n value.forEach((item) => {\n extractedValues.add(item.extractedValue);\n });\n return extractedValues;\n }\n\n protected get childrenEvaluating(): boolean {\n return this.structure ? Array.from(this.structure).some((n) => n.evaluating) : false;\n }\n\n protected get childrenFailed(): boolean {\n return this.structure ? Array.from(this.structure).some((n) => n.failed) : false;\n }\n\n protected get childrenActivated(): boolean {\n return this.structure ? Array.from(this.structure).every((n) => n.fullyActivated) : true;\n }\n\n getNodeByPath(path: (string | number)[]): AbstractNode<ValueType> | null {\n if (path.length === 0) {\n return this;\n }\n\n // Sets don't support path traversal since they don't have indexed access\n return null;\n }\n\n protected disposeChildren(): void {\n this.structure?.forEach((child) => isNode(child) && child.dispose());\n }\n}\n\nexport class ObjectNode extends AbstractObjectLikeNode<ObjectValueType> {\n constructor(valueType: ObjectValueType, structure: NodeStructure<ObjectValueType> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n get extractedValue() {\n return this.mapObjectExtracted();\n }\n\n protected object() {\n return this.structure;\n }\n}\n\nexport class ShapeNode extends AbstractObjectLikeNode<ShapeValueType> {\n constructor(valueType: ShapeValueType, structure: NodeStructure<ShapeValueType> | null, position: NodePosition) {\n super(valueType, structure, position);\n }\n\n get extractedValue() {\n return this.mapObjectExtracted();\n }\n\n protected object() {\n return this.structure;\n }\n}\n\nexport class VariantShapeNode extends AbstractObjectLikeNode<VariantShapeValueType> {\n constructor(\n valueType: VariantShapeValueType,\n structure: NodeStructure<VariantShapeValueType> | null,\n position: NodePosition,\n ) {\n super(valueType, structure, position);\n }\n\n get extractedValue() {\n const base = this.mapObjectExtracted();\n if (!base || !this.structure) return null;\n const kindField = `${this.valueType.shapeType}Type`;\n return { ...base, [kindField]: this.structure.kind };\n }\n\n protected object() {\n return this.structure?.fields ?? null;\n }\n}\n\n// TNode is removed - use AbstractNode<ValueType> directly\n","export type SelectorSegmentModifier = null | ':' | '^' | '&';\n\nexport interface SelectorSegment {\n qualifier: string;\n modifier: SelectorSegmentModifier;\n conditions: string[][];\n index?: number;\n}\n\nconst modifiers: SelectorSegmentModifier[] = [':', '^', '&'];\n\nexport function parseComponentSelector(selector: string): SelectorSegment[] {\n if (!selector.trim()) {\n return [];\n }\n\n const result: SelectorSegment[] = [];\n const parts = selector.split(/\\s+/);\n\n for (let i = 0; i < parts.length; i++) {\n let part = parts[i];\n if (part.includes('[')) {\n while (!part.endsWith(']') && i < parts.length - 1) {\n i++;\n part += ' ' + parts[i];\n }\n }\n result.push(parseSelectorSegment(part));\n }\n\n return result;\n}\n\nfunction parseSelectorSegment(rawSegment: string): SelectorSegment {\n const segment: SelectorSegment = {\n qualifier: '',\n modifier: null,\n conditions: [],\n };\n\n // Extract :nth(N) pseudo-selector\n const nthMatch = rawSegment.match(/:nth\\((-?\\d+)\\)/);\n if (nthMatch) {\n segment.index = parseInt(nthMatch[1], 10);\n rawSegment = rawSegment.replace(/:nth\\(-?\\d+\\)/, '');\n }\n\n const conditionsMatch = rawSegment.match(/\\[(.*?)]/g);\n\n if (conditionsMatch) {\n segment.conditions = conditionsMatch.map((item) => item.slice(1, -1).split('='));\n\n const conditionStart = rawSegment.indexOf('[');\n rawSegment = rawSegment.slice(0, conditionStart);\n }\n\n const firstChar = rawSegment[0] as SelectorSegmentModifier;\n\n segment.modifier = modifiers.includes(firstChar) ? firstChar : null;\n segment.qualifier = rawSegment.replace(/^[:^&]/, '');\n\n return segment;\n}\n","import { Delimiters } from '@kaskad/config';\n\nimport { NodeSelector, PathSegment } from './node-selector.types';\nimport { parseComponentSelector } from './parse-component-selector';\n\nexport type PathPart = string | number;\nexport type PathArray = PathPart[];\n\n/**\n * Parse a path string into structured segments.\n *\n * ## Path Notation Rules\n *\n * **Dot notation (.)** - Access object properties\n * - `user.profile.name` - Access nested object properties\n * - `config.0` - Access object property named \"0\" (string key)\n *\n * **Bracket notation ([])** - Access array elements by numeric index\n * - `items[0].name` - Access first array element, then its 'name' property\n * - `matrix[0][1]` - Access multi-dimensional arrays\n *\n * **Optional chaining (?.)** - Safely access potentially missing properties\n * - `user?.profile?.email` - Returns null if any segment is missing\n *\n * **Variable prefix ($)** - Access variables instead of properties\n * - `$config.theme` - Access variable 'config', then its 'theme' property\n * - `$items[0]` - Access variable 'items' array, then first element\n *\n * **Component selector (->)** - Access properties on other components\n * - `&ref->prop.field` - Access 'prop.field' on component with ref\n * - `:Button[disabled=true]->label` - Access 'label' on Button with condition\n * - `^parent->config` - Access 'config' on parent component\n *\n * **Optional component selector (?->)** - Safely access components that might not exist\n * - `&ref?->value` - Returns null if component with ref doesn't exist\n * - `:OptionalType?->property` - Returns null if component type not found\n * - `^Parent?->config` - Returns null if parent doesn't match\n *\n * ## Component Selector Syntax\n *\n * Component selectors support modifiers and conditions:\n * - `&ref` - Select by ref\n * - `:ComponentType` - Select by component type\n * - `^parent` - Select parent component\n * - `[prop=value]` - Filter by property value\n * - Multiple conditions: `:Button[disabled=true][type=submit]`\n *\n * ## Notation Disambiguation\n *\n * The choice between dot and bracket notation determines the access type:\n * ```typescript\n * 'data.0' // Object property named \"0\" (string key)\n * 'data[0]' // Array element at index 0 (numeric index)\n * 'columns.1' // Object property named \"1\"\n * 'columns[1]' // Array element at index 1\n * ```\n *\n * @example\n * parseNodeSelector('users[0].name')\n * // => { kind: 'property', head: 'users', tail: [{ key: 0, optional: false }, { key: 'name', optional: false }] }\n *\n * @example\n * parseNodeSelector('config.0')\n * // => { kind: 'property', head: 'config', tail: [{ key: '0', optional: false }] }\n *\n * @example\n * parseNodeSelector('prop?.nested?.field')\n * // => { kind: 'property', head: 'prop', tail: [{ key: 'nested', optional: true }, { key: 'field', optional: true }] }\n *\n * @example\n * parseNodeSelector('$varName.field')\n * // => { kind: 'variable', head: 'varName', tail: [{ key: 'field', optional: false }] }\n *\n * @example\n * parseNodeSelector('&ref->prop.field')\n * // => {\n * // componentSelector: [{ qualifier: 'ref', modifier: '&', conditions: [] }],\n * // kind: 'property',\n * // head: 'prop',\n * // tail: [{ key: 'field', optional: false }]\n * // }\n *\n * @example\n * parseNodeSelector(':Button[disabled=true]->label.text')\n * // => {\n * // componentSelector: [{ qualifier: 'Button', modifier: ':', conditions: [['disabled', 'true']] }],\n * // kind: 'property',\n * // head: 'label',\n * // tail: [{ key: 'text', optional: false }]\n * // }\n */\nexport function parseNodeSelector(path: string): NodeSelector {\n if (!path) {\n throw new Error('Empty path provided');\n }\n\n // Handle variable prefix\n if (path.startsWith(Delimiters.Variable)) {\n const withoutPrefix = path.slice(1);\n\n // Check for both . and ?. separators\n const dotIndex = withoutPrefix.indexOf(Delimiters.NodePath);\n const optionalIndex = withoutPrefix.indexOf('?.');\n\n // If no separator found, it's just the variable name\n if (dotIndex === -1 && optionalIndex === -1) {\n return {\n kind: 'variable',\n head: withoutPrefix,\n tail: [],\n };\n }\n\n // Find the first separator (. or ?.)\n let firstSeparatorIndex: number;\n let isOptional: boolean;\n\n if (dotIndex === -1) {\n firstSeparatorIndex = optionalIndex;\n isOptional = true;\n } else if (optionalIndex === -1) {\n firstSeparatorIndex = dotIndex;\n isOptional = false;\n } else {\n firstSeparatorIndex = Math.min(dotIndex, optionalIndex);\n isOptional = firstSeparatorIndex === optionalIndex;\n }\n\n const varName = withoutPrefix.substring(0, firstSeparatorIndex);\n const restPath = withoutPrefix.substring(firstSeparatorIndex + (isOptional ? 2 : 1));\n\n return {\n kind: 'variable',\n head: varName,\n tail: parseSegments(restPath, isOptional), // Pass the optional flag\n };\n }\n\n // Handle component selector arrow (both ?-> and ->)\n const optionalArrowIndex = path.indexOf('?->');\n const strictArrowIndex = path.indexOf('->');\n\n // Determine which arrow to use (prefer ?-> if both are found)\n let arrowIndex = -1;\n let arrowLength = 2;\n let isOptionalComponent = false;\n\n if (optionalArrowIndex !== -1 && (strictArrowIndex === -1 || optionalArrowIndex < strictArrowIndex)) {\n arrowIndex = optionalArrowIndex;\n arrowLength = 3;\n isOptionalComponent = true;\n } else if (strictArrowIndex !== -1) {\n arrowIndex = strictArrowIndex;\n arrowLength = 2;\n isOptionalComponent = false;\n }\n\n if (arrowIndex !== -1) {\n const componentSelectorStr = path.substring(0, arrowIndex);\n const nodePath = path.substring(arrowIndex + arrowLength);\n const parsed = parseNodeSelector(nodePath);\n\n return {\n component: {\n selector: parseComponentSelector(componentSelectorStr),\n optional: isOptionalComponent,\n },\n kind: parsed.kind,\n head: parsed.head,\n tail: parsed.tail,\n };\n }\n\n // Regular property path\n return parsePropertyPath(path);\n}\n\n/**\n * Parse a property path (no variable prefix or component selector)\n */\nfunction parsePropertyPath(path: string): NodeSelector {\n if (!path) {\n throw new Error('Empty property path provided');\n }\n\n const allSegments = parseSegments(path);\n\n if (allSegments.length === 0) {\n throw new Error('Empty property path provided');\n }\n\n const [first, ...rest] = allSegments;\n\n return {\n kind: 'property',\n head: first.key as string,\n tail: rest,\n };\n}\n\n/**\n * Parse path segments, handling optional chaining and array notation\n * @param path - The path to parse\n * @param startOptional - If true, the first segment should be marked as optional\n */\nfunction parseSegments(path: string, startOptional = false): PathSegment[] {\n if (!path) return [];\n\n const segments: PathSegment[] = [];\n let current = '';\n let nextOptional = startOptional; // Start with the passed optional flag\n let i = 0;\n\n while (i < path.length) {\n const char = path[i];\n const nextChar = path[i + 1];\n\n // Handle optional chaining ?.\n if (char === '?' && nextChar === '.') {\n if (current) {\n segments.push(makeSegment(current, nextOptional, false));\n current = '';\n }\n nextOptional = true;\n i += 2;\n continue;\n }\n\n // Handle array bracket notation [0]\n if (char === '[') {\n if (current) {\n segments.push(makeSegment(current, nextOptional, false));\n current = '';\n nextOptional = false;\n }\n\n let index = '';\n i++;\n while (i < path.length && path[i] !== ']') {\n index += path[i];\n i++;\n }\n\n if (path[i] === ']') {\n segments.push(makeSegment(index, nextOptional, true)); // fromBracket = true\n i++; // Skip ]\n\n // Skip following . if present\n if (path[i] === '.') i++;\n }\n continue;\n }\n\n // Handle regular . separator\n if (char === '.') {\n if (current) {\n segments.push(makeSegment(current, nextOptional, false));\n current = '';\n nextOptional = false;\n }\n i++;\n continue;\n }\n\n current += char;\n i++;\n }\n\n if (current) {\n segments.push(makeSegment(current, nextOptional, false));\n }\n\n return segments;\n}\n\n/**\n * Create a path segment, parsing numbers only for bracket notation.\n * Dot notation keeps keys as strings to allow object properties named \"0\", \"1\", etc.\n *\n * @param key - The segment key\n * @param optional - Whether this segment uses optional chaining\n * @param fromBracket - True if this came from bracket notation [0], false if from dot notation\n */\nfunction makeSegment(key: string, optional: boolean, fromBracket = false): PathSegment {\n // Only convert to number if it came from bracket notation\n if (fromBracket) {\n const asNumber = Number(key);\n if (!Number.isNaN(asNumber)) {\n return { key: asNumber, optional };\n }\n }\n\n // Keep as string for dot notation or non-numeric bracket content\n return { key, optional };\n}\n","export function formatSource(sourceUrl: string | null | undefined, path?: (string | number)[]): string {\n if (!sourceUrl) return '';\n const pathStr = path?.length ? ` @ ${path.join('.')}` : '';\n return `[${sourceUrl}${pathStr}]`;\n}\n","import { ValueType } from '@kaskad/types';\n\nimport { AbstractNode } from '../node/node';\nimport { PathSegment } from '../parsers';\n\n/**\n * Traverse a node using parsed path segments, respecting optional chaining.\n *\n * @param node - The starting node\n * @param segments - Array of path segments to traverse\n * @returns The found node, or null if not found and optional chaining was used\n * @throws Error if a required segment is not found\n *\n * @example\n * const userNode = component.getNode('user');\n * const nameNode = traverseNode(userNode, [\n * { key: 'profile', optional: false },\n * { key: 'name', optional: false }\n * ]);\n *\n * @example\n * // With optional chaining - returns null instead of throwing\n * const emailNode = traverseNode(userNode, [\n * { key: 'contact', optional: true },\n * { key: 'email', optional: false }\n * ]);\n */\nexport function traverseNode(node: AbstractNode<ValueType>, segments: PathSegment[]): AbstractNode<ValueType> | null {\n if (segments.length === 0) {\n return node;\n }\n\n const [head, ...tail] = segments;\n const found = node.getNodeByPath([head.key]);\n\n if (!found) {\n if (head.optional) {\n return null; // Optional chaining returns null\n }\n\n // Check if this is a shape/object-like node with null value\n // In this case, accessing properties should return null instead of throwing\n // This is common in reactive systems where shape values might not be initialized yet\n if (\n node.nodeType === 'shape' ||\n node.nodeType === 'variantShape' ||\n node.nodeType === 'object' ||\n node.nodeType === 'map'\n ) {\n const extracted = node.extractedValue;\n if (extracted === null || extracted === undefined) {\n return null;\n }\n }\n\n throw new Error(\n `Cannot access ${typeof head.key === 'number' ? 'index' : 'property'} ` +\n `'${head.key}' on ${node.nodeType} node at path ${node.position.path.join('.')}`,\n );\n }\n\n return traverseNode(found, tail);\n}\n","import { ComponentId, NodePosition, RefSpaceId, ValueType } from '@kaskad/types';\nimport { action, IReactionDisposer, makeObservable, observable } from 'mobx';\n\nimport { AbstractNode } from '../node/node';\nimport { NodeSelector, parseNodeSelector } from '../parsers';\nimport { NodeChangeHandler } from '../types';\nimport { formatSource } from '../util/format-source';\nimport { traverseNode } from '../util/traverse-node';\n\nexport interface ComponentCreateConfig {\n id: ComponentId;\n componentType: string;\n position: NodePosition;\n refSpaceId: RefSpaceId;\n props: Map<string, AbstractNode<ValueType>>;\n variables: Map<string, AbstractNode<ValueType>>;\n onNodeChange: NodeChangeHandler[];\n sourceUrl?: string;\n}\n\nexport class TComponent {\n readonly id: ComponentId;\n readonly position: NodePosition;\n readonly refSpaceId: RefSpaceId;\n sourceUrl: string | null;\n componentType: string;\n props: Map<string, AbstractNode<ValueType>>;\n variables: Map<string, AbstractNode<ValueType>>;\n onNodeChange: NodeChangeHandler[];\n handlerDisposers: IReactionDisposer[] = [];\n\n constructor(config: ComponentCreateConfig) {\n this.id = config.id;\n this.position = config.position;\n this.refSpaceId = config.refSpaceId;\n this.sourceUrl = config.sourceUrl ?? null;\n this.componentType = config.componentType;\n this.props = config.props;\n this.variables = config.variables;\n this.onNodeChange = config.onNodeChange;\n\n makeObservable(this, {\n props: observable.shallow,\n variables: observable.shallow,\n setVariable: action,\n });\n }\n\n setVariable(variableName: string, node: AbstractNode<ValueType>) {\n this.variables.set(variableName, node);\n }\n\n /**\n * Find a node by selector. Returns null if the node is not found.\n * This is an alias for getNode for consistency with ComponentStore's API.\n */\n findNode(nodeSelector: string): AbstractNode<ValueType> | null {\n const parsed = parseNodeSelector(nodeSelector);\n return this.findNodeFromParsed(parsed);\n }\n\n /**\n * Get a node by selector. Throws an error if the node is not found.\n * Use findNode() for optional lookups that return null instead of throwing.\n *\n * Note: Even if the selector contains optional chaining (?.), this method will throw\n * if the node is not found. Use findNode() for optional chaining support.\n */\n getNode(nodeSelector: string): AbstractNode<ValueType> {\n const parsed = parseNodeSelector(nodeSelector);\n return this.getNodeFromParsed(parsed);\n }\n\n findNodeFromParsed(parsed: Omit<NodeSelector, 'componentSelector'>): AbstractNode<ValueType> | null {\n // Handle variable access\n if (parsed.kind === 'variable') {\n const varNode = this.variables.get(parsed.head);\n if (!varNode) {\n return null;\n }\n\n return traverseNode(varNode, parsed.tail);\n }\n\n // Handle property access\n const propNode = this.props.get(parsed.head);\n if (!propNode) {\n return null;\n }\n\n return traverseNode(propNode, parsed.tail);\n }\n\n getNodeFromParsed(parsed: Omit<NodeSelector, 'componentSelector'>): AbstractNode<ValueType> {\n const src = formatSource(this.sourceUrl);\n\n // Handle variable access\n if (parsed.kind === 'variable') {\n const varNode = this.variables.get(parsed.head);\n if (!varNode) {\n throw new Error(\n `${src} Variable '${parsed.head}' does not exist in component '${this.id}' (type: ${this.componentType})`,\n );\n }\n\n const result = traverseNode(varNode, parsed.tail);\n if (!result) {\n throw new Error(\n `${src} Node not found for variable path '${parsed.head}${parsed.tail.map((s) => `.${s.key}`).join('')}' in component '${this.id}'`,\n );\n }\n return result;\n }\n\n // Handle property access - strict mode, always throw if not found\n const propNode = this.props.get(parsed.head);\n if (!propNode) {\n throw new Error(\n `${src} Property '${parsed.head}' does not exist on component '${this.id}' (type: ${this.componentType}). ` +\n `Available properties: [${Array.from(this.props.keys()).join(', ')}]`,\n );\n }\n\n const result = traverseNode(propNode, parsed.tail);\n if (!result) {\n throw new Error(\n `${src} Node not found for property path '${parsed.head}${parsed.tail.map((s) => `.${s.key}`).join('')}' in component '${this.id}'`,\n );\n }\n return result;\n }\n\n getNodeValue<T>(nodeSelector: string): T | null {\n // Use findNode to support optional chaining and return null if not found\n const node = this.findNode(nodeSelector);\n return node ? (node.extractedValue as T) : null;\n }\n\n dispose() {\n this.handlerDisposers.forEach((disposer) => disposer());\n this.handlerDisposers = [];\n\n for (const [, prop] of this.props.entries()) {\n prop.dispose();\n }\n\n for (const [, variable] of this.variables.entries()) {\n variable.dispose();\n }\n }\n}\n","import { ComponentId, ComponentRef, RefSpaceId } from '@kaskad/types';\nimport { observable, runInAction } from 'mobx';\n\nexport class RefSpace {\n private readonly byRef: Map<ComponentRef, ComponentId>;\n\n constructor(\n public id: RefSpaceId,\n public parentRefSpaceId: RefSpaceId | null = null,\n ) {\n this.byRef = observable.map({}, { name: 'by-ref-map', deep: false });\n }\n\n get refs() {\n return this.byRef;\n }\n\n addRefs(refs: Record<ComponentRef, ComponentId>) {\n runInAction(() => {\n for (const ref in refs) {\n this.byRef.set(ref, refs[ref]);\n }\n });\n }\n\n getComponentIdByRef(ref: string): ComponentId | null {\n return this.byRef.get(ref) || null;\n }\n}\n","import { ArrayValueType, ValueType } from '@kaskad/types';\n\nimport { Context, NodeQueue } from '../types';\n\nexport function traversArray(ctx: Context<ArrayValueType>, nodeQueue: NodeQueue) {\n if (!ctx.selectorSegments.length) {\n return;\n }\n\n const arrayValue = ctx.currentNode.value || [];\n const description = ctx.currentNode.valueType;\n\n for (const item of arrayValue) {\n const childCtx: Context<ValueType> = {\n ...ctx,\n currentNode: {\n valueType: description.item,\n value: item,\n },\n };\n nodeQueue.push(childCtx);\n }\n}\n","import { log } from '@kaskad/config';\nimport { DefinitionStore } from '@kaskad/definition';\nimport { ComponentId, ComponentValueType, ValueType } from '@kaskad/types';\n\nimport { TComponent } from '../../mobx/component';\nimport { ComponentStore } from '../../mobx/store';\nimport { AbstractNode } from '../../node/node';\nimport { SelectorSegment } from '../../parsers';\nimport { Context, NodeQueue, TraverseResult } from '../types';\n\nexport function traversComponent(\n ctx: Context<ComponentValueType>,\n nodeQueue: NodeQueue,\n foundComponents: TraverseResult,\n) {\n const componentId = ctx.currentNode.value as ComponentId | null;\n if (componentId === null) return;\n\n const segmentQueue = [...ctx.selectorSegments];\n\n const store = ComponentStore.getInstance();\n const currentComponent = store.getComponentOrThrow(componentId);\n\n while (segmentQueue.length > 0) {\n const selectorSegment = segmentQueue.shift();\n if (!selectorSegment) break;\n const isLastSelectorSegment = segmentQueue.length === 0;\n\n if (selectorSegment.modifier === '&') {\n const refSpace = store.getRefSpaceOrThrow(currentComponent.refSpaceId);\n const foundComponentId = refSpace.getComponentIdByRef(selectorSegment.qualifier);\n\n if (!foundComponentId) {\n if (!refSpace.parentRefSpaceId) {\n return;\n }\n const parentRefSpace = store.getRefSpaceOrThrow(refSpace.parentRefSpaceId);\n const foundInParent = parentRefSpace.getComponentIdByRef(selectorSegment.qualifier);\n\n if (!foundInParent) {\n return;\n }\n\n if (isLastSelectorSegment) {\n foundComponents.push(foundInParent);\n return;\n }\n\n addToQueue(\n currentComponent.id,\n {\n valueType: { type: 'component' },\n value: foundInParent,\n },\n segmentQueue,\n nodeQueue,\n );\n return;\n }\n if (isLastSelectorSegment) {\n foundComponents.push(foundComponentId);\n return;\n }\n continue;\n }\n\n if (selectorSegment.modifier === '^') {\n const matched =\n testComponentType(selectorSegment.qualifier, currentComponent.componentType) &&\n testConditions(selectorSegment.conditions, currentComponent);\n\n if (!matched) {\n addToQueue(\n currentComponent.id,\n {\n valueType: { type: 'component' },\n value: currentComponent.position.componentId,\n },\n [selectorSegment, ...segmentQueue],\n nodeQueue,\n );\n\n return;\n }\n\n if (isLastSelectorSegment) {\n foundComponents.push(componentId);\n }\n continue;\n }\n\n if (selectorSegment.modifier === ':') {\n if (!DefinitionStore.getInstance().hasComponentWithType(selectorSegment.qualifier)) {\n log.trace(`Component with type \"${selectorSegment.qualifier}\" does not exist.`);\n return;\n }\n\n if (currentComponent.id === ctx.relativeTo) {\n addComponentNodesToQueue(currentComponent, [selectorSegment, ...segmentQueue], nodeQueue);\n return;\n }\n\n const matched =\n testComponentType(selectorSegment.qualifier, currentComponent.componentType) &&\n testConditions(selectorSegment.conditions, currentComponent);\n\n if (!matched) {\n addComponentNodesToQueue(currentComponent, [selectorSegment, ...segmentQueue], nodeQueue);\n return;\n }\n\n if (isLastSelectorSegment) {\n foundComponents.push(componentId);\n return;\n }\n\n addToQueue(\n currentComponent.id,\n {\n valueType: { type: 'component' },\n value: currentComponent.id,\n },\n segmentQueue,\n nodeQueue,\n );\n return;\n }\n\n log.trace('Potentially invalid selector', ctx.selectorSegments);\n }\n}\n\nfunction testComponentType(qualifier: string, componentType: string): boolean {\n return DefinitionStore.getInstance().getComponentTraits(componentType).includes(qualifier);\n}\n\nfunction testConditions(conditions: string[][], component: TComponent): boolean {\n return conditions.every((condition) => {\n const [key, expectedValue] = condition;\n\n if (!component.props.has(key)) return false;\n\n const actualValue = String(extractNodeValue(component.props.get(key)));\n return actualValue === expectedValue;\n });\n}\n\nfunction addComponentNodesToQueue(component: TComponent, selectorSegments: SelectorSegment[], nodeQueue: NodeQueue) {\n for (const node of component.props.values()) {\n addToQueue(\n component.id,\n {\n valueType: node.valueType,\n value: extractNodeValue(node),\n },\n selectorSegments,\n nodeQueue,\n );\n }\n}\n\nfunction addToQueue(\n componentId: ComponentId,\n node: Context<ValueType>['currentNode'],\n selectorSegments: SelectorSegment[],\n nodeQueue: NodeQueue,\n) {\n const childCtx: Context<ValueType> = {\n selectorSegments,\n currentNode: node,\n relativeTo: componentId,\n };\n nodeQueue.push(childCtx);\n}\n\nfunction extractNodeValue(node?: AbstractNode<ValueType>) {\n if (!node) return null;\n return node.extractedValue;\n}\n","import { ObjectValueType, ValueType } from '@kaskad/types';\n\nimport { Context, NodeQueue } from '../types';\n\nexport function traversObject(ctx: Context<ObjectValueType>, nodeQueue: NodeQueue) {\n if (!ctx.selectorSegments.length) {\n return;\n }\n\n const description = ctx.currentNode.valueType as ObjectValueType;\n\n const objectNodeValue = ctx.currentNode.value;\n if (!objectNodeValue) {\n return;\n }\n\n Object.entries(description.fields).forEach(([fieldKey, fieldDescription]) => {\n const childCtx: Context<ValueType> = {\n ...ctx,\n currentNode: {\n valueType: fieldDescription,\n value: objectNodeValue[fieldKey],\n },\n };\n nodeQueue.push(childCtx);\n });\n return;\n}\n","import { ValueType } from '@kaskad/types';\n\nimport { Context, NodeQueue, TraverseResult } from '../types';\nimport { traversArray } from './array-traverser';\nimport { traversComponent } from './component-traverser';\nimport { traversObject } from './object-traverser';\n\ntype TraversFn = (ctx: Context<ValueType>, nodeQueue: NodeQueue, foundComponents: TraverseResult) => void;\n\ntype Registry = {\n _registry: Record<string, unknown>;\n get(key: string): TraversFn;\n};\n\nexport const traversesRegistry: Registry = {\n _registry: {\n array: traversArray,\n object: traversObject,\n component: traversComponent,\n map: () => [], // TODO: implement\n\n // the following node types cannot contain components\n set: () => [],\n unknown: () => [],\n boolean: () => [],\n string: () => [],\n number: () => [],\n componentSchema: () => [],\n validator: () => [],\n command: () => [],\n shape: () => [],\n variantShape: () => [],\n },\n get(type: string) {\n if (!this._registry[type]) {\n throw new Error(`Travers for type \"${type}\" not found`);\n }\n return this._registry[type] as TraversFn;\n },\n};\n","import { ComponentId, ComponentValueType } from '@kaskad/types';\n\nimport { TComponent } from '../mobx/component';\nimport { ComponentStore } from '../mobx/store';\nimport { parseComponentSelector, SelectorSegment } from '../parsers';\nimport { traversesRegistry } from './traverses';\nimport { Context, NodeQueue, TraverseResult } from './types';\n\nexport { parseComponentSelector };\nexport type { SelectorSegment };\n\nexport function findComponent(relativeTo: ComponentId, selector: SelectorSegment[]): TComponent | null {\n const ids = findComponentsIds(relativeTo, selector);\n\n if (!ids.length) {\n return null;\n }\n\n if (ids.length > 1) {\n throw new Error(`Selector matched ${ids.length} components (expected 1): ${ids.join(', ')}`);\n }\n\n return ComponentStore.getInstance().getComponentOrThrow(ids[0]);\n}\n\nexport function findComponents(relativeTo: ComponentId, selector: SelectorSegment[]): TComponent[] {\n const ids = findComponentsIds(relativeTo, selector);\n return ids.map((componentId) => ComponentStore.getInstance().getComponentOrThrow(componentId));\n}\n\nexport function findComponentsIds(relativeTo: ComponentId, selector: SelectorSegment[]): ComponentId[] {\n const selectors = [selector];\n\n const foundComponents: TraverseResult = [];\n\n for (const parsedSelector of selectors) {\n if (parsedSelector.length === 0) {\n foundComponents.push(relativeTo);\n continue;\n }\n\n const startFrom: Context<ComponentValueType> = {\n currentNode: {\n valueType: { type: 'component' },\n value: relativeTo,\n },\n selectorSegments: parsedSelector,\n relativeTo,\n };\n\n const nodeQueue: NodeQueue = [startFrom];\n\n while (nodeQueue.length > 0) {\n const ctx = nodeQueue.shift();\n if (!ctx) break;\n const traverser = traversesRegistry.get(ctx.currentNode.valueType.type);\n traverser(ctx, nodeQueue, foundComponents);\n }\n }\n\n const uniqueComponents = Array.from(new Set(foundComponents));\n\n // Apply :nth(N) filtering if the last segment has an index\n const lastSegment = selector[selector.length - 1];\n if (lastSegment && lastSegment.index !== undefined) {\n const index = lastSegment.index;\n const actualIndex = index < 0 ? uniqueComponents.length + index : index;\n\n if (actualIndex < 0 || actualIndex >= uniqueComponents.length) {\n const selectorStr = selector.map(formatSelectorSegment).join(' ');\n throw new Error(\n `Index ${index} out of bounds for selector \"${selectorStr}\" (found ${uniqueComponents.length} elements)`,\n );\n }\n\n return [uniqueComponents[actualIndex]];\n }\n\n return uniqueComponents;\n}\n\nfunction formatSelectorSegment(segment: SelectorSegment): string {\n let result = segment.modifier ? segment.modifier + segment.qualifier : segment.qualifier;\n if (segment.conditions.length > 0) {\n result += segment.conditions.map(([key, value]) => `[${key}=${value}]`).join('');\n }\n if (segment.index !== undefined) {\n result += `:nth(${segment.index})`;\n }\n return result;\n}\n","import { ComponentId, ComponentRef, NodePath, NodePosition, RefSpaceId } from '@kaskad/types';\n\nimport { TComponent } from '../mobx/component';\n\nexport interface CreateNodeOptions {\n readonly refSpaceId: RefSpaceId;\n readonly position: NodePosition;\n readonly components: Record<ComponentId, TComponent>;\n readonly refs: Record<RefSpaceId, Record<ComponentRef, ComponentId>>;\n readonly sourceUrl?: string;\n}\n\nexport function withPath(opts: CreateNodeOptions, newPath: NodePath): CreateNodeOptions {\n return {\n ...opts,\n position: { componentId: opts.position.componentId, path: newPath },\n };\n}\n\nexport function withPosition(\n opts: CreateNodeOptions,\n componentId: ComponentId | null,\n path: NodePath,\n): CreateNodeOptions {\n return {\n ...opts,\n position: { componentId, path },\n };\n}\n\nexport function appendPath(opts: CreateNodeOptions, ...segments: (string | number)[]): CreateNodeOptions {\n return withPath(opts, [...opts.position.path, ...segments]);\n}\n","import { ArrayNodeSchema } from '@kaskad/types';\n\nimport { appendPath, CreateNodeOptions } from '../create-node-options';\nimport { ArrayNode } from '../node';\nimport { createNode } from '../node-creation';\n\nexport function createArrayNode(schema: ArrayNodeSchema, opts: CreateNodeOptions): ArrayNode {\n // TODO: set empty array on unfolding ?\n const value = (schema.value || []).map((item, index) => createNode(item, appendPath(opts, index)));\n\n return new ArrayNode(schema.valueType, value, opts.position);\n}\n","import { isObject } from '@kaskad/schema';\nimport { CommandNodeSchema } from '@kaskad/types';\n\nimport { CommandNodeStructure } from '../../types';\nimport { CreateNodeOptions } from '../create-node-options';\nimport { CommandNode } from '../node';\n\nexport function createCommandNode(schema: CommandNodeSchema, opts: CreateNodeOptions): CommandNode {\n if (!opts.position.componentId) {\n throw new Error(`componentId is required for command.`);\n }\n\n if (!isObject(schema.value)) {\n return new CommandNode(schema.valueType, null, opts.position);\n }\n\n const structure = { ...schema.value }; // Clone the value to avoid mutation\n\n if (!structure.owner) {\n structure.owner = opts.position.componentId;\n }\n\n return new CommandNode(schema.valueType, structure as CommandNodeStructure, opts.position);\n}\n","export const componentIdGenerator = {\n increment: 0,\n generateId() {\n return ['csid', ++this.increment].filter((item) => !!item).join('-');\n },\n reset() {\n this.increment = 0;\n },\n};\n","import { ComponentNodeSchema, ComponentValueType, ValueType } from '@kaskad/types';\n\nimport { TComponent } from '../../mobx/component';\nimport { RefSpace } from '../../mobx/ref-space';\nimport { ComponentStore } from '../../mobx/store';\nimport { NodeChangeHandler } from '../../types';\nimport { componentIdGenerator } from '../../util/id-generator';\nimport { CreateNodeOptions, withPosition } from '../create-node-options';\nimport { AbstractNode, CommandNode, LeafNode } from '../node';\nimport { createNode } from '../node-creation';\n\nexport function createComponentNode(\n schema: ComponentNodeSchema,\n opts: CreateNodeOptions,\n): LeafNode<ComponentValueType> {\n const componentSchema = schema.value;\n\n if (!componentSchema || typeof componentSchema === 'string') {\n return new LeafNode(schema.valueType, componentSchema, opts.position);\n }\n\n if (componentSchema.ref && opts.refs[opts.refSpaceId]?.[componentSchema.ref]) {\n throw new Error(`Duplicated ref \"${componentSchema.ref}\".`);\n }\n\n const id = componentIdGenerator.generateId();\n\n const isFacade = componentSchema.componentType === 'sys.Facade';\n const isRefSpace = componentSchema.componentType === 'sys.RefSpace';\n const needsContentSpace = isFacade || isRefSpace;\n const contentSpaceId = isFacade ? `${id}-template` : isRefSpace ? `${id}-instance` : opts.refSpaceId;\n\n const props = new Map<string, AbstractNode<ValueType>>();\n for (const [key, propSchema] of componentSchema.props.entries()) {\n // 'content' prop uses isolated RefSpace\n const propOpts = needsContentSpace && key === 'content' ? { ...opts, refSpaceId: contentSpaceId } : opts;\n props.set(key, createNode(propSchema, withPosition(propOpts, id, [key])));\n }\n\n const variables = new Map<string, AbstractNode<ValueType>>();\n for (const [key, variableSchema] of componentSchema.variables.entries()) {\n variables.set(key, createNode(variableSchema, withPosition(opts, id, [key])));\n }\n\n const onNodeChange = componentSchema.onNodeChange.map((handler) => ({\n ...handler,\n command: createNode(handler.command, withPosition(opts, id, [handler.selector])) as CommandNode,\n })) as NodeChangeHandler[];\n\n opts.components[id] = new TComponent({\n id,\n componentType: componentSchema.componentType,\n props,\n variables,\n onNodeChange,\n position: opts.position,\n refSpaceId: isFacade ? opts.refSpaceId : contentSpaceId,\n sourceUrl: opts.sourceUrl,\n });\n\n if (componentSchema.ref) {\n opts.refs[opts.refSpaceId] ??= {};\n opts.refs[opts.refSpaceId][componentSchema.ref] = id;\n }\n\n if (needsContentSpace) {\n const refSpace = new RefSpace(contentSpaceId, opts.refSpaceId);\n ComponentStore.getInstance().addRefSpace(refSpace);\n\n if (opts.refs[contentSpaceId]) {\n refSpace.addRefs(opts.refs[contentSpaceId]);\n }\n }\n\n return new LeafNode({ type: 'component' }, id, opts.position);\n}\n","import { LeafNodeSchema, ValueType } from '@kaskad/types';\n\nimport { CreateNodeOptions } from '../create-node-options';\nimport { AbstractNode, LeafNode } from '../node';\n\nexport function createLeafNode(schema: LeafNodeSchema, opts: CreateNodeOptions) {\n return new LeafNode(schema.valueType, schema.value, opts.position) as AbstractNode<ValueType>;\n}\n","import { MapNodeSchema, ValueType } from '@kaskad/types';\n\nimport { appendPath, CreateNodeOptions } from '../create-node-options';\nimport { AbstractNode, MapNode } from '../node';\nimport { createNode } from '../node-creation';\n\nexport function createMapNode(schema: MapNodeSchema, opts: CreateNodeOptions): MapNode {\n if (!schema.value) {\n return new MapNode(schema.valueType, null, opts.position);\n }\n\n const children: Record<string, AbstractNode<ValueType>> = {};\n for (const key in schema.value) {\n children[key] = createNode(schema.value[key], appendPath(opts, key));\n }\n\n return new MapNode(schema.valueType, children, opts.position);\n}\n","import { ObjectNodeSchema, ValueType } from '@kaskad/types';\n\nimport { appendPath, CreateNodeOptions } from '../create-node-options';\nimport { AbstractNode, ObjectNode } from '../node';\nimport { createNode } from '../node-creation';\n\nexport function createObjectNode(schema: ObjectNodeSchema, opts: CreateNodeOptions): ObjectNode {\n if (!schema.value) {\n return new ObjectNode(schema.valueType, null, opts.position);\n }\n\n if (!Object.keys(schema.valueType).length) {\n return new ObjectNode(schema.valueType, null, opts.position);\n }\n\n const fields: Record<string, AbstractNode<ValueType>> = {};\n for (const key in schema.value) {\n fields[key] = createNode(schema.value[key], appendPath(opts, key));\n }\n\n return new ObjectNode(schema.valueType, fields, opts.position);\n}\n","import { SetNodeSchema } from '@kaskad/types';\n\nimport { appendPath, CreateNodeOptions } from '../create-node-options';\nimport { SetNode } from '../node';\nimport { createNode } from '../node-creation';\n\nexport function createSetNode(schema: SetNodeSchema, opts: CreateNodeOptions): SetNode {\n if (!schema.value) {\n return new SetNode(schema.valueType, null, opts.position);\n }\n\n // Convert array to Set of nodes\n const items = schema.value.map((item, index) => createNode(item, appendPath(opts, index)));\n const value = new Set(items);\n\n return new SetNode(schema.valueType, value, opts.position);\n}\n","import { isObject } from '@kaskad/schema';\nimport { ShapeNodeSchema, ValueType } from '@kaskad/types';\n\nimport { appendPath, CreateNodeOptions } from '../create-node-options';\nimport { AbstractNode, ShapeNode } from '../node';\nimport { createNode } from '../node-creation';\n\nexport function createShapeNode(schema: ShapeNodeSchema, opts: CreateNodeOptions): ShapeNode {\n if (!isObject(schema.value)) {\n return new ShapeNode(schema.valueType, null, opts.position);\n }\n\n const fields: Record<string, AbstractNode<ValueType>> = {};\n for (const key in schema.value) {\n fields[key] = createNode(schema.value[key], appendPath(opts, key));\n }\n\n return new ShapeNode(schema.valueType, fields, opts.position);\n}\n","import { NodeSchema, ValueType, VariantShapeNodeSchema, VariantShapeValue, VariantShapeValueType } from '@kaskad/types';\n\nimport { appendPath, CreateNodeOptions } from '../create-node-options';\nimport { AbstractNode, VariantShapeNode } from '../node';\nimport { createNode } from '../node-creation';\n\ntype SplitValue = { kind: string; fields: Record<string, NodeSchema> };\n\nexport function createVariantShapeNode(schema: VariantShapeNodeSchema, opts: CreateNodeOptions) {\n if (!schema.value) {\n return new VariantShapeNode(schema.valueType, null, opts.position);\n }\n\n const value = splitValue(schema.value, schema.valueType);\n\n const fields: Record<string, AbstractNode<ValueType>> = {};\n for (const key in value.fields) {\n fields[key] = createNode(value.fields[key], appendPath(opts, key));\n }\n\n return new VariantShapeNode(schema.valueType, { kind: value.kind, fields }, opts.position);\n}\n\nfunction splitValue(value: VariantShapeValue, valueType: VariantShapeValueType): SplitValue {\n const kindKey = `${valueType.shapeType}Type`;\n const { [kindKey]: kind, ...fields } = value;\n\n if (!kind) {\n throw new Error(`Missing kind field ${kindKey}`);\n }\n\n return { kind, fields } as SplitValue;\n}\n","import {\n ArrayNodeSchema,\n CommandNodeSchema,\n ComponentNodeSchema,\n LeafNodeSchema,\n MapNodeSchema,\n NodeSchema,\n ObjectNodeSchema,\n SetNodeSchema,\n ShapeNodeSchema,\n ValueType,\n VariantShapeNodeSchema,\n} from '@kaskad/types';\n\nimport { CreateNodeOptions } from './create-node-options';\nimport { createArrayNode } from './creators/array-creator';\nimport { createCommandNode } from './creators/command-creator';\nimport { createComponentNode } from './creators/component-creator';\nimport { createLeafNode } from './creators/leaf-creator';\nimport { createMapNode } from './creators/map-creator';\nimport { createObjectNode } from './creators/object-creator';\nimport { createSetNode } from './creators/set-creator';\nimport { createShapeNode } from './creators/shape-creator';\nimport { createVariantShapeNode } from './creators/variant-shape-creator';\nimport { AbstractNode } from './node';\n\nexport function createNode<T extends AbstractNode<ValueType> = AbstractNode<ValueType>>(\n unfolded: NodeSchema,\n opts: CreateNodeOptions,\n): T {\n if (unfolded instanceof AbstractNode) {\n return unfolded as unknown as T;\n }\n const node = _create(unfolded, opts);\n\n if (unfolded.computation) {\n node.computationStack.push(unfolded.computation);\n }\n\n node.bindingSchema = unfolded.binding;\n node.extraBinding = unfolded.extraBinding;\n return node as T;\n}\n\nconst nodeCreators: Record<string, (node: NodeSchema, opts: CreateNodeOptions) => AbstractNode<ValueType>> = {\n component: (node, opts) => createComponentNode(node as ComponentNodeSchema, opts),\n array: (node, opts) => createArrayNode(node as ArrayNodeSchema, opts),\n map: (node, opts) => createMapNode(node as MapNodeSchema, opts),\n set: (node, opts) => createSetNode(node as SetNodeSchema, opts),\n object: (node, opts) => createObjectNode(node as ObjectNodeSchema, opts),\n command: (node, opts) => createCommandNode(node as CommandNodeSchema, opts),\n shape: (node, opts) => createShapeNode(node as ShapeNodeSchema, opts),\n variantShape: (node, opts) => createVariantShapeNode(node as VariantShapeNodeSchema, opts),\n // Leaf types\n string: (node, opts) => createLeafNode(node as LeafNodeSchema, opts),\n number: (node, opts) => createLeafNode(node as LeafNodeSchema, opts),\n boolean: (node, opts) => createLeafNode(node as LeafNodeSchema, opts),\n unknown: (node, opts) => createLeafNode(node as LeafNodeSchema, opts),\n componentSchema: (node, opts) => createLeafNode(node as LeafNodeSchema, opts),\n};\n\nfunction _create(node: NodeSchema, opts: CreateNodeOptions): AbstractNode<ValueType> {\n const creator = nodeCreators[node.valueType.type];\n if (creator) {\n return creator(node, opts);\n }\n // Fallback for any unknown types\n return createLeafNode(node as LeafNodeSchema, opts);\n}\n","import { ComponentId, ValueType } from '@kaskad/types';\n\nimport { ComponentStore } from '../mobx/store';\nimport { AbstractNode } from '../node/node';\n\nconst componentIdExtractors: Record<string, (value: unknown, ids: ComponentId[]) => void> = {\n array: (value, ids) => {\n if (!Array.isArray(value)) return; // the check is needed for booleanInputGroup value proxies (TODO: verify)\n for (const node of value as AbstractNode<ValueType>[]) {\n extractComponentsIds(node, ids);\n }\n },\n object: (value, ids) => {\n if (!value) return;\n for (const node of Object.values(value as Record<string, AbstractNode<ValueType>>)) {\n extractComponentsIds(node, ids);\n }\n },\n map: (value, ids) => {\n if (!value) return;\n for (const node of Object.values(value as Record<string, AbstractNode<ValueType>>)) {\n extractComponentsIds(node, ids);\n }\n },\n component: (value, ids) => {\n if (!value) return;\n const componentId = value as ComponentId;\n ids.push(componentId);\n\n const component = ComponentStore.getInstance().getComponent(componentId);\n if (component) {\n for (const [, propNode] of component.props) {\n extractComponentsIds(propNode, ids);\n }\n }\n },\n};\n\nexport function extractComponentsIds(node: AbstractNode<ValueType>, ids: ComponentId[] = []): ComponentId[] {\n const value = node.structure;\n const extractor = componentIdExtractors[node.valueType.type];\n\n if (extractor) {\n extractor(value, ids);\n }\n\n return ids;\n}\n","import { ValueType } from '@kaskad/types';\n\nimport { TComponent } from '../mobx/component';\nimport { ComponentStore } from '../mobx/store';\nimport { AbstractNode } from '../node/node';\n\nexport function getComponent(node: AbstractNode<ValueType>): TComponent {\n if (!node.position.componentId) {\n throw new Error('Node does not have a component context');\n }\n return ComponentStore.getInstance().getComponentOrThrow(node.position.componentId);\n}\n","import { log } from '@kaskad/config';\nimport { unfoldNodeSchema } from '@kaskad/schema';\nimport { ComponentId, ComponentRef, NodeSchema, RefSpaceId, ValueType } from '@kaskad/types';\nimport { configure, observable, runInAction, untracked } from 'mobx';\n\nimport { findComponent, findComponents, parseComponentSelector } from '../component-lookup';\nimport { CreateNodeOptions } from '../node/create-node-options';\nimport { AbstractNode, ArrayNode } from '../node/node';\nimport { createNode } from '../node/node-creation';\nimport { parseNodeSelector } from '../parsers';\nimport { extractComponentsIds } from '../util/extract-node-value';\nimport { formatSource } from '../util/format-source';\nimport { getComponent } from '../util/get-component';\nimport { componentIdGenerator } from '../util/id-generator';\nimport { traverseNode } from '../util/traverse-node';\nimport { TComponent } from './component';\nimport { RefSpace } from './ref-space';\n\nconfigure({\n enforceActions: 'always',\n});\n\nexport class ComponentStore {\n private static instance: ComponentStore;\n\n components: Map<ComponentId, TComponent> = new Map();\n refSpaces: Map<RefSpaceId, RefSpace> = observable.map({}, { deep: false, name: 'ref-spaces-map' });\n\n componentsToPreload: Set<string> = new Set();\n\n // Index for O(m) RefSpace cleanup during component removal\n private componentsByRefSpace: Map<RefSpaceId, Set<ComponentId>> = new Map();\n\n static getInstance(): ComponentStore {\n if (!ComponentStore.instance) {\n ComponentStore.instance = new ComponentStore();\n }\n return ComponentStore.instance;\n }\n\n // tests purposes only\n static reset() {\n const store = ComponentStore.getInstance();\n runInAction(() => {\n // Remove all root components (components without parents)\n // This will cascade and remove all child components and RefSpaces\n const rootComponents = Array.from(store.components.values()).filter((c) => !c.position.componentId);\n\n for (const component of rootComponents) {\n store.removeComponent(component.id);\n }\n\n // Clear any remaining orphaned data (shouldn't be any, but just to be safe)\n store.components.clear();\n store.refSpaces.clear();\n store.componentsToPreload.clear();\n store.componentsByRefSpace.clear();\n\n componentIdGenerator.reset();\n });\n\n return store;\n }\n\n addRefSpace(refSpace: RefSpace): void {\n runInAction(() => {\n this.refSpaces.set(refSpace.id, refSpace);\n });\n }\n\n addComponents(components: Record<ComponentId, TComponent>) {\n runInAction(() => {\n for (const id in components) {\n const component = components[id];\n this.components.set(id, component);\n\n // Maintain componentsByRefSpace index\n if (!this.componentsByRefSpace.has(component.refSpaceId)) {\n this.componentsByRefSpace.set(component.refSpaceId, new Set());\n }\n this.componentsByRefSpace.get(component.refSpaceId)?.add(id);\n }\n });\n }\n\n getRefSpace(refSpaceId: RefSpaceId): RefSpace | null {\n return this.refSpaces.get(refSpaceId) ?? null;\n }\n\n getRefSpaceOrThrow(refSpaceId: RefSpaceId): RefSpace {\n const refSpace = this.getRefSpace(refSpaceId);\n if (!refSpace) {\n throw new Error(`RefSpace with id \"${refSpaceId}\" is not found.`);\n }\n\n return refSpace;\n }\n\n getComponent(componentId: string): TComponent | null {\n return this.components.get(componentId) || null;\n }\n\n getComponentOrThrow(componentId: string): TComponent {\n const component = this.getComponent(componentId);\n if (!component) {\n throw new Error(`Component with id \"${componentId}\" is not found.`);\n }\n\n return component;\n }\n\n findVariable(componentId: ComponentId, variableName: string): AbstractNode<ValueType> | null {\n const component = this.getComponentOrThrow(componentId);\n\n const node = component.variables.get(variableName);\n if (node) {\n return node;\n }\n\n const parentComponentId = component.position.componentId;\n if (!parentComponentId) {\n return null;\n }\n\n return this.findVariable(parentComponentId, variableName);\n }\n\n /**\n * Find a single component using a selector relative to another component.\n * Throws if multiple components match the selector.\n *\n * @param relativeTo - The component ID to search relative to\n * @param selector - Component selector string (e.g., 'Button', '&myRef', '^parent', ':button', 'Button[disabled=true]')\n * @returns The matching component or null if not found\n * @throws If the selector matches multiple components\n *\n * @example\n * ```typescript\n * const button = store.findComponent(componentId, 'Button');\n * const aliased = store.findComponent(componentId, '&myRef');\n * const parent = store.findComponent(componentId, '^parent');\n * const byType = store.findComponent(componentId, ':button');\n * const filtered = store.findComponent(componentId, 'Button[disabled=true]');\n * ```\n */\n findComponent(relativeTo: ComponentId, selector: string): TComponent | null {\n const parsed = parseComponentSelector(selector);\n return findComponent(relativeTo, parsed);\n }\n\n /**\n * Find all components matching a selector relative to another component.\n *\n * @param relativeTo - The component ID to search relative to\n * @param selector - Component selector string (e.g., 'Button', '&myRef', ':button', 'Button[disabled=true]')\n * @returns Array of matching components (empty if none found)\n *\n * @example\n * ```typescript\n * const buttons = store.findComponents(componentId, 'Button');\n * const allOfType = store.findComponents(componentId, ':button');\n * const filtered = store.findComponents(componentId, 'Button[disabled=true]');\n * ```\n */\n findComponents(relativeTo: ComponentId, selector: string): TComponent[] {\n const parsed = parseComponentSelector(selector);\n return findComponents(relativeTo, parsed);\n }\n\n /**\n * Get a node by selector relative to a component.\n * Throws an error if the component or node is not found.\n * Use findNode() for optional lookups that return null instead of throwing.\n *\n * Note: Even if the selector contains optional chaining (?.), this method will throw\n * if the node is not found. Use findNode() for optional chaining support.\n *\n * Component selector behavior:\n * - `&ref->value` - Throws if component with ref doesn't exist\n * - `&ref?->value` - Throws if node not found, but allows missing component (returns null for the whole expression)\n *\n * @param relativeTo - The component ID to search relative to\n * @param selector - Node selector string (e.g., 'prop', '$variable', '^Parent->prop', '&ref?->value')\n * @returns The node\n * @throws If the component or node is not found (unless using ?-> for component)\n *\n * @example\n * ```typescript\n * const node = store.getNode(componentId, 'requiredProp'); // throws if not found\n * const optionalNode = store.findNode(componentId, 'user?.profile'); // returns null if not found\n * const optionalComponent = store.getNode(componentId, '&optional?->value'); // throws only if value missing, not if component missing\n * ```\n */\n getNode<T extends AbstractNode<ValueType>>(relativeTo: ComponentId, selector: string): T {\n const parsed = parseNodeSelector(selector);\n\n // Look up the component\n let component: TComponent | null;\n\n if (parsed.component) {\n component = findComponent(relativeTo, parsed.component.selector);\n\n // If component not found and not using optional selector, throw error\n if (!component && !parsed.component.optional) {\n const src = formatSource(this.getComponent(relativeTo)?.sourceUrl);\n throw new Error(`${src} Component not found for selector '${selector}' relative to '${relativeTo}'`);\n }\n } else {\n component = this.getComponentOrThrow(relativeTo);\n }\n\n // If component is null (only possible with component.optional), throw\n if (!component) {\n const src = formatSource(this.getComponent(relativeTo)?.sourceUrl);\n throw new Error(`${src} Component not found for selector '${selector}' relative to '${relativeTo}'`);\n }\n\n const src = formatSource(component.sourceUrl);\n\n // If it's a variable path, use RefSpace chain lookup\n if (parsed.kind === 'variable') {\n const node = this.findVariable(component.id, parsed.head);\n if (!node) {\n throw new Error(\n `${src} Variable '${parsed.head}' does not exist in component '${component.id}' or its parent RefSpaces`,\n );\n }\n\n const result = traverseNode(node, parsed.tail) as T | null;\n if (!result) {\n throw new Error(`${src} Node not found for selector '${selector}' in component '${component.id}'`);\n }\n return result;\n }\n\n // For property paths, use strict lookup that throws on missing nodes\n const node = component.getNodeFromParsed(parsed) as T | null;\n if (!node) {\n throw new Error(`${src} Node not found for selector '${selector}' in component '${component.id}'`);\n }\n\n return node;\n }\n\n /**\n * Find a node by selector relative to a component.\n * Returns null if the node is not found.\n *\n * Component selector behavior:\n * - `&ref->value` - Throws if component doesn't exist (strict by default)\n * - `&ref?->value` - Returns null if component doesn't exist (lenient when explicit)\n *\n * Use `?->` to explicitly indicate that a missing component is acceptable.\n * This makes the code self-documenting and prevents accidental null returns.\n *\n * @param relativeTo - The component ID to search relative to\n * @param selector - Node selector string (e.g., 'prop', '$variable', '^Parent->prop', '&ref?->value')\n * @returns The node or null if not found\n *\n * @example\n * ```typescript\n * // Strict - throws if component missing\n * const node = store.findNode(componentId, '&ref->value');\n *\n * // Lenient - returns null if component missing\n * const optionalNode = store.findNode(componentId, '&ref?->value');\n * if (optionalNode) {\n * // Use the node\n * }\n * ```\n */\n findNode<T extends AbstractNode<ValueType>>(relativeTo: ComponentId, selector: string): T | null {\n const parsed = parseNodeSelector(selector);\n\n // If a component selector is specified, look up the component\n let component = parsed.component\n ? findComponent(relativeTo, parsed.component.selector)\n : this.getComponent(relativeTo);\n\n // If component not found and not using optional selector, throw error\n if (!component && parsed.component && !parsed.component.optional) {\n const src = formatSource(this.getComponent(relativeTo)?.sourceUrl);\n throw new Error(`${src} Component not found for selector '${selector}' relative to '${relativeTo}'`);\n }\n\n if (!component) {\n return null;\n }\n\n // If looking up a variable in a sys.Facade component (without explicit component selector),\n // start search from the facade's parent. This ensures variables are resolved from the facade's\n // context, not from within the facade itself. This only applies when using the implicit\n // relativeTo component, not when explicitly selecting a Facade (e.g., ':sys.Facade->$var')\n if (parsed.kind === 'variable' && !parsed.component && component.componentType === 'sys.Facade') {\n const parentComponentId = component.position.componentId;\n if (parentComponentId) {\n const parentComponent = this.getComponent(parentComponentId);\n // If parent exists, use it for variable lookup; otherwise fall back to the Facade itself\n if (parentComponent) {\n component = parentComponent;\n }\n }\n }\n\n const src = formatSource(component.sourceUrl);\n\n // If it's a variable path, use RefSpace chain lookup\n if (parsed.kind === 'variable') {\n const node = this.findVariable(component.id, parsed.head);\n if (!node) {\n // Variable itself doesn't exist - this is likely a typo, so throw\n throw new Error(`${src} Variable \"${parsed.head}\" not found in component \"${component.id}\"`);\n }\n\n // Variable exists, traverse the path (may return null if path is missing)\n return traverseNode(node, parsed.tail) as T;\n }\n\n // For property paths, throw if property doesn't exist but allow null paths\n const node = component.props.get(parsed.head);\n if (!node) {\n throw new Error(\n `${src} Property \"${parsed.head}\" not found in component \"${component.id}\" (type: ${component.componentType}). ` +\n `Available properties: [${Array.from(component.props.keys()).join(', ')}]`,\n );\n }\n\n // Property exists, traverse the path (may return null if path is missing)\n return traverseNode(node, parsed.tail) as T;\n }\n\n /**\n * Collect node values from multiple components into an array.\n * Maps over all components matching the selector and extracts a node value from each.\n *\n * @param relativeTo - The component ID to search relative to\n * @param componentSelector - Selector for finding components (e.g., ':forms.Input', 'Button')\n * @param nodeSelector - The node path to extract from each component (e.g., 'value', 'inputKey')\n * @returns Array of node values from matched components\n *\n * @example\n * ```typescript\n * // Get all input values\n * const values = store.collectValuesArray(componentId, ':forms.Input', 'value');\n * // Returns: ['value1', 'value2', 'value3']\n * ```\n */\n collectValuesArray<T = unknown[]>(relativeTo: ComponentId, componentSelector: string, nodeSelector: string): T {\n const components = this.findComponents(relativeTo, componentSelector);\n return components.map((component) => component.getNodeValue(nodeSelector)) as T;\n }\n\n /**\n * Collect node values from multiple components into a map/object.\n * Reduces over all components matching the selector, using one node as the key and another as the value.\n *\n * @param relativeTo - The component ID to search relative to\n * @param componentSelector - Selector for finding components (e.g., ':forms.Input', 'Button')\n * @param keyNodeSelector - The node path to use as the object key (e.g., 'inputKey', 'id')\n * @param valueNodeSelector - The node path to use as the object value (e.g., 'value', 'label')\n * @returns Object/map with keys and values from matched components\n *\n * @example\n * ```typescript\n * // Create a map from inputKey to value\n * const map = store.collectValuesMap(componentId, ':forms.Input', 'inputKey', 'value');\n * // Returns: { key1: 'value1', key2: 'value2' }\n * ```\n */\n collectValuesMap<T = Record<string, unknown>>(\n relativeTo: ComponentId,\n componentSelector: string,\n keyNodeSelector: string,\n valueNodeSelector: string,\n ): T {\n const components = this.findComponents(relativeTo, componentSelector);\n return components.reduce<Record<string, unknown>>((acc, component) => {\n const key = component.getNodeValue(keyNodeSelector);\n const value = component.getNodeValue(valueNodeSelector);\n\n // skip if the key is not defined\n if (key) {\n acc[key as string] = value;\n }\n return acc;\n }, {}) as T;\n }\n\n /**\n * Set a node from a raw schema value.\n * The raw schema will be unfolded before being applied.\n * Handles structure, computation stack, and nested components.\n *\n * @param node - The node to update\n * @param rawSchema - The raw schema value (will be unfolded into a NodeSchema)\n */\n setNodeRawSchema(node: AbstractNode<ValueType>, rawSchema: unknown): void {\n try {\n const unfolded = unfoldNodeSchema(rawSchema, node.valueType);\n this.setNodeSchema(node, unfolded);\n } catch (e) {\n const component = getComponent(node);\n const src = formatSource(component.sourceUrl, node.position.path);\n throw new Error(`${src} ${(e as Error).message}`, { cause: e });\n }\n }\n\n /**\n * Set a node from an already-unfolded schema.\n * Use this when you already have a NodeSchema to avoid double-unfolding.\n * Handles structure, nested components, and computation stack.\n *\n * @param node - The node to update\n * @param schema - The unfolded NodeSchema to set\n */\n setNodeSchema(node: AbstractNode<ValueType>, schema: NodeSchema): void {\n const component = getComponent(node);\n const refSpace = this.getRefSpaceOrThrow(component.refSpaceId);\n\n const opts: CreateNodeOptions = {\n refSpaceId: refSpace.id,\n position: { componentId: component.id, path: node.position.path },\n components: {},\n refs: {},\n sourceUrl: component.sourceUrl ?? undefined,\n };\n\n const tmpNode = createNode(schema, opts);\n\n runInAction(() => {\n // Handle component removal for component-type nodes\n // Only remove components that are in the old structure but NOT in the new structure\n // This is important for component[] types where existing component IDs may be reused\n const oldComponents = extractComponentsIds(node);\n const newComponents = new Set(extractComponentsIds(tmpNode));\n\n for (const id of oldComponents) {\n if (!newComponents.has(id)) {\n this.removeComponent(id);\n }\n }\n\n // Set new structure and register new components/refs\n node.structure = tmpNode.structure;\n\n // Add refs for all RefSpaces (parent RefSpace and any nested RefSpaces created)\n for (const refSpaceId in opts.refs) {\n const targetRefSpace = this.getRefSpace(refSpaceId);\n if (targetRefSpace) {\n const refs = (opts.refs[refSpaceId] as unknown as Record<ComponentRef, ComponentId> | undefined) ?? {};\n targetRefSpace.addRefs(refs);\n }\n }\n\n this.addComponents(opts.components);\n });\n\n // Push computation frame onto stack (after runAction, before activation)\n if (schema.computation) {\n const resultFrame = tmpNode.computationStack.top;\n if (resultFrame) {\n node.computationStack.push(resultFrame.schema);\n }\n }\n }\n\n /**\n * Remove an item from an array node.\n * Handles cleanup of nested components in the removed item.\n *\n * @param arrayNode - The array node to remove from\n * @param index - The index of the item to remove\n */\n removeArrayItem(arrayNode: ArrayNode, index: number): void {\n runInAction(() => {\n const value = arrayNode.structure || [];\n const removedItem = value[index];\n\n // Clean up components in the removed item\n if (removedItem) {\n const oldComponents = extractComponentsIds(removedItem);\n for (const id of oldComponents) {\n this.removeComponent(id);\n }\n }\n\n arrayNode.structure = [...value.slice(0, index), ...value.slice(index + 1)];\n });\n }\n\n /**\n * Insert an item into an array node at a specific index.\n * Creates a node structure from the raw value and inserts it at the specified position.\n * Shifts existing items to the right.\n *\n * @param arrayNode - The array node to insert into\n * @param index - The index at which to insert the item\n * @param value - The raw value to insert (will be transformed into a node structure)\n */\n insertArrayItem(arrayNode: ArrayNode, index: number, value: unknown): void {\n const { itemNode, opts, refSpace } = this.createArrayItemNode(arrayNode, index, value);\n\n runInAction(() => {\n const currentValue = arrayNode.structure || [];\n arrayNode.structure = [...currentValue.slice(0, index), itemNode, ...currentValue.slice(index)];\n const refs = (opts.refs[refSpace.id] as unknown as Record<ComponentRef, ComponentId> | undefined) ?? {};\n refSpace.addRefs(refs);\n this.addComponents(opts.components);\n });\n }\n\n /**\n * Replace an item in an array node at a specific index.\n * Creates a node structure from the raw value and replaces the item at the specified position.\n * Properly cleans up nested components in the replaced item.\n *\n * @param arrayNode - The array node containing the item to replace\n * @param index - The index of the item to replace\n * @param value - The raw value to set (will be transformed into a node structure)\n */\n replaceArrayItem(arrayNode: ArrayNode, index: number, value: unknown): void {\n const { itemNode, opts, refSpace } = this.createArrayItemNode(arrayNode, index, value);\n\n runInAction(() => {\n const currentValue = arrayNode.structure || [];\n const replacedItem = currentValue[index];\n\n // Clean up components in the replaced item\n if (replacedItem) {\n const oldComponents = extractComponentsIds(replacedItem);\n for (const id of oldComponents) {\n this.removeComponent(id);\n }\n }\n\n arrayNode.structure = [...currentValue.slice(0, index), itemNode, ...currentValue.slice(index + 1)];\n const refs = (opts.refs[refSpace.id] as unknown as Record<ComponentRef, ComponentId> | undefined) ?? {};\n refSpace.addRefs(refs);\n this.addComponents(opts.components);\n });\n }\n\n /**\n * Append an item to the end of an array node.\n * Creates a node structure from the raw value and appends it to the array.\n *\n * @param arrayNode - The array node to append to\n * @param value - The raw value to append (will be transformed into a node structure)\n */\n appendArrayItem(arrayNode: ArrayNode, value: unknown): void {\n // Calculate the index for the new item\n const currentLength = arrayNode.structure?.length ?? 0;\n const { itemNode, opts, refSpace } = this.createArrayItemNode(arrayNode, currentLength, value);\n\n runInAction(() => {\n arrayNode.structure = [...(arrayNode.structure ?? []), itemNode];\n const refs = (opts.refs[refSpace.id] as unknown as Record<ComponentRef, ComponentId> | undefined) ?? {};\n refSpace.addRefs(refs);\n this.addComponents(opts.components);\n });\n }\n\n /**\n * Reconcile for-loop children using key-based diffing.\n * Instead of destroying all children and recreating them,\n * this method compares old vs new keys and only creates/destroys what's necessary.\n *\n * @param arrayNode - The array node containing for-loop children\n * @param newSchemas - The new schemas to reconcile\n * @returns Indices of newly added items for activation\n */\n reconcileForLoopChildren(arrayNode: ArrayNode, newSchemas: unknown[]): number[] {\n const oldChildren = arrayNode.structure || [];\n\n // Handle null/undefined newSchemas\n if (!newSchemas) {\n this.setNodeRawSchema(arrayNode, []);\n return [];\n }\n\n // If there are no old children, just set the new schemas\n if (oldChildren.length === 0) {\n this.setNodeRawSchema(arrayNode, newSchemas);\n return newSchemas.map((_, index) => index);\n }\n\n // If there are no new schemas, just set empty array (will remove all)\n if (newSchemas.length === 0) {\n this.setNodeRawSchema(arrayNode, []);\n return [];\n }\n\n // Check if explicit keys are provided (trackBy syntax)\n const hasExplicitKeys = this.checkForExplicitKeys(newSchemas);\n if (!hasExplicitKeys) {\n // No explicit keys - fall back to full replacement\n this.setNodeRawSchema(arrayNode, newSchemas);\n return newSchemas.map((_, index) => index);\n }\n\n // Extract keys from old children and new schemas\n const oldKeyMap = this.extractOldKeys(oldChildren);\n const newKeys = this.extractNewKeys(newSchemas);\n\n // Check for duplicate keys in new schemas\n const duplicateKeys = this.findDuplicateKeys(newKeys);\n if (duplicateKeys.size > 0) {\n log.warn(\n `Duplicate keys detected in for-loop: ${Array.from(duplicateKeys).join(', ')}. ` +\n 'This may cause unexpected behavior. Falling back to full replacement.',\n );\n this.setNodeRawSchema(arrayNode, newSchemas);\n return newSchemas.map((_, index) => index);\n }\n\n // Build sets for diffing\n const oldKeySet = new Set(oldKeyMap.keys());\n const newKeySet = new Set(newKeys);\n\n // Determine what to add, remove, and keep\n const toRemove: string[] = [];\n const toKeepSet = new Set<string>();\n\n for (const key of oldKeySet) {\n if (newKeySet.has(key)) {\n toKeepSet.add(key);\n } else {\n toRemove.push(key);\n }\n }\n\n const toAdd: number[] = [];\n newKeys.forEach((key, index) => {\n if (!oldKeySet.has(key)) {\n toAdd.push(index);\n }\n });\n\n // Perform the actual reconciliation\n this.applyForLoopReconciliation(arrayNode, {\n oldKeyMap,\n newKeys,\n newSchemas,\n toRemove,\n toKeep: Array.from(toKeepSet),\n });\n\n // Update loop variables (index, first, last, and item variables) for repositioned components\n this.updateLoopVariables(arrayNode, newKeys, newSchemas, oldKeyMap);\n\n return toAdd;\n }\n\n /**\n * Apply for-loop reconciliation by building new structure and cleaning up removed components.\n */\n private applyForLoopReconciliation(\n arrayNode: ArrayNode,\n reconcileInfo: {\n oldKeyMap: Map<string, { index: number; componentId: ComponentId }>;\n newKeys: string[];\n newSchemas: unknown[];\n toRemove: string[];\n toKeep: string[];\n },\n ): void {\n const { oldKeyMap, newKeys, newSchemas, toRemove, toKeep } = reconcileInfo;\n const toKeepSet = new Set(toKeep);\n\n const component = getComponent(arrayNode);\n const refSpace = this.getRefSpaceOrThrow(component.refSpaceId);\n\n // Build the new structure array, reusing kept nodes and creating new ones\n const newStructure: AbstractNode<ValueType>[] = [];\n const newComponents: Record<ComponentId, TComponent> = {};\n const newRefs: Record<ComponentRef, ComponentId> = {};\n\n // Build new structure in order of new keys\n // Use untracked to avoid MobX reactivity issues when reading structure\n const oldStructure = untracked(() => arrayNode.structure);\n for (let i = 0; i < newKeys.length; i++) {\n const key = newKeys[i];\n const oldEntry = oldKeyMap.get(key);\n\n if (oldEntry && toKeepSet.has(key) && oldStructure && oldStructure[oldEntry.index]) {\n // Reuse existing node\n newStructure.push(oldStructure[oldEntry.index]);\n } else {\n // Create new node\n const schema = newSchemas[i];\n const itemPath = [...arrayNode.position.path, i];\n\n const opts: CreateNodeOptions = {\n refSpaceId: refSpace.id,\n position: { componentId: component.id, path: itemPath },\n components: {},\n refs: {},\n sourceUrl: component.sourceUrl ?? undefined,\n };\n\n const itemNode = createNode(unfoldNodeSchema(schema, arrayNode.valueType.item), opts);\n newStructure.push(itemNode);\n\n // Collect new components and refs\n Object.assign(newComponents, opts.components);\n const itemRefs = (opts.refs[refSpace.id] as unknown as Record<ComponentRef, ComponentId> | undefined) ?? {};\n Object.assign(newRefs, itemRefs);\n }\n }\n\n runInAction(() => {\n // Remove components that are no longer needed\n for (const key of toRemove) {\n const entry = oldKeyMap.get(key);\n if (entry) {\n this.removeComponent(entry.componentId);\n }\n }\n\n // Update the structure\n arrayNode.structure = newStructure;\n\n // Register new refs and components\n refSpace.addRefs(newRefs);\n this.addComponents(newComponents);\n });\n }\n\n /**\n * Update loop variables (including item variable) on components that have been repositioned or whose data changed.\n */\n private updateLoopVariables(\n node: ArrayNode,\n newKeys: string[],\n newSchemas: unknown[],\n oldKeyMap: Map<string, { index: number; componentId: ComponentId }>,\n ): void {\n const structure = node.structure || [];\n const totalItems = newKeys.length;\n\n runInAction(() => {\n newKeys.forEach((key, newIndex) => {\n const oldEntry = oldKeyMap.get(key);\n if (!oldEntry) return; // Skip newly added items\n\n const child = structure[newIndex];\n if (!child) return;\n\n const componentId = child.structure as ComponentId | null;\n if (!componentId) return;\n\n const component = this.getComponent(componentId);\n if (!component) return;\n\n // Update $index variable if it exists and the index changed\n // Variables are stored without the $ prefix (e.g., 'index' not '$index')\n const indexNode = component.variables.get('index');\n if (indexNode && oldEntry.index !== newIndex) {\n indexNode.structure = newIndex;\n }\n\n // Update $first variable if it exists\n const firstNode = component.variables.get('first');\n if (firstNode) {\n const wasFirst = oldEntry.index === 0;\n const isFirst = newIndex === 0;\n if (wasFirst !== isFirst) {\n firstNode.structure = isFirst;\n }\n }\n\n // Update $last variable if it exists\n const lastNode = component.variables.get('last');\n if (lastNode) {\n lastNode.structure = newIndex === totalItems - 1;\n }\n\n // Update item variables from new schema\n const newSchema = newSchemas[newIndex] as Record<string, unknown>;\n for (const [schemaKey, schemaValue] of Object.entries(newSchema)) {\n if (!schemaKey.startsWith('$')) continue;\n\n const varName = schemaKey.slice(1); // Remove '$' prefix\n\n // Skip loop control variables (already handled above)\n if (varName === 'index' || varName === 'first' || varName === 'last' || varName === 'trackBy') {\n continue;\n }\n\n const varNode = component.variables.get(varName);\n if (!varNode) continue;\n\n const varDef = schemaValue as { _value?: unknown } | undefined;\n if (!varDef || !('_value' in varDef)) continue;\n\n // Update item variable using setNodeRawSchema for proper object handling\n this.setNodeRawSchema(varNode, varDef._value);\n }\n });\n });\n }\n\n /**\n * Check if schemas have explicit trackBy keys that can be used for diffing.\n */\n private checkForExplicitKeys(schemas: unknown[]): boolean {\n if (schemas.length === 0) return false;\n\n const firstSchema = schemas[0] as Record<string, unknown> | undefined;\n if (!firstSchema) return false;\n\n const forKeySchema = firstSchema['$trackBy'] as { _value: unknown } | undefined;\n\n if (forKeySchema && '_value' in forKeySchema) {\n const value = forKeySchema._value;\n if (typeof value === 'number') {\n return false;\n }\n if (typeof value === 'string') {\n const indexPattern = /^\\d+(?::\\d+)*$/;\n return !indexPattern.test(value);\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * Extract keys from existing children (RefSpace components with $trackBy variable)\n */\n private extractOldKeys(\n children: AbstractNode<ValueType>[],\n ): Map<string, { index: number; componentId: ComponentId }> {\n const keyMap = new Map<string, { index: number; componentId: ComponentId }>();\n\n children.forEach((child, index) => {\n const componentId = child.structure as ComponentId | null;\n if (!componentId) return;\n\n const component = this.getComponent(componentId);\n if (!component || component.componentType !== 'sys.RefSpace') return;\n\n const keyNode = component.variables.get('trackBy');\n const key = keyNode ? keyNode.extractedValue : component.id;\n keyMap.set(String(key), { index, componentId });\n });\n\n return keyMap;\n }\n\n /**\n * Extract keys from new schemas (generated by repeat())\n */\n private extractNewKeys(schemas: unknown[]): string[] {\n return schemas.map((schema, index) => {\n const forKeyValue = (schema as Record<string, unknown>)['$trackBy'] as { _value: unknown } | undefined;\n\n if (forKeyValue && '_value' in forKeyValue) {\n return String(forKeyValue._value);\n }\n\n return String(index);\n });\n }\n\n /**\n * Find duplicate keys in an array\n */\n private findDuplicateKeys(keys: string[]): Set<string> {\n const seen = new Set<string>();\n const duplicates = new Set<string>();\n\n for (const key of keys) {\n if (seen.has(key)) {\n duplicates.add(key);\n }\n seen.add(key);\n }\n\n return duplicates;\n }\n\n removeComponent(componentId: ComponentId): void {\n const component = this.components.get(componentId);\n if (!component) return;\n\n runInAction(() => {\n // Collect all nested child component IDs (depth-first traversal)\n const allChildIds: ComponentId[] = [];\n for (const [, propNode] of component.props) {\n extractComponentsIds(propNode, allChildIds);\n }\n for (const [, varNode] of component.variables) {\n extractComponentsIds(varNode, allChildIds);\n }\n\n // Deduplicate while preserving order (later items are deeper in tree)\n const childIds = [...new Set(allChildIds)];\n const allIds = new Set([componentId, ...childIds]);\n\n const spacesToRemove = this.collectRefSpacesToRemove(allIds);\n\n // Dispose components in leaf-first order (reverse of depth-first)\n for (let i = childIds.length - 1; i >= 0; i--) {\n this.components.get(childIds[i])?.dispose();\n }\n component.dispose();\n\n // Finally, delete all components and RefSpaces from registries\n for (const id of allIds) {\n // Remove from componentsByRefSpace index\n const comp = this.components.get(id);\n if (comp) {\n this.componentsByRefSpace.get(comp.refSpaceId)?.delete(id);\n }\n this.components.delete(id);\n }\n for (const refSpaceId of spacesToRemove) {\n this.refSpaces.delete(refSpaceId);\n // Clean up empty index entries\n this.componentsByRefSpace.delete(refSpaceId);\n }\n });\n }\n\n /**\n * Creates a new node for an array item from a raw value.\n * Returns the created node and the options used (for registering components/refs).\n * @throws If the array node has no parent component\n */\n private createArrayItemNode(\n arrayNode: ArrayNode,\n index: number,\n value: unknown,\n ): { itemNode: AbstractNode<ValueType>; opts: CreateNodeOptions; refSpace: RefSpace } {\n const component = getComponent(arrayNode);\n const refSpace = this.getRefSpaceOrThrow(component.refSpaceId);\n\n const itemPath = [...arrayNode.position.path, index];\n\n const opts: CreateNodeOptions = {\n refSpaceId: refSpace.id,\n position: { componentId: component.position.componentId, path: itemPath },\n components: {},\n refs: {},\n sourceUrl: component.sourceUrl ?? undefined,\n };\n\n const itemNode = createNode(unfoldNodeSchema(value, arrayNode.valueType.item), opts);\n\n return { itemNode, opts, refSpace };\n }\n\n private collectRefSpacesToRemove(componentIdsToDelete: Set<ComponentId>): Set<RefSpaceId> {\n // Collect unique RefSpace IDs that components belong to (candidates for removal)\n const candidateSpaceIds = new Set<RefSpaceId>();\n for (const componentId of componentIdsToDelete) {\n const refSpaceId = this.components.get(componentId)?.refSpaceId;\n if (refSpaceId) {\n candidateSpaceIds.add(refSpaceId);\n }\n }\n\n // Filter to only RefSpaces that have no remaining components after deletion\n const refSpaceIdsToDelete = new Set<RefSpaceId>();\n for (const refSpaceId of candidateSpaceIds) {\n const componentsInSpace = this.componentsByRefSpace.get(refSpaceId);\n if (!componentsInSpace) continue;\n\n // Check if ALL components in this RefSpace are being deleted\n let allDeleted = true;\n for (const id of componentsInSpace) {\n if (!componentIdsToDelete.has(id)) {\n allDeleted = false;\n break;\n }\n }\n\n if (allDeleted) {\n refSpaceIdsToDelete.add(refSpaceId);\n }\n }\n\n return refSpaceIdsToDelete;\n }\n}\n","import { ComponentId, ComponentRef, NodeSchema, RefSpaceId, ValueType } from '@kaskad/types';\n\nimport { CreateNodeOptions } from '../node/create-node-options';\nimport { AbstractNode } from '../node/node';\nimport { createNode } from '../node/node-creation';\nimport { RefSpace } from './ref-space';\nimport { ComponentStore } from './store';\n\nexport function createRootNode(\n refSpaceId: RefSpaceId,\n schema: NodeSchema,\n ownerComponentId: ComponentId | null,\n parentRefSpaceId: RefSpaceId | null,\n sourceUrl?: string,\n): AbstractNode<ValueType> {\n const opts: CreateNodeOptions = {\n refSpaceId: refSpaceId,\n position: { componentId: ownerComponentId, path: [] },\n components: {},\n refs: {},\n sourceUrl,\n };\n const root = createNode(schema, opts);\n const refSpace = new RefSpace(refSpaceId, parentRefSpaceId);\n const store = ComponentStore.getInstance();\n\n store.addRefSpace(refSpace);\n store.addComponents(opts.components);\n\n const refs = (opts.refs[refSpaceId] as unknown as Record<ComponentRef, ComponentId> | undefined) ?? {};\n refSpace.addRefs(refs);\n\n return root;\n}\n","import { log } from '@kaskad/config';\nimport { ComponentId, ValueType } from '@kaskad/types';\n\nimport { findComponentsIds, parseComponentSelector } from './component-lookup';\nimport { TComponent } from './mobx/component';\nimport { ComponentStore } from './mobx/store';\nimport { AbstractNode, ArrayNode } from './node/node';\nimport { isCommandNode } from './types';\n\nexport class ComponentTreeApi {\n private static store: ComponentStore = ComponentStore.getInstance();\n\n static findComponent(relativeTo: ComponentId, componentSelector: string): TComponent | null {\n return this.store.findComponent(relativeTo, componentSelector);\n }\n\n static findComponentsIds(relativeTo: ComponentId, componentSelector: string): ComponentId[] {\n return findComponentsIds(relativeTo, parseComponentSelector(componentSelector));\n }\n\n static findComponents(relativeTo: ComponentId, componentSelector: string): TComponent[] {\n const ids = this.findComponentsIds(relativeTo, componentSelector);\n return ids.map((id) => this.store.getComponentOrThrow(id));\n }\n\n static getComponent(relativeTo: ComponentId, componentSelector: string): TComponent {\n const component = this.store.findComponent(relativeTo, componentSelector);\n if (!component) {\n throw new Error(`Component ${componentSelector} not found`);\n }\n\n return component;\n }\n\n static findNode(relativeTo: ComponentId, componentSelector: string): AbstractNode<ValueType> | null {\n return this.store.findNode(relativeTo, componentSelector);\n }\n\n static getNode(relativeTo: ComponentId, componentSelector: string): AbstractNode<ValueType> {\n return this.store.getNode(relativeTo, componentSelector);\n }\n\n static collectValuesArray<T>(componentId: ComponentId, componentSelector: string, nodeSelector: string): T {\n try {\n return this.store.collectValuesArray<T>(componentId, componentSelector, nodeSelector);\n } catch (e) {\n log.error(`Error collecting values as array by component selector ${componentSelector}`, e);\n return [] as T;\n }\n }\n\n static collectValuesMap<T>(\n componentId: ComponentId,\n componentSelector: string,\n keyNodeSelector: string,\n valueNodeSelector: string,\n ): T {\n try {\n return this.store.collectValuesMap<T>(componentId, componentSelector, keyNodeSelector, valueNodeSelector);\n } catch (e) {\n log.error(`Error collecting values as map by component selector ${componentSelector}`, e);\n return {} as T;\n }\n }\n\n static isCommandRunning(componentId: ComponentId, selector: string): boolean {\n try {\n const node = this.getNode(componentId, selector);\n if (!isCommandNode(node)) {\n throw new Error(`Error`);\n }\n\n return node.viewModel.executing;\n } catch (e) {\n log.error(`Error checking command running state by selector ${selector}`, e);\n return false;\n }\n }\n\n static runCommandNode(componentId: ComponentId, selector: string, ...args: unknown[]): unknown {\n try {\n const node = this.getNode(componentId, selector);\n if (!isCommandNode(node)) {\n throw new Error(`Node at \"${selector}\" is not a command`);\n }\n\n log.trace(`Running command \"${selector}\" on ${componentId}`);\n return node.viewModel.execute(...args);\n } catch (e) {\n log.error(`Error running command by selector \"${selector}\" with args:`, JSON.stringify(args), e);\n return null;\n }\n }\n\n static setNodeRawSchema(componentId: ComponentId, selector: string, value: unknown): void {\n try {\n const node = this.getNode(componentId, selector);\n this.store.setNodeRawSchema(node, value);\n } catch (e) {\n log.error(`Error setting node by selector \"${selector}\" with value:`, value, e);\n }\n }\n\n static appendArrayItem(componentId: ComponentId, selector: string, item: unknown): void {\n try {\n const arrayNode = this.store.getNode<ArrayNode>(componentId, selector);\n this.store.appendArrayItem(arrayNode, item);\n } catch (e) {\n log.error(`Error appending array item to selector \"${selector}\" with value:`, item, e);\n }\n }\n\n static insertArrayItem(componentId: ComponentId, selector: string, index: number, item: unknown) {\n try {\n const arrayNode = this.store.getNode<ArrayNode>(componentId, selector);\n this.store.insertArrayItem(arrayNode, index, item);\n } catch (e) {\n log.error(`Error inserting array item to selector \"${selector}\" with value:`, item, e);\n }\n }\n\n static removeArrayItem(componentId: ComponentId, selector: string, index: number) {\n try {\n const arrayNode = this.store.getNode<ArrayNode>(componentId, selector);\n this.store.removeArrayItem(arrayNode, index);\n } catch (e) {\n log.error(`Error removing array item from selector \"${selector}\" at index ${index}`, e);\n }\n }\n\n static replaceArrayItem(componentId: ComponentId, selector: string, index: number, item: unknown) {\n try {\n const arrayNode = this.store.getNode<ArrayNode>(componentId, selector);\n this.store.replaceArrayItem(arrayNode, index, item);\n } catch (e) {\n log.error(`Error replacing array item at selector \"${selector}\" at index ${index} with value:`, item, e);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":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wCAAA,EAA2C,QAAQ,CAAA,WAAA,EAAc,KAAK,CAAA,YAAA,CAAc,EAAE,IAAI,EAAE,CAAC,CAAC;;;;;ACvI9G;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaskad/component-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@kaskad/types": "0.0.
|
|
6
|
-
"@kaskad/schema": "0.0.
|
|
7
|
-
"@kaskad/definition": "0.0.
|
|
8
|
-
"@kaskad/config": "0.0.
|
|
5
|
+
"@kaskad/types": "0.0.2",
|
|
6
|
+
"@kaskad/schema": "0.0.2",
|
|
7
|
+
"@kaskad/definition": "0.0.2",
|
|
8
|
+
"@kaskad/config": "0.0.2",
|
|
9
9
|
"mobx": "^6.13.7"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|
|
12
|
-
"module": "
|
|
13
|
-
"typings": "kaskad-component-tree.d.ts",
|
|
12
|
+
"module": "fesm2022/kaskad-component-tree.mjs",
|
|
13
|
+
"typings": "types/kaskad-component-tree.d.ts",
|
|
14
14
|
"exports": {
|
|
15
15
|
"./package.json": {
|
|
16
16
|
"default": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
".": {
|
|
19
|
-
"types": "./kaskad-component-tree.d.ts",
|
|
20
|
-
"default": "./
|
|
19
|
+
"types": "./types/kaskad-component-tree.d.ts",
|
|
20
|
+
"default": "./fesm2022/kaskad-component-tree.mjs"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"tslib": "^2.3.0"
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
}
|