@pixi-ui-editor/runtime-pixi 0.3.0 → 0.5.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 (72) hide show
  1. package/README.md +81 -2
  2. package/dist/SceneViewport.d.ts +17 -0
  3. package/dist/SceneViewport.d.ts.map +1 -0
  4. package/dist/SceneViewport.js +35 -0
  5. package/dist/SceneViewport.js.map +1 -0
  6. package/dist/assets/bitmapFonts.d.ts +22 -0
  7. package/dist/assets/bitmapFonts.d.ts.map +1 -0
  8. package/dist/assets/bitmapFonts.js +75 -0
  9. package/dist/assets/bitmapFonts.js.map +1 -0
  10. package/dist/assets/cache.d.ts +31 -0
  11. package/dist/assets/cache.d.ts.map +1 -0
  12. package/dist/assets/cache.js +20 -0
  13. package/dist/assets/cache.js.map +1 -0
  14. package/dist/assets/fonts.d.ts +1 -1
  15. package/dist/assets/fonts.d.ts.map +1 -1
  16. package/dist/assets/fonts.js +2 -2
  17. package/dist/assets/fonts.js.map +1 -1
  18. package/dist/assets/loadTexture.d.ts +9 -0
  19. package/dist/assets/loadTexture.d.ts.map +1 -0
  20. package/dist/assets/loadTexture.js +14 -0
  21. package/dist/assets/loadTexture.js.map +1 -0
  22. package/dist/assets/textures.d.ts +4 -5
  23. package/dist/assets/textures.d.ts.map +1 -1
  24. package/dist/assets/textures.js +31 -20
  25. package/dist/assets/textures.js.map +1 -1
  26. package/dist/controls.d.ts +9 -1
  27. package/dist/controls.d.ts.map +1 -1
  28. package/dist/controls.js +23 -0
  29. package/dist/controls.js.map +1 -1
  30. package/dist/index.d.ts +10 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +7 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.test.js +95 -3
  35. package/dist/index.test.js.map +1 -1
  36. package/dist/layout.d.ts +10 -4
  37. package/dist/layout.d.ts.map +1 -1
  38. package/dist/layout.js +13 -0
  39. package/dist/layout.js.map +1 -1
  40. package/dist/localization.d.ts +42 -0
  41. package/dist/localization.d.ts.map +1 -0
  42. package/dist/localization.js +73 -0
  43. package/dist/localization.js.map +1 -0
  44. package/dist/scene.d.ts +24 -13
  45. package/dist/scene.d.ts.map +1 -1
  46. package/dist/scene.js +66 -14
  47. package/dist/scene.js.map +1 -1
  48. package/dist/views/ButtonNodeView.d.ts +16 -3
  49. package/dist/views/ButtonNodeView.d.ts.map +1 -1
  50. package/dist/views/ButtonNodeView.js +94 -27
  51. package/dist/views/ButtonNodeView.js.map +1 -1
  52. package/dist/views/CheckboxNodeView.d.ts +47 -0
  53. package/dist/views/CheckboxNodeView.d.ts.map +1 -0
  54. package/dist/views/CheckboxNodeView.js +127 -0
  55. package/dist/views/CheckboxNodeView.js.map +1 -0
  56. package/dist/views/NodeView.d.ts +8 -0
  57. package/dist/views/NodeView.d.ts.map +1 -1
  58. package/dist/views/NodeView.js +8 -0
  59. package/dist/views/NodeView.js.map +1 -1
  60. package/dist/views/StagedButtonNodeView.d.ts +81 -0
  61. package/dist/views/StagedButtonNodeView.d.ts.map +1 -0
  62. package/dist/views/StagedButtonNodeView.js +275 -0
  63. package/dist/views/StagedButtonNodeView.js.map +1 -0
  64. package/dist/views/basic.d.ts +97 -2
  65. package/dist/views/basic.d.ts.map +1 -1
  66. package/dist/views/basic.js +273 -8
  67. package/dist/views/basic.js.map +1 -1
  68. package/dist/views/createNodeView.d.ts +1 -1
  69. package/dist/views/createNodeView.d.ts.map +1 -1
  70. package/dist/views/createNodeView.js +30 -4
  71. package/dist/views/createNodeView.js.map +1 -1
  72. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonNodeView.js","sourceRoot":"","sources":["../../src/views/ButtonNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAoC,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAa,QAAQ,EAAE,MAAM,EAAW,MAAM,SAAS,C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AC,CAAC;YACpC,IAAI,CAAC,CAAC,IAAI,YAAY,eAAe,CAAC;gBAAE,SAAS;YACjD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC;YAC/B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC;YAClC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC;QACvC,CAAC;IACH,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO,CAAC,KAAc;QACxB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,mGAAmG;IACnG,QAAQ,CAAC,KAAqB;QAC5B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,OAAO,KAA6B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,IAAI,MAAM,KAA4B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,IAAI,IAAI,KAA0B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,IAAI,OAAO,KAA6B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,IAAI,KAAK,KAA2B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAChE"}
