@pixi-ui-editor/runtime-pixi 0.5.1 → 0.6.1

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 (66) hide show
  1. package/dist/controls.d.ts +19 -0
  2. package/dist/controls.d.ts.map +1 -1
  3. package/dist/controls.js +40 -0
  4. package/dist/controls.js.map +1 -1
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +3 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/layoutGroups.js.map +1 -1
  10. package/dist/pageGroup.d.ts +17 -0
  11. package/dist/pageGroup.d.ts.map +1 -0
  12. package/dist/pageGroup.js +20 -0
  13. package/dist/pageGroup.js.map +1 -0
  14. package/dist/particles.d.ts +5 -2
  15. package/dist/particles.d.ts.map +1 -1
  16. package/dist/particles.js +57 -12
  17. package/dist/particles.js.map +1 -1
  18. package/dist/scene.d.ts.map +1 -1
  19. package/dist/scene.js +43 -2
  20. package/dist/scene.js.map +1 -1
  21. package/dist/views/NodeView.d.ts +2 -2
  22. package/dist/views/NodeView.d.ts.map +1 -1
  23. package/dist/views/NodeView.js.map +1 -1
  24. package/dist/views/PageGroupNodeView.d.ts +42 -0
  25. package/dist/views/PageGroupNodeView.d.ts.map +1 -0
  26. package/dist/views/PageGroupNodeView.js +72 -0
  27. package/dist/views/PageGroupNodeView.js.map +1 -0
  28. package/dist/views/PaginationNodeView.d.ts +59 -0
  29. package/dist/views/PaginationNodeView.d.ts.map +1 -0
  30. package/dist/views/PaginationNodeView.js +238 -0
  31. package/dist/views/PaginationNodeView.js.map +1 -0
  32. package/dist/views/ParticleEmitterNodeView.d.ts +13 -0
  33. package/dist/views/ParticleEmitterNodeView.d.ts.map +1 -1
  34. package/dist/views/ParticleEmitterNodeView.js +164 -32
  35. package/dist/views/ParticleEmitterNodeView.js.map +1 -1
  36. package/dist/views/SpineNodeView.d.ts +23 -2
  37. package/dist/views/SpineNodeView.d.ts.map +1 -1
  38. package/dist/views/SpineNodeView.js +131 -2
  39. package/dist/views/SpineNodeView.js.map +1 -1
  40. package/dist/views/basic.d.ts.map +1 -1
  41. package/dist/views/basic.js +3 -1
  42. package/dist/views/basic.js.map +1 -1
  43. package/dist/views/createNodeView.d.ts.map +1 -1
  44. package/dist/views/createNodeView.js +9 -0
  45. package/dist/views/createNodeView.js.map +1 -1
  46. package/package.json +5 -3
  47. package/dist/assets/spine.test.d.ts +0 -2
  48. package/dist/assets/spine.test.d.ts.map +0 -1
  49. package/dist/assets/spine.test.js +0 -42
  50. package/dist/assets/spine.test.js.map +0 -1
  51. package/dist/index.test.d.ts +0 -2
  52. package/dist/index.test.d.ts.map +0 -1
  53. package/dist/index.test.js +0 -485
  54. package/dist/index.test.js.map +0 -1
  55. package/dist/particles.test.d.ts +0 -2
  56. package/dist/particles.test.d.ts.map +0 -1
  57. package/dist/particles.test.js +0 -210
  58. package/dist/particles.test.js.map +0 -1
  59. package/dist/test.setup.d.ts +0 -2
  60. package/dist/test.setup.d.ts.map +0 -1
  61. package/dist/test.setup.js +0 -6
  62. package/dist/test.setup.js.map +0 -1
  63. package/dist/views/ParticleEmitterNodeView.test.d.ts +0 -2
  64. package/dist/views/ParticleEmitterNodeView.test.d.ts.map +0 -1
  65. package/dist/views/ParticleEmitterNodeView.test.js +0 -148
  66. package/dist/views/ParticleEmitterNodeView.test.js.map +0 -1
