@rive-app/webgl2 2.14.4 → 2.15.0
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 +10 -3
- package/rive.js +65 -46
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +26 -4
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as rc from "./rive_advanced.mjs";
|
|
2
|
-
export type { FileAsset, FontAsset, ImageAsset } from "./rive_advanced.mjs";
|
|
2
|
+
export type { FileAsset, AudioAsset, FontAsset, ImageAsset, } from "./rive_advanced.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Generic type for a parameterless void callback
|
|
5
5
|
*/
|
|
@@ -567,17 +567,24 @@ export declare const Testing: {
|
|
|
567
567
|
EventManager: typeof EventManager;
|
|
568
568
|
TaskQueueManager: typeof TaskQueueManager;
|
|
569
569
|
};
|
|
570
|
+
/**
|
|
571
|
+
* Decodes bytes into an audio asset.
|
|
572
|
+
*
|
|
573
|
+
* Be sure to call `.unref()` on the audio once it is no longer needed. This
|
|
574
|
+
* allows the engine to clean it up when it is not used by any more animations.
|
|
575
|
+
*/
|
|
576
|
+
export declare const decodeAudio: (bytes: Uint8Array) => Promise<rc.Audio>;
|
|
570
577
|
/**
|
|
571
578
|
* Decodes bytes into an image.
|
|
572
579
|
*
|
|
573
|
-
* Be sure to call `.
|
|
580
|
+
* Be sure to call `.unref()` on the image once it is no longer needed. This
|
|
574
581
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
575
582
|
*/
|
|
576
583
|
export declare const decodeImage: (bytes: Uint8Array) => Promise<rc.Image>;
|
|
577
584
|
/**
|
|
578
585
|
* Decodes bytes into a font.
|
|
579
586
|
*
|
|
580
|
-
* Be sure to call `.
|
|
587
|
+
* Be sure to call `.unref()` on the font once it is no longer needed. This
|
|
581
588
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
582
589
|
*/
|
|
583
590
|
export declare const decodeFont: (bytes: Uint8Array) => Promise<rc.Font>;
|
package/rive.js
CHANGED
|
@@ -91,52 +91,57 @@ function ea() {
|
|
|
91
91
|
const fa = n.onRuntimeInitialized;
|
|
92
92
|
n.onRuntimeInitialized = function() {
|
|
93
93
|
fa && fa();
|
|
94
|
-
let a = n.
|
|
95
|
-
n.
|
|
96
|
-
|
|
97
|
-
d
|
|
94
|
+
let a = n.decodeAudio;
|
|
95
|
+
n.decodeAudio = function(d, e) {
|
|
96
|
+
d = a(d);
|
|
97
|
+
e(d);
|
|
98
98
|
};
|
|
99
|
-
|
|
100
|
-
n.
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
let b = n.decodeFont;
|
|
100
|
+
n.decodeFont = function(d, e) {
|
|
101
|
+
d = b(d);
|
|
102
|
+
e(d);
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
const c = n.FileAssetLoader;
|
|
105
|
+
n.ptrToAsset = d => {
|
|
106
|
+
let e = n.ptrToFileAsset(d);
|
|
107
|
+
return e.isImage ? n.ptrToImageAsset(d) : e.isFont ? n.ptrToFontAsset(d) : e.isAudio ? n.ptrToAudioAsset(d) : e;
|
|
108
|
+
};
|
|
109
|
+
n.CustomFileAssetLoader = c.extend("CustomFileAssetLoader", {__construct:function({loadContents:d}) {
|
|
105
110
|
this.__parent.__construct.call(this);
|
|
106
|
-
this.Ab =
|
|
107
|
-
}, loadContents:function(
|
|
108
|
-
|
|
109
|
-
return this.Ab(
|
|
111
|
+
this.Ab = d;
|
|
112
|
+
}, loadContents:function(d, e) {
|
|
113
|
+
d = n.ptrToAsset(d);
|
|
114
|
+
return this.Ab(d, e);
|
|
110
115
|
},});
|
|
111
|
-
n.CDNFileAssetLoader =
|
|
116
|
+
n.CDNFileAssetLoader = c.extend("CDNFileAssetLoader", {__construct:function() {
|
|
112
117
|
this.__parent.__construct.call(this);
|
|
113
|
-
}, loadContents:function(
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
if ("" ===
|
|
118
|
+
}, loadContents:function(d) {
|
|
119
|
+
let e = n.ptrToAsset(d);
|
|
120
|
+
d = e.cdnUuid;
|
|
121
|
+
if ("" === d) {
|
|
117
122
|
return !1;
|
|
118
123
|
}
|
|
119
|
-
(function(
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
4 ==
|
|
124
|
+
(function(f, g) {
|
|
125
|
+
var m = new XMLHttpRequest();
|
|
126
|
+
m.responseType = "arraybuffer";
|
|
127
|
+
m.onreadystatechange = function() {
|
|
128
|
+
4 == m.readyState && 200 == m.status && g(m);
|
|
124
129
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})(
|
|
128
|
-
|
|
130
|
+
m.open("GET", f, !0);
|
|
131
|
+
m.send(null);
|
|
132
|
+
})(e.cdnBaseUrl + "/" + d, f => {
|
|
133
|
+
e.decode(new Uint8Array(f.response));
|
|
129
134
|
});
|
|
130
135
|
return !0;
|
|
131
136
|
},});
|
|
132
|
-
n.FallbackFileAssetLoader =
|
|
137
|
+
n.FallbackFileAssetLoader = c.extend("FallbackFileAssetLoader", {__construct:function() {
|
|
133
138
|
this.__parent.__construct.call(this);
|
|
134
139
|
this.fb = [];
|
|
135
|
-
}, addLoader:function(
|
|
136
|
-
this.fb.push(
|
|
137
|
-
}, loadContents:function(
|
|
138
|
-
for (let
|
|
139
|
-
if (
|
|
140
|
+
}, addLoader:function(d) {
|
|
141
|
+
this.fb.push(d);
|
|
142
|
+
}, loadContents:function(d, e) {
|
|
143
|
+
for (let f of this.fb) {
|
|
144
|
+
if (f.loadContents(d, e)) {
|
|
140
145
|
return !0;
|
|
141
146
|
}
|
|
142
147
|
}
|
|
@@ -410,7 +415,7 @@ function Pa(a, b) {
|
|
|
410
415
|
return Oa(c, a, b);
|
|
411
416
|
}));
|
|
412
417
|
}
|
|
413
|
-
var J, K, Ta = {
|
|
418
|
+
var J, K, Ta = {474240:(a, b, c, d, e) => {
|
|
414
419
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
415
420
|
return 0;
|
|
416
421
|
}
|
|
@@ -473,9 +478,9 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
473
478
|
}
|
|
474
479
|
window.h.Da += 1;
|
|
475
480
|
return 1;
|
|
476
|
-
},
|
|
481
|
+
}, 476418:() => {
|
|
477
482
|
"undefined" !== typeof window.h && (--window.h.Da, 0 === window.h.Da && delete window.h);
|
|
478
|
-
},
|
|
483
|
+
}, 476582:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 476686:() => {
|
|
479
484
|
try {
|
|
480
485
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
481
486
|
a.close();
|
|
@@ -483,7 +488,7 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
483
488
|
} catch (c) {
|
|
484
489
|
return 0;
|
|
485
490
|
}
|
|
486
|
-
},
|
|
491
|
+
}, 476857:(a, b, c, d, e, f) => {
|
|
487
492
|
if ("undefined" === typeof window.h) {
|
|
488
493
|
return -1;
|
|
489
494
|
}
|
|
@@ -529,7 +534,7 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
529
534
|
a == window.h.I.Ca && g.Z.connect(g.J.destination);
|
|
530
535
|
g.kb = f;
|
|
531
536
|
return window.h.tc(g);
|
|
532
|
-
},
|
|
537
|
+
}, 479734:a => window.h.wa(a).J.sampleRate, 479807:a => {
|
|
533
538
|
a = window.h.wa(a);
|
|
534
539
|
void 0 !== a.Z && (a.Z.onaudioprocess = function() {
|
|
535
540
|
}, a.Z.disconnect(), a.Z = void 0);
|
|
@@ -537,13 +542,13 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
537
542
|
a.J.close();
|
|
538
543
|
a.J = void 0;
|
|
539
544
|
a.kb = void 0;
|
|
540
|
-
},
|
|
545
|
+
}, 480207:a => {
|
|
541
546
|
window.h.xb(a);
|
|
542
|
-
},
|
|
547
|
+
}, 480257:a => {
|
|
543
548
|
a = window.h.wa(a);
|
|
544
549
|
a.J.resume();
|
|
545
550
|
a.state = window.h.ha.sb;
|
|
546
|
-
},
|
|
551
|
+
}, 480396:a => {
|
|
547
552
|
a = window.h.wa(a);
|
|
548
553
|
a.J.suspend();
|
|
549
554
|
a.state = window.h.ha.stopped;
|
|
@@ -3548,8 +3553,8 @@ n.dynCall_viijii = (a, b, c, d, e, f, g) => (n.dynCall_viijii = y.dynCall_viijii
|
|
|
3548
3553
|
n.dynCall_iiiiij = (a, b, c, d, e, f, g) => (n.dynCall_iiiiij = y.dynCall_iiiiij)(a, b, c, d, e, f, g);
|
|
3549
3554
|
n.dynCall_iiiiijj = (a, b, c, d, e, f, g, m, p) => (n.dynCall_iiiiijj = y.dynCall_iiiiijj)(a, b, c, d, e, f, g, m, p);
|
|
3550
3555
|
n.dynCall_iiiiiijj = (a, b, c, d, e, f, g, m, p, l) => (n.dynCall_iiiiiijj = y.dynCall_iiiiiijj)(a, b, c, d, e, f, g, m, p, l);
|
|
3551
|
-
n.___start_em_js =
|
|
3552
|
-
n.___stop_em_js =
|
|
3556
|
+
n.___start_em_js = 471616;
|
|
3557
|
+
n.___stop_em_js = 474240;
|
|
3553
3558
|
var $d;
|
|
3554
3559
|
Ia = function ae() {
|
|
3555
3560
|
$d || be();
|
|
@@ -3609,7 +3614,7 @@ be();
|
|
|
3609
3614
|
/* 2 */
|
|
3610
3615
|
/***/ ((module) => {
|
|
3611
3616
|
|
|
3612
|
-
module.exports = JSON.parse('{"name":"@rive-app/webgl2","version":"2.
|
|
3617
|
+
module.exports = JSON.parse('{"name":"@rive-app/webgl2","version":"2.15.0","description":"Rive\'s webgl2 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)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
3613
3618
|
|
|
3614
3619
|
/***/ }),
|
|
3615
3620
|
/* 3 */
|
|
@@ -3907,6 +3912,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3907
3912
|
/* harmony export */ StateMachineInput: () => (/* binding */ StateMachineInput),
|
|
3908
3913
|
/* harmony export */ StateMachineInputType: () => (/* binding */ StateMachineInputType),
|
|
3909
3914
|
/* harmony export */ Testing: () => (/* binding */ Testing),
|
|
3915
|
+
/* harmony export */ decodeAudio: () => (/* binding */ decodeAudio),
|
|
3910
3916
|
/* harmony export */ decodeFont: () => (/* binding */ decodeFont),
|
|
3911
3917
|
/* harmony export */ decodeImage: () => (/* binding */ decodeImage)
|
|
3912
3918
|
/* harmony export */ });
|
|
@@ -6081,10 +6087,23 @@ var Testing = {
|
|
|
6081
6087
|
};
|
|
6082
6088
|
// #endregion
|
|
6083
6089
|
// #region asset loaders
|
|
6090
|
+
/**
|
|
6091
|
+
* Decodes bytes into an audio asset.
|
|
6092
|
+
*
|
|
6093
|
+
* Be sure to call `.unref()` on the audio once it is no longer needed. This
|
|
6094
|
+
* allows the engine to clean it up when it is not used by any more animations.
|
|
6095
|
+
*/
|
|
6096
|
+
var decodeAudio = function (bytes) {
|
|
6097
|
+
return new Promise(function (resolve) {
|
|
6098
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
6099
|
+
rive.decodeAudio(bytes, resolve);
|
|
6100
|
+
});
|
|
6101
|
+
});
|
|
6102
|
+
};
|
|
6084
6103
|
/**
|
|
6085
6104
|
* Decodes bytes into an image.
|
|
6086
6105
|
*
|
|
6087
|
-
* Be sure to call `.
|
|
6106
|
+
* Be sure to call `.unref()` on the image once it is no longer needed. This
|
|
6088
6107
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
6089
6108
|
*/
|
|
6090
6109
|
var decodeImage = function (bytes) {
|
|
@@ -6097,7 +6116,7 @@ var decodeImage = function (bytes) {
|
|
|
6097
6116
|
/**
|
|
6098
6117
|
* Decodes bytes into a font.
|
|
6099
6118
|
*
|
|
6100
|
-
* Be sure to call `.
|
|
6119
|
+
* Be sure to call `.unref()` on the font once it is no longer needed. This
|
|
6101
6120
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
6102
6121
|
*/
|
|
6103
6122
|
var decodeFont = function (bytes) {
|