@rive-app/webgl-single 1.0.74 → 1.0.75

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 (3) hide show
  1. package/package.json +1 -1
  2. package/rive.js +9 -6
  3. package/rive.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/webgl-single",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "Rive's webgl based web api with bundled wasm.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.js CHANGED
@@ -176,7 +176,7 @@ k.run=xd;if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);
176
176
  /* 2 */
177
177
  /***/ ((module) => {
178
178
 
179
- module.exports = JSON.parse('{"name":"@rive-app/webgl-single","version":"1.0.74","description":"Rive\'s webgl based web api with bundled wasm.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
179
+ module.exports = JSON.parse('{"name":"@rive-app/webgl-single","version":"1.0.75","description":"Rive\'s webgl based web api with bundled wasm.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
180
180
 
181
181
  /***/ }),
182
182
  /* 3 */
@@ -1551,8 +1551,12 @@ var Rive = /** @class */ (function () {
1551
1551
  if (this.eventCleanup !== null) {
1552
1552
  this.eventCleanup();
1553
1553
  }
1554
- this.artboard.delete();
1555
- // TODO: delete animation and state machine instances
1554
+ // Delete all animation and state machine instances
1555
+ this.stop();
1556
+ if (this.artboard) {
1557
+ this.artboard.delete();
1558
+ this.artboard = null;
1559
+ }
1556
1560
  };
1557
1561
  // Plays specified animations; if none specified, it unpauses everything.
1558
1562
  Rive.prototype.play = function (animationNames, autoplay) {
@@ -1625,7 +1629,6 @@ var Rive = /** @class */ (function () {
1625
1629
  var stateMachineNames = mapToStringArray(params === null || params === void 0 ? void 0 : params.stateMachines);
1626
1630
  var autoplay = (_a = params === null || params === void 0 ? void 0 : params.autoplay) !== null && _a !== void 0 ? _a : false;
1627
1631
  // Stop everything and clean up
1628
- this.stop();
1629
1632
  this.cleanup();
1630
1633
  // Reinitialize an artboard instance with the state
1631
1634
  this.initArtboard(artBoardName, animationNames, stateMachineNames, autoplay);
@@ -1702,7 +1705,7 @@ var Rive = /** @class */ (function () {
1702
1705
  * Returns the name of the active artboard
1703
1706
  */
1704
1707
  get: function () {
1705
- return this.artboard.name;
1708
+ return this.artboard ? this.artboard.name : "";
1706
1709
  },
1707
1710
  enumerable: false,
1708
1711
  configurable: true
@@ -1908,7 +1911,7 @@ var Rive = /** @class */ (function () {
1908
1911
  * renderer is already active, then this will have zero effect.
1909
1912
  */
1910
1913
  Rive.prototype.startRendering = function () {
1911
- if (this.loaded && !this.frameRequestId) {
1914
+ if (this.loaded && this.artboard && !this.frameRequestId) {
1912
1915
  if (this.runtime.requestAnimationFrame) {
1913
1916
  this.frameRequestId = this.runtime.requestAnimationFrame(this.draw.bind(this));
1914
1917
  }