@@ -0,0 +1,47 @@
1
+ import { type CheckboxStateKey, type UINode } from "@pixi-ui-editor/schema";
2
+ import { CheckBox } from "@pixi/ui";
3
+ import type { Sound } from "@pixi/sound";
4
+ import { Texture } from "pixi.js";
5
+ import { NodeView, type SceneInteractionMode } from "./NodeView.js";
6
+ export type CheckboxNode = Extract<UINode, {
7
+ type: "checkbox";
8
+ }>;
9
+ /**
10
+ * Adapts a checkbox node to `@pixi/ui`'s `CheckBox`, which owns the checked/unchecked switching —
11
+ * this class never reimplements it. `group`-based radio exclusivity is wired one layer up, in
12
+ * `wireCheckboxGroups` (see scene.ts): this view only exposes `forceCheck` so that wiring can flip
13
+ * a sibling without re-emitting `onCheck` and recursing back into itself.
14
+ *
15
+ * Hover is layered on top of `CheckBox` by hand: unlike `FancyButton`, `CheckBox`/`Switcher` only
16
+ * switches between its checked/unchecked views and has no hover state slot of its own. Both of its
17
+ * internal Sprites always carry the texture matching the current hover flag — whichever one is
18
+ * `visible` at any moment is Switcher's concern, not ours.
19
+ */
20
+ export declare class CheckboxNodeView extends NodeView {
21
+ private readonly checkbox;
22
+ private readonly interaction;
23
+ private readonly sounds;
24
+ private soundAssetIds;
25
+ private uncheckedTexture;
26
+ private checkedTexture;
27
+ private uncheckedHoverTexture;
28
+ private checkedHoverTexture;
29
+ private enabledState;
30
+ private hovering;
31
+ constructor(node: CheckboxNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, sounds?: ReadonlyMap<string, Sound>);
32
+ private hoverTextureFor;
33
+ /** Puts the current hover/non-hover texture on both internal Sprites; switching visibility is Switcher's job. */
34
+ private applyTextures;
35
+ /** In authoring mode `enabled` may only drive selectability elsewhere: this view stays inert either way. */
36
+ private applyEnabled;
37
+ protected syncContent(node: UINode, transform: UINode["transform"]): void;
38
+ get enabled(): boolean;
39
+ set enabled(value: boolean);
40
+ get checked(): boolean;
41
+ set checked(value: boolean);
42
+ /** Sets checked state without emitting `onCheck` — used by radio-group wiring to avoid re-entrancy. */
43
+ forceCheck(checked: boolean): void;
44
+ get state(): CheckboxStateKey;
45
+ get onCheck(): CheckBox["onCheck"];
46
+ }
47
+ //# sourceMappingURL=CheckboxNodeView.d.ts.map
@@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,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI;IAwBzE,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAED,uGAAuG;IACvG,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,IAAI,KAAK,IAAI,gBAAgB,CAE5B;IAED,IAAI,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAkC;CACrE"}
@@ -0,0 +1,127 @@
1
+ import { CHECKBOX_STATE_KEYS } from "@pixi-ui-editor/schema";
2
+ import { CheckBox } from "@pixi/ui";
3
+ import { Sprite, Texture } from "pixi.js";
4
+ import { NodeView } from "./NodeView.js";
5
+ /**
6
+ * Adapts a checkbox node to `@pixi/ui`'s `CheckBox`, which owns the checked/unchecked switching —
7
+ * this class never reimplements it. `group`-based radio exclusivity is wired one layer up, in
8
+ * `wireCheckboxGroups` (see scene.ts): this view only exposes `forceCheck` so that wiring can flip
9
+ * a sibling without re-emitting `onCheck` and recursing back into itself.
10
+ *
11
+ * Hover is layered on top of `CheckBox` by hand: unlike `FancyButton`, `CheckBox`/`Switcher` only
12
+ * switches between its checked/unchecked views and has no hover state slot of its own. Both of its
13
+ * internal Sprites always carry the texture matching the current hover flag — whichever one is
14
+ * `visible` at any moment is Switcher's concern, not ours.
15
+ */
16
+ export class CheckboxNodeView extends NodeView {
17
+ checkbox;
18
+ interaction;
19
+ sounds;
20
+ soundAssetIds;
21
+ uncheckedTexture;
22
+ checkedTexture;
23
+ uncheckedHoverTexture;
24
+ checkedHoverTexture;
25
+ enabledState;
26
+ hovering = false;
27
+ constructor(node, textures, interaction, sounds) {
28
+ super(textures);
29
+ this.interaction = interaction;
30
+ this.sounds = sounds;
31
+ this.soundAssetIds = node.sounds;
32
+ const unchecked = this.textureFor(node.states.uncheckedAssetId) ?? Texture.WHITE;
33
+ const checked = this.textureFor(node.states.checkedAssetId) ?? Texture.WHITE;
34
+ this.uncheckedTexture = unchecked;
35
+ this.checkedTexture = checked;
36
+ this.uncheckedHoverTexture = this.hoverTextureFor(node.states.uncheckedHoverAssetId, unchecked);
37
+ this.checkedHoverTexture = this.hoverTextureFor(node.states.checkedHoverAssetId, checked);
38
+ this.checkbox = new CheckBox({
39
+ checked: node.defaultChecked,
40
+ style: { unchecked, checked },
41
+ });
42
+ // Authoring-сцена инертна, как и у button: eventMode "none" на верхнем контейнере отключает
43
+ // hit-testing всего поддерева, включая `innerView`, который Switcher сам сделал "static" — а
44
+ // значит и hover в authoring никогда не наступает, так что его незачем отдельно отключать.
45
+ if (interaction === "authoring")
46
+ this.checkbox.eventMode = "none";
47
+ else {
48
+ this.checkbox.innerView.on("pointerover", () => { this.hovering = true; this.applyTextures(); });
49
+ this.checkbox.innerView.on("pointerout", () => { this.hovering = false; this.applyTextures(); });
50
+ if (sounds !== undefined) {
51
+ this.checkbox.onCheck.connect((checkedState) => {
52
+ const assetId = checkedState ? this.soundAssetIds?.checkAssetId : this.soundAssetIds?.uncheckAssetId;
53
+ const result = assetId === undefined ? undefined : this.sounds?.get(assetId)?.play();
54
+ if (result instanceof Promise)
55
+ void result.catch(() => undefined);
56
+ });
57
+ }
58
+ }
59
+ this.enabledState = node.enabled;
60
+ this.applyEnabled(node.enabled);
61
+ this.setContent(this.checkbox);
62
+ }
63
+ hoverTextureFor(assetId, fallback) {
64
+ return (assetId === undefined ? undefined : this.textureFor(assetId)) ?? fallback;
65
+ }
66
+ /** Puts the current hover/non-hover texture on both internal Sprites; switching visibility is Switcher's job. */
67
+ applyTextures() {
68
+ const [uncheckedView, checkedView] = this.checkbox.views;
69
+ if (uncheckedView instanceof Sprite)
70
+ uncheckedView.texture = this.hovering ? this.uncheckedHoverTexture : this.uncheckedTexture;
71
+ if (checkedView instanceof Sprite)
72
+ checkedView.texture = this.hovering ? this.checkedHoverTexture : this.checkedTexture;
73
+ }
74
+ /** In authoring mode `enabled` may only drive selectability elsewhere: this view stays inert either way. */
75
+ applyEnabled(enabled) {
76
+ this.enabledState = enabled;
77
+ if (this.interaction === "authoring")
78
+ return;
79
+ this.checkbox.eventMode = enabled ? "static" : "none";
80
+ }
81
+ syncContent(node, transform) {
82
+ if (node.type !== "checkbox")
83
+ return;
84
+ this.soundAssetIds = node.sounds;
85
+ const unchecked = this.textureFor(node.states.uncheckedAssetId) ?? Texture.WHITE;
86
+ const checked = this.textureFor(node.states.checkedAssetId) ?? Texture.WHITE;
87
+ // `style` rebuilds both internal views, so it's only reassigned when a base texture actually
88
+ // changed — same rule ButtonNodeView follows for its state Sprites. A fresh pair of Sprites
89
+ // starts out holding the plain (non-hover) textures `style` was given, so `applyTextures` always
90
+ // runs afterwards to restore the current hover look.
91
+ if (unchecked !== this.uncheckedTexture || checked !== this.checkedTexture) {
92
+ this.uncheckedTexture = unchecked;
93
+ this.checkedTexture = checked;
94
+ this.checkbox.style = { unchecked, checked };
95
+ }
96
+ this.uncheckedHoverTexture = this.hoverTextureFor(node.states.uncheckedHoverAssetId, unchecked);
97
+ this.checkedHoverTexture = this.hoverTextureFor(node.states.checkedHoverAssetId, checked);
98
+ this.applyTextures();
99
+ for (const view of this.checkbox.views)
100
+ if (view instanceof Sprite)
101
+ view.setSize(transform.width, transform.height);
102
+ // Только на изменение документа: иначе любой пересчёт layout сбрасывал бы transient preview state.
103
+ if (node.enabled !== this.enabledState)
104
+ this.applyEnabled(node.enabled);
105
+ }
106
+ get enabled() {
107
+ return this.enabledState;
108
+ }
109
+ set enabled(value) {
110
+ this.applyEnabled(value);
111
+ }
112
+ get checked() {
113
+ return this.checkbox.checked;
114
+ }
115
+ set checked(value) {
116
+ this.checkbox.checked = value;
117
+ }
118
+ /** Sets checked state without emitting `onCheck` — used by radio-group wiring to avoid re-entrancy. */
119
+ forceCheck(checked) {
120
+ this.checkbox.forceCheck(checked);
121
+ }
122
+ get state() {
123
+ return this.checkbox.checked ? CHECKBOX_STATE_KEYS[1] : CHECKBOX_STATE_KEYS[0];
124
+ }
125
+ get onCheck() { return this.checkbox.onCheck; }
126
+ }
127
+ //# sourceMappingURL=CheckboxNodeView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxNodeView.js","sourceRoot":"","sources":["../../src/views/CheckboxNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsC,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAIpE;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAiB,SAAQ,QAAQ;IAC3B,QAAQ,CAAW;IACnB,WAAW,CAAuB;IAClC,MAAM,CAAyC;IACxD,aAAa,CAAyB;IACtC,gBAAgB,CAAU;IAC1B,cAAc,CAAU;IACxB,qBAAqB,CAAU;IAC/B,mBAAmB,CAAU;IAC7B,YAAY,CAAU;IACtB,QAAQ,GAAG,KAAK,CAAC;IAEzB,YAAY,IAAkB,EAAE,QAAkD,EAAE,WAAiC,EAAE,MAAmC;QACxJ,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC;QACjF,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,OAAO,CAAC,KAAK,CA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gBAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QAEpH,mGAAmG;QACnG,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,YAAY;YAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO,CAAC,KAAc;QACxB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,IAAI,OAAO,CAAC,KAAc;QACxB,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;IAChC,CAAC;IAED,uGAAuG;IACvG,UAAU,CAAC,OAAgB;QACzB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;IAED,IAAI,OAAO,KAA0B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;CACrE"}
@@ -50,5 +50,13 @@ export declare abstract class NodeView extends Container {
50
50
  updateManaged(node: UINode, profile: LayoutProfileId, size: LayoutSize): void;
51
51
  get layoutRectangle(): LayoutSize;
52
52
  getSpine(): Spine | undefined;
53
+ /**
54
+ * Rasterizes canvas-based content (`TextNodeView`) at a higher pixel density than the renderer's
55
+ * own backing resolution, so an authoring camera zoomed in doesn't magnify an already-rasterized
56
+ * bitmap past its source resolution and read as blurred. A no-op base implementation: sprite/
57
+ * graphics/bitmap-text content is either GPU-native (always crisp under zoom) or, for bitmap-text,
58
+ * has its resolution fixed by the installed `BitmapFont` and can't be changed per instance.
59
+ */
60
+ setContentResolution(_resolution: number): void;
53
61
  }
