diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3dbd5cd07..793e2b4a4 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -163,6 +163,7 @@ module.exports = { 'server-rs/target', 'server-rs/target-*', 'apps/desktop-shell/src-tauri/target', + 'apps/ai-game-creator-shell/src/features/ui-editor/types/**', 'target', 'src/main.tsx', 'src/App.tsx', diff --git a/.prettierignore b/.prettierignore index 4592c0b69..0f7f7cfd3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,6 +3,7 @@ node_modules .git .codex-logs public/Icons +apps/ai-game-creator-shell/src/features/ui-editor/types/ media *.log .preview.* diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/ChildrenDisplayMode.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/ChildrenDisplayMode.ts index a9aaf69ca..fcedb923b 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/ChildrenDisplayMode.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/ChildrenDisplayMode.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ChildrenDisplayMode = 'Stack' | 'Exclusive'; +export type ChildrenDisplayMode = "Stack" | "Exclusive"; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/Container.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/Container.ts index 59a9b0b3d..d435f9d0b 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/Container.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/Container.ts @@ -1,20 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ContainerAlignment } from './ContainerAlignment'; +import type { ContainerAlignment } from "./ContainerAlignment"; /** * 互斥 Container 定义。没有 Container 即普通 Control。 */ -export type Container = - | 'None' - | { HBox: { alignment: ContainerAlignment; separation: number } } - | { VBox: { alignment: ContainerAlignment; separation: number } } - | { Grid: { columns: number; h_separation: number; v_separation: number } } - | { - Margin: { - margin_left: number; - margin_top: number; - margin_right: number; - margin_bottom: number; - }; - } - | { Center: { use_top_left: boolean } }; +export type Container = "None" | { "HBox": { alignment: ContainerAlignment, separation: number, } } | { "VBox": { alignment: ContainerAlignment, separation: number, } } | { "Grid": { columns: number, h_separation: number, v_separation: number, } } | { "Margin": { margin_left: number, margin_top: number, margin_right: number, margin_bottom: number, } } | { "Center": { use_top_left: boolean, } }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/ContainerAlignment.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/ContainerAlignment.ts index bfb465b5e..054f0b15e 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/ContainerAlignment.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/ContainerAlignment.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ContainerAlignment = 'Begin' | 'Center' | 'End'; +export type ContainerAlignment = "Begin" | "Center" | "End"; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/ControlLayout.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/ControlLayout.ts index aa68c4aa5..1dfc28ff5 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/ControlLayout.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/ControlLayout.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Container } from './Container'; -import type { Transform } from './Transform'; +import type { Container } from "./Container"; +import type { Transform } from "./Transform"; /** * Godot Control 的 Container 相关布局属性。 @@ -8,11 +8,4 @@ import type { Transform } from './Transform'; * `Transform` 始终被保留。只有直接父节点为 Container 时,父节点才会 * 忽略 child 的 anchors / offsets,改读 minimum size 与 size flags。 */ -export type ControlLayout = { - transform: Transform; - custom_minimum_size: [number, number]; - size_flags_horizontal: number; - size_flags_vertical: number; - size_flags_stretch_ratio: number; - container: Container; -}; +export type ControlLayout = { transform: Transform, custom_minimum_size: [number, number], size_flags_horizontal: number, size_flags_vertical: number, size_flags_stretch_ratio: number, container: Container, }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/FillMethod.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/FillMethod.ts index 2dd0b1767..1651dbbee 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/FillMethod.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/FillMethod.ts @@ -1,13 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { HorizontalFillOrigin } from './HorizontalFillOrigin'; -import type { Radial90Origin } from './Radial90Origin'; -import type { Radial180Origin } from './Radial180Origin'; -import type { Radial360Origin } from './Radial360Origin'; -import type { VerticalFillOrigin } from './VerticalFillOrigin'; +import type { HorizontalFillOrigin } from "./HorizontalFillOrigin"; +import type { Radial180Origin } from "./Radial180Origin"; +import type { Radial360Origin } from "./Radial360Origin"; +import type { Radial90Origin } from "./Radial90Origin"; +import type { VerticalFillOrigin } from "./VerticalFillOrigin"; -export type FillMethod = - | { Horizontal: HorizontalFillOrigin } - | { Vertical: VerticalFillOrigin } - | { Radial90: { origin: Radial90Origin; clockwise: boolean } } - | { Radial180: { origin: Radial180Origin; clockwise: boolean } } - | { Radial360: { origin: Radial360Origin; clockwise: boolean } }; +export type FillMethod = { "Horizontal": HorizontalFillOrigin } | { "Vertical": VerticalFillOrigin } | { "Radial90": { origin: Radial90Origin, clockwise: boolean, } } | { "Radial180": { origin: Radial180Origin, clockwise: boolean, } } | { "Radial360": { origin: Radial360Origin, clockwise: boolean, } }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAsset.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAsset.ts index 291bd4dde..3e6df8f8e 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAsset.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAsset.ts @@ -1,10 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FontAssetId } from './FontAssetId'; -import type { FontAssetMetadata } from './FontAssetMetadata'; +import type { FontAssetId } from "./FontAssetId"; +import type { FontAssetMetadata } from "./FontAssetMetadata"; -export type FontAsset = { - asset_id: FontAssetId; - metadata: FontAssetMetadata; - path: string; - content_sha256: string; -}; +export type FontAsset = { asset_id: FontAssetId, metadata: FontAssetMetadata, path: string, content_sha256: string, }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAssetMetadata.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAssetMetadata.ts index 031e4609f..39ee02a91 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAssetMetadata.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontAssetMetadata.ts @@ -1,11 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FontFormat } from './FontFormat'; +import type { FontFormat } from "./FontFormat"; -export type FontAssetMetadata = { - family_name: string; - face_name: string; - weight: number; - italic: boolean; - format: FontFormat; - source_file_name: string; -}; +export type FontAssetMetadata = { family_name: string, face_name: string, weight: number, italic: boolean, format: FontFormat, source_file_name: string, }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontFormat.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontFormat.ts index c15b77454..4b9ff9391 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontFormat.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontFormat.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type FontFormat = 'TrueType' | 'OpenType' | 'Woff' | 'Woff2'; +export type FontFormat = "TrueType" | "OpenType" | "Woff" | "Woff2"; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontSource.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontSource.ts index 7893a3777..dc80dd4fb 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/FontSource.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/FontSource.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FontAssetId } from './FontAssetId'; +import type { FontAssetId } from "./FontAssetId"; /** * 文本的字体来源。系统字体是一个明确的有效选择,而不是缺失的字体绑定。 */ -export type FontSource = 'SystemFont' | { Bound: FontAssetId }; +export type FontSource = "SystemFont" | { "Bound": FontAssetId }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/Node.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/Node.ts index c014b35ad..c05d8743a 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/Node.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/Node.ts @@ -1,15 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChildrenDisplayMode } from './ChildrenDisplayMode'; -import type { Component } from './Component'; -import type { ControlLayout } from './ControlLayout'; -import type { NodeId } from './NodeId'; -import type { NodeMetadata } from './NodeMetadata'; +import type { ChildrenDisplayMode } from "./ChildrenDisplayMode"; +import type { Component } from "./Component"; +import type { ControlLayout } from "./ControlLayout"; +import type { NodeId } from "./NodeId"; +import type { NodeMetadata } from "./NodeMetadata"; -export type Node = { - id: NodeId; - layout: ControlLayout; - metadata: NodeMetadata; - components: Array; - children_display_mode: ChildrenDisplayMode; - children: Array; -}; +export type Node = { id: NodeId, layout: ControlLayout, metadata: NodeMetadata, components: Array, children_display_mode: ChildrenDisplayMode, children: Array, }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/StageStatus.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/StageStatus.ts index 9a12ba476..ebb7d0541 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/StageStatus.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/StageStatus.ts @@ -1,4 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type StageStatus = - 'NoProblem' | { NeedReview: string } | { Blocked: string }; +export type StageStatus = "NoProblem" | { "NeedReview": string } | { "Blocked": string }; diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/types/TextComponent.ts b/apps/ai-game-creator-shell/src/features/ui-editor/types/TextComponent.ts index 8745af8c9..1f22b7b87 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/types/TextComponent.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/types/TextComponent.ts @@ -1,22 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FontSizing } from './FontSizing'; -import type { FontSource } from './FontSource'; -import type { FontStyle } from './FontStyle'; -import type { HorizontalTextOverflow } from './HorizontalTextOverflow'; -import type { TextAlignment } from './TextAlignment'; -import type { VerticalTextOverflow } from './VerticalTextOverflow'; +import type { FontSizing } from "./FontSizing"; +import type { FontSource } from "./FontSource"; +import type { FontStyle } from "./FontStyle"; +import type { HorizontalTextOverflow } from "./HorizontalTextOverflow"; +import type { TextAlignment } from "./TextAlignment"; +import type { VerticalTextOverflow } from "./VerticalTextOverflow"; /** * Text / Label 渲染组件;布局由同一 Entity 上独立的 `Control` 提供。 */ -export type TextComponent = { - content: string; - font: FontSource; - font_style: FontStyle; - font_sizing: FontSizing; - color: [number, number, number, number]; - alignment: TextAlignment; - horizontal_overflow: HorizontalTextOverflow; - vertical_overflow: VerticalTextOverflow; - line_spacing: number; -}; +export type TextComponent = { content: string, font: FontSource, font_style: FontStyle, font_sizing: FontSizing, color: [number, number, number, number], alignment: TextAlignment, horizontal_overflow: HorizontalTextOverflow, vertical_overflow: VerticalTextOverflow, line_spacing: number, };