@silentstatestudio/perseon 0.1.0 → 0.1.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 (48) hide show
  1. package/CHANGELOG.md +31 -4
  2. package/LICENSE.md +61 -18
  3. package/README.md +9 -8
  4. package/dist/authoring/index.cjs +7 -2
  5. package/dist/authoring/index.d.cts +102 -4
  6. package/dist/authoring/index.d.ts +102 -4
  7. package/dist/authoring/index.js +6 -1
  8. package/dist/authoring/index.js.map +1 -1
  9. package/dist/{chunk-PT7F7TTB.cjs → chunk-443SQYAB.cjs} +216 -179
  10. package/dist/{chunk-ON4JV4BI.js → chunk-AVYXWDFD.js} +39 -2
  11. package/dist/chunk-AVYXWDFD.js.map +1 -0
  12. package/dist/{chunk-GDXCMDJ6.js → chunk-BEDH7OYG.js} +25 -3
  13. package/dist/chunk-BEDH7OYG.js.map +1 -0
  14. package/dist/{chunk-Q2HLLGJ7.cjs → chunk-WEQPSGPS.cjs} +23 -2
  15. package/dist/chunk-ZIMCQTYK.cjs +5 -0
  16. package/dist/chunk-ZTG42LPX.js +6 -0
  17. package/dist/{colors-CUEeQ78V.d.cts → colors-CCeWL9q4.d.cts} +362 -12
  18. package/dist/{colors-pshUJaKB.d.ts → colors-CGWrMf4V.d.ts} +362 -12
  19. package/dist/core/index.cjs +8 -3
  20. package/dist/core/index.d.cts +4 -3
  21. package/dist/core/index.d.ts +4 -3
  22. package/dist/core/index.js +8 -3
  23. package/dist/index.cjs +8 -3
  24. package/dist/index.d.cts +2 -2
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.js +8 -3
  27. package/dist/pixi-v7/index.cjs +79 -5
  28. package/dist/pixi-v7/index.d.cts +106 -7
  29. package/dist/pixi-v7/index.d.ts +106 -7
  30. package/dist/pixi-v7/index.js +77 -3
  31. package/dist/pixi-v7/index.js.map +1 -1
  32. package/dist/pixi-v8/index.cjs +78 -7
  33. package/dist/pixi-v8/index.d.cts +81 -9
  34. package/dist/pixi-v8/index.d.ts +81 -9
  35. package/dist/pixi-v8/index.js +76 -5
  36. package/dist/pixi-v8/index.js.map +1 -1
  37. package/dist/{rendering-DeUo1BsK.d.cts → rendering-dYQXmGTV.d.cts} +29 -2
  38. package/dist/{rendering-DeUo1BsK.d.ts → rendering-dYQXmGTV.d.ts} +29 -2
  39. package/dist/testing/index.cjs +23 -0
  40. package/dist/testing/index.d.cts +19 -1
  41. package/dist/testing/index.d.ts +19 -1
  42. package/dist/testing/index.js +24 -0
  43. package/dist/testing/index.js.map +1 -1
  44. package/package.json +145 -148
  45. package/dist/chunk-GDXCMDJ6.js.map +0 -1
  46. package/dist/chunk-ON4JV4BI.js.map +0 -1
  47. package/dist/chunk-SVI6WUOB.js +0 -1
  48. /package/dist/{chunk-SVI6WUOB.js.map → chunk-ZTG42LPX.js.map} +0 -0
@@ -1,3 +1,8 @@
1
+ /*!
2
+ * @silentstatestudio/perseon v0.1.1
3
+ * Required Notice: Copyright 2026 Jesús Pérez de Miguel, trading as Silent State Studio (https://perseon.dev)
4
+ * PolyForm Perimeter License 1.0.1 <https://polyformproject.org/licenses/perimeter/1.0.1>
5
+ */
1
6
  import {
2
7
  CUSTOM_PARAMETER_DOMAINS,
3
8
  DAMPING_CONFIG,
@@ -53,7 +58,7 @@ import {
53
58
  sanitizeRuntimeValue,
54
59
  spawnNumber,
55
60
  topologicalOrder
56
- } from "./chunk-GDXCMDJ6.js";
61
+ } from "./chunk-BEDH7OYG.js";
57
62
 
