@eva/plugin-renderer-lottie 1.3.0-alpha.1 → 2.0.0-beta.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.
@@ -431,25 +431,25 @@ function M$1(t, s, e, i) {
431
431
  return s;
432
432
  })(t, i, this.mX1, this.mX2)
433
433
  : 0 === h
434
- ? i
435
- : (function (t, s, e, i, h) {
436
- let r,
437
- a,
438
- n = 0;
439
- do {
440
- (a = s + (e - s) / 2), (r = S$1(a, i, h) - t), r > 0 ? (e = a) : (s = a);
441
- } while (Math.abs(r) > 1e-7 && ++n < 10);
442
- return a;
443
- })(t, s, s + 0.1, this.mX1, this.mX2);
434
+ ? i
435
+ : (function (t, s, e, i, h) {
436
+ let r,
437
+ a,
438
+ n = 0;
439
+ do {
440
+ (a = s + (e - s) / 2), (r = S$1(a, i, h) - t), r > 0 ? (e = a) : (s = a);
441
+ } while (Math.abs(r) > 1e-7 && ++n < 10);
442
+ return a;
443
+ })(t, s, s + 0.1, this.mX1, this.mX2);
444
444
  }),
445
445
  (M$1.prototype.get = function (t) {
446
446
  return this.mX1 === this.mY1 && this.mX2 === this.mY2
447
447
  ? t
448
448
  : 0 === t
449
- ? 0
450
- : 1 === t
451
- ? 1
452
- : S$1(this._getTForX(t), this.mY1, this.mY2);
449
+ ? 0
450
+ : 1 === t
451
+ ? 1
452
+ : S$1(this._getTForX(t), this.mY1, this.mY2);
453
453
  });
454
454
  const P = {};
455
455
  var T$1 = {
@@ -470,10 +470,10 @@ w =
470
470
  return 'float32' === t
471
471
  ? new Float32Array(s)
472
472
  : 'int16' === t
473
- ? new Int16Array(s)
474
- : 'uint8c' === t
475
- ? new Uint8ClampedArray(s)
476
- : void 0;
473
+ ? new Int16Array(s)
474
+ : 'uint8c' === t
475
+ ? new Uint8ClampedArray(s)
476
+ : void 0;
477
477
  }
478
478
  : function (t, s) {
479
479
  let e = 0;
@@ -834,10 +834,10 @@ class $$1 {
834
834
  ? t
835
835
  : this.end - s.euclideanModulo(this.begin - t, this.total)
836
836
  : 'out' === this.type
837
- ? t <= this.end
838
- ? t
839
- : this.begin + s.euclideanModulo(t - this.end, this.total)
840
- : void 0;
837
+ ? t <= this.end
838
+ ? t
839
+ : this.begin + s.euclideanModulo(t - this.end, this.total)
840
+ : void 0;
841
841
  }
842
842
  }
