diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/binding.ts b/apps/ai-game-creator-shell/src/features/ui-editor/binding.ts deleted file mode 100644 index 3f3422b18..000000000 --- a/apps/ai-game-creator-shell/src/features/ui-editor/binding.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { BindingDTO } from './types/BindingDTO'; -import type { Node } from './types/Node'; -import type { State } from './types/State'; - -function applyChanges(node: Node, result: BindingDTO): void { - const change = result.changes.find( - (candidate) => candidate.node_id === node.id, - ); - if (change) { - node.component = structuredClone( - change.component === 'PureNode' ? null : change.component.WithComponent, - ); - node.metadata.component_status = structuredClone(change.component_status); - } - for (const child of node.children) applyChanges(child, result); -} - -/** Applies only explicit component changes; omitted nodes remain untouched. */ -export function applyBindingResult(state: State, result: BindingDTO): State { - const next = structuredClone(state); - for (const tree of next.ui_trees) applyChanges(tree.root, result); - return next; -} diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/BindingChange.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/BindingChange.ts deleted file mode 100644 index 3bb2c5c4d..000000000 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/BindingChange.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { NodeComponent } from "./NodeComponent"; -import type { NodeId } from "./NodeId"; -import type { StageStatus } from "./StageStatus"; - -export type BindingChange = { node_id: NodeId, component: NodeComponent, component_status: StageStatus, }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/BindingDTO.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/BindingDTO.ts deleted file mode 100644 index beb340894..000000000 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/BindingDTO.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BindingChange } from "./BindingChange"; - -export type BindingDTO = { changes: Array, };