54
62
  //# sourceMappingURL=NodeView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeView.d.ts","sourceRoot":"","sources":["../../src/views/NodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAa,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElG;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,SAAS,CAAC;AAE3D;;;;GAIG;AACH,8BAAsB,QAAS,SAAQ,SAAS;IAC9C,SAAS,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC9B,4FAA4F;IAC5F,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACtE,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,yGAAyG;IACzG,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,YAAY,CAAK;gBAEb,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;IAKnD,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI1D;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAIxC,mGAAmG;IACnG,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI;IAM9C,kGAAkG;IAClG,S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ACtE,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,yGAAyG;IACzG,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,YAAY,CAAK;gBAEb,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;IAKnD,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI1D;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAIxC,mGAAmG;IACnG,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI;IAM9C,kGAAkG;IAClG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAE5G,OAAO,CAAC,sBAAsB;IAuB9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI;IAK7E,mGAAmG;IACnG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,UAAO,EAAE,OAAO,GAAE,eAA2B,GAAG,IAAI;IAIjH,sEAAsE;IACtE,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAK7E,IAAI,eAAe,IAAI,UAAU,CAEhC;IAED,QAAQ,IAAI,KAAK,GAAG,SAAS;IAI7B;;;;;;OAMG;IACH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAChD"}
