@rive-app/canvas-lite 2.26.1 → 2.26.2
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 +1 -1
- package/rive.d.ts +1 -0
- package/rive.js +15 -4
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_fallback.wasm +0 -0
package/package.json
CHANGED
package/rive.d.ts
CHANGED
package/rive.js
CHANGED
|
@@ -2269,7 +2269,7 @@ Qc();
|
|
|
2269
2269
|
/* 2 */
|
|
2270
2270
|
/***/ ((module) => {
|
|
2271
2271
|
|
|
2272
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.26.
|
|
2272
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.26.2","description":"A lite version of 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"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
2273
2273
|
|
|
2274
2274
|
/***/ }),
|
|
2275
2275
|
/* 3 */
|
|
@@ -4055,6 +4055,8 @@ var Rive = /** @class */ (function () {
|
|
|
4055
4055
|
var _a;
|
|
4056
4056
|
// Tracks if a Rive file is loaded
|
|
4057
4057
|
this.loaded = false;
|
|
4058
|
+
// Tracks if a Rive file is destroyed
|
|
4059
|
+
this.destroyed = false;
|
|
4058
4060
|
// Reference of an object that handles any observers for the animation
|
|
4059
4061
|
this._observed = null;
|
|
4060
4062
|
/**
|
|
@@ -4191,12 +4193,15 @@ var Rive = /** @class */ (function () {
|
|
|
4191
4193
|
Rive.prototype.init = function (_a) {
|
|
4192
4194
|
var _this = this;
|
|
4193
4195
|
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c;
|
|
4196
|
+
if (this.destroyed) {
|
|
4197
|
+
return;
|
|
4198
|
+
}
|
|
4194
4199
|
this.src = src;
|
|
4195
4200
|
this.buffer = buffer;
|
|
4196
4201
|
this.riveFile = riveFile;
|
|
4197
4202
|
// If no source file url specified, it's a bust
|
|
4198
4203
|
if (!this.src && !this.buffer && !this.riveFile) {
|
|
4199
|
-
throw new
|
|
4204
|
+
throw new RiveError(Rive.missingErrorMessage);
|
|
4200
4205
|
}
|
|
4201
4206
|
// List of animations that should be initialized.
|
|
4202
4207
|
var startingAnimationNames = mapToStringArray(animations);
|
|
@@ -4208,6 +4213,9 @@ var Rive = /** @class */ (function () {
|
|
|
4208
4213
|
// Ensure the runtime is loaded
|
|
4209
4214
|
RuntimeLoader.awaitInstance()
|
|
4210
4215
|
.then(function (runtime) {
|
|
4216
|
+
if (_this.destroyed) {
|
|
4217
|
+
return;
|
|
4218
|
+
}
|
|
4211
4219
|
_this.runtime = runtime;
|
|
4212
4220
|
_this.removeRiveListeners();
|
|
4213
4221
|
_this.deleteRiveRenderer();
|
|
@@ -4580,6 +4588,7 @@ var Rive = /** @class */ (function () {
|
|
|
4580
4588
|
*/
|
|
4581
4589
|
Rive.prototype.cleanup = function () {
|
|
4582
4590
|
var _a;
|
|
4591
|
+
this.destroyed = true;
|
|
4583
4592
|
// Stop the renderer if it hasn't already been stopped.
|
|
4584
4593
|
this.stopRendering();
|
|
4585
4594
|
// Clean up any artboard, animation or state machine instances.
|
|
@@ -4589,9 +4598,11 @@ var Rive = /** @class */ (function () {
|
|
|
4589
4598
|
observers.remove(this._observed);
|
|
4590
4599
|
}
|
|
4591
4600
|
this.removeRiveListeners();
|
|
4592
|
-
(
|
|
4601
|
+
if (this.file) {
|
|
4602
|
+
(_a = this.riveFile) === null || _a === void 0 ? void 0 : _a.cleanup();
|
|
4603
|
+
this.file = null;
|
|
4604
|
+
}
|
|
4593
4605
|
this.riveFile = null;
|
|
4594
|
-
this.file = null;
|
|
4595
4606
|
this.deleteRiveRenderer();
|
|
4596
4607
|
if (this._audioEventListener !== null) {
|
|
4597
4608
|
audioManager.remove(this._audioEventListener);
|