A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(sdk): declare ThemeStyle's fields so themed widgets validate
esengineddb1f5e442cd
diff --git a/sdk/src/ui/theme/theme-style.ts b/sdk/src/ui/theme/theme-style.tsindex 2c979d09a..9db694336 100644--- a/sdk/src/ui/theme/theme-style.ts+++ b/sdk/src/ui/theme/theme-style.ts@@ -30,8 +30,15 @@ export interface ThemeStyleData {}// Runtime-only: a widget's theme-role tags are re-derived from code on every-// construct, never persisted — so it stays out of scenes and prefabs.-export const ThemeStyle = defineComponent<ThemeStyleData>('ThemeStyle', {}, { transient: true });+// construct, never persisted — so it stays out of scenes and prefabs. The default+// DECLARES the fields (even though all are optional): `insert` validates data+// against the schema's keys, so an empty default would reject every role a widget+// tags (e.g. a dialog's `{ visual: 'backdrop' }`).+export const ThemeStyle = defineComponent<ThemeStyleData>(+ 'ThemeStyle',+ { visual: undefined, text: undefined, states: {} },+ { transient: true },+);/** Tag `entity` so the active theme's colors re-resolve onto it (see* `applyThemeToWorld`). */