@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.
@@ -7,7 +7,7 @@ var pluginRenderer = require('@eva/plugin-renderer');
7
7
  var pixi_js = require('pixi.js');
8
8
  var iOSVersion = require('ios-version');
9
9
 
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
11
11
 
12
12
  var iOSVersion__default = /*#__PURE__*/_interopDefaultLegacy(iOSVersion);
13
13
 
@@ -439,25 +439,25 @@ function M$1(t, s, e, i) {
439
439
  return s;
440
440
  })(t, i, this.mX1, this.mX2)
441
441
  : 0 === h
442
- ? i
443
- : (function (t, s, e, i, h) {
444
- let r,
445
- a,
446
- n = 0;
447
- do {
448
- (a = s + (e - s) / 2), (r = S$1(a, i, h) - t), r > 0 ? (e = a) : (s = a);
449
- } while (Math.abs(r) > 1e-7 && ++n < 10);
450
- return a;
451
- })(t, s, s + 0.1, this.mX1, this.mX2);
442
+ ? i
443
+ : (function (t, s, e, i, h) {
444
+ let r,
445
+ a,
446
+ n = 0;
447
+ do {
448
+ (a = s + (e - s) / 2), (r = S$1(a, i, h) - t), r > 0 ? (e = a) : (s = a);
449
+ } while (Math.abs(r) > 1e-7 && ++n < 10);
450
+ return a;
451
+ })(t, s, s + 0.1, this.mX1, this.mX2);
452
452
  }),
453
453
  (M$1.prototype.get = function (t) {
454
454
  return this.mX1 === this.mY1 && this.mX2 === this.mY2
455
455
  ? t
456
456
  : 0 === t
457
- ? 0
458
- : 1 === t
459
- ? 1
460
- : S$1(this._getTForX(t), this.mY1, this.mY2);
457
+ ? 0
458
+ : 1 === t
459
+ ? 1
460
+ : S$1(this._getTForX(t), this.mY1, this.mY2);
461
461
  });
462
462
  const P = {};
463
463
  var T$1 = {
@@ -478,10 +478,10 @@ w =
478
478
  return 'float32' === t
479
479
  ? new Float32Array(s)
480
480
  : 'int16' === t
481
- ? new Int16Array(s)
482
- : 'uint8c' === t
483
- ? new Uint8ClampedArray(s)
484
- : void 0;
481
+ ? new Int16Array(s)
482
+ : 'uint8c' === t
483
+ ? new Uint8ClampedArray(s)
484
+ : void 0;
485
485
  }
486
486
  : function (t, s) {
487
487
  let e = 0;
@@ -842,10 +842,10 @@ class $$1 {
842
842
  ? t
843
843
  : this.end - s.euclideanModulo(this.begin - t, this.total)
844
844
  : 'out' === this.type
845
- ? t <= this.end
846
- ? t
847
- : this.begin + s.euclideanModulo(t - this.end, this.total)
848
- : void 0;
845
+ ? t <= this.end
846
+ ? t
847
+ : this.begin + s.euclideanModulo(t - this.end, this.total)
848
+ : void 0;
849
849
  }
850
850
  }