843
843
  class tt {
@@ -1019,26 +1019,26 @@ class rt {
1019
1019
  (t >= g
1020
1020
  ? (n = 1)
1021
1021
  : t < y
1022
- ? (n = 0)
1023
- : (i.o.x.constructor === Array
1024
- ? (i.__fnct || (i.__fnct = []),
1025
- i.__fnct[d]
1026
- ? (p = i.__fnct[d])
1027
- : ((s = void 0 === i.o.x[d] ? i.o.x[0] : i.o.x[d]),
1028
- (r = void 0 === i.o.y[d] ? i.o.y[0] : i.o.y[d]),
1029
- (a = void 0 === i.i.x[d] ? i.i.x[0] : i.i.x[d]),
1030
- (o = void 0 === i.i.y[d] ? i.i.y[0] : i.i.y[d]),
1022
+ ? (n = 0)
1023
+ : (i.o.x.constructor === Array
1024
+ ? (i.__fnct || (i.__fnct = []),
1025
+ i.__fnct[d]
1026
+ ? (p = i.__fnct[d])
1027
+ : ((s = void 0 === i.o.x[d] ? i.o.x[0] : i.o.x[d]),
1028
+ (r = void 0 === i.o.y[d] ? i.o.y[0] : i.o.y[d]),
1029
+ (a = void 0 === i.i.x[d] ? i.i.x[0] : i.i.x[d]),
1030
+ (o = void 0 === i.i.y[d] ? i.i.y[0] : i.i.y[d]),
1031
+ (p = T$1.getBezierEasing(s, r, a, o).get),
1032
+ (i.__fnct[d] = p)))
1033
+ : i.__fnct
1034
+ ? (p = i.__fnct)
1035
+ : ((s = i.o.x),
1036
+ (r = i.o.y),
1037
+ (a = i.i.x),
1038
+ (o = i.i.y),
1031
1039
  (p = T$1.getBezierEasing(s, r, a, o).get),
1032
- (i.__fnct[d] = p)))
1033
- : i.__fnct
1034
- ? (p = i.__fnct)
1035
- : ((s = i.o.x),
1036
- (r = i.o.y),
1037
- (a = i.i.x),
1038
- (o = i.i.y),
1039
- (p = T$1.getBezierEasing(s, r, a, o).get),
1040
- (i.__fnct = p)),
1041
- (n = p((t - y) / (g - y))))),
1040
+ (i.__fnct = p)),
1041
+ (n = p((t - y) / (g - y))))),
1042
1042
  (m = h.s || i.e),
1043
1043
  (l = 1 === i.h ? i.s[d] : i.s[d] + (m[d] - i.s[d]) * n),
1044
1044
  'multidimensional' === this.propType ? (e[d] = l) : (e = l);
@@ -2108,13 +2108,13 @@ class Lt extends O$1 {
2108
2108
  ? ((t = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / e, 0)),
2109
2109
  (s = this.p.getValueAtTime(this.p.keyframes[0].t / e, 0)))
2110
2110
  : this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t
2111
- ? ((t = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / e, 0)),
2112
- (s = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / e, 0)))
2113
- : ((t = this.p.pv),
2114
- (s = this.p.getValueAtTime(
2115
- (this.p._caching.lastFrame + this.p.offsetTime - 0.01) / e,
2116
- this.p.offsetTime,
2117
- )));
2111
+ ? ((t = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / e, 0)),
2112
+ (s = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / e, 0)))
2113
+ : ((t = this.p.pv),
2114
+ (s = this.p.getValueAtTime(
2115
+ (this.p._caching.lastFrame + this.p.offsetTime - 0.01) / e,
2116
+ this.p.offsetTime,
2117
+ )));
2118
2118
  else if (
2119
2119
  this.px &&
2120
2120
  this.px.keyframes &&
@@ -2131,13 +2131,13 @@ class Lt extends O$1 {
2131
2131
  (s[0] = i.getValueAtTime(i.keyframes[0].t / e, 0)),
2132
2132
  (s[1] = h.getValueAtTime(h.keyframes[0].t / e, 0)))
2133
2133
  : i._caching.lastFrame + i.offsetTime >= i.keyframes[i.keyframes.length - 1].t
2134
- ? ((t[0] = i.getValueAtTime(i.keyframes[i.keyframes.length - 1].t / e, 0)),
2135
- (t[1] = h.getValueAtTime(h.keyframes[h.keyframes.length - 1].t / e, 0)),
2136
- (s[0] = i.getValueAtTime((i.keyframes[i.keyframes.length - 1].t - 0.01) / e, 0)),
2137
- (s[1] = h.getValueAtTime((h.keyframes[h.keyframes.length - 1].t - 0.01) / e, 0)))
2138
- : ((t = [i.pv, h.pv]),
2139
- (s[0] = i.getValueAtTime((i._caching.lastFrame + i.offsetTime - 0.01) / e, i.offsetTime)),
2140
- (s[1] = h.getValueAtTime((h._caching.lastFrame + h.offsetTime - 0.01) / e, h.offsetTime)));
2134
+ ? ((t[0] = i.getValueAtTime(i.keyframes[i.keyframes.length - 1].t / e, 0)),
2135
+ (t[1] = h.getValueAtTime(h.keyframes[h.keyframes.length - 1].t / e, 0)),
2136
+ (s[0] = i.getValueAtTime((i.keyframes[i.keyframes.length - 1].t - 0.01) / e, 0)),
2137
+ (s[1] = h.getValueAtTime((h.keyframes[h.keyframes.length - 1].t - 0.01) / e, 0)))
2138
+ : ((t = [i.pv, h.pv]),
2139
+ (s[0] = i.getValueAtTime((i._caching.lastFrame + i.offsetTime - 0.01) / e, i.offsetTime)),
2140
+ (s[1] = h.getValueAtTime((h._caching.lastFrame + h.offsetTime - 0.01) / e, h.offsetTime)));
2141
2141
  } else t = s = Z$1;
2142
2142
  this.v.rotate(-Math.atan2(t[1] - s[1], t[0] - s[0]));
2143
2143
  }
