@rive-app/webgl 2.23.0 → 2.23.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 +42 -14
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +23 -0
- package/rive_fallback.wasm +0 -0
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export declare class RuntimeLoader {
|
|
|
73
73
|
static getInstance(callback: RuntimeCallback): void;
|
|
74
74
|
static awaitInstance(): Promise<rc.RiveCanvas>;
|
|
75
75
|
static setWasmUrl(url: string): void;
|
|
76
|
+
static getWasmUrl(): string;
|
|
76
77
|
}
|
|
77
78
|
export declare enum StateMachineInputType {
|
|
78
79
|
Number = 56,
|
package/rive.js
CHANGED
|
@@ -408,7 +408,7 @@ function Qa(a, b) {
|
|
|
408
408
|
return Pa(c, a, b);
|
|
409
409
|
}));
|
|
410
410
|
}
|
|
411
|
-
var Ra, Sa, Wa = {
|
|
411
|
+
var Ra, Sa, Wa = {696428:(a, b, c, d, e) => {
|
|
412
412
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
413
413
|
return 0;
|
|
414
414
|
}
|
|
@@ -471,9 +471,9 @@ var Ra, Sa, Wa = {693516:(a, b, c, d, e) => {
|
|
|
471
471
|
}
|
|
472
472
|
window.h.Ea += 1;
|
|
473
473
|
return 1;
|
|
474
|
-
},
|
|
474
|
+
}, 698606:() => {
|
|
475
475
|
"undefined" !== typeof window.h && (--window.h.Ea, 0 === window.h.Ea && delete window.h);
|
|
476
|
-
},
|
|
476
|
+
}, 698770:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 698874:() => {
|
|
477
477
|
try {
|
|
478
478
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
479
479
|
a.close();
|
|
@@ -481,7 +481,7 @@ var Ra, Sa, Wa = {693516:(a, b, c, d, e) => {
|
|
|
481
481
|
} catch (c) {
|
|
482
482
|
return 0;
|
|
483
483
|
}
|
|
484
|
-
},
|
|
484
|
+
}, 699045:(a, b, c, d, e, f) => {
|
|
485
485
|
if ("undefined" === typeof window.h) {
|
|
486
486
|
return -1;
|
|
487
487
|
}
|
|
@@ -527,7 +527,7 @@ var Ra, Sa, Wa = {693516:(a, b, c, d, e) => {
|
|
|
527
527
|
a == window.h.H.Ca && g.X.connect(g.I.destination);
|
|
528
528
|
g.lb = f;
|
|
529
529
|
return window.h.nc(g);
|
|
530
|
-
},
|
|
530
|
+
}, 701922:a => window.h.ta(a).I.sampleRate, 701995:a => {
|
|
531
531
|
a = window.h.ta(a);
|
|
532
532
|
void 0 !== a.X && (a.X.onaudioprocess = function() {
|
|
533
533
|
}, a.X.disconnect(), a.X = void 0);
|
|
@@ -535,13 +535,13 @@ var Ra, Sa, Wa = {693516:(a, b, c, d, e) => {
|
|
|
535
535
|
a.I.close();
|
|
536
536
|
a.I = void 0;
|
|
537
537
|
a.lb = void 0;
|
|
538
|
-
},
|
|
538
|
+
}, 702395:a => {
|
|
539
539
|
window.h.xb(a);
|
|
540
|
-
},
|
|
540
|
+
}, 702445:a => {
|
|
541
541
|
a = window.h.ta(a);
|
|
542
542
|
a.I.resume();
|
|
543
543
|
a.state = window.h.ha.sb;
|
|
544
|
-
},
|
|
544
|
+
}, 702584:a => {
|
|
545
545
|
a = window.h.ta(a);
|
|
546
546
|
a.I.suspend();
|
|
547
547
|
a.state = window.h.ha.stopped;
|
|
@@ -4061,7 +4061,7 @@ Je();
|
|
|
4061
4061
|
/* 2 */
|
|
4062
4062
|
/***/ ((module) => {
|
|
4063
4063
|
|
|
4064
|
-
module.exports = JSON.parse('{"name":"@rive-app/webgl","version":"2.23.
|
|
4064
|
+
module.exports = JSON.parse('{"name":"@rive-app/webgl","version":"2.23.2","description":"Rive\'s webgl 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.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
4065
4065
|
|
|
4066
4066
|
/***/ }),
|
|
4067
4067
|
/* 3 */
|
|
@@ -4726,20 +4726,44 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
4726
4726
|
(_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
|
|
4727
4727
|
}
|
|
4728
4728
|
})
|
|
4729
|
-
.catch(function () {
|
|
4729
|
+
.catch(function (error) {
|
|
4730
|
+
// Capture specific error details
|
|
4731
|
+
var errorDetails = {
|
|
4732
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error",
|
|
4733
|
+
type: (error === null || error === void 0 ? void 0 : error.name) || "Error",
|
|
4734
|
+
// Some browsers may provide additional WebAssembly-specific details
|
|
4735
|
+
wasmError: error instanceof WebAssembly.CompileError ||
|
|
4736
|
+
error instanceof WebAssembly.RuntimeError,
|
|
4737
|
+
originalError: error,
|
|
4738
|
+
};
|
|
4739
|
+
// Log detailed error for debugging
|
|
4740
|
+
console.debug("Rive WASM load error details:", errorDetails);
|
|
4730
4741
|
// In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
|
|
4731
4742
|
// This `rive_fallback.wasm` is compiled to support older architecture.
|
|
4732
4743
|
// TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
|
|
4733
4744
|
var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
|
|
4734
4745
|
if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
|
|
4735
|
-
console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, ", trying jsdelivr as a backup"));
|
|
4746
|
+
console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
|
|
4736
4747
|
RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
|
|
4737
4748
|
RuntimeLoader.loadRuntime();
|
|
4738
4749
|
}
|
|
4739
4750
|
else {
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4751
|
+
var errorMessage = [
|
|
4752
|
+
"Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
|
|
4753
|
+
"Possible reasons:",
|
|
4754
|
+
"- Network connection is down",
|
|
4755
|
+
"- WebAssembly is not supported in this environment",
|
|
4756
|
+
"- The WASM file is corrupted or incompatible",
|
|
4757
|
+
"\nError details:",
|
|
4758
|
+
"- Type: ".concat(errorDetails.type),
|
|
4759
|
+
"- Message: ".concat(errorDetails.message),
|
|
4760
|
+
"- WebAssembly-specific error: ".concat(errorDetails.wasmError),
|
|
4761
|
+
"\nTo resolve, you may need to:",
|
|
4762
|
+
"1. Check your network connection",
|
|
4763
|
+
"2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
|
|
4764
|
+
"3. Call RuntimeLoader.loadRuntime() again",
|
|
4765
|
+
].join("\n");
|
|
4766
|
+
console.error(errorMessage);
|
|
4743
4767
|
}
|
|
4744
4768
|
});
|
|
4745
4769
|
};
|
|
@@ -4767,6 +4791,10 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
4767
4791
|
RuntimeLoader.setWasmUrl = function (url) {
|
|
4768
4792
|
RuntimeLoader.wasmURL = url;
|
|
4769
4793
|
};
|
|
4794
|
+
// Gets the current wasm url
|
|
4795
|
+
RuntimeLoader.getWasmUrl = function () {
|
|
4796
|
+
return RuntimeLoader.wasmURL;
|
|
4797
|
+
};
|
|
4770
4798
|
// Flag to indicate that loading has started/completed
|
|
4771
4799
|
RuntimeLoader.isLoading = false;
|
|
4772
4800
|
// List of callbacks for the runtime that come in while loading
|