@rive-app/canvas 2.38.1 → 2.38.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas",
3
- "version": "2.38.1",
3
+ "version": "2.38.3",
4
4
  "description": "Rive's canvas based web api.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.js CHANGED
@@ -1084,7 +1084,7 @@ function Za(a, b) {
1084
1084
  return Ya(c, a, b);
1085
1085
  }));
1086
1086
  }
1087
- var $a, ab, eb = {485789:(a, b, c, d, e) => {
1087
+ var $a, ab, eb = {485917:(a, b, c, d, e) => {
1088
1088
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
1089
1089
  return 0;
1090
1090
  }
@@ -1147,11 +1147,11 @@ var $a, ab, eb = {485789:(a, b, c, d, e) => {
1147
1147
  }
1148
1148
  window.h.za += 1;
1149
1149
  return 1;
1150
- }, 487967:() => {
1150
+ }, 488095:() => {
1151
1151
  "undefined" !== typeof window.h && (window.h.Sa.map(function(a) {
1152
1152
  document.removeEventListener(a, window.h.unlock, !0);
1153
1153
  }), --window.h.za, 0 === window.h.za && delete window.h);
1154
- }, 488271:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 488375:() => {
1154
+ }, 488399:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 488503:() => {
1155
1155
  try {
1156
1156
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
1157
1157
  a.close();
@@ -1159,7 +1159,7 @@ var $a, ab, eb = {485789:(a, b, c, d, e) => {
1159
1159
  } catch (c) {
1160
1160
  return 0;
1161
1161
  }
1162
- }, 488546:(a, b, c, d, e, f) => {
1162
+ }, 488674:(a, b, c, d, e, f) => {
1163
1163
  if ("undefined" === typeof window.h) {
1164
1164
  return -1;
1165
1165
  }
@@ -1205,7 +1205,7 @@ var $a, ab, eb = {485789:(a, b, c, d, e) => {
1205
1205
  a == window.h.J.xa && g.Z.connect(g.L.destination);
1206
1206
  g.pb = f;
1207
1207
  return window.h.tc(g);
1208
- }, 491423:a => window.h.qa(a).L.sampleRate, 491496:a => {
1208
+ }, 491551:a => window.h.qa(a).L.sampleRate, 491624:a => {
1209
1209
  a = window.h.qa(a);
1210
1210
  void 0 !== a.Z && (a.Z.onaudioprocess = function() {
1211
1211
  }, a.Z.disconnect(), a.Z = void 0);
@@ -1213,13 +1213,13 @@ var $a, ab, eb = {485789:(a, b, c, d, e) => {
1213
1213
  a.L.close();
1214
1214
  a.L = void 0;
1215
1215
  a.pb = void 0;
1216
- }, 491896:a => {
1216
+ }, 492024:a => {
1217
1217
  window.h.Ab(a);
1218
- }, 491946:a => {
1218
+ }, 492074:a => {
1219
1219
  a = window.h.qa(a);
1220
1220
  a.L.resume();
1221
1221
  a.state = window.h.ga.wb;
1222
- }, 492085:a => {
1222
+ }, 492213:a => {
1223
1223
  a = window.h.qa(a);
1224
1224
  a.L.suspend();
1225
1225
  a.state = window.h.ga.stopped;
@@ -3752,7 +3752,7 @@ moduleRtn = ea;
3752
3752
  /* 5 */
3753
3753
  /***/ ((module) => {
3754
3754
 
3755
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.38.1","description":"Rive\'s canvas based web api.","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.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3755
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.38.3","description":"Rive\'s canvas based web api.","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.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3756
3756
 
3757
3757
  /***/ }),
3758
3758
  /* 6 */
@@ -6955,10 +6955,15 @@ var Rive = /** @class */ (function () {
6955
6955
  * Rive class
6956
6956
  */
6957
6957
  Rive.prototype.cleanup = function () {
6958
- var _a, _b;
6958
+ var _a, _b, _c, _d;
6959
6959
  this.destroyed = true;
6960
6960
  // Stop the renderer if it hasn't already been stopped.
6961
6961
  this.stopRendering();
6962
+ // Make the GL context backing this renderer current before any WASM teardown
6963
+ // that frees GPU resources. Binding here covers the artboard/file deletes;
6964
+ // deleteRiveRenderer() re-binds for the renderer's own delete. No-op on the
6965
+ // canvas2d build
6966
+ (_b = (_a = this.renderer) === null || _a === void 0 ? void 0 : _a.bindContext) === null || _b === void 0 ? void 0 : _b.call(_a);
6962
6967
  // Clean up any artboard, animation or state machine instances.
6963
6968
  this.cleanupInstances();
6964
6969
  // Remove from observer
@@ -6967,7 +6972,7 @@ var Rive = /** @class */ (function () {
6967
6972
  }
6968
6973
  this.removeRiveListeners();
6969
6974
  if (this.file) {
6970
- (_a = this.riveFile) === null || _a === void 0 ? void 0 : _a.cleanup();
6975
+ (_c = this.riveFile) === null || _c === void 0 ? void 0 : _c.cleanup();
6971
6976
  this.file = null;
6972
6977
  }
6973
6978
  this.riveFile = null;
@@ -6980,7 +6985,7 @@ var Rive = /** @class */ (function () {
6980
6985
  document.removeEventListener('visibilitychange', this._pageVisibilityHandler);
6981
6986
  this._pageVisibilityHandler = null;
6982
6987
  }
6983
- (_b = this._viewModelInstance) === null || _b === void 0 ? void 0 : _b.cleanup();
6988
+ (_d = this._viewModelInstance) === null || _d === void 0 ? void 0 : _d.cleanup();
6984
6989
  this._viewModelInstance = null;
6985
6990
  this._dataEnums = null;
6986
6991
  };