851
851
  class tt {
@@ -1027,26 +1027,26 @@ class rt {
1027
1027
  (t >= g
1028
1028
  ? (n = 1)
1029
1029
  : t < y
1030
- ? (n = 0)
1031
- : (i.o.x.constructor === Array
1032
- ? (i.__fnct || (i.__fnct = []),
1033
- i.__fnct[d]
1034
- ? (p = i.__fnct[d])
1035
- : ((s = void 0 === i.o.x[d] ? i.o.x[0] : i.o.x[d]),
1036
- (r = void 0 === i.o.y[d] ? i.o.y[0] : i.o.y[d]),
1037
- (a = void 0 === i.i.x[d] ? i.i.x[0] : i.i.x[d]),
1038
- (o = void 0 === i.i.y[d] ? i.i.y[0] : i.i.y[d]),
1030
+ ? (n = 0)
1031
+ : (i.o.x.constructor === Array
1032
+ ? (i.__fnct || (i.__fnct = []),
1033
+ i.__fnct[d]
1034
+ ? (p = i.__fnct[d])
1035
+ : ((s = void 0 === i.o.x[d] ? i.o.x[0] : i.o.x[d]),
1036
+ (r = void 0 === i.o.y[d] ? i.o.y[0] : i.o.y[d]),
1037
+ (a = void 0 === i.i.x[d] ? i.i.x[0] : i.i.x[d]),
1038
+ (o = void 0 === i.i.y[d] ? i.i.y[0] : i.i.y[d]),
1039
+ (p = T$1.getBezierEasing(s, r, a, o).get),
1040
+ (i.__fnct[d] = p)))
1041
+ : i.__fnct
1042
+ ? (p = i.__fnct)
1043
+ : ((s = i.o.x),
1044
+ (r = i.o.y),
1045
+ (a = i.i.x),
1046
+ (o = i.i.y),
1039
1047
  (p = T$1.getBezierEasing(s, r, a, o).get),
1040
- (i.__fnct[d] = p)))
1041
- : i.__fnct
1042
- ? (p = i.__fnct)
1043
- : ((s = i.o.x),
1044
- (r = i.o.y),
1045
- (a = i.i.x),
1046
- (o = i.i.y),
1047
- (p = T$1.getBezierEasing(s, r, a, o).get),
1048
- (i.__fnct = p)),
1049
- (n = p((t - y) / (g - y))))),
1048
+ (i.__fnct = p)),
1049
+ (n = p((t - y) / (g - y))))),
1050
1050
  (m = h.s || i.e),
1051
1051
  (l = 1 === i.h ? i.s[d] : i.s[d] + (m[d] - i.s[d]) * n),
1052
1052
  'multidimensional' === this.propType ? (e[d] = l) : (e = l);
@@ -2116,13 +2116,13 @@ class Lt extends O$1 {
2116
2116
  ? ((t = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / e, 0)),
2117
2117
  (s = this.p.getValueAtTime(this.p.keyframes[0].t / e, 0)))
2118
2118
  : this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t
2119
- ? ((t = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / e, 0)),
2120
- (s = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / e, 0)))
2121
- : ((t = this.p.pv),
2122
- (s = this.p.getValueAtTime(
2123
- (this.p._caching.lastFrame + this.p.offsetTime - 0.01) / e,
2124
- this.p.offsetTime,
2125
- )));
2119
+ ? ((t = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / e, 0)),
2120
+ (s = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / e, 0)))
2121
+ : ((t = this.p.pv),
2122
+ (s = this.p.getValueAtTime(
2123
+ (this.p._caching.lastFrame + this.p.offsetTime - 0.01) / e,
2124
+ this.p.offsetTime,
2125
+ )));
2126
2126
  else if (
2127
2127
  this.px &&
2128
2128
  this.px.keyframes &&
@@ -2139,13 +2139,13 @@ class Lt extends O$1 {
2139
2139
  (s[0] = i.getValueAtTime(i.keyframes[0].t / e, 0)),
2140
2140
  (s[1] = h.getValueAtTime(h.keyframes[0].t / e, 0)))
2141
2141
  : i._caching.lastFrame + i.offsetTime >= i.keyframes[i.keyframes.length - 1].t
2142
- ? ((t[0] = i.getValueAtTime(i.keyframes[i.keyframes.length - 1].t / e, 0)),
2143
- (t[1] = h.getValueAtTime(h.keyframes[h.keyframes.length - 1].t / e, 0)),
2144
- (s[0] = i.getValueAtTime((i.keyframes[i.keyframes.length - 1].t - 0.01) / e, 0)),
2145
- (s[1] = h.getValueAtTime((h.keyframes[h.keyframes.length - 1].t - 0.01) / e, 0)))
2146
- : ((t = [i.pv, h.pv]),
2147
- (s[0] = i.getValueAtTime((i._caching.lastFrame + i.offsetTime - 0.01) / e, i.offsetTime)),
2148
- (s[1] = h.getValueAtTime((h._caching.lastFrame + h.offsetTime - 0.01) / e, h.offsetTime)));
2142
+ ? ((t[0] = i.getValueAtTime(i.keyframes[i.keyframes.length - 1].t / e, 0)),
2143
+ (t[1] = h.getValueAtTime(h.keyframes[h.keyframes.length - 1].t / e, 0)),
2144
+ (s[0] = i.getValueAtTime((i.keyframes[i.keyframes.length - 1].t - 0.01) / e, 0)),
2145
+ (s[1] = h.getValueAtTime((h.keyframes[h.keyframes.length - 1].t - 0.01) / e, 0)))
2146
+ : ((t = [i.pv, h.pv]),
2147
+ (s[0] = i.getValueAtTime((i._caching.lastFrame + i.offsetTime - 0.01) / e, i.offsetTime)),
2148
+ (s[1] = h.getValueAtTime((h._caching.lastFrame + h.offsetTime - 0.01) / e, h.offsetTime)));
2149
2149
  } else t = s = Z$1;
2150
2150
  this.v.rotate(-Math.atan2(t[1] - s[1], t[0] - s[0]));
