@rive-app/webgl2-advanced 2.49.3 → 2.49.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/README.md ADDED
@@ -0,0 +1,21 @@
1
+ ![npm](https://img.shields.io/npm/v/@rive-app/webgl2-advanced)
2
+ # Rive
3
+ Low-level Rive API using WebGL2 and the Rive Renderer. Please see https://github.com/rive-app/rive-wasm for a list of all the available web runtimes and their details.
4
+
5
+ [Rive](https://rive.app) is an agent-native 2D and 3D engine for games, apps, and interactive UI. Use it as your whole engine, or add it to the products you already have. Build with your coding agent through the [Rive CLI](https://rive.app/agents), or draw, rig, and animate by hand with the professional design and animation tools in the [Rive Editor](https://rive.app/editor). Both work on the same files. Open-source runtimes, no royalties or runtime fees. Rive files (`.riv`) play natively on web, mobile, desktop, game engines, consoles, smart TVs, and cars.
6
+
7
+ ```
8
+ npm install @rive-app/webgl2-advanced
9
+ ```
10
+
11
+ [Getting Started](https://github.com/rive-app/rive-wasm#getting-started)
12
+
13
+ ## Build with your agent
14
+
15
+ Paste this into Claude Code, Codex, Cursor, or any agent that runs commands on your computer:
16
+
17
+ ```text
18
+ Install the Rive CLI from rive.app/cli. Build an interactive hero for my website as a Rive file and add it to the page with the Rive web runtime.
19
+ ```
20
+
21
+ Your agent installs the [Rive CLI](https://rive.app/agents), writes the scene, and opens a preview window that rebuilds every time it saves. Keep giving it notes, or open the same file in the [Rive Editor](https://editor.rive.app/) and shape it by hand. Trying it needs no account. Writing the `.riv` that ships on your site needs a free Rive account. Free exports play a short Rive splash screen; [paid plans](https://rive.app/pricing) export without it. See [Getting started with the Rive CLI](https://rive.app/docs/cli/getting-started).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rive-app/webgl2-advanced",
3
- "version": "2.49.3",
4
- "description": "Rive's webgl2 low-level canvas based web api.",
3
+ "version": "2.49.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",
7
7
  "repository": {
@@ -10,7 +10,11 @@
10
10
  },
11
11
  "keywords": [
12
12
  "rive",
13
- "animation"
13
+ "animation",
14
+ "interactive",
15
+ "ui",
16
+ "game-engine",
17
+ "graphics"
14
18
  ],
15
19
  "author": "Rive",
16
20
  "contributors": [
package/rive.wasm CHANGED
Binary file
@@ -1009,6 +1009,8 @@ export interface FocusState {
1009
1009
  hasFocus: boolean;
1010
1010
  /** True if the focused element accepts keyboard input (e.g. a TextInput node). */
1011
1011
  expectsKeyboardInput: boolean;
1012
+ /** True if the focused element or an ancestor takes typed text: show a virtual keyboard. */
1013
+ expectsTextInput: boolean;
1012
1014
  }
1013
1015
 
1014
1016
  export declare class LinearAnimation {
Binary file
@@ -284,14 +284,14 @@ return}switch(m){case 1:m=u;lb[g>>2]=m;lb[g+4>>2]=(m-lb[g>>2])/4294967296;break;
284
284
  !1;return m},["delete"](){this.m.u||zc(this);if(this.m.la&&!this.m.ga)throw new Vb("Object already scheduled for deletion");nc(this);var m=this.m;--m.count.value;0===m.count.value&&(m.D?m.K.O(m.D):m.v.o.O(m.u));this.m.ga||(this.m.D=void 0,this.m.u=void 0)},isDeleted:function(){return!this.m.u},deleteLater:function(){this.m.u||zc(this);if(this.m.la&&!this.m.ga)throw new Vb("Object already scheduled for deletion");Ac.push(this);this.m.la=!0;return this}});const g=Symbol.dispose;g&&(d[g]=d["delete"])})();
285
285
  Object.assign($c.prototype,{vc(d){this.Db&&(d=this.Db(d));return d},ob(d){this.O?.(d)},J:sc,s:function(d){function g(){return this.Ga?Zc(this.o.N,{v:this.Oc,u:m,K:this,D:d}):Zc(this.o.N,{v:this,u:d})}var m=this.vc(d);if(!m)return this.ob(d),null;var u=Yc(this.o,m);if(void 0!==u){if(0===u.m.count.value)return u.m.u=m,u.m.D=d,u.clone();u=u.clone();this.ob(d);return u}u=this.o.uc(m);u=Cc[u];if(!u)return g.call(this);u=this.Fa?u.jc:u.pointerType;var y=Xc(m,this.o,u.o);return null===y?g.call(this):this.Ga?
286
286
  Zc(u.o.N,{v:u,u:y,K:this,D:d}):Zc(u.o.N,{v:u,u:y})}});for(let d=0;32>d;++d)se.push(Array(d));K.print&&(Va=K.print);K.printErr&&(Wa=K.printErr);K.wasmBinary&&(Xa=K.wasmBinary);K.thisProgram&&(Pa=K.thisProgram);if(K.preInit)for("function"==typeof K.preInit&&(K.preInit=[K.preInit]);0<K.preInit.length;)K.preInit.shift()();
287
- var Ee={362116:(d,g,m,u,y)=>{if("undefined"===typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if("undefined"===typeof window.miniaudio){window.miniaudio={referenceCount:0};window.miniaudio.device_type={};window.miniaudio.device_type.playback=d;window.miniaudio.device_type.capture=g;window.miniaudio.device_type.duplex=m;window.miniaudio.device_state={};window.miniaudio.device_state.stopped=u;window.miniaudio.device_state.started=y;let D=window.miniaudio;D.devices=
287
+ var Ee={361988:(d,g,m,u,y)=>{if("undefined"===typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if("undefined"===typeof window.miniaudio){window.miniaudio={referenceCount:0};window.miniaudio.device_type={};window.miniaudio.device_type.playback=d;window.miniaudio.device_type.capture=g;window.miniaudio.device_type.duplex=m;window.miniaudio.device_state={};window.miniaudio.device_state.stopped=u;window.miniaudio.device_state.started=y;let D=window.miniaudio;D.devices=
288
288
  [];D.track_device=function(E){for(var F=0;F<D.devices.length;++F)if(null==D.devices[F])return D.devices[F]=E,F;D.devices.push(E);return D.devices.length-1};D.untrack_device_by_index=function(E){for(D.devices[E]=null;0<D.devices.length;)if(null==D.devices[D.devices.length-1])D.devices.pop();else break};D.untrack_device=function(E){for(var F=0;F<D.devices.length;++F)if(D.devices[F]==E)return D.untrack_device_by_index(F)};D.get_device_by_index=function(E){return D.devices[E]};D.unlock_event_types=["touchend",
289
- "click"];D.unlock=function(){for(var E=0;E<D.devices.length;++E){var F=D.devices[E];null!=F&&null!=F.L&&F.state===D.device_state.started&&F.L.resume().then(()=>{Be(F.yb)},L=>{console.error("Failed to resume audiocontext",L)})}D.unlock_event_types.map(function(L){document.removeEventListener(L,D.unlock,!0)})};D.unlock_event_types.map(function(E){document.addEventListener(E,D.unlock,!0)})}window.miniaudio.referenceCount+=1;return 1},364294:()=>{"undefined"!==typeof window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(d){document.removeEventListener(d,
290
- window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},364598:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,364702:()=>{try{var d=new (window.AudioContext||window.webkitAudioContext),g=d.sampleRate;d.close();return g}catch(m){return 0}},364873:(d,g,m,u,y,D)=>{if("undefined"===typeof window.miniaudio)return-1;var E={},F={};d==window.miniaudio.device_type.playback&&0!=m&&(F.sampleRate=m);E.L=
289
+ "click"];D.unlock=function(){for(var E=0;E<D.devices.length;++E){var F=D.devices[E];null!=F&&null!=F.L&&F.state===D.device_state.started&&F.L.resume().then(()=>{Be(F.yb)},L=>{console.error("Failed to resume audiocontext",L)})}D.unlock_event_types.map(function(L){document.removeEventListener(L,D.unlock,!0)})};D.unlock_event_types.map(function(E){document.addEventListener(E,D.unlock,!0)})}window.miniaudio.referenceCount+=1;return 1},364166:()=>{"undefined"!==typeof window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(d){document.removeEventListener(d,
290
+ window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},364470:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,364574:()=>{try{var d=new (window.AudioContext||window.webkitAudioContext),g=d.sampleRate;d.close();return g}catch(m){return 0}},364745:(d,g,m,u,y,D)=>{if("undefined"===typeof window.miniaudio)return-1;var E={},F={};d==window.miniaudio.device_type.playback&&0!=m&&(F.sampleRate=m);E.L=
291
291
  new (window.AudioContext||window.webkitAudioContext)(F);E.L.suspend();E.state=window.miniaudio.device_state.stopped;m=0;d!=window.miniaudio.device_type.playback&&(m=g);E.U=E.L.createScriptProcessor(u,m,g);E.U.onaudioprocess=function(L){if(null==E.oa||0==E.oa.length||E.oa.buffer!==mb.buffer)E.oa=new Float32Array(mb.buffer,Number(y),u*g);if(d==window.miniaudio.device_type.capture||d==window.miniaudio.device_type.duplex){for(var P=0;P<g;P+=1)for(var T=L.inputBuffer.getChannelData(P),U=E.oa,W=0;W<u;W+=
292
292
  1)U[W*g+P]=T[W];Ce(D,u,y)}if(d==window.miniaudio.device_type.playback||d==window.miniaudio.device_type.duplex)for(De(D,u,y),P=0;P<L.outputBuffer.numberOfChannels;++P)for(T=L.outputBuffer.getChannelData(P),U=E.oa,W=0;W<u;W+=1)T[W]=U[W*g+P];else for(P=0;P<L.outputBuffer.numberOfChannels;++P)L.outputBuffer.getChannelData(P).fill(0)};d!=window.miniaudio.device_type.capture&&d!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(L){E.Na=E.L.createMediaStreamSource(L);
293
- E.Na.connect(E.U);E.U.connect(E.L.destination)}).catch(function(L){console.log("Failed to get user media: "+L)});d==window.miniaudio.device_type.playback&&E.U.connect(E.L.destination);E.yb=D;return window.miniaudio.track_device(E)},367817:d=>window.miniaudio.get_device_by_index(d).L.sampleRate,367890:d=>{d=window.miniaudio.get_device_by_index(d);void 0!==d.U&&(d.U.onaudioprocess=function(){},d.U.disconnect(),d.U=void 0);void 0!==d.Na&&(d.Na.disconnect(),d.Na=void 0);d.L.close();d.L=void 0;d.yb=void 0},
294
- 368290:d=>{window.miniaudio.untrack_device_by_index(d)},368340:d=>{d=window.miniaudio.get_device_by_index(d);d.L.resume();d.state=window.miniaudio.device_state.started},368479:d=>{d=window.miniaudio.get_device_by_index(d);d.L.suspend();d.state=window.miniaudio.device_state.stopped}},dc,ve,cc,Fe,Ge,He,Ie,Je,Ke,Le,Me,Ne,Oe,Pe,Be,Ce,De,Qe,Re,Hb,ze,Jb,rb,cd,Te={__syscall_fcntl64:function(){return 0},__syscall_ioctl:function(){return 0},__syscall_openat:function(){},_abort_js:()=>sb(""),_embind_create_inheriting_constructor:(d,
293
+ E.Na.connect(E.U);E.U.connect(E.L.destination)}).catch(function(L){console.log("Failed to get user media: "+L)});d==window.miniaudio.device_type.playback&&E.U.connect(E.L.destination);E.yb=D;return window.miniaudio.track_device(E)},367689:d=>window.miniaudio.get_device_by_index(d).L.sampleRate,367762:d=>{d=window.miniaudio.get_device_by_index(d);void 0!==d.U&&(d.U.onaudioprocess=function(){},d.U.disconnect(),d.U=void 0);void 0!==d.Na&&(d.Na.disconnect(),d.Na=void 0);d.L.close();d.L=void 0;d.yb=void 0},
294
+ 368162:d=>{window.miniaudio.untrack_device_by_index(d)},368212:d=>{d=window.miniaudio.get_device_by_index(d);d.L.resume();d.state=window.miniaudio.device_state.started},368351:d=>{d=window.miniaudio.get_device_by_index(d);d.L.suspend();d.state=window.miniaudio.device_state.stopped}},dc,ve,cc,Fe,Ge,He,Ie,Je,Ke,Le,Me,Ne,Oe,Pe,Be,Ce,De,Qe,Re,Hb,ze,Jb,rb,cd,Te={__syscall_fcntl64:function(){return 0},__syscall_ioctl:function(){return 0},__syscall_openat:function(){},_abort_js:()=>sb(""),_embind_create_inheriting_constructor:(d,
295
295
  g,m)=>{d=Zb(d);g=mc(g,"wrapper");m=Wb(m);var u=g.o,y=u.N,D=u.C.N,E=u.C.constructor;d=Sb(d,function(...F){for(var L of u.C.Ab)if(this[L]===D[L])throw new Yb(`Pure virtual function ${L} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:y});this.__construct(...F)});y.__construct=function(...F){if(this===y)throw new Vb("Pass correct 'this' to __construct");F=E.implement(this,...F);nc(F);var L=F.m;F.notifyOnDestruction();L.ga=!0;Object.defineProperties(this,{m:{value:L}});
296
296
  pc(this);F=L.u;F=ac(u,F);if($b.hasOwnProperty(F))throw new Vb(`Tried to register registered instance: ${F}`);$b[F]=this};y.__destruct=function(){if(this===y)throw new Vb("Pass correct 'this' to __destruct");nc(this);var F=this.m.u;F=ac(u,F);if($b.hasOwnProperty(F))delete $b[F];else throw new Vb(`Tried to unregister unregistered instance: ${F}`);};d.prototype=Object.create(y);Object.assign(d.prototype,m);return Xb(d)},_embind_finalize_value_object:d=>{var g=qc[d];delete qc[d];var m=g.cb,u=g.O,y=g.qb,
297
297
  D=y.map(E=>E.yc).concat(y.map(E=>E.Sj));xc([d],D,E=>{var F={},L,P;for([L,P]of y.entries()){const T=E[L],U=P.wc,W=P.xc,na=E[L+y.length],oa=P.Rj,wa=P.Tj;F[P.rc]={read:aa=>T.s(U(W,aa)),write:(aa,ca)=>{var ha=[];oa(wa,aa,na.B(ha,ca));rc(ha)},optional:T.optional}}return[{name:g.name,s:T=>{var U={},W;for(W in F)U[W]=F[W].read(T);u(T);return U},B:(T,U)=>{for(var W in F)if(!(W in U||F[W].optional))throw new TypeError(`Missing field: "${W}"`);var na=m();for(W in F)F[W].write(na,U[W]);null!==T&&T.push(u,na);