58
63
  // src/core/events/EventBus.ts
59
64
  var EventListeners = class {
@@ -2083,6 +2088,7 @@ var ParticleLayerView = class _ParticleLayerView {
2083
2088
  get zIndex() {
2084
2089
  return this._layer.zIndex;
2085
2090
  }
2091
+ /** Set the draw order among the layers of its emitter. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2086
2092
  set zIndex(value) {
2087
2093
  if (this._playback.checkAlive("layer.zIndex")) this._layer.zIndex = value;
2088
2094
  }
@@ -2094,6 +2100,7 @@ var ParticleLayerView = class _ParticleLayerView {
2094
2100
  get visible() {
2095
2101
  return this._layer.visible;
2096
2102
  }
2103
+ /** Show or hide this layer; a hidden layer still spawns and simulates. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2097
2104
  set visible(value) {
2098
2105
  if (this._playback.checkAlive("layer.visible")) this._layer.visible = value;
2099
2106
  }
@@ -2158,6 +2165,7 @@ var EmitterView = class _EmitterView {
2158
2165
  get spawn() {
2159
2166
  return this._emitter.spawn;
2160
2167
  }
2168
+ /** Open or close the emission. Called from inside an update, it takes effect when that tick ends. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2161
2169
  set spawn(value) {
2162
2170
  if (!this._playback.checkAlive("emitter.spawn")) return;
2163
2171
  const instance = this._playback.instance;
@@ -2171,6 +2179,7 @@ var EmitterView = class _EmitterView {
2171
2179
  get spawnCount() {
2172
2180
  return this._emitter.spawnCount;
2173
2181
  }
2182
+ /** Set the number of particles of a burst. Read at the next cycle. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2174
2183
  set spawnCount(value) {
2175
2184
  if (this._playback.checkAlive("emitter.spawnCount")) this._emitter.spawnCount = value;
2176
2185
  }
@@ -2178,6 +2187,7 @@ var EmitterView = class _EmitterView {
2178
2187
  get spawnRate() {
2179
2188
  return this._emitter.spawnRate;
2180
2189
  }
2190
+ /** Set the particles per second of a rate emission; 0 means no rate emission. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2181
2191
  set spawnRate(value) {
2182
2192
  if (this._playback.checkAlive("emitter.spawnRate")) this._emitter.spawnRate = value;
2183
2193
  }
@@ -2185,6 +2195,7 @@ var EmitterView = class _EmitterView {
2185
2195
  get spawnDuration() {
2186
2196
  return this._emitter.spawnDuration;
2187
2197
  }
2198
+ /** Set the seconds a rate emission lasts per cycle; 0 means it never ends. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2188
2199
  set spawnDuration(value) {
2189
2200
  if (this._playback.checkAlive("emitter.spawnDuration")) this._emitter.spawnDuration = value;
2190
2201
  }
@@ -2192,6 +2203,7 @@ var EmitterView = class _EmitterView {
2192
2203
  get startDelay() {
2193
2204
  return this._emitter.startDelay;
2194
2205
  }
2206
+ /** Set the seconds the emitter waits after a session starts before it begins to emit. Read when the next session starts. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2195
2207
  set startDelay(value) {
2196
2208
  if (this._playback.checkAlive("emitter.startDelay")) this._emitter.startDelay = value;
2197
2209
  }
@@ -2199,6 +2211,7 @@ var EmitterView = class _EmitterView {
2199
2211
  get repeat() {
2200
2212
  return this._emitter.repeat;
2201
2213
  }
2214
+ /** Set how many times the emission cycle repeats after the first; the highest value allowed means forever. Read when the next session starts. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2202
2215
  set repeat(value) {
2203
2216
  if (this._playback.checkAlive("emitter.repeat")) this._emitter.repeat = value;
2204
2217
  }
@@ -2206,6 +2219,7 @@ var EmitterView = class _EmitterView {
2206
2219
  get repeatInterval() {
2207
2220
  return this._emitter.repeatInterval;
2208
2221
  }
2222
+ /** Set the seconds between the end of one emission cycle and the start of the next. Read when the next cycle is armed. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2209
2223
  set repeatInterval(value) {
2210
2224
  if (this._playback.checkAlive("emitter.repeatInterval")) this._emitter.repeatInterval = value;
2211
2225
  }
@@ -2213,6 +2227,7 @@ var EmitterView = class _EmitterView {
2213
2227
  get simulateTime() {
2214
2228
  return this._emitter.simulateTime;
2215
2229
  }
2230
+ /** Set the seconds of simulation run as warm-up when a session starts. Read when the next session starts. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2216
2231
  set simulateTime(value) {
2217
2232
  if (this._playback.checkAlive("emitter.simulateTime")) this._emitter.simulateTime = value;
2218
2233
  }
@@ -2220,6 +2235,7 @@ var EmitterView = class _EmitterView {
2220
2235
  get ensureAliveCount() {
2221
2236
  return this._emitter.ensureAliveCount;
2222
2237
  }
2238
+ /** Set the minimum number of live particles the emitter spawns up to once the warm-up ends. Read when the next session starts. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2223
2239
  set ensureAliveCount(value) {
2224
2240
  if (this._playback.checkAlive("emitter.ensureAliveCount")) this._emitter.ensureAliveCount = value;
2225
2241
  }
@@ -2227,6 +2243,7 @@ var EmitterView = class _EmitterView {
2227
2243
  get maxPoolSize() {
2228
2244
  return this._emitter.maxPoolSize;
2229
2245
  }
2246
+ /** Set the maximum number of live particles of the emitter; read at the next birth. A value that is not a finite number throws a `PerseonConfigError`; one out of its domain is clipped, with a warning. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2230
2247
  set maxPoolSize(value) {
2231
2248
  if (this._playback.checkAlive("emitter.maxPoolSize")) this._emitter.maxPoolSize = value;
2232
2249
  }
@@ -2234,6 +2251,7 @@ var EmitterView = class _EmitterView {
2234
2251
  get particleLimitStrategy() {
2235
2252
  return this._emitter.particleLimitStrategy;
2236
2253
  }
2254
+ /** Set what happens when the emitter is at its particle limit; read at the next birth. A value that is not one of the strategies throws a `PerseonConfigError`. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2237
2255
  set particleLimitStrategy(value) {
2238
2256
  if (this._playback.checkAlive("emitter.particleLimitStrategy")) this._emitter.particleLimitStrategy = value;
2239
2257
  }
@@ -2241,6 +2259,7 @@ var EmitterView = class _EmitterView {
2241
2259
  get particleSpawnStrategy() {
2242
2260
  return this._emitter.particleSpawnStrategy;
2243
2261
  }
2262
+ /** Set where a new particle is drawn among the live ones of its layer; read at the next birth. A value that is not one of the strategies throws a `PerseonConfigError`. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2244
2263
  set particleSpawnStrategy(value) {
2245
2264
  if (this._playback.checkAlive("emitter.particleSpawnStrategy")) this._emitter.particleSpawnStrategy = value;
2246
2265
  }
@@ -2256,6 +2275,7 @@ var EmitterView = class _EmitterView {
2256
2275
  get effectiveWarmUpMaxTicks() {
2257
2276
  return this._emitter.effectiveWarmUpMaxTicks;
2258
2277
  }
2278
+ /** Set this emitter's warm-up tick budget, capped by the animation's. `undefined` inherits the animation's; any other value that is not a positive number is not applied and is reported by the diagnostics policy. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2259
2279
  set warmUpMaxTicks(value) {
2260
2280
  if (this._playback.checkAlive("emitter.warmUpMaxTicks")) this._emitter.warmUpMaxTicks = value;
2261
2281
  }
@@ -2267,6 +2287,7 @@ var EmitterView = class _EmitterView {
2267
2287
  get effectiveMaxUpdateRate() {
2268
2288
  return this._emitter.effectiveMaxUpdateRate;
2269
2289
  }
2290
+ /** Set this emitter's simulation rate in steps per second, capped by the animation's. `undefined` inherits the animation's; any other value that is not a positive number is not applied and is reported by the diagnostics policy. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2270
2291
  set maxUpdateRate(value) {
2271
2292
  if (this._playback.checkAlive("emitter.maxUpdateRate")) this._emitter.maxUpdateRate = value;
2272
2293
  }
@@ -2320,6 +2341,7 @@ var EmitterView = class _EmitterView {
2320
2341
  get visible() {
2321
2342
  return this._emitter.visible;
2322
2343
  }
2344
+ /** Show or hide this emitter and its layers. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
2323
2345
  set visible(value) {
2324
2346
  if (this._playback.checkAlive("emitter.visible")) this._emitter.visible = value;
2325
2347
  }
@@ -2495,7 +2517,9 @@ var ParticleItem = class {
2495
2517
  * context at it without going through the layer.
2496
2518
  */
2497
2519
  _listState = [];
2520
+ /** The random value drawn at birth; read through `seed`. */
2498
2521
  _seed = 0;
2522
+ /** The state of the particle's texture-frame animation, or `null` when it has none or it has ended. */
2499
2523
  _spriteAnimation = null;
2500
2524
  /**
2501
2525
  * The state the layer's program keeps per particle: frozen
@@ -7520,6 +7544,7 @@ var PerseonPlayback = class {
7520
7544
  get maxUpdateRate() {
7521
7545
  return this.instance.maxUpdateRate;
7522
7546
  }
7547
+ /** Set the animation's simulation rate, in steps per second. A value that is not a positive number is not applied and is reported by the diagnostics policy; use `Infinity` for no limit. Positive values are clipped to 1–1,000,000, so `Infinity` reads back as 1,000,000. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7523
7548
  set maxUpdateRate(value) {
7524
7549
  if (this.checkAlive("maxUpdateRate")) this.instance.maxUpdateRate = value;
7525
7550
  }
@@ -7532,6 +7557,7 @@ var PerseonPlayback = class {
7532
7557
  get timeScale() {
7533
7558
  return this.instance.timeScale;
7534
7559
  }
7560
+ /** Set the factor of the simulated step: 1 is real time, 0 freezes the simulation without pausing it. Throws a `PerseonConfigError` for a negative or non-finite value. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7535
7561
  set timeScale(value) {
7536
7562
  if (this.checkAlive("timeScale")) this.instance.timeScale = value;
7537
7563
  }
@@ -7539,6 +7565,7 @@ var PerseonPlayback = class {
7539
7565
  get warmUpMaxTicks() {
7540
7566
  return this.instance.warmUpMaxTicks;
7541
7567
  }
7568
+ /** Set the animation's warm-up tick budget. A value that is not a positive number is not applied and is reported by the diagnostics policy. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7542
7569
  set warmUpMaxTicks(value) {
7543
7570
  if (this.checkAlive("warmUpMaxTicks")) this.instance.warmUpMaxTicks = value;
7544
7571
  }
@@ -7555,6 +7582,7 @@ var PerseonPlayback = class {
7555
7582
  get autoRelease() {
7556
7583
  return this.instance.autoRelease;
7557
7584
  }
7585
+ /** Choose whether the instance goes back to the pool at its natural end. Setting `true` on a playback already stopped at its natural end gives it back immediately. A playback with no pool (built with `new PerseonPlayback`) has nowhere to go back to. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7558
7586
  set autoRelease(value) {
7559
7587
  if (this.checkAlive("autoRelease")) this.instance.autoRelease = value;
7560
7588
  }
@@ -7590,6 +7618,7 @@ var PerseonPlayback = class {
7590
7618
  get x() {
7591
7619
  return this.instance.x;
7592
7620
  }
7621
+ /** Move the whole animation horizontally within its parent. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7593
7622
  set x(value) {
7594
7623
  if (this.checkAlive("x")) this.instance.x = value;
7595
7624
  }
@@ -7597,6 +7626,7 @@ var PerseonPlayback = class {
7597
7626
  get y() {
7598
7627
  return this.instance.y;
7599
7628
  }
7629
+ /** Move the whole animation vertically within its parent. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7600
7630
  set y(value) {
7601
7631
  if (this.checkAlive("y")) this.instance.y = value;
7602
7632
  }
@@ -7614,6 +7644,7 @@ var PerseonPlayback = class {
7614
7644
  get visible() {
7615
7645
  return this.instance.visible;
7616
7646
  }
7647
+ /** Hide or show the whole animation; hiding does not pause the simulation. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7617
7648
  set visible(value) {
7618
7649
  if (this.checkAlive("visible")) this.instance.visible = value;
7619
7650
  }
@@ -7666,6 +7697,7 @@ var PerseonPlayback = class {
7666
7697
  get gravity() {
7667
7698
  return this.instance.gravity;
7668
7699
  }
7700
+ /** Set the gravitational acceleration; a shortcut of `option('externalForces.gravity').set`. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7669
7701
  set gravity(value) {
7670
7702
  if (this.checkAlive("gravity")) this.instance.gravity = value;
7671
7703
  }
@@ -7673,6 +7705,7 @@ var PerseonPlayback = class {
7673
7705
  get damping() {
7674
7706
  return this.instance.damping;
7675
7707
  }
7708
+ /** Set the movement damping; a shortcut of `option('externalForces.damping').set`. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7676
7709
  set damping(value) {
7677
7710
  if (this.checkAlive("damping")) this.instance.damping = value;
7678
7711
  }
@@ -7684,6 +7717,7 @@ var PerseonPlayback = class {
7684
7717
  get wind() {
7685
7718
  return this.instance.wind;
7686
7719
  }
7720
+ /** Set the wind from a point; a shortcut of `option('externalForces.wind').set`. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7687
7721
  set wind(value) {
7688
7722
  if (this.checkAlive("wind")) this.instance.wind = value;
7689
7723
  }
@@ -7691,6 +7725,7 @@ var PerseonPlayback = class {
7691
7725
  get windVector() {
7692
7726
  return this.instance.windVector;
7693
7727
  }
7728
+ /** Set the wind from a vector (angle and magnitude); a shortcut of `option('externalForces.wind').set`. Once the playback is over (`alive` is false), it does nothing and is reported by the diagnostics policy. */
7694
7729
  set windVector(value) {
7695
7730
  if (this.checkAlive("windVector")) this.instance.windVector = value;
7696
7731
  }
@@ -8231,6 +8266,8 @@ var PerseonIntegration = class {
8231
8266
  /** @internal */
8232
8267
  _destroyed = false;
8233
8268
  /**
8269
+ * Build an integration over a renderer. Backends call this from their own constructor; a host rarely does.
8270
+ *
8234
8271
  * @param renderer the backend, built by the integration from its host's own
8235
8272
  * objects.
8236
8273
  * @param ticker the host's frame source. Optional because the renderer
@@ -8429,4 +8466,4 @@ export {
8429
8466
  PerseonIntegration,
8430
8467
  parseAnimationOptions
8431
8468
  };
8432
- //# sourceMappingURL=chunk-ON4JV4BI.js.map
8469
+ //# sourceMappingURL=chunk-AVYXWDFD.js.map