@@ -22,6 +22,25 @@ export declare function previewNineSlice(view: Container, nineSlice: LayoutPaddi
22
22
  export declare function setSliderViewValue(view: Container, value: number): void;
23
23
  /** Applies an editor-only progress preview without touching the document. */
24
24
  export declare function setProgressBarViewProgress(view: Container, progress: number): void;
25
+ /** One-way sync from game code (or editor preview) into the widget: highlights a dot without emitting `onPageChange`. */
26
+ export declare function setPaginationViewPage(view: Container, page: number): void;
27
+ /** Rebuilds the widget's dots for a runtime-known page count, e.g. once actual content length is known. */
28
+ export declare function setPaginationViewPageCount(view: Container, pageCount: number): void;
29
+ /** Switches which direct child ("page") of a page group is shown; every other child is hidden. */
30
+ export declare function setPageGroupViewPage(view: Container, page: number): void;
31
+ /**
32
+ * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any
33
+ * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history
34
+ * list, a chat log, ...) rather than one fully known at authoring time. Fits the page to the group's
35
+ * current rectangle and hides it until switched to. Returns the new page's index, or `undefined` if
36
+ * `view` is not a page group. Keep `setPaginationViewPageCount` in sync with the resulting `pageCount`
37
+ * if a `pagination` widget is showing this group's page count.
38
+ */
39
+ export declare function addPageGroupViewPage(view: Container, page: Container): number | undefined;
25
40
  /** Enables or pauses editor-only automatic playback without affecting serialized node data. */
26
41
  export declare function setSpineViewAutoplay(view: Container, autoplay: boolean): void;
42
+ /** Activates authored bone/slot part connectors on one Spine node without mutating the document. */
43
+ export declare function setSpineConnectorBonesActive(view: Container, active: boolean): void;
44
+ /** Reasserts active connector matrices after a host performs live node-view updates. */
45
+ export declare function refreshSpineConnectorBones(nodeViews: ReadonlyMap<string, Container>): void;
27
46
  //# sourceMappingURL=controls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAapC,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CASnJ;AAED,kHAAkH;AAClH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAA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G,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAEzF;AAED,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAG7E;AAED,oGAAoG;AACpG,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAEnF;AAED,wFAAwF;AACxF,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAE1F"}
package/dist/controls.js CHANGED
@@ -1,10 +1,13 @@
1
1
  import { Spine } from "@esotericsoftware/spine-pixi-v8";
2
2
  import { ButtonNodeView } from "./views/ButtonNodeView.js";
3
3
  import { CheckboxNodeView } from "./views/CheckboxNodeView.js";
4
+ import { PageGroupNodeView } from "./views/PageGroupNodeView.js";
5
+ import { PaginationNodeView } from "./views/PaginationNodeView.js";
4
6
  import { StagedButtonNodeView } from "./views/StagedButtonNodeView.js";
5
7
  import { ImageNodeView } from "./views/basic.js";
6
8
  import { NodeView } from "./views/NodeView.js";
7
9
  import { ProgressBarNodeView, SliderNodeView } from "./views/ValueControlNodeViews.js";
10
+ import { SpineNodeView } from "./views/SpineNodeView.js";
8
11
  function findSpineChild(view) {
9
12
  if (view instanceof NodeView)
10
13
  return view.getSpine();
@@ -69,10 +72,47 @@ export function setProgressBarViewProgress(view, progress) {
69
72
  if (view instanceof ProgressBarNodeView)
70
73
  view.progress = progress;
71
74
  }
75
+ /** One-way sync from game code (or editor preview) into the widget: highlights a dot without emitting `onPageChange`. */
76
+ export function setPaginationViewPage(view, page) {
77
+ if (view instanceof PaginationNodeView)
78
+ view.page = page;
79
+ }
80
+ /** Rebuilds the widget's dots for a runtime-known page count, e.g. once actual content length is known. */
81
+ export function setPaginationViewPageCount(view, pageCount) {
82
+ if (view instanceof PaginationNodeView)
83
+ view.pageCount = pageCount;
84
+ }
85
+ /** Switches which direct child ("page") of a page group is shown; every other child is hidden. */
86
+ export function setPageGroupViewPage(view, page) {
87
+ if (view instanceof PageGroupNodeView)
88
+ view.page = page;
89
+ }
90
+ /**
91
+ * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any
92
+ * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history
93
+ * list, a chat log, ...) rather than one fully known at authoring time. Fits the page to the group's
94
+ * current rectangle and hides it until switched to. Returns the new page's index, or `undefined` if
95
+ * `view` is not a page group. Keep `setPaginationViewPageCount` in sync with the resulting `pageCount`
96
+ * if a `pagination` widget is showing this group's page count.
97
+ */
98
+ export function addPageGroupViewPage(view, page) {
99
+ return view instanceof PageGroupNodeView ? view.addPage(page) : undefined;
100
+ }
72
101
  /** Enables or pauses editor-only automatic playback without affecting serialized node data. */
73
102
  export function setSpineViewAutoplay(view, autoplay) {
74
103
  const spine = findSpineChild(view);
75
104
  if (spine !== undefined)
76
105
  spine.autoUpdate = autoplay;
77
106
  }
107
+ /** Activates authored bone/slot part connectors on one Spine node without mutating the document. */
108
+ export function setSpineConnectorBonesActive(view, active) {
109
+ if (view instanceof SpineNodeView)
110
+ view.activeConnectorBones = active;
111
+ }
112
+ /** Reasserts active connector matrices after a host performs live node-view updates. */
113
+ export function refreshSpineConnectorBones(nodeViews) {
114
+ for (const view of nodeViews.values())
115
+ if (view instanceof SpineNodeView && view.activeConnectorBones)
116
+ view.refreshConnectorBones();
117
+ }
78
118
  //# sourceMappingURL=controls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controls.js","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAA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,QAAQ,CAAC;AACpE,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,QAAiB;IACrE,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;AACvD,CAAC","sourcesContent":["import { type SkeletonData, Spine } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { type ButtonStateKey, type LayoutPadding } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\r\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\r\nimport { ImageNodeView } from \"./views/basic.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\nimport { ProgressBarNodeView, SliderNodeView } from \"./views/ValueControlNodeViews.js\";\r\n\r\nfunction findSpineChild(view: Container): Spine | undefined {\r\n if (view instanceof NodeView) return view.getSpine();\r\n return view instanceof Spine ? view : view.children.find((child): child is Spine => child instanceof Spine);\r\n}\r\n\r\n/** Reads the current 1-based animation frame for an editor Spine node. */\r\nexport function getSpineViewPlayback(view: Container, skeletonData: SkeletonData, animation: string): { current: number; total: number } | undefined {\r\n const spine = findSpineChild(view);\r\n const track = spine?.state.tracks[0];\r\n const duration = skeletonData.findAnimation(animation)?.duration;\r\n if (track === null || track === undefined || duration === undefined || duration <= 0) return undefined;\r\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\r\n const total = Math.max(1, Math.round(duration * fps));\r\n const time = track.loop ? track.trackTime % duration : Math.min(track.trackTime, duration);\r\n return { current: Math.min(total, Math.floor(time * fps) + 1), total };\r\n}\r\n\r\n/** Seeks an editor Spine node to a 1-based animation frame without changing its serialized animation settings. */\r\nexport function setSpineViewFrame(view: Container, frame: number, skeletonData: SkeletonData, animation: string): void {\r\n const spine = findSpineChild(view);\r\n const track = spine?.state.tracks[0];\r\n const duration = skeletonData.findAnimation(animation)?.duration;\r\n if (track === null || track === undefined || duration === undefined || duration <= 0) return;\r\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\r\n const total = Math.max(1, Math.round(duration * fps));\r\n track.trackTime = Math.min(total, Math.max(1, Math.round(frame)) - 1) / fps;\r\n spine?.update(0);\r\n}\r\n\r\n/** Forces an editor-only button state; the node's serialized `enabled` and states stay untouched. */\r\nexport function setButtonViewState(view: Container, state: ButtonStateKey): void {\r\n if (view instanceof ButtonNodeView) view.setState(state);\r\n}\r\n\r\n/** Forces an editor-only checkbox checked state; the node's serialized `defaultChecked` stays untouched. */\r\nexport function setCheckboxViewChecked(view: Container, checked: boolean): void {\r\n if (view instanceof CheckboxNodeView) view.forceCheck(checked);\r\n}\r\n\r\n/** Forces an editor-only staged button preview stage; the document's `stages`/current stage stay untouched. */\r\nexport function setStagedButtonViewStage(view: Container, index: number): void {\r\n if (view instanceof StagedButtonNodeView) view.forceStage(index);\r\n}\r\n\r\n/** Forces an editor-only staged button visual state; the node's serialized `enabled` stays untouched. */\r\nexport function setStagedButtonViewState(view: Container, state: ButtonStateKey): void {\r\n if (view instanceof StagedButtonNodeView) view.setState(state);\r\n}\r\n\r\n/** Live-previews nine-slice border edits while dragging the canvas gizmo; commits only on release. */\r\nexport function previewNineSlice(view: Container, nineSlice: LayoutPadding): void {\r\n if (view instanceof ImageNodeView || view instanceof ButtonNodeView || view instanceof StagedButtonNodeView) view.previewNineSlice(nineSlice);\r\n}\r\n\r\n/** Applies an editor-only slider preview value without touching the document. */\r\nexport function setSliderViewValue(view: Container, value: number): void {\r\n if (view instanceof SliderNodeView) view.value = value;\r\n}\r\n\r\n/** Applies an editor-only progress preview without touching the document. */\r\nexport function setProgressBarViewProgress(view: Container, progress: number): void {\r\n if (view instanceof ProgressBarNodeView) view.progress = progress;\r\n}\r\n\r\n/** Enables or pauses editor-only automatic playback without affecting serialized node data. */\r\nexport function setSpineViewAutoplay(view: Container, autoplay: boolean): void {\r\n const spine = findSpineChild(view);\r\n if (spine !== undefined) spine.autoUpdate = autoplay;\r\n}\r\n"]}
1
+ {"version":3,"file":"controls.js","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,SAAS,cAAc,CAAC,IAAe;IACrC,IAAI,IAAI,YAAY,QAAQ;QAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACrD,OAAO,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAkB,EAAE,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC;AAC9G,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,YAA0B,EAAE,SAAiB;IACjG,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,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KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;AACvD,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,4BAA4B,CAAC,IAAe,EAAE,MAAe;IAC3E,IAAI,IAAI,YAAY,aAAa;QAAE,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC;AACxE,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,0BAA0B,CAAC,SAAyC;IAClF,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,MAAM,EAAE;QAAE,IAAI,IAAI,YAAY,aAAa,IAAI,IAAI,CAAC,oBAAoB;YAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC;AACtI,CAAC","sourcesContent":["import { type SkeletonData, Spine } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { type ButtonStateKey, type LayoutPadding } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\r\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\r\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\r\nimport { PaginationNodeView } from \"./views/PaginationNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\r\nimport { ImageNodeView } from \"./views/basic.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\nimport { ProgressBarNodeView, SliderNodeView } from \"./views/ValueControlNodeViews.js\";\r\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\r\n\r\nfunction findSpineChild(view: Container): Spine | undefined {\r\n if (view instanceof NodeView) return view.getSpine();\r\n return view instanceof Spine ? view : view.children.find((child): child is Spine => child instanceof Spine);\r\n}\r\n\r\n/** Reads the current 1-based animation frame for an editor Spine node. */\r\nexport function getSpineViewPlayback(view: Container, skeletonData: SkeletonData, animation: string): { current: number; total: number } | undefined {\r\n const spine = findSpineChild(view);\r\n const track = spine?.state.tracks[0];\r\n const duration = skeletonData.findAnimation(animation)?.duration;\r\n if (track === null || track === undefined || duration === undefined || duration <= 0) return undefined;\r\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\r\n const total = Math.max(1, Math.round(duration * fps));\r\n const time = track.loop ? track.trackTime % duration : Math.min(track.trackTime, duration);\r\n return { current: Math.min(total, Math.floor(time * fps) + 1), total };\r\n}\r\n\r\n/** Seeks an editor Spine node to a 1-based animation frame without changing its serialized animation settings. */\r\nexport function setSpineViewFrame(view: Container, frame: number, skeletonData: SkeletonData, animation: string): void {\r\n const spine = findSpineChild(view);\r\n const track = spine?.state.tracks[0];\r\n const duration = skeletonData.findAnimation(animation)?.duration;\r\n if (track === null || track === undefined || duration === undefined || duration <= 0) return;\r\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\r\n const total = Math.max(1, Math.round(duration * fps));\r\n track.trackTime = Math.min(total, Math.max(1, Math.round(frame)) - 1) / fps;\r\n spine?.update(0);\r\n}\r\n\r\n/** Forces an editor-only button state; the node's serialized `enabled` and states stay untouched. */\r\nexport function setButtonViewState(view: Container, state: ButtonStateKey): void {\r\n if (view instanceof ButtonNodeView) view.setState(state);\r\n}\r\n\r\n/** Forces an editor-only checkbox checked state; the node's serialized `defaultChecked` stays untouched. */\r\nexport function setCheckboxViewChecked(view: Container, checked: boolean): void {\r\n if (view instanceof CheckboxNodeView) view.forceCheck(checked);\r\n}\r\n\r\n/** Forces an editor-only staged button preview stage; the document's `stages`/current stage stay untouched. */\r\nexport function setStagedButtonViewStage(view: Container, index: number): void {\r\n if (view instanceof StagedButtonNodeView) view.forceStage(index);\r\n}\r\n\r\n/** Forces an editor-only staged button visual state; the node's serialized `enabled` stays untouched. */\r\nexport function setStagedButtonViewState(view: Container, state: ButtonStateKey): void {\r\n if (view instanceof StagedButtonNodeView) view.setState(state);\r\n}\r\n\r\n/** Live-previews nine-slice border edits while dragging the canvas gizmo; commits only on release. */\r\nexport function previewNineSlice(view: Container, nineSlice: LayoutPadding): void {\r\n if (view instanceof ImageNodeView || view instanceof ButtonNodeView || view instanceof StagedButtonNodeView) view.previewNineSlice(nineSlice);\r\n}\r\n\r\n/** Applies an editor-only slider preview value without touching the document. */\r\nexport function setSliderViewValue(view: Container, value: number): void {\r\n if (view instanceof SliderNodeView) view.value = value;\r\n}\r\n\r\n/** Applies an editor-only progress preview without touching the document. */\r\nexport function setProgressBarViewProgress(view: Container, progress: number): void {\r\n if (view instanceof ProgressBarNodeView) view.progress = progress;\r\n}\r\n\r\n/** One-way sync from game code (or editor preview) into the widget: highlights a dot without emitting `onPageChange`. */\r\nexport function setPaginationViewPage(view: Container, page: number): void {\r\n if (view instanceof PaginationNodeView) view.page = page;\r\n}\r\n\r\n/** Rebuilds the widget's dots for a runtime-known page count, e.g. once actual content length is known. */\r\nexport function setPaginationViewPageCount(view: Container, pageCount: number): void {\r\n if (view instanceof PaginationNodeView) view.pageCount = pageCount;\r\n}\r\n\r\n/** Switches which direct child (\"page\") of a page group is shown; every other child is hidden. */\r\nexport function setPageGroupViewPage(view: Container, page: number): void {\r\n if (view instanceof PageGroupNodeView) view.page = page;\r\n}\r\n\r\n/**\r\n * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any\r\n * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history\r\n * list, a chat log, ...) rather than one fully known at authoring time. Fits the page to the group's\r\n * current rectangle and hides it until switched to. Returns the new page's index, or `undefined` if\r\n * `view` is not a page group. Keep `setPaginationViewPageCount` in sync with the resulting `pageCount`\r\n * if a `pagination` widget is showing this group's page count.\r\n */\r\nexport function addPageGroupViewPage(view: Container, page: Container): number | undefined {\r\n return view instanceof PageGroupNodeView ? view.addPage(page) : undefined;\r\n}\r\n\r\n/** Enables or pauses editor-only automatic playback without affecting serialized node data. */\r\nexport function setSpineViewAutoplay(view: Container, autoplay: boolean): void {\r\n const spine = findSpineChild(view);\r\n if (spine !== undefined) spine.autoUpdate = autoplay;\r\n}\r\n\r\n/** Activates authored bone/slot part connectors on one Spine node without mutating the document. */\r\nexport function setSpineConnectorBonesActive(view: Container, active: boolean): void {\r\n if (view instanceof SpineNodeView) view.activeConnectorBones = active;\r\n}\r\n\r\n/** Reasserts active connector matrices after a host performs live node-view updates. */\r\nexport function refreshSpineConnectorBones(nodeViews: ReadonlyMap<string, Container>): void {\r\n for (const view of nodeViews.values()) if (view instanceof SpineNodeView && view.activeConnectorBones) view.refreshConnectorBones();\r\n}\r\n"]}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from "./layout.js";
5
5
  export { SceneViewport } from "./SceneViewport.js";
6
6
  export * from "./layoutGroups.js";
7
7
  export * from "./scrollView.js";
8
+ export * from "./pageGroup.js";
8
9
  export * from "./views/NodeView.js";
9
10
  export { ButtonNodeView } from "./views/ButtonNodeView.js";
10
11
  export { StagedButtonNodeView } from "./views/StagedButtonNodeView.js";
@@ -13,6 +14,8 @@ export { InputNodeView } from "./views/InputNodeView.js";
13
14
  export { ScrollViewNodeView } from "./views/ScrollViewNodeView.js";
14
15
  export { SpineNodeView } from "./views/SpineNodeView.js";
15
16
  export { ProgressBarNodeView, SliderNodeView } from "./views/ValueControlNodeViews.js";
17
+ export { PaginationNodeView } from "./views/PaginationNodeView.js";
18
+ export { PageGroupNodeView } from "./views/PageGroupNodeView.js";
16
19
  export { ParticleEmitterNodeView } from "./views/ParticleEmitterNodeView.js";
17
20
  export * from "./particles.js";
18
21
  export { collectNodeAssetIds } from "./views/createNodeView.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC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,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3K,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export * from "./layout.js";
3
3
  export { SceneViewport } from "./SceneViewport.js";
4
4
  export * from "./layoutGroups.js";
5
5
  export * from "./scrollView.js";
6
+ export * from "./pageGroup.js";
6
7
  export * from "./views/NodeView.js";
7
8
  export { ButtonNodeView } from "./views/ButtonNodeView.js";
8
9
  export { StagedButtonNodeView } from "./views/StagedButtonNodeView.js";
@@ -11,6 +12,8 @@ export { InputNodeView } from "./views/InputNodeView.js";
11
12
  export { ScrollViewNodeView } from "./views/ScrollViewNodeView.js";
12
13
  export { SpineNodeView } from "./views/SpineNodeView.js";
13
14
  export { ProgressBarNodeView, SliderNodeView } from "./views/ValueControlNodeViews.js";
15
+ export { PaginationNodeView } from "./views/PaginationNodeView.js";
16
+ export { PageGroupNodeView } from "./views/PageGroupNodeView.js";
14
17
  export { ParticleEmitterNodeView } from "./views/ParticleEmitterNodeView.js";
15
18
  export * from "./particles.js";
16
19
  export { collectNodeAssetIds } from "./views/createNodeView.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3K,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC","sourcesContent":["export type { SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nexport type { Sound } from \"@pixi/sound\";\r\nexport * from \"./document.js\";\r\nexport * from \"./layout.js\";\r\nexport { SceneViewport } from \"./SceneViewport.js\";\r\nexport * from \"./layoutGroups.js\";\r\nexport * from \"./scrollView.js\";\r\nexport * from \"./views/NodeView.js\";\r\nexport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\r\nexport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\r\nexport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\r\nexport { InputNodeView } from \"./views/InputNodeView.js\";\r\nexport { ScrollViewNodeView } from \"./views/ScrollViewNodeView.js\";\r\nexport { SpineNodeView } from \"./views/SpineNodeView.js\";\r\nexport { ProgressBarNodeView, SliderNodeView } from \"./views/ValueControlNodeViews.js\";\r\nexport { ParticleEmitterNodeView } from \"./views/ParticleEmitterNodeView.js\";\r\nexport * from \"./particles.js\";\r\nexport { collectNodeAssetIds } from \"./views/createNodeView.js\";\r\nexport { SceneLocalization } from \"./localization.js\";\r\nexport type { SceneLocalizationOptions } from \"./localization.js\";\r\nexport { ImageNodeView, MaskNodeView, TextNodeView } from \"./views/basic.js\";\r\nexport type { BuildSceneViewOptions, PrefabViewConfiguration, SceneViewResult } from \"./scene.js\";\r\nexport { buildPrefabView, buildSceneView, collectRenderedNodes, loadPrefabView, previewNodeView, updateNodeView, updateParticleEmitters, loadSceneView } from \"./scene.js\";\r\nexport * from \"./controls.js\";\r\nexport { createSceneAssetCache } from \"./assets/cache.js\";\r\nexport type { SceneAssetCache } from \"./assets/cache.js\";\r\nexport * from \"./assets/textures.js\";\r\nexport * from \"./assets/spine.js\";\r\nexport * from \"./assets/fonts.js\";\r\nexport * from \"./assets/bitmapFonts.js\";\r\nexport * from \"./assets/sounds.js\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3K,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC","sourcesContent":["export type { SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nexport type { Sound } from \"@pixi/sound\";\r\nexport * from \"./document.js\";\r\nexport * from \"./layout.js\";\r\nexport { SceneViewport } from \"./SceneViewport.js\";\r\nexport * from \"./layoutGroups.js\";\r\nexport * from \"./scrollView.js\";\r\nexport * from \"./pageGroup.js\";\r\nexport * from \"./views/NodeView.js\";\r\nexport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\r\nexport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\r\nexport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\r\nexport { InputNodeView } from \"./views/InputNodeView.js\";\r\nexport { ScrollViewNodeView } from \"./views/ScrollViewNodeView.js\";\r\nexport { SpineNodeView } from \"./views/SpineNodeView.js\";\r\nexport { ProgressBarNodeView, SliderNodeView } from \"./views/ValueControlNodeViews.js\";\r\nexport { PaginationNodeView } from \"./views/PaginationNodeView.js\";\r\nexport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\r\nexport { ParticleEmitterNodeView } from \"./views/ParticleEmitterNodeView.js\";\r\nexport * from \"./particles.js\";\r\nexport { collectNodeAssetIds } from \"./views/createNodeView.js\";\r\nexport { SceneLocalization } from \"./localization.js\";\r\nexport type { SceneLocalizationOptions } from \"./localization.js\";\r\nexport { ImageNodeView, MaskNodeView, TextNodeView } from \"./views/basic.js\";\r\nexport type { BuildSceneViewOptions, PrefabViewConfiguration, SceneViewResult } from \"./scene.js\";\r\nexport { buildPrefabView, buildSceneView, collectRenderedNodes, loadPrefabView, previewNodeView, updateNodeView, updateParticleEmitters, loadSceneView } from \"./scene.js\";\r\nexport * from \"./controls.js\";\r\nexport { createSceneAssetCache } from \"./assets/cache.js\";\r\nexport type { SceneAssetCache } from \"./assets/cache.js\";\r\nexport * from \"./assets/textures.js\";\r\nexport * from \"./assets/spine.js\";\r\nexport * from \"./assets/fonts.js\";\r\nexport * from \"./assets/bitmapFonts.js\";\r\nexport * from \"./assets/sounds.js\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGroups.js","sourceRoot":"","sources":["../src/layoutGroups.ts"],"names":[],"mappings":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utAlignment, type LayoutGroupNode, type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport { resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\r\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/** Importing @pixi/layout installs its renderer extension. Kept as a shared explicit contract for every host. */\r\nexport function initializePixiLayout(): void { /* @pixi/layout is installed by this module's side effect. */ }\r\n\r\nfunction alignmentParts(alignment: LayoutAlignment) {\r\n const [vertical, horizontal] = alignment.split(\"-\") as [\"upper\" | \"middle\" | \"lower\", \"left\" | \"center\" | \"right\"];\r\n return {\r\n horizontal: horizontal === \"left\" ? \"flex-start\" : horizontal === \"right\" ? \"flex-end\" : \"center\",\r\n vertical: vertical === \"upper\" ? \"flex-start\" : vertical === \"lower\" ? \"flex-end\" : \"center\",\r\n };\r\n}\r\n\r\nfunction layoutSize(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): LayoutSize {\n const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);\n return { width: transform.width, height: transform.height };\n}\n\n/** Applies one declarative document group to Pixi Layout; no computed Yoga data crosses the document boundary. */\nexport function applyLayoutGroup(view: Container, node: LayoutGroupNode, profile: LayoutProfileId, parentSize?: LayoutSize, managedSize?: LayoutSize): void {\n const settings = resolveLayoutGroupSettings(node, profile) as LayoutGroupNode[\"layoutGroup\"][\"base\"];\n const size = managedSize ?? layoutSize(node, profile, parentSize);\n const common = { width: size.width, height: size.height, display: \"flex\" as const };\r\n if (node.type === \"horizontal-layout\" || node.type === \"vertical-layout\") {\r\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(linear.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: node.type === \"horizontal-layout\" ? alignment.horizontal : alignment.vertical,\r\n alignItems: node.type === \"horizontal-layout\" ? alignment.vertical : alignment.horizontal,\r\n flexDirection: node.type === \"horizontal-layout\" ? (linear.reverseOrder ? \"row-reverse\" : \"row\") : (linear.reverseOrder ? \"column-reverse\" : \"column\"),\r\n gap: linear.spacing,\r\n paddingLeft: linear.padding.left, paddingRight: linear.padding.right, paddingTop: linear.padding.top, paddingBottom: linear.padding.bottom,\r\n } as never;\r\n return;\r\n }\r\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const reverseX = grid.startCorner.endsWith(\"right\");\r\n const reverseY = grid.startCorner.startsWith(\"lower\");\r\n const fillsByRow = grid.constraint === \"fixed-column-count\" || (grid.constraint === \"flexible\" && grid.startAxis === \"horizontal\");\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(grid.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: fillsByRow ? alignment.horizontal : alignment.vertical,\r\n alignItems: fillsByRow ? alignment.vertical : alignment.horizontal,\r\n alignContent: fillsByRow ? alignment.vertical : alignment.horizontal,\r\n flexDirection: fillsByRow ? (reverseX ? \"row-reverse\" : \"row\") : (reverseY ? \"column-reverse\" : \"column\"),\r\n flexWrap: reverseY && fillsByRow ? \"wrap-reverse\" : \"wrap\",\r\n columnGap: grid.spacingX, rowGap: grid.spacingY,\r\n paddingLeft: grid.padding.left, paddingRight: grid.padding.right, paddingTop: grid.padding.top, paddingBottom: grid.padding.bottom,\r\n } as never;\r\n}\r\n\r\n/**\r\n * Runtime-only Yoga owner for one direct child. The wrapper receives Yoga coordinates while the\r\n * serializable NodeView keeps the shared pivot/rotation/scale/content/hit-test contract.\r\n */\r\nexport class LayoutItemContainer extends Container {\r\n private node?: UINode;\r\n private profile: LayoutProfileId = \"desktop\";\r\n private fallbackSize: LayoutSize = { width: 0, height: 0 };\r\n\r\n constructor(readonly nodeView: NodeView, private readonly onLayoutChanged?: () => void) {\r\n super();\r\n super.addChild(nodeView);\r\n this.onLayout = () => this.applyComputedSize();\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, fallbackSize: LayoutSize): void {\r\n this.node = node;\r\n this.profile = profile;\r\n this.fallbackSize = fallbackSize;\r\n this.visible = resolveProfileTransform(node, profile).visible;\r\n this.applyComputedSize();\r\n }\r\n\r\n private applyComputedSize(): void {\r\n if (this.node === undefined) return;\r\n const computed = this.layout?.computedLayout;\r\n const size = computed === undefined || computed.width <= 0 || computed.height <= 0\r\n ? this.fallbackSize\r\n : { width: computed.width, height: computed.height };\r\n if (isLayoutGroup(this.node)) applyLayoutGroup(this.nodeView, this.node, this.profile, undefined, size);\n this.nodeView.updateManaged(this.node, this.profile, size);\r\n this.onLayoutChanged?.();\r\n }\r\n}\r\n\r\n/** Marks a direct child's technical wrapper as layout-managed. */\r\nexport function applyLayoutItem(view: LayoutItemContainer, node: UINode, parent: LayoutGroupNode, profile: LayoutProfileId): void {\r\n // Anchors belong to authored positioning and are deliberately ignored while a parent layout owns\r\n // the rectangle. Width/height remain the child's logical intrinsic size, never Pixi content bounds.\r\n const transform = resolveProfileTransform(node, profile).transform;\r\n const own = { width: transform.width, height: transform.height };\r\n const item = node.layoutItem;\r\n const settings = resolveLayoutGroupSettings(parent, profile);\r\n const base = { position: \"relative\" as const, flexGrow: item?.flexGrow ?? 0, flexShrink: item?.flexShrink ?? 0, flexBasis: item?.flexBasis, alignSelf: item?.alignSelf };\r\n view.sync(node, profile, own);\r\n if (parent.type === \"grid-layout\") {\r\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n view.layout = { ...base, width: grid.cellWidth, height: grid.cellHeight } as never;\r\n return;\r\n }\r\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const horizontal = parent.type === \"horizontal-layout\";\r\n const expandsMain = horizontal\r\n ? linear.controlChildWidth && linear.forceExpandWidth\r\n : linear.controlChildHeight && linear.forceExpandHeight;\r\n const expandsCross = horizontal\r\n ? linear.controlChildHeight && linear.forceExpandHeight\r\n : linear.controlChildWidth && linear.forceExpandWidth;\r\n view.layout = {\r\n ...base,\r\n // The schema has no separate min/preferred size yet, so the logical authored rect is the safe\r\n // intrinsic fallback for both control modes. Force-expand may then replace the relevant axis.\r\n width: expandsCross && !horizontal ? undefined : own.width,\r\n height: expandsCross && horizontal ? undefined : own.height,\r\n ...(expandsMain ? { flexGrow: Math.max(1, item?.flexGrow ?? 0) } : {}),\r\n ...(expandsCross ? { alignSelf: item?.alignSelf ?? \"stretch\" } : {}),\r\n } as never;\r\n}\r\n\r\n/** A zero-visual Yoga flex item. Fixed Unity grid constraints need explicit line breaks; this is still solved entirely by Yoga. */\r\nexport function createGridLineBreak(parent: Extract<LayoutGroupNode, { type: \"grid-layout\" }>, profile: LayoutProfileId): Container | undefined {\r\n const grid = resolveLayoutGroupSettings(parent, profile) as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n if (grid.constraint === \"flexible\" || grid.constraintCount === undefined) return undefined;\r\n const lineBreak = new Container({ label: \"__layout-grid-line-break__\" });\r\n lineBreak.layout = (grid.constraint === \"fixed-column-count\"\r\n ? { flexBasis: \"100%\", width: \"100%\", height: 0 }\r\n : { flexBasis: \"100%\", height: \"100%\", width: 0 }) as never;\r\n return lineBreak;\r\n}\r\n\r\nexport function isLayoutManagedChild(node: UINode, nodes: readonly UINode[]): boolean {\r\n return node.parentId !== null && isLayoutGroup(nodes.find((candidate) => candidate.id === node.parentId) ?? node) && nodes.some((candidate) => candidate.id === node.parentId && isLayoutGroup(candidate));\r\n}\r\n"]}
1
+ {"version":3,"file":"layoutGroups.js","sourceRoot":"","sources":["../src/layoutGroups.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,aAA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IAAI,EAAE,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5D,CAAC;AACb,CAAC;AAED,mIAAmI;AACnI,MAAM,UAAU,mBAAmB,CAAC,MAAyD,EAAE,OAAwB;IACrH,MAAM,IAAI,GAAG,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAA8E,CAAC;IACtI,IAAI,IAAI,CAAC,UAAU,KAAK,UAAU,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3F,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;IACzE,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,KAAK,oBAAoB;QAC1D,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE;QACjD,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAU,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAwB;IACzE,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AAC7M,CAAC","sourcesContent":["import \"@pixi/layout\";\r\nimport { isLayoutGroup, resolveLayoutGroupSettings, type LayoutAlignment, type LayoutGroupNode, type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport { resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\r\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/** Importing @pixi/layout installs its renderer extension. Kept as a shared explicit contract for every host. */\r\nexport function initializePixiLayout(): void { /* @pixi/layout is installed by this module's side effect. */ }\r\n\r\nfunction alignmentParts(alignment: LayoutAlignment) {\r\n const [vertical, horizontal] = alignment.split(\"-\") as [\"upper\" | \"middle\" | \"lower\", \"left\" | \"center\" | \"right\"];\r\n return {\r\n horizontal: horizontal === \"left\" ? \"flex-start\" : horizontal === \"right\" ? \"flex-end\" : \"center\",\r\n vertical: vertical === \"upper\" ? \"flex-start\" : vertical === \"lower\" ? \"flex-end\" : \"center\",\r\n };\r\n}\r\n\r\nfunction layoutSize(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): LayoutSize {\n const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);\n return { width: transform.width, height: transform.height };\n}\n\n/** Applies one declarative document group to Pixi Layout; no computed Yoga data crosses the document boundary. */\nexport function applyLayoutGroup(view: Container, node: LayoutGroupNode, profile: LayoutProfileId, parentSize?: LayoutSize, managedSize?: LayoutSize): void {\n const settings = resolveLayoutGroupSettings(node, profile) as LayoutGroupNode[\"layoutGroup\"][\"base\"];\n const size = managedSize ?? layoutSize(node, profile, parentSize);\n const common = { width: size.width, height: size.height, display: \"flex\" as const };\r\n if (node.type === \"horizontal-layout\" || node.type === \"vertical-layout\") {\r\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(linear.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: node.type === \"horizontal-layout\" ? alignment.horizontal : alignment.vertical,\r\n alignItems: node.type === \"horizontal-layout\" ? alignment.vertical : alignment.horizontal,\r\n flexDirection: node.type === \"horizontal-layout\" ? (linear.reverseOrder ? \"row-reverse\" : \"row\") : (linear.reverseOrder ? \"column-reverse\" : \"column\"),\r\n gap: linear.spacing,\r\n paddingLeft: linear.padding.left, paddingRight: linear.padding.right, paddingTop: linear.padding.top, paddingBottom: linear.padding.bottom,\r\n } as never;\r\n return;\r\n }\r\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const reverseX = grid.startCorner.endsWith(\"right\");\r\n const reverseY = grid.startCorner.startsWith(\"lower\");\r\n const fillsByRow = grid.constraint === \"fixed-column-count\" || (grid.constraint === \"flexible\" && grid.startAxis === \"horizontal\");\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(grid.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: fillsByRow ? alignment.horizontal : alignment.vertical,\r\n alignItems: fillsByRow ? alignment.vertical : alignment.horizontal,\r\n alignContent: fillsByRow ? alignment.vertical : alignment.horizontal,\r\n flexDirection: fillsByRow ? (reverseX ? \"row-reverse\" : \"row\") : (reverseY ? \"column-reverse\" : \"column\"),\r\n flexWrap: reverseY && fillsByRow ? \"wrap-reverse\" : \"wrap\",\r\n columnGap: grid.spacingX, rowGap: grid.spacingY,\n paddingLeft: grid.padding.left, paddingRight: grid.padding.right, paddingTop: grid.padding.top, paddingBottom: grid.padding.bottom,\r\n } as never;\r\n}\r\n\r\n/**\r\n * Runtime-only Yoga owner for one direct child. The wrapper receives Yoga coordinates while the\r\n * serializable NodeView keeps the shared pivot/rotation/scale/content/hit-test contract.\r\n */\r\nexport class LayoutItemContainer extends Container {\r\n private node?: UINode;\r\n private profile: LayoutProfileId = \"desktop\";\r\n private fallbackSize: LayoutSize = { width: 0, height: 0 };\r\n\r\n constructor(readonly nodeView: NodeView, private readonly onLayoutChanged?: () => void) {\r\n super();\r\n super.addChild(nodeView);\r\n this.onLayout = () => this.applyComputedSize();\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, fallbackSize: LayoutSize): void {\r\n this.node = node;\r\n this.profile = profile;\r\n this.fallbackSize = fallbackSize;\r\n this.visible = resolveProfileTransform(node, profile).visible;\r\n this.applyComputedSize();\r\n }\r\n\r\n private applyComputedSize(): void {\r\n if (this.node === undefined) return;\r\n const computed = this.layout?.computedLayout;\r\n const size = computed === undefined || computed.width <= 0 || computed.height <= 0\r\n ? this.fallbackSize\r\n : { width: computed.width, height: computed.height };\r\n if (isLayoutGroup(this.node)) applyLayoutGroup(this.nodeView, this.node, this.profile, undefined, size);\n this.nodeView.updateManaged(this.node, this.profile, size);\r\n this.onLayoutChanged?.();\r\n }\r\n}\r\n\r\n/** Marks a direct child's technical wrapper as layout-managed. */\r\nexport function applyLayoutItem(view: LayoutItemContainer, node: UINode, parent: LayoutGroupNode, profile: LayoutProfileId): void {\r\n // Anchors belong to authored positioning and are deliberately ignored while a parent layout owns\r\n // the rectangle. Width/height remain the child's logical intrinsic size, never Pixi content bounds.\r\n const transform = resolveProfileTransform(node, profile).transform;\r\n const own = { width: transform.width, height: transform.height };\r\n const item = node.layoutItem;\r\n const settings = resolveLayoutGroupSettings(parent, profile);\r\n const base = { position: \"relative\" as const, flexGrow: item?.flexGrow ?? 0, flexShrink: item?.flexShrink ?? 0, flexBasis: item?.flexBasis, alignSelf: item?.alignSelf };\r\n view.sync(node, profile, own);\r\n if (parent.type === \"grid-layout\") {\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\n view.layout = { ...base, width: grid.cellWidth, height: grid.cellHeight } as never;\n return;\n }\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const horizontal = parent.type === \"horizontal-layout\";\r\n const expandsMain = horizontal\r\n ? linear.controlChildWidth && linear.forceExpandWidth\r\n : linear.controlChildHeight && linear.forceExpandHeight;\r\n const expandsCross = horizontal\r\n ? linear.controlChildHeight && linear.forceExpandHeight\r\n : linear.controlChildWidth && linear.forceExpandWidth;\r\n view.layout = {\r\n ...base,\r\n // The schema has no separate min/preferred size yet, so the logical authored rect is the safe\r\n // intrinsic fallback for both control modes. Force-expand may then replace the relevant axis.\r\n width: expandsCross && !horizontal ? undefined : own.width,\r\n height: expandsCross && horizontal ? undefined : own.height,\r\n ...(expandsMain ? { flexGrow: Math.max(1, item?.flexGrow ?? 0) } : {}),\r\n ...(expandsCross ? { alignSelf: item?.alignSelf ?? \"stretch\" } : {}),\r\n } as never;\r\n}\r\n\r\n/** A zero-visual Yoga flex item. Fixed Unity grid constraints need explicit line breaks; this is still solved entirely by Yoga. */\r\nexport function createGridLineBreak(parent: Extract<LayoutGroupNode, { type: \"grid-layout\" }>, profile: LayoutProfileId): Container | undefined {\r\n const grid = resolveLayoutGroupSettings(parent, profile) as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n if (grid.constraint === \"flexible\" || grid.constraintCount === undefined) return undefined;\r\n const lineBreak = new Container({ label: \"__layout-grid-line-break__\" });\r\n lineBreak.layout = (grid.constraint === \"fixed-column-count\"\r\n ? { flexBasis: \"100%\", width: \"100%\", height: 0 }\r\n : { flexBasis: \"100%\", height: \"100%\", width: 0 }) as never;\r\n return lineBreak;\r\n}\r\n\r\nexport function isLayoutManagedChild(node: UINode, nodes: readonly UINode[]): boolean {\r\n return node.parentId !== null && isLayoutGroup(nodes.find((candidate) => candidate.id === node.parentId) ?? node) && nodes.some((candidate) => candidate.id === node.parentId && isLayoutGroup(candidate));\r\n}\r\n"]}
@@ -0,0 +1,17 @@
1
+ import { type LayoutProfileId, type UINode } from "@pixi-ui-editor/schema";
2
+ import { Container } from "pixi.js";
3
+ import type { LayoutSize } from "./layout.js";
4
+ import { NodeView } from "./views/NodeView.js";
5
+ /**
6
+ * Runtime-only position owner for one direct page-group child: fills the group's whole resolved
7
+ * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's
8
+ * job; the wrapped `NodeView` keeps its own pivot/rotation/scale/visibility contract via
9
+ * `updateManaged`, the same split a layout group's `LayoutItemContainer` and a scroll-view's
10
+ * `ScrollItemContainer` already use.
11
+ */
12
+ export declare class PageItemContainer extends Container {
13
+ readonly nodeView: NodeView;
14
+ constructor(nodeView: NodeView);
15
+ sync(node: UINode, profile: LayoutProfileId, size: LayoutSize): void;
16
+ }
17
+ //# sourceMappingURL=pageGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageGroup.d.ts","sourceRoot":"","sources":["../src/pageGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAClC,QAAQ,CAAC,QAAQ,EAAE,QAAQ;gBAAlB,QAAQ,EAAE,QAAQ;IAKvC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;CAGrE"}
@@ -0,0 +1,20 @@
1
+ import { Container } from "pixi.js";
2
+ /**
3
+ * Runtime-only position owner for one direct page-group child: fills the group's whole resolved
4
+ * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's
5
+ * job; the wrapped `NodeView` keeps its own pivot/rotation/scale/visibility contract via
6
+ * `updateManaged`, the same split a layout group's `LayoutItemContainer` and a scroll-view's
7
+ * `ScrollItemContainer` already use.
8
+ */
9
+ export class PageItemContainer extends Container {
10
+ nodeView;
11
+ constructor(nodeView) {
12
+ super();
13
+ this.nodeView = nodeView;
14
+ super.addChild(nodeView);
15
+ }
16
+ sync(node, profile, size) {
17
+ this.nodeView.updateManaged(node, profile, size);
18
+ }
19
+ }
20
+ //# sourceMappingURL=pageGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageGroup.js","sourceRoot":"","sources":["../src/pageGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IACzB;IAArB,YAAqB,QAAkB;QACrC,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAErC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,OAAwB,EAAE,IAAgB;QAC3D,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["import { type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport type { LayoutSize } from \"./layout.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/**\r\n * Runtime-only position owner for one direct page-group child: fills the group's whole resolved\r\n * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's\r\n * job; the wrapped `NodeView` keeps its own pivot/rotation/scale/visibility contract via\r\n * `updateManaged`, the same split a layout group's `LayoutItemContainer` and a scroll-view's\r\n * `ScrollItemContainer` already use.\r\n */\r\nexport class PageItemContainer extends Container {\r\n constructor(readonly nodeView: NodeView) {\r\n super();\r\n super.addChild(nodeView);\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, size: LayoutSize): void {\r\n this.nodeView.updateManaged(node, profile, size);\r\n }\r\n}\r\n"]}
@@ -20,6 +20,8 @@ export declare function sampleSpawnPoint(shape: ParticleSpawnShape, width: numbe
20
20
  /** A prewarmed pool entry: `render` is an opaque adapter-owned renderer object created by the same factory as the simulation slot. */
21
21
  export type ParticleSlot<TRender> = {
22
22
  render: TRender;
23
+ /** Adapter-owned static attributes must be uploaded once after this slot is (re)spawned. */
24
+ renderDirty: boolean;
23
25
  age: number;
24
26
  lifetime: number;
25
27
  x: number;
@@ -113,6 +115,7 @@ export declare class ParticleSimulator<TRender> {
113
115
  private multiplier;
114
116
  private emitting;
115
117
  private simulating;
118
+ private stopped;
116
119
  private disposed;
117
120
  private context;
118
121
  constructor(definition: ParticleEffectDefinition, hooks: ParticleRenderHooks<TRender>);
@@ -129,8 +132,8 @@ export declare class ParticleSimulator<TRender> {
129
132
  /** Idempotent terminal cleanup: destroys every pooled render object and excludes the view from further updates. */
130
133
  dispose(): void;
131
134
  /** Advances exactly one fixed step regardless of paused/stopped state, and never changes it. */
132
- step(context: ParticleSpawnContext): void;
133
- update(deltaSeconds: number, context: ParticleSpawnContext): void;
135
+ step(context: ParticleSpawnContext): boolean;
136
+ update(deltaSeconds: number, context: ParticleSpawnContext): boolean;
134
137
  getDiagnostics(): ParticleDiagnostics;
135
138
  private tick;
136
139
  private spawnParticle;
@@ -1 +1 @@
1
- {"version":3,"file":"particles.d.ts","sourceRoot":"","sources":["../src/particles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAIvE,gFAAgF;AAChF,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAS;gBACV,IAAI,EAAE,MAAM;IACxB,IAAI,IAAI,MAAM;IACd,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IACvC,2EAA2E;IAC3E,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAC9B;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAA4B;AAGzF,qGAAqG;AACrG,w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zB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAiE;gBAE7D,UAAU,EAAE,wBAAwB,EAAmB,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC;IAU7G,IAAI,WAAW,IAAI,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAA6B;IAElF,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1C,wNAAwN;IACxN,UAAU,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI;IAOlD,IAAI,IAAI,IAAI;IACZ,+EAA+E;IAC/E,KAAK,IAAI,IAAI;IACb,0FAA0F;IAC1F,IAAI,IAAI,IAAI;IAOZ,OAAO,IAAI,IAAI;IAcf,mHAAmH;IACnH,OAAO,IAAI,IAAI;IASf,gGAAgG;IAChG,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO;IAO5C,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO;IAapE,cAAc,IAAI,mBAAmB;IAIrC,OAAO,CAAC,IAAI;IA+CZ,OAAO,CAAC,aAAa;IAmCrB,OAAO,CAAC,WAAW;CAKpB"}
package/dist/particles.js CHANGED
@@ -27,9 +27,32 @@ export function sampleSpawnPoint(shape, width, height, random) {
27
27
  return { x: cx + Math.cos(angle) * radius * cx, y: cy + Math.sin(angle) * radius * cy };
28
28
  }
29
29
  function createZeroedSlot(render) {
30
- return { render, age: 0, lifetime: 0, x: 0, y: 0, vx: 0, vy: 0, spawnX: 0, spawnY: 0, rotationDegrees: 0, angularVelocityDegrees: 0, scaleStart: 1, scaleEnd: 1, sourceIndex: 0, sequenceStart: 0, worldSpawnX: 0, worldSpawnY: 0, spawnMatrixA: 1, spawnMatrixB: 0, spawnMatrixC: 0, spawnMatrixD: 1 };
30
+ return { render, renderDirty: false, age: 0, lifetime: 0, x: 0, y: 0, vx: 0, vy: 0, spawnX: 0, spawnY: 0, rotationDegrees: 0, angularVelocityDegrees: 0, scaleStart: 1, scaleEnd: 1, sourceIndex: 0, sequenceStart: 0, worldSpawnX: 0, worldSpawnY: 0, spawnMatrixA: 1, spawnMatrixB: 0, spawnMatrixC: 0, spawnMatrixD: 1 };
31
+ }
32
+ function resetSlot(slot) {
33
+ // Hot release path: reset in place instead of allocating a temporary zeroed slot for Object.assign.
34
+ slot.renderDirty = false;
35
+ slot.age = 0;
36
+ slot.lifetime = 0;
37
+ slot.x = 0;
38
+ slot.y = 0;
39
+ slot.vx = 0;
40
+ slot.vy = 0;
41
+ slot.spawnX = 0;
42
+ slot.spawnY = 0;
43
+ slot.rotationDegrees = 0;
44
+ slot.angularVelocityDegrees = 0;
45
+ slot.scaleStart = 1;
46
+ slot.scaleEnd = 1;
47
+ slot.sourceIndex = 0;
48
+ slot.sequenceStart = 0;
49
+ slot.worldSpawnX = 0;
50
+ slot.worldSpawnY = 0;
51
+ slot.spawnMatrixA = 1;
52
+ slot.spawnMatrixB = 0;
53
+ slot.spawnMatrixC = 0;
54
+ slot.spawnMatrixD = 1;
31
55
  }
32
- function resetSlot(slot) { Object.assign(slot, createZeroedSlot(slot.render)); }
33
56
  /**
34
57
  * Prewarmed object pool. `acquire`/`release` never call the factory; only `resize` does, and only for
35
58
  * the capacity delta. Shrinking removes idle free slots immediately; active slots beyond the new
@@ -112,6 +135,7 @@ export class ParticleSimulator {
112
135
  multiplier = 1;
113
136
  emitting = false;
114
137
  simulating = false;
138
+ stopped = false;
115
139
  disposed = false;
116
140
  context = { width: 0, height: 0, space: "local" };
117
141
  constructor(definition, hooks) {
@@ -136,13 +160,18 @@ export class ParticleSimulator {
136
160
  this.burstCursors = cursors;
137
161
  }
138
162
  play() { if (this.disposed)
139
- return; this.emitting = true; this.simulating = true; }
163
+ return; this.emitting = true; this.simulating = true; this.stopped = false; }
140
164
  /** Freezes emission and every live particle without resetting time or PRNG. */
141
165
  pause() { if (this.disposed)
142
- return; this.emitting = false; this.simulating = false; }
166
+ return; this.emitting = false; this.simulating = false; this.stopped = false; }
143
167
  /** Stops new spawns; already-emitted particles keep simulating to their natural death. */
144
- stop() { if (this.disposed)
145
- return; this.emitting = false; this.simulating = true; }
168
+ stop() {
169
+ if (this.disposed)
170
+ return;
171
+ this.emitting = false;
172
+ this.simulating = this.pool.values.size > 0;
173
+ this.stopped = true;
174
+ }
146
175
  restart() {
147
176
  if (this.disposed)
148
177
  return;
@@ -156,6 +185,7 @@ export class ParticleSimulator {
156
185
  this.random = new SeededRandom(this.definition.seed);
157
186
  this.emitting = true;
158
187
  this.simulating = true;
188
+ this.stopped = false;
159
189
  }
160
190
  /** Idempotent terminal cleanup: destroys every pooled render object and excludes the view from further updates. */
161
191
  dispose() {
@@ -164,34 +194,39 @@ export class ParticleSimulator {
164
194
  this.disposed = true;
165
195
  this.emitting = false;
166
196
  this.simulating = false;
197
+ this.stopped = false;
167
198
  this.pool.clear();
168
199
  }
169
200
  /** Advances exactly one fixed step regardless of paused/stopped state, and never changes it. */
170
201
  step(context) {
171
202
  if (this.disposed)
172
- return;
203
+ return false;
173
204
  this.context = context;
174
205
  this.tick(ParticleSimulator.stepSeconds);
206
+ return true;
175
207
  }
176
208
  update(deltaSeconds, context) {
177
209
  if (this.disposed || !this.simulating)
178
- return;
210
+ return false;
179
211
  this.context = context;
180
212
  this.stepAccumulator = Math.min(this.stepAccumulator + Math.max(0, deltaSeconds), ParticleSimulator.stepSeconds * 8);
213
+ let advanced = false;
181
214
  while (this.stepAccumulator >= ParticleSimulator.stepSeconds) {
182
215
  this.stepAccumulator -= ParticleSimulator.stepSeconds;
183
216
  this.tick(ParticleSimulator.stepSeconds);
217
+ advanced = true;
184
218
  }
219
+ return advanced;
185
220
  }
186
221
  getDiagnostics() {
187
- return { active: this.pool.values.size, dropped: this.pool.dropped, playing: this.emitting, stopped: this.simulating && !this.emitting && !this.disposed, disposed: this.disposed };
222
+ return { active: this.pool.values.size, dropped: this.pool.dropped, playing: this.emitting, stopped: this.stopped && !this.disposed, disposed: this.disposed };
188
223
  }
189
224
  tick(dt) {
190
225
  // Age and move existing particles before spawning: a particle created this tick starts at age 0
191
226
  // and receives its first dt on the next tick, instead of being silently pre-aged by one step.
192
227
  const movement = this.definition.particle.movement;
193
228
  const drag = Math.max(0, 1 - movement.drag * dt);
194
- for (const slot of [...this.pool.values]) {
229
+ for (const slot of this.pool.values) {
195
230
  slot.age += dt;
196
231
  if (slot.age >= slot.lifetime) {
197
232
  this.releaseSlot(slot);
@@ -216,7 +251,8 @@ export class ParticleSimulator {
216
251
  this.spawnParticle();
217
252
  }
218
253
  }
219
- e.bursts.forEach((burst, index) => {
254
+ for (let index = 0; index < e.bursts.length; index++) {
255
+ const burst = e.bursts[index];
220
256
  const triggerBase = e.delay + burst.time;
221
257
  for (;;) {
222
258
  const cursor = this.burstCursors[index] ?? 0;
@@ -229,8 +265,16 @@ export class ParticleSimulator {
229
265
  this.spawnParticle();
230
266
  this.burstCursors[index] = cursor + 1;
231
267
  }
232
- });
268
+ }
269
+ if (!e.loop && this.elapsed >= e.delay + e.duration) {
270
+ this.emitting = false;
271
+ this.stopped = true;
272
+ }
233
273
  }
274
+ // A completed one-shot or a graceful stop must not keep an otherwise idle emitter on the hot
275
+ // ticker path forever. Preserve the stopped diagnostic while putting simulation fully to sleep.
276
+ if (!this.emitting && this.pool.values.size === 0)
277
+ this.simulating = false;
234
278
  }
235
279
  spawnParticle() {
236
280
  const slot = this.pool.acquire();
@@ -239,6 +283,7 @@ export class ParticleSimulator {
239
283
  const p = this.definition.particle;
240
284
  const rand = this.random;
241
285
  const point = sampleSpawnPoint(p.spawnShape.type, this.context.width, this.context.height, rand);
286
+ slot.renderDirty = true;
242
287
  slot.age = 0;
243
288
  slot.lifetime = rand.range(p.lifetime.min, p.lifetime.max);
244
289
  slot.spawnX = point.x;