@rive-app/webgl2-advanced 2.14.4 → 2.15.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.wasm +0 -0
- package/rive_advanced.mjs.d.ts +27 -4
- package/webgl2_advanced.mjs +48 -43
package/package.json
CHANGED
package/rive.wasm
CHANGED
|
Binary file
|
package/rive_advanced.mjs.d.ts
CHANGED
|
@@ -29,7 +29,8 @@ export interface RiveCanvas {
|
|
|
29
29
|
RenderPaintStyle: typeof RenderPaintStyle;
|
|
30
30
|
StrokeCap: typeof StrokeCap;
|
|
31
31
|
StrokeJoin: typeof StrokeJoin;
|
|
32
|
-
|
|
32
|
+
decodeAudio: DecodeAudio;
|
|
33
|
+
decodeImage: DecodeImage;
|
|
33
34
|
decodeFont: DecodeFont;
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -92,7 +93,7 @@ export interface RiveCanvas {
|
|
|
92
93
|
cancelAnimationFrame(requestID: number): void;
|
|
93
94
|
/**
|
|
94
95
|
* A Rive-specific function to "flush" queued up draw calls from using the renderer.
|
|
95
|
-
*
|
|
96
|
+
*
|
|
96
97
|
* This should only be invoked once at the end of a loop in a regular JS
|
|
97
98
|
* requestAnimationFrame loop, and should not be used with the Rive-wrapped
|
|
98
99
|
* requestAnimationFrame (aka, the requestAnimationFrame() API on this object) as that
|
|
@@ -269,6 +270,15 @@ export interface CanvasRenderFactory {
|
|
|
269
270
|
makeRenderPath(): CanvasRenderPath;
|
|
270
271
|
}
|
|
271
272
|
|
|
273
|
+
export class Audio {
|
|
274
|
+
unref(): void;
|
|
275
|
+
}
|
|
276
|
+
export interface AudioCallback {
|
|
277
|
+
(audio: Audio): void;
|
|
278
|
+
}
|
|
279
|
+
export interface DecodeAudio {
|
|
280
|
+
(bytes: Uint8Array, callback: AudioCallback): void;
|
|
281
|
+
}
|
|
272
282
|
export class Image {
|
|
273
283
|
unref(): void;
|
|
274
284
|
}
|
|
@@ -338,6 +348,7 @@ export declare class Artboard {
|
|
|
338
348
|
* Get the bounds of this Artboard instance
|
|
339
349
|
*/
|
|
340
350
|
get bounds(): AABB;
|
|
351
|
+
get hasAudio(): boolean;
|
|
341
352
|
get frameOrigin(): boolean;
|
|
342
353
|
set frameOrigin(val: boolean);
|
|
343
354
|
/**
|
|
@@ -896,13 +907,25 @@ export declare class Vec2D {
|
|
|
896
907
|
export declare class FileAsset {
|
|
897
908
|
name: string;
|
|
898
909
|
fileExtension: string;
|
|
910
|
+
uniqueFilename: string;
|
|
911
|
+
isAudio: boolean;
|
|
899
912
|
isImage: boolean;
|
|
900
913
|
isFont: boolean;
|
|
901
914
|
cdnUuid: string;
|
|
915
|
+
|
|
916
|
+
decode(bytes: Uint8Array): void;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Rive class extending the FileAsset that exposes a `setAudioSource()` API with a
|
|
921
|
+
* decoded Audio (via the `decodeAudio()` API) to set a new Audio on the Rive FileAsset
|
|
922
|
+
*/
|
|
923
|
+
export declare class AudioAsset extends FileAsset {
|
|
924
|
+
setAudioSource(audio: Audio): void;
|
|
902
925
|
}
|
|
903
926
|
|
|
904
927
|
/**
|
|
905
|
-
* Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
|
|
928
|
+
* Rive class extending the FileAsset that exposes a `setRenderImage()` API with a
|
|
906
929
|
* decoded Image (via the `decodeImage()` API) to set a new Image on the Rive FileAsset
|
|
907
930
|
*/
|
|
908
931
|
export declare class ImageAsset extends FileAsset {
|
|
@@ -910,7 +933,7 @@ export declare class ImageAsset extends FileAsset {
|
|
|
910
933
|
}
|
|
911
934
|
|
|
912
935
|
/**
|
|
913
|
-
* Rive class extending the FileAsset that exposes a `setFont()` API with a
|
|
936
|
+
* Rive class extending the FileAsset that exposes a `setFont()` API with a
|
|
914
937
|
* decoded Font (via the `decodeFont()` API) to set a new Font on the Rive FileAsset
|
|
915
938
|
*/
|
|
916
939
|
export declare class FontAsset extends FileAsset {
|
package/webgl2_advanced.mjs
CHANGED
|
@@ -70,52 +70,57 @@ function ea() {
|
|
|
70
70
|
const fa = n.onRuntimeInitialized;
|
|
71
71
|
n.onRuntimeInitialized = function() {
|
|
72
72
|
fa && fa();
|
|
73
|
-
let a = n.
|
|
74
|
-
n.
|
|
75
|
-
|
|
76
|
-
d
|
|
73
|
+
let a = n.decodeAudio;
|
|
74
|
+
n.decodeAudio = function(d, e) {
|
|
75
|
+
d = a(d);
|
|
76
|
+
e(d);
|
|
77
77
|
};
|
|
78
|
-
|
|
79
|
-
n.
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
let b = n.decodeFont;
|
|
79
|
+
n.decodeFont = function(d, e) {
|
|
80
|
+
d = b(d);
|
|
81
|
+
e(d);
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
const c = n.FileAssetLoader;
|
|
84
|
+
n.ptrToAsset = d => {
|
|
85
|
+
let e = n.ptrToFileAsset(d);
|
|
86
|
+
return e.isImage ? n.ptrToImageAsset(d) : e.isFont ? n.ptrToFontAsset(d) : e.isAudio ? n.ptrToAudioAsset(d) : e;
|
|
87
|
+
};
|
|
88
|
+
n.CustomFileAssetLoader = c.extend("CustomFileAssetLoader", {__construct:function({loadContents:d}) {
|
|
84
89
|
this.__parent.__construct.call(this);
|
|
85
|
-
this.Ab =
|
|
86
|
-
}, loadContents:function(
|
|
87
|
-
|
|
88
|
-
return this.Ab(
|
|
90
|
+
this.Ab = d;
|
|
91
|
+
}, loadContents:function(d, e) {
|
|
92
|
+
d = n.ptrToAsset(d);
|
|
93
|
+
return this.Ab(d, e);
|
|
89
94
|
},});
|
|
90
|
-
n.CDNFileAssetLoader =
|
|
95
|
+
n.CDNFileAssetLoader = c.extend("CDNFileAssetLoader", {__construct:function() {
|
|
91
96
|
this.__parent.__construct.call(this);
|
|
92
|
-
}, loadContents:function(
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
if ("" ===
|
|
97
|
+
}, loadContents:function(d) {
|
|
98
|
+
let e = n.ptrToAsset(d);
|
|
99
|
+
d = e.cdnUuid;
|
|
100
|
+
if ("" === d) {
|
|
96
101
|
return !1;
|
|
97
102
|
}
|
|
98
|
-
(function(
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
4 ==
|
|
103
|
+
(function(f, g) {
|
|
104
|
+
var m = new XMLHttpRequest();
|
|
105
|
+
m.responseType = "arraybuffer";
|
|
106
|
+
m.onreadystatechange = function() {
|
|
107
|
+
4 == m.readyState && 200 == m.status && g(m);
|
|
103
108
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})(
|
|
107
|
-
|
|
109
|
+
m.open("GET", f, !0);
|
|
110
|
+
m.send(null);
|
|
111
|
+
})(e.cdnBaseUrl + "/" + d, f => {
|
|
112
|
+
e.decode(new Uint8Array(f.response));
|
|
108
113
|
});
|
|
109
114
|
return !0;
|
|
110
115
|
},});
|
|
111
|
-
n.FallbackFileAssetLoader =
|
|
116
|
+
n.FallbackFileAssetLoader = c.extend("FallbackFileAssetLoader", {__construct:function() {
|
|
112
117
|
this.__parent.__construct.call(this);
|
|
113
118
|
this.fb = [];
|
|
114
|
-
}, addLoader:function(
|
|
115
|
-
this.fb.push(
|
|
116
|
-
}, loadContents:function(
|
|
117
|
-
for (let
|
|
118
|
-
if (
|
|
119
|
+
}, addLoader:function(d) {
|
|
120
|
+
this.fb.push(d);
|
|
121
|
+
}, loadContents:function(d, e) {
|
|
122
|
+
for (let f of this.fb) {
|
|
123
|
+
if (f.loadContents(d, e)) {
|
|
119
124
|
return !0;
|
|
120
125
|
}
|
|
121
126
|
}
|
|
@@ -389,7 +394,7 @@ function Pa(a, b) {
|
|
|
389
394
|
return Oa(c, a, b);
|
|
390
395
|
}));
|
|
391
396
|
}
|
|
392
|
-
var J, K, Ta = {
|
|
397
|
+
var J, K, Ta = {474256:(a, b, c, d, e) => {
|
|
393
398
|
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
|
|
394
399
|
return 0;
|
|
395
400
|
}
|
|
@@ -452,9 +457,9 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
452
457
|
}
|
|
453
458
|
window.h.Da += 1;
|
|
454
459
|
return 1;
|
|
455
|
-
},
|
|
460
|
+
}, 476434:() => {
|
|
456
461
|
"undefined" !== typeof window.h && (--window.h.Da, 0 === window.h.Da && delete window.h);
|
|
457
|
-
},
|
|
462
|
+
}, 476598:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 476702:() => {
|
|
458
463
|
try {
|
|
459
464
|
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
|
|
460
465
|
a.close();
|
|
@@ -462,7 +467,7 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
462
467
|
} catch (c) {
|
|
463
468
|
return 0;
|
|
464
469
|
}
|
|
465
|
-
},
|
|
470
|
+
}, 476873:(a, b, c, d, e, f) => {
|
|
466
471
|
if ("undefined" === typeof window.h) {
|
|
467
472
|
return -1;
|
|
468
473
|
}
|
|
@@ -508,7 +513,7 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
508
513
|
a == window.h.I.Ca && g.Z.connect(g.J.destination);
|
|
509
514
|
g.kb = f;
|
|
510
515
|
return window.h.tc(g);
|
|
511
|
-
},
|
|
516
|
+
}, 479750:a => window.h.wa(a).J.sampleRate, 479823:a => {
|
|
512
517
|
a = window.h.wa(a);
|
|
513
518
|
void 0 !== a.Z && (a.Z.onaudioprocess = function() {
|
|
514
519
|
}, a.Z.disconnect(), a.Z = void 0);
|
|
@@ -516,13 +521,13 @@ var J, K, Ta = {473872:(a, b, c, d, e) => {
|
|
|
516
521
|
a.J.close();
|
|
517
522
|
a.J = void 0;
|
|
518
523
|
a.kb = void 0;
|
|
519
|
-
},
|
|
524
|
+
}, 480223:a => {
|
|
520
525
|
window.h.xb(a);
|
|
521
|
-
},
|
|
526
|
+
}, 480273:a => {
|
|
522
527
|
a = window.h.wa(a);
|
|
523
528
|
a.J.resume();
|
|
524
529
|
a.state = window.h.ha.sb;
|
|
525
|
-
},
|
|
530
|
+
}, 480412:a => {
|
|
526
531
|
a = window.h.wa(a);
|
|
527
532
|
a.J.suspend();
|
|
528
533
|
a.state = window.h.ha.stopped;
|
|
@@ -3527,8 +3532,8 @@ n.dynCall_viijii = (a, b, c, d, e, f, g) => (n.dynCall_viijii = y.dynCall_viijii
|
|
|
3527
3532
|
n.dynCall_iiiiij = (a, b, c, d, e, f, g) => (n.dynCall_iiiiij = y.dynCall_iiiiij)(a, b, c, d, e, f, g);
|
|
3528
3533
|
n.dynCall_iiiiijj = (a, b, c, d, e, f, g, m, p) => (n.dynCall_iiiiijj = y.dynCall_iiiiijj)(a, b, c, d, e, f, g, m, p);
|
|
3529
3534
|
n.dynCall_iiiiiijj = (a, b, c, d, e, f, g, m, p, l) => (n.dynCall_iiiiiijj = y.dynCall_iiiiiijj)(a, b, c, d, e, f, g, m, p, l);
|
|
3530
|
-
n.___start_em_js =
|
|
3531
|
-
n.___stop_em_js =
|
|
3535
|
+
n.___start_em_js = 471632;
|
|
3536
|
+
n.___stop_em_js = 474256;
|
|
3532
3537
|
var $d;
|
|
3533
3538
|
Ia = function ae() {
|
|
3534
3539
|
$d || be();
|