2151
2151
  }
@@ -2263,8 +2263,8 @@ bt(
2263
2263
  s <= 1
2264
2264
  ? r.push({ s: t, e: s })
2265
2265
  : t >= 1
2266
- ? r.push({ s: t - 1, e: s - 1 })
2267
- : (r.push({ s: t, e: 1 }), r.push({ s: 0, e: s - 1 }));
2266
+ ? r.push({ s: t - 1, e: s - 1 })
2267
+ : (r.push({ s: t, e: 1 }), r.push({ s: 0, e: s - 1 }));
2268
2268
  let a,
2269
2269
  n,
2270
2270
  o = [],
@@ -2351,9 +2351,9 @@ bt(
2351
2351
  y <= 1
2352
2352
  ? f.push({ s: d.totalShapeLength * g, e: d.totalShapeLength * y })
2353
2353
  : g >= 1
2354
- ? f.push({ s: d.totalShapeLength * (g - 1), e: d.totalShapeLength * (y - 1) })
2355
- : (f.push({ s: d.totalShapeLength * g, e: d.totalShapeLength }),
2356
- f.push({ s: 0, e: d.totalShapeLength * (y - 1) }));
2354
+ ? f.push({ s: d.totalShapeLength * (g - 1), e: d.totalShapeLength * (y - 1) })
2355
+ : (f.push({ s: d.totalShapeLength * g, e: d.totalShapeLength }),
2356
+ f.push({ s: 0, e: d.totalShapeLength * (y - 1) }));
2357
2357
  let t = this.addShapes(d, f[0]);
2358
2358
  if (f[0].s !== f[0].e) {
2359
2359
  if (f.length > 1) {
@@ -3077,21 +3077,21 @@ class Nt extends O$1 {
3077
3077
  f.push(s[r]),
3078
3078
  this.addTransformToStyleList(s[r]))
3079
3079
  : 'sh' == t[r].ty || 'rc' == t[r].ty || 'el' == t[r].ty || 'sr' == t[r].ty
3080
- ? o || (s[r] = this.createShapeElement(t[r]))
3081
- : 'tm' == t[r].ty || 'rd' == t[r].ty
3082
- ? (o
3083
- ? ((l = s[r]), (l.closed = !1))
3084
- : ((l = It.getModifier(t[r].ty)), l.init(this, t[r]), (s[r] = l), this.shapeModifiers.push(l)),
3085
- u.push(l))
3086
- : 'rp' == t[r].ty &&
3087
- (o
3088
- ? ((l = s[r]), (l.closed = !0))
3089
- : ((l = It.getModifier(t[r].ty)),
3090
- (s[r] = l),
3091
- l.init(this, t, r, s),
3092
- this.shapeModifiers.push(l),
3093
- (i = !1)),
3094
- u.push(l));
3080
+ ? o || (s[r] = this.createShapeElement(t[r]))
3081
+ : 'tm' == t[r].ty || 'rd' == t[r].ty
3082
+ ? (o
3083
+ ? ((l = s[r]), (l.closed = !1))
3084
+ : ((l = It.getModifier(t[r].ty)), l.init(this, t[r]), (s[r] = l), this.shapeModifiers.push(l)),
3085
+ u.push(l))
3086
+ : 'rp' == t[r].ty &&
3087
+ (o
3088
+ ? ((l = s[r]), (l.closed = !0))
3089
+ : ((l = It.getModifier(t[r].ty)),
3090
+ (s[r] = l),
3091
+ l.init(this, t, r, s),
3092
+ this.shapeModifiers.push(l),
3093
+ (i = !1)),
3094
+ u.push(l));
3095
3095
  this.addProcessedElement(t[r], r + 1);
3096
3096
  }
3097
3097
  for (this.removeTransformFromStyleList(), this.closeStyles(d), c = u.length, r = 0; r < c; r += 1) u[r].closed = !0;
@@ -3154,14 +3154,14 @@ class Nt extends O$1 {
3154
3154
  'tr' == s[h].ty
3155
3155
  ? ((i = e[h].transform), this.updateShapeTransform(t, i))
3156
3156
  : 'sh' == s[h].ty || 'el' == s[h].ty || 'rc' == s[h].ty || 'sr' == s[h].ty
3157
- ? this.updatePath(s[h], e[h])
3158
- : 'fl' == s[h].ty
3159
- ? this.updateFill(s[h], e[h], i)
3160
- : 'st' == s[h].ty
3161
- ? this.updateStroke(s[h], e[h], i)
3162
- : 'gf' == s[h].ty || 'gs' == s[h].ty
3163
- ? this.updateGradientFill(s[h], e[h], i)
3164
- : 'gr' == s[h].ty && this.updateShape(i, s[h].it, e[h].it);
3157
+ ? this.updatePath(s[h], e[h])
3158
+ : 'fl' == s[h].ty
3159
+ ? this.updateFill(s[h], e[h], i)
3160
+ : 'st' == s[h].ty
3161
+ ? this.updateStroke(s[h], e[h], i)
3162
+ : 'gf' == s[h].ty || 'gs' == s[h].ty
3163
+ ? this.updateGradientFill(s[h], e[h], i)
3164
+ : 'gr' == s[h].ty && this.updateShape(i, s[h].it, e[h].it);
3165
3165
  }
3166
3166
  updateGrahpics() {
3167
3167
  const t = this.stylesList.length;
@@ -3498,8 +3498,8 @@ class Kt extends e {
3498
3498
  null === this.textureLoader
3499
3499
  ? this.emit('success')
3500
3500
  : this.textureLoader.loaded
3501
- ? this.emit('success')
3502
- : this.textureLoader.once('complete', () => this.emit('success'));
3501
+ ? this.emit('success')
3502
+ : this.textureLoader.once('complete', () => this.emit('success'));
3503
3503
  }
3504
3504
  _extraCompositions(t, { global: e, local: i }, h = !1) {
3505
3505
  const { w: r, h: a, ip: n, op: o, st: l = 0 } = t,
@@ -4437,8 +4437,8 @@ class z extends X {
4437
4437
  'm' == e[t].t
4438
4438
  ? this.moveTo(e[t].p[0], e[t].p[1])
4439
4439
  : 'c' == e[t].t
4440
- ? 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])
4441
- : this.closePath();
4440
+ ? 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])
4441
+ : this.closePath();
4442
4442
  }
4443
4443
  ('st' !== s$1 && 'gs' !== s$1) ||
4444
4444
  (e.da
@@ -4580,10 +4580,10 @@ function j(t) {
4580
4580
  return t.response && 'object' == typeof t.response
4581
4581
  ? t.response
4582
4582
  : t.response && 'string' == typeof t.response
4583
- ? JSON.parse(t.response)
4584
- : t.responseText
4585
- ? JSON.parse(t.responseText)
4586
- : void 0;
4583
+ ? JSON.parse(t.response)
4584
+ : t.responseText
4585
+ ? JSON.parse(t.responseText)
4586
+ : void 0;
4587
4587
  }
4588
4588
  class q extends e {
4589
4589
  constructor(t) {
@@ -4655,10 +4655,10 @@ const Y = {
4655
4655
  0 === t
4656
4656
  ? 0
4657
4657
  : 1 === t
4658
- ? 1
4659
- : (t *= 2) < 1
4660
- ? -0.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
4661
- : 0.5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1,
4658
+ ? 1
4659
+ : (t *= 2) < 1
4660
+ ? -0.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
4661
+ : 0.5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1,
4662
4662
  },
4663
4663
  Back: {
4664
4664
  In(t) {
@@ -4680,10 +4680,10 @@ const Y = {
4680
4680
  t < 1 / 2.75
4681
4681
  ? 7.5625 * t * t
4682
4682
  : t < 2 / 2.75
4683
- ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75
4684
- : t < 2.5 / 2.75
4685
- ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375
4686
- : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375,
4683
+ ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75
4684
+ : t < 2.5 / 2.75
4685
+ ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375
4686
+ : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375,
4687
4687
  InOut: t => (t < 0.5 ? 0.5 * Y.Bounce.In(2 * t) : 0.5 * Y.Bounce.Out(2 * t - 1) + 0.5),
4688
4688
  },
4689
4689
  };
@@ -5134,7 +5134,7 @@ var LottieSystem = (function (_super) {
5134
5134
  var container = this.renderSystem.containerManager.getContainer(changed.gameObject.id);
5135
5135
  if (container) {
5136
5136
  container.removeChild(component.anim.group);
5137
- component.anim.group.destory(true);
5137
+ component.anim.destroy();
5138
5138
  }
5139
5139
  component.anim = null;
5140
5140
  };
@@ -5243,5 +5243,7 @@ var Lottie = (function (_super) {
5243
5243
  }(eva_js.Component));
5244
5244
  var Lottie$1 = Lottie;
5245
5245
 
5246
+ eva_js.resource.registerResourceType('LOTTIE');
5247
+
5246
5248
  exports.Lottie = Lottie$1;
5247
5249
  exports.LottieSystem = LottieSystem$1;