@pixi-ui-editor/runtime-pixi 0.7.1 → 0.9.0

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.
Files changed (63) hide show
  1. package/dist/SceneViewport.d.ts.map +1 -1
  2. package/dist/assets/bitmapFonts.js.map +1 -1
  3. package/dist/assets/fonts.js.map +1 -1
  4. package/dist/assets/sounds.js.map +1 -1
  5. package/dist/assets/spine.js.map +1 -1
  6. package/dist/assets/textures.js.map +1 -1
  7. package/dist/controls.d.ts +25 -1
  8. package/dist/controls.d.ts.map +1 -1
  9. package/dist/controls.js +42 -2
  10. package/dist/controls.js.map +1 -1
  11. package/dist/document.d.ts.map +1 -1
  12. package/dist/index.d.ts +2 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +2 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/layoutGroups.d.ts.map +1 -1
  17. package/dist/layoutGroups.js.map +1 -1
  18. package/dist/localization.d.ts.map +1 -1
  19. package/dist/localization.js.map +1 -1
  20. package/dist/pageGroup.d.ts.map +1 -1
  21. package/dist/pageGroup.js.map +1 -1
  22. package/dist/particles.d.ts.map +1 -1
  23. package/dist/particles.js.map +1 -1
  24. package/dist/scene.d.ts.map +1 -1
  25. package/dist/scene.js +36 -0
  26. package/dist/scene.js.map +1 -1
  27. package/dist/scrollView.d.ts.map +1 -1
  28. package/dist/scrollView.js.map +1 -1
  29. package/dist/views/ButtonNodeView.d.ts +12 -0
  30. package/dist/views/ButtonNodeView.d.ts.map +1 -1
  31. package/dist/views/ButtonNodeView.js +25 -7
  32. package/dist/views/ButtonNodeView.js.map +1 -1
  33. package/dist/views/CheckboxNodeView.d.ts.map +1 -1
  34. package/dist/views/InputNodeView.d.ts.map +1 -1
  35. package/dist/views/ItemTableNodeView.d.ts +57 -0
  36. package/dist/views/ItemTableNodeView.d.ts.map +1 -0
  37. package/dist/views/ItemTableNodeView.js +100 -0
  38. package/dist/views/ItemTableNodeView.js.map +1 -0
  39. package/dist/views/NodeView.d.ts +15 -1
  40. package/dist/views/NodeView.d.ts.map +1 -1
  41. package/dist/views/NodeView.js +19 -2
  42. package/dist/views/NodeView.js.map +1 -1
  43. package/dist/views/PageGroupNodeView.d.ts.map +1 -1
  44. package/dist/views/PaginationNodeView.d.ts +38 -2
  45. package/dist/views/PaginationNodeView.d.ts.map +1 -1
  46. package/dist/views/PaginationNodeView.js +85 -28
  47. package/dist/views/PaginationNodeView.js.map +1 -1
  48. package/dist/views/ParticleEmitterNodeView.d.ts.map +1 -1
  49. package/dist/views/ScrollViewNodeView.d.ts.map +1 -1
  50. package/dist/views/SpineNodeView.d.ts.map +1 -1
  51. package/dist/views/StagedButtonNodeView.d.ts +12 -1
  52. package/dist/views/StagedButtonNodeView.d.ts.map +1 -1
  53. package/dist/views/StagedButtonNodeView.js +27 -9
  54. package/dist/views/StagedButtonNodeView.js.map +1 -1
  55. package/dist/views/ValueControlNodeViews.d.ts.map +1 -1
  56. package/dist/views/basic.d.ts +27 -1
  57. package/dist/views/basic.d.ts.map +1 -1
  58. package/dist/views/basic.js +44 -0
  59. package/dist/views/basic.js.map +1 -1
  60. package/dist/views/createNodeView.d.ts.map +1 -1
  61. package/dist/views/createNodeView.js +8 -1
  62. package/dist/views/createNodeView.js.map +1 -1
  63. package/package.json +5 -2