@@ -87,5 +87,13 @@ export class NodeView extends Container {
87
87
  getSpine() {
88
88
  return this.content instanceof Spine ? this.content : undefined;
89
89
  }
90
+ /**
91
+ * Rasterizes canvas-based content (`TextNodeView`) at a higher pixel density than the renderer's
92
+ * own backing resolution, so an authoring camera zoomed in doesn't magnify an already-rasterized
93
+ * bitmap past its source resolution and read as blurred. A no-op base implementation: sprite/
94
+ * graphics/bitmap-text content is either GPU-native (always crisp under zoom) or, for bitmap-text,
95
+ * has its resolution fixed by the installed `BitmapFont` and can't be changed per instance.
96
+ */
97
+ setContentResolution(_resolution) { }
90
98
  }
91
99
  //# sourceMappingURL=NodeView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeView.js","sourceRoot":"","sources":["../../src/views/NodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,SAAS,EAA2B,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAmB,MAAM,cAAc,CAAC;AASlG;;;;GAIG;AACH,MAAM,OAAgB,QAAS,SAAQ,SAAS;IACpC,OAAO,CAAa;IAC9B,4FAA4F;IACzE,QAAQ,CAA2C;IACtE,6FAA6F;IAC5E,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;IAC5C,yGAAyG;IACjG,WAAW,GAAG,CAAC,CAAC;IAChB,YAAY,GAAG,CAAC,CAAC;IAEzB,YAAY,QAAuC;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,UAAU,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,KAAgB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,mGAAmG;IACzF,UAAU,CAAC,OAAkB;QACrC,IAAI,IAAI,CAAC,OA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,CAAC,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACH,oBAAoB,CAAC,WAAmB,IAAS,CAAC;CACnD"}
