@rive-app/canvas 2.13.2 → 2.14.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 +7 -1
- package/rive.js +33 -10
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +5 -0
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as rc from "./rive_advanced.mjs";
|
|
2
|
-
export type { FileAsset, FontAsset, ImageAsset } from
|
|
2
|
+
export type { FileAsset, FontAsset, ImageAsset } from "./rive_advanced.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Generic type for a parameterless void callback
|
|
5
5
|
*/
|
|
@@ -304,6 +304,7 @@ export declare class Rive {
|
|
|
304
304
|
private shouldDisableRiveListeners;
|
|
305
305
|
private automaticallyHandleEvents;
|
|
306
306
|
private enableRiveAssetCDN;
|
|
307
|
+
private _volume;
|
|
307
308
|
durations: number[];
|
|
308
309
|
frameTimes: number[];
|
|
309
310
|
frameCount: number;
|
|
@@ -525,6 +526,11 @@ export declare class Rive {
|
|
|
525
526
|
* Returns the contents of a Rive file: the artboards, animations, and state machines
|
|
526
527
|
*/
|
|
527
528
|
get contents(): RiveFileContents;
|
|
529
|
+
/**
|
|
530
|
+
* getter and setter for the volume of the artboard
|
|
531
|
+
*/
|
|
532
|
+
get volume(): number;
|
|
533
|
+
set volume(value: number);
|
|
528
534
|
}
|
|
529
535
|
/**
|
|
530
536
|
* Contents of a state machine input
|
package/rive.js
CHANGED
|
@@ -731,7 +731,7 @@ function Ya(a, b) {
|
|
|
731
731
|
return Xa(c, a, b);
|
|
732
732
|
}));
|
|
733
733
|
}
|
|
734
|
-
var N, P, bb = {
|
|
734
|
+
var N, P, bb = {433284:(a, b, c, d, e) => {
|
|
735
735
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
736
736
|
return 0;
|
|
737
737
|
}
|
|
@@ -794,9 +794,9 @@ var N, P, bb = {433268:(a, b, c, d, e) => {
|
|
|
794
794
|
}
|
|
795
795
|
window.h.Aa += 1;
|
|
796
796
|
return 1;
|
|
797
|
-
},
|
|
797
|
+
}, 435462:() => {
|
|
798
798
|
"undefined" !== typeof window.h && (--window.h.Aa, 0 === window.h.Aa && delete window.h);
|
|
799
|
-
},
|
|
799
|
+
}, 435626:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 435730:() => {
|
|
800
800
|
try {
|
|
801
801
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
802
802
|
a.close();
|
|
@@ -804,7 +804,7 @@ var N, P, bb = {433268:(a, b, c, d, e) => {
|
|
|
804
804
|
} catch (c) {
|
|
805
805
|
return 0;
|
|
806
806
|
}
|
|
807
|
-
},
|
|
807
|
+
}, 435901:(a, b, c, d, e, f) => {
|
|
808
808
|
if ("undefined" === typeof window.h) {
|
|
809
809
|
return -1;
|
|
810
810
|
}
|
|
@@ -850,7 +850,7 @@ var N, P, bb = {433268:(a, b, c, d, e) => {
|
|
|
850
850
|
a == window.h.H.za && g.$.connect(g.I.destination);
|
|
851
851
|
g.qb = f;
|
|
852
852
|
return window.h.Gc(g);
|
|
853
|
-
},
|
|
853
|
+
}, 438778:a => window.h.sa(a).I.sampleRate, 438851:a => {
|
|
854
854
|
a = window.h.sa(a);
|
|
855
855
|
void 0 !== a.$ && (a.$.onaudioprocess = function() {
|
|
856
856
|
}, a.$.disconnect(), a.$ = void 0);
|
|
@@ -858,13 +858,13 @@ var N, P, bb = {433268:(a, b, c, d, e) => {
|
|
|
858
858
|
a.I.close();
|
|
859
859
|
a.I = void 0;
|
|
860
860
|
a.qb = void 0;
|
|
861
|
-
},
|
|
861
|
+
}, 439251:a => {
|
|
862
862
|
window.h.Db(a);
|
|
863
|
-
},
|
|
863
|
+
}, 439301:a => {
|
|
864
864
|
a = window.h.sa(a);
|
|
865
865
|
a.I.resume();
|
|
866
866
|
a.state = window.h.ga.yb;
|
|
867
|
-
},
|
|
867
|
+
}, 439440:a => {
|
|
868
868
|
a = window.h.sa(a);
|
|
869
869
|
a.I.suspend();
|
|
870
870
|
a.state = window.h.ga.stopped;
|
|
@@ -3404,7 +3404,7 @@ Zd();
|
|
|
3404
3404
|
/* 2 */
|
|
3405
3405
|
/***/ ((module) => {
|
|
3406
3406
|
|
|
3407
|
-
module.exports = JSON.parse('{"name":"@rive-app/canvas","version":"2.
|
|
3407
|
+
module.exports = JSON.parse('{"name":"@rive-app/canvas","version":"2.14.1","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.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
3408
3408
|
|
|
3409
3409
|
/***/ }),
|
|
3410
3410
|
/* 3 */
|
|
@@ -4664,6 +4664,8 @@ var Rive = /** @class */ (function () {
|
|
|
4664
4664
|
this.automaticallyHandleEvents = false;
|
|
4665
4665
|
// Allow the runtime to automatically load assets hosted in Rive's runtime.
|
|
4666
4666
|
this.enableRiveAssetCDN = true;
|
|
4667
|
+
// Keep a local value of the set volume to update it asynchronously
|
|
4668
|
+
this._volume = 1;
|
|
4667
4669
|
// Durations to generate a frame for the last second. Used for performance profiling.
|
|
4668
4670
|
this.durations = [];
|
|
4669
4671
|
this.frameTimes = [];
|
|
@@ -4794,7 +4796,8 @@ var Rive = /** @class */ (function () {
|
|
|
4794
4796
|
.filter(function (sm) { return sm.playing && _this.runtime.hasListeners(sm.instance); })
|
|
4795
4797
|
.map(function (sm) { return sm.instance; });
|
|
4796
4798
|
var touchScrollEnabledOption = this.isTouchScrollEnabled;
|
|
4797
|
-
if (riveListenerOptions &&
|
|
4799
|
+
if (riveListenerOptions &&
|
|
4800
|
+
"isTouchScrollEnabled" in riveListenerOptions) {
|
|
4798
4801
|
touchScrollEnabledOption = riveListenerOptions.isTouchScrollEnabled;
|
|
4799
4802
|
}
|
|
4800
4803
|
this.eventCleanup = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.registerTouchInteractions)({
|
|
@@ -4884,6 +4887,7 @@ var Rive = /** @class */ (function () {
|
|
|
4884
4887
|
return;
|
|
4885
4888
|
}
|
|
4886
4889
|
this.artboard = rootArtboard;
|
|
4890
|
+
rootArtboard.volume = this._volume;
|
|
4887
4891
|
// Check that the artboard has at least 1 animation
|
|
4888
4892
|
if (this.artboard.animationCount() < 1) {
|
|
4889
4893
|
var msg = "Artboard has no animations";
|
|
@@ -5611,6 +5615,25 @@ var Rive = /** @class */ (function () {
|
|
|
5611
5615
|
enumerable: false,
|
|
5612
5616
|
configurable: true
|
|
5613
5617
|
});
|
|
5618
|
+
Object.defineProperty(Rive.prototype, "volume", {
|
|
5619
|
+
/**
|
|
5620
|
+
* getter and setter for the volume of the artboard
|
|
5621
|
+
*/
|
|
5622
|
+
get: function () {
|
|
5623
|
+
if (this.artboard && this.artboard.volume !== this._volume) {
|
|
5624
|
+
this._volume = this.artboard.volume;
|
|
5625
|
+
}
|
|
5626
|
+
return this._volume;
|
|
5627
|
+
},
|
|
5628
|
+
set: function (value) {
|
|
5629
|
+
this._volume = value;
|
|
5630
|
+
if (this.artboard) {
|
|
5631
|
+
this.artboard.volume = value;
|
|
5632
|
+
}
|
|
5633
|
+
},
|
|
5634
|
+
enumerable: false,
|
|
5635
|
+
configurable: true
|
|
5636
|
+
});
|
|
5614
5637
|
// Error message for missing source or buffer
|
|
5615
5638
|
Rive.missingErrorMessage = "Rive source file or data buffer required";
|
|
5616
5639
|
return Rive;
|