@rive-app/webgl2-advanced 2.49.4 → 2.51.0
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 +33 -5
- package/rive_fallback.wasm +0 -0
- package/webgl2_advanced.mjs +280 -274
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rive-app/webgl2-advanced",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.51.0",
|
|
4
4
|
"description": "Rive web runtime, low-level API, WebGL2 renderer. Rive is an agent-native 2D and 3D engine for games, apps, and interactive UI.",
|
|
5
5
|
"main": "webgl2_advanced.mjs",
|
|
6
6
|
"homepage": "https://rive.app",
|
package/rive.wasm
CHANGED
|
Binary file
|
package/rive_advanced.mjs.d.ts
CHANGED
|
@@ -22,6 +22,14 @@ interface RiveOptions {
|
|
|
22
22
|
declare function Rive(options?: RiveOptions): Promise<RiveCanvas>;
|
|
23
23
|
export default Rive;
|
|
24
24
|
|
|
25
|
+
/** Resolved script fetch options; see RuntimeLoader.setScriptFetch. */
|
|
26
|
+
export interface ScriptFetchConfig {
|
|
27
|
+
proxyUrl: string | null;
|
|
28
|
+
allowedHosts: string[] | null;
|
|
29
|
+
/** 0 keeps the runtime's default. */
|
|
30
|
+
maxResponseBytes: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
/**
|
|
26
34
|
* RiveCanvas is the main export object that contains references to different Rive classes to help
|
|
27
35
|
* build the Rive render loop for low-level API usage. In addition, this contains multiple methods
|
|
@@ -52,8 +60,12 @@ export interface RiveCanvas {
|
|
|
52
60
|
decodeAudio: DecodeAudio;
|
|
53
61
|
decodeImage: DecodeImage;
|
|
54
62
|
decodeFont: DecodeFont;
|
|
55
|
-
// Returns a pointer value to the FontWrapper
|
|
56
|
-
|
|
63
|
+
// Returns a pointer value to the FontWrapper. [languages] are BCP 47 tags,
|
|
64
|
+
// the text's own language first, then the system languages.
|
|
65
|
+
setFallbackFontCallback: (callback: (missingGlyph: number, fallbackFontIndex: number, weight: number, languages: string[]) => number | null) => void;
|
|
66
|
+
// The preferred languages text without a language of its own shapes and
|
|
67
|
+
// falls back with, most preferred first.
|
|
68
|
+
setSystemLanguages: (languages: string[]) => void;
|
|
57
69
|
|
|
58
70
|
/**
|
|
59
71
|
* @experimental Creates a deferred recording session. Only present in builds
|
|
@@ -93,6 +105,13 @@ export interface RiveCanvas {
|
|
|
93
105
|
*/
|
|
94
106
|
awaitReplayCaps?(): Promise<void> | undefined;
|
|
95
107
|
|
|
108
|
+
/**
|
|
109
|
+
* @experimental Enables scripts' fetch() for every file, or disables it
|
|
110
|
+
* with null. Only in builds with script networking (the threaded webgl2
|
|
111
|
+
* build), so always feature-detect it. Use RuntimeLoader.setScriptFetch.
|
|
112
|
+
*/
|
|
113
|
+
configureScriptFetch?(options: ScriptFetchConfig | null): void;
|
|
114
|
+
|
|
96
115
|
/**
|
|
97
116
|
* Loads a Rive file for the runtime and returns a Rive-specific File class
|
|
98
117
|
*
|
|
@@ -101,6 +120,9 @@ export interface RiveCanvas {
|
|
|
101
120
|
* @param enableRiveAssetCDN - boolean flag to allow loading assets from the Rive CDN, enabled by default.
|
|
102
121
|
* @param session - @experimental Deferred session to import through. The file's mode is fixed
|
|
103
122
|
* at import: pass null (the default) for an immediate file.
|
|
123
|
+
* @param deferDecoding - Decode animations, artboards (other than the default
|
|
124
|
+
* one) and file level view model instances the first time they're used instead of at import.
|
|
125
|
+
* False by default.
|
|
104
126
|
* @returns A Promise for a Rive File class
|
|
105
127
|
*/
|
|
106
128
|
load(
|
|
@@ -108,6 +130,7 @@ export interface RiveCanvas {
|
|
|
108
130
|
assetLoader?: FileAssetLoader,
|
|
109
131
|
enableRiveAssetCDN?: boolean,
|
|
110
132
|
session?: DeferredSession | null,
|
|
133
|
+
deferDecoding?: boolean,
|
|
111
134
|
): Promise<File>;
|
|
112
135
|
|
|
113
136
|
/**
|
|
@@ -150,9 +173,14 @@ export interface RiveCanvas {
|
|
|
150
173
|
* A Rive-specific requestAnimationFrame function; this must be used instead of the global
|
|
151
174
|
* requestAnimationFrame function.
|
|
152
175
|
* @param cb - Callback function to call with an elapsed timestamp
|
|
176
|
+
* @param onWorker - True when the caller's renderer draws on the replay
|
|
177
|
+
* worker (`replaysOnWorker()`), so a worker's frames pace it
|
|
153
178
|
* @returns number - An ID of the requestAnimationFrame request
|
|
154
179
|
*/
|
|
155
|
-
requestAnimationFrame(
|
|
180
|
+
requestAnimationFrame(
|
|
181
|
+
cb: (timestamp: DOMHighResTimeStamp) => void,
|
|
182
|
+
onWorker?: boolean,
|
|
183
|
+
): number;
|
|
156
184
|
/**
|
|
157
185
|
* A Rive-specific cancelAnimationFrame function; this must be used instead of the global
|
|
158
186
|
* cancelAnimationFrame function.
|
|
@@ -321,7 +349,7 @@ export declare class RendererWrapper {
|
|
|
321
349
|
acceptsFrame?(): boolean;
|
|
322
350
|
/**
|
|
323
351
|
* @experimental How long the replay worker's recent frames took to finish,
|
|
324
|
-
* in milliseconds, or 0 before its
|
|
352
|
+
* in milliseconds, or 0 before its third.
|
|
325
353
|
*/
|
|
326
354
|
replayMs?(): number;
|
|
327
355
|
/**
|
|
@@ -1150,7 +1178,7 @@ export declare class StateMachineInstance {
|
|
|
1150
1178
|
* @param dy - Vertical distance the content moves, in Artboard pixels. Revealing content below
|
|
1151
1179
|
* is negative.
|
|
1152
1180
|
* @param phase - Where the event sits within its gesture: 0 begin, 1 update, 2 end,
|
|
1153
|
-
* 3 momentum, 4 inertiaCancel. A phaseless wheel
|
|
1181
|
+
* 3 momentum, 4 inertiaCancel. A phaseless wheel sends 1 (update), or 3 for momentum.
|
|
1154
1182
|
* @param precise - True for a pixel-precise source such as a trackpad, false for a detented
|
|
1155
1183
|
* wheel.
|
|
1156
1184
|
* @param timeStamp - Event time in seconds.
|
package/rive_fallback.wasm
CHANGED
|
Binary file
|