@rive-app/canvas 2.27.2 → 2.27.4
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 +16 -5
- package/rive.js +456 -114
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +4 -0
- package/rive_fallback.wasm +0 -0
package/rive.js
CHANGED
|
@@ -43,7 +43,7 @@ function fa() {
|
|
|
43
43
|
console.error(l);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
this.
|
|
46
|
+
this.pb();
|
|
47
47
|
e && e.Tb();
|
|
48
48
|
}
|
|
49
49
|
let b = 0, c = 0, d = new Map(), e = null, f = null;
|
|
@@ -74,7 +74,7 @@ function fa() {
|
|
|
74
74
|
f && (document.body.remove(f), f = null);
|
|
75
75
|
e = null;
|
|
76
76
|
};
|
|
77
|
-
this.
|
|
77
|
+
this.pb = function() {
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
function ha(a) {
|
|
@@ -140,11 +140,11 @@ m.onRuntimeInitialized = function() {
|
|
|
140
140
|
},});
|
|
141
141
|
m.FallbackFileAssetLoader = c.extend("FallbackFileAssetLoader", {__construct:function() {
|
|
142
142
|
this.__parent.__construct.call(this);
|
|
143
|
-
this.
|
|
143
|
+
this.lb = [];
|
|
144
144
|
}, addLoader:function(e) {
|
|
145
|
-
this.
|
|
145
|
+
this.lb.push(e);
|
|
146
146
|
}, loadContents:function(e, f) {
|
|
147
|
-
for (let g of this.
|
|
147
|
+
for (let g of this.lb) {
|
|
148
148
|
if (g.loadContents(e, f)) {
|
|
149
149
|
return !0;
|
|
150
150
|
}
|
|
@@ -266,12 +266,12 @@ const ja = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
266
266
|
b.clearColor(0, 0, 0, 0);
|
|
267
267
|
b.clear(b.COLOR_BUFFER_BIT);
|
|
268
268
|
b.enable(b.SCISSOR_TEST);
|
|
269
|
-
r.sort((H, ca) => ca.
|
|
269
|
+
r.sort((H, ca) => ca.xb - H.xb);
|
|
270
270
|
w = v.push(B);
|
|
271
271
|
g != w && (b.bufferData(b.ARRAY_BUFFER, 8 * w, b.DYNAMIC_DRAW), g = w);
|
|
272
272
|
w = 0;
|
|
273
273
|
for (var T of r) {
|
|
274
|
-
b.bufferSubData(b.ARRAY_BUFFER, w, T.
|
|
274
|
+
b.bufferSubData(b.ARRAY_BUFFER, w, T.Ua), w += 4 * T.Ua.length;
|
|
275
275
|
}
|
|
276
276
|
console.assert(w == 4 * B);
|
|
277
277
|
for (var da of r) {
|
|
@@ -290,15 +290,15 @@ const ja = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
290
290
|
w = T = 0;
|
|
291
291
|
for (const H of r) {
|
|
292
292
|
H.image.Ka != ra && (b.bindTexture(b.TEXTURE_2D, H.image.Ja || null), ra = H.image.Ka);
|
|
293
|
-
H.mc ? (b.scissor(H.
|
|
293
|
+
H.mc ? (b.scissor(H.Za, M - H.$a - H.kb, H.Ac, H.kb), da = !0) : da && (b.scissor(0, M - t, k, t), da = !1);
|
|
294
294
|
r = 2 / k;
|
|
295
295
|
const ca = -2 / t;
|
|
296
296
|
b.uniform4f(e, H.ha[0] * r * H.Ba, H.ha[1] * ca * H.Ca, H.ha[2] * r * H.Ba, H.ha[3] * ca * H.Ca);
|
|
297
|
-
b.uniform2f(f, H.ha[4] * r * H.Ba + r * (H.
|
|
297
|
+
b.uniform2f(f, H.ha[4] * r * H.Ba + r * (H.Za - H.ic * H.Ba) - 1, H.ha[5] * ca * H.Ca + ca * (H.$a - H.jc * H.Ca) + 1);
|
|
298
298
|
b.vertexAttribPointer(0, 2, b.FLOAT, !1, 0, w);
|
|
299
299
|
b.vertexAttribPointer(1, 2, b.FLOAT, !1, 0, w + 4 * B);
|
|
300
300
|
b.drawElements(b.TRIANGLES, H.indices.length, b.UNSIGNED_SHORT, T);
|
|
301
|
-
w += 4 * H.
|
|
301
|
+
w += 4 * H.Ua.length;
|
|
302
302
|
T += 2 * H.indices.length;
|
|
303
303
|
}
|
|
304
304
|
console.assert(w == 4 * B);
|
|
@@ -371,20 +371,20 @@ m.onRuntimeInitialized = function() {
|
|
|
371
371
|
this.la = q;
|
|
372
372
|
this.xa = y;
|
|
373
373
|
}, __destruct:function() {
|
|
374
|
-
this.Ja && (ka.Mb(this.Ja), URL.revokeObjectURL(this.
|
|
374
|
+
this.Ja && (ka.Mb(this.Ja), URL.revokeObjectURL(this.Xa));
|
|
375
375
|
this.__parent.__destruct.call(this);
|
|
376
376
|
}, decode:function(q) {
|
|
377
377
|
var y = this;
|
|
378
378
|
y.xa && y.xa(y);
|
|
379
379
|
var F = new Image();
|
|
380
|
-
y.
|
|
380
|
+
y.Xa = URL.createObjectURL(new Blob([q], {type:"image/png",}));
|
|
381
381
|
F.onload = function() {
|
|
382
382
|
y.Fb = F;
|
|
383
383
|
y.Ja = ka.Lb(F);
|
|
384
384
|
y.size(F.width, F.height);
|
|
385
385
|
y.la && y.la(y);
|
|
386
386
|
};
|
|
387
|
-
F.src = y.
|
|
387
|
+
F.src = y.Xa;
|
|
388
388
|
},}), r = e.extend("CanvasRenderPath", {__construct:function() {
|
|
389
389
|
this.__parent.__construct.call(this);
|
|
390
390
|
this.T = new Path2D();
|
|
@@ -402,7 +402,7 @@ m.onRuntimeInitialized = function() {
|
|
|
402
402
|
Q.f = J;
|
|
403
403
|
X.call(K, q, Q);
|
|
404
404
|
}, fillRule:function(q) {
|
|
405
|
-
this.
|
|
405
|
+
this.Wa = q;
|
|
406
406
|
}, moveTo:function(q, y) {
|
|
407
407
|
this.T.moveTo(q, y);
|
|
408
408
|
}, lineTo:function(q, y) {
|
|
@@ -412,7 +412,7 @@ m.onRuntimeInitialized = function() {
|
|
|
412
412
|
}, close:function() {
|
|
413
413
|
this.T.closePath();
|
|
414
414
|
},}), B = f.extend("CanvasRenderPaint", {color:function(q) {
|
|
415
|
-
this.
|
|
415
|
+
this.Ya = b(q);
|
|
416
416
|
}, thickness:function(q) {
|
|
417
417
|
this.Ib = q;
|
|
418
418
|
}, join:function(q) {
|
|
@@ -444,27 +444,27 @@ m.onRuntimeInitialized = function() {
|
|
|
444
444
|
}, clearGradient:function() {
|
|
445
445
|
this.ja = null;
|
|
446
446
|
}, linearGradient:function(q, y, F, G) {
|
|
447
|
-
this.ja = {
|
|
447
|
+
this.ja = {zb:q, Ab:y, cb:F, eb:G, Ra:[],};
|
|
448
448
|
}, radialGradient:function(q, y, F, G) {
|
|
449
|
-
this.ja = {
|
|
449
|
+
this.ja = {zb:q, Ab:y, cb:F, eb:G, Ra:[], ec:!0,};
|
|
450
450
|
}, addStop:function(q, y) {
|
|
451
451
|
this.ja.Ra.push({color:q, stop:y,});
|
|
452
452
|
}, completeGradient:function() {
|
|
453
453
|
}, draw:function(q, y, F) {
|
|
454
454
|
let G = this.Hb;
|
|
455
|
-
var A = this.
|
|
455
|
+
var A = this.Ya, I = this.ja;
|
|
456
456
|
q.globalCompositeOperation = this.Eb;
|
|
457
457
|
if (null != I) {
|
|
458
|
-
A = I.
|
|
459
|
-
var J = I.
|
|
460
|
-
const X = I.
|
|
461
|
-
var K = I.
|
|
458
|
+
A = I.zb;
|
|
459
|
+
var J = I.Ab;
|
|
460
|
+
const X = I.cb;
|
|
461
|
+
var K = I.eb;
|
|
462
462
|
const Q = I.Ra;
|
|
463
463
|
I.ec ? (I = X - A, K -= J, A = q.createRadialGradient(A, J, 0, A, J, Math.sqrt(I * I + K * K))) : A = q.createLinearGradient(A, J, X, K);
|
|
464
464
|
for (let ea = 0, R = Q.length; ea < R; ea++) {
|
|
465
465
|
J = Q[ea], A.addColorStop(J.stop, b(J.color));
|
|
466
466
|
}
|
|
467
|
-
this.
|
|
467
|
+
this.Ya = A;
|
|
468
468
|
this.ja = null;
|
|
469
469
|
}
|
|
470
470
|
switch(G) {
|
|
@@ -485,7 +485,7 @@ m.onRuntimeInitialized = function() {
|
|
|
485
485
|
this.__parent.__construct.call(this);
|
|
486
486
|
this.S = [1, 0, 0, 1, 0, 0];
|
|
487
487
|
this.C = q.getContext("2d");
|
|
488
|
-
this.
|
|
488
|
+
this.Va = q;
|
|
489
489
|
this.H = [];
|
|
490
490
|
}, save:function() {
|
|
491
491
|
this.S.push(...this.S.slice(this.S.length - 6));
|
|
@@ -506,7 +506,7 @@ m.onRuntimeInitialized = function() {
|
|
|
506
506
|
q = Math.cos(q);
|
|
507
507
|
this.transform(q, y, -y, q, 0, 0);
|
|
508
508
|
}, _drawPath:function(q, y) {
|
|
509
|
-
this.H.push(y.draw.bind(y, this.C, q.T, q.
|
|
509
|
+
this.H.push(y.draw.bind(y, this.C, q.T, q.Wa === x ? "evenodd" : "nonzero"));
|
|
510
510
|
}, _drawRiveImage:function(q, y, F) {
|
|
511
511
|
var G = q.Fb;
|
|
512
512
|
if (G) {
|
|
@@ -544,7 +544,7 @@ m.onRuntimeInitialized = function() {
|
|
|
544
544
|
R = w.addRect(sa, ta);
|
|
545
545
|
0 > R && (c(), D.add(this), R = w.addRect(sa, ta), console.assert(0 <= R));
|
|
546
546
|
var $b = R & 65535, ac = R >> 16;
|
|
547
|
-
M.push({ha:this.S.slice(this.S.length - 6), image:q,
|
|
547
|
+
M.push({ha:this.S.slice(this.S.length - 6), image:q, Za:$b, $a:ac, ic:J, jc:K, Ac:sa, kb:ta, Ba:Q, Ca:ea, Ua:new Float32Array(G), Db:new Float32Array(A), indices:new Uint16Array(I), mc:X, xb:q.Ka << 1 | (X ? 1 : 0),});
|
|
548
548
|
T += G.length;
|
|
549
549
|
da += I.length;
|
|
550
550
|
var za = this.C, qd = a(y);
|
|
@@ -559,10 +559,10 @@ m.onRuntimeInitialized = function() {
|
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
561
|
}, _clipPath:function(q) {
|
|
562
|
-
this.H.push(this.C.clip.bind(this.C, q.T, q.
|
|
562
|
+
this.H.push(this.C.clip.bind(this.C, q.T, q.Wa === x ? "evenodd" : "nonzero"));
|
|
563
563
|
}, clear:function() {
|
|
564
564
|
D.add(this);
|
|
565
|
-
this.H.push(this.C.clearRect.bind(this.C, 0, 0, this.
|
|
565
|
+
this.H.push(this.C.clearRect.bind(this.C, 0, 0, this.Va.width, this.Va.height));
|
|
566
566
|
}, flush:function() {
|
|
567
567
|
}, translate:function(q, y) {
|
|
568
568
|
this.transform(1, 0, 0, 1, q, y);
|
|
@@ -634,7 +634,7 @@ m.onRuntimeInitialized = function() {
|
|
|
634
634
|
m.cancelAnimationFrame = d.cancelAnimationFrame.bind(d);
|
|
635
635
|
m.enableFPSCounter = d.Rb.bind(d);
|
|
636
636
|
m.disableFPSCounter = d.Ob;
|
|
637
|
-
d.
|
|
637
|
+
d.pb = c;
|
|
638
638
|
m.resolveAnimationFrame = c;
|
|
639
639
|
m.cleanup = function() {
|
|
640
640
|
w && w.delete();
|
|
@@ -746,7 +746,7 @@ function Ya(a, b) {
|
|
|
746
746
|
return Xa(c, a, b);
|
|
747
747
|
}));
|
|
748
748
|
}
|
|
749
|
-
var Za, $a, db = {
|
|
749
|
+
var Za, $a, db = {453404:(a, b, c, d, e) => {
|
|
750
750
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
751
751
|
return 0;
|
|
752
752
|
}
|
|
@@ -758,7 +758,7 @@ var Za, $a, db = {452588:(a, b, c, d, e) => {
|
|
|
758
758
|
window.h.I.La = c;
|
|
759
759
|
window.h.ga = {};
|
|
760
760
|
window.h.ga.stopped = d;
|
|
761
|
-
window.h.ga.
|
|
761
|
+
window.h.ga.yb = e;
|
|
762
762
|
let f = window.h;
|
|
763
763
|
f.D = [];
|
|
764
764
|
f.yc = function(g) {
|
|
@@ -789,29 +789,31 @@ var Za, $a, db = {452588:(a, b, c, d, e) => {
|
|
|
789
789
|
f.ra = function(g) {
|
|
790
790
|
return f.D[g];
|
|
791
791
|
};
|
|
792
|
-
f.
|
|
792
|
+
f.Ta = ["touchend", "click"];
|
|
793
793
|
f.unlock = function() {
|
|
794
794
|
for (var g = 0; g < f.D.length; ++g) {
|
|
795
795
|
var n = f.D[g];
|
|
796
|
-
null != n && null != n.J && n.state === f.ga.
|
|
797
|
-
ab(n.
|
|
796
|
+
null != n && null != n.J && n.state === f.ga.yb && n.J.resume().then(() => {
|
|
797
|
+
ab(n.qb);
|
|
798
798
|
}, p => {
|
|
799
799
|
console.error("Failed to resume audiocontext", p);
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
|
-
f.
|
|
802
|
+
f.Ta.map(function(p) {
|
|
803
803
|
document.removeEventListener(p, f.unlock, !0);
|
|
804
804
|
});
|
|
805
805
|
};
|
|
806
|
-
f.
|
|
806
|
+
f.Ta.map(function(g) {
|
|
807
807
|
document.addEventListener(g, f.unlock, !0);
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
window.h.Aa += 1;
|
|
811
811
|
return 1;
|
|
812
|
-
},
|
|
813
|
-
"undefined" !== typeof window.h && (
|
|
814
|
-
|
|
812
|
+
}, 455582:() => {
|
|
813
|
+
"undefined" !== typeof window.h && (window.h.Ta.map(function(a) {
|
|
814
|
+
document.removeEventListener(a, window.h.unlock, !0);
|
|
815
|
+
}), --window.h.Aa, 0 === window.h.Aa && delete window.h);
|
|
816
|
+
}, 455886:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 455990:() => {
|
|
815
817
|
try {
|
|
816
818
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
817
819
|
a.close();
|
|
@@ -819,7 +821,7 @@ var Za, $a, db = {452588:(a, b, c, d, e) => {
|
|
|
819
821
|
} catch (c) {
|
|
820
822
|
return 0;
|
|
821
823
|
}
|
|
822
|
-
},
|
|
824
|
+
}, 456161:(a, b, c, d, e, f) => {
|
|
823
825
|
if ("undefined" === typeof window.h) {
|
|
824
826
|
return -1;
|
|
825
827
|
}
|
|
@@ -863,23 +865,23 @@ var Za, $a, db = {452588:(a, b, c, d, e) => {
|
|
|
863
865
|
console.log("Failed to get user media: " + p);
|
|
864
866
|
});
|
|
865
867
|
a == window.h.I.ya && g.Z.connect(g.J.destination);
|
|
866
|
-
g.
|
|
868
|
+
g.qb = f;
|
|
867
869
|
return window.h.yc(g);
|
|
868
|
-
},
|
|
870
|
+
}, 459038:a => window.h.ra(a).J.sampleRate, 459111:a => {
|
|
869
871
|
a = window.h.ra(a);
|
|
870
872
|
void 0 !== a.Z && (a.Z.onaudioprocess = function() {
|
|
871
873
|
}, a.Z.disconnect(), a.Z = void 0);
|
|
872
874
|
void 0 !== a.Da && (a.Da.disconnect(), a.Da = void 0);
|
|
873
875
|
a.J.close();
|
|
874
876
|
a.J = void 0;
|
|
875
|
-
a.
|
|
876
|
-
},
|
|
877
|
+
a.qb = void 0;
|
|
878
|
+
}, 459511:a => {
|
|
877
879
|
window.h.Cb(a);
|
|
878
|
-
},
|
|
880
|
+
}, 459561:a => {
|
|
879
881
|
a = window.h.ra(a);
|
|
880
882
|
a.J.resume();
|
|
881
|
-
a.state = window.h.ga.
|
|
882
|
-
},
|
|
883
|
+
a.state = window.h.ga.yb;
|
|
884
|
+
}, 459700:a => {
|
|
883
885
|
a = window.h.ra(a);
|
|
884
886
|
a.J.suspend();
|
|
885
887
|
a.state = window.h.ga.stopped;
|
|
@@ -1038,12 +1040,12 @@ var vb = {open:function(a) {
|
|
|
1038
1040
|
}, qa:function(a) {
|
|
1039
1041
|
a.s.V.qa(a.s);
|
|
1040
1042
|
}, read:function(a, b, c, d) {
|
|
1041
|
-
if (!a.s || !a.s.V.
|
|
1043
|
+
if (!a.s || !a.s.V.jb) {
|
|
1042
1044
|
throw new O(60);
|
|
1043
1045
|
}
|
|
1044
1046
|
for (var e = 0, f = 0; f < d; f++) {
|
|
1045
1047
|
try {
|
|
1046
|
-
var g = a.s.V.
|
|
1048
|
+
var g = a.s.V.jb(a.s);
|
|
1047
1049
|
} catch (n) {
|
|
1048
1050
|
throw new O(29);
|
|
1049
1051
|
}
|
|
@@ -1071,7 +1073,7 @@ var vb = {open:function(a) {
|
|
|
1071
1073
|
}
|
|
1072
1074
|
d && (a.node.timestamp = Date.now());
|
|
1073
1075
|
return e;
|
|
1074
|
-
},}, wb = {
|
|
1076
|
+
},}, wb = {jb:function() {
|
|
1075
1077
|
a: {
|
|
1076
1078
|
if (!ob.length) {
|
|
1077
1079
|
var a = null;
|
|
@@ -1110,9 +1112,9 @@ var P = {O:null, U() {
|
|
|
1110
1112
|
if (24576 === (c & 61440) || 4096 === (c & 61440)) {
|
|
1111
1113
|
throw new O(63);
|
|
1112
1114
|
}
|
|
1113
|
-
P.O || (P.O = {dir:{node:{Y:P.l.Y, P:P.l.P, ka:P.l.ka, va:P.l.va,
|
|
1115
|
+
P.O || (P.O = {dir:{node:{Y:P.l.Y, P:P.l.P, ka:P.l.ka, va:P.l.va, vb:P.l.vb, Bb:P.l.Bb, wb:P.l.wb, tb:P.l.tb, Ea:P.l.Ea}, stream:{ba:P.m.ba}}, file:{node:{Y:P.l.Y, P:P.l.P}, stream:{ba:P.m.ba, read:P.m.read, write:P.m.write, pa:P.m.pa, mb:P.m.mb, ob:P.m.ob}}, link:{node:{Y:P.l.Y, P:P.l.P, ma:P.l.ma}, stream:{}}, ab:{node:{Y:P.l.Y, P:P.l.P}, stream:zb}});
|
|
1114
1116
|
c = Ab(a, b, c, d);
|
|
1115
|
-
16384 === (c.mode & 61440) ? (c.l = P.O.dir.node, c.m = P.O.dir.stream, c.j = {}) : 32768 === (c.mode & 61440) ? (c.l = P.O.file.node, c.m = P.O.file.stream, c.v = 0, c.j = null) : 40960 === (c.mode & 61440) ? (c.l = P.O.link.node, c.m = P.O.link.stream) : 8192 === (c.mode & 61440) && (c.l = P.O
|
|
1117
|
+
16384 === (c.mode & 61440) ? (c.l = P.O.dir.node, c.m = P.O.dir.stream, c.j = {}) : 32768 === (c.mode & 61440) ? (c.l = P.O.file.node, c.m = P.O.file.stream, c.v = 0, c.j = null) : 40960 === (c.mode & 61440) ? (c.l = P.O.link.node, c.m = P.O.link.stream) : 8192 === (c.mode & 61440) && (c.l = P.O.ab.node, c.m = P.O.ab.stream);
|
|
1116
1118
|
c.timestamp = Date.now();
|
|
1117
1119
|
a && (a.j[b] = c, a.timestamp = c.timestamp);
|
|
1118
1120
|
return c;
|
|
@@ -1151,7 +1153,7 @@ var P = {O:null, U() {
|
|
|
1151
1153
|
throw Bb[44];
|
|
1152
1154
|
}, va(a, b, c, d) {
|
|
1153
1155
|
return P.createNode(a, b, c, d);
|
|
1154
|
-
},
|
|
1156
|
+
}, vb(a, b, c) {
|
|
1155
1157
|
if (16384 === (a.mode & 61440)) {
|
|
1156
1158
|
try {
|
|
1157
1159
|
var d = Cb(b, c);
|
|
@@ -1169,17 +1171,17 @@ var P = {O:null, U() {
|
|
|
1169
1171
|
b.j[c] = a;
|
|
1170
1172
|
b.timestamp = a.parent.timestamp;
|
|
1171
1173
|
a.parent = b;
|
|
1172
|
-
},
|
|
1174
|
+
}, Bb(a, b) {
|
|
1173
1175
|
delete a.j[b];
|
|
1174
1176
|
a.timestamp = Date.now();
|
|
1175
|
-
},
|
|
1177
|
+
}, wb(a, b) {
|
|
1176
1178
|
var c = Cb(a, b), d;
|
|
1177
1179
|
for (d in c.j) {
|
|
1178
1180
|
throw new O(55);
|
|
1179
1181
|
}
|
|
1180
1182
|
delete a.j[b];
|
|
1181
1183
|
a.timestamp = Date.now();
|
|
1182
|
-
},
|
|
1184
|
+
}, tb(a) {
|
|
1183
1185
|
var b = [".", ".."], c;
|
|
1184
1186
|
for (c in a.j) {
|
|
1185
1187
|
a.j.hasOwnProperty(c) && b.push(c);
|
|
@@ -1245,7 +1247,7 @@ var P = {O:null, U() {
|
|
|
1245
1247
|
}, pa(a, b, c) {
|
|
1246
1248
|
yb(a.node, b + c);
|
|
1247
1249
|
a.node.v = Math.max(a.node.v, b + c);
|
|
1248
|
-
},
|
|
1250
|
+
}, mb(a, b, c, d, e) {
|
|
1249
1251
|
if (32768 !== (a.node.mode & 61440)) {
|
|
1250
1252
|
throw new O(43);
|
|
1251
1253
|
}
|
|
@@ -1265,7 +1267,7 @@ var P = {O:null, U() {
|
|
|
1265
1267
|
c = !1, b = a.byteOffset;
|
|
1266
1268
|
}
|
|
1267
1269
|
return {o:b, M:c};
|
|
1268
|
-
},
|
|
1270
|
+
}, ob(a, b, c, d) {
|
|
1269
1271
|
P.m.write(a, b, 0, d, c, !1);
|
|
1270
1272
|
return 0;
|
|
1271
1273
|
},},};
|
|
@@ -1280,7 +1282,7 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1280
1282
|
if (!a) {
|
|
1281
1283
|
return {path:"", node:null};
|
|
1282
1284
|
}
|
|
1283
|
-
b = Object.assign({
|
|
1285
|
+
b = Object.assign({hb:!0, Qa:0}, b);
|
|
1284
1286
|
if (8 < b.Qa) {
|
|
1285
1287
|
throw new O(32);
|
|
1286
1288
|
}
|
|
@@ -1292,8 +1294,8 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1292
1294
|
}
|
|
1293
1295
|
c = Cb(c, a[e]);
|
|
1294
1296
|
d = gb(d + "/" + a[e]);
|
|
1295
|
-
c.wa && (!f || f && b.
|
|
1296
|
-
if (!f || b.
|
|
1297
|
+
c.wa && (!f || f && b.hb) && (c = c.wa.root);
|
|
1298
|
+
if (!f || b.gb) {
|
|
1297
1299
|
for (f = 0; 40960 === (c.mode & 61440);) {
|
|
1298
1300
|
if (c = Kb(d), d = lb(hb(d), c), c = Lb(d, {Qa:b.Qa + 1}).node, 40 < f++) {
|
|
1299
1301
|
throw new O(32);
|
|
@@ -1305,7 +1307,7 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1305
1307
|
}, Mb = a => {
|
|
1306
1308
|
for (var b;;) {
|
|
1307
1309
|
if (a === a.parent) {
|
|
1308
|
-
return a = a.U.
|
|
1310
|
+
return a = a.U.nb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
|
|
1309
1311
|
}
|
|
1310
1312
|
b = b ? `${a.name}/${b}` : a.name;
|
|
1311
1313
|
a = a.parent;
|
|
@@ -1400,7 +1402,7 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1400
1402
|
throw new O(10);
|
|
1401
1403
|
}
|
|
1402
1404
|
if (!c && !d) {
|
|
1403
|
-
var e = Lb(b, {
|
|
1405
|
+
var e = Lb(b, {hb:!1});
|
|
1404
1406
|
b = e.path;
|
|
1405
1407
|
e = e.node;
|
|
1406
1408
|
if (e.wa) {
|
|
@@ -1410,7 +1412,7 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1410
1412
|
throw new O(54);
|
|
1411
1413
|
}
|
|
1412
1414
|
}
|
|
1413
|
-
b = {type:a, Qc:{},
|
|
1415
|
+
b = {type:a, Qc:{}, nb:b, kc:[]};
|
|
1414
1416
|
a = a.U(b);
|
|
1415
1417
|
a.U = b;
|
|
1416
1418
|
b.root = a;
|
|
@@ -1475,7 +1477,7 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1475
1477
|
} else {
|
|
1476
1478
|
a = gb(a);
|
|
1477
1479
|
try {
|
|
1478
|
-
e = Lb(a, {
|
|
1480
|
+
e = Lb(a, {gb:!(b & 131072)}).node;
|
|
1479
1481
|
} catch (f) {
|
|
1480
1482
|
}
|
|
1481
1483
|
}
|
|
@@ -1501,7 +1503,7 @@ var Eb = null, Fb = {}, Gb = [], Hb = 1, Ib = null, Jb = !0, O = null, Bb = {},
|
|
|
1501
1503
|
}
|
|
1502
1504
|
if (b & 512 && !d) {
|
|
1503
1505
|
c = e;
|
|
1504
|
-
c = "string" == typeof c ? Lb(c, {
|
|
1506
|
+
c = "string" == typeof c ? Lb(c, {gb:!0}).node : c;
|
|
1505
1507
|
if (!c.l.P) {
|
|
1506
1508
|
throw new O(63);
|
|
1507
1509
|
}
|
|
@@ -1606,7 +1608,7 @@ function oc(a, b) {
|
|
|
1606
1608
|
}
|
|
1607
1609
|
function pc() {
|
|
1608
1610
|
this.M = [void 0];
|
|
1609
|
-
this.
|
|
1611
|
+
this.ib = [];
|
|
1610
1612
|
}
|
|
1611
1613
|
var U = new pc(), qc = void 0;
|
|
1612
1614
|
function V(a) {
|
|
@@ -1626,7 +1628,7 @@ var rc = a => {
|
|
|
1626
1628
|
case !1:
|
|
1627
1629
|
return 4;
|
|
1628
1630
|
default:
|
|
1629
|
-
return U.pa({
|
|
1631
|
+
return U.pa({ub:1, value:a});
|
|
1630
1632
|
}
|
|
1631
1633
|
};
|
|
1632
1634
|
function tc(a) {
|
|
@@ -1819,7 +1821,7 @@ function bd(a, b, c, d, e, f, g, n) {
|
|
|
1819
1821
|
this.Ub = f;
|
|
1820
1822
|
this.na = g;
|
|
1821
1823
|
this.Pb = n;
|
|
1822
|
-
this.
|
|
1824
|
+
this.rb = [];
|
|
1823
1825
|
}
|
|
1824
1826
|
function cd(a, b, c) {
|
|
1825
1827
|
for (; b !== c;) {
|
|
@@ -1889,7 +1891,7 @@ function hd(a, b, c, d) {
|
|
|
1889
1891
|
this.Na = c;
|
|
1890
1892
|
this.ta = d;
|
|
1891
1893
|
this.ua = !1;
|
|
1892
|
-
this.W = this.oc = this.Pa = this.
|
|
1894
|
+
this.W = this.oc = this.Pa = this.sb = this.tc = this.nc = void 0;
|
|
1893
1895
|
void 0 !== b.A ? this.toWireType = fd : (this.toWireType = d ? dd : gd, this.K = null);
|
|
1894
1896
|
}
|
|
1895
1897
|
function jd(a, b, c) {
|
|
@@ -1978,7 +1980,7 @@ function td(a, b, c) {
|
|
|
1978
1980
|
return cd(a.g.o, a.g.u.i, b.i);
|
|
1979
1981
|
}
|
|
1980
1982
|
function ud(a) {
|
|
1981
|
-
a >= U.h && 0 === --U.get(a).
|
|
1983
|
+
a >= U.h && 0 === --U.get(a).ub && U.Zb(a);
|
|
1982
1984
|
}
|
|
1983
1985
|
function vd(a, b, c) {
|
|
1984
1986
|
switch(b) {
|
|
@@ -2291,7 +2293,7 @@ S("/home/web_user", 16895, 0);
|
|
|
2291
2293
|
var b = Ab(a, "fd", 16895, 73);
|
|
2292
2294
|
b.l = {ka:(c, d) => {
|
|
2293
2295
|
var e = Tb(+d);
|
|
2294
|
-
c = {parent:null, U:{
|
|
2296
|
+
c = {parent:null, U:{nb:"fake"}, l:{ma:() => e.path},};
|
|
2295
2297
|
return c.parent = c;
|
|
2296
2298
|
}};
|
|
2297
2299
|
return b;
|
|
@@ -2302,12 +2304,12 @@ Object.assign(pc.prototype, {get(a) {
|
|
|
2302
2304
|
}, has(a) {
|
|
2303
2305
|
return void 0 !== this.M[a];
|
|
2304
2306
|
}, pa(a) {
|
|
2305
|
-
var b = this.
|
|
2307
|
+
var b = this.ib.pop() || this.M.length;
|
|
2306
2308
|
this.M[b] = a;
|
|
2307
2309
|
return b;
|
|
2308
2310
|
}, Zb(a) {
|
|
2309
2311
|
this.M[a] = void 0;
|
|
2310
|
-
this.
|
|
2312
|
+
this.ib.push(a);
|
|
2311
2313
|
}});
|
|
2312
2314
|
qc = m.BindingError = class extends Error {
|
|
2313
2315
|
constructor(a) {
|
|
@@ -2392,10 +2394,10 @@ Zc.prototype.deleteLater = function() {
|
|
|
2392
2394
|
return this;
|
|
2393
2395
|
};
|
|
2394
2396
|
hd.prototype.Vb = function(a) {
|
|
2395
|
-
this.
|
|
2397
|
+
this.sb && (a = this.sb(a));
|
|
2396
2398
|
return a;
|
|
2397
2399
|
};
|
|
2398
|
-
hd.prototype.
|
|
2400
|
+
hd.prototype.bb = function(a) {
|
|
2399
2401
|
this.W && this.W(a);
|
|
2400
2402
|
};
|
|
2401
2403
|
hd.prototype.argPackAdvance = 8;
|
|
@@ -2411,7 +2413,7 @@ hd.prototype.fromWireType = function(a) {
|
|
|
2411
2413
|
}
|
|
2412
2414
|
var c = this.Vb(a);
|
|
2413
2415
|
if (!c) {
|
|
2414
|
-
return this.
|
|
2416
|
+
return this.bb(a), null;
|
|
2415
2417
|
}
|
|
2416
2418
|
var d = Lc(this.i, c);
|
|
2417
2419
|
if (void 0 !== d) {
|
|
@@ -2419,7 +2421,7 @@ hd.prototype.fromWireType = function(a) {
|
|
|
2419
2421
|
return d.g.o = c, d.g.G = a, d.clone();
|
|
2420
2422
|
}
|
|
2421
2423
|
d = d.clone();
|
|
2422
|
-
this.
|
|
2424
|
+
this.bb(a);
|
|
2423
2425
|
return d;
|
|
2424
2426
|
}
|
|
2425
2427
|
d = this.i.Ub(c);
|
|
@@ -2566,7 +2568,7 @@ var Xd = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2566
2568
|
c = rc(c);
|
|
2567
2569
|
var d = [].slice, e = b.i, f = e.N, g = e.A.N, n = e.A.constructor;
|
|
2568
2570
|
a = oc(a, function() {
|
|
2569
|
-
e.A.
|
|
2571
|
+
e.A.rb.forEach(function(l) {
|
|
2570
2572
|
if (this[l] === g[l]) {
|
|
2571
2573
|
throw new uc(`Pure virtual function ${l} must be implemented in JavaScript`);
|
|
2572
2574
|
}
|
|
@@ -2602,7 +2604,7 @@ var Xd = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2602
2604
|
}, _embind_finalize_value_object:function(a) {
|
|
2603
2605
|
var b = Qc[a];
|
|
2604
2606
|
delete Qc[a];
|
|
2605
|
-
var c = b.Pa, d = b.W, e = b.
|
|
2607
|
+
var c = b.Pa, d = b.W, e = b.fb, f = e.map(g => g.Yb).concat(e.map(g => g.rc));
|
|
2606
2608
|
Y([a], f, g => {
|
|
2607
2609
|
var n = {};
|
|
2608
2610
|
e.forEach((p, l) => {
|
|
@@ -2781,7 +2783,7 @@ var Xd = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2781
2783
|
l = l[0];
|
|
2782
2784
|
var v = `${l.name}.${b}`;
|
|
2783
2785
|
b.startsWith("@@") && (b = Symbol[b.substring(2)]);
|
|
2784
|
-
n && l.i.
|
|
2786
|
+
n && l.i.rb.push(b);
|
|
2785
2787
|
var x = l.i.N, k = x[b];
|
|
2786
2788
|
void 0 === k || void 0 === k.B && k.className !== l.name && k.ea === c - 2 ? (u.ea = c - 2, u.className = l.name, x[b] = u) : ($c(x, b, v), x[b].B[c - 2] = u);
|
|
2787
2789
|
Y([], p, function(t) {
|
|
@@ -2981,9 +2983,9 @@ var Xd = {__syscall_fcntl64:function(a, b, c) {
|
|
|
2981
2983
|
Ec(p);
|
|
2982
2984
|
},});
|
|
2983
2985
|
}, _embind_register_value_object:function(a, b, c, d, e, f) {
|
|
2984
|
-
Qc[a] = {name:W(b), Pa:Z(c, d), W:Z(e, f),
|
|
2986
|
+
Qc[a] = {name:W(b), Pa:Z(c, d), W:Z(e, f), fb:[],};
|
|
2985
2987
|
}, _embind_register_value_object_field:function(a, b, c, d, e, f, g, n, p, l) {
|
|
2986
|
-
Qc[a].
|
|
2988
|
+
Qc[a].fb.push({Sb:W(b), Yb:c, Wb:Z(d, e), Xb:f, rc:g, qc:Z(n, p), sc:l,});
|
|
2987
2989
|
}, _embind_register_void:function(a, b) {
|
|
2988
2990
|
b = W(b);
|
|
2989
2991
|
Vc(a, {fc:!0, name:b, argPackAdvance:0, fromWireType:function() {
|
|
@@ -3038,7 +3040,7 @@ var Xd = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3038
3040
|
b = rc(b);
|
|
3039
3041
|
return sc(a[b]);
|
|
3040
3042
|
}, _emval_incref:function(a) {
|
|
3041
|
-
4 < a && (U.get(a).
|
|
3043
|
+
4 < a && (U.get(a).ub += 1);
|
|
3042
3044
|
}, _emval_new_array:function() {
|
|
3043
3045
|
return sc([]);
|
|
3044
3046
|
}, _emval_new_cstring:function(a) {
|
|
@@ -3294,10 +3296,10 @@ var Xd = {__syscall_fcntl64:function(a, b, c) {
|
|
|
3294
3296
|
}).catch(ba);
|
|
3295
3297
|
return {};
|
|
3296
3298
|
})();
|
|
3297
|
-
var Ec = a => (Ec = z.free)(a), Wd = a => (Wd = z.malloc)(a), ab = m._ma_device__on_notification_unlocked = a => (ab = m._ma_device__on_notification_unlocked = z.ma_device__on_notification_unlocked)(a);
|
|
3299
|
+
var Ec = a => (Ec = z.free)(a), Wd = a => (Wd = z.malloc)(a), Vd = () => (Vd = z.__errno_location)(), ab = m._ma_device__on_notification_unlocked = a => (ab = m._ma_device__on_notification_unlocked = z.ma_device__on_notification_unlocked)(a);
|
|
3298
3300
|
m._ma_malloc_emscripten = (a, b) => (m._ma_malloc_emscripten = z.ma_malloc_emscripten)(a, b);
|
|
3299
3301
|
m._ma_free_emscripten = (a, b) => (m._ma_free_emscripten = z.ma_free_emscripten)(a, b);
|
|
3300
|
-
var bb = m._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (bb = m._ma_device_process_pcm_frames_capture__webaudio = z.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), cb = m._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (cb = m._ma_device_process_pcm_frames_playback__webaudio = z.ma_device_process_pcm_frames_playback__webaudio)(a, b, c),
|
|
3302
|
+
var bb = m._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (bb = m._ma_device_process_pcm_frames_capture__webaudio = z.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), cb = m._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (cb = m._ma_device_process_pcm_frames_playback__webaudio = z.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), Dc = a => (Dc = z.__getTypeName)(a);
|
|
3301
3303
|
m.__embind_initialize_bindings = () => (m.__embind_initialize_bindings = z._embind_initialize_bindings)();
|
|
3302
3304
|
m.dynCall_iiji = (a, b, c, d, e) => (m.dynCall_iiji = z.dynCall_iiji)(a, b, c, d, e);
|
|
3303
3305
|
m.dynCall_jiji = (a, b, c, d, e) => (m.dynCall_jiji = z.dynCall_jiji)(a, b, c, d, e);
|
|
@@ -3367,7 +3369,7 @@ $d();
|
|
|
3367
3369
|
/* 2 */
|
|
3368
3370
|
/***/ ((module) => {
|
|
3369
3371
|
|
|
3370
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.27.
|
|
3372
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.27.4","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"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
3371
3373
|
|
|
3372
3374
|
/***/ }),
|
|
3373
3375
|
/* 3 */
|
|
@@ -3509,12 +3511,24 @@ var Animation = /** @class */ (function () {
|
|
|
3509
3511
|
|
|
3510
3512
|
__webpack_require__.r(__webpack_exports__);
|
|
3511
3513
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3514
|
+
/* harmony export */ AudioAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.AudioAssetWrapper),
|
|
3515
|
+
/* harmony export */ AudioWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.AudioWrapper),
|
|
3512
3516
|
/* harmony export */ BLANK_URL: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__.BLANK_URL),
|
|
3517
|
+
/* harmony export */ CustomFileAssetLoaderWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.CustomFileAssetLoaderWrapper),
|
|
3518
|
+
/* harmony export */ FileAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FileAssetWrapper),
|
|
3519
|
+
/* harmony export */ Finalizable: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.Finalizable),
|
|
3520
|
+
/* harmony export */ FontAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FontAssetWrapper),
|
|
3521
|
+
/* harmony export */ FontWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FontWrapper),
|
|
3522
|
+
/* harmony export */ ImageAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageAssetWrapper),
|
|
3523
|
+
/* harmony export */ ImageWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageWrapper),
|
|
3524
|
+
/* harmony export */ finalizationRegistry: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry),
|
|
3513
3525
|
/* harmony export */ registerTouchInteractions: () => (/* reexport safe */ _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__.registerTouchInteractions),
|
|
3514
3526
|
/* harmony export */ sanitizeUrl: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__.sanitizeUrl)
|
|
3515
3527
|
/* harmony export */ });
|
|
3516
3528
|
/* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
|
3517
3529
|
/* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
|
3530
|
+
/* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
|
|
3531
|
+
|
|
3518
3532
|
|
|
3519
3533
|
|
|
3520
3534
|
|
|
@@ -3763,6 +3777,258 @@ function sanitizeUrl(url) {
|
|
|
3763
3777
|
}
|
|
3764
3778
|
|
|
3765
3779
|
|
|
3780
|
+
/***/ }),
|
|
3781
|
+
/* 8 */
|
|
3782
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3783
|
+
|
|
3784
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3785
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3786
|
+
/* harmony export */ AudioAssetWrapper: () => (/* binding */ AudioAssetWrapper),
|
|
3787
|
+
/* harmony export */ AudioWrapper: () => (/* binding */ AudioWrapper),
|
|
3788
|
+
/* harmony export */ CustomFileAssetLoaderWrapper: () => (/* binding */ CustomFileAssetLoaderWrapper),
|
|
3789
|
+
/* harmony export */ FileAssetWrapper: () => (/* binding */ FileAssetWrapper),
|
|
3790
|
+
/* harmony export */ Finalizable: () => (/* binding */ Finalizable),
|
|
3791
|
+
/* harmony export */ FontAssetWrapper: () => (/* binding */ FontAssetWrapper),
|
|
3792
|
+
/* harmony export */ FontWrapper: () => (/* binding */ FontWrapper),
|
|
3793
|
+
/* harmony export */ ImageAssetWrapper: () => (/* binding */ ImageAssetWrapper),
|
|
3794
|
+
/* harmony export */ ImageWrapper: () => (/* binding */ ImageWrapper),
|
|
3795
|
+
/* harmony export */ finalizationRegistry: () => (/* binding */ finalizationRegistry)
|
|
3796
|
+
/* harmony export */ });
|
|
3797
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3798
|
+
var extendStatics = function (d, b) {
|
|
3799
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3800
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3801
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3802
|
+
return extendStatics(d, b);
|
|
3803
|
+
};
|
|
3804
|
+
return function (d, b) {
|
|
3805
|
+
if (typeof b !== "function" && b !== null)
|
|
3806
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3807
|
+
extendStatics(d, b);
|
|
3808
|
+
function __() { this.constructor = d; }
|
|
3809
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3810
|
+
};
|
|
3811
|
+
})();
|
|
3812
|
+
var Finalizable = /** @class */ (function () {
|
|
3813
|
+
function Finalizable() {
|
|
3814
|
+
this.selfUnref = false;
|
|
3815
|
+
}
|
|
3816
|
+
return Finalizable;
|
|
3817
|
+
}());
|
|
3818
|
+
var ImageWrapper = /** @class */ (function (_super) {
|
|
3819
|
+
__extends(ImageWrapper, _super);
|
|
3820
|
+
function ImageWrapper(image) {
|
|
3821
|
+
var _this = _super.call(this) || this;
|
|
3822
|
+
_this._nativeImage = image;
|
|
3823
|
+
return _this;
|
|
3824
|
+
}
|
|
3825
|
+
Object.defineProperty(ImageWrapper.prototype, "nativeImage", {
|
|
3826
|
+
get: function () {
|
|
3827
|
+
return this._nativeImage;
|
|
3828
|
+
},
|
|
3829
|
+
enumerable: false,
|
|
3830
|
+
configurable: true
|
|
3831
|
+
});
|
|
3832
|
+
ImageWrapper.prototype.unref = function () {
|
|
3833
|
+
if (this.selfUnref) {
|
|
3834
|
+
this._nativeImage.unref();
|
|
3835
|
+
}
|
|
3836
|
+
};
|
|
3837
|
+
return ImageWrapper;
|
|
3838
|
+
}(Finalizable));
|
|
3839
|
+
var AudioWrapper = /** @class */ (function (_super) {
|
|
3840
|
+
__extends(AudioWrapper, _super);
|
|
3841
|
+
function AudioWrapper(audio) {
|
|
3842
|
+
var _this = _super.call(this) || this;
|
|
3843
|
+
_this._nativeAudio = audio;
|
|
3844
|
+
return _this;
|
|
3845
|
+
}
|
|
3846
|
+
Object.defineProperty(AudioWrapper.prototype, "nativeAudio", {
|
|
3847
|
+
get: function () {
|
|
3848
|
+
return this._nativeAudio;
|
|
3849
|
+
},
|
|
3850
|
+
enumerable: false,
|
|
3851
|
+
configurable: true
|
|
3852
|
+
});
|
|
3853
|
+
AudioWrapper.prototype.unref = function () {
|
|
3854
|
+
if (this.selfUnref) {
|
|
3855
|
+
this._nativeAudio.unref();
|
|
3856
|
+
}
|
|
3857
|
+
};
|
|
3858
|
+
return AudioWrapper;
|
|
3859
|
+
}(Finalizable));
|
|
3860
|
+
var FontWrapper = /** @class */ (function (_super) {
|
|
3861
|
+
__extends(FontWrapper, _super);
|
|
3862
|
+
function FontWrapper(font) {
|
|
3863
|
+
var _this = _super.call(this) || this;
|
|
3864
|
+
_this._nativeFont = font;
|
|
3865
|
+
return _this;
|
|
3866
|
+
}
|
|
3867
|
+
Object.defineProperty(FontWrapper.prototype, "nativeFont", {
|
|
3868
|
+
get: function () {
|
|
3869
|
+
return this._nativeFont;
|
|
3870
|
+
},
|
|
3871
|
+
enumerable: false,
|
|
3872
|
+
configurable: true
|
|
3873
|
+
});
|
|
3874
|
+
FontWrapper.prototype.unref = function () {
|
|
3875
|
+
if (this.selfUnref) {
|
|
3876
|
+
this._nativeFont.unref();
|
|
3877
|
+
}
|
|
3878
|
+
};
|
|
3879
|
+
return FontWrapper;
|
|
3880
|
+
}(Finalizable));
|
|
3881
|
+
var CustomFileAssetLoaderWrapper = /** @class */ (function () {
|
|
3882
|
+
function CustomFileAssetLoaderWrapper(runtime, loaderCallback) {
|
|
3883
|
+
this._assetLoaderCallback = loaderCallback;
|
|
3884
|
+
this.assetLoader = new runtime.CustomFileAssetLoader({
|
|
3885
|
+
loadContents: this.loadContents.bind(this),
|
|
3886
|
+
});
|
|
3887
|
+
}
|
|
3888
|
+
CustomFileAssetLoaderWrapper.prototype.loadContents = function (asset, bytes) {
|
|
3889
|
+
var assetWrapper;
|
|
3890
|
+
if (asset.isImage) {
|
|
3891
|
+
assetWrapper = new ImageAssetWrapper(asset);
|
|
3892
|
+
}
|
|
3893
|
+
else if (asset.isAudio) {
|
|
3894
|
+
assetWrapper = new AudioAssetWrapper(asset);
|
|
3895
|
+
}
|
|
3896
|
+
else if (asset.isFont) {
|
|
3897
|
+
assetWrapper = new FontAssetWrapper(asset);
|
|
3898
|
+
}
|
|
3899
|
+
return this._assetLoaderCallback(assetWrapper, bytes);
|
|
3900
|
+
};
|
|
3901
|
+
return CustomFileAssetLoaderWrapper;
|
|
3902
|
+
}());
|
|
3903
|
+
/**
|
|
3904
|
+
* Rive class representing a FileAsset with relevant metadata fields to describe
|
|
3905
|
+
* an asset associated wtih the Rive File
|
|
3906
|
+
*/
|
|
3907
|
+
var FileAssetWrapper = /** @class */ (function () {
|
|
3908
|
+
function FileAssetWrapper(nativeAsset) {
|
|
3909
|
+
this._nativeFileAsset = nativeAsset;
|
|
3910
|
+
}
|
|
3911
|
+
FileAssetWrapper.prototype.decode = function (bytes) {
|
|
3912
|
+
this._nativeFileAsset.decode(bytes);
|
|
3913
|
+
};
|
|
3914
|
+
Object.defineProperty(FileAssetWrapper.prototype, "name", {
|
|
3915
|
+
get: function () {
|
|
3916
|
+
return this._nativeFileAsset.name;
|
|
3917
|
+
},
|
|
3918
|
+
enumerable: false,
|
|
3919
|
+
configurable: true
|
|
3920
|
+
});
|
|
3921
|
+
Object.defineProperty(FileAssetWrapper.prototype, "fileExtension", {
|
|
3922
|
+
get: function () {
|
|
3923
|
+
return this._nativeFileAsset.fileExtension;
|
|
3924
|
+
},
|
|
3925
|
+
enumerable: false,
|
|
3926
|
+
configurable: true
|
|
3927
|
+
});
|
|
3928
|
+
Object.defineProperty(FileAssetWrapper.prototype, "uniqueFilename", {
|
|
3929
|
+
get: function () {
|
|
3930
|
+
return this._nativeFileAsset.uniqueFilename;
|
|
3931
|
+
},
|
|
3932
|
+
enumerable: false,
|
|
3933
|
+
configurable: true
|
|
3934
|
+
});
|
|
3935
|
+
Object.defineProperty(FileAssetWrapper.prototype, "isAudio", {
|
|
3936
|
+
get: function () {
|
|
3937
|
+
return this._nativeFileAsset.isAudio;
|
|
3938
|
+
},
|
|
3939
|
+
enumerable: false,
|
|
3940
|
+
configurable: true
|
|
3941
|
+
});
|
|
3942
|
+
Object.defineProperty(FileAssetWrapper.prototype, "isImage", {
|
|
3943
|
+
get: function () {
|
|
3944
|
+
return this._nativeFileAsset.isImage;
|
|
3945
|
+
},
|
|
3946
|
+
enumerable: false,
|
|
3947
|
+
configurable: true
|
|
3948
|
+
});
|
|
3949
|
+
Object.defineProperty(FileAssetWrapper.prototype, "isFont", {
|
|
3950
|
+
get: function () {
|
|
3951
|
+
return this._nativeFileAsset.isFont;
|
|
3952
|
+
},
|
|
3953
|
+
enumerable: false,
|
|
3954
|
+
configurable: true
|
|
3955
|
+
});
|
|
3956
|
+
Object.defineProperty(FileAssetWrapper.prototype, "cdnUuid", {
|
|
3957
|
+
get: function () {
|
|
3958
|
+
return this._nativeFileAsset.cdnUuid;
|
|
3959
|
+
},
|
|
3960
|
+
enumerable: false,
|
|
3961
|
+
configurable: true
|
|
3962
|
+
});
|
|
3963
|
+
Object.defineProperty(FileAssetWrapper.prototype, "nativeFileAsset", {
|
|
3964
|
+
get: function () {
|
|
3965
|
+
return this._nativeFileAsset;
|
|
3966
|
+
},
|
|
3967
|
+
enumerable: false,
|
|
3968
|
+
configurable: true
|
|
3969
|
+
});
|
|
3970
|
+
return FileAssetWrapper;
|
|
3971
|
+
}());
|
|
3972
|
+
/**
|
|
3973
|
+
* Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
|
|
3974
|
+
* decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset
|
|
3975
|
+
*/
|
|
3976
|
+
var ImageAssetWrapper = /** @class */ (function (_super) {
|
|
3977
|
+
__extends(ImageAssetWrapper, _super);
|
|
3978
|
+
function ImageAssetWrapper(nativeAsset) {
|
|
3979
|
+
return _super.call(this, nativeAsset) || this;
|
|
3980
|
+
}
|
|
3981
|
+
ImageAssetWrapper.prototype.setRenderImage = function (image) {
|
|
3982
|
+
this._nativeFileAsset.setRenderImage(image.nativeImage);
|
|
3983
|
+
};
|
|
3984
|
+
return ImageAssetWrapper;
|
|
3985
|
+
}(FileAssetWrapper));
|
|
3986
|
+
/**
|
|
3987
|
+
* Rive class extending the FileAsset that exposes a `setAudioSource()` API with a
|
|
3988
|
+
* decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset
|
|
3989
|
+
*/
|
|
3990
|
+
var AudioAssetWrapper = /** @class */ (function (_super) {
|
|
3991
|
+
__extends(AudioAssetWrapper, _super);
|
|
3992
|
+
function AudioAssetWrapper(nativeAsset) {
|
|
3993
|
+
return _super.call(this, nativeAsset) || this;
|
|
3994
|
+
}
|
|
3995
|
+
AudioAssetWrapper.prototype.setAudioSource = function (audio) {
|
|
3996
|
+
this._nativeFileAsset.setAudioSource(audio.nativeAudio);
|
|
3997
|
+
};
|
|
3998
|
+
return AudioAssetWrapper;
|
|
3999
|
+
}(FileAssetWrapper));
|
|
4000
|
+
/**
|
|
4001
|
+
* Rive class extending the FileAsset that exposes a `setFont()` API with a
|
|
4002
|
+
* decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset
|
|
4003
|
+
*/
|
|
4004
|
+
var FontAssetWrapper = /** @class */ (function (_super) {
|
|
4005
|
+
__extends(FontAssetWrapper, _super);
|
|
4006
|
+
function FontAssetWrapper() {
|
|
4007
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4008
|
+
}
|
|
4009
|
+
FontAssetWrapper.prototype.setFont = function (font) {
|
|
4010
|
+
this._nativeFileAsset.setFont(font.nativeFont);
|
|
4011
|
+
};
|
|
4012
|
+
return FontAssetWrapper;
|
|
4013
|
+
}(FileAssetWrapper));
|
|
4014
|
+
var FakeFinalizationRegistry = /** @class */ (function (_super) {
|
|
4015
|
+
__extends(FakeFinalizationRegistry, _super);
|
|
4016
|
+
function FakeFinalizationRegistry(fn) {
|
|
4017
|
+
return _super.call(this, fn) || this;
|
|
4018
|
+
}
|
|
4019
|
+
FakeFinalizationRegistry.prototype.register = function (object) {
|
|
4020
|
+
object.selfUnref = true;
|
|
4021
|
+
};
|
|
4022
|
+
FakeFinalizationRegistry.prototype.unregister = function (_) { };
|
|
4023
|
+
return FakeFinalizationRegistry;
|
|
4024
|
+
}(FinalizationRegistry));
|
|
4025
|
+
var MyFinalizationRegistry = FinalizationRegistry || FakeFinalizationRegistry;
|
|
4026
|
+
var finalizationRegistry = new MyFinalizationRegistry(function (ob) {
|
|
4027
|
+
ob.unref();
|
|
4028
|
+
});
|
|
4029
|
+
|
|
4030
|
+
|
|
4031
|
+
|
|
3766
4032
|
/***/ })
|
|
3767
4033
|
/******/ ]);
|
|
3768
4034
|
/************************************************************************/
|
|
@@ -3840,6 +4106,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3840
4106
|
/* harmony export */ Testing: () => (/* binding */ Testing),
|
|
3841
4107
|
/* harmony export */ ViewModel: () => (/* binding */ ViewModel),
|
|
3842
4108
|
/* harmony export */ ViewModelInstance: () => (/* binding */ ViewModelInstance),
|
|
4109
|
+
/* harmony export */ ViewModelInstanceAssetImage: () => (/* binding */ ViewModelInstanceAssetImage),
|
|
3843
4110
|
/* harmony export */ ViewModelInstanceBoolean: () => (/* binding */ ViewModelInstanceBoolean),
|
|
3844
4111
|
/* harmony export */ ViewModelInstanceColor: () => (/* binding */ ViewModelInstanceColor),
|
|
3845
4112
|
/* harmony export */ ViewModelInstanceEnum: () => (/* binding */ ViewModelInstanceEnum),
|
|
@@ -5062,7 +5329,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
5062
5329
|
}
|
|
5063
5330
|
RiveFile.prototype.initData = function () {
|
|
5064
5331
|
return __awaiter(this, void 0, void 0, function () {
|
|
5065
|
-
var _a, loader, _b;
|
|
5332
|
+
var _a, loader, loaderWrapper, _b;
|
|
5066
5333
|
var _c;
|
|
5067
5334
|
return __generator(this, function (_d) {
|
|
5068
5335
|
switch (_d.label) {
|
|
@@ -5078,9 +5345,8 @@ var RiveFile = /** @class */ (function () {
|
|
|
5078
5345
|
return [2 /*return*/];
|
|
5079
5346
|
}
|
|
5080
5347
|
if (this.assetLoader) {
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
});
|
|
5348
|
+
loaderWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.CustomFileAssetLoaderWrapper(this.runtime, this.assetLoader);
|
|
5349
|
+
loader = loaderWrapper.assetLoader;
|
|
5084
5350
|
}
|
|
5085
5351
|
// Load the Rive file
|
|
5086
5352
|
_b = this;
|
|
@@ -5379,7 +5645,11 @@ var Rive = /** @class */ (function () {
|
|
|
5379
5645
|
}
|
|
5380
5646
|
// Load Rive data from a source uri or a data buffer
|
|
5381
5647
|
_this.initData(artboard, startingAnimationNames, startingStateMachineNames, autoplay, autoBind)
|
|
5382
|
-
.then(function () {
|
|
5648
|
+
.then(function (hasInitialized) {
|
|
5649
|
+
if (hasInitialized) {
|
|
5650
|
+
return _this.setupRiveListeners();
|
|
5651
|
+
}
|
|
5652
|
+
})
|
|
5383
5653
|
.catch(function (e) {
|
|
5384
5654
|
console.error(e);
|
|
5385
5655
|
});
|
|
@@ -5458,7 +5728,8 @@ var Rive = /** @class */ (function () {
|
|
|
5458
5728
|
this._artboardHeight = this.artboard.height =
|
|
5459
5729
|
this._artboardHeight || this.artboard.height;
|
|
5460
5730
|
};
|
|
5461
|
-
// Initializes runtime with Rive data and preps for playing
|
|
5731
|
+
// Initializes runtime with Rive data and preps for playing.
|
|
5732
|
+
// Returns true for successful initialization.
|
|
5462
5733
|
Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
|
|
5463
5734
|
return __awaiter(this, void 0, void 0, function () {
|
|
5464
5735
|
var error_1, msg;
|
|
@@ -5481,7 +5752,7 @@ var Rive = /** @class */ (function () {
|
|
|
5481
5752
|
case 2:
|
|
5482
5753
|
// Check for riveFile in case it has been cleaned up while initializing;
|
|
5483
5754
|
if (!this.riveFile) {
|
|
5484
|
-
|
|
5755
|
+
return [2 /*return*/, false];
|
|
5485
5756
|
}
|
|
5486
5757
|
this.file = this.riveFile.getInstance();
|
|
5487
5758
|
// Initialize and draw frame
|
|
@@ -5501,7 +5772,7 @@ var Rive = /** @class */ (function () {
|
|
|
5501
5772
|
this.readyForPlaying = true;
|
|
5502
5773
|
this.taskQueue.process();
|
|
5503
5774
|
this.drawFrame();
|
|
5504
|
-
return [2 /*return*/,
|
|
5775
|
+
return [2 /*return*/, true];
|
|
5505
5776
|
case 3:
|
|
5506
5777
|
error_1 = _b.sent();
|
|
5507
5778
|
msg = resolveErrorMessage(error_1);
|
|
@@ -6719,6 +6990,7 @@ var PropertyType;
|
|
|
6719
6990
|
PropertyType["Trigger"] = "trigger";
|
|
6720
6991
|
PropertyType["Enum"] = "enum";
|
|
6721
6992
|
PropertyType["List"] = "list";
|
|
6993
|
+
PropertyType["Image"] = "image";
|
|
6722
6994
|
})(PropertyType || (PropertyType = {}));
|
|
6723
6995
|
var ViewModelInstance = /** @class */ (function () {
|
|
6724
6996
|
function ViewModelInstance(runtimeInstance, parent) {
|
|
@@ -6842,7 +7114,7 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6842
7114
|
return null;
|
|
6843
7115
|
};
|
|
6844
7116
|
ViewModelInstance.prototype.propertyFromPathSegments = function (pathSegments, index, type) {
|
|
6845
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
7117
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
6846
7118
|
if (index < pathSegments.length - 1) {
|
|
6847
7119
|
var viewModelInstance = this.internalViewModelInstance(pathSegments[index]);
|
|
6848
7120
|
if (viewModelInstance !== null) {
|
|
@@ -6896,6 +7168,12 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6896
7168
|
return new ViewModelInstanceList(instance, this);
|
|
6897
7169
|
}
|
|
6898
7170
|
break;
|
|
7171
|
+
case PropertyType.Image:
|
|
7172
|
+
instance = (_r = (_q = this._runtimeInstance) === null || _q === void 0 ? void 0 : _q.image(pathSegments[index])) !== null && _r !== void 0 ? _r : null;
|
|
7173
|
+
if (instance !== null) {
|
|
7174
|
+
return new ViewModelInstanceAssetImage(instance, this);
|
|
7175
|
+
}
|
|
7176
|
+
break;
|
|
6899
7177
|
}
|
|
6900
7178
|
return null;
|
|
6901
7179
|
};
|
|
@@ -6976,6 +7254,15 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6976
7254
|
var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.List);
|
|
6977
7255
|
return viewmodelInstanceValue;
|
|
6978
7256
|
};
|
|
7257
|
+
/**
|
|
7258
|
+
* method to access a view model property instance belonging
|
|
7259
|
+
* to the view model instance or to a nested view model instance
|
|
7260
|
+
* @param path - path to the image property
|
|
7261
|
+
*/
|
|
7262
|
+
ViewModelInstance.prototype.image = function (path) {
|
|
7263
|
+
var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.Image);
|
|
7264
|
+
return viewmodelInstanceValue;
|
|
7265
|
+
};
|
|
6979
7266
|
/**
|
|
6980
7267
|
* method to access a view model property instance belonging
|
|
6981
7268
|
* to the view model instance or to a nested view model instance
|
|
@@ -7327,6 +7614,25 @@ var ViewModelInstanceColor = /** @class */ (function (_super) {
|
|
|
7327
7614
|
return ViewModelInstanceColor;
|
|
7328
7615
|
}(ViewModelInstanceValue));
|
|
7329
7616
|
|
|
7617
|
+
var ViewModelInstanceAssetImage = /** @class */ (function (_super) {
|
|
7618
|
+
__extends(ViewModelInstanceAssetImage, _super);
|
|
7619
|
+
function ViewModelInstanceAssetImage(instance, root) {
|
|
7620
|
+
return _super.call(this, instance, root) || this;
|
|
7621
|
+
}
|
|
7622
|
+
Object.defineProperty(ViewModelInstanceAssetImage.prototype, "value", {
|
|
7623
|
+
set: function (image) {
|
|
7624
|
+
this._viewModelInstanceValue.value =
|
|
7625
|
+
image.nativeImage;
|
|
7626
|
+
},
|
|
7627
|
+
enumerable: false,
|
|
7628
|
+
configurable: true
|
|
7629
|
+
});
|
|
7630
|
+
ViewModelInstanceAssetImage.prototype.internalHandleCallback = function (callback) {
|
|
7631
|
+
callback();
|
|
7632
|
+
};
|
|
7633
|
+
return ViewModelInstanceAssetImage;
|
|
7634
|
+
}(ViewModelInstanceValue));
|
|
7635
|
+
|
|
7330
7636
|
// Loads Rive data from a URI via fetch.
|
|
7331
7637
|
var loadRiveFile = function (src) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7332
7638
|
var req, res, buffer;
|
|
@@ -7374,39 +7680,75 @@ var Testing = {
|
|
|
7374
7680
|
* Be sure to call `.unref()` on the audio once it is no longer needed. This
|
|
7375
7681
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
7376
7682
|
*/
|
|
7377
|
-
var decodeAudio = function (bytes) {
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7683
|
+
var decodeAudio = function (bytes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7684
|
+
var decodedPromise, audio, audioWrapper;
|
|
7685
|
+
return __generator(this, function (_a) {
|
|
7686
|
+
switch (_a.label) {
|
|
7687
|
+
case 0:
|
|
7688
|
+
decodedPromise = new Promise(function (resolve) {
|
|
7689
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
7690
|
+
rive.decodeAudio(bytes, resolve);
|
|
7691
|
+
});
|
|
7692
|
+
});
|
|
7693
|
+
return [4 /*yield*/, decodedPromise];
|
|
7694
|
+
case 1:
|
|
7695
|
+
audio = _a.sent();
|
|
7696
|
+
audioWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.AudioWrapper(audio);
|
|
7697
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(audioWrapper, audio);
|
|
7698
|
+
return [2 /*return*/, audioWrapper];
|
|
7699
|
+
}
|
|
7382
7700
|
});
|
|
7383
|
-
};
|
|
7701
|
+
}); };
|
|
7384
7702
|
/**
|
|
7385
7703
|
* Decodes bytes into an image.
|
|
7386
7704
|
*
|
|
7387
7705
|
* Be sure to call `.unref()` on the image once it is no longer needed. This
|
|
7388
7706
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
7389
7707
|
*/
|
|
7390
|
-
var decodeImage = function (bytes) {
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7708
|
+
var decodeImage = function (bytes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7709
|
+
var decodedPromise, image, imageWrapper;
|
|
7710
|
+
return __generator(this, function (_a) {
|
|
7711
|
+
switch (_a.label) {
|
|
7712
|
+
case 0:
|
|
7713
|
+
decodedPromise = new Promise(function (resolve) {
|
|
7714
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
7715
|
+
rive.decodeImage(bytes, resolve);
|
|
7716
|
+
});
|
|
7717
|
+
});
|
|
7718
|
+
return [4 /*yield*/, decodedPromise];
|
|
7719
|
+
case 1:
|
|
7720
|
+
image = _a.sent();
|
|
7721
|
+
imageWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.ImageWrapper(image);
|
|
7722
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(imageWrapper, image);
|
|
7723
|
+
return [2 /*return*/, imageWrapper];
|
|
7724
|
+
}
|
|
7395
7725
|
});
|
|
7396
|
-
};
|
|
7726
|
+
}); };
|
|
7397
7727
|
/**
|
|
7398
7728
|
* Decodes bytes into a font.
|
|
7399
7729
|
*
|
|
7400
7730
|
* Be sure to call `.unref()` on the font once it is no longer needed. This
|
|
7401
7731
|
* allows the engine to clean it up when it is not used by any more animations.
|
|
7402
7732
|
*/
|
|
7403
|
-
var decodeFont = function (bytes) {
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7733
|
+
var decodeFont = function (bytes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7734
|
+
var decodedPromise, font, fontWrapper;
|
|
7735
|
+
return __generator(this, function (_a) {
|
|
7736
|
+
switch (_a.label) {
|
|
7737
|
+
case 0:
|
|
7738
|
+
decodedPromise = new Promise(function (resolve) {
|
|
7739
|
+
return RuntimeLoader.getInstance(function (rive) {
|
|
7740
|
+
rive.decodeFont(bytes, resolve);
|
|
7741
|
+
});
|
|
7742
|
+
});
|
|
7743
|
+
return [4 /*yield*/, decodedPromise];
|
|
7744
|
+
case 1:
|
|
7745
|
+
font = _a.sent();
|
|
7746
|
+
fontWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.FontWrapper(font);
|
|
7747
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(fontWrapper, font);
|
|
7748
|
+
return [2 /*return*/, fontWrapper];
|
|
7749
|
+
}
|
|
7408
7750
|
});
|
|
7409
|
-
};
|
|
7751
|
+
}); };
|
|
7410
7752
|
// #endregion
|
|
7411
7753
|
|
|
7412
7754
|
})();
|