@rive-app/webgl 2.27.3 → 2.27.5
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 +12 -1
- package/rive.js +454 -113
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +44 -0
- package/rive_fallback.wasm +0 -0
package/rive.js
CHANGED
|
@@ -43,7 +43,7 @@ function ca() {
|
|
|
43
43
|
console.error(n);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
this.
|
|
46
|
+
this.lb();
|
|
47
47
|
e && e.Mb();
|
|
48
48
|
}
|
|
49
49
|
let b = 0, c = 0, d = new Map(), e = null, f = null;
|
|
@@ -70,7 +70,7 @@ function ca() {
|
|
|
70
70
|
};
|
|
71
71
|
}();
|
|
72
72
|
};
|
|
73
|
-
this.
|
|
73
|
+
this.lb = function() {
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function da() {
|
|
@@ -136,11 +136,11 @@ l.onRuntimeInitialized = function() {
|
|
|
136
136
|
},});
|
|
137
137
|
l.FallbackFileAssetLoader = c.extend("FallbackFileAssetLoader", {__construct:function() {
|
|
138
138
|
this.__parent.__construct.call(this);
|
|
139
|
-
this.
|
|
139
|
+
this.gb = [];
|
|
140
140
|
}, addLoader:function(e) {
|
|
141
|
-
this.
|
|
141
|
+
this.gb.push(e);
|
|
142
142
|
}, loadContents:function(e, f) {
|
|
143
|
-
for (let g of this.
|
|
143
|
+
for (let g of this.gb) {
|
|
144
144
|
if (g.loadContents(e, f)) {
|
|
145
145
|
return !0;
|
|
146
146
|
}
|
|
@@ -187,7 +187,7 @@ l.onRuntimeInitialized = function() {
|
|
|
187
187
|
function b(r) {
|
|
188
188
|
var u = {alpha:1, depth:0, stencil:8, antialias:0, premultipliedAlpha:1, preserveDrawingBuffer:0, powerPreference:"high-performance", failIfMajorPerformanceCaveat:0, enableExtensionsByDefault:1, explicitSwapControl:0, renderViaOffscreenBackBuffer:0,}, z = r.getContext("webgl2", u);
|
|
189
189
|
z || (z = r.getContext("webgl", u));
|
|
190
|
-
var B = z, C = ha(ia), O = {handle:C, attributes:u, version:u.Dc,
|
|
190
|
+
var B = z, C = ha(ia), O = {handle:C, attributes:u, version:u.Dc, Ua:B};
|
|
191
191
|
B.canvas && (B.canvas.pc = O);
|
|
192
192
|
ia[C] = O;
|
|
193
193
|
("undefined" == typeof u.Jb || u.Jb) && ka(O);
|
|
@@ -195,8 +195,8 @@ l.onRuntimeInitialized = function() {
|
|
|
195
195
|
u = g(r.width, r.height);
|
|
196
196
|
u.Ab = C;
|
|
197
197
|
u.F = r;
|
|
198
|
-
u.
|
|
199
|
-
u.
|
|
198
|
+
u.Wa = r.width;
|
|
199
|
+
u.Va = r.height;
|
|
200
200
|
u.zb = z;
|
|
201
201
|
return u;
|
|
202
202
|
}
|
|
@@ -275,7 +275,7 @@ l.onRuntimeInitialized = function() {
|
|
|
275
275
|
l.requestAnimationFrame = t.requestAnimationFrame.bind(t);
|
|
276
276
|
l.cancelAnimationFrame = t.cancelAnimationFrame.bind(t);
|
|
277
277
|
l.enableFPSCounter = t.Kb.bind(t);
|
|
278
|
-
t.
|
|
278
|
+
t.lb = c;
|
|
279
279
|
l.resolveAnimationFrame = c;
|
|
280
280
|
let w = l.load;
|
|
281
281
|
l.load = function(r, u, z = !0) {
|
|
@@ -288,8 +288,8 @@ l.onRuntimeInitialized = function() {
|
|
|
288
288
|
l.WebGLRenderer.prototype.clear = function() {
|
|
289
289
|
la(this.Ab);
|
|
290
290
|
const r = this.F;
|
|
291
|
-
if (this.
|
|
292
|
-
this.resize(r.width, r.height), this.
|
|
291
|
+
if (this.Wa != r.width || this.Va != r.height) {
|
|
292
|
+
this.resize(r.width, r.height), this.Wa = r.width, this.Va = r.height;
|
|
293
293
|
}
|
|
294
294
|
y.call(this);
|
|
295
295
|
};
|
|
@@ -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 = {708524:(a, b, c, d, e) => {
|
|
412
412
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
413
413
|
return 0;
|
|
414
414
|
}
|
|
@@ -420,7 +420,7 @@ var Ra, Sa, Wa = {708044:(a, b, c, d, e) => {
|
|
|
420
420
|
window.h.H.La = c;
|
|
421
421
|
window.h.ha = {};
|
|
422
422
|
window.h.ha.stopped = d;
|
|
423
|
-
window.h.ha.
|
|
423
|
+
window.h.ha.tb = e;
|
|
424
424
|
let f = window.h;
|
|
425
425
|
f.C = [];
|
|
426
426
|
f.nc = function(g) {
|
|
@@ -451,29 +451,31 @@ var Ra, Sa, Wa = {708044:(a, b, c, d, e) => {
|
|
|
451
451
|
f.ta = function(g) {
|
|
452
452
|
return f.C[g];
|
|
453
453
|
};
|
|
454
|
-
f.
|
|
454
|
+
f.Ta = ["touchend", "click"];
|
|
455
455
|
f.unlock = function() {
|
|
456
456
|
for (var g = 0; g < f.C.length; ++g) {
|
|
457
457
|
var k = f.C[g];
|
|
458
|
-
null != k && null != k.I && k.state === f.ha.
|
|
459
|
-
Ta(k.
|
|
458
|
+
null != k && null != k.I && k.state === f.ha.tb && k.I.resume().then(() => {
|
|
459
|
+
Ta(k.mb);
|
|
460
460
|
}, p => {
|
|
461
461
|
console.error("Failed to resume audiocontext", p);
|
|
462
462
|
});
|
|
463
463
|
}
|
|
464
|
-
f.
|
|
464
|
+
f.Ta.map(function(p) {
|
|
465
465
|
document.removeEventListener(p, f.unlock, !0);
|
|
466
466
|
});
|
|
467
467
|
};
|
|
468
|
-
f.
|
|
468
|
+
f.Ta.map(function(g) {
|
|
469
469
|
document.addEventListener(g, f.unlock, !0);
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
window.h.Ea += 1;
|
|
473
473
|
return 1;
|
|
474
|
-
},
|
|
475
|
-
"undefined" !== typeof window.h && (
|
|
476
|
-
|
|
474
|
+
}, 710702:() => {
|
|
475
|
+
"undefined" !== typeof window.h && (window.h.Ta.map(function(a) {
|
|
476
|
+
document.removeEventListener(a, window.h.unlock, !0);
|
|
477
|
+
}), --window.h.Ea, 0 === window.h.Ea && delete window.h);
|
|
478
|
+
}, 711006:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 711110:() => {
|
|
477
479
|
try {
|
|
478
480
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
479
481
|
a.close();
|
|
@@ -481,7 +483,7 @@ var Ra, Sa, Wa = {708044:(a, b, c, d, e) => {
|
|
|
481
483
|
} catch (c) {
|
|
482
484
|
return 0;
|
|
483
485
|
}
|
|
484
|
-
},
|
|
486
|
+
}, 711281:(a, b, c, d, e, f) => {
|
|
485
487
|
if ("undefined" === typeof window.h) {
|
|
486
488
|
return -1;
|
|
487
489
|
}
|
|
@@ -525,23 +527,23 @@ var Ra, Sa, Wa = {708044:(a, b, c, d, e) => {
|
|
|
525
527
|
console.log("Failed to get user media: " + p);
|
|
526
528
|
});
|
|
527
529
|
a == window.h.H.Ca && g.X.connect(g.I.destination);
|
|
528
|
-
g.
|
|
530
|
+
g.mb = f;
|
|
529
531
|
return window.h.nc(g);
|
|
530
|
-
},
|
|
532
|
+
}, 714158:a => window.h.ta(a).I.sampleRate, 714231:a => {
|
|
531
533
|
a = window.h.ta(a);
|
|
532
534
|
void 0 !== a.X && (a.X.onaudioprocess = function() {
|
|
533
535
|
}, a.X.disconnect(), a.X = void 0);
|
|
534
536
|
void 0 !== a.Fa && (a.Fa.disconnect(), a.Fa = void 0);
|
|
535
537
|
a.I.close();
|
|
536
538
|
a.I = void 0;
|
|
537
|
-
a.
|
|
538
|
-
},
|
|
539
|
+
a.mb = void 0;
|
|
540
|
+
}, 714631:a => {
|
|
539
541
|
window.h.xb(a);
|
|
540
|
-
},
|
|
542
|
+
}, 714681:a => {
|
|
541
543
|
a = window.h.ta(a);
|
|
542
544
|
a.I.resume();
|
|
543
|
-
a.state = window.h.ha.
|
|
544
|
-
},
|
|
545
|
+
a.state = window.h.ha.tb;
|
|
546
|
+
}, 714820:a => {
|
|
545
547
|
a = window.h.ta(a);
|
|
546
548
|
a.I.suspend();
|
|
547
549
|
a.state = window.h.ha.stopped;
|
|
@@ -700,12 +702,12 @@ var nb = {open:function(a) {
|
|
|
700
702
|
}, sa:function(a) {
|
|
701
703
|
a.s.T.sa(a.s);
|
|
702
704
|
}, read:function(a, b, c, d) {
|
|
703
|
-
if (!a.s || !a.s.T.
|
|
705
|
+
if (!a.s || !a.s.T.fb) {
|
|
704
706
|
throw new G(60);
|
|
705
707
|
}
|
|
706
708
|
for (var e = 0, f = 0; f < d; f++) {
|
|
707
709
|
try {
|
|
708
|
-
var g = a.s.T.
|
|
710
|
+
var g = a.s.T.fb(a.s);
|
|
709
711
|
} catch (k) {
|
|
710
712
|
throw new G(29);
|
|
711
713
|
}
|
|
@@ -733,7 +735,7 @@ var nb = {open:function(a) {
|
|
|
733
735
|
}
|
|
734
736
|
d && (a.node.timestamp = Date.now());
|
|
735
737
|
return e;
|
|
736
|
-
},}, ob = {
|
|
738
|
+
},}, ob = {fb:function() {
|
|
737
739
|
a: {
|
|
738
740
|
if (!gb.length) {
|
|
739
741
|
var a = null;
|
|
@@ -772,9 +774,9 @@ var H = {N:null, S() {
|
|
|
772
774
|
if (24576 === (c & 61440) || 4096 === (c & 61440)) {
|
|
773
775
|
throw new G(63);
|
|
774
776
|
}
|
|
775
|
-
H.N || (H.N = {dir:{node:{W:H.l.W, O:H.l.O, ka:H.l.ka, Aa:H.l.Aa,
|
|
777
|
+
H.N || (H.N = {dir:{node:{W:H.l.W, O:H.l.O, ka:H.l.ka, Aa:H.l.Aa, rb:H.l.rb, wb:H.l.wb, sb:H.l.sb, pb:H.l.pb, Ga:H.l.Ga}, stream:{$:H.m.$}}, file:{node:{W:H.l.W, O:H.l.O}, stream:{$:H.m.$, read:H.m.read, write:H.m.write, ra:H.m.ra, ib:H.m.ib, kb:H.m.kb}}, link:{node:{W:H.l.W, O:H.l.O, la:H.l.la}, stream:{}}, Xa:{node:{W:H.l.W, O:H.l.O}, stream:rb}});
|
|
776
778
|
c = sb(a, b, c, d);
|
|
777
|
-
16384 === (c.mode & 61440) ? (c.l = H.N.dir.node, c.m = H.N.dir.stream, c.j = {}) : 32768 === (c.mode & 61440) ? (c.l = H.N.file.node, c.m = H.N.file.stream, c.v = 0, c.j = null) : 40960 === (c.mode & 61440) ? (c.l = H.N.link.node, c.m = H.N.link.stream) : 8192 === (c.mode & 61440) && (c.l = H.N.
|
|
779
|
+
16384 === (c.mode & 61440) ? (c.l = H.N.dir.node, c.m = H.N.dir.stream, c.j = {}) : 32768 === (c.mode & 61440) ? (c.l = H.N.file.node, c.m = H.N.file.stream, c.v = 0, c.j = null) : 40960 === (c.mode & 61440) ? (c.l = H.N.link.node, c.m = H.N.link.stream) : 8192 === (c.mode & 61440) && (c.l = H.N.Xa.node, c.m = H.N.Xa.stream);
|
|
778
780
|
c.timestamp = Date.now();
|
|
779
781
|
a && (a.j[b] = c, a.timestamp = c.timestamp);
|
|
780
782
|
return c;
|
|
@@ -813,7 +815,7 @@ var H = {N:null, S() {
|
|
|
813
815
|
throw tb[44];
|
|
814
816
|
}, Aa(a, b, c, d) {
|
|
815
817
|
return H.createNode(a, b, c, d);
|
|
816
|
-
},
|
|
818
|
+
}, rb(a, b, c) {
|
|
817
819
|
if (16384 === (a.mode & 61440)) {
|
|
818
820
|
try {
|
|
819
821
|
var d = ub(b, c);
|
|
@@ -831,17 +833,17 @@ var H = {N:null, S() {
|
|
|
831
833
|
b.j[c] = a;
|
|
832
834
|
b.timestamp = a.parent.timestamp;
|
|
833
835
|
a.parent = b;
|
|
834
|
-
},
|
|
836
|
+
}, wb(a, b) {
|
|
835
837
|
delete a.j[b];
|
|
836
838
|
a.timestamp = Date.now();
|
|
837
|
-
},
|
|
839
|
+
}, sb(a, b) {
|
|
838
840
|
var c = ub(a, b), d;
|
|
839
841
|
for (d in c.j) {
|
|
840
842
|
throw new G(55);
|
|
841
843
|
}
|
|
842
844
|
delete a.j[b];
|
|
843
845
|
a.timestamp = Date.now();
|
|
844
|
-
},
|
|
846
|
+
}, pb(a) {
|
|
845
847
|
var b = [".", ".."], c;
|
|
846
848
|
for (c in a.j) {
|
|
847
849
|
a.j.hasOwnProperty(c) && b.push(c);
|
|
@@ -907,7 +909,7 @@ var H = {N:null, S() {
|
|
|
907
909
|
}, ra(a, b, c) {
|
|
908
910
|
qb(a.node, b + c);
|
|
909
911
|
a.node.v = Math.max(a.node.v, b + c);
|
|
910
|
-
},
|
|
912
|
+
}, ib(a, b, c, d, e) {
|
|
911
913
|
if (32768 !== (a.node.mode & 61440)) {
|
|
912
914
|
throw new G(43);
|
|
913
915
|
}
|
|
@@ -927,7 +929,7 @@ var H = {N:null, S() {
|
|
|
927
929
|
c = !1, b = a.byteOffset;
|
|
928
930
|
}
|
|
929
931
|
return {o:b, L:c};
|
|
930
|
-
},
|
|
932
|
+
}, kb(a, b, c, d) {
|
|
931
933
|
H.m.write(a, b, 0, d, c, !1);
|
|
932
934
|
return 0;
|
|
933
935
|
},},};
|
|
@@ -942,7 +944,7 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
942
944
|
if (!a) {
|
|
943
945
|
return {path:"", node:null};
|
|
944
946
|
}
|
|
945
|
-
b = Object.assign({
|
|
947
|
+
b = Object.assign({cb:!0, Qa:0}, b);
|
|
946
948
|
if (8 < b.Qa) {
|
|
947
949
|
throw new G(32);
|
|
948
950
|
}
|
|
@@ -954,8 +956,8 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
954
956
|
}
|
|
955
957
|
c = ub(c, a[e]);
|
|
956
958
|
d = Za(d + "/" + a[e]);
|
|
957
|
-
c.Ba && (!f || f && b.
|
|
958
|
-
if (!f || b.
|
|
959
|
+
c.Ba && (!f || f && b.cb) && (c = c.Ba.root);
|
|
960
|
+
if (!f || b.bb) {
|
|
959
961
|
for (f = 0; 40960 === (c.mode & 61440);) {
|
|
960
962
|
if (c = Db(d), d = db($a(d), c), c = Eb(d, {Qa:b.Qa + 1}).node, 40 < f++) {
|
|
961
963
|
throw new G(32);
|
|
@@ -967,7 +969,7 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
967
969
|
}, Fb = a => {
|
|
968
970
|
for (var b;;) {
|
|
969
971
|
if (a === a.parent) {
|
|
970
|
-
return a = a.S.
|
|
972
|
+
return a = a.S.jb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
|
|
971
973
|
}
|
|
972
974
|
b = b ? `${a.name}/${b}` : a.name;
|
|
973
975
|
a = a.parent;
|
|
@@ -1062,7 +1064,7 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
1062
1064
|
throw new G(10);
|
|
1063
1065
|
}
|
|
1064
1066
|
if (!c && !d) {
|
|
1065
|
-
var e = Eb(b, {
|
|
1067
|
+
var e = Eb(b, {cb:!1});
|
|
1066
1068
|
b = e.path;
|
|
1067
1069
|
e = e.node;
|
|
1068
1070
|
if (e.Ba) {
|
|
@@ -1072,7 +1074,7 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
1072
1074
|
throw new G(54);
|
|
1073
1075
|
}
|
|
1074
1076
|
}
|
|
1075
|
-
b = {type:a, Ic:{},
|
|
1077
|
+
b = {type:a, Ic:{}, jb:b, $b:[]};
|
|
1076
1078
|
a = a.S(b);
|
|
1077
1079
|
a.S = b;
|
|
1078
1080
|
b.root = a;
|
|
@@ -1137,7 +1139,7 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
1137
1139
|
} else {
|
|
1138
1140
|
a = Za(a);
|
|
1139
1141
|
try {
|
|
1140
|
-
e = Eb(a, {
|
|
1142
|
+
e = Eb(a, {bb:!(b & 131072)}).node;
|
|
1141
1143
|
} catch (f) {
|
|
1142
1144
|
}
|
|
1143
1145
|
}
|
|
@@ -1163,7 +1165,7 @@ var xb = null, yb = {}, zb = [], Ab = 1, Bb = null, Cb = !0, G = null, tb = {},
|
|
|
1163
1165
|
}
|
|
1164
1166
|
if (b & 512 && !d) {
|
|
1165
1167
|
c = e;
|
|
1166
|
-
c = "string" == typeof c ? Eb(c, {
|
|
1168
|
+
c = "string" == typeof c ? Eb(c, {bb:!0}).node : c;
|
|
1167
1169
|
if (!c.l.O) {
|
|
1168
1170
|
throw new G(63);
|
|
1169
1171
|
}
|
|
@@ -1268,7 +1270,7 @@ function ec(a, b) {
|
|
|
1268
1270
|
}
|
|
1269
1271
|
function fc() {
|
|
1270
1272
|
this.L = [void 0];
|
|
1271
|
-
this.
|
|
1273
|
+
this.eb = [];
|
|
1272
1274
|
}
|
|
1273
1275
|
var I = new fc(), gc = void 0;
|
|
1274
1276
|
function K(a) {
|
|
@@ -1288,7 +1290,7 @@ var hc = a => {
|
|
|
1288
1290
|
case !1:
|
|
1289
1291
|
return 4;
|
|
1290
1292
|
default:
|
|
1291
|
-
return I.ra({
|
|
1293
|
+
return I.ra({qb:1, value:a});
|
|
1292
1294
|
}
|
|
1293
1295
|
};
|
|
1294
1296
|
function jc(a) {
|
|
@@ -1481,7 +1483,7 @@ function Sc(a, b, c, d, e, f, g, k) {
|
|
|
1481
1483
|
this.Nb = f;
|
|
1482
1484
|
this.na = g;
|
|
1483
1485
|
this.Ib = k;
|
|
1484
|
-
this.
|
|
1486
|
+
this.nb = [];
|
|
1485
1487
|
}
|
|
1486
1488
|
function Tc(a, b, c) {
|
|
1487
1489
|
for (; b !== c;) {
|
|
@@ -1551,7 +1553,7 @@ function Yc(a, b, c, d) {
|
|
|
1551
1553
|
this.Na = c;
|
|
1552
1554
|
this.va = d;
|
|
1553
1555
|
this.wa = !1;
|
|
1554
|
-
this.U = this.cc = this.Pa = this.
|
|
1556
|
+
this.U = this.cc = this.Pa = this.ob = this.ic = this.bc = void 0;
|
|
1555
1557
|
void 0 !== b.A ? this.toWireType = Wc : (this.toWireType = d ? Uc : Xc, this.J = null);
|
|
1556
1558
|
}
|
|
1557
1559
|
function Zc(a, b, c) {
|
|
@@ -1640,7 +1642,7 @@ function fd(a, b, c) {
|
|
|
1640
1642
|
return Tc(a.g.o, a.g.u.i, b.i);
|
|
1641
1643
|
}
|
|
1642
1644
|
function gd(a) {
|
|
1643
|
-
a >= I.h && 0 === --I.get(a).
|
|
1645
|
+
a >= I.h && 0 === --I.get(a).qb && I.Sb(a);
|
|
1644
1646
|
}
|
|
1645
1647
|
function hd(a, b, c) {
|
|
1646
1648
|
switch(b) {
|
|
@@ -1832,22 +1834,22 @@ function ha(a) {
|
|
|
1832
1834
|
}
|
|
1833
1835
|
function la(a) {
|
|
1834
1836
|
T = ia[a];
|
|
1835
|
-
l.yc = U = T && T.
|
|
1837
|
+
l.yc = U = T && T.Ua;
|
|
1836
1838
|
return !(a && !U);
|
|
1837
1839
|
}
|
|
1838
1840
|
function ka(a) {
|
|
1839
1841
|
a || (a = T);
|
|
1840
1842
|
if (!a.Ub) {
|
|
1841
1843
|
a.Ub = !0;
|
|
1842
|
-
var b = a.
|
|
1844
|
+
var b = a.Ua;
|
|
1843
1845
|
zd(b);
|
|
1844
1846
|
Ad(b);
|
|
1845
1847
|
Bd(b);
|
|
1846
|
-
b.
|
|
1847
|
-
b.
|
|
1848
|
-
2 <= a.version && (b
|
|
1849
|
-
if (2 > a.version || !b
|
|
1850
|
-
b
|
|
1848
|
+
b.Za = b.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");
|
|
1849
|
+
b.hb = b.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");
|
|
1850
|
+
2 <= a.version && (b.$a = b.getExtension("EXT_disjoint_timer_query_webgl2"));
|
|
1851
|
+
if (2 > a.version || !b.$a) {
|
|
1852
|
+
b.$a = b.getExtension("EXT_disjoint_timer_query");
|
|
1851
1853
|
}
|
|
1852
1854
|
b.Fc = b.getExtension("WEBGL_multi_draw");
|
|
1853
1855
|
(b.getSupportedExtensions() || []).forEach(function(c) {
|
|
@@ -2005,7 +2007,7 @@ function V(a) {
|
|
|
2005
2007
|
var b = U.Gb;
|
|
2006
2008
|
if (b) {
|
|
2007
2009
|
var c = b.ma[a];
|
|
2008
|
-
"number" == typeof c && (b.ma[a] = c = U.getUniformLocation(b, b.
|
|
2010
|
+
"number" == typeof c && (b.ma[a] = c = U.getUniformLocation(b, b.ub[a] + (0 < c ? "[" + c + "]" : "")));
|
|
2009
2011
|
return c;
|
|
2010
2012
|
}
|
|
2011
2013
|
S(1282);
|
|
@@ -2172,7 +2174,7 @@ Rb("/home/web_user", 16895, 0);
|
|
|
2172
2174
|
var b = sb(a, "fd", 16895, 73);
|
|
2173
2175
|
b.l = {ka:(c, d) => {
|
|
2174
2176
|
var e = Nb(+d);
|
|
2175
|
-
c = {parent:null, S:{
|
|
2177
|
+
c = {parent:null, S:{jb:"fake"}, l:{la:() => e.path},};
|
|
2176
2178
|
return c.parent = c;
|
|
2177
2179
|
}};
|
|
2178
2180
|
return b;
|
|
@@ -2183,12 +2185,12 @@ Object.assign(fc.prototype, {get(a) {
|
|
|
2183
2185
|
}, has(a) {
|
|
2184
2186
|
return void 0 !== this.L[a];
|
|
2185
2187
|
}, ra(a) {
|
|
2186
|
-
var b = this.
|
|
2188
|
+
var b = this.eb.pop() || this.L.length;
|
|
2187
2189
|
this.L[b] = a;
|
|
2188
2190
|
return b;
|
|
2189
2191
|
}, Sb(a) {
|
|
2190
2192
|
this.L[a] = void 0;
|
|
2191
|
-
this.
|
|
2193
|
+
this.eb.push(a);
|
|
2192
2194
|
}});
|
|
2193
2195
|
gc = l.BindingError = class extends Error {
|
|
2194
2196
|
constructor(a) {
|
|
@@ -2273,10 +2275,10 @@ Pc.prototype.deleteLater = function() {
|
|
|
2273
2275
|
return this;
|
|
2274
2276
|
};
|
|
2275
2277
|
Yc.prototype.Ob = function(a) {
|
|
2276
|
-
this.
|
|
2278
|
+
this.ob && (a = this.ob(a));
|
|
2277
2279
|
return a;
|
|
2278
2280
|
};
|
|
2279
|
-
Yc.prototype.
|
|
2281
|
+
Yc.prototype.Ya = function(a) {
|
|
2280
2282
|
this.U && this.U(a);
|
|
2281
2283
|
};
|
|
2282
2284
|
Yc.prototype.argPackAdvance = 8;
|
|
@@ -2292,7 +2294,7 @@ Yc.prototype.fromWireType = function(a) {
|
|
|
2292
2294
|
}
|
|
2293
2295
|
var c = this.Ob(a);
|
|
2294
2296
|
if (!c) {
|
|
2295
|
-
return this.
|
|
2297
|
+
return this.Ya(a), null;
|
|
2296
2298
|
}
|
|
2297
2299
|
var d = Bc(this.i, c);
|
|
2298
2300
|
if (void 0 !== d) {
|
|
@@ -2300,7 +2302,7 @@ Yc.prototype.fromWireType = function(a) {
|
|
|
2300
2302
|
return d.g.o = c, d.g.G = a, d.clone();
|
|
2301
2303
|
}
|
|
2302
2304
|
d = d.clone();
|
|
2303
|
-
this.
|
|
2305
|
+
this.Ya(a);
|
|
2304
2306
|
return d;
|
|
2305
2307
|
}
|
|
2306
2308
|
d = this.i.Nb(c);
|
|
@@ -2458,7 +2460,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2458
2460
|
c = hc(c);
|
|
2459
2461
|
var d = [].slice, e = b.i, f = e.M, g = e.A.M, k = e.A.constructor;
|
|
2460
2462
|
a = ec(a, function() {
|
|
2461
|
-
e.A.
|
|
2463
|
+
e.A.nb.forEach(function(n) {
|
|
2462
2464
|
if (this[n] === g[n]) {
|
|
2463
2465
|
throw new kc(`Pure virtual function ${n} must be implemented in JavaScript`);
|
|
2464
2466
|
}
|
|
@@ -2494,7 +2496,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2494
2496
|
}, _embind_finalize_value_object:function(a) {
|
|
2495
2497
|
var b = Gc[a];
|
|
2496
2498
|
delete Gc[a];
|
|
2497
|
-
var c = b.Pa, d = b.U, e = b
|
|
2499
|
+
var c = b.Pa, d = b.U, e = b.ab, f = e.map(g => g.Rb).concat(e.map(g => g.fc));
|
|
2498
2500
|
N([a], f, g => {
|
|
2499
2501
|
var k = {};
|
|
2500
2502
|
e.forEach((p, n) => {
|
|
@@ -2673,7 +2675,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2673
2675
|
n = n[0];
|
|
2674
2676
|
var w = `${n.name}.${b}`;
|
|
2675
2677
|
b.startsWith("@@") && (b = Symbol[b.substring(2)]);
|
|
2676
|
-
k && n.i.
|
|
2678
|
+
k && n.i.nb.push(b);
|
|
2677
2679
|
var y = n.i.M, q = y[b];
|
|
2678
2680
|
void 0 === q || void 0 === q.B && q.className !== n.name && q.ea === c - 2 ? (t.ea = c - 2, t.className = n.name, y[b] = t) : (Qc(y, b, w), y[b].B[c - 2] = t);
|
|
2679
2681
|
N([], p, function(r) {
|
|
@@ -2873,9 +2875,9 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2873
2875
|
uc(p);
|
|
2874
2876
|
},});
|
|
2875
2877
|
}, _embind_register_value_object:function(a, b, c, d, e, f) {
|
|
2876
|
-
Gc[a] = {name:L(b), Pa:R(c, d), U:R(e, f),
|
|
2878
|
+
Gc[a] = {name:L(b), Pa:R(c, d), U:R(e, f), ab:[],};
|
|
2877
2879
|
}, _embind_register_value_object_field:function(a, b, c, d, e, f, g, k, p, n) {
|
|
2878
|
-
Gc[a]
|
|
2880
|
+
Gc[a].ab.push({Lb:L(b), Rb:c, Pb:R(d, e), Qb:f, fc:g, ec:R(k, p), hc:n,});
|
|
2879
2881
|
}, _embind_register_void:function(a, b) {
|
|
2880
2882
|
b = L(b);
|
|
2881
2883
|
Lc(a, {Zb:!0, name:b, argPackAdvance:0, fromWireType:function() {
|
|
@@ -2929,7 +2931,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2929
2931
|
b = hc(b);
|
|
2930
2932
|
return ic(a[b]);
|
|
2931
2933
|
}, _emval_incref:function(a) {
|
|
2932
|
-
4 < a && (I.get(a).
|
|
2934
|
+
4 < a && (I.get(a).qb += 1);
|
|
2933
2935
|
}, _emval_new_array:function() {
|
|
2934
2936
|
return ic([]);
|
|
2935
2937
|
}, _emval_new_cstring:function(a) {
|
|
@@ -3071,7 +3073,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3071
3073
|
}, emscripten_glDrawArraysInstanced:function(a, b, c, d) {
|
|
3072
3074
|
U.drawArraysInstanced(a, b, c, d);
|
|
3073
3075
|
}, emscripten_glDrawArraysInstancedBaseInstanceWEBGL:function(a, b, c, d, e) {
|
|
3074
|
-
U.
|
|
3076
|
+
U.Za.drawArraysInstancedBaseInstanceWEBGL(a, b, c, d, e);
|
|
3075
3077
|
}, emscripten_glDrawBuffers:function(a, b) {
|
|
3076
3078
|
for (var c = Td[a], d = 0; d < a; d++) {
|
|
3077
3079
|
c[d] = D[b + 4 * d >> 2];
|
|
@@ -3080,7 +3082,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3080
3082
|
}, emscripten_glDrawElements:Ud, emscripten_glDrawElementsInstanced:function(a, b, c, d, e) {
|
|
3081
3083
|
U.drawElementsInstanced(a, b, c, d, e);
|
|
3082
3084
|
}, emscripten_glDrawElementsInstancedBaseVertexBaseInstanceWEBGL:function(a, b, c, d, e, f, g) {
|
|
3083
|
-
U.
|
|
3085
|
+
U.Za.drawElementsInstancedBaseVertexBaseInstanceWEBGL(a, b, c, d, e, f, g);
|
|
3084
3086
|
}, emscripten_glDrawRangeElements:function(a, b, c, d, e, f) {
|
|
3085
3087
|
Ud(a, d, e, f);
|
|
3086
3088
|
}, emscripten_glEnable:function(a) {
|
|
@@ -3233,9 +3235,9 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3233
3235
|
}, emscripten_glGetUniformLocation:function(a, b) {
|
|
3234
3236
|
b = b ? fb(x, b) : "";
|
|
3235
3237
|
if (a = Ed[a]) {
|
|
3236
|
-
var c = a, d = c.ma, e = c.
|
|
3238
|
+
var c = a, d = c.ma, e = c.vb, f;
|
|
3237
3239
|
if (!d) {
|
|
3238
|
-
for (c.ma = d = {}, c.
|
|
3240
|
+
for (c.ma = d = {}, c.ub = {}, f = 0; f < U.getProgramParameter(c, 35718); ++f) {
|
|
3239
3241
|
var g = U.getActiveUniform(c, f);
|
|
3240
3242
|
var k = g.name;
|
|
3241
3243
|
g = g.size;
|
|
@@ -3245,7 +3247,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3245
3247
|
c.Sa += g;
|
|
3246
3248
|
e[p] = [g, n];
|
|
3247
3249
|
for (k = 0; k < g; ++k) {
|
|
3248
|
-
d[n] = k, c.
|
|
3250
|
+
d[n] = k, c.ub[n++] = p;
|
|
3249
3251
|
}
|
|
3250
3252
|
}
|
|
3251
3253
|
}
|
|
@@ -3254,7 +3256,7 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3254
3256
|
e = b;
|
|
3255
3257
|
f = ae(b);
|
|
3256
3258
|
0 < f && (d = parseInt(b.slice(f + 1)) >>> 0, e = b.slice(0, f));
|
|
3257
|
-
if ((e = a.
|
|
3259
|
+
if ((e = a.vb[e]) && d < e[0] && (d += e[1], c[d] = c[d] || U.getUniformLocation(a, b))) {
|
|
3258
3260
|
return d;
|
|
3259
3261
|
}
|
|
3260
3262
|
} else {
|
|
@@ -3281,11 +3283,11 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3281
3283
|
a = Ed[a];
|
|
3282
3284
|
U.linkProgram(a);
|
|
3283
3285
|
a.ma = 0;
|
|
3284
|
-
a.
|
|
3286
|
+
a.vb = {};
|
|
3285
3287
|
}, emscripten_glMultiDrawArraysInstancedBaseInstanceWEBGL:function(a, b, c, d, e, f) {
|
|
3286
|
-
U.
|
|
3288
|
+
U.hb.multiDrawArraysInstancedBaseInstanceWEBGL(a, D, b >> 2, D, c >> 2, D, d >> 2, E, e >> 2, f);
|
|
3287
3289
|
}, emscripten_glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL:function(a, b, c, d, e, f, g, k) {
|
|
3288
|
-
U.
|
|
3290
|
+
U.hb.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(a, D, b >> 2, c, D, d >> 2, D, e >> 2, D, f >> 2, E, g >> 2, k);
|
|
3289
3291
|
}, emscripten_glPixelStorei:function(a, b) {
|
|
3290
3292
|
3317 == a && (Od = b);
|
|
3291
3293
|
U.pixelStorei(a, b);
|
|
@@ -3801,10 +3803,10 @@ var Ge = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3801
3803
|
}).catch(ba);
|
|
3802
3804
|
return {};
|
|
3803
3805
|
})();
|
|
3804
|
-
var uc = a => (uc = m.free)(a), Zd = a => (Zd = m.malloc)(a), Ta = l._ma_device__on_notification_unlocked = a => (Ta = l._ma_device__on_notification_unlocked = m.ma_device__on_notification_unlocked)(a);
|
|
3806
|
+
var uc = a => (uc = m.free)(a), Zd = a => (Zd = m.malloc)(a), qe = () => (qe = m.__errno_location)(), Ta = l._ma_device__on_notification_unlocked = a => (Ta = l._ma_device__on_notification_unlocked = m.ma_device__on_notification_unlocked)(a);
|
|
3805
3807
|
l._ma_malloc_emscripten = (a, b) => (l._ma_malloc_emscripten = m.ma_malloc_emscripten)(a, b);
|
|
3806
3808
|
l._ma_free_emscripten = (a, b) => (l._ma_free_emscripten = m.ma_free_emscripten)(a, b);
|
|
3807
|
-
var Ua = l._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (Ua = l._ma_device_process_pcm_frames_capture__webaudio = m.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), Va = l._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (Va = l._ma_device_process_pcm_frames_playback__webaudio = m.ma_device_process_pcm_frames_playback__webaudio)(a, b, c),
|
|
3809
|
+
var Ua = l._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (Ua = l._ma_device_process_pcm_frames_capture__webaudio = m.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), Va = l._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (Va = l._ma_device_process_pcm_frames_playback__webaudio = m.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), tc = a => (tc = m.__getTypeName)(a);
|
|
3808
3810
|
l.__embind_initialize_bindings = () => (l.__embind_initialize_bindings = m._embind_initialize_bindings)();
|
|
3809
3811
|
var vb = (a, b) => (vb = m.emscripten_builtin_memalign)(a, b), X = (a, b) => (X = m.setThrew)(a, b), Y = () => (Y = m.stackSave)(), Z = a => (Z = m.stackRestore)(a);
|
|
3810
3812
|
l.dynCall_iiiij = (a, b, c, d, e, f) => (l.dynCall_iiiij = m.dynCall_iiiij)(a, b, c, d, e, f);
|
|
@@ -4063,7 +4065,7 @@ Je();
|
|
|
4063
4065
|
/* 2 */
|
|
4064
4066
|
/***/ ((module) => {
|
|
4065
4067
|
|
|
4066
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl","version":"2.27.
|
|
4068
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl","version":"2.27.5","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}}');
|
|
4067
4069
|
|
|
4068
4070
|
/***/ }),
|
|
4069
4071
|
/* 3 */
|
|
@@ -4205,12 +4207,24 @@ var Animation = /** @class */ (function () {
|
|
|
4205
4207
|
|
|
4206
4208
|
__webpack_require__.r(__webpack_exports__);
|
|
4207
4209
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4210
|
+
/* harmony export */ AudioAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.AudioAssetWrapper),
|
|
4211
|
+
/* harmony export */ AudioWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.AudioWrapper),
|
|
4208
4212
|
/* harmony export */ BLANK_URL: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__.BLANK_URL),
|
|
4213
|
+
/* harmony export */ CustomFileAssetLoaderWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.CustomFileAssetLoaderWrapper),
|
|
4214
|
+
/* harmony export */ FileAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FileAssetWrapper),
|
|
4215
|
+
/* harmony export */ Finalizable: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.Finalizable),
|
|
4216
|
+
/* harmony export */ FontAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FontAssetWrapper),
|
|
4217
|
+
/* harmony export */ FontWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FontWrapper),
|
|
4218
|
+
/* harmony export */ ImageAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageAssetWrapper),
|
|
4219
|
+
/* harmony export */ ImageWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageWrapper),
|
|
4220
|
+
/* harmony export */ finalizationRegistry: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry),
|
|
4209
4221
|
/* harmony export */ registerTouchInteractions: () => (/* reexport safe */ _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__.registerTouchInteractions),
|
|
4210
4222
|
/* harmony export */ sanitizeUrl: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__.sanitizeUrl)
|
|
4211
4223
|
/* harmony export */ });
|
|
4212
4224
|
/* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
|
4213
4225
|
/* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
|
4226
|
+
/* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
|
|
4227
|
+
|
|
4214
4228
|
|
|
4215
4229
|
|
|
4216
4230
|
|
|
@@ -4459,6 +4473,258 @@ function sanitizeUrl(url) {
|
|
|
4459
4473
|
}
|
|
4460
4474
|
|
|
4461
4475
|
|
|
4476
|
+
/***/ }),
|
|
4477
|
+
/* 8 */
|
|
4478
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4479
|
+
|
|
4480
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4481
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4482
|
+
/* harmony export */ AudioAssetWrapper: () => (/* binding */ AudioAssetWrapper),
|
|
4483
|
+
/* harmony export */ AudioWrapper: () => (/* binding */ AudioWrapper),
|
|
4484
|
+
/* harmony export */ CustomFileAssetLoaderWrapper: () => (/* binding */ CustomFileAssetLoaderWrapper),
|
|
4485
|
+
/* harmony export */ FileAssetWrapper: () => (/* binding */ FileAssetWrapper),
|
|
4486
|
+
/* harmony export */ Finalizable: () => (/* binding */ Finalizable),
|
|
4487
|
+
/* harmony export */ FontAssetWrapper: () => (/* binding */ FontAssetWrapper),
|
|
4488
|
+
/* harmony export */ FontWrapper: () => (/* binding */ FontWrapper),
|
|
4489
|
+
/* harmony export */ ImageAssetWrapper: () => (/* binding */ ImageAssetWrapper),
|
|
4490
|
+
/* harmony export */ ImageWrapper: () => (/* binding */ ImageWrapper),
|
|
4491
|
+
/* harmony export */ finalizationRegistry: () => (/* binding */ finalizationRegistry)
|
|
4492
|
+
/* harmony export */ });
|
|
4493
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
4494
|
+
var extendStatics = function (d, b) {
|
|
4495
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4496
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4497
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
4498
|
+
return extendStatics(d, b);
|
|
4499
|
+
};
|
|
4500
|
+
return function (d, b) {
|
|
4501
|
+
if (typeof b !== "function" && b !== null)
|
|
4502
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
4503
|
+
extendStatics(d, b);
|
|
4504
|
+
function __() { this.constructor = d; }
|
|
4505
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4506
|
+
};
|
|
4507
|
+
})();
|
|
4508
|
+
var Finalizable = /** @class */ (function () {
|
|
4509
|
+
function Finalizable() {
|
|
4510
|
+
this.selfUnref = false;
|
|
4511
|
+
}
|
|
4512
|
+
return Finalizable;
|
|
4513
|
+
}());
|
|
4514
|
+
var ImageWrapper = /** @class */ (function (_super) {
|
|
4515
|
+
__extends(ImageWrapper, _super);
|
|
4516
|
+
function ImageWrapper(image) {
|
|
4517
|
+
var _this = _super.call(this) || this;
|
|
4518
|
+
_this._nativeImage = image;
|
|
4519
|
+
return _this;
|
|
4520
|
+
}
|
|
4521
|
+
Object.defineProperty(ImageWrapper.prototype, "nativeImage", {
|
|
4522
|
+
get: function () {
|
|
4523
|
+
return this._nativeImage;
|
|
4524
|
+
},
|
|
4525
|
+
enumerable: false,
|
|
4526
|
+
configurable: true
|
|
4527
|
+
});
|
|
4528
|
+
ImageWrapper.prototype.unref = function () {
|
|
4529
|
+
if (this.selfUnref) {
|
|
4530
|
+
this._nativeImage.unref();
|
|
4531
|
+
}
|
|
4532
|
+
};
|
|
4533
|
+
return ImageWrapper;
|
|
4534
|
+
}(Finalizable));
|
|
4535
|
+
var AudioWrapper = /** @class */ (function (_super) {
|
|
4536
|
+
__extends(AudioWrapper, _super);
|
|
4537
|
+
function AudioWrapper(audio) {
|
|
4538
|
+
var _this = _super.call(this) || this;
|
|
4539
|
+
_this._nativeAudio = audio;
|
|
4540
|
+
return _this;
|
|
4541
|
+
}
|
|
4542
|
+
Object.defineProperty(AudioWrapper.prototype, "nativeAudio", {
|
|
4543
|
+
get: function () {
|
|
4544
|
+
return this._nativeAudio;
|
|
4545
|
+
},
|
|
4546
|
+
enumerable: false,
|
|
4547
|
+
configurable: true
|
|
4548
|
+
});
|
|
4549
|
+
AudioWrapper.prototype.unref = function () {
|
|
4550
|
+
if (this.selfUnref) {
|
|
4551
|
+
this._nativeAudio.unref();
|
|
4552
|
+
}
|
|
4553
|
+
};
|
|
4554
|
+
return AudioWrapper;
|
|
4555
|
+
}(Finalizable));
|
|
4556
|
+
var FontWrapper = /** @class */ (function (_super) {
|
|
4557
|
+
__extends(FontWrapper, _super);
|
|
4558
|
+
function FontWrapper(font) {
|
|
4559
|
+
var _this = _super.call(this) || this;
|
|
4560
|
+
_this._nativeFont = font;
|
|
4561
|
+
return _this;
|
|
4562
|
+
}
|
|
4563
|
+
Object.defineProperty(FontWrapper.prototype, "nativeFont", {
|
|
4564
|
+
get: function () {
|
|
4565
|
+
return this._nativeFont;
|
|
4566
|
+
},
|
|
4567
|
+
enumerable: false,
|
|
4568
|
+
configurable: true
|
|
4569
|
+
});
|
|
4570
|
+
FontWrapper.prototype.unref = function () {
|
|
4571
|
+
if (this.selfUnref) {
|
|
4572
|
+
this._nativeFont.unref();
|
|
4573
|
+
}
|
|
4574
|
+
};
|
|
4575
|
+
return FontWrapper;
|
|
4576
|
+
}(Finalizable));
|
|
4577
|
+
var CustomFileAssetLoaderWrapper = /** @class */ (function () {
|
|
4578
|
+
function CustomFileAssetLoaderWrapper(runtime, loaderCallback) {
|
|
4579
|
+
this._assetLoaderCallback = loaderCallback;
|
|
4580
|
+
this.assetLoader = new runtime.CustomFileAssetLoader({
|
|
4581
|
+
loadContents: this.loadContents.bind(this),
|
|
4582
|
+
});
|
|
4583
|
+
}
|
|
4584
|
+
CustomFileAssetLoaderWrapper.prototype.loadContents = function (asset, bytes) {
|
|
4585
|
+
var assetWrapper;
|
|
4586
|
+
if (asset.isImage) {
|
|
4587
|
+
assetWrapper = new ImageAssetWrapper(asset);
|
|
4588
|
+
}
|
|
4589
|
+
else if (asset.isAudio) {
|
|
4590
|
+
assetWrapper = new AudioAssetWrapper(asset);
|
|
4591
|
+
}
|
|
4592
|
+
else if (asset.isFont) {
|
|
4593
|
+
assetWrapper = new FontAssetWrapper(asset);
|
|
4594
|
+
}
|
|
4595
|
+
return this._assetLoaderCallback(assetWrapper, bytes);
|
|
4596
|
+
};
|
|
4597
|
+
return CustomFileAssetLoaderWrapper;
|
|
4598
|
+
}());
|
|
4599
|
+
/**
|
|
4600
|
+
* Rive class representing a FileAsset with relevant metadata fields to describe
|
|
4601
|
+
* an asset associated wtih the Rive File
|
|
4602
|
+
*/
|
|
4603
|
+
var FileAssetWrapper = /** @class */ (function () {
|
|
4604
|
+
function FileAssetWrapper(nativeAsset) {
|
|
4605
|
+
this._nativeFileAsset = nativeAsset;
|
|
4606
|
+
}
|
|
4607
|
+
FileAssetWrapper.prototype.decode = function (bytes) {
|
|
4608
|
+
this._nativeFileAsset.decode(bytes);
|
|
4609
|
+
};
|
|
4610
|
+
Object.defineProperty(FileAssetWrapper.prototype, "name", {
|
|
4611
|
+
get: function () {
|
|
4612
|
+
return this._nativeFileAsset.name;
|
|
4613
|
+
},
|
|
4614
|
+
enumerable: false,
|
|
4615
|
+
configurable: true
|
|
4616
|
+
});
|
|
4617
|
+
Object.defineProperty(FileAssetWrapper.prototype, "fileExtension", {
|
|
4618
|
+
get: function () {
|
|
4619
|
+
return this._nativeFileAsset.fileExtension;
|
|
4620
|
+
},
|
|
4621
|
+
enumerable: false,
|
|
4622
|
+
configurable: true
|
|
4623
|
+
});
|
|
4624
|
+
Object.defineProperty(FileAssetWrapper.prototype, "uniqueFilename", {
|
|
4625
|
+
get: function () {
|
|
4626
|
+
return this._nativeFileAsset.uniqueFilename;
|
|
4627
|
+
},
|
|
4628
|
+
enumerable: false,
|
|
4629
|
+
configurable: true
|
|
4630
|
+
});
|
|
4631
|
+
Object.defineProperty(FileAssetWrapper.prototype, "isAudio", {
|
|
4632
|
+
get: function () {
|
|
4633
|
+
return this._nativeFileAsset.isAudio;
|
|
4634
|
+
},
|
|
4635
|
+
enumerable: false,
|
|
4636
|
+
configurable: true
|
|
4637
|
+
});
|
|
4638
|
+
Object.defineProperty(FileAssetWrapper.prototype, "isImage", {
|
|
4639
|
+
get: function () {
|
|
4640
|
+
return this._nativeFileAsset.isImage;
|
|
4641
|
+
},
|
|
4642
|
+
enumerable: false,
|
|
4643
|
+
configurable: true
|
|
4644
|
+
});
|
|
4645
|
+
Object.defineProperty(FileAssetWrapper.prototype, "isFont", {
|
|
4646
|
+
get: function () {
|
|
4647
|
+
return this._nativeFileAsset.isFont;
|
|
4648
|
+
},
|
|
4649
|
+
enumerable: false,
|
|
4650
|
+
configurable: true
|
|
4651
|
+
});
|
|
4652
|
+
Object.defineProperty(FileAssetWrapper.prototype, "cdnUuid", {
|
|
4653
|
+
get: function () {
|
|
4654
|
+
return this._nativeFileAsset.cdnUuid;
|
|
4655
|
+
},
|
|
4656
|
+
enumerable: false,
|
|
4657
|
+
configurable: true
|
|
4658
|
+
});
|
|
4659
|
+
Object.defineProperty(FileAssetWrapper.prototype, "nativeFileAsset", {
|
|
4660
|
+
get: function () {
|
|
4661
|
+
return this._nativeFileAsset;
|
|
4662
|
+
},
|
|
4663
|
+
enumerable: false,
|
|
4664
|
+
configurable: true
|
|
4665
|
+
});
|
|
4666
|
+
return FileAssetWrapper;
|
|
4667
|
+
}());
|
|
4668
|
+
/**
|
|
4669
|
+
* Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
|
|
4670
|
+
* decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset
|
|
4671
|
+
*/
|
|
4672
|
+
var ImageAssetWrapper = /** @class */ (function (_super) {
|
|
4673
|
+
__extends(ImageAssetWrapper, _super);
|
|
4674
|
+
function ImageAssetWrapper() {
|
|
4675
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4676
|
+
}
|
|
4677
|
+
ImageAssetWrapper.prototype.setRenderImage = function (image) {
|
|
4678
|
+
this._nativeFileAsset.setRenderImage(image.nativeImage);
|
|
4679
|
+
};
|
|
4680
|
+
return ImageAssetWrapper;
|
|
4681
|
+
}(FileAssetWrapper));
|
|
4682
|
+
/**
|
|
4683
|
+
* Rive class extending the FileAsset that exposes a `setAudioSource()` API with a
|
|
4684
|
+
* decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset
|
|
4685
|
+
*/
|
|
4686
|
+
var AudioAssetWrapper = /** @class */ (function (_super) {
|
|
4687
|
+
__extends(AudioAssetWrapper, _super);
|
|
4688
|
+
function AudioAssetWrapper() {
|
|
4689
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4690
|
+
}
|
|
4691
|
+
AudioAssetWrapper.prototype.setAudioSource = function (audio) {
|
|
4692
|
+
this._nativeFileAsset.setAudioSource(audio.nativeAudio);
|
|
4693
|
+
};
|
|
4694
|
+
return AudioAssetWrapper;
|
|
4695
|
+
}(FileAssetWrapper));
|
|
4696
|
+
/**
|
|
4697
|
+
* Rive class extending the FileAsset that exposes a `setFont()` API with a
|
|
4698
|
+
* decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset
|
|
4699
|
+
*/
|
|
4700
|
+
var FontAssetWrapper = /** @class */ (function (_super) {
|
|
4701
|
+
__extends(FontAssetWrapper, _super);
|
|
4702
|
+
function FontAssetWrapper() {
|
|
4703
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4704
|
+
}
|
|
4705
|
+
FontAssetWrapper.prototype.setFont = function (font) {
|
|
4706
|
+
this._nativeFileAsset.setFont(font.nativeFont);
|
|
4707
|
+
};
|
|
4708
|
+
return FontAssetWrapper;
|
|
4709
|
+
}(FileAssetWrapper));
|
|
4710
|
+
var FakeFinalizationRegistry = /** @class */ (function (_super) {
|
|
4711
|
+
__extends(FakeFinalizationRegistry, _super);
|
|
4712
|
+
function FakeFinalizationRegistry(fn) {
|
|
4713
|
+
return _super.call(this, fn) || this;
|
|
4714
|
+
}
|
|
4715
|
+
FakeFinalizationRegistry.prototype.register = function (object) {
|
|
4716
|
+
object.selfUnref = true;
|
|
4717
|
+
};
|
|
4718
|
+
FakeFinalizationRegistry.prototype.unregister = function (_) { };
|
|
4719
|
+
return FakeFinalizationRegistry;
|
|
4720
|
+
}(FinalizationRegistry));
|
|
4721
|
+
var MyFinalizationRegistry = FinalizationRegistry || FakeFinalizationRegistry;
|
|
4722
|
+
var finalizationRegistry = new MyFinalizationRegistry(function (ob) {
|
|
4723
|
+
ob.unref();
|
|
4724
|
+
});
|
|
4725
|
+
|
|
4726
|
+
|
|
4727
|
+
|
|
4462
4728
|
/***/ })
|
|
4463
4729
|
/******/ ]);
|
|
4464
4730
|
/************************************************************************/
|
|
@@ -4536,6 +4802,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4536
4802
|
/* harmony export */ Testing: () => (/* binding */ Testing),
|
|
4537
4803
|
/* harmony export */ ViewModel: () => (/* binding */ ViewModel),
|
|
4538
4804
|
/* harmony export */ ViewModelInstance: () => (/* binding */ ViewModelInstance),
|
|
4805
|
+
/* harmony export */ ViewModelInstanceAssetImage: () => (/* binding */ ViewModelInstanceAssetImage),
|
|
4539
4806
|
/* harmony export */ ViewModelInstanceBoolean: () => (/* binding */ ViewModelInstanceBoolean),
|
|
4540
4807
|
/* harmony export */ ViewModelInstanceColor: () => (/* binding */ ViewModelInstanceColor),
|
|
4541
4808
|
/* harmony export */ ViewModelInstanceEnum: () => (/* binding */ ViewModelInstanceEnum),
|
|
@@ -5758,7 +6025,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
5758
6025
|
}
|
|
5759
6026
|
RiveFile.prototype.initData = function () {
|
|
5760
6027
|
return __awaiter(this, void 0, void 0, function () {
|
|
5761
|
-
var _a, loader, _b;
|
|
6028
|
+
var _a, loader, loaderWrapper, _b;
|
|
5762
6029
|
var _c;
|
|
5763
6030
|
return __generator(this, function (_d) {
|
|
5764
6031
|
switch (_d.label) {
|
|
@@ -5774,9 +6041,8 @@ var RiveFile = /** @class */ (function () {
|
|
|
5774
6041
|
return [2 /*return*/];
|
|
5775
6042
|
}
|
|
5776
6043
|
if (this.assetLoader) {
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
});
|
|
6044
|
+
loaderWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.CustomFileAssetLoaderWrapper(this.runtime, this.assetLoader);
|
|
6045
|
+
loader = loaderWrapper.assetLoader;
|
|
5780
6046
|
}
|
|
5781
6047
|
// Load the Rive file
|
|
5782
6048
|
_b = this;
|
|
@@ -6075,7 +6341,11 @@ var Rive = /** @class */ (function () {
|
|
|
6075
6341
|
}
|
|
6076
6342
|
// Load Rive data from a source uri or a data buffer
|
|
6077
6343
|
_this.initData(artboard, startingAnimationNames, startingStateMachineNames, autoplay, autoBind)
|
|
6078
|
-
.then(function () {
|
|
6344
|
+
.then(function (hasInitialized) {
|
|
6345
|
+
if (hasInitialized) {
|
|
6346
|
+
return _this.setupRiveListeners();
|
|
6347
|
+
}
|
|
6348
|
+
})
|
|
6079
6349
|
.catch(function (e) {
|
|
6080
6350
|
console.error(e);
|
|
6081
6351
|
});
|
|
@@ -6154,7 +6424,8 @@ var Rive = /** @class */ (function () {
|
|
|
6154
6424
|
this._artboardHeight = this.artboard.height =
|
|
6155
6425
|
this._artboardHeight || this.artboard.height;
|
|
6156
6426
|
};
|
|
6157
|
-
// Initializes runtime with Rive data and preps for playing
|
|
6427
|
+
// Initializes runtime with Rive data and preps for playing.
|
|
6428
|
+
// Returns true for successful initialization.
|
|
6158
6429
|
Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
|
|
6159
6430
|
return __awaiter(this, void 0, void 0, function () {
|
|
6160
6431
|
var error_1, msg;
|
|
@@ -6177,7 +6448,7 @@ var Rive = /** @class */ (function () {
|
|
|
6177
6448
|
case 2:
|
|
6178
6449
|
// Check for riveFile in case it has been cleaned up while initializing;
|
|
6179
6450
|
if (!this.riveFile) {
|
|
6180
|
-
|
|
6451
|
+
return [2 /*return*/, false];
|
|
6181
6452
|
}
|
|
6182
6453
|
this.file = this.riveFile.getInstance();
|
|
6183
6454
|
// Initialize and draw frame
|
|
@@ -6197,7 +6468,7 @@ var Rive = /** @class */ (function () {
|
|
|
6197
6468
|
this.readyForPlaying = true;
|
|
6198
6469
|
this.taskQueue.process();
|
|
6199
6470
|
this.drawFrame();
|
|
6200
|
-
return [2 /*return*/,
|
|
6471
|
+
return [2 /*return*/, true];
|
|
6201
6472
|
case 3:
|
|
6202
6473
|
error_1 = _b.sent();
|
|
6203
6474
|
msg = resolveErrorMessage(error_1);
|
|
@@ -7415,6 +7686,7 @@ var PropertyType;
|
|
|
7415
7686
|
PropertyType["Trigger"] = "trigger";
|
|
7416
7687
|
PropertyType["Enum"] = "enum";
|
|
7417
7688
|
PropertyType["List"] = "list";
|
|
7689
|
+
PropertyType["Image"] = "image";
|
|
7418
7690
|
})(PropertyType || (PropertyType = {}));
|
|
7419
7691
|
var ViewModelInstance = /** @class */ (function () {
|
|
7420
7692
|
function ViewModelInstance(runtimeInstance, parent) {
|
|
@@ -7538,7 +7810,7 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
7538
7810
|
return null;
|
|
7539
7811
|
};
|
|
7540
7812
|
ViewModelInstance.prototype.propertyFromPathSegments = function (pathSegments, index, type) {
|
|
7541
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
7813
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
7542
7814
|
if (index < pathSegments.length - 1) {
|
|
7543
7815
|
var viewModelInstance = this.internalViewModelInstance(pathSegments[index]);
|
|
7544
7816
|
if (viewModelInstance !== null) {
|
|
@@ -7592,6 +7864,12 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
7592
7864
|
return new ViewModelInstanceList(instance, this);
|
|
7593
7865
|
}
|
|
7594
7866
|
break;
|
|
7867
|
+
case PropertyType.Image:
|
|
7868
|
+
instance = (_r = (_q = this._runtimeInstance) === null || _q === void 0 ? void 0 : _q.image(pathSegments[index])) !== null && _r !== void 0 ? _r : null;
|
|
7869
|
+
if (instance !== null) {
|
|
7870
|
+
return new ViewModelInstanceAssetImage(instance, this);
|
|
7871
|
+
}
|
|
7872
|
+
break;
|
|
7595
7873
|
}
|
|
7596
7874
|
return null;
|
|
7597
7875
|
};
|
|
@@ -7672,6 +7950,15 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
7672
7950
|
var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.List);
|
|
7673
7951
|
return viewmodelInstanceValue;
|
|
7674
7952
|
};
|
|
7953
|
+
/**
|
|
7954
|
+
* method to access a view model property instance belonging
|
|
7955
|
+
* to the view model instance or to a nested view model instance
|
|
7956
|
+
* @param path - path to the image property
|
|
7957
|
+
*/
|
|
7958
|
+
ViewModelInstance.prototype.image = function (path) {
|
|
7959
|
+
var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.Image);
|
|
7960
|
+
return viewmodelInstanceValue;
|
|
7961
|
+
};
|
|
7675
7962
|
/**
|
|
7676
7963
|
* method to access a view model property instance belonging
|
|
7677
7964
|
* to the view model instance or to a nested view model instance
|
|
@@ -8023,6 +8310,24 @@ var ViewModelInstanceColor = /** @class */ (function (_super) {
|
|
|
8023
8310
|
return ViewModelInstanceColor;
|
|
8024
8311
|
}(ViewModelInstanceValue));
|
|
8025
8312
|
|
|
8313
|
+
var ViewModelInstanceAssetImage = /** @class */ (function (_super) {
|
|
8314
|
+
__extends(ViewModelInstanceAssetImage, _super);
|
|
8315
|
+
function ViewModelInstanceAssetImage(instance, root) {
|
|
8316
|
+
return _super.call(this, instance, root) || this;
|
|
8317
|
+
}
|
|
8318
|
+
Object.defineProperty(ViewModelInstanceAssetImage.prototype, "value", {
|
|
8319
|
+
set: function (image) {
|
|
8320
|
+
this._viewModelInstanceValue.value(image.nativeImage);
|
|
8321
|
+
},
|
|
8322
|
+
enumerable: false,
|
|
8323
|
+
configurable: true
|
|
8324
|
+
});
|
|
8325
|
+
ViewModelInstanceAssetImage.prototype.internalHandleCallback = function (callback) {
|
|
8326
|
+
callback();
|
|
8327
|
+
};
|
|
8328
|
+
return ViewModelInstanceAssetImage;
|
|
8329
|
+
}(ViewModelInstanceValue));
|
|
8330
|
+
|
|
8026
8331
|
// Loads Rive data from a URI via fetch.
|
|
8027
8332
|
var loadRiveFile = function (src) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8028
8333
|
var req, res, buffer;
|
|
@@ -8070,39 +8375,75 @@ var Testing = {
|
|
|
8070
8375
|
* Be sure to call `.unref()` on the audio once it is no longer needed. This
|
|
8071
8376
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
8072
8377
|
*/
|
|
8073
|
-
var decodeAudio = function (bytes) {
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8378
|
+
var decodeAudio = function (bytes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8379
|
+
var decodedPromise, audio, audioWrapper;
|
|
8380
|
+
return __generator(this, function (_a) {
|
|
8381
|
+
switch (_a.label) {
|
|
8382
|
+
case 0:
|
|
8383
|
+
decodedPromise = new Promise(function (resolve) {
|
|
8384
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
8385
|
+
rive.decodeAudio(bytes, resolve);
|
|
8386
|
+
});
|
|
8387
|
+
});
|
|
8388
|
+
return [4 /*yield*/, decodedPromise];
|
|
8389
|
+
case 1:
|
|
8390
|
+
audio = _a.sent();
|
|
8391
|
+
audioWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.AudioWrapper(audio);
|
|
8392
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(audioWrapper, audio);
|
|
8393
|
+
return [2 /*return*/, audioWrapper];
|
|
8394
|
+
}
|
|
8078
8395
|
});
|
|
8079
|
-
};
|
|
8396
|
+
}); };
|
|
8080
8397
|
/**
|
|
8081
8398
|
* Decodes bytes into an image.
|
|
8082
8399
|
*
|
|
8083
8400
|
* Be sure to call `.unref()` on the image once it is no longer needed. This
|
|
8084
8401
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
8085
8402
|
*/
|
|
8086
|
-
var decodeImage = function (bytes) {
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8403
|
+
var decodeImage = function (bytes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8404
|
+
var decodedPromise, image, imageWrapper;
|
|
8405
|
+
return __generator(this, function (_a) {
|
|
8406
|
+
switch (_a.label) {
|
|
8407
|
+
case 0:
|
|
8408
|
+
decodedPromise = new Promise(function (resolve) {
|
|
8409
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
8410
|
+
rive.decodeImage(bytes, resolve);
|
|
8411
|
+
});
|
|
8412
|
+
});
|
|
8413
|
+
return [4 /*yield*/, decodedPromise];
|
|
8414
|
+
case 1:
|
|
8415
|
+
image = _a.sent();
|
|
8416
|
+
imageWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.ImageWrapper(image);
|
|
8417
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(imageWrapper, image);
|
|
8418
|
+
return [2 /*return*/, imageWrapper];
|
|
8419
|
+
}
|
|
8091
8420
|
});
|
|
8092
|
-
};
|
|
8421
|
+
}); };
|
|
8093
8422
|
/**
|
|
8094
8423
|
* Decodes bytes into a font.
|
|
8095
8424
|
*
|
|
8096
8425
|
* Be sure to call `.unref()` on the font once it is no longer needed. This
|
|
8097
8426
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
8098
8427
|
*/
|
|
8099
|
-
var decodeFont = function (bytes) {
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8428
|
+
var decodeFont = function (bytes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8429
|
+
var decodedPromise, font, fontWrapper;
|
|
8430
|
+
return __generator(this, function (_a) {
|
|
8431
|
+
switch (_a.label) {
|
|
8432
|
+
case 0:
|
|
8433
|
+
decodedPromise = new Promise(function (resolve) {
|
|
8434
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
8435
|
+
rive.decodeFont(bytes, resolve);
|
|
8436
|
+
});
|
|
8437
|
+
});
|
|
8438
|
+
return [4 /*yield*/, decodedPromise];
|
|
8439
|
+
case 1:
|
|
8440
|
+
font = _a.sent();
|
|
8441
|
+
fontWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.FontWrapper(font);
|
|
8442
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(fontWrapper, font);
|
|
8443
|
+
return [2 /*return*/, fontWrapper];
|
|
8444
|
+
}
|
|
8104
8445
|
});
|
|
8105
|
-
};
|
|
8446
|
+
}); };
|
|
8106
8447
|
// #endregion
|
|
8107
8448
|
|
|
8108
8449
|
})();
|