@@ -0,0 +1,81 @@
1
+ import { type ButtonStateKey, type LayoutPadding, type StagedButtonNode, type UINode } from "@pixi-ui-editor/schema";
2
+ import type { Sound } from "@pixi/sound";
3
+ import { Texture } from "pixi.js";
4
+ import { Signal } from "typed-signals";
5
+ import { NodeView, type SceneInteractionMode } from "./NodeView.js";
6
+ export type { StagedButtonNode };
7
+ /**
8
+ * Adapts a staged-button node to `@pixi/ui`'s `FancyButton`, exactly like `ButtonNodeView` does for a
9
+ * plain button — this class never reimplements its pointer state machine either. It is a deliberately
10
+ * separate component (see TASK-057): it does not extend or share behavior with `ButtonNodeView`.
11
+ *
12
+ * A click at runtime advances the current stage (`next()`), which respects `wrap`. Four state views
13
+ * are created once and reused across stages: changing stage only reassigns their textures/size, never
14
+ * replacing the view type — a full `FancyButton` rebuild only happens when a view's required *type*
15
+ * changes (nine-slice toggled, or a texture just finished loading), because `FancyButton` gives no way
16
+ * to swap a view after construction.
17
+ */
18
+ export declare class StagedButtonNodeView extends NodeView {
19
+ private button;
20
+ private stateViews;
21
+ private readonly interaction;
22
+ private readonly sounds;
23
+ private soundAssetIds;
24
+ private nineSlice;
25
+ private stagesData;
26
+ private currentStageId;
27
+ private defaultStageId;
28
+ private wrapState;
29
+ private enabledState;
30
+ /** Последнее editor-only визуальное состояние из `setState`: переживает пересборку `FancyButton`. */
31
+ private forcedState;
32
+ readonly onStageChange: Signal<(stage: {
33
+ index: number;
34
+ value: string;
35
+ }) => void>;
36
+ constructor(node: StagedButtonNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, sounds?: ReadonlyMap<string, Sound>);
37
+ private currentStage;
38
+ private static createStateView;
39
+ /**
40
+ * (Re)builds `FancyButton` and its four state views for the current stage. `size`, when provided,
41
+ * sizes the freshly built views immediately — needed because a stage change may happen well outside
42
+ * a `syncContent` pass (e.g. a runtime click), where nothing else would resize them afterwards.
43
+ */
44
+ private buildButton;
45
+ /**
46
+ * Sizes the four state views to the resolved layout rectangle without touching their textures.
47
+ *
48
+ * `NineSliceSprite` проверяется отдельно: в PixiJS 8 он наследуется от `ViewContainer`, а не от
49
+ * `Sprite`, поэтому одна ветка `instanceof Sprite` его молча пропускает.
50
+ */
51
+ private applySizes;
52
+ /**
53
+ * Applies the current stage's textures/border to the existing state views (or rebuilds them if a
54
+ * view's required type no longer matches, the same rule `ButtonNodeView.syncContent` follows).
55
+ */
56
+ private refreshStateViews;
57
+ private applyStage;
58
+ /** In authoring mode `enabled` may only drive the visuals: `FancyButton` couples it to `eventMode`. */
59
+ private applyEnabled;
60
+ protected syncContent(node: UINode, transform: UINode["transform"]): void;
61
+ /** Editor-only live preview of nine-slice border edits while dragging the canvas gizmo. */
62
+ previewNineSlice(nineSlice: LayoutPadding): void;
63
+ get enabled(): boolean;
64
+ set enabled(value: boolean);
65
+ get stage(): number;
66
+ get value(): string;
67
+ get stageCount(): number;
68
+ /** Moves to the stage at `index` and emits `onStageChange`; an out-of-range index is a no-op. */
69
+ setStage(index: number): void;
70
+ /** Moves to the stage at `index` without emitting — used by editor preview to avoid feedback loops. */
71
+ forceStage(index: number): void;
72
+ /** Moves to the first stage whose `value` matches; an unknown value is ignored. */
73
+ setValue(value: string): void;
74
+ /** Advances one stage, as a click does; respects `wrap` at the last stage. */
75
+ next(): void;
76
+ /** Returns to `defaultStageId`, emitting `onStageChange`. */
77
+ reset(): void;
78
+ /** Forces an editor-only visual state without changing `enabled`, mirroring `ButtonNodeView.setState`. */
79
+ setState(state: ButtonStateKey): void;
80
+ }
81
+ //# sourceMappingURL=StagedButtonNodeView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StagedButtonNodeView.d.ts","sourceRoot":"","sources":["../../src/views/StagedButtonNodeView.ts"],"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9B;;;;OAIG;IACH,OAAO,CAAC,WAAW;IA6CnB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IASlB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAyCzB,OAAO,CAAC,UAAU;IAMlB,uGAAuG;IACvG,OAAO,CAAC,YAAY;IAMpB,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI;IAsBzE,2FAA2F;IAC3F,gBAAgB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAWhD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAED,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,iGAAiG;IACjG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO7B,uGAAuG;IACvG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/B,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM7B,8EAA8E;IAC9E,IAAI,IAAI,IAAI;IAUZ,6DAA6D;IAC7D,KAAK,IAAI,IAAI;IAKb,0GAA0G;IAC1G,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;CAItC"}
@@ -0,0 +1,275 @@
1
+ import { BUTTON_STATE_KEYS } from "@pixi-ui-editor/schema";
2
+ import { FancyButton } from "@pixi/ui";
3
+ import { Graphics, NineSliceSprite, Sprite } from "pixi.js";
4
+ import { Signal } from "typed-signals";
5
+ import { NodeView } from "./NodeView.js";
6
+ const FANCY_STATE_BY_KEY = { normal: "default", hover: "hover", pressed: "pressed", disabled: "disabled" };
7
+ /**
8
+ * Adapts a staged-button node to `@pixi/ui`'s `FancyButton`, exactly like `ButtonNodeView` does for a
9
+ * plain button — this class never reimplements its pointer state machine either. It is a deliberately
10
+ * separate component (see TASK-057): it does not extend or share behavior with `ButtonNodeView`.
11
+ *
12
+ * A click at runtime advances the current stage (`next()`), which respects `wrap`. Four state views
13
+ * are created once and reused across stages: changing stage only reassigns their textures/size, never
14
+ * replacing the view type — a full `FancyButton` rebuild only happens when a view's required *type*
15
+ * changes (nine-slice toggled, or a texture just finished loading), because `FancyButton` gives no way
16
+ * to swap a view after construction.
17
+ */
18
+ export class StagedButtonNodeView extends NodeView {
19
+ button;
20
+ stateViews;
21
+ interaction;
22
+ sounds;
23
+ soundAssetIds;
24
+ nineSlice;
25
+ stagesData;
26
+ currentStageId;
27
+ defaultStageId;
28
+ wrapState;
29
+ enabledState;
30
+ /** Последнее editor-only визуальное состояние из `setState`: переживает пересборку `FancyButton`. */
31
+ forcedState;
32
+ onStageChange = new Signal();
33
+ constructor(node, textures, interaction, sounds) {
34
+ super(textures);
35
+ this.interaction = interaction;
36
+ this.sounds = sounds;
37
+ this.soundAssetIds = node.sounds;
38
+ this.nineSlice = node.nineSlice;
39
+ this.stagesData = node.stages;
40
+ this.wrapState = node.wrap;
41
+ this.defaultStageId = node.defaultStageId;
42
+ this.currentStageId = node.stages.some((stage) => stage.id === node.defaultStageId) ? node.defaultStageId : node.stages[0].id;
43
+ this.enabledState = node.enabled;
44
+ this.buildButton();
45
+ }
46
+ currentStage() {
47
+ return this.stagesData.find((stage) => stage.id === this.currentStageId) ?? this.stagesData[0];
48
+ }
49
+ static createStateView(texture, nineSlice) {
50
+ if (texture === undefined)
51
+ return new Graphics();
52
+ return nineSlice === undefined
53
+ ? new Sprite(texture)
54
+ : new NineSliceSprite({ texture, leftWidth: nineSlice.left, topHeight: nineSlice.top, rightWidth: nineSlice.right, bottomHeight: nineSlice.bottom });
55
+ }
56
+ /**
57
+ * (Re)builds `FancyButton` and its four state views for the current stage. `size`, when provided,
58
+ * sizes the freshly built views immediately — needed because a stage change may happen well outside
59
+ * a `syncContent` pass (e.g. a runtime click), where nothing else would resize them afterwards.
60
+ */
61
+ buildButton(size) {
62
+ const stage = this.currentStage();
63
+ const normalTexture = this.textureFor(stage.states.normalAssetId);
64
+ const stateViews = {};
65
+ const viewFor = (state, assetId) => {
66
+ const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;
67
+ const view = StagedButtonNodeView.createStateView(texture, this.nineSlice);
68
+ stateViews[state] = view;
69
+ return view;
70
+ };
71
+ const button = new FancyButton({
72
+ defaultView: viewFor("normal", stage.states.normalAssetId),
73
+ hoverView: viewFor("hover", stage.states.hoverAssetId),
74
+ pressedView: viewFor("pressed", stage.states.pressedAssetId),
75
+ disabledView: viewFor("disabled", stage.states.disabledAssetId),
76
+ });
77
+ // Authoring-сцена инертна, как и у обычной кнопки: клики не должны крутить стадию, а попадание по
78
+ // ноде остаётся ответственностью NodeView.containsPoint.
79
+ if (this.interaction === "authoring")
80
+ button.eventMode = "none";
81
+ else {
82
+ button.onPress.connect(() => {
83
+ this.next();
84
+ const result = this.soundAssetIds?.pressAssetId === undefined ? undefined : this.sounds?.get(this.soundAssetIds.pressAssetId)?.play();
85
+ if (result instanceof Promise)
86
+ void result.catch(() => undefined);
87
+ });
88
+ button.onHover.connect(() => {
89
+ const result = this.soundAssetIds?.hoverAssetId === undefined ? undefined : this.sounds?.get(this.soundAssetIds.hoverAssetId)?.play();
90
+ if (result instanceof Promise)
91
+ void result.catch(() => undefined);
92
+ });
93
+ }
94
+ this.button = button;
95
+ this.stateViews = stateViews;
96
+ this.setContent(button);
97
+ const resolved = size ?? this.layoutRectangle;
98
+ this.applySizes(resolved.width, resolved.height);
99
+ // Пересборка — деталь реализации `FancyButton`, а не действие пользователя: transient enabled и
100
+ // визуальное состояние восстанавливаются на новом инстансе, иначе переключение nine-slice или
101
+ // догрузка текстуры сбрасывали бы их.
102
+ this.applyEnabled(this.enabledState);
103
+ if (this.forcedState !== undefined)
104
+ this.button.setState(FANCY_STATE_BY_KEY[this.forcedState]);
105
+ }
106
+ /**
107
+ * Sizes the four state views to the resolved layout rectangle without touching their textures.
108
+ *
109
+ * `NineSliceSprite` проверяется отдельно: в PixiJS 8 он наследуется от `ViewContainer`, а не от
110
+ * `Sprite`, поэтому одна ветка `instanceof Sprite` его молча пропускает.
111
+ */
112
+ applySizes(width, height) {
113
+ for (const state of BUTTON_STATE_KEYS) {
114
+ const view = this.stateViews[state];
115
+ if (view instanceof NineSliceSprite)
116
+ view.setSize(width, height);
117
+ else if (view instanceof Sprite)
118
+ view.setSize(width, height);
119
+ else if (view instanceof Graphics)
120
+ view.clear().rect(0, 0, width, height).fill(0x4a5568).stroke({ width: 1, color: 0x94a3b8 });
121
+ }
122
+ }
123
+ /**
124
+ * Applies the current stage's textures/border to the existing state views (or rebuilds them if a
125
+ * view's required type no longer matches, the same rule `ButtonNodeView.syncContent` follows).
126
+ */
127
+ refreshStateViews(width, height) {
128
+ const stage = this.currentStage();
129
+ const normalTexture = this.textureFor(stage.states.normalAssetId);
130
+ let needsRebuild = false;
131
+ for (const state of BUTTON_STATE_KEYS) {
132
+ const assetId = stage.states[`${state}AssetId`];
133
+ const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;
134
+ const view = this.stateViews[state];
135
+ const wantsNineSlice = texture !== undefined && this.nineSlice !== undefined;
136
+ // `NineSliceSprite` не наследуется от `Sprite` в PixiJS 8, поэтому ветки не пересекаются.
137
+ const matches = texture === undefined ? view instanceof Graphics : wantsNineSlice ? view instanceof NineSliceSprite : view instanceof Sprite;
138
+ if (!matches) {
139
+ needsRebuild = true;
140
+ break;
141
+ }
142
+ }
143
+ if (needsRebuild) {
144
+ this.buildButton({ width, height });
145
+ return;
146
+ }
147
+ for (const state of BUTTON_STATE_KEYS) {
148
+ const view = this.stateViews[state];
149
+ const assetId = stage.states[`${state}AssetId`];
150
+ const texture = (assetId === undefined ? undefined : this.textureFor(assetId)) ?? normalTexture;
151
+ // Set the texture before the layout size: Sprite/NineSliceSprite preserve scale when their
152
+ // texture changes, so sizing first would shift visual bounds for a differently-sized source.
153
+ if (view instanceof NineSliceSprite) {
154
+ if (texture !== undefined && view.texture !== texture)
155
+ view.texture = texture;
156
+ if (this.nineSlice !== undefined) {
157
+ view.leftWidth = this.nineSlice.left;
158
+ view.topHeight = this.nineSlice.top;
159
+ view.rightWidth = this.nineSlice.right;
160
+ view.bottomHeight = this.nineSlice.bottom;
161
+ }
162
+ }
163
+ else if (view instanceof Sprite) {
164
+ if (texture !== undefined && view.texture !== texture)
165
+ view.texture = texture;
166
+ }
167
+ }
168
+ this.applySizes(width, height);
169
+ }
170
+ applyStage(stageId) {
171
+ this.currentStageId = stageId;
172
+ const { width, height } = this.layoutRectangle;
173
+ this.refreshStateViews(width, height);
174
+ }
175
+ /** In authoring mode `enabled` may only drive the visuals: `FancyButton` couples it to `eventMode`. */
176
+ applyEnabled(enabled) {
177
+ this.enabledState = enabled;
178
+ if (this.interaction === "runtime")
179
+ this.button.enabled = enabled;
180
+ else
181
+ this.button.setState(enabled ? "default" : "disabled");
182
+ }
183
+ syncContent(node, transform) {
184
+ if (node.type !== "staged-button")
185
+ return;
186
+ this.soundAssetIds = node.sounds;
187
+ this.nineSlice = node.nineSlice;
188
+ this.wrapState = node.wrap;
189
+ this.defaultStageId = node.defaultStageId;
190
+ // Сохраняет текущую стадию, если она ещё существует после изменения документа; если стадию
191
+ // удалили — переходит на ближайшую валидную по прежнему индексу.
192
+ const previousIndex = this.stagesData.findIndex((stage) => stage.id === this.currentStageId);
193
+ this.stagesData = node.stages;
194
+ if (!node.stages.some((stage) => stage.id === this.currentStageId)) {
195
+ const clampedIndex = Math.min(Math.max(previousIndex, 0), node.stages.length - 1);
196
+ this.currentStageId = node.stages[clampedIndex].id;
197
+ }
198
+ this.refreshStateViews(transform.width, transform.height);
199
+ // Только на изменение документа: иначе любой пересчёт layout сбрасывал бы transient preview state.
200
+ if (node.enabled !== this.enabledState)
201
+ this.applyEnabled(node.enabled);
202
+ }
203
+ /** Editor-only live preview of nine-slice border edits while dragging the canvas gizmo. */
204
+ previewNineSlice(nineSlice) {
205
+ for (const state of BUTTON_STATE_KEYS) {
206
+ const view = this.stateViews[state];
207
+ if (!(view instanceof NineSliceSprite))
208
+ continue;
209
+ view.leftWidth = nineSlice.left;
210
+ view.topHeight = nineSlice.top;
211
+ view.rightWidth = nineSlice.right;
212
+ view.bottomHeight = nineSlice.bottom;
213
+ }
214
+ }
215
+ get enabled() {
216
+ return this.enabledState;
217
+ }
218
+ set enabled(value) {
219
+ this.applyEnabled(value);
220
+ }
221
+ get stage() {
222
+ const index = this.stagesData.findIndex((stage) => stage.id === this.currentStageId);
223
+ return index === -1 ? 0 : index;
224
+ }
225
+ get value() {
226
+ return this.currentStage().value;
227
+ }
228
+ get stageCount() {
229
+ return this.stagesData.length;
230
+ }
231
+ /** Moves to the stage at `index` and emits `onStageChange`; an out-of-range index is a no-op. */
232
+ setStage(index) {
233
+ const target = this.stagesData[index];
234
+ if (target === undefined)
235
+ return;
236
+ this.applyStage(target.id);
237
+ this.onStageChange.emit({ index, value: target.value });
238
+ }
239
+ /** Moves to the stage at `index` without emitting — used by editor preview to avoid feedback loops. */
240
+ forceStage(index) {
241
+ const target = this.stagesData[index];
242
+ if (target === undefined)
243
+ return;
244
+ this.applyStage(target.id);
245
+ }
246
+ /** Moves to the first stage whose `value` matches; an unknown value is ignored. */
247
+ setValue(value) {
248
+ const index = this.stagesData.findIndex((stage) => stage.value === value);
249
+ if (index === -1)
250
+ return;
251
+ this.setStage(index);
252
+ }
253
+ /** Advances one stage, as a click does; respects `wrap` at the last stage. */
254
+ next() {
255
+ const nextIndex = this.stage + 1;
256
+ if (nextIndex >= this.stagesData.length) {
257
+ if (!this.wrapState)
258
+ return;
259
+ this.setStage(0);
260
+ return;
261
+ }
262
+ this.setStage(nextIndex);
263
+ }
264
+ /** Returns to `defaultStageId`, emitting `onStageChange`. */
265
+ reset() {
266
+ const index = this.stagesData.findIndex((stage) => stage.id === this.defaultStageId);
267
+ this.setStage(index === -1 ? 0 : index);
268
+ }
269
+ /** Forces an editor-only visual state without changing `enabled`, mirroring `ButtonNodeView.setState`. */
270
+ setState(state) {
271
+ this.forcedState = state;
272
+ this.button.setState(FANCY_STATE_BY_KEY[state]);
273
+ }
274
+ }
275
+ //# sourceMappingURL=StagedButtonNodeView.js.map