@rive-app/canvas 2.19.4 → 2.19.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas",
3
- "version": "2.19.4",
3
+ "version": "2.19.6",
4
4
  "description": "Rive's canvas based web api.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.js CHANGED
@@ -349,10 +349,10 @@ m.onRuntimeInitialized = function() {
349
349
  function c() {
350
350
  0 < M.length && (ka.Qb(w.drawWidth(), w.drawHeight(), M, T, ca), M = [], ca = T = 0, w.reset(512, 512));
351
351
  for (const q of D) {
352
- for (const z of q.J) {
352
+ for (const z of q.H) {
353
353
  z();
354
354
  }
355
- q.J = [];
355
+ q.H = [];
356
356
  }
357
357
  D.clear();
358
358
  }
@@ -482,32 +482,32 @@ m.onRuntimeInitialized = function() {
482
482
  this.S = [1, 0, 0, 1, 0, 0];
483
483
  this.C = q.getContext("2d");
484
484
  this.Ua = q;
485
- this.J = [];
485
+ this.H = [];
486
486
  }, save:function() {
487
487
  this.S.push(...this.S.slice(this.S.length - 6));
488
- this.J.push(this.C.save.bind(this.C));
488
+ this.H.push(this.C.save.bind(this.C));
489
489
  }, restore:function() {
490
490
  const q = this.S.length - 6;
491
491
  if (6 > q) {
492
492
  throw "restore() called without matching save().";
493
493
  }
494
494
  this.S.splice(q);
495
- this.J.push(this.C.restore.bind(this.C));
495
+ this.H.push(this.C.restore.bind(this.C));
496
496
  }, transform:function(q, z, G, H, C, I) {
497
497
  const J = this.S, K = J.length - 6;
498
498
  J.splice(K, 6, J[K] * q + J[K + 2] * z, J[K + 1] * q + J[K + 3] * z, J[K] * G + J[K + 2] * H, J[K + 1] * G + J[K + 3] * H, J[K] * C + J[K + 2] * I + J[K + 4], J[K + 1] * C + J[K + 3] * I + J[K + 5]);
499
- this.J.push(this.C.transform.bind(this.C, q, z, G, H, C, I));
499
+ this.H.push(this.C.transform.bind(this.C, q, z, G, H, C, I));
500
500
  }, rotate:function(q) {
501
501
  const z = Math.sin(q);
502
502
  q = Math.cos(q);
503
503
  this.transform(q, z, -z, q, 0, 0);
504
504
  }, _drawPath:function(q, z) {
505
- this.J.push(z.draw.bind(z, this.C, q.T, q.Va === x ? "evenodd" : "nonzero"));
505
+ this.H.push(z.draw.bind(z, this.C, q.T, q.Va === x ? "evenodd" : "nonzero"));
506
506
  }, _drawRiveImage:function(q, z, G) {
507
507
  var H = q.Fb;
508
508
  if (H) {
509
509
  var C = this.C, I = a(z);
510
- this.J.push(function() {
510
+ this.H.push(function() {
511
511
  C.globalCompositeOperation = I;
512
512
  C.globalAlpha = G;
513
513
  C.drawImage(H, 0, 0);
@@ -544,7 +544,7 @@ m.onRuntimeInitialized = function() {
544
544
  T += H.length;
545
545
  ca += I.length;
546
546
  var za = this.C, qd = a(z);
547
- this.J.push(function() {
547
+ this.H.push(function() {
548
548
  za.save();
549
549
  za.resetTransform();
550
550
  za.globalCompositeOperation = qd;
@@ -555,10 +555,10 @@ m.onRuntimeInitialized = function() {
555
555
  });
556
556
  }
557
557
  }, _clipPath:function(q) {
558
- this.J.push(this.C.clip.bind(this.C, q.T, q.Va === x ? "evenodd" : "nonzero"));
558
+ this.H.push(this.C.clip.bind(this.C, q.T, q.Va === x ? "evenodd" : "nonzero"));
559
559
  }, clear:function() {
560
560
  D.add(this);
561
- this.J.push(this.C.clearRect.bind(this.C, 0, 0, this.Ua.width, this.Ua.height));
561
+ this.H.push(this.C.clearRect.bind(this.C, 0, 0, this.Ua.width, this.Ua.height));
562
562
  }, flush:function() {
563
563
  }, translate:function(q, z) {
564
564
  this.transform(1, 0, 0, 1, q, z);
@@ -576,13 +576,15 @@ m.onRuntimeInitialized = function() {
576
576
  throw Error("RiveException: Method call to '" + C + "()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");
577
577
  }
578
578
  return function(...I) {
579
- z.J.push(G[C].bind(G, ...I));
579
+ z.H.push(G[C].bind(G, ...I));
580
580
  };
581
581
  }
582
582
  return H[C];
583
583
  }, set(H, C, I) {
584
584
  if (C in G) {
585
- return G[C] = I, !0;
585
+ return z.H.push(() => {
586
+ G[C] = I;
587
+ }), !0;
586
588
  }
587
589
  },});
588
590
  };
@@ -736,16 +738,16 @@ function Ya(a, b) {
736
738
  return Xa(c, a, b);
737
739
  }));
738
740
  }
739
- var Za, $a, db = {433532:(a, b, c, d, e) => {
741
+ var Za, $a, db = {435020:(a, b, c, d, e) => {
740
742
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
741
743
  return 0;
742
744
  }
743
745
  if ("undefined" === typeof window.h) {
744
746
  window.h = {Aa:0};
745
- window.h.H = {};
746
- window.h.H.ya = a;
747
- window.h.H.capture = b;
748
- window.h.H.La = c;
747
+ window.h.I = {};
748
+ window.h.I.ya = a;
749
+ window.h.I.capture = b;
750
+ window.h.I.La = c;
749
751
  window.h.ga = {};
750
752
  window.h.ga.stopped = d;
751
753
  window.h.ga.xb = e;
@@ -783,7 +785,7 @@ var Za, $a, db = {433532:(a, b, c, d, e) => {
783
785
  f.unlock = function() {
784
786
  for (var g = 0; g < f.D.length; ++g) {
785
787
  var n = f.D[g];
786
- null != n && null != n.I && n.state === f.ga.xb && n.I.resume().then(() => {
788
+ null != n && null != n.J && n.state === f.ga.xb && n.J.resume().then(() => {
787
789
  ab(n.pb);
788
790
  }, p => {
789
791
  console.error("Failed to resume audiocontext", p);
@@ -799,9 +801,9 @@ var Za, $a, db = {433532:(a, b, c, d, e) => {
799
801
  }
800
802
  window.h.Aa += 1;
801
803
  return 1;
802
- }, 435710:() => {
804
+ }, 437198:() => {
803
805
  "undefined" !== typeof window.h && (--window.h.Aa, 0 === window.h.Aa && delete window.h);
804
- }, 435874:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 435978:() => {
806
+ }, 437362:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 437466:() => {
805
807
  try {
806
808
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
807
809
  a.close();
@@ -809,23 +811,23 @@ var Za, $a, db = {433532:(a, b, c, d, e) => {
809
811
  } catch (c) {
810
812
  return 0;
811
813
  }
812
- }, 436149:(a, b, c, d, e, f) => {
814
+ }, 437637:(a, b, c, d, e, f) => {
813
815
  if ("undefined" === typeof window.h) {
814
816
  return -1;
815
817
  }
816
818
  var g = {}, n = {};
817
- a == window.h.H.ya && 0 != c && (n.sampleRate = c);
818
- g.I = new (window.AudioContext || window.webkitAudioContext)(n);
819
- g.I.suspend();
819
+ a == window.h.I.ya && 0 != c && (n.sampleRate = c);
820
+ g.J = new (window.AudioContext || window.webkitAudioContext)(n);
821
+ g.J.suspend();
820
822
  g.state = window.h.ga.stopped;
821
823
  c = 0;
822
- a != window.h.H.ya && (c = b);
823
- g.Z = g.I.createScriptProcessor(d, c, b);
824
+ a != window.h.I.ya && (c = b);
825
+ g.Z = g.J.createScriptProcessor(d, c, b);
824
826
  g.Z.onaudioprocess = function(p) {
825
827
  if (null == g.sa || 0 == g.sa.length) {
826
828
  g.sa = new Float32Array(Fa.buffer, e, d * b);
827
829
  }
828
- if (a == window.h.H.capture || a == window.h.H.La) {
830
+ if (a == window.h.I.capture || a == window.h.I.La) {
829
831
  for (var l = 0; l < b; l += 1) {
830
832
  for (var u = p.inputBuffer.getChannelData(l), v = g.sa, x = 0; x < d; x += 1) {
831
833
  v[x * b + l] = u[x];
@@ -833,7 +835,7 @@ var Za, $a, db = {433532:(a, b, c, d, e) => {
833
835
  }
834
836
  bb(f, d, e);
835
837
  }
836
- if (a == window.h.H.ya || a == window.h.H.La) {
838
+ if (a == window.h.I.ya || a == window.h.I.La) {
837
839
  for (cb(f, d, e), l = 0; l < p.outputBuffer.numberOfChannels; ++l) {
838
840
  for (u = p.outputBuffer.getChannelData(l), v = g.sa, x = 0; x < d; x += 1) {
839
841
  u[x] = v[x * b + l];
@@ -845,33 +847,33 @@ var Za, $a, db = {433532:(a, b, c, d, e) => {
845
847
  }
846
848
  }
847
849
  };
848
- a != window.h.H.capture && a != window.h.H.La || navigator.mediaDevices.getUserMedia({audio:!0, video:!1}).then(function(p) {
849
- g.Da = g.I.createMediaStreamSource(p);
850
+ a != window.h.I.capture && a != window.h.I.La || navigator.mediaDevices.getUserMedia({audio:!0, video:!1}).then(function(p) {
851
+ g.Da = g.J.createMediaStreamSource(p);
850
852
  g.Da.connect(g.Z);
851
- g.Z.connect(g.I.destination);
853
+ g.Z.connect(g.J.destination);
852
854
  }).catch(function(p) {
853
855
  console.log("Failed to get user media: " + p);
854
856
  });
855
- a == window.h.H.ya && g.Z.connect(g.I.destination);
857
+ a == window.h.I.ya && g.Z.connect(g.J.destination);
856
858
  g.pb = f;
857
859
  return window.h.yc(g);
858
- }, 439026:a => window.h.ra(a).I.sampleRate, 439099:a => {
860
+ }, 440514:a => window.h.ra(a).J.sampleRate, 440587:a => {
859
861
  a = window.h.ra(a);
860
862
  void 0 !== a.Z && (a.Z.onaudioprocess = function() {
861
863
  }, a.Z.disconnect(), a.Z = void 0);
862
864
  void 0 !== a.Da && (a.Da.disconnect(), a.Da = void 0);
863
- a.I.close();
864
- a.I = void 0;
865
+ a.J.close();
866
+ a.J = void 0;
865
867
  a.pb = void 0;
866
- }, 439499:a => {
868
+ }, 440987:a => {
867
869
  window.h.Cb(a);
868
- }, 439549:a => {
870
+ }, 441037:a => {
869
871
  a = window.h.ra(a);
870
- a.I.resume();
872
+ a.J.resume();
871
873
  a.state = window.h.ga.xb;
872
- }, 439688:a => {
874
+ }, 441176:a => {
873
875
  a = window.h.ra(a);
874
- a.I.suspend();
876
+ a.J.suspend();
875
877
  a.state = window.h.ga.stopped;
876
878
  }}, eb = a => {
877
879
  for (; 0 < a.length;) {
@@ -3355,7 +3357,7 @@ Zd();
3355
3357
  /* 2 */
3356
3358
  /***/ ((module) => {
3357
3359
 
3358
- module.exports = JSON.parse('{"name":"@rive-app/canvas","version":"2.19.4","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3360
+ module.exports = JSON.parse('{"name":"@rive-app/canvas","version":"2.19.6","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3359
3361
 
3360
3362
  /***/ }),
3361
3363
  /* 3 */