@@ -1 +1 @@
1
- {"version":3,"file":"StagedButtonNodeView.js","sourceRoot":"","sources":["../../src/views/StagedButtonNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+E,MAAM,wBAAwB,CAAC;AACxI,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAa,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAW,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAMpE,MAAM,kBAAkB,GAAG,EAAE,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C1G,QAAQ,CAAC,KAAqB;QAC5B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["import { BUTTON_STATE_KEYS, type ButtonStateKey, type LayoutPadding, type StagedButtonNode, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { FancyButton } from \"@pixi/ui\";\r\nimport type { Sound } from \"@pixi/sound\";\r\nimport { Container, Graphics, NineSliceSprite, Sprite, Texture } from \"pixi.js\";\r\nimport { Signal } from \"typed-signals\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\n\r\nexport type { StagedButtonNode };\r\ntype StagedButtonStage = StagedButtonNode[\"stages\"][number];\r\ntype FancyButtonEventHandler = Parameters<FancyButton[\"onPress\"][\"connect\"]>[0];\r\n\r\nconst FANCY_STATE_BY_KEY = { normal: \"default\", hover: \"hover\", pressed: \"pressed\", disabled: \"disabled\" } as const;\r\n\r\n/**\r\n * Adapts a staged-button node to `@pixi/ui`'s `FancyButton`, exactly like `ButtonNodeView` does for a\r\n * plain button — this class never reimplements its pointer state machine either. It is a deliberately\r\n * separate component (see TASK-057): it does not extend or share behavior with `ButtonNodeView`.\r\n *\r\n * A click at runtime advances the current stage (`next()`), which respects `wrap`. Four state views\r\n * are created once and reused across stages: changing stage only reassigns their textures/size, never\r\n * replacing the view type — a full `FancyButton` rebuild only happens when a view's required *type*\r\n * changes (nine-slice toggled, or a texture just finished loading), because `FancyButton` gives no way\r\n * to swap a view after construction.\r\n */\r\nexport class StagedButtonNodeView extends NodeView {\r\n private button!: FancyButton;\r\n private stateViews!: Record<ButtonStateKey, Container>;\r\n private readonly interaction: SceneInteractionMode;\r\n private readonly sounds: ReadonlyMap<string, Sound> | undefined;\r\n private soundAssetIds: StagedButtonNode[\"sounds\"];\r\n private nineSlice: LayoutPadding | undefined;\r\n private stagesData: StagedButtonStage[];\r\n private currentStageId: string;\r\n private defaultStageId: string;\r\n private wrapState: boolean;\r\n private enabledState: boolean;\r\n /** Последнее editor-only визуальное состояние из `setState`: переживает пересборку `FancyButton`. */\r\n private forcedState: ButtonStateKey | undefined;\r\n\r\n /** Stable public signals: subscriptions survive an internal `FancyButton` rebuild. */\r\n readonly onPress: FancyButton[\"onPress\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onDown: FancyButton[\"onDown\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onUp: FancyButton[\"onUp\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onHover: FancyButton[\"onHover\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onOut: FancyButton[\"onOut\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onStageChange = new Signal<(stage: { index: number; value: string }) => void>();\r\n\r\n constructor(node: StagedButtonNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, sounds?: ReadonlyMap<string, Sound>) {\r\n super(textures);\r\n this.interaction = interaction;\r\n this.sounds = sounds;\r\n this.soundAssetIds = node.sounds;\r\n this.nineSlice = node.nineSlice;\r\n this.stagesData = node.stages;\r\n this.wrapState = node.wrap;\r\n this.defaultStageId = node.defaultStageId;\r\n this.currentStageId = node.stages.some((stage) => stage.id === node.defaultStageId) ? node.defaultStageId : node.stages[0]!.id;\r\n this.enabledState = node.enabled;\r\n this.buildButton();\r\n }\r\n\r\n private currentStage(): StagedButtonStage {\r\n return this.stagesData.find((stage) => stage.id === this.currentStageId) ?? this.stagesData[0]!;\r\n }\r\n\r\n private static createStateView(texture: Texture | undefined, nineSlice: LayoutPadding | undefined): Container {\r\n if (texture === undefined) return new Graphics();\r\n return nineSlice === undefined\r\n ? new Sprite(texture)\r\n : new NineSliceSprite({ texture, leftWidth: nineSlice.left, topHeight: nineSlice.top, rightWidth: nineSlice.right, bottomHeight: nineSlice.bottom });\r\n }\r\n\r\n /**\r\n * (Re)builds `FancyButton` and its four state views for the current stage. `size`, when provided,\r\n * sizes the freshly built views immediately — needed because a stage change may happen well outside\r\n * a `syncContent` pass (e.g. a runtime click), where nothing else would resize them afterwards.\r\n */\r\n private buildButton(size?: { width: number; height: number }): void {\r\n const stage = this.currentStage();\r\n const normalTexture = this.textureFor(stage.states.normalAssetId);\r\n const stateViews = {} as Record<ButtonStateKey, Container>;\r\n const viewFor = (state: ButtonStateKey, assetId: string | undefined): Container => {\r\n const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;\r\n const view = StagedButtonNodeView.createStateView(texture, this.nineSlice);\r\n stateViews[state] = view;\r\n return view;\r\n };\r\n\r\n const button = new FancyButton({\r\n defaultView: viewFor(\"normal\", stage.states.normalAssetId),\r\n hoverView: viewFor(\"hover\", stage.states.hoverAssetId),\r\n pressedView: viewFor(\"pressed\", stage.states.pressedAssetId),\r\n disabledView: viewFor(\"disabled\", stage.states.disabledAssetId),\r\n });\r\n // Authoring-сцена инертна, как и у обычной кнопки: клики не должны крутить стадию, а попадание по\r\n // ноде остаётся ответственностью NodeView.containsPoint.\r\n if (this.interaction === \"authoring\") button.eventMode = \"none\";\r\n else {\r\n button.onPress.connect((source, event) => {\r\n this.next();\r\n const result = this.soundAssetIds?.pressAssetId === undefined ? undefined : this.sounds?.get(this.soundAssetIds.pressAssetId)?.play();\r\n if (result instanceof Promise) void result.catch(() => undefined);\r\n this.onPress.emit(source, event);\r\n });\r\n button.onDown.connect((source, event) => this.onDown.emit(source, event));\r\n button.onUp.connect((source, event) => this.onUp.emit(source, event));\r\n button.onHover.connect((source, event) => {\r\n const result = this.soundAssetIds?.hoverAssetId === undefined ? undefined : this.sounds?.get(this.soundAssetIds.hoverAssetId)?.play();\r\n if (result instanceof Promise) void result.catch(() => undefined);\r\n this.onHover.emit(source, event);\r\n });\r\n button.onOut.connect((source, event) => this.onOut.emit(source, event));\r\n }\r\n this.button = button;\r\n this.stateViews = stateViews;\r\n this.setContent(button);\r\n\r\n const resolved = size ?? this.layoutRectangle;\r\n this.applySizes(resolved.width, resolved.height);\r\n\r\n // Пересборка — деталь реализации `FancyButton`, а не действие пользователя: transient enabled и\r\n // визуальное состояние восстанавливаются на новом инстансе, иначе переключение nine-slice или\r\n // догрузка текстуры сбрасывали бы их.\r\n this.applyEnabled(this.enabledState);\r\n if (this.forcedState !== undefined) this.button.setState(FANCY_STATE_BY_KEY[this.forcedState]);\r\n }\r\n\r\n /**\r\n * Sizes the four state views to the resolved layout rectangle without touching their textures.\r\n *\r\n * `NineSliceSprite` проверяется отдельно: в PixiJS 8 он наследуется от `ViewContainer`, а не от\r\n * `Sprite`, поэтому одна ветка `instanceof Sprite` его молча пропускает.\r\n */\r\n private applySizes(width: number, height: number): void {\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const view = this.stateViews[state];\r\n if (view instanceof NineSliceSprite) view.setSize(width, height);\r\n else if (view instanceof Sprite) view.setSize(width, height);\r\n else if (view instanceof Graphics) view.clear().rect(0, 0, width, height).fill(0x4a5568).stroke({ width: 1, color: 0x94a3b8 });\r\n }\r\n }\r\n\r\n /**\r\n * Applies the current stage's textures/border to the existing state views (or rebuilds them if a\r\n * view's required type no longer matches, the same rule `ButtonNodeView.syncContent` follows).\r\n */\r\n private refreshStateViews(width: number, height: number): void {\r\n const stage = this.currentStage();\r\n const normalTexture = this.textureFor(stage.states.normalAssetId);\r\n\r\n let needsRebuild = false;\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const assetId = stage.states[`${state}AssetId`];\r\n const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;\r\n const view = this.stateViews[state];\r\n const wantsNineSlice = texture !== undefined && this.nineSlice !== undefined;\r\n // `NineSliceSprite` не наследуется от `Sprite` в PixiJS 8, поэтому ветки не пересекаются.\r\n const matches = texture === undefined ? view instanceof Graphics : wantsNineSlice ? view instanceof NineSliceSprite : view instanceof Sprite;\r\n if (!matches) { needsRebuild = true; break; }\r\n }\r\n\r\n if (needsRebuild) {\r\n this.buildButton({ width, height });\r\n return;\r\n }\r\n\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const view = this.stateViews[state];\r\n const assetId = stage.states[`${state}AssetId`];\r\n const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;\r\n // Set the texture before the layout size: Sprite/NineSliceSprite preserve scale when their\r\n // texture changes, so sizing first would shift visual bounds for a differently-sized source.\r\n if (view instanceof NineSliceSprite) {\r\n if (texture !== undefined && view.texture !== texture) view.texture = texture;\r\n if (this.nineSlice !== undefined) {\r\n view.leftWidth = this.nineSlice.left;\r\n view.topHeight = this.nineSlice.top;\r\n view.rightWidth = this.nineSlice.right;\r\n view.bottomHeight = this.nineSlice.bottom;\r\n }\r\n } else if (view instanceof Sprite) {\r\n if (texture !== undefined && view.texture !== texture) view.texture = texture;\r\n }\r\n }\r\n this.applySizes(width, height);\r\n }\r\n\r\n private applyStage(stageId: string): void {\r\n this.currentStageId = stageId;\r\n const { width, height } = this.layoutRectangle;\r\n this.refreshStateViews(width, height);\r\n }\r\n\r\n /** In authoring mode `enabled` may only drive the visuals: `FancyButton` couples it to `eventMode`. */\r\n private applyEnabled(enabled: boolean): void {\r\n this.enabledState = enabled;\r\n if (this.interaction === \"runtime\") this.button.enabled = enabled;\r\n else this.button.setState(enabled ? \"default\" : \"disabled\");\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"staged-button\") return;\r\n this.soundAssetIds = node.sounds;\r\n this.nineSlice = node.nineSlice;\r\n this.wrapState = node.wrap;\r\n this.defaultStageId = node.defaultStageId;\r\n\r\n // Сохраняет текущую стадию, если она ещё существует после изменения документа; если стадию\r\n // удалили — переходит на ближайшую валидную по прежнему индексу.\r\n const previousIndex = this.stagesData.findIndex((stage) => stage.id === this.currentStageId);\r\n this.stagesData = node.stages;\r\n if (!node.stages.some((stage) => stage.id === this.currentStageId)) {\r\n const clampedIndex = Math.min(Math.max(previousIndex, 0), node.stages.length - 1);\r\n this.currentStageId = node.stages[clampedIndex]!.id;\r\n }\r\n\r\n this.refreshStateViews(transform.width, transform.height);\r\n\r\n // Только на изменение документа: иначе любой пересчёт layout сбрасывал бы transient preview state.\r\n if (node.enabled !== this.enabledState) this.applyEnabled(node.enabled);\r\n }\r\n\r\n /** Editor-only live preview of nine-slice border edits while dragging the canvas gizmo. */\r\n previewNineSlice(nineSlice: LayoutPadding): void {\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const view = this.stateViews[state];\r\n if (!(view instanceof NineSliceSprite)) continue;\r\n view.leftWidth = nineSlice.left;\r\n view.topHeight = nineSlice.top;\r\n view.rightWidth = nineSlice.right;\r\n view.bottomHeight = nineSlice.bottom;\r\n }\r\n }\r\n\r\n get enabled(): boolean {\r\n return this.enabledState;\r\n }\r\n\r\n set enabled(value: boolean) {\r\n this.applyEnabled(value);\r\n }\r\n\r\n get stage(): number {\r\n const index = this.stagesData.findIndex((stage) => stage.id === this.currentStageId);\r\n return index === -1 ? 0 : index;\r\n }\r\n\r\n get value(): string {\r\n return this.currentStage().value;\r\n }\r\n\r\n get stageCount(): number {\r\n return this.stagesData.length;\r\n }\r\n\r\n /** Moves to the stage at `index` and emits `onStageChange`; an out-of-range index is a no-op. */\r\n setStage(index: number): void {\r\n const target = this.stagesData[index];\r\n if (target === undefined) return;\r\n this.applyStage(target.id);\r\n this.onStageChange.emit({ index, value: target.value });\r\n }\r\n\r\n /** Moves to the stage at `index` without emitting — used by editor preview to avoid feedback loops. */\r\n forceStage(index: number): void {\r\n const target = this.stagesData[index];\r\n if (target === undefined) return;\r\n this.applyStage(target.id);\r\n }\r\n\r\n /** Moves to the first stage whose `value` matches; an unknown value is ignored. */\r\n setValue(value: string): void {\r\n const index = this.stagesData.findIndex((stage) => stage.value === value);\r\n if (index === -1) return;\r\n this.setStage(index);\r\n }\r\n\r\n /** Advances one stage, as a click does; respects `wrap` at the last stage. */\r\n next(): void {\r\n const nextIndex = this.stage + 1;\r\n if (nextIndex >= this.stagesData.length) {\r\n if (!this.wrapState) return;\r\n this.setStage(0);\r\n return;\r\n }\r\n this.setStage(nextIndex);\r\n }\r\n\r\n /** Returns to `defaultStageId`, emitting `onStageChange`. */\r\n reset(): void {\r\n const index = this.stagesData.findIndex((stage) => stage.id === this.defaultStageId);\r\n this.setStage(index === -1 ? 0 : index);\r\n }\r\n\r\n /** Forces an editor-only visual state without changing `enabled`, mirroring `ButtonNodeView.setState`. */\r\n setState(state: ButtonStateKey): void {\r\n this.forcedState = state;\r\n this.button.setState(FANCY_STATE_BY_KEY[state]);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"StagedButtonNodeView.js","sourceRoot":"","sources":["../../src/views/StagedButtonNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+E,MAAM,wBAAwB,CAAC;AACxI,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAa,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAW,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAMpE,MAAM,kBAAkB,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAW,CAAC;AAEpH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,oBAAqB,SAAQ,QAAQ;IACxC,MAAM,CAAe;IACrB,UAAU,CAAqC;IACtC,WAAW,CAAuB;IAClC,MAAM,CAAyC;IACxD,aAAa,CAA6B;IAC1C,SAAS,CAA4B;IACrC,UAAU,CAAsB;IAChC,cAAc,CAAS;IACvB,cAAc,CAAS;IACvB,SAAS,CAAU;IACnB,YAAY,CAAU;IAC9B,qGAAqG;IAC7F,WAAW,CAA6B;IAEhD,sFAAsF;IAC7E,OAAO,GAA2B,IAAI,MAAM,EAA2B,CAAC;IACxE,MAAM,GAA0B,IA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5B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["import { BUTTON_STATE_KEYS, type ButtonStateKey, type LayoutPadding, type StagedButtonNode, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { FancyButton } from \"@pixi/ui\";\r\nimport type { Sound } from \"@pixi/sound\";\r\nimport { Container, Graphics, NineSliceSprite, Sprite, Texture } from \"pixi.js\";\r\nimport { Signal } from \"typed-signals\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\n\r\nexport type { StagedButtonNode };\r\ntype StagedButtonStage = StagedButtonNode[\"stages\"][number];\r\ntype FancyButtonEventHandler = Parameters<FancyButton[\"onPress\"][\"connect\"]>[0];\r\n\r\nconst FANCY_STATE_BY_KEY = { normal: \"default\", hover: \"hover\", pressed: \"pressed\", disabled: \"disabled\" } as const;\r\n\r\n/**\r\n * Adapts a staged-button node to `@pixi/ui`'s `FancyButton`, exactly like `ButtonNodeView` does for a\r\n * plain button — this class never reimplements its pointer state machine either. It is a deliberately\r\n * separate component (see TASK-057): it does not extend or share behavior with `ButtonNodeView`.\r\n *\r\n * A click at runtime advances the current stage (`next()`), which respects `wrap`. Four state views\r\n * are created once and reused across stages: changing stage only reassigns their textures/size, never\r\n * replacing the view type — a full `FancyButton` rebuild only happens when a view's required *type*\r\n * changes (nine-slice toggled, or a texture just finished loading), because `FancyButton` gives no way\r\n * to swap a view after construction.\r\n */\r\nexport class StagedButtonNodeView extends NodeView {\r\n private button!: FancyButton;\r\n private stateViews!: Record<ButtonStateKey, Container>;\r\n private readonly interaction: SceneInteractionMode;\r\n private readonly sounds: ReadonlyMap<string, Sound> | undefined;\r\n private soundAssetIds: StagedButtonNode[\"sounds\"];\r\n private nineSlice: LayoutPadding | undefined;\r\n private stagesData: StagedButtonStage[];\r\n private currentStageId: string;\r\n private defaultStageId: string;\r\n private wrapState: boolean;\r\n private enabledState: boolean;\r\n /** Последнее editor-only визуальное состояние из `setState`: переживает пересборку `FancyButton`. */\r\n private forcedState: ButtonStateKey | undefined;\r\n\r\n /** Stable public signals: subscriptions survive an internal `FancyButton` rebuild. */\r\n readonly onPress: FancyButton[\"onPress\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onDown: FancyButton[\"onDown\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onUp: FancyButton[\"onUp\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onHover: FancyButton[\"onHover\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onOut: FancyButton[\"onOut\"] = new Signal<FancyButtonEventHandler>();\r\n readonly onStageChange = new Signal<(stage: { index: number; value: string }) => void>();\r\n\r\n constructor(node: StagedButtonNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, sounds?: ReadonlyMap<string, Sound>) {\r\n super(textures);\r\n this.interaction = interaction;\r\n this.sounds = sounds;\r\n this.soundAssetIds = node.sounds;\r\n this.nineSlice = node.nineSlice;\r\n this.stagesData = node.stages;\r\n this.wrapState = node.wrap;\r\n this.defaultStageId = node.defaultStageId;\r\n this.currentStageId = node.stages.some((stage) => stage.id === node.defaultStageId) ? node.defaultStageId : node.stages[0]!.id;\r\n this.enabledState = node.enabled;\r\n // Explicit size, not the `this.layoutRectangle` default `buildButton()` would otherwise fall back\r\n // to: no layout pass has run yet at construction time, so that getter still reads `{0, 0}`.\r\n this.buildButton({ width: node.transform.width, height: node.transform.height });\r\n }\r\n\r\n private currentStage(): StagedButtonStage {\r\n return this.stagesData.find((stage) => stage.id === this.currentStageId) ?? this.stagesData[0]!;\r\n }\r\n\r\n /**\r\n * Invisible (alpha 0) but still hit-testable: Pixi's `containsPoint` hit-tests the fill's geometry\r\n * regardless of its alpha. Painted with a real size *before* the view ever reaches `FancyButton`:\r\n * `FancyButton` reads `defaultView`'s bounds exactly once, synchronously during construction, to\r\n * freeze its own `hitArea` — it never re-reads them afterwards. A `Graphics` still at its default\r\n * (0, 0) size at that moment would freeze a zero-size, permanently unclickable hit area.\r\n */\r\n private static paintPlaceholder(graphics: Graphics, width: number, height: number): void {\r\n graphics.clear().rect(0, 0, width, height).fill({ color: 0x000000, alpha: 0 });\r\n }\r\n\r\n private static createStateView(texture: Texture | undefined, nineSlice: LayoutPadding | undefined, size: { width: number; height: number }): Container {\r\n if (texture === undefined) {\r\n const graphics = new Graphics();\r\n StagedButtonNodeView.paintPlaceholder(graphics, size.width, size.height);\r\n return graphics;\r\n }\r\n return nineSlice === undefined\r\n ? new Sprite(texture)\r\n : new NineSliceSprite({ texture, leftWidth: nineSlice.left, topHeight: nineSlice.top, rightWidth: nineSlice.right, bottomHeight: nineSlice.bottom });\r\n }\r\n\r\n /**\r\n * (Re)builds `FancyButton` and its four state views for the current stage. `size`, when provided,\r\n * sizes the freshly built views immediately — needed because a stage change may happen well outside\r\n * a `syncContent` pass (e.g. a runtime click), where nothing else would resize them afterwards. The\r\n * constructor also always passes it explicitly: `this.layoutRectangle` is still `{0, 0}` before the\r\n * first layout pass, and an initial placeholder painted at that size would freeze a zero-size,\r\n * permanently unclickable `hitArea` on `FancyButton` (see `paintPlaceholder`).\r\n */\r\n private buildButton(size?: { width: number; height: number }): void {\r\n const stage = this.currentStage();\r\n const normalTexture = this.textureFor(stage.states.normalAssetId);\r\n const resolvedSize = size ?? this.layoutRectangle;\r\n const stateViews = {} as Record<ButtonStateKey, Container>;\r\n const viewFor = (state: ButtonStateKey, assetId: string | undefined): Container => {\r\n const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;\r\n const view = StagedButtonNodeView.createStateView(texture, this.nineSlice, resolvedSize);\r\n stateViews[state] = view;\r\n return view;\r\n };\r\n\r\n const button = new FancyButton({\r\n defaultView: viewFor(\"normal\", stage.states.normalAssetId),\r\n hoverView: viewFor(\"hover\", stage.states.hoverAssetId),\r\n pressedView: viewFor(\"pressed\", stage.states.pressedAssetId),\r\n disabledView: viewFor(\"disabled\", stage.states.disabledAssetId),\r\n });\r\n // Authoring-сцена инертна, как и у обычной кнопки: клики не должны крутить стадию, а попадание по\r\n // ноде остаётся ответственностью NodeView.containsPoint.\r\n if (this.interaction === \"authoring\") button.eventMode = \"none\";\r\n else {\r\n button.onPress.connect((source, event) => {\r\n this.next();\r\n const result = this.soundAssetIds?.pressAssetId === undefined ? undefined : this.sounds?.get(this.soundAssetIds.pressAssetId)?.play();\r\n if (result instanceof Promise) void result.catch(() => undefined);\r\n this.onPress.emit(source, event);\r\n });\r\n button.onDown.connect((source, event) => this.onDown.emit(source, event));\r\n button.onUp.connect((source, event) => this.onUp.emit(source, event));\r\n button.onHover.connect((source, event) => {\r\n const result = this.soundAssetIds?.hoverAssetId === undefined ? undefined : this.sounds?.get(this.soundAssetIds.hoverAssetId)?.play();\r\n if (result instanceof Promise) void result.catch(() => undefined);\r\n this.onHover.emit(source, event);\r\n });\r\n button.onOut.connect((source, event) => this.onOut.emit(source, event));\r\n }\r\n this.button = button;\r\n this.stateViews = stateViews;\r\n this.setContent(button);\r\n\r\n this.applySizes(resolvedSize.width, resolvedSize.height);\r\n\r\n // Пересборка — деталь реализации `FancyButton`, а не действие пользователя: transient enabled и\r\n // визуальное состояние восстанавливаются на новом инстансе, иначе переключение nine-slice или\r\n // догрузка текстуры сбрасывали бы их.\r\n this.applyEnabled(this.enabledState);\r\n if (this.forcedState !== undefined) this.button.setState(FANCY_STATE_BY_KEY[this.forcedState]);\r\n }\r\n\r\n /**\r\n * Sizes the four state views to the resolved layout rectangle without touching their textures.\r\n *\r\n * `NineSliceSprite` проверяется отдельно: в PixiJS 8 он наследуется от `ViewContainer`, а не от\r\n * `Sprite`, поэтому одна ветка `instanceof Sprite` его молча пропускает.\r\n */\r\n private applySizes(width: number, height: number): void {\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const view = this.stateViews[state];\r\n if (view instanceof NineSliceSprite) view.setSize(width, height);\r\n else if (view instanceof Sprite) view.setSize(width, height);\r\n else if (view instanceof Graphics) StagedButtonNodeView.paintPlaceholder(view, width, height);\r\n }\r\n }\r\n\r\n /**\r\n * Applies the current stage's textures/border to the existing state views (or rebuilds them if a\r\n * view's required type no longer matches, the same rule `ButtonNodeView.syncContent` follows).\r\n */\r\n private refreshStateViews(width: number, height: number): void {\r\n const stage = this.currentStage();\r\n const normalTexture = this.textureFor(stage.states.normalAssetId);\r\n\r\n let needsRebuild = false;\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const assetId = stage.states[`${state}AssetId`];\r\n const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;\r\n const view = this.stateViews[state];\r\n const wantsNineSlice = texture !== undefined && this.nineSlice !== undefined;\r\n // `NineSliceSprite` не наследуется от `Sprite` в PixiJS 8, поэтому ветки не пересекаются.\r\n const matches = texture === undefined ? view instanceof Graphics : wantsNineSlice ? view instanceof NineSliceSprite : view instanceof Sprite;\r\n if (!matches) { needsRebuild = true; break; }\r\n }\r\n\r\n if (needsRebuild) {\r\n this.buildButton({ width, height });\r\n return;\r\n }\r\n\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const view = this.stateViews[state];\r\n const assetId = stage.states[`${state}AssetId`];\r\n const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;\r\n // Set the texture before the layout size: Sprite/NineSliceSprite preserve scale when their\r\n // texture changes, so sizing first would shift visual bounds for a differently-sized source.\r\n if (view instanceof NineSliceSprite) {\r\n if (texture !== undefined && view.texture !== texture) view.texture = texture;\r\n if (this.nineSlice !== undefined) {\r\n view.leftWidth = this.nineSlice.left;\r\n view.topHeight = this.nineSlice.top;\r\n view.rightWidth = this.nineSlice.right;\r\n view.bottomHeight = this.nineSlice.bottom;\r\n }\r\n } else if (view instanceof Sprite) {\r\n if (texture !== undefined && view.texture !== texture) view.texture = texture;\r\n }\r\n }\r\n this.applySizes(width, height);\r\n }\r\n\r\n private applyStage(stageId: string): void {\r\n this.currentStageId = stageId;\r\n const { width, height } = this.layoutRectangle;\r\n this.refreshStateViews(width, height);\r\n }\r\n\r\n /** In authoring mode `enabled` may only drive the visuals: `FancyButton` couples it to `eventMode`. */\r\n private applyEnabled(enabled: boolean): void {\r\n this.enabledState = enabled;\r\n if (this.interaction === \"runtime\") this.button.enabled = enabled;\r\n else this.button.setState(enabled ? \"default\" : \"disabled\");\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"staged-button\") return;\r\n this.soundAssetIds = node.sounds;\r\n this.nineSlice = node.nineSlice;\r\n this.wrapState = node.wrap;\r\n this.defaultStageId = node.defaultStageId;\r\n\r\n // Сохраняет текущую стадию, если она ещё существует после изменения документа; если стадию\r\n // удалили — переходит на ближайшую валидную по прежнему индексу.\r\n const previousIndex = this.stagesData.findIndex((stage) => stage.id === this.currentStageId);\r\n this.stagesData = node.stages;\r\n if (!node.stages.some((stage) => stage.id === this.currentStageId)) {\r\n const clampedIndex = Math.min(Math.max(previousIndex, 0), node.stages.length - 1);\r\n this.currentStageId = node.stages[clampedIndex]!.id;\r\n }\r\n\r\n this.refreshStateViews(transform.width, transform.height);\r\n\r\n // Только на изменение документа: иначе любой пересчёт layout сбрасывал бы transient preview state.\r\n if (node.enabled !== this.enabledState) this.applyEnabled(node.enabled);\r\n }\r\n\r\n /** Editor-only live preview of nine-slice border edits while dragging the canvas gizmo. */\r\n previewNineSlice(nineSlice: LayoutPadding): void {\r\n for (const state of BUTTON_STATE_KEYS) {\r\n const view = this.stateViews[state];\r\n if (!(view instanceof NineSliceSprite)) continue;\r\n view.leftWidth = nineSlice.left;\r\n view.topHeight = nineSlice.top;\r\n view.rightWidth = nineSlice.right;\r\n view.bottomHeight = nineSlice.bottom;\r\n }\r\n }\r\n\r\n get enabled(): boolean {\r\n return this.enabledState;\r\n }\r\n\r\n set enabled(value: boolean) {\r\n this.applyEnabled(value);\r\n }\r\n\r\n get stage(): number {\r\n const index = this.stagesData.findIndex((stage) => stage.id === this.currentStageId);\r\n return index === -1 ? 0 : index;\r\n }\r\n\r\n get value(): string {\r\n return this.currentStage().value;\r\n }\r\n\r\n get stageCount(): number {\r\n return this.stagesData.length;\r\n }\r\n\r\n /** Moves to the stage at `index` and emits `onStageChange`; an out-of-range index is a no-op. */\r\n setStage(index: number): void {\r\n const target = this.stagesData[index];\r\n if (target === undefined) return;\r\n this.applyStage(target.id);\r\n this.onStageChange.emit({ index, value: target.value });\r\n }\r\n\r\n /** Moves to the stage at `index` without emitting — used by editor preview to avoid feedback loops. */\r\n forceStage(index: number): void {\r\n const target = this.stagesData[index];\r\n if (target === undefined) return;\r\n this.applyStage(target.id);\r\n }\r\n\r\n /** Moves to the first stage whose `value` matches; an unknown value is ignored. */\r\n setValue(value: string): void {\r\n const index = this.stagesData.findIndex((stage) => stage.value === value);\r\n if (index === -1) return;\r\n this.setStage(index);\r\n }\r\n\r\n /** Advances one stage, as a click does; respects `wrap` at the last stage. */\r\n next(): void {\r\n const nextIndex = this.stage + 1;\r\n if (nextIndex >= this.stagesData.length) {\r\n if (!this.wrapState) return;\r\n this.setStage(0);\r\n return;\r\n }\r\n this.setStage(nextIndex);\r\n }\r\n\r\n /** Returns to `defaultStageId`, emitting `onStageChange`. */\r\n reset(): void {\r\n const index = this.stagesData.findIndex((stage) => stage.id === this.defaultStageId);\r\n this.setStage(index === -1 ? 0 : index);\r\n }\r\n\r\n /** Forces an editor-only visual state without changing `enabled`, mirroring `ButtonNodeView.setState`. */\r\n setState(state: ButtonStateKey): void {\r\n this.forcedState = state;\r\n this.button.setState(FANCY_STATE_BY_KEY[state]);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ValueControlNodeViews.d.ts","sourceRoot":"","sources":["../../src/views/ValueControlNodeViews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,UAAU,EAA4B,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC1I,OAAO,EAAe,MAAM,EA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AG,SAAS,EAsBlK;IAED,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAgBxE;IAED,IAAI,KAAK,IAAI,MAAM,CAA+B;IAClD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAiC;IACxD,IAAI,GAAG,IAAI,MAAM,CAA6B;IAC9C,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAwE;IAC7F,IAAI,GAAG,IAAI,MAAM,CAA6B;IAC9C,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAwE;IAC7F,IAAI,IAAI,IAAI,MAAM,CAA8B;IAChD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAyE;IAC/F,IAAI,QAAQ,IAAI,MAAM,CAAC,UAAU,CAAC,CAAkC;IACpE,IAAI,QAAQ,IAAI,MAAM,CAAC,UAAU,CAAC,CAAkC;CACrE;AAED,uEAAuE;AACvE,qBAAa,mBAAoB,SAAQ,QAAQ;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,iBAAiB,CAAU;IACnC,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,UAAU,CAAM;IAExB,YAAY,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAYpF;IAED,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAQxE;IAED,IAAI,QAAQ,IAAI,MAAM,CAAkC;IACxD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAoC;CAC/D"}
@@ -1,6 +1,6 @@
1
1
  import { type LayoutPadding, type LayoutProfileId, type UINode } from "@pixi-ui-editor/schema";
2
2
  import { Container, Texture } from "pixi.js";
3
- import { NodeView } from "./NodeView.js";
3
+ import { NodeView, type SceneInteractionMode } from "./NodeView.js";
4
4
  export declare class ContainerNodeView extends NodeView {
5
5
  protected syncContent(): void;
6
6
  }
@@ -10,6 +10,32 @@ export declare class MaskNodeView extends NodeView {
10
10
  constructor();
11
11
  protected syncContent(node: UINode, transform: UINode["transform"]): void;
12
12
  }
13
+ /**
14
+ * Multiplies one opacity into its whole child subtree, the same contract as Unity's `CanvasGroup.alpha`:
15
+ * PixiJS already folds a container's `alpha` into every descendant's `worldAlpha`, so this costs one
16
+ * multiply per object in a traversal that happens anyway — no offscreen render pass, and a fade over an
17
+ * arbitrarily large subtree stays a single number written once per frame. Overlapping children therefore
18
+ * show through each other at intermediate values, exactly as they do under a Unity `CanvasGroup`; true
19
+ * flattened group opacity would need an `AlphaFilter` and its per-frame render texture, which is
20
+ * deliberately not what this node is for.
21
+ *
22
+ * At zero opacity a runtime scene also stops rendering and hit-testing the subtree outright — the
23
+ * `blocksRaycasts` half of `CanvasGroup`, without which a fully faded-out screen keeps eating the
24
+ * pointer input of the one faded in over it. Both are skipped while authoring: `eventMode = "none"` on
25
+ * the view itself would drop the node and its children out of editor selection, and hit testing stays
26
+ * `NodeView`'s responsibility.
27
+ */
28
+ export declare class OpacityGroupNodeView extends NodeView {
29
+ private readonly interaction;
30
+ /** Transient runtime override; `undefined` keeps the authored `opacity` from the document. */
31
+ private runtimeOpacity?;
32
+ private authoredOpacity;
33
+ constructor(interaction: SceneInteractionMode);
34
+ /** Drives a fade from game code without touching the document; `undefined` restores the authored value. */
35
+ setOpacity(opacity: number | undefined): void;
36
+ private applyOpacity;
37
+ protected syncContent(node: UINode): void;
38
+ }
13
39
  /** Layout groups may optionally paint one image behind their managed children. No asset means no content/view at all. */
14
40
  export declare class LayoutGroupNodeView extends NodeView {
15
41
  private readonly layoutContent;
@@ -1 +1 @@
1
- {"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/views/basic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAAE,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ED,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAEzE;CACF"}
@@ -20,6 +20,50 @@ export class MaskNodeView extends NodeView {
20
20
  this.maskShape.clear().rect(0, 0, transform.width, transform.height).fill(0xffffff);
21
21
  }
22
22
  }
23
+ /**
24
+ * Multiplies one opacity into its whole child subtree, the same contract as Unity's `CanvasGroup.alpha`:
25
+ * PixiJS already folds a container's `alpha` into every descendant's `worldAlpha`, so this costs one
26
+ * multiply per object in a traversal that happens anyway — no offscreen render pass, and a fade over an
27
+ * arbitrarily large subtree stays a single number written once per frame. Overlapping children therefore
28
+ * show through each other at intermediate values, exactly as they do under a Unity `CanvasGroup`; true
29
+ * flattened group opacity would need an `AlphaFilter` and its per-frame render texture, which is
30
+ * deliberately not what this node is for.
31
+ *
32
+ * At zero opacity a runtime scene also stops rendering and hit-testing the subtree outright — the
33
+ * `blocksRaycasts` half of `CanvasGroup`, without which a fully faded-out screen keeps eating the
34
+ * pointer input of the one faded in over it. Both are skipped while authoring: `eventMode = "none"` on
35
+ * the view itself would drop the node and its children out of editor selection, and hit testing stays
36
+ * `NodeView`'s responsibility.
37
+ */
38
+ export class OpacityGroupNodeView extends NodeView {
39
+ interaction;
40
+ /** Transient runtime override; `undefined` keeps the authored `opacity` from the document. */
41
+ runtimeOpacity;
42
+ authoredOpacity = 1;
43
+ constructor(interaction) {
44
+ super();
45
+ this.interaction = interaction;
46
+ }
47
+ /** Drives a fade from game code without touching the document; `undefined` restores the authored value. */
48
+ setOpacity(opacity) {
49
+ this.runtimeOpacity = opacity === undefined ? undefined : Math.min(1, Math.max(0, opacity));
50
+ this.applyOpacity(this.runtimeOpacity ?? this.authoredOpacity);
51
+ }
52
+ applyOpacity(opacity) {
53
+ this.alpha = opacity;
54
+ if (this.interaction === "authoring")
55
+ return;
56
+ const hidden = opacity <= 0;
57
+ this.renderable = !hidden;
58
+ this.eventMode = hidden ? "none" : "passive";
59
+ }
60
+ syncContent(node) {
61
+ if (node.type !== "opacity-group")
62
+ return;
63
+ this.authoredOpacity = node.opacity;
64
+ this.applyOpacity(this.runtimeOpacity ?? this.authoredOpacity);
65
+ }
66
+ }
23
67
  /** Layout groups may optionally paint one image behind their managed children. No asset means no content/view at all. */
24
68
  export class LayoutGroupNodeView extends NodeView {
25
69
  layoutContent = new Container();
@@ -1 +1 @@
1
- {"version":3,"file":"basic.js","sourceRoot":"","sources":["../../src/views/basic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAW,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,OAAO,iBAAkB,SAAQ,QAAQ;IACnC,WAAW,KAAU,CAAC;CACjC;AAED,iFAAiF;AACjF,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACvB,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;IAE5C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9B,mGAAmG;QACnG,yGAAyG;QACzG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;IAES,WAAW,CAAC,IAAY,EAAE,SAA8B;QAChE,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO;QACjC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtF,CAAC;CACF;AAED,yHAAyH;AACzH,MAAM,OAAO,mBAAoB,SAAQ,QAAQ;IAC9B,aA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G,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC;IAC9C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,QAAQ;IAClD,YAAY,QAAiB;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,UAAU,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAES,WAAW,CAAC,KAAa,EAAE,SAA8B;QACjE,IAAI,IAAI,CAAC,OAAO,YAAY,QAAQ;YAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1H,CAAC;CACF","sourcesContent":["import { type BitmapTextNode, type LayoutPadding, type LayoutProfileId, type TextNode, type TextStyleDefinition, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { BitmapText, Container, Graphics, NineSliceSprite, Sprite, Text, Texture } from \"pixi.js\";\r\nimport { NodeView } from \"./NodeView.js\";\r\nimport { resolveTextStyle } from \"../layout.js\";\r\n\r\nexport class ContainerNodeView extends NodeView {\r\n protected syncContent(): void {}\r\n}\r\n\r\n/** Clips every authored child to the node's resolved rectangular layout area. */\r\nexport class MaskNodeView extends NodeView {\r\n private readonly maskShape = new Graphics();\r\n\r\n constructor() {\r\n super();\r\n this.addChild(this.maskShape);\r\n // A Graphics mask keeps the shape GPU-native and avoids the offscreen texture pass of alpha masks.\r\n // Pixi's regular mask contract also preserves correct clipping through rotation and transformed parents.\r\n this.mask = this.maskShape;\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"mask\") return;\r\n this.maskShape.clear().rect(0, 0, transform.width, transform.height).fill(0xffffff);\r\n }\r\n}\r\n\r\n/** Layout groups may optionally paint one image behind their managed children. No asset means no content/view at all. */\r\nexport class LayoutGroupNodeView extends NodeView {\r\n private readonly layoutContent = new Container();\r\n private background?: Sprite;\r\n\r\n constructor(textures: ReadonlyMap<string, Texture> | undefined) {\r\n super(textures);\r\n // Yoga owns this inner container only. The NodeView itself retains the authored transform,\r\n // pivot and grab rectangle used by both editor gizmos and runtime interaction.\r\n super.addChild(this.layoutContent);\r\n }\r\n\r\n get layoutTarget(): Container { return this.layoutContent; }\r\n\r\n addLayoutChild<T extends Container[]>(...children: T): T[0] {\r\n return this.layoutContent.addChild(...children);\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"horizontal-layout\" && node.type !== \"vertical-layout\" && node.type !== \"grid-layout\") return;\r\n const texture = node.backgroundAssetId === undefined ? undefined : this.textureFor(node.backgroundAssetId);\r\n if (texture === undefined) {\r\n if (this.background !== undefined) { super.removeChild(this.background); this.background.destroy(); this.background = undefined; }\r\n return;\r\n }\r\n if (this.background === undefined) { this.background = new Sprite(texture); super.addChildAt(this.background, 0); }\r\n else if (this.background.texture !== texture) this.background.texture = texture;\r\n this.background.setSize(transform.width, transform.height);\r\n }\r\n}\r\n\r\n/**\r\n * Ноде-картинке источник не обязателен: без `assetId` она рисует белый прямоугольник своего размера,\r\n * а серо-синяя заглушка остаётся признаком того, что назначенный ассет не загрузился.\r\n *\r\n * `nineSlice` переключает контент на `NineSliceSprite`: углы источника остаются нерастянутыми, а\r\n * растягиваются только края/середина — то же 9-slice, что уже использует Slider/ProgressBar через\r\n * `@pixi/ui`'s `fillPaddings`, только здесь это применяется напрямую к содержимому Image-ноды.\r\n */\r\nexport class ImageNodeView extends NodeView {\r\n constructor(assetId: string | undefined, textures: ReadonlyMap<string, Texture> | undefined, nineSlice?: LayoutPadding) {\r\n super(textures);\r\n const texture = assetId === undefined ? undefined : this.textureFor(assetId);\r\n this.setContent(ImageNodeView.createSpriteContent(texture, nineSlice));\r\n }\r\n\r\n private static createSpriteContent(texture: Texture | undefined, nineSlice: LayoutPadding | undefined): Container {\r\n if (texture === undefined) return new Graphics();\r\n return nineSlice === undefined\r\n ? new Sprite(texture)\r\n : new NineSliceSprite({ texture, leftWidth: nineSlice.left, topHeight: nineSlice.top, rightWidth: nineSlice.right, bottomHeight: nineSlice.bottom });\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"image\") return;\r\n const texture = node.assetId === undefined ? undefined : this.textureFor(node.assetId);\r\n const nineSlice = node.nineSlice;\r\n // Sprite ↔ NineSliceSprite ↔ Graphics меняются местами прямо здесь: структурный ключ сцены не\r\n // включает assetId/nineSlice, поэтому переключение (в том числе на None) не пересобирает сцену.\r\n if (texture !== undefined && nineSlice !== undefined) {\r\n if (!(this.content instanceof NineSliceSprite)) this.setContent(ImageNodeView.createSpriteContent(texture, nineSlice));\r\n const sprite = this.content as NineSliceSprite;\r\n // Keep the NineSliceSprite and its layout rectangle stable when its image asset/borders change.\r\n if (sprite.texture !== texture) sprite.texture = texture;\r\n sprite.leftWidth = nineSlice.left;\r\n sprite.topHeight = nineSlice.top;\r\n sprite.rightWidth = nineSlice.right;\r\n sprite.bottomHeight = nineSlice.bottom;\r\n sprite.setSize(transform.width, transform.height);\r\n } else if (texture !== undefined) {\r\n // `NineSliceSprite` is a Sprite sibling, not a subclass, so this rebuilds when switching back from it.\r\n if (!(this.content instanceof Sprite)) this.setContent(new Sprite(texture));\r\n const sprite = this.content as Sprite;\r\n // Keep the Sprite and its layout rectangle stable when its image asset changes.\r\n if (sprite.texture !== texture) sprite.texture = texture;\r\n sprite.setSize(transform.width, transform.height);\r\n } else {\r\n if (!(this.content instanceof Graphics)) this.setContent(new Graphics());\r\n const graphics = (this.content as Graphics).clear().rect(0, 0, transform.width, transform.height);\r\n if (node.assetId === undefined) graphics.fill(node.tint ?? 0xffffff);\r\n else graphics.fill(0x4a5568).stroke({ width: 1, color: 0x94a3b8 });\r\n }\r\n this.content!.alpha = node.opacity ?? 1;\r\n if (this.content instanceof Sprite || this.content instanceof NineSliceSprite) this.content.tint = node.tint ?? 0xffffff;\r\n }\r\n\r\n /**\r\n * Editor-only live preview of border edits while dragging the canvas nine-slice gizmo; the\r\n * document is only written once, on drag release. A no-op without a `NineSliceSprite` content —\r\n * e.g. mid-drag right after the asset was cleared, before the next document sync catches up.\r\n */\r\n previewNineSlice(nineSlice: LayoutPadding): void {\r\n if (!(this.content instanceof NineSliceSprite)) return;\r\n this.content.leftWidth = nineSlice.left;\r\n this.content.topHeight = nineSlice.top;\r\n this.content.rightWidth = nineSlice.right;\r\n this.content.bottomHeight = nineSlice.bottom;\r\n }\r\n\r\n}\r\n\r\nexport class TextNodeView extends NodeView {\r\n /**\r\n * Строка, применённая локализацией поверх авторской. Она переживает `updateNodeView`: без неё\r\n * любая синхронизация документа возвращала бы fallback `node.text` вместо текущего перевода.\r\n */\r\n private localizedText?: string;\r\n /** Последний применённый прямоугольник и стиль — их же переиспользует инкрементальный `setText`. */\r\n private lastTransform?: UINode[\"transform\"];\r\n private lastStyle?: TextStyleDefinition;\r\n\r\n constructor(text: string, private readonly fonts?: ReadonlyMap<string, string>) {\r\n super();\r\n this.setContent(new Text({ text, style: { fontFamily: \"Arial\", fontSize: 24, fill: 0xffffff } }));\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"], profile: LayoutProfileId): void {\r\n if (node.type !== \"text\" || !(this.content instanceof Text)) return;\r\n const text = this.localizedText ?? node.text;\r\n if (this.content.text !== text) this.content.text = text;\r\n const style = resolveTextStyle(node, profile);\r\n this.lastTransform = transform;\r\n this.lastStyle = style;\r\n if (style === undefined) return;\r\n this.applyFittedStyle(this.content, node, style, transform);\r\n this.align();\r\n }\r\n\r\n /**\r\n * Applies the resolved style at the largest font size (down to `minFontSize`) that keeps the\r\n * rendered text inside `transform`, when `autoSize` is on — the same \"shrink, never grow past the\r\n * authored size\" contract as `BitmapTextNodeView.applyFittedStyle` / Unity legacy Text's Best Fit.\r\n * A binary search over candidate sizes rather than a closed-form scale, because word-wrapped text\r\n * re-flows at every size: a smaller font fits more words per line, so height doesn't shrink linearly\r\n * with font size the way unwrapped bounds would — the same reasoning `measureOverflow` follows.\r\n */\r\n private applyFittedStyle(text: Text, node: TextNode, style: TextStyleDefinition, transform: UINode[\"transform\"]): void {\r\n const baseStyle = { fontFamily: style.fontAssetId === undefined ? style.fontFamily : this.fonts?.get(style.fontAssetId) ?? style.fontFamily, fontWeight: style.fontWeight, fontStyle: style.fontStyle, fill: style.fill, align: style.align, wordWrap: style.wordWrap, breakWords: style.breakWords, wordWrapWidth: transform.width, lineHeight: style.lineHeight, letterSpacing: style.letterSpacing, stroke: style.stroke === undefined ? undefined : { color: style.stroke.color, width: style.stroke.width } };\r\n const fits = (fontSize: number): boolean => {\r\n text.style = { ...baseStyle, fontSize };\r\n // Headless loaders and schema tests have no browser canvas to measure against; they keep the\r\n // authored fontSize, same boundary `align()` already respects.\r\n if (typeof globalThis.document === \"undefined\") return true;\r\n const bounds = text.getLocalBounds();\r\n const tolerance = 0.5;\r\n return style.wordWrap\r\n ? bounds.height <= transform.height + tolerance\r\n : bounds.width <= transform.width + tolerance && bounds.height <= transform.height + tolerance;\r\n };\r\n // Always runs at least once, applying `baseStyle` at the authored size as a side effect — not\r\n // just the shrink-check's fast path. Written as `||` short-circuit, `fits(style.fontSize)` would\r\n // never execute while `autoSize` is off, leaving `text.style` frozen at whatever the constructor\r\n // set it to and silently dropping every later font/color/align/wrap edit (see the identical fix\r\n // in `BitmapTextNodeView.applyFittedStyle`).\r\n const fitsAtAuthoredSize = fits(style.fontSize);\r\n if (node.autoSize !== true || fitsAtAuthoredSize) return;\r\n const minFontSize = Math.min(node.minFontSize ?? 1, style.fontSize);\r\n if (!fits(minFontSize)) return; // Best effort: even the floor overflows, so it stays at the floor.\r\n let lo = minFontSize, hi = style.fontSize;\r\n for (let i = 0; i < 8; i++) {\r\n const mid = (lo + hi) / 2;\r\n if (fits(mid)) lo = mid; else hi = mid;\r\n }\r\n fits(lo); // Leaves `text.style` applied at the converged, fitting size.\r\n }\r\n\r\n /**\r\n * Инкрементальная смена строки: та же строка не делает работы вообще, новая — только переизмеряет\r\n * и выравнивает текст в текущем authored rectangle. `TextStyle` не пересоздаётся, а сам view\r\n * сохраняет identity, поэтому смена локали не трогает ни сцену, ни GPU-ресурсы стиля.\r\n */\r\n setText(text: string): void {\r\n if (!(this.content instanceof Text) || this.content.text === text) return;\r\n this.content.text = text;\r\n this.align();\r\n }\r\n\r\n /** `undefined` возвращает ноду к авторской строке при следующей синхронизации документа. */\r\n setLocalizedText(text: string | undefined): void {\r\n this.localizedText = text;\r\n if (text !== undefined) this.setText(text);\r\n }\r\n\r\n /**\r\n * Rasterizes the canvas-based `Text` at a higher pixel density than the renderer's own backing\r\n * resolution, so authoring-camera zoom doesn't magnify an already-rasterized bitmap past its\r\n * source resolution. `Application.resolution` (see `resolveCanvasResolution`) only matches the\r\n * *display's* pixel density — it knows nothing about the editor's independent camera zoom, which\r\n * can reach 8x (`MAX_ZOOM`). Without this, zooming in to inspect a text node (exactly what\r\n * `autoSize`/shrink-to-fit users do, since it converges to a smaller font) reads as soft/blurred\r\n * even on a display this app already renders crisply on. A no-op if unchanged: assigning\r\n * `.resolution` always re-rasterizes, so skip it when the caller (the authoring canvas, on every\r\n * camera-zoom tick) passes back the same value.\r\n */\r\n setContentResolution(resolution: number): void {\r\n if (!(this.content instanceof Text) || this.content.resolution === resolution) return;\r\n this.content.resolution = resolution;\r\n }\r\n\r\n /**\r\n * Вылезает ли фактически отрисованный текст за логический прямоугольник ноды.\r\n *\r\n * Меряется уже готовый `Text`, а не длина строки: перенос по словам, шрифт и обводка известны\r\n * только рендеру. Без `wordWrap` переполнение возможно по ширине, с ним — по высоте, потому что\r\n * перенос сам удерживает ширину в пределах `wordWrapWidth`. Диагностика transient: она ничего не\r\n * пишет ни в документ, ни в view.\r\n */\r\n measureOverflow(): boolean {\r\n const transform = this.lastTransform;\r\n if (!(this.content instanceof Text) || transform === undefined || typeof globalThis.document === \"undefined\") return false;\r\n const bounds = this.content.getLocalBounds();\r\n const tolerance = 0.5;\r\n return this.lastStyle?.wordWrap === true\r\n ? bounds.height > transform.height + tolerance\r\n : bounds.width > transform.width + tolerance || bounds.height > transform.height + tolerance;\r\n }\r\n\r\n private align(): void {\r\n const transform = this.lastTransform;\r\n const style = this.lastStyle;\r\n if (!(this.content instanceof Text) || transform === undefined || style === undefined) return;\r\n // Headless loaders and schema tests intentionally have no browser canvas. In that boundary\r\n // text still owns its authored rectangle; browser rendering keeps the precise measurement.\r\n const bounds = typeof globalThis.document === \"undefined\" ? { x: 0, y: 0, width: 0, height: 0 } : this.content.getLocalBounds();\r\n this.content.x = style.align === \"center\" ? (transform.width - bounds.width) / 2 - bounds.x : style.align === \"right\" ? transform.width - bounds.width - bounds.x : -bounds.x;\r\n this.content.y = style.verticalAlign === \"middle\" ? (transform.height - bounds.height) / 2 - bounds.y : style.verticalAlign === \"bottom\" ? transform.height - bounds.height - bounds.y : -bounds.y;\r\n }\r\n}\r\n\r\n/**\r\n * A bitmap font's rendered glyphs come from its texture, not an arbitrary system/TTF face, so unlike\r\n * `TextNodeView` there is no style-driven fallback: without a loaded font (asset deleted, still\r\n * loading, or failed to parse) this draws the same missing-asset placeholder `ImageNodeView` does.\r\n */\r\nexport class BitmapTextNodeView extends NodeView {\r\n private lastTransform?: UINode[\"transform\"];\r\n private lastAlign: \"left\" | \"center\" | \"right\" = \"left\";\r\n private lastVerticalAlign: \"top\" | \"middle\" | \"bottom\" = \"top\";\r\n\r\n constructor(private readonly fonts?: ReadonlyMap<string, string>) {\r\n super();\r\n this.setContent(new Graphics());\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"bitmap-text\") return;\r\n this.lastTransform = transform;\r\n this.lastAlign = node.align;\r\n this.lastVerticalAlign = node.verticalAlign;\r\n const family = this.fonts?.get(node.assetId);\r\n if (family === undefined) {\r\n if (!(this.content instanceof Graphics)) this.setContent(new Graphics());\r\n (this.content as Graphics).clear().rect(0, 0, transform.width, transform.height).fill(0x4a5568).stroke({ width: 1, color: 0x94a3b8 });\r\n return;\r\n }\r\n if (!(this.content instanceof BitmapText)) this.setContent(new BitmapText({ text: node.text, style: { fontFamily: family, fontSize: node.fontSize, fill: node.fill } }));\r\n const bitmapText = this.content as BitmapText;\r\n if (bitmapText.text !== node.text) bitmapText.text = node.text;\r\n this.applyFittedStyle(bitmapText, node, family, transform);\r\n this.align();\r\n }\r\n\r\n /**\r\n * Updates the rendered bitmap text without reapplying the node transform. This lets game code\r\n * refresh counters that are temporarily attached to a Spine connector without dislodging them.\r\n */\r\n setText(text: string): void {\r\n if (!(this.content instanceof BitmapText) || this.content.text === text) return;\r\n this.content.text = text;\r\n this.align();\r\n }\r\n\r\n /**\r\n * Applies the node's style at the largest font size (down to `minFontSize`) that keeps the text\r\n * inside `transform`, when `autoSize` is on — the same \"shrink, never grow past the authored size\"\r\n * contract as Unity legacy Text's Best Fit. A binary search over candidate sizes rather than a\r\n * closed-form scale, because word-wrapped text re-flows at every size: a smaller font can fit more\r\n * words per line, so height doesn't shrink linearly with font size the way unwrapped bounds would.\r\n */\r\n private applyFittedStyle(bitmapText: BitmapText, node: BitmapTextNode, family: string, transform: UINode[\"transform\"]): void {\r\n const baseStyle = { fontFamily: family, fill: node.fill, align: node.align, letterSpacing: node.letterSpacing, wordWrap: node.wordWrap, wordWrapWidth: transform.width };\r\n const fits = (fontSize: number): boolean => {\r\n bitmapText.style = { ...baseStyle, fontSize };\r\n // Headless loaders and schema tests have no browser canvas to measure against; they keep the\r\n // authored fontSize, same boundary `align()` already respects.\r\n if (typeof globalThis.document === \"undefined\") return true;\r\n const bounds = bitmapText.getLocalBounds();\r\n const tolerance = 0.5;\r\n return node.wordWrap\r\n ? bounds.height <= transform.height + tolerance\r\n : bounds.width <= transform.width + tolerance && bounds.height <= transform.height + tolerance;\r\n };\r\n // Always runs at least once, applying `baseStyle` at the authored size as a side effect — not\r\n // just the shrink-check's fast path. Written as `||` short-circuit, `fits(node.fontSize)` would\r\n // never execute while `autoSize` is off, leaving `bitmapText.style` frozen at whatever the\r\n // constructor set it to and silently dropping every later fill/align/letterSpacing/wordWrap edit.\r\n const fitsAtAuthoredSize = fits(node.fontSize);\r\n if (node.autoSize !== true || fitsAtAuthoredSize) return;\r\n const minFontSize = Math.min(node.minFontSize ?? 1, node.fontSize);\r\n if (!fits(minFontSize)) return; // Best effort: even the floor overflows, so it stays at the floor.\r\n let lo = minFontSize, hi = node.fontSize;\r\n for (let i = 0; i < 8; i++) {\r\n const mid = (lo + hi) / 2;\r\n if (fits(mid)) lo = mid; else hi = mid;\r\n }\r\n fits(lo); // Leaves `bitmapText.style` applied at the converged, fitting size.\r\n }\r\n\r\n /**\r\n * Positions via PixiJS's own `anchor`, not a manual `getLocalBounds()` computation like\r\n * `TextNodeView.align()` uses: `BitmapText.updateBounds()` reports a coarse line-metrics box\r\n * (built from the font's `lineHeight`/`baseLineOffset`), not the tight pixel bounds a canvas\r\n * `Text` or `Sprite` reports. Its own glyphs are drawn with an additional baseline-derived offset\r\n * that box doesn't account for, so computing `-bounds.y`-style positions from it lands text\r\n * slightly (but consistently, for every vertical setting) off — `anchor` is the one code path\r\n * PixiJS keeps in sync with how it actually renders the glyphs.\r\n */\r\n private align(): void {\r\n const transform = this.lastTransform;\r\n if (!(this.content instanceof BitmapText) || transform === undefined) return;\r\n const anchorX = this.lastAlign === \"center\" ? 0.5 : this.lastAlign === \"right\" ? 1 : 0;\r\n const anchorY = this.lastVerticalAlign === \"middle\" ? 0.5 : this.lastVerticalAlign === \"bottom\" ? 1 : 0;\r\n this.content.anchor.set(anchorX, anchorY);\r\n this.content.x = anchorX * transform.width;\r\n this.content.y = anchorY * transform.height;\r\n }\r\n}\r\n\r\n/**\r\n * Содержимое инстанса приходит обычными детьми из общего резолвера иерархии. Собственный контент\r\n * нужен только как заметная заглушка, когда определение пресета отсутствует в документе.\r\n */\r\nexport class PrefabInstanceNodeView extends NodeView {\r\n constructor(resolved: boolean) {\r\n super();\r\n if (!resolved) this.setContent(new Graphics());\r\n }\r\n\r\n protected syncContent(_node: UINode, transform: UINode[\"transform\"]): void {\r\n if (this.content instanceof Graphics) this.content.clear().rect(0, 0, transform.width, transform.height).fill(0xff00ff);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"basic.js","sourceRoot":"","sources":["../../src/views/basic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAW,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,OAAO,iBAAkB,SAAQ,QAAQ;IACnC,WAAW,KAAU,CAAC;CACjC;AAED,iFAAiF;AACjF,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACvB,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;IAE5C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9B,mGAAmG;QACnG,yGAAyG;QACzG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;IAES,WAAW,CAAC,IAAY,EAAE,SAA8B;QAChE,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO;QACjC,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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvF,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC;IAC9C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,QAAQ;IAClD,YAAY,QAAiB;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,UAAU,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAES,WAAW,CAAC,KAAa,EAAE,SAA8B;QACjE,IAAI,IAAI,CAAC,OAAO,YAAY,QAAQ;YAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1H,CAAC;CACF","sourcesContent":["import { type BitmapTextNode, type LayoutPadding, type LayoutProfileId, type TextNode, type TextStyleDefinition, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { BitmapText, Container, Graphics, NineSliceSprite, Sprite, Text, Texture } from \"pixi.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\nimport { resolveTextStyle } from \"../layout.js\";\r\n\r\nexport class ContainerNodeView extends NodeView {\r\n protected syncContent(): void {}\r\n}\r\n\r\n/** Clips every authored child to the node's resolved rectangular layout area. */\r\nexport class MaskNodeView extends NodeView {\r\n private readonly maskShape = new Graphics();\r\n\r\n constructor() {\r\n super();\r\n this.addChild(this.maskShape);\r\n // A Graphics mask keeps the shape GPU-native and avoids the offscreen texture pass of alpha masks.\r\n // Pixi's regular mask contract also preserves correct clipping through rotation and transformed parents.\r\n this.mask = this.maskShape;\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"mask\") return;\r\n this.maskShape.clear().rect(0, 0, transform.width, transform.height).fill(0xffffff);\r\n }\r\n}\r\n\r\n/**\r\n * Multiplies one opacity into its whole child subtree, the same contract as Unity's `CanvasGroup.alpha`:\r\n * PixiJS already folds a container's `alpha` into every descendant's `worldAlpha`, so this costs one\r\n * multiply per object in a traversal that happens anyway — no offscreen render pass, and a fade over an\r\n * arbitrarily large subtree stays a single number written once per frame. Overlapping children therefore\r\n * show through each other at intermediate values, exactly as they do under a Unity `CanvasGroup`; true\r\n * flattened group opacity would need an `AlphaFilter` and its per-frame render texture, which is\r\n * deliberately not what this node is for.\r\n *\r\n * At zero opacity a runtime scene also stops rendering and hit-testing the subtree outright — the\r\n * `blocksRaycasts` half of `CanvasGroup`, without which a fully faded-out screen keeps eating the\r\n * pointer input of the one faded in over it. Both are skipped while authoring: `eventMode = \"none\"` on\r\n * the view itself would drop the node and its children out of editor selection, and hit testing stays\r\n * `NodeView`'s responsibility.\r\n */\r\nexport class OpacityGroupNodeView extends NodeView {\r\n private readonly interaction: SceneInteractionMode;\r\n /** Transient runtime override; `undefined` keeps the authored `opacity` from the document. */\r\n private runtimeOpacity?: number;\r\n private authoredOpacity = 1;\r\n\r\n constructor(interaction: SceneInteractionMode) {\r\n super();\r\n this.interaction = interaction;\r\n }\r\n\r\n /** Drives a fade from game code without touching the document; `undefined` restores the authored value. */\r\n setOpacity(opacity: number | undefined): void {\r\n this.runtimeOpacity = opacity === undefined ? undefined : Math.min(1, Math.max(0, opacity));\r\n this.applyOpacity(this.runtimeOpacity ?? this.authoredOpacity);\r\n }\r\n\r\n private applyOpacity(opacity: number): void {\r\n this.alpha = opacity;\r\n if (this.interaction === \"authoring\") return;\r\n const hidden = opacity <= 0;\r\n this.renderable = !hidden;\r\n this.eventMode = hidden ? \"none\" : \"passive\";\r\n }\r\n\r\n protected syncContent(node: UINode): void {\r\n if (node.type !== \"opacity-group\") return;\r\n this.authoredOpacity = node.opacity;\r\n this.applyOpacity(this.runtimeOpacity ?? this.authoredOpacity);\r\n }\r\n}\r\n\r\n/** Layout groups may optionally paint one image behind their managed children. No asset means no content/view at all. */\r\nexport class LayoutGroupNodeView extends NodeView {\r\n private readonly layoutContent = new Container();\r\n private background?: Sprite;\r\n\r\n constructor(textures: ReadonlyMap<string, Texture> | undefined) {\r\n super(textures);\r\n // Yoga owns this inner container only. The NodeView itself retains the authored transform,\r\n // pivot and grab rectangle used by both editor gizmos and runtime interaction.\r\n super.addChild(this.layoutContent);\r\n }\r\n\r\n get layoutTarget(): Container { return this.layoutContent; }\r\n\r\n addLayoutChild<T extends Container[]>(...children: T): T[0] {\r\n return this.layoutContent.addChild(...children);\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"horizontal-layout\" && node.type !== \"vertical-layout\" && node.type !== \"grid-layout\") return;\r\n const texture = node.backgroundAssetId === undefined ? undefined : this.textureFor(node.backgroundAssetId);\r\n if (texture === undefined) {\r\n if (this.background !== undefined) { super.removeChild(this.background); this.background.destroy(); this.background = undefined; }\r\n return;\r\n }\r\n if (this.background === undefined) { this.background = new Sprite(texture); super.addChildAt(this.background, 0); }\r\n else if (this.background.texture !== texture) this.background.texture = texture;\r\n this.background.setSize(transform.width, transform.height);\r\n }\r\n}\r\n\r\n/**\r\n * Ноде-картинке источник не обязателен: без `assetId` она рисует белый прямоугольник своего размера,\r\n * а серо-синяя заглушка остаётся признаком того, что назначенный ассет не загрузился.\r\n *\r\n * `nineSlice` переключает контент на `NineSliceSprite`: углы источника остаются нерастянутыми, а\r\n * растягиваются только края/середина — то же 9-slice, что уже использует Slider/ProgressBar через\r\n * `@pixi/ui`'s `fillPaddings`, только здесь это применяется напрямую к содержимому Image-ноды.\r\n */\r\nexport class ImageNodeView extends NodeView {\r\n constructor(assetId: string | undefined, textures: ReadonlyMap<string, Texture> | undefined, nineSlice?: LayoutPadding) {\r\n super(textures);\r\n const texture = assetId === undefined ? undefined : this.textureFor(assetId);\r\n this.setContent(ImageNodeView.createSpriteContent(texture, nineSlice));\r\n }\r\n\r\n private static createSpriteContent(texture: Texture | undefined, nineSlice: LayoutPadding | undefined): Container {\r\n if (texture === undefined) return new Graphics();\r\n return nineSlice === undefined\r\n ? new Sprite(texture)\r\n : new NineSliceSprite({ texture, leftWidth: nineSlice.left, topHeight: nineSlice.top, rightWidth: nineSlice.right, bottomHeight: nineSlice.bottom });\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"image\") return;\r\n const texture = node.assetId === undefined ? undefined : this.textureFor(node.assetId);\r\n const nineSlice = node.nineSlice;\r\n // Sprite ↔ NineSliceSprite ↔ Graphics меняются местами прямо здесь: структурный ключ сцены не\r\n // включает assetId/nineSlice, поэтому переключение (в том числе на None) не пересобирает сцену.\r\n if (texture !== undefined && nineSlice !== undefined) {\r\n if (!(this.content instanceof NineSliceSprite)) this.setContent(ImageNodeView.createSpriteContent(texture, nineSlice));\r\n const sprite = this.content as NineSliceSprite;\r\n // Keep the NineSliceSprite and its layout rectangle stable when its image asset/borders change.\r\n if (sprite.texture !== texture) sprite.texture = texture;\r\n sprite.leftWidth = nineSlice.left;\r\n sprite.topHeight = nineSlice.top;\r\n sprite.rightWidth = nineSlice.right;\r\n sprite.bottomHeight = nineSlice.bottom;\r\n sprite.setSize(transform.width, transform.height);\r\n } else if (texture !== undefined) {\r\n // `NineSliceSprite` is a Sprite sibling, not a subclass, so this rebuilds when switching back from it.\r\n if (!(this.content instanceof Sprite)) this.setContent(new Sprite(texture));\r\n const sprite = this.content as Sprite;\r\n // Keep the Sprite and its layout rectangle stable when its image asset changes.\r\n if (sprite.texture !== texture) sprite.texture = texture;\r\n sprite.setSize(transform.width, transform.height);\r\n } else {\r\n if (!(this.content instanceof Graphics)) this.setContent(new Graphics());\r\n const graphics = (this.content as Graphics).clear().rect(0, 0, transform.width, transform.height);\r\n if (node.assetId === undefined) graphics.fill(node.tint ?? 0xffffff);\r\n else graphics.fill(0x4a5568).stroke({ width: 1, color: 0x94a3b8 });\r\n }\r\n this.content!.alpha = node.opacity ?? 1;\r\n if (this.content instanceof Sprite || this.content instanceof NineSliceSprite) this.content.tint = node.tint ?? 0xffffff;\r\n }\r\n\r\n /**\r\n * Editor-only live preview of border edits while dragging the canvas nine-slice gizmo; the\r\n * document is only written once, on drag release. A no-op without a `NineSliceSprite` content —\r\n * e.g. mid-drag right after the asset was cleared, before the next document sync catches up.\r\n */\r\n previewNineSlice(nineSlice: LayoutPadding): void {\r\n if (!(this.content instanceof NineSliceSprite)) return;\r\n this.content.leftWidth = nineSlice.left;\r\n this.content.topHeight = nineSlice.top;\r\n this.content.rightWidth = nineSlice.right;\r\n this.content.bottomHeight = nineSlice.bottom;\r\n }\r\n\r\n}\r\n\r\nexport class TextNodeView extends NodeView {\r\n /**\r\n * Строка, применённая локализацией поверх авторской. Она переживает `updateNodeView`: без неё\r\n * любая синхронизация документа возвращала бы fallback `node.text` вместо текущего перевода.\r\n */\r\n private localizedText?: string;\r\n /** Последний применённый прямоугольник и стиль — их же переиспользует инкрементальный `setText`. */\r\n private lastTransform?: UINode[\"transform\"];\r\n private lastStyle?: TextStyleDefinition;\r\n\r\n constructor(text: string, private readonly fonts?: ReadonlyMap<string, string>) {\r\n super();\r\n this.setContent(new Text({ text, style: { fontFamily: \"Arial\", fontSize: 24, fill: 0xffffff } }));\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"], profile: LayoutProfileId): void {\r\n if (node.type !== \"text\" || !(this.content instanceof Text)) return;\r\n const text = this.localizedText ?? node.text;\r\n if (this.content.text !== text) this.content.text = text;\r\n const style = resolveTextStyle(node, profile);\r\n this.lastTransform = transform;\r\n this.lastStyle = style;\r\n if (style === undefined) return;\r\n this.applyFittedStyle(this.content, node, style, transform);\r\n this.align();\r\n }\r\n\r\n /**\r\n * Applies the resolved style at the largest font size (down to `minFontSize`) that keeps the\r\n * rendered text inside `transform`, when `autoSize` is on — the same \"shrink, never grow past the\r\n * authored size\" contract as `BitmapTextNodeView.applyFittedStyle` / Unity legacy Text's Best Fit.\r\n * A binary search over candidate sizes rather than a closed-form scale, because word-wrapped text\r\n * re-flows at every size: a smaller font fits more words per line, so height doesn't shrink linearly\r\n * with font size the way unwrapped bounds would — the same reasoning `measureOverflow` follows.\r\n */\r\n private applyFittedStyle(text: Text, node: TextNode, style: TextStyleDefinition, transform: UINode[\"transform\"]): void {\r\n const baseStyle = { fontFamily: style.fontAssetId === undefined ? style.fontFamily : this.fonts?.get(style.fontAssetId) ?? style.fontFamily, fontWeight: style.fontWeight, fontStyle: style.fontStyle, fill: style.fill, align: style.align, wordWrap: style.wordWrap, breakWords: style.breakWords, wordWrapWidth: transform.width, lineHeight: style.lineHeight, letterSpacing: style.letterSpacing, stroke: style.stroke === undefined ? undefined : { color: style.stroke.color, width: style.stroke.width } };\r\n const fits = (fontSize: number): boolean => {\r\n text.style = { ...baseStyle, fontSize };\r\n // Headless loaders and schema tests have no browser canvas to measure against; they keep the\r\n // authored fontSize, same boundary `align()` already respects.\r\n if (typeof globalThis.document === \"undefined\") return true;\r\n const bounds = text.getLocalBounds();\r\n const tolerance = 0.5;\r\n return style.wordWrap\r\n ? bounds.height <= transform.height + tolerance\r\n : bounds.width <= transform.width + tolerance && bounds.height <= transform.height + tolerance;\r\n };\r\n // Always runs at least once, applying `baseStyle` at the authored size as a side effect — not\r\n // just the shrink-check's fast path. Written as `||` short-circuit, `fits(style.fontSize)` would\r\n // never execute while `autoSize` is off, leaving `text.style` frozen at whatever the constructor\r\n // set it to and silently dropping every later font/color/align/wrap edit (see the identical fix\r\n // in `BitmapTextNodeView.applyFittedStyle`).\r\n const fitsAtAuthoredSize = fits(style.fontSize);\r\n if (node.autoSize !== true || fitsAtAuthoredSize) return;\r\n const minFontSize = Math.min(node.minFontSize ?? 1, style.fontSize);\r\n if (!fits(minFontSize)) return; // Best effort: even the floor overflows, so it stays at the floor.\r\n let lo = minFontSize, hi = style.fontSize;\r\n for (let i = 0; i < 8; i++) {\r\n const mid = (lo + hi) / 2;\r\n if (fits(mid)) lo = mid; else hi = mid;\r\n }\r\n fits(lo); // Leaves `text.style` applied at the converged, fitting size.\r\n }\r\n\r\n /**\r\n * Инкрементальная смена строки: та же строка не делает работы вообще, новая — только переизмеряет\r\n * и выравнивает текст в текущем authored rectangle. `TextStyle` не пересоздаётся, а сам view\r\n * сохраняет identity, поэтому смена локали не трогает ни сцену, ни GPU-ресурсы стиля.\r\n */\r\n setText(text: string): void {\r\n if (!(this.content instanceof Text) || this.content.text === text) return;\r\n this.content.text = text;\r\n this.align();\r\n }\r\n\r\n /** `undefined` возвращает ноду к авторской строке при следующей синхронизации документа. */\r\n setLocalizedText(text: string | undefined): void {\r\n this.localizedText = text;\r\n if (text !== undefined) this.setText(text);\r\n }\r\n\r\n /**\r\n * Rasterizes the canvas-based `Text` at a higher pixel density than the renderer's own backing\r\n * resolution, so authoring-camera zoom doesn't magnify an already-rasterized bitmap past its\r\n * source resolution. `Application.resolution` (see `resolveCanvasResolution`) only matches the\r\n * *display's* pixel density — it knows nothing about the editor's independent camera zoom, which\r\n * can reach 8x (`MAX_ZOOM`). Without this, zooming in to inspect a text node (exactly what\r\n * `autoSize`/shrink-to-fit users do, since it converges to a smaller font) reads as soft/blurred\r\n * even on a display this app already renders crisply on. A no-op if unchanged: assigning\r\n * `.resolution` always re-rasterizes, so skip it when the caller (the authoring canvas, on every\r\n * camera-zoom tick) passes back the same value.\r\n */\r\n setContentResolution(resolution: number): void {\r\n if (!(this.content instanceof Text) || this.content.resolution === resolution) return;\r\n this.content.resolution = resolution;\r\n }\r\n\r\n /**\r\n * Вылезает ли фактически отрисованный текст за логический прямоугольник ноды.\r\n *\r\n * Меряется уже готовый `Text`, а не длина строки: перенос по словам, шрифт и обводка известны\r\n * только рендеру. Без `wordWrap` переполнение возможно по ширине, с ним — по высоте, потому что\r\n * перенос сам удерживает ширину в пределах `wordWrapWidth`. Диагностика transient: она ничего не\r\n * пишет ни в документ, ни в view.\r\n */\r\n measureOverflow(): boolean {\r\n const transform = this.lastTransform;\r\n if (!(this.content instanceof Text) || transform === undefined || typeof globalThis.document === \"undefined\") return false;\r\n const bounds = this.content.getLocalBounds();\r\n const tolerance = 0.5;\r\n return this.lastStyle?.wordWrap === true\r\n ? bounds.height > transform.height + tolerance\r\n : bounds.width > transform.width + tolerance || bounds.height > transform.height + tolerance;\r\n }\r\n\r\n private align(): void {\r\n const transform = this.lastTransform;\r\n const style = this.lastStyle;\r\n if (!(this.content instanceof Text) || transform === undefined || style === undefined) return;\r\n // Headless loaders and schema tests intentionally have no browser canvas. In that boundary\r\n // text still owns its authored rectangle; browser rendering keeps the precise measurement.\r\n const bounds = typeof globalThis.document === \"undefined\" ? { x: 0, y: 0, width: 0, height: 0 } : this.content.getLocalBounds();\r\n this.content.x = style.align === \"center\" ? (transform.width - bounds.width) / 2 - bounds.x : style.align === \"right\" ? transform.width - bounds.width - bounds.x : -bounds.x;\r\n this.content.y = style.verticalAlign === \"middle\" ? (transform.height - bounds.height) / 2 - bounds.y : style.verticalAlign === \"bottom\" ? transform.height - bounds.height - bounds.y : -bounds.y;\r\n }\r\n}\r\n\r\n/**\r\n * A bitmap font's rendered glyphs come from its texture, not an arbitrary system/TTF face, so unlike\r\n * `TextNodeView` there is no style-driven fallback: without a loaded font (asset deleted, still\r\n * loading, or failed to parse) this draws the same missing-asset placeholder `ImageNodeView` does.\r\n */\r\nexport class BitmapTextNodeView extends NodeView {\r\n private lastTransform?: UINode[\"transform\"];\r\n private lastAlign: \"left\" | \"center\" | \"right\" = \"left\";\r\n private lastVerticalAlign: \"top\" | \"middle\" | \"bottom\" = \"top\";\r\n\r\n constructor(private readonly fonts?: ReadonlyMap<string, string>) {\r\n super();\r\n this.setContent(new Graphics());\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"]): void {\r\n if (node.type !== \"bitmap-text\") return;\r\n this.lastTransform = transform;\r\n this.lastAlign = node.align;\r\n this.lastVerticalAlign = node.verticalAlign;\r\n const family = this.fonts?.get(node.assetId);\r\n if (family === undefined) {\r\n if (!(this.content instanceof Graphics)) this.setContent(new Graphics());\r\n (this.content as Graphics).clear().rect(0, 0, transform.width, transform.height).fill(0x4a5568).stroke({ width: 1, color: 0x94a3b8 });\r\n return;\r\n }\r\n if (!(this.content instanceof BitmapText)) this.setContent(new BitmapText({ text: node.text, style: { fontFamily: family, fontSize: node.fontSize, fill: node.fill } }));\r\n const bitmapText = this.content as BitmapText;\r\n if (bitmapText.text !== node.text) bitmapText.text = node.text;\r\n this.applyFittedStyle(bitmapText, node, family, transform);\r\n this.align();\r\n }\r\n\r\n /**\r\n * Updates the rendered bitmap text without reapplying the node transform. This lets game code\r\n * refresh counters that are temporarily attached to a Spine connector without dislodging them.\r\n */\r\n setText(text: string): void {\r\n if (!(this.content instanceof BitmapText) || this.content.text === text) return;\r\n this.content.text = text;\r\n this.align();\r\n }\r\n\r\n /**\r\n * Applies the node's style at the largest font size (down to `minFontSize`) that keeps the text\r\n * inside `transform`, when `autoSize` is on — the same \"shrink, never grow past the authored size\"\r\n * contract as Unity legacy Text's Best Fit. A binary search over candidate sizes rather than a\r\n * closed-form scale, because word-wrapped text re-flows at every size: a smaller font can fit more\r\n * words per line, so height doesn't shrink linearly with font size the way unwrapped bounds would.\r\n */\r\n private applyFittedStyle(bitmapText: BitmapText, node: BitmapTextNode, family: string, transform: UINode[\"transform\"]): void {\r\n const baseStyle = { fontFamily: family, fill: node.fill, align: node.align, letterSpacing: node.letterSpacing, wordWrap: node.wordWrap, wordWrapWidth: transform.width };\r\n const fits = (fontSize: number): boolean => {\r\n bitmapText.style = { ...baseStyle, fontSize };\r\n // Headless loaders and schema tests have no browser canvas to measure against; they keep the\r\n // authored fontSize, same boundary `align()` already respects.\r\n if (typeof globalThis.document === \"undefined\") return true;\r\n const bounds = bitmapText.getLocalBounds();\r\n const tolerance = 0.5;\r\n return node.wordWrap\r\n ? bounds.height <= transform.height + tolerance\r\n : bounds.width <= transform.width + tolerance && bounds.height <= transform.height + tolerance;\r\n };\r\n // Always runs at least once, applying `baseStyle` at the authored size as a side effect — not\r\n // just the shrink-check's fast path. Written as `||` short-circuit, `fits(node.fontSize)` would\r\n // never execute while `autoSize` is off, leaving `bitmapText.style` frozen at whatever the\r\n // constructor set it to and silently dropping every later fill/align/letterSpacing/wordWrap edit.\r\n const fitsAtAuthoredSize = fits(node.fontSize);\r\n if (node.autoSize !== true || fitsAtAuthoredSize) return;\r\n const minFontSize = Math.min(node.minFontSize ?? 1, node.fontSize);\r\n if (!fits(minFontSize)) return; // Best effort: even the floor overflows, so it stays at the floor.\r\n let lo = minFontSize, hi = node.fontSize;\r\n for (let i = 0; i < 8; i++) {\r\n const mid = (lo + hi) / 2;\r\n if (fits(mid)) lo = mid; else hi = mid;\r\n }\r\n fits(lo); // Leaves `bitmapText.style` applied at the converged, fitting size.\r\n }\r\n\r\n /**\r\n * Positions via PixiJS's own `anchor`, not a manual `getLocalBounds()` computation like\r\n * `TextNodeView.align()` uses: `BitmapText.updateBounds()` reports a coarse line-metrics box\r\n * (built from the font's `lineHeight`/`baseLineOffset`), not the tight pixel bounds a canvas\r\n * `Text` or `Sprite` reports. Its own glyphs are drawn with an additional baseline-derived offset\r\n * that box doesn't account for, so computing `-bounds.y`-style positions from it lands text\r\n * slightly (but consistently, for every vertical setting) off — `anchor` is the one code path\r\n * PixiJS keeps in sync with how it actually renders the glyphs.\r\n */\r\n private align(): void {\r\n const transform = this.lastTransform;\r\n if (!(this.content instanceof BitmapText) || transform === undefined) return;\r\n const anchorX = this.lastAlign === \"center\" ? 0.5 : this.lastAlign === \"right\" ? 1 : 0;\r\n const anchorY = this.lastVerticalAlign === \"middle\" ? 0.5 : this.lastVerticalAlign === \"bottom\" ? 1 : 0;\r\n this.content.anchor.set(anchorX, anchorY);\r\n this.content.x = anchorX * transform.width;\r\n this.content.y = anchorY * transform.height;\r\n }\r\n}\r\n\r\n/**\r\n * Содержимое инстанса приходит обычными детьми из общего резолвера иерархии. Собственный контент\r\n * нужен только как заметная заглушка, когда определение пресета отсутствует в документе.\r\n */\r\nexport class PrefabInstanceNodeView extends NodeView {\r\n constructor(resolved: boolean) {\r\n super();\r\n if (!resolved) this.setContent(new Graphics());\r\n }\r\n\r\n protected syncContent(_node: UINode, transform: UINode[\"transform\"]): void {\r\n if (this.content instanceof Graphics) this.content.clear().rect(0, 0, transform.width, transform.height).fill(0xff00ff);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createNodeView.d.ts","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACtJ,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAa,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAK1D,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AASpE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,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E,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,wBAAwB,EAAE,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CA6C5a;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAmE1D"}
@@ -1,8 +1,9 @@
1
1
  import { BUTTON_STATE_KEYS, CHECKBOX_STATE_KEYS } from "@pixi-ui-editor/schema";
2
2
  import { ButtonNodeView } from "./ButtonNodeView.js";
3
3
  import { CheckboxNodeView } from "./CheckboxNodeView.js";
4
- import { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, PrefabInstanceNodeView, TextNodeView } from "./basic.js";
4
+ import { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, OpacityGroupNodeView, PrefabInstanceNodeView, TextNodeView } from "./basic.js";
5
5
  import { InputNodeView } from "./InputNodeView.js";
6
+ import { ItemTableNodeView } from "./ItemTableNodeView.js";
6
7
  import { PageGroupNodeView } from "./PageGroupNodeView.js";
7
8
  import { PaginationNodeView } from "./PaginationNodeView.js";
8
9
  import { ScrollViewNodeView } from "./ScrollViewNodeView.js";
@@ -20,6 +21,8 @@ export function createNodeView(node, interaction, textures, spines, hasPrefab, f
20
21
  return new ContainerNodeView();
21
22
  case "mask":
22
23
  return new MaskNodeView();
24
+ case "opacity-group":
25
+ return new OpacityGroupNodeView(interaction);
23
26
  case "horizontal-layout":
24
27
  case "vertical-layout":
25
28
  case "grid-layout":
@@ -28,6 +31,8 @@ export function createNodeView(node, interaction, textures, spines, hasPrefab, f
28
31
  return new ScrollViewNodeView(node, textures, interaction);
29
32
  case "page-group":
30
33
  return new PageGroupNodeView(node, textures);
34
+ case "item-table":
35
+ return new ItemTableNodeView();
31
36
  case "image":
32
37
  return new ImageNodeView(node.assetId, textures, node.nineSlice);
33
38
  case "text":
@@ -89,6 +94,8 @@ export function collectNodeAssetIds(node) {
89
94
  ];
90
95
  case "container":
91
96
  case "mask":
97
+ case "opacity-group":
98
+ case "item-table":
92
99
  case "prefab-instance":
93
100
  return [];
94
101
  case "horizontal-layout":
@@ -1 +1 @@
1
- {"version":3,"file":"createNodeView.js","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAwE,MAAM,wBAAwB,CAAC;AAItJ,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3J,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,WAAiC,EAAE,QAAuC,EAAE,MAA0C,EAAE,SAAyC,EAAE,KAAmC,EAAE,MAAmC,EAAE,MAAiC,EAAE,mBAAyC,EAAE,MAAe,EAAE,WAA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AC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAC9F,OAAO,GAAG,CAAC;QACb,CAAC;QACD,KAAK,cAAc;YACjB,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,KAAK,YAAY;YACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;QACrL,KAAK,kBAAkB;YACrB,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { BUTTON_STATE_KEYS, CHECKBOX_STATE_KEYS, type ParticleEffectDefinition, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport type { Sound } from \"@pixi/sound\";\r\nimport { Container, Texture, type Ticker } from \"pixi.js\";\r\nimport { ButtonNodeView } from \"./ButtonNodeView.js\";\r\nimport { CheckboxNodeView } from \"./CheckboxNodeView.js\";\r\nimport { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, PrefabInstanceNodeView, TextNodeView } from \"./basic.js\";\r\nimport { InputNodeView } from \"./InputNodeView.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\nimport { PageGroupNodeView } from \"./PageGroupNodeView.js\";\r\nimport { PaginationNodeView } from \"./PaginationNodeView.js\";\r\nimport { ScrollViewNodeView } from \"./ScrollViewNodeView.js\";\r\nimport { SpineNodeView } from \"./SpineNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./StagedButtonNodeView.js\";\r\nimport { ProgressBarNodeView, SliderNodeView } from \"./ValueControlNodeViews.js\";\r\nimport { ParticleEmitterNodeView } from \"./ParticleEmitterNodeView.js\";\r\n\r\n/**\r\n * `hasPrefab` только сообщает, существует ли определение пресета: содержимое инстанса приходит его\r\n * обычными детьми из общего резолвера иерархии, а не отдельной веткой сборки.\r\n */\r\nexport function createNodeView(node: UINode, interaction: SceneInteractionMode, textures?: ReadonlyMap<string, Texture>, spines?: ReadonlyMap<string, SkeletonData>, hasPrefab?: (prefabId: string) => boolean, fonts?: ReadonlyMap<string, string>, sounds?: ReadonlyMap<string, Sound>, effect?: ParticleEffectDefinition, spineReferenceFrame?: SpineReferenceFrame, ticker?: Ticker, bitmapFonts?: ReadonlyMap<string, string>): NodeView {\r\n switch (node.type) {\r\n case \"container\":\r\n return new ContainerNodeView();\r\n case \"mask\":\r\n return new MaskNodeView();\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\":\r\n return new LayoutGroupNodeView(textures);\r\n case \"scroll-view\":\r\n return new ScrollViewNodeView(node, textures, interaction);\r\n case \"page-group\":\r\n return new PageGroupNodeView(node, textures);\r\n case \"image\":\r\n return new ImageNodeView(node.assetId, textures, node.nineSlice);\r\n case \"text\":\r\n return new TextNodeView(node.text, fonts);\r\n case \"bitmap-text\":\r\n return new BitmapTextNodeView(bitmapFonts);\r\n case \"spine\":\r\n return new SpineNodeView(spines?.get(node.assetId), node.animation, node.autoplay ?? true, node.loop ?? true, node.animationSpeed ?? 1, interaction === \"authoring\", spineReferenceFrame, ticker);\r\n case \"button\":\r\n return new ButtonNodeView(node, textures, interaction, sounds);\r\n case \"staged-button\":\r\n return new StagedButtonNodeView(node, textures, interaction, sounds);\r\n case \"checkbox\":\r\n return new CheckboxNodeView(node, textures, interaction, sounds);\r\n case \"input\":\r\n return new InputNodeView(node, textures, interaction, fonts);\r\n case \"slider\":\r\n return new SliderNodeView(node, textures, interaction, fonts);\r\n case \"progress-bar\":\r\n return new ProgressBarNodeView(node, textures);\r\n case \"pagination\":\r\n return new PaginationNodeView(node, textures, interaction, fonts);\r\n case \"particle-emitter\":\r\n return effect === undefined ? new ContainerNodeView() : new ParticleEmitterNodeView(effect, textures);\r\n case \"prefab-instance\":\r\n return new PrefabInstanceNodeView(hasPrefab?.(node.prefabId) ?? false);\r\n }\r\n}\r\n\r\n/**\r\n * Every asset a node references: the image, the Spine data, or each of a button's state images.\r\n * Single source of truth for \"which assets does this node use\" — texture loading and the editor's\r\n * usage count both read it, so a new node type can never silently drop out of one of them.\r\n */\r\nexport function collectNodeAssetIds(node: UINode): string[] {\r\n switch (node.type) {\r\n case \"image\":\r\n return node.assetId === undefined ? [] : [node.assetId];\r\n case \"spine\":\r\n return [node.assetId];\r\n case \"button\":\r\n return [\r\n ...BUTTON_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.pressAssetId, node.sounds?.hoverAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"staged-button\":\r\n return [...new Set([\r\n ...node.stages.flatMap((stage) => BUTTON_STATE_KEYS.map((state) => stage.states[`${state}AssetId`])),\r\n node.sounds?.pressAssetId,\r\n node.sounds?.hoverAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"checkbox\":\r\n return [\r\n ...CHECKBOX_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.checkAssetId, node.sounds?.uncheckAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"container\":\r\n case \"mask\":\r\n case \"prefab-instance\":\r\n return [];\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\": {\r\n const backgroundAssetId = node.backgroundAssetId;\r\n return backgroundAssetId === undefined ? [] : [backgroundAssetId];\r\n }\r\n case \"scroll-view\":\r\n case \"page-group\":\r\n return [];\r\n case \"text\":\r\n return [...new Set([\r\n node.style?.fontAssetId,\r\n node.textStyleOverrides?.desktop?.fontAssetId,\r\n node.textStyleOverrides?.mobile?.fontAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"bitmap-text\":\r\n return [node.assetId];\r\n case \"input\": {\r\n const ids: string[] = [];\r\n if (node.backgroundAssetId !== undefined) ids.push(node.backgroundAssetId);\r\n if (node.textStyle.fontAssetId !== undefined) ids.push(node.textStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"slider\": {\r\n const ids = [node.backgroundAssetId, node.fillAssetId, node.handleAssetId];\r\n if (node.valueTextStyle?.fontAssetId !== undefined) ids.push(node.valueTextStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"progress-bar\":\r\n return [node.backgroundAssetId, node.fillAssetId];\r\n case \"pagination\":\r\n return [node.activeAssetId, node.inactiveAssetId, node.numberStyle?.fontAssetId, node.numberActiveBackgroundAssetId].filter((assetId): assetId is string => assetId !== undefined);\r\n case \"particle-emitter\":\r\n return [];\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"createNodeView.js","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAwE,MAAM,wBAAwB,CAAC;AAItJ,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACjL,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CA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;QACxB,KAAK,OAAO,EAAE,CAAC;YACb,MAAM,GAAG,GAAa,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAC3E,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACnF,OAAO,GAAG,CAAC;QACb,CAAC;QACD,KAAK,QAAQ,EAAE,CAAC;YACd,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAC3E,IAAI,IAAI,CAAC,cAAc,EAAE,WAAW,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAC9F,OAAO,GAAG,CAAC;QACb,CAAC;QACD,KAAK,cAAc;YACjB,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,KAAK,YAAY;YACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;QACrL,KAAK,kBAAkB;YACrB,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { BUTTON_STATE_KEYS, CHECKBOX_STATE_KEYS, type ParticleEffectDefinition, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport type { Sound } from \"@pixi/sound\";\r\nimport { Container, Texture, type Ticker } from \"pixi.js\";\r\nimport { ButtonNodeView } from \"./ButtonNodeView.js\";\r\nimport { CheckboxNodeView } from \"./CheckboxNodeView.js\";\r\nimport { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, OpacityGroupNodeView, PrefabInstanceNodeView, TextNodeView } from \"./basic.js\";\r\nimport { InputNodeView } from \"./InputNodeView.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\nimport { ItemTableNodeView } from \"./ItemTableNodeView.js\";\r\nimport { PageGroupNodeView } from \"./PageGroupNodeView.js\";\r\nimport { PaginationNodeView } from \"./PaginationNodeView.js\";\r\nimport { ScrollViewNodeView } from \"./ScrollViewNodeView.js\";\r\nimport { SpineNodeView } from \"./SpineNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./StagedButtonNodeView.js\";\r\nimport { ProgressBarNodeView, SliderNodeView } from \"./ValueControlNodeViews.js\";\r\nimport { ParticleEmitterNodeView } from \"./ParticleEmitterNodeView.js\";\r\n\r\n/**\r\n * `hasPrefab` только сообщает, существует ли определение пресета: содержимое инстанса приходит его\r\n * обычными детьми из общего резолвера иерархии, а не отдельной веткой сборки.\r\n */\r\nexport function createNodeView(node: UINode, interaction: SceneInteractionMode, textures?: ReadonlyMap<string, Texture>, spines?: ReadonlyMap<string, SkeletonData>, hasPrefab?: (prefabId: string) => boolean, fonts?: ReadonlyMap<string, string>, sounds?: ReadonlyMap<string, Sound>, effect?: ParticleEffectDefinition, spineReferenceFrame?: SpineReferenceFrame, ticker?: Ticker, bitmapFonts?: ReadonlyMap<string, string>): NodeView {\r\n switch (node.type) {\r\n case \"container\":\r\n return new ContainerNodeView();\r\n case \"mask\":\r\n return new MaskNodeView();\r\n case \"opacity-group\":\r\n return new OpacityGroupNodeView(interaction);\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\":\r\n return new LayoutGroupNodeView(textures);\r\n case \"scroll-view\":\r\n return new ScrollViewNodeView(node, textures, interaction);\r\n case \"page-group\":\r\n return new PageGroupNodeView(node, textures);\r\n case \"item-table\":\r\n return new ItemTableNodeView();\r\n case \"image\":\r\n return new ImageNodeView(node.assetId, textures, node.nineSlice);\r\n case \"text\":\r\n return new TextNodeView(node.text, fonts);\r\n case \"bitmap-text\":\r\n return new BitmapTextNodeView(bitmapFonts);\r\n case \"spine\":\r\n return new SpineNodeView(spines?.get(node.assetId), node.animation, node.autoplay ?? true, node.loop ?? true, node.animationSpeed ?? 1, interaction === \"authoring\", spineReferenceFrame, ticker);\r\n case \"button\":\r\n return new ButtonNodeView(node, textures, interaction, sounds);\r\n case \"staged-button\":\r\n return new StagedButtonNodeView(node, textures, interaction, sounds);\r\n case \"checkbox\":\r\n return new CheckboxNodeView(node, textures, interaction, sounds);\r\n case \"input\":\r\n return new InputNodeView(node, textures, interaction, fonts);\r\n case \"slider\":\r\n return new SliderNodeView(node, textures, interaction, fonts);\r\n case \"progress-bar\":\r\n return new ProgressBarNodeView(node, textures);\r\n case \"pagination\":\r\n return new PaginationNodeView(node, textures, interaction, fonts);\r\n case \"particle-emitter\":\r\n return effect === undefined ? new ContainerNodeView() : new ParticleEmitterNodeView(effect, textures);\r\n case \"prefab-instance\":\r\n return new PrefabInstanceNodeView(hasPrefab?.(node.prefabId) ?? false);\r\n }\r\n}\r\n\r\n/**\r\n * Every asset a node references: the image, the Spine data, or each of a button's state images.\r\n * Single source of truth for \"which assets does this node use\" — texture loading and the editor's\r\n * usage count both read it, so a new node type can never silently drop out of one of them.\r\n */\r\nexport function collectNodeAssetIds(node: UINode): string[] {\r\n switch (node.type) {\r\n case \"image\":\r\n return node.assetId === undefined ? [] : [node.assetId];\r\n case \"spine\":\r\n return [node.assetId];\r\n case \"button\":\r\n return [\r\n ...BUTTON_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.pressAssetId, node.sounds?.hoverAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"staged-button\":\r\n return [...new Set([\r\n ...node.stages.flatMap((stage) => BUTTON_STATE_KEYS.map((state) => stage.states[`${state}AssetId`])),\r\n node.sounds?.pressAssetId,\r\n node.sounds?.hoverAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"checkbox\":\r\n return [\r\n ...CHECKBOX_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.checkAssetId, node.sounds?.uncheckAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"container\":\r\n case \"mask\":\r\n case \"opacity-group\":\r\n case \"item-table\":\r\n case \"prefab-instance\":\r\n return [];\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\": {\r\n const backgroundAssetId = node.backgroundAssetId;\r\n return backgroundAssetId === undefined ? [] : [backgroundAssetId];\r\n }\r\n case \"scroll-view\":\r\n case \"page-group\":\r\n return [];\r\n case \"text\":\r\n return [...new Set([\r\n node.style?.fontAssetId,\r\n node.textStyleOverrides?.desktop?.fontAssetId,\r\n node.textStyleOverrides?.mobile?.fontAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"bitmap-text\":\r\n return [node.assetId];\r\n case \"input\": {\r\n const ids: string[] = [];\r\n if (node.backgroundAssetId !== undefined) ids.push(node.backgroundAssetId);\r\n if (node.textStyle.fontAssetId !== undefined) ids.push(node.textStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"slider\": {\r\n const ids = [node.backgroundAssetId, node.fillAssetId, node.handleAssetId];\r\n if (node.valueTextStyle?.fontAssetId !== undefined) ids.push(node.valueTextStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"progress-bar\":\r\n return [node.backgroundAssetId, node.fillAssetId];\r\n case \"pagination\":\r\n return [node.activeAssetId, node.inactiveAssetId, node.numberStyle?.fontAssetId, node.numberActiveBackgroundAssetId].filter((assetId): assetId is string => assetId !== undefined);\r\n case \"particle-emitter\":\r\n return [];\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixi-ui-editor/runtime-pixi",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "PixiJS runtime that renders Pixi UI Editor scene documents in a game.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -30,7 +30,10 @@
30
30
  "pixi.js": "^8.19.0",
31
31
  "typed-signals": "^2.5.0",
32
32
  "yoga-layout": "^3.2.1",
33
- "@pixi-ui-editor/schema": "0.7.1"
33
+ "@pixi-ui-editor/schema": "0.9.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "^26.2.0"
34
37
  },
35
38
  "scripts": {
36
39
  "build": "tsc -p tsconfig.json",