From a5e936dd27f975554c724fa6ff34f8911014f47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 11 Sep 2026 19:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=B7=B2=E9=80=80=E5=BD=B9?= =?UTF-8?q?=E7=9A=84=E5=89=8D=E7=AB=AF=E7=BB=91=E5=AE=9A=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除无现役导入的 binding.ts 及其 BindingDTO、BindingChange 类型。 --- .../src/features/ui-editor/binding.ts | 23 ------------------- .../features/ui-editor/types/BindingChange.ts | 6 ----- .../features/ui-editor/types/BindingDTO.ts | 4 ---- 3 files changed, 33 deletions(-) delete mode 100644 apps/ai-game-creator-shell/src/features/ui-editor/binding.ts delete mode 100644 apps/ai-game-creator-shell/src/features/ui-editor/types/BindingChange.ts delete mode 100644 apps/ai-game-creator-shell/src/features/ui-editor/types/BindingDTO.ts 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, };