@@ -2255,8 +2255,8 @@ bt(
2255
2255
  s <= 1
2256
2256
  ? r.push({ s: t, e: s })
2257
2257
  : t >= 1
2258
- ? r.push({ s: t - 1, e: s - 1 })
2259
- : (r.push({ s: t, e: 1 }), r.push({ s: 0, e: s - 1 }));
2258
+ ? r.push({ s: t - 1, e: s - 1 })
2259
+ : (r.push({ s: t, e: 1 }), r.push({ s: 0, e: s - 1 }));
2260
2260
  let a,
2261
2261
  n,
2262
2262
  o = [],
@@ -2343,9 +2343,9 @@ bt(
2343
2343
  y <= 1
2344
2344
  ? f.push({ s: d.totalShapeLength * g, e: d.totalShapeLength * y })
2345
2345
  : g >= 1
2346
- ? f.push({ s: d.totalShapeLength * (g - 1), e: d.totalShapeLength * (y - 1) })
2347
- : (f.push({ s: d.totalShapeLength * g, e: d.totalShapeLength }),
2348
- f.push({ s: 0, e: d.totalShapeLength * (y - 1) }));
2346
+ ? f.push({ s: d.totalShapeLength * (g - 1), e: d.totalShapeLength * (y - 1) })
2347
+ : (f.push({ s: d.totalShapeLength * g, e: d.totalShapeLength }),
2348
+ f.push({ s: 0, e: d.totalShapeLength * (y - 1) }));
2349
2349
  let t = this.addShapes(d, f[0]);
2350
2350
  if (f[0].s !== f[0].e) {
2351
2351
  if (f.length > 1) {
@@ -3069,21 +3069,21 @@ class Nt extends O$1 {
3069
3069
  f.push(s[r]),
3070
3070
  this.addTransformToStyleList(s[r]))
3071
3071
  : 'sh' == t[r].ty || 'rc' == t[r].ty || 'el' == t[r].ty || 'sr' == t[r].ty
3072
- ? o || (s[r] = this.createShapeElement(t[r]))
3073
- : 'tm' == t[r].ty || 'rd' == t[r].ty
3074
- ? (o
3075
- ? ((l = s[r]), (l.closed = !1))
3076
- : ((l = It.getModifier(t[r].ty)), l.init(this, t[r]), (s[r] = l), this.shapeModifiers.push(l)),
3077
- u.push(l))
3078
- : 'rp' == t[r].ty &&
3079
- (o
3080
- ? ((l = s[r]), (l.closed = !0))
3081
- : ((l = It.getModifier(t[r].ty)),
3082
- (s[r] = l),
3083
- l.init(this, t, r, s),
3084
- this.shapeModifiers.push(l),
3085
- (i = !1)),
3086
- u.push(l));
3072
+ ? o || (s[r] = this.createShapeElement(t[r]))
3073
+ : 'tm' == t[r].ty || 'rd' == t[r].ty
3074
+ ? (o
3075
+ ? ((l = s[r]), (l.closed = !1))
3076
+ : ((l = It.getModifier(t[r].ty)), l.init(this, t[r]), (s[r] = l), this.shapeModifiers.push(l)),
3077
+ u.push(l))
3078
+ : 'rp' == t[r].ty &&
3079
+ (o
3080
+ ? ((l = s[r]), (l.closed = !0))
3081
+ : ((l = It.getModifier(t[r].ty)),
3082
+ (s[r] = l),
3083
+ l.init(this, t, r, s),
3084
+ this.shapeModifiers.push(l),
3085
+ (i = !1)),
3086
+ u.push(l));
3087
3087
  this.addProcessedElement(t[r], r + 1);
3088
3088
  }
3089
3089
  for (this.removeTransformFromStyleList(), this.closeStyles(d), c = u.length, r = 0; r < c; r += 1) u[r].closed = !0;
@@ -3146,14 +3146,14 @@ class Nt extends O$1 {
3146
3146
  'tr' == s[h].ty
3147
3147
  ? ((i = e[h].transform), this.updateShapeTransform(t, i))
3148
3148
  : 'sh' == s[h].ty || 'el' == s[h].ty || 'rc' == s[h].ty || 'sr' == s[h].ty
3149
- ? this.updatePath(s[h], e[h])
3150
- : 'fl' == s[h].ty
3151
- ? this.updateFill(s[h], e[h], i)
3152
- : 'st' == s[h].ty
3153
- ? this.updateStroke(s[h], e[h], i)
3154
- : 'gf' == s[h].ty || 'gs' == s[h].ty
3155
- ? this.updateGradientFill(s[h], e[h], i)
3156
- : 'gr' == s[h].ty && this.updateShape(i, s[h].it, e[h].it);
3149
+ ? this.updatePath(s[h], e[h])
3150
+ : 'fl' == s[h].ty
3151
+ ? this.updateFill(s[h], e[h], i)
3152
+ : 'st' == s[h].ty
3153
+ ? this.updateStroke(s[h], e[h], i)
3154
+ : 'gf' == s[h].ty || 'gs' == s[h].ty
3155
+ ? this.updateGradientFill(s[h], e[h], i)
3156
+ : 'gr' == s[h].ty && this.updateShape(i, s[h].it, e[h].it);
3157
3157
  }
3158
3158
  updateGrahpics() {
3159
3159
  const t = this.stylesList.length;
@@ -3490,8 +3490,8 @@ class Kt extends e {
3490
3490
  null === this.textureLoader
3491
3491
  ? this.emit('success')
3492
3492
  : this.textureLoader.loaded
3493
- ? this.emit('success')
3494
- : this.textureLoader.once('complete', () => this.emit('success'));
3493
+ ? this.emit('success')
3494
+ : this.textureLoader.once('complete', () => this.emit('success'));
3495
3495
  }
3496
3496
  _extraCompositions(t, { global: e, local: i }, h = !1) {
3497
3497
  const { w: r, h: a, ip: n, op: o, st: l = 0 } = t,
@@ -4429,8 +4429,8 @@ class z extends X {
4429
4429
  'm' == e[t].t
4430
4430
  ? this.moveTo(e[t].p[0], e[t].p[1])
4431
4431
  : 'c' == e[t].t
4432
- ? this.bezierCurveTo(e[t].pts[0], e[t].pts[1], e[t].pts[2], e[t].pts[3], e[t].pts[4], e[t].pts[5])
4433
- : this.closePath();
4432
+ ? this.bezierCurveTo(e[t].pts[0], e[t].pts[1], e[t].pts[2], e[t].pts[3], e[t].pts[4], e[t].pts[5])
4433
+ : this.closePath();
4434
4434
  }
4435
4435
  ('st' !== s$1 && 'gs' !== s$1) ||
4436
4436
  (e.da
@@ -4572,10 +4572,10 @@ function j(t) {
4572
4572
  return t.response && 'object' == typeof t.response
4573
4573
  ? t.response
4574
4574
  : t.response && 'string' == typeof t.response
4575
- ? JSON.parse(t.response)
4576
- : t.responseText
4577
- ? JSON.parse(t.responseText)
4578
- : void 0;
4575
+ ? JSON.parse(t.response)
4576
+ : t.responseText
4577
+ ? JSON.parse(t.responseText)
4578
+ : void 0;
4579
4579
  }
4580
4580
  class q extends e {
4581
4581
  constructor(t) {
@@ -4647,10 +4647,10 @@ const Y = {
4647
4647
  0 === t
4648
4648
  ? 0
4649
4649
  : 1 === t
4650
- ? 1
4651
- : (t *= 2) < 1
4652
- ? -0.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
4653
- : 0.5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1,
4650
+ ? 1
4651
+ : (t *= 2) < 1
4652
+ ? -0.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
4653
+ : 0.5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1,
4654
4654
  },
4655
4655
  Back: {
4656
4656
  In(t) {
@@ -4672,10 +4672,10 @@ const Y = {
4672
4672
  t < 1 / 2.75
4673
4673
  ? 7.5625 * t * t
4674
4674
  : t < 2 / 2.75
4675
- ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75
4676
- : t < 2.5 / 2.75
4677
- ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375
4678
- : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375,
4675
+ ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75
4676
+ : t < 2.5 / 2.75
4677
+ ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375
4678
+ : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375,
4679
4679
  InOut: t => (t < 0.5 ? 0.5 * Y.Bounce.In(2 * t) : 0.5 * Y.Bounce.Out(2 * t - 1) + 0.5),
4680
4680
  },
4681
4681
  };
@@ -5126,7 +5126,7 @@ var LottieSystem = (function (_super) {
5126
5126
  var container = this.renderSystem.containerManager.getContainer(changed.gameObject.id);
5127
5127
  if (container) {
5128
5128
  container.removeChild(component.anim.group);
5129
- component.anim.group.destory(true);
5129
+ component.anim.destroy();
5130
5130
  }
5131
5131
  component.anim = null;
5132
5132
  };
@@ -5235,4 +5235,6 @@ var Lottie = (function (_super) {
5235
5235
  }(Component));
5236
5236
  var Lottie$1 = Lottie;
5237
5237
 
5238
+ resource.registerResourceType('LOTTIE');
5239
+
5238
5240
  export { Lottie$1 as Lottie, LottieSystem$1 as LottieSystem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-lottie",
3
- "version": "1.3.0-alpha.1",
3
+ "version": "2.0.0-beta.1",
4
4
  "description": "@eva/plugin-renderer-lottie",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-lottie.esm.js",
@@ -18,9 +18,9 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
- "@eva/eva.js": "1.3.0-alpha.1",
22
- "@eva/plugin-renderer": "1.3.0-alpha.1",
21
+ "@eva/eva.js": "2.0.0-beta.1",
22
+ "@eva/plugin-renderer": "2.0.0-beta.1",
23
23
  "ios-version": "^1.0.1",
24
- "pixi.js": "^4.8.9"
24
+ "pixi.js": "^8.6.3"
25
25
  }
26
26
  }