@rive-app/webgl2 2.40.1 → 2.41.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 +206 -5
- package/rive.js +340 -50
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +27 -12
- package/rive_fallback.wasm +0 -0
- package/semantics/index.d.ts +1 -1
- package/semantics/types.d.ts +15 -2
package/rive.js
CHANGED
|
@@ -431,14 +431,14 @@ c.ec.count.value+=1;c.ec.Xc=!1;return c},["delete"](){this.ec.lc||dc(this);if(th
|
|
|
431
431
|
const b=Symbol.dispose;b&&(a[b]=a["delete"])})();
|
|
432
432
|
Object.assign(tc.prototype,{ye(a){this.Zd&&(a=this.Zd(a));return a},Md(a){this.Ec?.(a)},wc:Yb,kc:function(a){function b(){return this.kd?sc(this.fc.Bc,{nc:this.Me,lc:c,yc:this,sc:a}):sc(this.fc.Bc,{nc:this,lc:a})}var c=this.ye(a);if(!c)return this.Md(a),null;var d=rc(this.fc,c);if(void 0!==d){if(0===d.ec.count.value)return d.ec.lc=c,d.ec.sc=a,d.clone();d=d.clone();this.Md(a);return d}d=this.fc.xe(c);d=gc[d];if(!d)return b.call(this);d=this.jd?d.oe:d.pointerType;var e=qc(c,this.fc,d.fc);return null===
|
|
433
433
|
e?b.call(this):this.kd?sc(d.fc.Bc,{nc:d,lc:e,yc:this,sc:a}):sc(d.fc.Bc,{nc:d,lc:e})}});for(let a=0;32>a;++a)od.push(Array(a));l.print&&(oa=l.print);l.printErr&&(y=l.printErr);l.wasmBinary&&(pa=l.wasmBinary);l.thisProgram&&(ja=l.thisProgram);if(l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.shift()();
|
|
434
|
-
var yd={
|
|
434
|
+
var yd={325814:(a,b,c,d,e)=>{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=a;window.miniaudio.device_type.capture=b;window.miniaudio.device_type.duplex=c;window.miniaudio.device_state={};window.miniaudio.device_state.stopped=d;window.miniaudio.device_state.started=e;let f=window.miniaudio;f.devices=
|
|
435
435
|
[];f.track_device=function(g){for(var h=0;h<f.devices.length;++h)if(null==f.devices[h])return f.devices[h]=g,h;f.devices.push(g);return f.devices.length-1};f.untrack_device_by_index=function(g){for(f.devices[g]=null;0<f.devices.length;)if(null==f.devices[f.devices.length-1])f.devices.pop();else break};f.untrack_device=function(g){for(var h=0;h<f.devices.length;++h)if(f.devices[h]==g)return f.untrack_device_by_index(h)};f.get_device_by_index=function(g){return f.devices[g]};f.unlock_event_types=["touchend",
|
|
436
|
-
"click"];f.unlock=function(){for(var g=0;g<f.devices.length;++g){var h=f.devices[g];null!=h&&null!=h.zc&&h.state===f.device_state.started&&h.zc.resume().then(()=>{vd(h.Wd)},k=>{console.error("Failed to resume audiocontext",k)})}f.unlock_event_types.map(function(k){document.removeEventListener(k,f.unlock,!0)})};f.unlock_event_types.map(function(g){document.addEventListener(g,f.unlock,!0)})}window.miniaudio.referenceCount+=1;return 1},
|
|
437
|
-
window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},
|
|
436
|
+
"click"];f.unlock=function(){for(var g=0;g<f.devices.length;++g){var h=f.devices[g];null!=h&&null!=h.zc&&h.state===f.device_state.started&&h.zc.resume().then(()=>{vd(h.Wd)},k=>{console.error("Failed to resume audiocontext",k)})}f.unlock_event_types.map(function(k){document.removeEventListener(k,f.unlock,!0)})};f.unlock_event_types.map(function(g){document.addEventListener(g,f.unlock,!0)})}window.miniaudio.referenceCount+=1;return 1},327992:()=>{"undefined"!==typeof window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(a){document.removeEventListener(a,
|
|
437
|
+
window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},328296:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,328400:()=>{try{var a=new (window.AudioContext||window.webkitAudioContext),b=a.sampleRate;a.close();return b}catch(c){return 0}},328571:(a,b,c,d,e,f)=>{if("undefined"===typeof window.miniaudio)return-1;var g={},h={};a==window.miniaudio.device_type.playback&&0!=c&&(h.sampleRate=c);g.zc=
|
|
438
438
|
new (window.AudioContext||window.webkitAudioContext)(h);g.zc.suspend();g.state=window.miniaudio.device_state.stopped;c=0;a!=window.miniaudio.device_type.playback&&(c=b);g.Oc=g.zc.createScriptProcessor(d,c,b);g.Oc.onaudioprocess=function(k){if(null==g.hd||0==g.hd.length)g.hd=new Float32Array(ua.buffer,e,d*b);if(a==window.miniaudio.device_type.capture||a==window.miniaudio.device_type.duplex){for(var m=0;m<b;m+=1)for(var q=k.inputBuffer.getChannelData(m),v=g.hd,t=0;t<d;t+=1)v[t*b+m]=q[t];wd(f,d,e)}if(a==
|
|
439
439
|
window.miniaudio.device_type.playback||a==window.miniaudio.device_type.duplex)for(xd(f,d,e),m=0;m<k.outputBuffer.numberOfChannels;++m)for(q=k.outputBuffer.getChannelData(m),v=g.hd,t=0;t<d;t+=1)q[t]=v[t*b+m];else for(m=0;m<k.outputBuffer.numberOfChannels;++m)k.outputBuffer.getChannelData(m).fill(0)};a!=window.miniaudio.device_type.capture&&a!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(k){g.sd=g.zc.createMediaStreamSource(k);g.sd.connect(g.Oc);
|
|
440
|
-
g.Oc.connect(g.zc.destination)}).catch(function(k){console.log("Failed to get user media: "+k)});a==window.miniaudio.device_type.playback&&g.Oc.connect(g.zc.destination);g.Wd=f;return window.miniaudio.track_device(g)},
|
|
441
|
-
{window.miniaudio.untrack_device_by_index(a)},
|
|
440
|
+
g.Oc.connect(g.zc.destination)}).catch(function(k){console.log("Failed to get user media: "+k)});a==window.miniaudio.device_type.playback&&g.Oc.connect(g.zc.destination);g.Wd=f;return window.miniaudio.track_device(g)},331448:a=>window.miniaudio.get_device_by_index(a).zc.sampleRate,331521:a=>{a=window.miniaudio.get_device_by_index(a);void 0!==a.Oc&&(a.Oc.onaudioprocess=function(){},a.Oc.disconnect(),a.Oc=void 0);void 0!==a.sd&&(a.sd.disconnect(),a.sd=void 0);a.zc.close();a.zc=void 0;a.Wd=void 0},331921:a=>
|
|
441
|
+
{window.miniaudio.untrack_device_by_index(a)},331971:a=>{a=window.miniaudio.get_device_by_index(a);a.zc.resume();a.state=window.miniaudio.device_state.started},332110:a=>{a=window.miniaudio.get_device_by_index(a);a.zc.suspend();a.state=window.miniaudio.device_state.stopped}},Qb,rd,Pb,vd,wd,xd,zd,Ad,Bd,Aa,vc,Dd={pa:function(a,b,c){Ka=c;try{var d=vb(a);switch(b){case 0:var e=K();if(0>e)break;for(;kb[e];)e++;return xb(d,e).Mc;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=K(),d.flags|=
|
|
442
442
|
e,0;case 12:return e=K(),D[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(f){if("undefined"==typeof Gb||"ErrnoError"!==f.name)throw f;return-f.Lc}},vb:function(a,b,c){Ka=c;try{var d=vb(a);switch(b){case 21509:return d.mc?0:-59;case 21505:if(!d.mc)return-59;if(d.mc.Kc.Fe){a=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var e=K();G[e>>2]=25856;G[e+4>>2]=5;G[e+8>>2]=191;G[e+12>>2]=35387;for(var f=0;32>f;f++)A[e+f+17]=a[f]||0}return 0;case 21510:case 21511:case 21512:return d.mc?
|
|
443
443
|
0:-59;case 21506:case 21507:case 21508:if(!d.mc)return-59;if(d.mc.Kc.Ge)for(e=K(),a=[],f=0;32>f;f++)a.push(A[e+f+17]);return 0;case 21519:if(!d.mc)return-59;e=K();return G[e>>2]=0;case 21520:return d.mc?-28:-59;case 21537:case 21531:e=K();if(!d.hc.Ee)throw new M(59);return d.hc.Ee(d,b,e);case 21523:if(!d.mc)return-59;d.mc.Kc.He&&(f=[24,80],e=K(),D[e>>1]=f[0],D[e+2>>1]=f[1]);return 0;case 21524:return d.mc?0:-59;case 21515:return d.mc?0:-59;default:return-28}}catch(g){if("undefined"==typeof Gb||"ErrnoError"!==
|
|
444
444
|
g.name)throw g;return-g.Lc}},wb:function(a,b,c,d){Ka=d;try{b=b?L(B,b):"";var e=b;if("/"===e.charAt(0))b=e;else{var f=-100===a?"/":vb(a).path;if(0==e.length)throw new M(44);b=f+"/"+e}var g=d?K():0;return Db(b,c,g).Mc}catch(h){if("undefined"==typeof Gb||"ErrnoError"!==h.name)throw h;return-h.Lc}},zb:()=>Ba(""),la:(a,b,c)=>{a=R(a);b=Sb(b,"wrapper");c=Q(c);var d=b.fc,e=d.Bc,f=d.rc.Bc,g=d.rc.constructor;a=Hb(a,function(...h){for(var k of d.rc.Xd)if(this[k]===f[k])throw new Lb(`Pure virtual function ${k} must be implemented in JavaScript`);
|
|
@@ -454,33 +454,33 @@ b,c,d,e,f,g,h)=>{var k=zc(c,d);b=R(b);b=Ac(b);f=V(e,f);T([],[a],m=>{function q()
|
|
|
454
454
|
V(d,e);T([],[a],q=>{q=q[0];var v=`${q.name}.${b}`,t={get(){W(`Cannot access ${v} due to unbound types`,[c,g])},enumerable:!0,configurable:!0};t.set=k?()=>W(`Cannot access ${v} due to unbound types`,[c,g]):()=>{throw new P(v+" is a read-only property");};Object.defineProperty(q.fc.Bc,b,t);T([],k?[c,g]:[c],C=>{var p=C[0],r={get(){var x=Bc(this,q,v+" getter");return p.kc(e(f,x))},enumerable:!0};if(k){k=V(h,k);var w=C[1];r.set=function(x){var z=Bc(this,q,v+" setter"),E=[];k(m,z,w.oc(E,x));Xb(E)}}Object.defineProperty(q.fc.Bc,
|
|
455
455
|
b,r);return[]});return[]})},$a:a=>S(a,Dc),ma:(a,b,c,d,e)=>{b=R(b);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function g(){}g.values={};S(a,{name:b,constructor:g,valueType:e,kc:function(h){return this.constructor.values[h]},oc:(h,k)=>k.value,wc:Ec(b,c,d),vc:null});ic(b,g);break;case "number":var f={};S(a,{name:b,Ed:f,valueType:e,kc:h=>h,oc:(h,k)=>k,wc:Ec(b,c,d),vc:null});ic(b,f);delete l[b].Ic;break;case "string":f={},S(a,{name:b,fe:{},ae:{},Ed:f,valueType:e,kc:function(h){return this.ae[h]},
|
|
456
456
|
oc:function(h,k){return this.fe[k]},wc:Ec(b,c,d),vc:null}),ic(b,f),delete l[b].Ic}},k:(a,b,c)=>{var d=Sb(a,"enum");b=R(b);switch(d.valueType){case "object":a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:Hb(`${d.name}_${b}`,function(){})}});a.values[c]=d;a[b]=d;break;case "number":d.Ed[b]=c;break;case "string":d.fe[b]=c,d.ae[c]=b,d.Ed[b]=b}},ha:(a,b,c)=>{b=R(b);S(a,{name:b,kc:d=>d,oc:(d,e)=>e,wc:Fc(b,c),vc:null})},j:(a,b,c,d,e,f)=>{var g=zc(b,c);a=R(a);
|
|
457
|
-
a=Ac(a);e=V(d,e);ic(a,function(){W(`Cannot call ${a} due to unbound types`,g)},b-1);T([],g,h=>{uc(a,yc(a,[h[0],null].concat(h.slice(1)),null,e,f),b-1);return[]})},
|
|
458
|
-
S(a,{name:c,kc:d,wc:d},{Ce:!0})},ab:(a,b)=>{b=R(b);S(a,{name:b,kc(c){var d=(d=c+4)?L(B,d,J[c>>2],!0):"";Qb(c);return d},oc(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new P("Cannot pass non-string to std::string");var f=e?Ua(d):d.length;var g=rd(4+f+1),h=g+4;J[g>>2]=f;e?Va(d,B,h,f+1):B.set(d,h);null!==c&&c.push(Qb,g);return g},wc:Yb,vc(c){Qb(c)}})},
|
|
459
|
-
Kc,e=Lc,f=Mc;S(a,{name:c,kc:g=>{var h=d(g+4,J[g>>2]*b,!0);Qb(g);return h},oc:(g,h)=>{if("string"!=typeof h)throw new P(`Cannot pass non-string to C++ string type ${c}`);var k=f(h),m=rd(4+k+b);J[m>>2]=k/b;e(h,m+4,k+b);null!==g&&g.push(Qb,m);return m},wc:Yb,vc(g){Qb(g)}})},lb:(a,b,c,d,e,f)=>{Wb[a]={name:R(b),Gd:V(c,d),Ec:V(e,f),Od:[]}},kb:(a,b,c,d,e,f,g,h,k,m)=>{Wb[a].Od.push({ve:R(b),Be:c,ze:V(d,e),Ae:f,Pe:g,Oe:V(h,k),Qe:m})},db:(a,b)=>{b=R(b);S(a,{Ie:!0,name:b,kc:()=>{},oc:()=>{}})},
|
|
457
|
+
a=Ac(a);e=V(d,e);ic(a,function(){W(`Cannot call ${a} due to unbound types`,g)},b-1);T([],g,h=>{uc(a,yc(a,[h[0],null].concat(h.slice(1)),null,e,f),b-1);return[]})},u:(a,b,c,d,e)=>{b=R(b);let f=h=>h;if(0===d){var g=32-8*c;f=h=>h<<g>>>g;e=f(e)}S(a,{name:b,kc:f,oc:(h,k)=>k,wc:cc(b,c,0!==d),vc:null})},h:(a,b,c)=>{function d(f){return new e(A.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=R(c);
|
|
458
|
+
S(a,{name:c,kc:d,wc:d},{Ce:!0})},ab:(a,b)=>{b=R(b);S(a,{name:b,kc(c){var d=(d=c+4)?L(B,d,J[c>>2],!0):"";Qb(c);return d},oc(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new P("Cannot pass non-string to std::string");var f=e?Ua(d):d.length;var g=rd(4+f+1),h=g+4;J[g>>2]=f;e?Va(d,B,h,f+1):B.set(d,h);null!==c&&c.push(Qb,g);return g},wc:Yb,vc(c){Qb(c)}})},T:(a,b,c)=>{c=R(c);if(2===b){var d=Hc;var e=Ic;var f=Jc}else d=
|
|
459
|
+
Kc,e=Lc,f=Mc;S(a,{name:c,kc:g=>{var h=d(g+4,J[g>>2]*b,!0);Qb(g);return h},oc:(g,h)=>{if("string"!=typeof h)throw new P(`Cannot pass non-string to C++ string type ${c}`);var k=f(h),m=rd(4+k+b);J[m>>2]=k/b;e(h,m+4,k+b);null!==g&&g.push(Qb,m);return m},wc:Yb,vc(g){Qb(g)}})},lb:(a,b,c,d,e,f)=>{Wb[a]={name:R(b),Gd:V(c,d),Ec:V(e,f),Od:[]}},kb:(a,b,c,d,e,f,g,h,k,m)=>{Wb[a].Od.push({ve:R(b),Be:c,ze:V(d,e),Ae:f,Pe:g,Oe:V(h,k),Qe:m})},db:(a,b)=>{b=R(b);S(a,{Ie:!0,name:b,kc:()=>{},oc:()=>{}})},mb:()=>{throw Infinity;
|
|
460
460
|
},m:(a,b,c)=>{var [d,...e]=Pc(a,b),f=d.oc.bind(d),g=e.map(k=>k.wc.bind(k));a--;var h=Array(a);b=`methodCaller<(${e.map(k=>k.name)}) => ${d.name}>`;return Oc(Hb(b,(k,m,q,v)=>{for(var t=0,C=0;C<a;++C)h[C]=g[C](v+t),t+=8;switch(c){case 0:var p=Q(k).apply(null,h);break;case 2:p=Reflect.construct(Q(k),h);break;case 3:p=h[0];break;case 1:p=Q(k)[Rc(m)](...h)}k=[];p=f(k,p);k.length&&(J[q>>2]=Kb(k));return p}))},jb:Cc,bb:(a,b)=>{a=Q(a);b=Q(b);return Kb(a[b])},ga:a=>{9<a&&(Jb[a+1]+=1)},l:(a,b,c,d,e)=>Nc[a](b,
|
|
461
|
-
c,d,e),gb:()=>Kb([]),ib:a=>Kb(Rc(a)),Ob:()=>Kb({}),Fa:a=>{var b=Q(a);Xb(b);Cc(a)},q:(a,b,c)=>{a=Q(a);b=Q(b);c=Q(c);a[b]=c},
|
|
461
|
+
c,d,e),gb:()=>Kb([]),ib:a=>Kb(Rc(a)),Ob:()=>Kb({}),Fa:a=>{var b=Q(a);Xb(b);Cc(a)},q:(a,b,c)=>{a=Q(a);b=Q(b);c=Q(c);a[b]=c},ob:function(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);G[b>>2]=a.getUTCSeconds();G[b+4>>2]=a.getUTCMinutes();G[b+8>>2]=a.getUTCHours();G[b+12>>2]=a.getUTCDate();G[b+16>>2]=a.getUTCMonth();G[b+20>>2]=a.getUTCFullYear()-1900;G[b+24>>2]=a.getUTCDay();G[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},pb:function(a,b){a=
|
|
462
462
|
-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);G[b>>2]=a.getSeconds();G[b+4>>2]=a.getMinutes();G[b+8>>2]=a.getHours();G[b+12>>2]=a.getDate();G[b+16>>2]=a.getMonth();G[b+20>>2]=a.getFullYear()-1900;G[b+24>>2]=a.getDay();var c=a.getFullYear();G[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Tc:Sc)[a.getMonth()]+a.getDate()-1|0;G[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();G[b+32>>
|
|
463
|
-
2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},
|
|
463
|
+
2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},qb:(a,b,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();J[a>>2]=60*Math.max(f,e);G[b>>2]=Number(f!=e);b=g=>{var h=Math.abs(g);return`UTC${0<=g?"-":"+"}${String(Math.floor(h/60)).padStart(2,"0")}${String(h%60).padStart(2,"0")}`};a=b(f);b=b(e);e<f?(Va(a,B,c,17),Va(b,B,d,17)):(Va(a,B,d,17),Va(b,B,c,17))},Ia:function(a,b,c){(a=u[a].tc.qd)&&a.beginPixelLocalStorageWEBGL(new Uint32Array(Aa.buffer,
|
|
464
464
|
4*c,b))},yb:function(a,b,c){if(!(0<=a&&3>=a))return 28;wa[c>>3]=BigInt(Math.round(1E6*(0===a?Date.now():performance.now())));return 0},fb:function(a,b,c){var d=l.images;d||(d=new Map,l.images=d);var e=new Image;d.set(a,e);b=l.HEAP8.subarray(b,b+c);c=new Uint8Array(c);c.set(b);e.src=URL.createObjectURL(new Blob([c],{type:"image/png"}));e.onload=function(){l._setWebImage(a,e.width,e.height)}},eb:function(a){var b=l.images;b&&b.get(a)&&b.delete(a)},s:(a,b,c)=>{Uc.length=0;for(var d;d=B[b++];){var e=
|
|
465
|
-
105!=d;e&=112!=d;c+=e&&c%8?4:0;Uc.push(112==d?J[c>>2]:106==d?wa[c>>3]:105==d?G[c>>2]:va[c>>3]);c+=e?8:4}return yd[a](...Uc)},xb:()=>Date.now(),Xa:()=>performance.now(),
|
|
465
|
+
105!=d;e&=112!=d;c+=e&&c%8?4:0;Uc.push(112==d?J[c>>2]:106==d?wa[c>>3]:105==d?G[c>>2]:va[c>>3]);c+=e?8:4}return yd[a](...Uc)},xb:()=>Date.now(),Xa:()=>performance.now(),nb:a=>{var b=B.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-Aa.buffer.byteLength+65535)/65536|0;try{Aa.grow(d);za();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},t:(a,b)=>{a=u[a];b=b?L(B,b):"";b.startsWith("GL_")&&
|
|
466
466
|
(b=b.slice(3));"WEBGL_draw_instanced_base_vertex_base_instance"==b&&Vc(X);"WEBGL_multi_draw_instanced_base_vertex_base_instance"==b&&Wc(X);"WEBGL_multi_draw"==b&&(X.Ke=X.getExtension("WEBGL_multi_draw"));"EXT_polygon_offset_clamp"==b&&(X.ue=X.getExtension("EXT_polygon_offset_clamp"));"EXT_clip_control"==b&&(X.te=X.getExtension("EXT_clip_control"));"WEBGL_polygon_mode"==b&&(X.Te=X.getExtension("WEBGL_polygon_mode"));return!!a.tc.getExtension(b)},f:()=>n?n.handle:0,ja:a=>ha(a)?0:-5,Ga:function(a){a=
|
|
467
|
-
u[a].tc;a.Yd=a.getExtension("WEBGL_provoking_vertex");return!!a.Yd},La:function(a){a=u[a].tc;const b=a.getExtension("WEBGL_shader_pixel_local_storage");if(b&&b.isCoherent()){if(5==b.framebufferTexturePixelLocalStorageWEBGL.length)return a.qd=b,!0;console.warn("WEBGL_shader_pixel_local_storage is advertised, but a deprecated version has been detected. Disabling.")}return!1},Ha:function(a,b,c){(a=u[a].tc.qd)&&a.endPixelLocalStorageWEBGL(new Uint32Array(Aa.buffer,4*c,b))},
|
|
468
|
-
b+c;J[a+d>>2]=f;c+=Va(e,B,f,Infinity)+1;d+=4}return 0},
|
|
467
|
+
u[a].tc;a.Yd=a.getExtension("WEBGL_provoking_vertex");return!!a.Yd},La:function(a){a=u[a].tc;const b=a.getExtension("WEBGL_shader_pixel_local_storage");if(b&&b.isCoherent()){if(5==b.framebufferTexturePixelLocalStorageWEBGL.length)return a.qd=b,!0;console.warn("WEBGL_shader_pixel_local_storage is advertised, but a deprecated version has been detected. Disabling.")}return!1},Ha:function(a,b,c){(a=u[a].tc.qd)&&a.endPixelLocalStorageWEBGL(new Uint32Array(Aa.buffer,4*c,b))},sb:(a,b)=>{var c=0,d=0,e;for(e of nd()){var f=
|
|
468
|
+
b+c;J[a+d>>2]=f;c+=Va(e,B,f,Infinity)+1;d+=4}return 0},tb:(a,b)=>{var c=nd();J[a>>2]=c.length;a=0;for(var d of c)a+=Ua(d)+1;J[b>>2]=a;return 0},na:function(a){try{var b=vb(a);if(null===b.Mc)throw new M(8);b.Cd&&(b.Cd=null);try{b.hc.close&&b.hc.close(b)}catch(c){throw c;}finally{kb[b.Mc]=null}b.Mc=null;return 0}catch(c){if("undefined"==typeof Gb||"ErrnoError"!==c.name)throw c;return c.Lc}},ub:function(a,b,c,d){try{a:{var e=vb(a);a=b;for(var f,g=b=0;g<c;g++){var h=J[a>>2],k=J[a+4>>2];a+=8;var m=e,q=
|
|
469
469
|
h,v=k,t=f,C=A;if(0>v||0>t)throw new M(28);if(null===m.Mc)throw new M(8);if(1===(m.flags&2097155))throw new M(8);if(16384===(m.node.mode&61440))throw new M(31);if(!m.hc.read)throw new M(28);var p="undefined"!=typeof t;if(!p)t=m.position;else if(!m.seekable)throw new M(70);var r=m.hc.read(m,C,q,v,t);p||(m.position+=r);var w=r;if(0>w){var x=-1;break a}b+=w;if(w<k)break;"undefined"!=typeof f&&(f+=w)}x=b}J[d>>2]=x;return 0}catch(z){if("undefined"==typeof Gb||"ErrnoError"!==z.name)throw z;return z.Lc}},
|
|
470
|
-
|
|
470
|
+
rb:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var e=vb(a);Eb(e,b,c);wa[d>>3]=BigInt(e.position);e.Cd&&0===b&&0===c&&(e.Cd=null);return 0}catch(f){if("undefined"==typeof Gb||"ErrnoError"!==f.name)throw f;return f.Lc}},oa:function(a,b,c,d){try{a:{var e=vb(a);a=b;for(var f,g=b=0;g<c;g++){var h=J[a>>2],k=J[a+4>>2];a+=8;var m=e,q=h,v=k,t=f,C=A;if(0>v||0>t)throw new M(28);if(null===m.Mc)throw new M(8);if(0===(m.flags&2097155))throw new M(8);if(16384===
|
|
471
471
|
(m.node.mode&61440))throw new M(31);if(!m.hc.write)throw new M(28);m.seekable&&m.flags&1024&&Eb(m,0,2);var p="undefined"!=typeof t;if(!p)t=m.position;else if(!m.seekable)throw new M(70);var r=m.hc.write(m,C,q,v,t,void 0);p||(m.position+=r);var w=r;if(0>w){var x=-1;break a}b+=w;if(w<k)break;"undefined"!=typeof f&&(f+=w)}x=b}J[d>>2]=x;return 0}catch(z){if("undefined"==typeof Gb||"ErrnoError"!==z.name)throw z;return z.Lc}},Ja:function(a,b,c,d,e,f){(a=u[a].tc.qd)&&a.framebufferPixelLocalClearValuefvWEBGL(b,
|
|
472
472
|
[c,d,e,f])},Ka:function(a,b,c,d,e,f){(a=u[a].tc.qd)&&a.framebufferTexturePixelLocalStorageWEBGL(b,bd[c],d,e,f)},e:a=>X.activeTexture(a),E:(a,b)=>{X.attachShader(Y[a],cd[b])},M:(a,b)=>{35051==a?X.yd=b:35052==a&&(X.ed=b);X.bindBuffer(a,Zc[b])},va:(a,b,c,d,e)=>{X.bindBufferRange(a,b,Zc[c],d,e)},i:(a,b)=>{X.bindFramebuffer(a,$c[b])},sa:(a,b)=>{X.bindRenderbuffer(a,ad[b])},Kb:(a,b)=>{X.bindSampler(a,ed[b])},d:(a,b)=>{X.bindTexture(a,bd[b])},Na:a=>{X.bindVertexArray(dd[a])},g:a=>X.blendEquation(a),L:(a,
|
|
473
473
|
b)=>X.blendFunc(a,b),Y:(a,b,c,d,e,f,g,h,k,m)=>X.blitFramebuffer(a,b,c,d,e,f,g,h,k,m),y:(a,b,c,d)=>{c&&b?X.bufferData(a,B,d,c,b):X.bufferData(a,b,d)},ya:(a,b,c,d)=>{c&&X.bufferSubData(a,b,B,d,c)},Db:a=>X.clear(a),Gb:(a,b,c)=>{X.clearBufferfv(a,b,ua,c>>2)},Fb:(a,b,c)=>{X.clearBufferuiv(a,b,J,c>>2)},Eb:(a,b,c,d)=>X.clearColor(a,b,c,d),Ua:a=>X.clearDepth(a),Ta:a=>X.clearStencil(a),fa:(a,b,c,d)=>{X.colorMask(!!a,!!b,!!c,!!d)},za:a=>{X.compileShader(cd[a])},Jb:(a,b,c,d,e,f,g,h,k)=>{X.ed||!h?X.compressedTexSubImage2D(a,
|
|
474
474
|
b,c,d,e,f,g,h,k):X.compressedTexSubImage2D(a,b,c,d,e,f,g,B,k,h)},H:()=>{var a=jd(Y),b=X.createProgram();b.name=a;b.nd=b.ld=b.md=0;b.Id=1;Y[a]=b;return a},Ba:a=>{var b=jd(cd);cd[b]=X.createShader(a);return b},Ra:a=>X.cullFace(a),$:(a,b)=>{for(var c=0;c<a;c++){var d=G[b+4*c>>2],e=Zc[d];e&&(X.deleteBuffer(e),e.name=0,Zc[d]=null,d==X.yd&&(X.yd=0),d==X.ed&&(X.ed=0))}},Da:(a,b)=>{for(var c=0;c<a;++c){var d=G[b+4*c>>2],e=$c[d];e&&(X.deleteFramebuffer(e),e.name=0,$c[d]=null)}},aa:a=>{if(a){var b=Y[a];b?(X.deleteProgram(b),
|
|
475
475
|
b.name=0,Y[a]=null):Z||=1281}},Ca:(a,b)=>{for(var c=0;c<a;c++){var d=G[b+4*c>>2],e=ad[d];e&&(X.deleteRenderbuffer(e),e.name=0,ad[d]=null)}},_:a=>{if(a){var b=cd[a];b?(X.deleteShader(b),cd[a]=null):Z||=1281}},z:(a,b)=>{for(var c=0;c<a;c++){var d=G[b+4*c>>2],e=bd[d];e&&(X.deleteTexture(e),e.name=0,bd[d]=null)}},Ma:(a,b)=>{for(var c=0;c<a;c++){var d=G[b+4*c>>2];X.deleteVertexArray(dd[d]);dd[d]=null}},Va:a=>X.depthFunc(a),ea:a=>{X.depthMask(!!a)},Wa:(a,b)=>X.depthRange(a,b),n:a=>X.disable(a),G:(a,b,c)=>
|
|
476
|
-
{X.drawArrays(a,b,c)},Hb:(a,b,c,d)=>{X.drawArraysInstanced(a,b,c,d)},xa:(a,b)=>{for(var c=od[a],d=0;d<a;d++)c[d]=G[b+4*d>>2];X.drawBuffers(c)},O:(a,b,c,d,e)=>{X.drawElementsInstanced(a,b,c,d,e)},A:a=>X.enable(a),r:a=>{X.enableVertexAttribArray(a)},Lb:()=>X.finish(),ua:()=>X.flush(),qa:(a,b,c,d)=>{X.framebufferRenderbuffer(a,b,c,ad[d])},
|
|
477
|
-
{kd(a,b,"createRenderbuffer",ad)},B:(a,b)=>{kd(a,b,"createTexture",bd)},Nb:(a,b)=>{kd(a,b,"createVertexArray",dd)},ka:a=>X.generateMipmap(a),
|
|
476
|
+
{X.drawArrays(a,b,c)},Hb:(a,b,c,d)=>{X.drawArraysInstanced(a,b,c,d)},xa:(a,b)=>{for(var c=od[a],d=0;d<a;d++)c[d]=G[b+4*d>>2];X.drawBuffers(c)},O:(a,b,c,d,e)=>{X.drawElementsInstanced(a,b,c,d,e)},A:a=>X.enable(a),r:a=>{X.enableVertexAttribArray(a)},Lb:()=>X.finish(),ua:()=>X.flush(),qa:(a,b,c,d)=>{X.framebufferRenderbuffer(a,b,c,ad[d])},v:(a,b,c,d,e)=>{X.framebufferTexture2D(a,b,c,bd[d],e)},S:a=>X.frontFace(a),W:(a,b)=>{kd(a,b,"createBuffer",Zc)},Mb:(a,b)=>{kd(a,b,"createFramebuffer",$c)},Bb:(a,b)=>
|
|
477
|
+
{kd(a,b,"createRenderbuffer",ad)},B:(a,b)=>{kd(a,b,"createTexture",bd)},Nb:(a,b)=>{kd(a,b,"createVertexArray",dd)},ka:a=>X.generateMipmap(a),U:(a,b)=>qd(a,b),wa:(a,b,c)=>{if(c)if(a>=Yc)Z||=1281;else if(a=Y[a],35716==b)a=X.getProgramInfoLog(a),null===a&&(a="(unknown error)"),G[c>>2]=a.length+1;else if(35719==b){if(!a.nd){var d=X.getProgramParameter(a,35718);for(b=0;b<d;++b)a.nd=Math.max(a.nd,X.getActiveUniform(a,b).name.length+1)}G[c>>2]=a.nd}else if(35722==b){if(!a.ld)for(d=X.getProgramParameter(a,
|
|
478
478
|
35721),b=0;b<d;++b)a.ld=Math.max(a.ld,X.getActiveAttrib(a,b).name.length+1);G[c>>2]=a.ld}else if(35381==b){if(!a.md)for(d=X.getProgramParameter(a,35382),b=0;b<d;++b)a.md=Math.max(a.md,X.getActiveUniformBlockName(a,b).length+1);G[c>>2]=a.md}else G[c>>2]=X.getProgramParameter(a,b);else Z||=1281},ta:a=>{var b=fd[a];if(!b){switch(a){case 7939:b=sd(pd().join(" "));break;case 7936:case 7937:case 37445:case 37446:(b=X.getParameter(a))||(Z||=1280);b=b?sd(b):0;break;case 7938:b=sd(`OpenGL ES 3.0 (${X.getParameter(7938)})`);
|
|
479
|
-
break;case 35724:b=X.getParameter(35724);var c=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==c&&(3==c[1].length&&(c[1]+="0"),b=`OpenGL ES GLSL ES ${c[1]} (${b})`);b=sd(b);break;default:Z||=1280}fd[a]=b}return b},K:(a,b)=>X.getUniformBlockIndex(Y[a],b?L(B,b):""),
|
|
479
|
+
break;case 35724:b=X.getParameter(35724);var c=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==c&&(3==c[1].length&&(c[1]+="0"),b=`OpenGL ES GLSL ES ${c[1]} (${b})`);b=sd(b);break;default:Z||=1280}fd[a]=b}return b},K:(a,b)=>X.getUniformBlockIndex(Y[a],b?L(B,b):""),R:(a,b)=>{b=b?L(B,b):"";if(a=Y[a]){var c=a,d=c.$c,e=c.de,f;if(!d){c.$c=d={};c.ce={};var g=X.getProgramParameter(c,35718);for(f=0;f<g;++f){var h=X.getActiveUniform(c,f);var k=h.name;h=h.size;var m=td(k);m=0<m?k.slice(0,m):k;
|
|
480
480
|
var q=c.Id;c.Id+=h;e[m]=[h,q];for(k=0;k<h;++k)d[q]=k,c.ce[q++]=m}}c=a.$c;d=0;e=b;f=td(b);0<f&&(d=parseInt(b.slice(f+1))>>>0,e=b.slice(0,f));if((e=a.de[e])&&d<e[0]&&(d+=e[1],c[d]=c[d]||X.getUniformLocation(a,b)))return d}else Z||=1281;return-1},C:(a,b,c)=>{for(var d=od[b],e=0;e<b;e++)d[e]=G[c+4*e>>2];X.invalidateFramebuffer(a,d)},Z:a=>{a=Y[a];X.linkProgram(a);a.$c=0;a.de={}},x:(a,b)=>{3317==a?gd=b:3314==a&&(hd=b);X.pixelStorei(a,b)},Ib:(a,b,c,d,e,f,g)=>{if(X.yd)X.readPixels(a,b,c,d,e,f,g);else{var h=
|
|
481
481
|
ud(f);g>>>=31-Math.clz32(h.BYTES_PER_ELEMENT);X.readPixels(a,b,c,d,e,f,h,g)}},ra:(a,b,c,d,e)=>X.renderbufferStorageMultisample(a,b,c,d,e),Sa:(a,b,c,d)=>X.scissor(a,b,c,d),Aa:(a,b,c,d)=>{for(var e="",f=0;f<b;++f){var g=(g=J[c+4*f>>2])?L(B,g,d?J[d+4*f>>2]:void 0):"";e+=g}X.shaderSource(cd[a],e)},Qa:(a,b,c)=>X.stencilFunc(a,b,c),ca:(a,b,c,d)=>X.stencilFuncSeparate(a,b,c,d),da:a=>X.stencilMask(a),Pa:(a,b,c)=>X.stencilOp(a,b,c),ba:(a,b,c,d)=>X.stencilOpSeparate(a,b,c,d),p:(a,b,c)=>X.texParameteri(a,b,
|
|
482
482
|
c),o:(a,b,c,d,e)=>X.texStorage2D(a,b,c,d,e),Ab:(a,b,c,d,e,f)=>X.texStorage3D(a,b,c,d,e,f),D:(a,b,c,d,e,f,g,h,k)=>{if(X.ed)X.texSubImage2D(a,b,c,d,e,f,g,h,k);else if(k){var m=ud(h);X.texSubImage2D(a,b,c,d,e,f,g,h,m,k>>>31-Math.clz32(m.BYTES_PER_ELEMENT))}else{if(k){m=ud(h);var q=f*((hd||e)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[g-6402]||1)*m.BYTES_PER_ELEMENT+gd-1&-gd);k=m.subarray(k>>>31-Math.clz32(m.BYTES_PER_ELEMENT),k+q>>>31-Math.clz32(m.BYTES_PER_ELEMENT))}else k=null;
|
|
483
|
-
X.texSubImage2D(a,b,c,d,e,f,g,h,k)}},X:(a,b)=>{var c=X,d=c.uniform1i;var e=X.pe;if(e){var f=e.$c[a];"number"==typeof f&&(e.$c[a]=f=X.getUniformLocation(e,e.ce[a]+(0<f?`[${f}]`:"")));a=f}else Z||=1282,a=void 0;d.call(c,a,b)},J:(a,b,c)=>{a=Y[a];X.uniformBlockBinding(a,b,c)},Oa:a=>{a=Y[a];X.useProgram(a);X.pe=a},I:(a,b)=>{X.vertexAttribDivisor(a,b)},
|
|
483
|
+
X.texSubImage2D(a,b,c,d,e,f,g,h,k)}},X:(a,b)=>{var c=X,d=c.uniform1i;var e=X.pe;if(e){var f=e.$c[a];"number"==typeof f&&(e.$c[a]=f=X.getUniformLocation(e,e.ce[a]+(0<f?`[${f}]`:"")));a=f}else Z||=1282,a=void 0;d.call(c,a,b)},J:(a,b,c)=>{a=Y[a];X.uniformBlockBinding(a,b,c)},Oa:a=>{a=Y[a];X.useProgram(a);X.pe=a},I:(a,b)=>{X.vertexAttribDivisor(a,b)},P:(a,b,c,d,e)=>{X.vertexAttribIPointer(a,b,c,d,e)},w:(a,b,c,d,e,f)=>{X.vertexAttribPointer(a,b,c,!!d,e,f)},Q:(a,b,c,d)=>X.viewport(a,b,c,d),Ya:Cd,Za:function(){return-1<
|
|
484
484
|
navigator.platform.indexOf("Win")},Ea:function(a,b){(a=u[a].tc.Yd)&&a.provokingVertexWEBGL(b)},hb:function(a,b){var c=l.images;c&&(b=c.get(b))&&(a=u[a].tc,a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,b),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1))},_a:function(a,b,c){b=new Uint8Array(Aa.buffer,b,c);c=new Uint8Array(c);c.set(b);createImageBitmap(new Blob([c])).then(function(d){var e=(new OffscreenCanvas(d.width,d.height)).getContext("2d");
|
|
485
485
|
e.drawImage(d,0,0);e=e.getImageData(0,0,d.width,d.height);var f=e.data.length,g=l.je(f);l.Ue.set(e.data,g);l.We(a,d.width,d.height,g,f)}).catch(function(d){d=d.message||"decode failed";var e=l.mf(d)+1,f=l.je(e);l.tf(d,f,e);l.Xe(a,f);l.Ve(f)})}};function Cd(a,b,c){var d=Bd();try{vc.get(a)(b,c)}catch(e){Ad(d);if(e!==e+0)throw e;zd(1,0)}}var Ed;
|
|
486
486
|
Ed=await (async function(){function a(c){c=Ed=c.exports;Qb=c.Sb;rd=c.Tb;l._setWebImage=c.Ub;Pb=c.Vb;l._wasm_image_decode_complete=c.Wb;l._wasm_image_decode_error=c.Xb;vd=l._ma_device__on_notification_unlocked=c.Yb;l._ma_malloc_emscripten=c.Zb;l._ma_free_emscripten=c._b;wd=l._ma_device_process_pcm_frames_capture__webaudio=c.$b;xd=l._ma_device_process_pcm_frames_playback__webaudio=c.ac;zd=c.bc;Ad=c.cc;Bd=c.dc;Aa=c.Pb;vc=c.Rb;za();return Ed}var b={a:Dd};if(l.instantiateWasm)return new Promise(c=>
|
|
@@ -495,7 +495,7 @@ if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.leng
|
|
|
495
495
|
/* 5 */
|
|
496
496
|
/***/ ((module) => {
|
|
497
497
|
|
|
498
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.
|
|
498
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.41.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_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
499
499
|
|
|
500
500
|
/***/ }),
|
|
501
501
|
/* 6 */
|
|
@@ -504,12 +504,16 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"
|
|
|
504
504
|
__webpack_require__.r(__webpack_exports__);
|
|
505
505
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
506
506
|
/* harmony export */ AccessibilityOverlay: () => (/* reexport safe */ _accessibilityOverlay__WEBPACK_IMPORTED_MODULE_1__.AccessibilityOverlay),
|
|
507
|
+
/* harmony export */ CHECK_STATE_MASK: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.CHECK_STATE_MASK),
|
|
508
|
+
/* harmony export */ CHECK_STATE_OFFSET: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.CHECK_STATE_OFFSET),
|
|
507
509
|
/* harmony export */ SemanticActionType: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticActionType),
|
|
510
|
+
/* harmony export */ SemanticCheckState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticCheckState),
|
|
508
511
|
/* harmony export */ SemanticMode: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticMode),
|
|
509
512
|
/* harmony export */ SemanticRole: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticRole),
|
|
510
513
|
/* harmony export */ SemanticState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticState),
|
|
511
514
|
/* harmony export */ SemanticTrait: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticTrait),
|
|
512
515
|
/* harmony export */ SemanticTreeModel: () => (/* reexport safe */ _semanticTreeModel__WEBPACK_IMPORTED_MODULE_0__.SemanticTreeModel),
|
|
516
|
+
/* harmony export */ checkStateOf: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.checkStateOf),
|
|
513
517
|
/* harmony export */ hasState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.hasState),
|
|
514
518
|
/* harmony export */ hasTrait: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.hasTrait),
|
|
515
519
|
/* harmony export */ roleName: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.roleName),
|
|
@@ -974,11 +978,15 @@ function applyGeometry(target, src) {
|
|
|
974
978
|
|
|
975
979
|
__webpack_require__.r(__webpack_exports__);
|
|
976
980
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
981
|
+
/* harmony export */ CHECK_STATE_MASK: () => (/* binding */ CHECK_STATE_MASK),
|
|
982
|
+
/* harmony export */ CHECK_STATE_OFFSET: () => (/* binding */ CHECK_STATE_OFFSET),
|
|
977
983
|
/* harmony export */ SemanticActionType: () => (/* binding */ SemanticActionType),
|
|
984
|
+
/* harmony export */ SemanticCheckState: () => (/* binding */ SemanticCheckState),
|
|
978
985
|
/* harmony export */ SemanticMode: () => (/* binding */ SemanticMode),
|
|
979
986
|
/* harmony export */ SemanticRole: () => (/* binding */ SemanticRole),
|
|
980
987
|
/* harmony export */ SemanticState: () => (/* binding */ SemanticState),
|
|
981
988
|
/* harmony export */ SemanticTrait: () => (/* binding */ SemanticTrait),
|
|
989
|
+
/* harmony export */ checkStateOf: () => (/* binding */ checkStateOf),
|
|
982
990
|
/* harmony export */ hasState: () => (/* binding */ hasState),
|
|
983
991
|
/* harmony export */ hasTrait: () => (/* binding */ hasTrait),
|
|
984
992
|
/* harmony export */ roleName: () => (/* binding */ roleName),
|
|
@@ -1013,14 +1021,17 @@ var SemanticRole = {
|
|
|
1013
1021
|
//
|
|
1014
1022
|
// Bits 0-7 are trait-gated (only meaningful when the corresponding
|
|
1015
1023
|
// SemanticTrait is set). Bits 8-13 are non-trait states.
|
|
1024
|
+
//
|
|
1025
|
+
// Check state is the exception: it is a two-bit *field* at bits 2-3 rather
|
|
1026
|
+
// than a flag, because a checkbox is tri-state. It is not a member of this
|
|
1027
|
+
// table — read it with checkStateOf().
|
|
1016
1028
|
// ---------------------------------------------------------------------------
|
|
1017
1029
|
var SemanticState = {
|
|
1018
1030
|
None: 0,
|
|
1019
1031
|
// Trait-gated
|
|
1020
1032
|
Expanded: 1 << 0, // requires Expandable
|
|
1021
1033
|
Selected: 1 << 1, // requires Selectable
|
|
1022
|
-
|
|
1023
|
-
Mixed: 1 << 3, // requires Checkable; wins over Checked
|
|
1034
|
+
// Bits 2-3 are the check state field, not independent flags -- see SemanticCheckState.
|
|
1024
1035
|
Toggled: 1 << 4, // requires Toggleable
|
|
1025
1036
|
Required: 1 << 5, // requires Requirable
|
|
1026
1037
|
Disabled: 1 << 6, // requires Enablable
|
|
@@ -1036,6 +1047,30 @@ var SemanticState = {
|
|
|
1036
1047
|
function hasState(flags, state) {
|
|
1037
1048
|
return (flags & state) !== 0;
|
|
1038
1049
|
}
|
|
1050
|
+
// SemanticCheckState — mirrors rive::SemanticCheckState
|
|
1051
|
+
//
|
|
1052
|
+
// The tri-state of a checkable node. Occupies two bits of stateFlags at
|
|
1053
|
+
// CHECK_STATE_OFFSET, so it is read as a value rather than tested as a flag.
|
|
1054
|
+
// Only meaningful when the Checkable trait is set.
|
|
1055
|
+
var SemanticCheckState = {
|
|
1056
|
+
Unchecked: 0,
|
|
1057
|
+
Checked: 1,
|
|
1058
|
+
Mixed: 2,
|
|
1059
|
+
};
|
|
1060
|
+
/** Bit offset of the check field within stateFlags. */
|
|
1061
|
+
var CHECK_STATE_OFFSET = 2;
|
|
1062
|
+
/** Mask of the check field within stateFlags. */
|
|
1063
|
+
var CHECK_STATE_MASK = 3 << CHECK_STATE_OFFSET;
|
|
1064
|
+
/**
|
|
1065
|
+
* Decodes the check field out of `flags`. The field is two bits. Returns 0, 1, or 2
|
|
1066
|
+
* per the mapping in SemanticCheckState.
|
|
1067
|
+
*/
|
|
1068
|
+
function checkStateOf(flags) {
|
|
1069
|
+
var value = (flags & CHECK_STATE_MASK) >> CHECK_STATE_OFFSET;
|
|
1070
|
+
return value >= SemanticCheckState.Mixed
|
|
1071
|
+
? SemanticCheckState.Mixed
|
|
1072
|
+
: value;
|
|
1073
|
+
}
|
|
1039
1074
|
/**
|
|
1040
1075
|
* Controls when the instance builds semantic trees and accessibility overlays.
|
|
1041
1076
|
*
|
|
@@ -1102,6 +1137,14 @@ function stateNames(flags) {
|
|
|
1102
1137
|
if (flags & bit)
|
|
1103
1138
|
active.push(name_2);
|
|
1104
1139
|
}
|
|
1140
|
+
switch (checkStateOf(flags)) {
|
|
1141
|
+
case SemanticCheckState.Checked:
|
|
1142
|
+
active.push("Checked");
|
|
1143
|
+
break;
|
|
1144
|
+
case SemanticCheckState.Mixed:
|
|
1145
|
+
active.push("Mixed");
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1105
1148
|
return active.join(", ") || "none";
|
|
1106
1149
|
}
|
|
1107
1150
|
function traitNames(flags) {
|
|
@@ -1870,13 +1913,15 @@ var AccessibilityOverlay = /** @class */ (function () {
|
|
|
1870
1913
|
removeAttr(el, "aria-selected");
|
|
1871
1914
|
}
|
|
1872
1915
|
if ((0,_types__WEBPACK_IMPORTED_MODULE_0__.hasTrait)(traits, _types__WEBPACK_IMPORTED_MODULE_0__.SemanticTrait.Checkable) && ARIA_CHECKED_ROLES.has(role)) {
|
|
1873
|
-
//
|
|
1874
|
-
//
|
|
1875
|
-
|
|
1916
|
+
// Check state is a tri-state field, but not every checkable role
|
|
1917
|
+
// accepts all three values — see ARIA_MIXED_ROLES.
|
|
1918
|
+
var checkState = (0,_types__WEBPACK_IMPORTED_MODULE_0__.checkStateOf)(flags);
|
|
1919
|
+
if (checkState === _types__WEBPACK_IMPORTED_MODULE_0__.SemanticCheckState.Mixed &&
|
|
1920
|
+
ARIA_MIXED_ROLES.has(role)) {
|
|
1876
1921
|
setAttr(el, "aria-checked", "mixed");
|
|
1877
1922
|
}
|
|
1878
1923
|
else {
|
|
1879
|
-
setBoolAttr(el, "aria-checked",
|
|
1924
|
+
setBoolAttr(el, "aria-checked", checkState === _types__WEBPACK_IMPORTED_MODULE_0__.SemanticCheckState.Checked);
|
|
1880
1925
|
}
|
|
1881
1926
|
}
|
|
1882
1927
|
else {
|
|
@@ -2136,6 +2181,15 @@ var ARIA_CHECKED_ROLES = new Set([
|
|
|
2136
2181
|
_types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.radioButton,
|
|
2137
2182
|
_types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.switchControl,
|
|
2138
2183
|
]);
|
|
2184
|
+
/**
|
|
2185
|
+
* aria-checked="mixed": checkbox only. ARIA defines checkbox as three-valued
|
|
2186
|
+
* (true/false/mixed) but radio and switch as two-valued (true/false), so an
|
|
2187
|
+
* indeterminate check state degrades to false for those roles rather than
|
|
2188
|
+
* emitting a value they do not support.
|
|
2189
|
+
*/
|
|
2190
|
+
var ARIA_MIXED_ROLES = new Set([
|
|
2191
|
+
_types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.checkbox,
|
|
2192
|
+
]);
|
|
2139
2193
|
/**
|
|
2140
2194
|
* aria-pressed: button only. switch is a button subclass in ARIA but uses
|
|
2141
2195
|
* aria-checked (not aria-pressed) for its on/off state — it is intentionally
|
|
@@ -3620,6 +3674,12 @@ var Layout = /** @class */ (function () {
|
|
|
3620
3674
|
|
|
3621
3675
|
// #endregion
|
|
3622
3676
|
// #region state machines
|
|
3677
|
+
/**
|
|
3678
|
+
* @deprecated State machine inputs are deprecated and will be removed in a
|
|
3679
|
+
* future major version: please use data binding properties instead. See
|
|
3680
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
3681
|
+
* for how to migrate.
|
|
3682
|
+
*/
|
|
3623
3683
|
var StateMachineInputType;
|
|
3624
3684
|
(function (StateMachineInputType) {
|
|
3625
3685
|
StateMachineInputType[StateMachineInputType["Number"] = 56] = "Number";
|
|
@@ -3628,6 +3688,10 @@ var StateMachineInputType;
|
|
|
3628
3688
|
})(StateMachineInputType || (StateMachineInputType = {}));
|
|
3629
3689
|
/**
|
|
3630
3690
|
* An input for a state machine
|
|
3691
|
+
* @deprecated State machine inputs are deprecated and will be removed in a
|
|
3692
|
+
* future major version: please use data binding properties instead. See
|
|
3693
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
3694
|
+
* for how to migrate.
|
|
3631
3695
|
*/
|
|
3632
3696
|
var StateMachineInput = /** @class */ (function () {
|
|
3633
3697
|
function StateMachineInput(type, runtimeInput) {
|
|
@@ -3677,6 +3741,11 @@ var StateMachineInput = /** @class */ (function () {
|
|
|
3677
3741
|
return StateMachineInput;
|
|
3678
3742
|
}());
|
|
3679
3743
|
|
|
3744
|
+
/**
|
|
3745
|
+
* @deprecated Rive Events are deprecated and will be removed in a future major
|
|
3746
|
+
* version: please use data binding instead. See
|
|
3747
|
+
* {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.
|
|
3748
|
+
*/
|
|
3680
3749
|
var RiveEventType;
|
|
3681
3750
|
(function (RiveEventType) {
|
|
3682
3751
|
RiveEventType[RiveEventType["General"] = 128] = "General";
|
|
@@ -4219,6 +4288,12 @@ var Animator = /** @class */ (function () {
|
|
|
4219
4288
|
var instancedName;
|
|
4220
4289
|
if (this.animations.length === 0 && this.stateMachines.length === 0) {
|
|
4221
4290
|
if (this.artboard.animationCount() > 0) {
|
|
4291
|
+
// Warn only when the v3 default would actually change what plays
|
|
4292
|
+
if (this.artboard.stateMachineCount() > 0) {
|
|
4293
|
+
warnOnce("No `stateMachine` was specified, so the artboard's first linear animation is playing by default. " +
|
|
4294
|
+
"In the next major version, the artboard's state machine will be played by default instead when one exists. " +
|
|
4295
|
+
"Pass the `stateMachine` parameter to adopt that behavior now.");
|
|
4296
|
+
}
|
|
4222
4297
|
// Add the first animation
|
|
4223
4298
|
this.add([(instancedName = this.artboard.animationByIndex(0).name)], playing, fireEvent);
|
|
4224
4299
|
}
|
|
@@ -4297,15 +4372,84 @@ var EventType;
|
|
|
4297
4372
|
EventType["Play"] = "play";
|
|
4298
4373
|
EventType["Pause"] = "pause";
|
|
4299
4374
|
EventType["Stop"] = "stop";
|
|
4375
|
+
/**
|
|
4376
|
+
* @deprecated Loop events are deprecated and will be removed in a future
|
|
4377
|
+
* major version: they are only reported for linear animation playback, which
|
|
4378
|
+
* is deprecated. Use a state machine to control playback and data binding to
|
|
4379
|
+
* react to changes instead. See
|
|
4380
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide} for how
|
|
4381
|
+
* to migrate.
|
|
4382
|
+
*/
|
|
4300
4383
|
EventType["Loop"] = "loop";
|
|
4301
4384
|
EventType["Draw"] = "draw";
|
|
4302
4385
|
EventType["Advance"] = "advance";
|
|
4386
|
+
/**
|
|
4387
|
+
* @deprecated State change events are deprecated and will be removed in a
|
|
4388
|
+
* future major version. Use data binding (view model property observers) or
|
|
4389
|
+
* state machine actions to react to changes from your graphic instead. See
|
|
4390
|
+
* {@link https://rive.app/docs/editor/state-machine/states#actions} for more details.
|
|
4391
|
+
*/
|
|
4303
4392
|
EventType["StateChange"] = "statechange";
|
|
4393
|
+
/**
|
|
4394
|
+
* @deprecated Rive Events are deprecated and will be removed in a future
|
|
4395
|
+
* major version: please use data binding instead. See
|
|
4396
|
+
* {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.
|
|
4397
|
+
*/
|
|
4304
4398
|
EventType["RiveEvent"] = "riveevent";
|
|
4305
4399
|
EventType["AudioStatusChange"] = "audiostatuschange";
|
|
4306
4400
|
})(EventType || (EventType = {}));
|
|
4401
|
+
var riveEventsDeprecationWarning = "Rive Events are deprecated and will be removed in a future major version: " +
|
|
4402
|
+
"please use data binding instead. See " +
|
|
4403
|
+
"https://rive.app/docs/runtimes/web/rive-events for how to migrate.";
|
|
4404
|
+
var stateMachineInputsDeprecationWarning = "State machine inputs are deprecated and will be removed in a future major version: " +
|
|
4405
|
+
"please use data binding properties instead. See " +
|
|
4406
|
+
"https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.";
|
|
4407
|
+
var textRunsDeprecationWarning = "Text run APIs are deprecated and will be removed in a future major version: " +
|
|
4408
|
+
"please use data binding instead. See " +
|
|
4409
|
+
"https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.";
|
|
4410
|
+
var loopEventsDeprecationWarning = "Loop events are deprecated and will be removed in a future major version: " +
|
|
4411
|
+
"they are only reported for linear animation playback, which is deprecated. " +
|
|
4412
|
+
"Use a state machine to control playback and data binding to react to changes instead. See " +
|
|
4413
|
+
"https://rive.app/docs/editor/data-binding/migration-guide for how to migrate.";
|
|
4414
|
+
var stateChangeEventsDeprecationWarning = "State change events are deprecated and will be removed in a future major version: " +
|
|
4415
|
+
"use data binding (view model property observers) or state machine actions to react to " +
|
|
4416
|
+
"changes from your graphic instead. See " +
|
|
4417
|
+
"https://rive.app/docs/editor/state-machine/states#actions for how to migrate.";
|
|
4418
|
+
// Deprecation warnings already emitted; each is logged at most once per page
|
|
4419
|
+
// session to avoid flooding the console when many instances are created.
|
|
4420
|
+
var emittedWarnings = new Set();
|
|
4421
|
+
var warnOnce = function (message) {
|
|
4422
|
+
if (!emittedWarnings.has(message)) {
|
|
4423
|
+
emittedWarnings.add(message);
|
|
4424
|
+
console.warn("[Rive] ".concat(message));
|
|
4425
|
+
}
|
|
4426
|
+
};
|
|
4427
|
+
/**
|
|
4428
|
+
* Warns that a playback-control method received an array of names; the next
|
|
4429
|
+
* major version restricts these parameters to a single string, since playing
|
|
4430
|
+
* multiple animations or state machines at once will not be supported.
|
|
4431
|
+
*/
|
|
4432
|
+
var warnIfNamesArray = function (names, methodName) {
|
|
4433
|
+
if (Array.isArray(names)) {
|
|
4434
|
+
warnOnce("Passing an array of names to `".concat(methodName, "()` is deprecated: in the next major version this parameter will be a single string, and playing multiple animations or state machines at once will not be supported."));
|
|
4435
|
+
}
|
|
4436
|
+
};
|
|
4437
|
+
/**
|
|
4438
|
+
* Warns that a playback-control method received linear animation names;
|
|
4439
|
+
* name-based control remains supported for state machines only, so
|
|
4440
|
+
* user-specified linear animation names are going away in a future major
|
|
4441
|
+
* version.
|
|
4442
|
+
*/
|
|
4443
|
+
var warnDeprecatedAnimationNames = function (methodName) {
|
|
4444
|
+
warnOnce("Passing linear animation names to `".concat(methodName, "()` is deprecated and will be removed in a future major version: ") +
|
|
4445
|
+
"Pass a single state machine name to control playback instead.");
|
|
4446
|
+
};
|
|
4307
4447
|
/**
|
|
4308
4448
|
* Looping types: one-shot, loop, and ping-pong
|
|
4449
|
+
* @deprecated Loop events are deprecated and will be removed in a future major
|
|
4450
|
+
* version: they are only reported for linear animation playback, which is
|
|
4451
|
+
* deprecated. Use a state machine to control playback and data binding to
|
|
4452
|
+
* react to changes instead.
|
|
4309
4453
|
*/
|
|
4310
4454
|
var LoopType;
|
|
4311
4455
|
(function (LoopType) {
|
|
@@ -4619,6 +4763,31 @@ var observers = new ObjectObservers();
|
|
|
4619
4763
|
// #endregion
|
|
4620
4764
|
// #region Rive
|
|
4621
4765
|
var nextRiveInstanceId = 0;
|
|
4766
|
+
/**
|
|
4767
|
+
* Resolves which animation/state machine names playback should start with.
|
|
4768
|
+
* The `stateMachine` parameter takes priority; the deprecated plural
|
|
4769
|
+
* `animations`/`stateMachines` parameters apply only when it
|
|
4770
|
+
* is not provided.
|
|
4771
|
+
*/
|
|
4772
|
+
var resolveStartingPlayback = function (_a) {
|
|
4773
|
+
var stateMachine = _a.stateMachine, animations = _a.animations, stateMachines = _a.stateMachines;
|
|
4774
|
+
if (animations !== undefined) {
|
|
4775
|
+
warnOnce("The `animations` parameter is deprecated and will be removed in a future major version: please use the `stateMachine` parameter to play a state machine instead.");
|
|
4776
|
+
}
|
|
4777
|
+
if (stateMachines !== undefined) {
|
|
4778
|
+
warnOnce("The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead.");
|
|
4779
|
+
}
|
|
4780
|
+
if (stateMachine) {
|
|
4781
|
+
return {
|
|
4782
|
+
startingAnimationNames: [],
|
|
4783
|
+
startingStateMachineNames: [stateMachine],
|
|
4784
|
+
};
|
|
4785
|
+
}
|
|
4786
|
+
return {
|
|
4787
|
+
startingAnimationNames: mapToStringArray(animations),
|
|
4788
|
+
startingStateMachineNames: mapToStringArray(stateMachines),
|
|
4789
|
+
};
|
|
4790
|
+
};
|
|
4622
4791
|
var RiveFile = /** @class */ (function () {
|
|
4623
4792
|
function RiveFile(params) {
|
|
4624
4793
|
// Allow the runtime to automatically load assets hosted in Rive's runtime.
|
|
@@ -5040,6 +5209,10 @@ var Rive = /** @class */ (function () {
|
|
|
5040
5209
|
this.layout = (_a = params.layout) !== null && _a !== void 0 ? _a : new Layout();
|
|
5041
5210
|
this.shouldDisableRiveListeners = !!params.shouldDisableRiveListeners;
|
|
5042
5211
|
this.isTouchScrollEnabled = !!params.isTouchScrollEnabled;
|
|
5212
|
+
if (params.automaticallyHandleEvents) {
|
|
5213
|
+
warnOnce("The `automaticallyHandleEvents` parameter is deprecated. " +
|
|
5214
|
+
riveEventsDeprecationWarning);
|
|
5215
|
+
}
|
|
5043
5216
|
this.automaticallyHandleEvents = !!params.automaticallyHandleEvents;
|
|
5044
5217
|
this.dispatchPointerExit =
|
|
5045
5218
|
params.dispatchPointerExit === false
|
|
@@ -5104,6 +5277,7 @@ var Rive = /** @class */ (function () {
|
|
|
5104
5277
|
riveFile: this.riveFile,
|
|
5105
5278
|
autoplay: params.autoplay,
|
|
5106
5279
|
autoBind: params.autoBind,
|
|
5280
|
+
stateMachine: params.stateMachine,
|
|
5107
5281
|
animations: params.animations,
|
|
5108
5282
|
stateMachines: params.stateMachines,
|
|
5109
5283
|
artboard: params.artboard,
|
|
@@ -5170,7 +5344,7 @@ var Rive = /** @class */ (function () {
|
|
|
5170
5344
|
// Initializes the Rive object either from constructor or load()
|
|
5171
5345
|
Rive.prototype.init = function (_a) {
|
|
5172
5346
|
var _this = this;
|
|
5173
|
-
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d, tabIndex = _a.tabIndex, semanticsMode = _a.semanticsMode, semanticsOptions = _a.semanticsOptions;
|
|
5347
|
+
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, stateMachine = _a.stateMachine, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d, tabIndex = _a.tabIndex, semanticsMode = _a.semanticsMode, semanticsOptions = _a.semanticsOptions;
|
|
5174
5348
|
if (this.destroyed) {
|
|
5175
5349
|
return;
|
|
5176
5350
|
}
|
|
@@ -5184,10 +5358,12 @@ var Rive = /** @class */ (function () {
|
|
|
5184
5358
|
if (!this.src && !this.buffer && !this.riveFile) {
|
|
5185
5359
|
throw new RiveError(Rive.missingErrorMessage);
|
|
5186
5360
|
}
|
|
5187
|
-
//
|
|
5188
|
-
var
|
|
5189
|
-
|
|
5190
|
-
|
|
5361
|
+
// Names of the animations and state machines that should be initialized
|
|
5362
|
+
var _e = resolveStartingPlayback({
|
|
5363
|
+
stateMachine: stateMachine,
|
|
5364
|
+
animations: animations,
|
|
5365
|
+
stateMachines: stateMachines,
|
|
5366
|
+
}), startingAnimationNames = _e.startingAnimationNames, startingStateMachineNames = _e.startingStateMachineNames;
|
|
5191
5367
|
// Ensure loaded is marked as false if loading new file
|
|
5192
5368
|
this.loaded = false;
|
|
5193
5369
|
this.readyForPlaying = false;
|
|
@@ -5904,6 +6080,7 @@ var Rive = /** @class */ (function () {
|
|
|
5904
6080
|
* might happen.
|
|
5905
6081
|
*/
|
|
5906
6082
|
Rive.prototype.cleanupInstances = function () {
|
|
6083
|
+
var _a;
|
|
5907
6084
|
if (this.eventCleanup !== null) {
|
|
5908
6085
|
this.eventCleanup();
|
|
5909
6086
|
}
|
|
@@ -5911,8 +6088,9 @@ var Rive = /** @class */ (function () {
|
|
|
5911
6088
|
// Tear down semantics before deleting state machines — the overlay's action
|
|
5912
6089
|
// closures point at instances that stop() is about to free.
|
|
5913
6090
|
this.cleanupSemantics();
|
|
5914
|
-
// Delete all animation and state machine instances
|
|
5915
|
-
|
|
6091
|
+
// Delete all animation and state machine instances synchronously via the
|
|
6092
|
+
// animator
|
|
6093
|
+
(_a = this.animator) === null || _a === void 0 ? void 0 : _a.stop();
|
|
5916
6094
|
if (this.artboard) {
|
|
5917
6095
|
this.artboard.delete();
|
|
5918
6096
|
this.artboard = null;
|
|
@@ -5945,29 +6123,58 @@ var Rive = /** @class */ (function () {
|
|
|
5945
6123
|
* Returns a string from a given text run node name, or undefined if the text run
|
|
5946
6124
|
* cannot be queried.
|
|
5947
6125
|
*
|
|
6126
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6127
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6128
|
+
* for how to migrate.
|
|
5948
6129
|
* @param textRunName - Name of the text run node associated with a text object
|
|
5949
6130
|
* @returns - String value of the text run node or undefined
|
|
5950
6131
|
*/
|
|
5951
6132
|
Rive.prototype.getTextRunValue = function (textRunName) {
|
|
6133
|
+
warnOnce(textRunsDeprecationWarning);
|
|
5952
6134
|
var textRun = this.retrieveTextRun(textRunName);
|
|
5953
6135
|
return textRun ? textRun.text : undefined;
|
|
5954
6136
|
};
|
|
5955
6137
|
/**
|
|
5956
6138
|
* Sets a text value for a given text run node name if possible
|
|
5957
6139
|
*
|
|
6140
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6141
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6142
|
+
* for how to migrate.
|
|
5958
6143
|
* @param textRunName - Name of the text run node associated with a text object
|
|
5959
6144
|
* @param textRunValue - String value to set on the text run node
|
|
5960
6145
|
*/
|
|
5961
6146
|
Rive.prototype.setTextRunValue = function (textRunName, textRunValue) {
|
|
6147
|
+
warnOnce(textRunsDeprecationWarning);
|
|
5962
6148
|
var textRun = this.retrieveTextRun(textRunName);
|
|
5963
6149
|
if (textRun) {
|
|
5964
6150
|
textRun.text = textRunValue;
|
|
5965
6151
|
}
|
|
5966
6152
|
};
|
|
5967
|
-
|
|
6153
|
+
/**
|
|
6154
|
+
* Warns when playback-control names match linear animations in the
|
|
6155
|
+
* Animator's instanced context; state machine playback remain supported.
|
|
6156
|
+
*
|
|
6157
|
+
* Remove for v3 release
|
|
6158
|
+
*/
|
|
6159
|
+
Rive.prototype.warnIfLinearAnimationNames = function (names, methodName) {
|
|
6160
|
+
if (this.animator &&
|
|
6161
|
+
this.animator.animations.some(function (a) { return names.includes(a.name); })) {
|
|
6162
|
+
warnDeprecatedAnimationNames(methodName);
|
|
6163
|
+
}
|
|
6164
|
+
};
|
|
6165
|
+
/**
|
|
6166
|
+
* Plays specified animations or state machines; if none specified, it
|
|
6167
|
+
* unpauses everything.
|
|
6168
|
+
* @param animationNames Animation or state machine name(s) to play.
|
|
6169
|
+
*
|
|
6170
|
+
* Deprecated usage: passing linear animation names (control playback with a
|
|
6171
|
+
* state machine instead) and passing an array of names (this parameter
|
|
6172
|
+
* becomes a single string in the next major version).
|
|
6173
|
+
*/
|
|
5968
6174
|
Rive.prototype.play = function (animationNames, autoplay) {
|
|
5969
6175
|
var _this = this;
|
|
5970
|
-
animationNames
|
|
6176
|
+
warnIfNamesArray(animationNames, "play");
|
|
6177
|
+
var names = mapToStringArray(animationNames);
|
|
5971
6178
|
// If the file's not loaded, queue up the play
|
|
5972
6179
|
if (!this.readyForPlaying) {
|
|
5973
6180
|
this.taskQueue.add({
|
|
@@ -5975,7 +6182,8 @@ var Rive = /** @class */ (function () {
|
|
|
5975
6182
|
});
|
|
5976
6183
|
return;
|
|
5977
6184
|
}
|
|
5978
|
-
this.animator.play(
|
|
6185
|
+
this.animator.play(names);
|
|
6186
|
+
this.warnIfLinearAnimationNames(names, "play");
|
|
5979
6187
|
this.syncSemanticsOnStateMachines();
|
|
5980
6188
|
if (this.eventCleanup) {
|
|
5981
6189
|
this.eventCleanup();
|
|
@@ -5984,10 +6192,19 @@ var Rive = /** @class */ (function () {
|
|
|
5984
6192
|
this.setupRiveListeners();
|
|
5985
6193
|
this.startRendering();
|
|
5986
6194
|
};
|
|
5987
|
-
|
|
6195
|
+
/**
|
|
6196
|
+
* Pauses specified animations or state machines; if none specified, pauses
|
|
6197
|
+
* all.
|
|
6198
|
+
* @param animationNames Animation or state machine name(s) to pause.
|
|
6199
|
+
*
|
|
6200
|
+
* Deprecated usage: passing linear animation names (control playback with a
|
|
6201
|
+
* state machine instead) and passing an array of names (this parameter
|
|
6202
|
+
* becomes a single string in the next major version).
|
|
6203
|
+
*/
|
|
5988
6204
|
Rive.prototype.pause = function (animationNames) {
|
|
5989
6205
|
var _this = this;
|
|
5990
|
-
animationNames
|
|
6206
|
+
warnIfNamesArray(animationNames, "pause");
|
|
6207
|
+
var names = mapToStringArray(animationNames);
|
|
5991
6208
|
// If the file's not loaded, early out, nothing to pause
|
|
5992
6209
|
if (!this.readyForPlaying) {
|
|
5993
6210
|
this.taskQueue.add({
|
|
@@ -5999,11 +6216,20 @@ var Rive = /** @class */ (function () {
|
|
|
5999
6216
|
this.eventCleanup();
|
|
6000
6217
|
}
|
|
6001
6218
|
this.cleanupKeyboardInteractions();
|
|
6002
|
-
this.animator.pause(
|
|
6219
|
+
this.animator.pause(names);
|
|
6220
|
+
this.warnIfLinearAnimationNames(names, "pause");
|
|
6003
6221
|
};
|
|
6222
|
+
/**
|
|
6223
|
+
* Scrubs specified animations to the given time; if none specified, scrubs
|
|
6224
|
+
* all of them.
|
|
6225
|
+
* @deprecated `scrub()` will be removed in a future major version: use a
|
|
6226
|
+
* state machine to control playback instead
|
|
6227
|
+
*/
|
|
6004
6228
|
Rive.prototype.scrub = function (animationNames, value) {
|
|
6005
6229
|
var _this = this;
|
|
6006
|
-
|
|
6230
|
+
warnOnce("`scrub()` is deprecated and will be removed in a future major version: " +
|
|
6231
|
+
"use a state machine to control playback instead.");
|
|
6232
|
+
var names = mapToStringArray(animationNames);
|
|
6007
6233
|
// If the file's not loaded, early out, nothing to pause
|
|
6008
6234
|
if (!this.readyForPlaying) {
|
|
6009
6235
|
this.taskQueue.add({
|
|
@@ -6013,13 +6239,22 @@ var Rive = /** @class */ (function () {
|
|
|
6013
6239
|
}
|
|
6014
6240
|
// Scrub the animation time; we draw a single frame here so that if
|
|
6015
6241
|
// nothing's currently playing, the scrubbed animation is still rendered/
|
|
6016
|
-
this.animator.scrub(
|
|
6242
|
+
this.animator.scrub(names, value || 0);
|
|
6017
6243
|
this.drawFrame();
|
|
6018
6244
|
};
|
|
6019
|
-
|
|
6245
|
+
/**
|
|
6246
|
+
* Stops specified animations or state machines; if none specified, stops
|
|
6247
|
+
* them all.
|
|
6248
|
+
* @param animationNames Animation or state machine name(s) to stop.
|
|
6249
|
+
*
|
|
6250
|
+
* Deprecated usage: passing linear animation names (control playback with a
|
|
6251
|
+
* state machine instead) and passing an array of names (this parameter
|
|
6252
|
+
* becomes a single string in the next major version).
|
|
6253
|
+
*/
|
|
6020
6254
|
Rive.prototype.stop = function (animationNames) {
|
|
6021
6255
|
var _this = this;
|
|
6022
|
-
animationNames
|
|
6256
|
+
warnIfNamesArray(animationNames, "stop");
|
|
6257
|
+
var names = mapToStringArray(animationNames);
|
|
6023
6258
|
// If the file's not loaded, early out, nothing to pause
|
|
6024
6259
|
if (!this.readyForPlaying) {
|
|
6025
6260
|
this.taskQueue.add({
|
|
@@ -6027,9 +6262,10 @@ var Rive = /** @class */ (function () {
|
|
|
6027
6262
|
});
|
|
6028
6263
|
return;
|
|
6029
6264
|
}
|
|
6265
|
+
this.warnIfLinearAnimationNames(names, "stop");
|
|
6030
6266
|
// If there is no artboard, this.animator will be undefined
|
|
6031
6267
|
if (this.animator) {
|
|
6032
|
-
this.animator.stop(
|
|
6268
|
+
this.animator.stop(names);
|
|
6033
6269
|
}
|
|
6034
6270
|
if (this.eventCleanup) {
|
|
6035
6271
|
this.eventCleanup();
|
|
@@ -6040,8 +6276,7 @@ var Rive = /** @class */ (function () {
|
|
|
6040
6276
|
/**
|
|
6041
6277
|
* Resets the animation
|
|
6042
6278
|
* @param artboard the name of the artboard, or default if none given
|
|
6043
|
-
* @param
|
|
6044
|
-
* @param stateMachines the names of state machines for playback
|
|
6279
|
+
* @param stateMachine the name of the state machine for playback
|
|
6045
6280
|
* @param autoplay whether to autoplay when reset, defaults to false
|
|
6046
6281
|
*
|
|
6047
6282
|
*/
|
|
@@ -6049,15 +6284,22 @@ var Rive = /** @class */ (function () {
|
|
|
6049
6284
|
var _a, _b;
|
|
6050
6285
|
// Get the current artboard, animations, state machines, and playback states
|
|
6051
6286
|
var artBoardName = params === null || params === void 0 ? void 0 : params.artboard;
|
|
6052
|
-
var
|
|
6053
|
-
|
|
6287
|
+
var _c = resolveStartingPlayback({
|
|
6288
|
+
stateMachine: params === null || params === void 0 ? void 0 : params.stateMachine,
|
|
6289
|
+
animations: params === null || params === void 0 ? void 0 : params.animations,
|
|
6290
|
+
stateMachines: params === null || params === void 0 ? void 0 : params.stateMachines,
|
|
6291
|
+
}), animationNames = _c.startingAnimationNames, stateMachineNames = _c.startingStateMachineNames;
|
|
6054
6292
|
var autoplay = (_a = params === null || params === void 0 ? void 0 : params.autoplay) !== null && _a !== void 0 ? _a : false;
|
|
6055
6293
|
var autoBind = (_b = params === null || params === void 0 ? void 0 : params.autoBind) !== null && _b !== void 0 ? _b : false;
|
|
6056
6294
|
// Stop everything and clean up
|
|
6057
6295
|
this.cleanupInstances();
|
|
6058
6296
|
// Reinitialize an artboard instance with the state
|
|
6059
6297
|
this.initArtboard(artBoardName, animationNames, stateMachineNames, autoplay, autoBind);
|
|
6060
|
-
|
|
6298
|
+
// Only drain the task queue once playback commands can execute; tasks
|
|
6299
|
+
// queued before then re-add themselves in a loop.
|
|
6300
|
+
if (this.readyForPlaying) {
|
|
6301
|
+
this.taskQueue.process();
|
|
6302
|
+
}
|
|
6061
6303
|
};
|
|
6062
6304
|
// Loads a new Rive file, keeping listeners in place
|
|
6063
6305
|
Rive.prototype.load = function (params) {
|
|
@@ -6212,11 +6454,18 @@ var Rive = /** @class */ (function () {
|
|
|
6212
6454
|
});
|
|
6213
6455
|
/**
|
|
6214
6456
|
* Returns the inputs for the specified instanced state machine, or an empty
|
|
6215
|
-
* list if the name is invalid or the state machine is not instanced
|
|
6457
|
+
* list if the name is invalid or the state machine is not instanced. Returns
|
|
6458
|
+
* undefined if the file is not loaded yet.
|
|
6459
|
+
*
|
|
6460
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6461
|
+
* properties instead. See
|
|
6462
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6463
|
+
* for how to migrate.
|
|
6216
6464
|
* @param name the state machine name
|
|
6217
|
-
* @returns the inputs for the named state machine
|
|
6465
|
+
* @returns the inputs for the named state machine or undefined
|
|
6218
6466
|
*/
|
|
6219
6467
|
Rive.prototype.stateMachineInputs = function (name) {
|
|
6468
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6220
6469
|
// If the file's not loaded, early out, nothing to pause
|
|
6221
6470
|
if (!this.loaded) {
|
|
6222
6471
|
return;
|
|
@@ -6243,11 +6492,16 @@ var Rive = /** @class */ (function () {
|
|
|
6243
6492
|
};
|
|
6244
6493
|
/**
|
|
6245
6494
|
* Set the boolean input with the provided name at the given path with value
|
|
6495
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6496
|
+
* properties instead. See
|
|
6497
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6498
|
+
* for how to migrate.
|
|
6246
6499
|
* @param input the state machine input name
|
|
6247
6500
|
* @param value the value to set the input to
|
|
6248
6501
|
* @param path the path the input is located at an artboard level
|
|
6249
6502
|
*/
|
|
6250
6503
|
Rive.prototype.setBooleanStateAtPath = function (inputName, value, path) {
|
|
6504
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6251
6505
|
var input = this.retrieveInputAtPath(inputName, path);
|
|
6252
6506
|
if (!input)
|
|
6253
6507
|
return;
|
|
@@ -6260,11 +6514,16 @@ var Rive = /** @class */ (function () {
|
|
|
6260
6514
|
};
|
|
6261
6515
|
/**
|
|
6262
6516
|
* Set the number input with the provided name at the given path with value
|
|
6517
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6518
|
+
* properties instead. See
|
|
6519
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6520
|
+
* for how to migrate.
|
|
6263
6521
|
* @param input the state machine input name
|
|
6264
6522
|
* @param value the value to set the input to
|
|
6265
6523
|
* @param path the path the input is located at an artboard level
|
|
6266
6524
|
*/
|
|
6267
6525
|
Rive.prototype.setNumberStateAtPath = function (inputName, value, path) {
|
|
6526
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6268
6527
|
var input = this.retrieveInputAtPath(inputName, path);
|
|
6269
6528
|
if (!input)
|
|
6270
6529
|
return;
|
|
@@ -6277,10 +6536,15 @@ var Rive = /** @class */ (function () {
|
|
|
6277
6536
|
};
|
|
6278
6537
|
/**
|
|
6279
6538
|
* Fire the trigger with the provided name at the given path
|
|
6539
|
+
* @deprecated State machine inputs are deprecated: use data binding
|
|
6540
|
+
* properties instead. See
|
|
6541
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
|
|
6542
|
+
* for how to migrate.
|
|
6280
6543
|
* @param input the state machine input name
|
|
6281
6544
|
* @param path the path the input is located at an artboard level
|
|
6282
6545
|
*/
|
|
6283
6546
|
Rive.prototype.fireStateAtPath = function (inputName, path) {
|
|
6547
|
+
warnOnce(stateMachineInputsDeprecationWarning);
|
|
6284
6548
|
var input = this.retrieveInputAtPath(inputName, path);
|
|
6285
6549
|
if (!input)
|
|
6286
6550
|
return;
|
|
@@ -6328,8 +6592,13 @@ var Rive = /** @class */ (function () {
|
|
|
6328
6592
|
*
|
|
6329
6593
|
* @remarks
|
|
6330
6594
|
* If the text run cannot be found at the specified path, a warning will be logged to the console.
|
|
6595
|
+
*
|
|
6596
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6597
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6598
|
+
* for how to migrate.
|
|
6331
6599
|
*/
|
|
6332
6600
|
Rive.prototype.getTextRunValueAtPath = function (textName, path) {
|
|
6601
|
+
warnOnce(textRunsDeprecationWarning);
|
|
6333
6602
|
var run = this.retrieveTextAtPath(textName, path);
|
|
6334
6603
|
if (!run) {
|
|
6335
6604
|
console.warn("Could not get text with name: '".concat(textName, "', at path:'").concat(path, "'"));
|
|
@@ -6354,8 +6623,13 @@ var Rive = /** @class */ (function () {
|
|
|
6354
6623
|
*
|
|
6355
6624
|
* @remarks
|
|
6356
6625
|
* If the text run cannot be found at the specified path, a warning will be logged to the console.
|
|
6626
|
+
*
|
|
6627
|
+
* @deprecated Text run APIs are deprecated: use data binding instead. See
|
|
6628
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
|
|
6629
|
+
* for how to migrate.
|
|
6357
6630
|
*/
|
|
6358
6631
|
Rive.prototype.setTextRunValueAtPath = function (textName, value, path) {
|
|
6632
|
+
warnOnce(textRunsDeprecationWarning);
|
|
6359
6633
|
var run = this.retrieveTextAtPath(textName, path);
|
|
6360
6634
|
if (!run) {
|
|
6361
6635
|
console.warn("Could not set text with name: '".concat(textName, "', at path:'").concat(path, "'"));
|
|
@@ -6464,10 +6738,26 @@ var Rive = /** @class */ (function () {
|
|
|
6464
6738
|
});
|
|
6465
6739
|
/**
|
|
6466
6740
|
* Subscribe to Rive-generated events
|
|
6741
|
+
*
|
|
6742
|
+
* Note: subscribing to {@link EventType.RiveEvent},
|
|
6743
|
+
* {@link EventType.StateChange}, or {@link EventType.Loop} is deprecated;
|
|
6744
|
+
* use data binding instead. See
|
|
6745
|
+
* {@link https://rive.app/docs/runtimes/web/rive-events} (Rive Events) and
|
|
6746
|
+
* {@link https://rive.app/docs/editor/data-binding/migration-guide} for how
|
|
6747
|
+
* to migrate Rive graphics to a data binding workflow instead.
|
|
6467
6748
|
* @param type the type of event to subscribe to
|
|
6468
6749
|
* @param callback callback to fire when the event occurs
|
|
6469
6750
|
*/
|
|
6470
6751
|
Rive.prototype.on = function (type, callback) {
|
|
6752
|
+
if (type === EventType.RiveEvent) {
|
|
6753
|
+
warnOnce(riveEventsDeprecationWarning);
|
|
6754
|
+
}
|
|
6755
|
+
else if (type === EventType.StateChange) {
|
|
6756
|
+
warnOnce(stateChangeEventsDeprecationWarning);
|
|
6757
|
+
}
|
|
6758
|
+
else if (type === EventType.Loop) {
|
|
6759
|
+
warnOnce(loopEventsDeprecationWarning);
|
|
6760
|
+
}
|
|
6471
6761
|
this.eventManager.add({
|
|
6472
6762
|
type: type,
|
|
6473
6763
|
callback: callback,
|