@rive-app/webgl2 2.24.1 → 2.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rive.d.ts +1 -0
- package/rive.js +33 -17
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +6 -0
package/package.json
CHANGED
package/rive.d.ts
CHANGED
package/rive.js
CHANGED
|
@@ -427,7 +427,7 @@ function Na(a, b) {
|
|
|
427
427
|
return Ma(c, a, b);
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
|
-
var Oa, Pa, Ta = {
|
|
430
|
+
var Oa, Pa, Ta = {494414:(a, b, c, d, e) => {
|
|
431
431
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
432
432
|
return 0;
|
|
433
433
|
}
|
|
@@ -490,9 +490,9 @@ var Oa, Pa, Ta = {494190:(a, b, c, d, e) => {
|
|
|
490
490
|
}
|
|
491
491
|
window.h.Da += 1;
|
|
492
492
|
return 1;
|
|
493
|
-
},
|
|
493
|
+
}, 496592:() => {
|
|
494
494
|
"undefined" !== typeof window.h && (--window.h.Da, 0 === window.h.Da && delete window.h);
|
|
495
|
-
},
|
|
495
|
+
}, 496756:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 496860:() => {
|
|
496
496
|
try {
|
|
497
497
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
498
498
|
a.close();
|
|
@@ -500,7 +500,7 @@ var Oa, Pa, Ta = {494190:(a, b, c, d, e) => {
|
|
|
500
500
|
} catch (c) {
|
|
501
501
|
return 0;
|
|
502
502
|
}
|
|
503
|
-
},
|
|
503
|
+
}, 497031:(a, b, c, d, e, f) => {
|
|
504
504
|
if ("undefined" === typeof window.h) {
|
|
505
505
|
return -1;
|
|
506
506
|
}
|
|
@@ -546,7 +546,7 @@ var Oa, Pa, Ta = {494190:(a, b, c, d, e) => {
|
|
|
546
546
|
a == window.h.H.Ba && g.Z.connect(g.I.destination);
|
|
547
547
|
g.kb = f;
|
|
548
548
|
return window.h.mc(g);
|
|
549
|
-
},
|
|
549
|
+
}, 499908:a => window.h.va(a).I.sampleRate, 499981:a => {
|
|
550
550
|
a = window.h.va(a);
|
|
551
551
|
void 0 !== a.Z && (a.Z.onaudioprocess = function() {
|
|
552
552
|
}, a.Z.disconnect(), a.Z = void 0);
|
|
@@ -554,13 +554,13 @@ var Oa, Pa, Ta = {494190:(a, b, c, d, e) => {
|
|
|
554
554
|
a.I.close();
|
|
555
555
|
a.I = void 0;
|
|
556
556
|
a.kb = void 0;
|
|
557
|
-
},
|
|
557
|
+
}, 500381:a => {
|
|
558
558
|
window.h.xb(a);
|
|
559
|
-
},
|
|
559
|
+
}, 500431:a => {
|
|
560
560
|
a = window.h.va(a);
|
|
561
561
|
a.I.resume();
|
|
562
562
|
a.state = window.h.ia.sb;
|
|
563
|
-
},
|
|
563
|
+
}, 500570:a => {
|
|
564
564
|
a = window.h.va(a);
|
|
565
565
|
a.I.suspend();
|
|
566
566
|
a.state = window.h.ia.stopped;
|
|
@@ -3466,8 +3466,8 @@ m.dynCall_viijii = (a, b, c, d, e, f, g) => (m.dynCall_viijii = A.dynCall_viijii
|
|
|
3466
3466
|
m.dynCall_iiiiij = (a, b, c, d, e, f, g) => (m.dynCall_iiiiij = A.dynCall_iiiiij)(a, b, c, d, e, f, g);
|
|
3467
3467
|
m.dynCall_iiiiijj = (a, b, c, d, e, f, g, n, p) => (m.dynCall_iiiiijj = A.dynCall_iiiiijj)(a, b, c, d, e, f, g, n, p);
|
|
3468
3468
|
m.dynCall_iiiiiijj = (a, b, c, d, e, f, g, n, p, l) => (m.dynCall_iiiiiijj = A.dynCall_iiiiiijj)(a, b, c, d, e, f, g, n, p, l);
|
|
3469
|
-
m.___start_em_js =
|
|
3470
|
-
m.___stop_em_js =
|
|
3469
|
+
m.___start_em_js = 491980;
|
|
3470
|
+
m.___stop_em_js = 494414;
|
|
3471
3471
|
var Xd;
|
|
3472
3472
|
Ga = function Yd() {
|
|
3473
3473
|
Xd || Zd();
|
|
@@ -3527,7 +3527,7 @@ Zd();
|
|
|
3527
3527
|
/* 2 */
|
|
3528
3528
|
/***/ ((module) => {
|
|
3529
3529
|
|
|
3530
|
-
module.exports = JSON.parse('{"name":"@rive-app/webgl2","version":"2.
|
|
3530
|
+
module.exports = JSON.parse('{"name":"@rive-app/webgl2","version":"2.25.1","description":"Rive\'s webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
3531
3531
|
|
|
3532
3532
|
/***/ }),
|
|
3533
3533
|
/* 3 */
|
|
@@ -3810,7 +3810,7 @@ var registerTouchInteractions = function (_a) {
|
|
|
3810
3810
|
case "mouseout":
|
|
3811
3811
|
for (var _i = 0, stateMachines_1 = stateMachines; _i < stateMachines_1.length; _i++) {
|
|
3812
3812
|
var stateMachine = stateMachines_1[_i];
|
|
3813
|
-
stateMachine.pointerMove(transformedX
|
|
3813
|
+
stateMachine.pointerMove(transformedX, transformedY);
|
|
3814
3814
|
}
|
|
3815
3815
|
break;
|
|
3816
3816
|
// Pointer moving/hovering on the canvas
|
|
@@ -4380,6 +4380,13 @@ var StateMachine = /** @class */ (function () {
|
|
|
4380
4380
|
StateMachine.prototype.advance = function (time) {
|
|
4381
4381
|
this.instance.advance(time);
|
|
4382
4382
|
};
|
|
4383
|
+
/**
|
|
4384
|
+
* Advances the state machine instance by a given time and apply changes to artboard.
|
|
4385
|
+
* @param time - the time to advance the animation by in seconds
|
|
4386
|
+
*/
|
|
4387
|
+
StateMachine.prototype.advanceAndApply = function (time) {
|
|
4388
|
+
this.instance.advanceAndApply(time);
|
|
4389
|
+
};
|
|
4383
4390
|
/**
|
|
4384
4391
|
* Returns the number of events reported from the last advance call
|
|
4385
4392
|
* @returns Number of events reported
|
|
@@ -5304,6 +5311,8 @@ var Rive = /** @class */ (function () {
|
|
|
5304
5311
|
this._devicePixelRatioUsed = 1;
|
|
5305
5312
|
// Whether the canvas element's size is 0
|
|
5306
5313
|
this._hasZeroSize = false;
|
|
5314
|
+
// Audio event listener
|
|
5315
|
+
this._audioEventListener = null;
|
|
5307
5316
|
// Durations to generate a frame for the last second. Used for performance profiling.
|
|
5308
5317
|
this.durations = [];
|
|
5309
5318
|
this.frameTimes = [];
|
|
@@ -5487,11 +5496,12 @@ var Rive = /** @class */ (function () {
|
|
|
5487
5496
|
var _a;
|
|
5488
5497
|
// Initialize audio if needed
|
|
5489
5498
|
if (audioManager.status == SystemAudioStatus.UNAVAILABLE) {
|
|
5490
|
-
if ((_a = this.artboard) === null || _a === void 0 ? void 0 : _a.hasAudio) {
|
|
5491
|
-
|
|
5499
|
+
if (((_a = this.artboard) === null || _a === void 0 ? void 0 : _a.hasAudio) && this._audioEventListener === null) {
|
|
5500
|
+
this._audioEventListener = {
|
|
5492
5501
|
type: EventType.AudioStatusChange,
|
|
5493
5502
|
callback: function () { return _this.onSystemAudioChanged(); },
|
|
5494
|
-
}
|
|
5503
|
+
};
|
|
5504
|
+
audioManager.add(this._audioEventListener);
|
|
5495
5505
|
audioManager.establishAudio();
|
|
5496
5506
|
}
|
|
5497
5507
|
}
|
|
@@ -5681,12 +5691,14 @@ var Rive = /** @class */ (function () {
|
|
|
5681
5691
|
}
|
|
5682
5692
|
}
|
|
5683
5693
|
}
|
|
5684
|
-
stateMachine.
|
|
5694
|
+
stateMachine.advanceAndApply(elapsedTime);
|
|
5685
5695
|
// stateMachine.instance.apply(this.artboard);
|
|
5686
5696
|
}
|
|
5687
5697
|
// Once the animations have been applied to the artboard, advance it
|
|
5688
5698
|
// by the elapsed time.
|
|
5689
|
-
this.
|
|
5699
|
+
if (this.animator.stateMachines.length == 0) {
|
|
5700
|
+
this.artboard.advance(elapsedTime);
|
|
5701
|
+
}
|
|
5690
5702
|
var renderer = this.renderer;
|
|
5691
5703
|
// Canvas must be wiped to prevent artifacts
|
|
5692
5704
|
renderer.clear();
|
|
@@ -5785,6 +5797,10 @@ var Rive = /** @class */ (function () {
|
|
|
5785
5797
|
this.riveFile = null;
|
|
5786
5798
|
this.file = null;
|
|
5787
5799
|
this.deleteRiveRenderer();
|
|
5800
|
+
if (this._audioEventListener !== null) {
|
|
5801
|
+
audioManager.remove(this._audioEventListener);
|
|
5802
|
+
this._audioEventListener = null;
|
|
5803
|
+
}
|
|
5788
5804
|
};
|
|
5789
5805
|
/**
|
|
5790
5806
|
* Cleans up the Renderer object. Only call this API if you no longer
|