@visactor/vrender 1.1.0-alpha.2 → 1.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -32343,6 +32343,19 @@
32343
32343
  return !1;
32344
32344
  }
32345
32345
 
32346
+ function applyAnimationTransientAttributes(target, attributes, type = exports.AttributeUpdateType.ANIMATE_UPDATE) {
32347
+ var _a;
32348
+ if (!attributes) return;
32349
+ const context = {
32350
+ type: type
32351
+ },
32352
+ transientTarget = target;
32353
+ "function" != typeof transientTarget.applyTransientAttributes ? "function" != typeof transientTarget.setAttributesAndPreventAnimate ? (transientTarget.attribute || (transientTarget.attribute = {}), Object.assign(transientTarget.attribute, attributes), null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, context)) : transientTarget.setAttributesAndPreventAnimate(attributes, !1, context) : transientTarget.applyTransientAttributes(attributes, !1, context);
32354
+ }
32355
+ function applyAppearStartAttributes(target, attributes) {
32356
+ applyAnimationTransientAttributes(target, attributes, exports.AttributeUpdateType.ANIMATE_BIND);
32357
+ }
32358
+
32346
32359
  function noop() {}
32347
32360
  class Step {
32348
32361
  constructor(type, props, duration, easing) {
@@ -32468,7 +32481,7 @@
32468
32481
  onStart() {
32469
32482
  super.onStart();
32470
32483
  const fromProps = this.getFromProps();
32471
- this.target.setAttributes(fromProps);
32484
+ applyAnimationTransientAttributes(this.target, fromProps, exports.AttributeUpdateType.ANIMATE_START);
32472
32485
  }
32473
32486
  update(end, ratio, out) {
32474
32487
  this.onStart();
@@ -32830,7 +32843,7 @@
32830
32843
  const currentLoop = Math.floor((nextTime - this._startTime) / this._duration);
32831
32844
  newLoop = currentLoop > this._currentLoop, this._currentLoop = currentLoop, bounceTime = this._bounce && currentLoop % 2 == 1, bounceTime && (cycleTime = this._duration - cycleTime);
32832
32845
  }
32833
- newLoop && !bounceTime && this.target.setAttributes(this._startProps);
32846
+ newLoop && !bounceTime && applyAnimationTransientAttributes(this.target, this._startProps, exports.AttributeUpdateType.ANIMATE_START);
32834
32847
  let targetStep = null;
32835
32848
  if (this._lastStep === this._firstStep) targetStep = this._firstStep;else {
32836
32849
  let currentStep = this._firstStep;
@@ -33396,7 +33409,8 @@
33396
33409
  void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : props[key] = config.to), void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : from[key] = config.from);
33397
33410
  }), diffAttrs) for (const key in diffAttrs) {
33398
33411
  const value = diffAttrs[key];
33399
- void 0 !== value && (props.hasOwnProperty(key) || (attrOutChannel[key] = value, hasAttrs = !0));
33412
+ if (void 0 === value) continue;
33413
+ props.hasOwnProperty(key) || !!(null == from ? void 0 : from.hasOwnProperty(key)) || (attrOutChannel[key] = value, hasAttrs = !0);
33400
33414
  }
33401
33415
  return {
33402
33416
  from: from,
@@ -33854,7 +33868,9 @@
33854
33868
  const parts = formattedNumber.toString().split(".");
33855
33869
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), formattedWithBasicFormat = parts.join(".");
33856
33870
  } else formattedWithBasicFormat = formattedNumber;
33857
- formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat, this.target.setAttribute("text", formattedText);
33871
+ formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat, applyAnimationTransientAttributes(this.target, {
33872
+ text: formattedText
33873
+ });
33858
33874
  }
33859
33875
  }
33860
33876
 
@@ -33961,7 +33977,7 @@
33961
33977
  onUpdate(end, ratio, out) {
33962
33978
  const target = this.target,
33963
33979
  pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
33964
- interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio), this.target.setAttributes(out), end && !this.saveOnEnd && (this.target.pathProxy = null);
33980
+ interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio), end && this.saveOnEnd ? this.target.setAttributes(out) : applyAnimationTransientAttributes(this.target, out), end && !this.saveOnEnd && (this.target.pathProxy = null);
33965
33981
  }
33966
33982
  }
33967
33983
  const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
@@ -34192,7 +34208,9 @@
34192
34208
  const blinkRate = .1;
34193
34209
  Math.floor(ratio / blinkRate) % 2 == 0 && (displayText = this.beforeText + currentText + this.cursorChar + this.afterText);
34194
34210
  } else displayText = this.beforeText + currentText + this.cursorChar + this.afterText;
34195
- this.target.setAttribute("text", displayText);
34211
+ applyAnimationTransientAttributes(this.target, {
34212
+ text: displayText
34213
+ });
34196
34214
  }
34197
34215
  }
34198
34216
 
@@ -34201,11 +34219,9 @@
34201
34219
  super(null, {}, duration, easing, params), this.clipFromAttribute = from, this.clipToAttribute = to, this._group = null == params ? void 0 : params.group, this._clipGraphic = null == params ? void 0 : params.clipGraphic;
34202
34220
  }
34203
34221
  onBind() {
34204
- super.onBind(), this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, this._group.setAttributes({
34222
+ super.onBind(), this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, applyAppearStartAttributes(this._group, {
34205
34223
  clip: !0,
34206
34224
  path: [this._clipGraphic]
34207
- }, !1, {
34208
- type: exports.AttributeUpdateType.ANIMATE_BIND
34209
34225
  }));
34210
34226
  }
34211
34227
  onEnd() {
@@ -34418,7 +34434,7 @@
34418
34434
  return newPoint.context = point.context, newPoint;
34419
34435
  }), this.clipRange) {
34420
34436
  if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints, out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
34421
- this.target.setAttributes({
34437
+ applyAnimationTransientAttributes(this.target, {
34422
34438
  clipRange: this.clipRange + (1 - this.clipRange) * ratio
34423
34439
  });
34424
34440
  }
@@ -34451,7 +34467,7 @@
34451
34467
  this.keys.forEach(key => {
34452
34468
  var _a, _b, _c;
34453
34469
  to[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1, from[key] = null !== (_c = null !== (_b = from[key]) && void 0 !== _b ? _b : fromAttrs[key]) && void 0 !== _c ? _c : 0;
34454
- }), null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.target.setAttributes(from);
34470
+ }), null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, from);
34455
34471
  }
34456
34472
  onUpdate(end, ratio, out) {
34457
34473
  const attribute = this.target.attribute;
@@ -34705,7 +34721,7 @@
34705
34721
  to: to
34706
34722
  } = growAngleIn(this.target, this.params.options, this.params),
34707
34723
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34708
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
34724
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs), this.determineUpdateFunction();
34709
34725
  }
34710
34726
  }
34711
34727
  class GrowAngleOut extends GrowAngleBase {
@@ -34855,7 +34871,7 @@
34855
34871
  to: to
34856
34872
  } = growCenterIn(this.target, this.params.options, this.params),
34857
34873
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34858
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.target.setAttributes(fromAttrs);
34874
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
34859
34875
  }
34860
34876
  onEnd(cb) {
34861
34877
  super.onEnd(cb);
@@ -34960,7 +34976,7 @@
34960
34976
  to: to
34961
34977
  } = growHeightIn(this.target, this.params.options, this.params),
34962
34978
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34963
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.target.setAttributes(fromAttrs);
34979
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
34964
34980
  }
34965
34981
  onEnd(cb) {
34966
34982
  super.onEnd(cb);
@@ -35074,7 +35090,7 @@
35074
35090
  from: from,
35075
35091
  to: to
35076
35092
  } = growPointsIn(this.target, this.params.options, this.params);
35077
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
35093
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35078
35094
  } else this.valid = !1;
35079
35095
  }
35080
35096
  }
@@ -35136,7 +35152,7 @@
35136
35152
  from: from,
35137
35153
  to: to
35138
35154
  } = growPointsXIn(this.target, this.params.options, this.params);
35139
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
35155
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35140
35156
  } else this.valid = !1;
35141
35157
  }
35142
35158
  }
@@ -35198,7 +35214,7 @@
35198
35214
  from: from,
35199
35215
  to: to
35200
35216
  } = growPointsYIn(this.target, this.params.options, this.params);
35201
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
35217
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
35202
35218
  } else this.valid = !1;
35203
35219
  }
35204
35220
  }
@@ -35310,7 +35326,7 @@
35310
35326
  to: to
35311
35327
  } = growRadiusIn(this.target, this.params.options, this.params),
35312
35328
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
35313
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.target.setAttributes(fromAttrs);
35329
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
35314
35330
  }
35315
35331
  }
35316
35332
  class GrowRadiusOut extends GrowPointsBase {
@@ -35432,7 +35448,7 @@
35432
35448
  to: to
35433
35449
  } = growWidthIn(this.target, this.params.options, this.params),
35434
35450
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
35435
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && this.target.setAttributes(fromAttrs);
35451
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to, null === (_d = (_c = this.target).applyFinalAttributeToAttribute) || void 0 === _d || _d.call(_c), !1 !== (null === (_e = this.params.controlOptions) || void 0 === _e ? void 0 : _e.immediatelyApply) && applyAppearStartAttributes(this.target, fromAttrs);
35436
35452
  }
35437
35453
  onEnd(cb) {
35438
35454
  super.onEnd(cb);
@@ -35483,7 +35499,7 @@
35483
35499
  } = this.params,
35484
35500
  symbolTime = duration / 10;
35485
35501
  let symbolStartOuterFrom, symbolStartOuterTo;
35486
- if (target._symbolStart.setAttributes({
35502
+ if (applyAppearStartAttributes(target._symbolStart, {
35487
35503
  scaleX: 0,
35488
35504
  scaleY: 0
35489
35505
  }), animator.animate(target._symbolStart, {
@@ -35504,12 +35520,12 @@
35504
35520
  clipRange: 0
35505
35521
  }, symbolStartOuterTo = {
35506
35522
  clipRange: 1
35507
- }), target._symbolStartOuter.setAttributes(symbolStartOuterFrom), animator.animate(target._symbolStartOuter, {
35523
+ }), applyAppearStartAttributes(target._symbolStartOuter, symbolStartOuterFrom), animator.animate(target._symbolStartOuter, {
35508
35524
  type: "to",
35509
35525
  to: symbolStartOuterTo,
35510
35526
  duration: 5 * symbolTime,
35511
35527
  easing: easing
35512
- }), target._symbolEnd.setAttributes({
35528
+ }), applyAppearStartAttributes(target._symbolEnd, {
35513
35529
  scaleX: 0,
35514
35530
  scaleY: 0
35515
35531
  }), animator.animate(target._symbolEnd, {
@@ -35521,7 +35537,7 @@
35521
35537
  duration: 2 * symbolTime,
35522
35538
  delay: 8 * symbolTime,
35523
35539
  easing: easing
35524
- }), target._line.setAttributes({
35540
+ }), applyAppearStartAttributes(target._line, {
35525
35541
  clipRange: 0
35526
35542
  }), animator.animate(target._line, {
35527
35543
  type: "to",
@@ -35532,7 +35548,7 @@
35532
35548
  easing: easing
35533
35549
  }), "typewriter" === titleType) {
35534
35550
  const titleTopText = target._titleTop.attribute.text;
35535
- target._titleTop.setAttributes({
35551
+ applyAppearStartAttributes(target._titleTop, {
35536
35552
  text: ""
35537
35553
  }), animator.animate(target._titleTop, {
35538
35554
  type: "custom",
@@ -35545,7 +35561,7 @@
35545
35561
  custom: InputText
35546
35562
  });
35547
35563
  const titleBottomText = target._titleBottom.attribute.text;
35548
- target._titleBottom.setAttributes({
35564
+ applyAppearStartAttributes(target._titleBottom, {
35549
35565
  text: ""
35550
35566
  }), animator.animate(target._titleBottom, {
35551
35567
  type: "custom",
@@ -35557,7 +35573,7 @@
35557
35573
  },
35558
35574
  custom: InputText
35559
35575
  });
35560
- } else target._titleTop.setAttributes({
35576
+ } else applyAppearStartAttributes(target._titleTop, {
35561
35577
  dy: target._titleTop.AABBBounds.height() + 10
35562
35578
  }), animator.animate(target._titleTop, {
35563
35579
  type: "to",
@@ -35567,7 +35583,7 @@
35567
35583
  delay: 5 * symbolTime,
35568
35584
  duration: 4 * symbolTime,
35569
35585
  easing: "linear"
35570
- }), target._titleBottom.setAttributes({
35586
+ }), applyAppearStartAttributes(target._titleBottom, {
35571
35587
  dy: -(10 + target._titleBottom.AABBBounds.height())
35572
35588
  }), animator.animate(target._titleBottom, {
35573
35589
  type: "to",
@@ -35581,7 +35597,7 @@
35581
35597
  "scale" === titlePanelType ? [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {
35582
35598
  var _a;
35583
35599
  const scaleX = null !== (_a = panel.attribute.scaleX) && void 0 !== _a ? _a : 1;
35584
- panel.setAttributes({
35600
+ applyAppearStartAttributes(panel, {
35585
35601
  scaleX: 0
35586
35602
  }), animator.animate(panel, {
35587
35603
  type: "to",
@@ -35594,7 +35610,7 @@
35594
35610
  }) : "stroke" === titlePanelType && [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {
35595
35611
  const b = panel.AABBBounds,
35596
35612
  totalLen = 2 * (b.width() + b.height());
35597
- panel.setAttributes({
35613
+ applyAppearStartAttributes(panel, {
35598
35614
  lineDash: [0, 10 * totalLen]
35599
35615
  }), animator.animate(panel, {
35600
35616
  type: "to",
@@ -35701,7 +35717,7 @@
35701
35717
  {
35702
35718
  wave: wave
35703
35719
  } = this.params;
35704
- if (target.setAttributes({
35720
+ if (applyAppearStartAttributes(target, {
35705
35721
  scaleX: 0,
35706
35722
  scaleY: 0
35707
35723
  }), animator.animate(target, {
@@ -35854,7 +35870,9 @@
35854
35870
  }
35855
35871
  }
35856
35872
  }
35857
- this.target.setAttribute("textConfig", currentTextConfig);
35873
+ applyAnimationTransientAttributes(this.target, {
35874
+ textConfig: currentTextConfig
35875
+ });
35858
35876
  }
35859
35877
  }
35860
35878
 
@@ -35881,18 +35899,21 @@
35881
35899
  displayedLength = Math.round(fromItems * (1 - adjustedRatio));
35882
35900
  } else displayedLength = Math.round(fromItems * (1 - ratio));
35883
35901
  let currentTextConfig = "forward" === this.direction ? this.fromTextConfig.slice(fromItems - displayedLength) : this.fromTextConfig.slice(0, displayedLength);
35884
- this.fadeOutChars && (currentTextConfig = this.applyFadeEffect(currentTextConfig, ratio, fromItems, displayedLength)), this.showCursor && displayedLength > 0 && (currentTextConfig = this.addCursor(currentTextConfig, ratio)), this.target.setAttribute("textConfig", currentTextConfig);
35902
+ this.fadeOutChars && (currentTextConfig = this.applyFadeEffect(currentTextConfig, ratio, fromItems, displayedLength)), this.showCursor && displayedLength > 0 && (currentTextConfig = this.addCursor(currentTextConfig, ratio)), applyAnimationTransientAttributes(this.target, {
35903
+ textConfig: currentTextConfig
35904
+ });
35885
35905
  } else {
35886
35906
  if (this.fadeOutChars) {
35887
35907
  const adjustedRatio = Math.min(1, ratio / maxTextHideRatio);
35888
35908
  displayedLength = Math.round(fromItems * (1 - adjustedRatio));
35889
35909
  } else displayedLength = Math.round(fromItems * (1 - ratio));
35890
35910
  let currentTextConfig = this.fromTextConfig.slice(0, displayedLength);
35891
- this.fadeOutChars && (currentTextConfig = this.applyFadeEffect(currentTextConfig, ratio, fromItems, displayedLength)), this.showCursor && displayedLength > 0 && (currentTextConfig = this.addCursor(currentTextConfig, ratio)), this.target.setAttribute("textConfig", currentTextConfig);
35911
+ this.fadeOutChars && (currentTextConfig = this.applyFadeEffect(currentTextConfig, ratio, fromItems, displayedLength)), this.showCursor && displayedLength > 0 && (currentTextConfig = this.addCursor(currentTextConfig, ratio)), applyAnimationTransientAttributes(this.target, {
35912
+ textConfig: currentTextConfig
35913
+ });
35892
35914
  }
35893
35915
  }
35894
35916
  applyFadeEffect(textConfig, ratio, totalItems, displayedLength) {
35895
- "forward" === this.direction ? totalItems - displayedLength : displayedLength;
35896
35917
  const fadeProgress = (ratio - (1 - this.fadeOutDuration)) / this.fadeOutDuration,
35897
35918
  fadeOpacity = Math.max(0, 1 - Math.min(1, fadeProgress));
35898
35919
  return textConfig.map((item, index) => {
@@ -35994,7 +36015,9 @@
35994
36015
  if (!this.valid) return;
35995
36016
  const maxTextShowRatio = 1 - this.fadeInDuration;
35996
36017
  let updatedTextConfig;
35997
- updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), this.target.setAttribute("textConfig", updatedTextConfig);
36018
+ updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), applyAnimationTransientAttributes(this.target, {
36019
+ textConfig: updatedTextConfig
36020
+ });
35998
36021
  }
35999
36022
  updateByWord(ratio, maxTextShowRatio) {
36000
36023
  const totalGroups = this.wordGroups.length,
@@ -36123,7 +36146,9 @@
36123
36146
  if (!this.valid) return;
36124
36147
  const maxTextShowRatio = 1 - this.fadeOutDuration;
36125
36148
  let updatedTextConfig;
36126
- updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), this.target.setAttribute("textConfig", updatedTextConfig);
36149
+ updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), applyAnimationTransientAttributes(this.target, {
36150
+ textConfig: updatedTextConfig
36151
+ });
36127
36152
  }
36128
36153
  updateByWord(ratio, maxTextShowRatio) {
36129
36154
  const totalGroups = this.wordGroups.length,
@@ -36222,7 +36247,7 @@
36222
36247
  scaleY: null !== (_k = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _k ? _k : 1
36223
36248
  }, this._updateFunction = this.updateXY;
36224
36249
  }
36225
- null === (_m = (_l = this.target).applyFinalAttributeToAttribute) || void 0 === _m || _m.call(_l), this.props = to, this.from = from, this.to = to, !1 !== (null === (_o = this.params.controlOptions) || void 0 === _o ? void 0 : _o.immediatelyApply) && this.target.setAttributes(from);
36250
+ null === (_m = (_l = this.target).applyFinalAttributeToAttribute) || void 0 === _m || _m.call(_l), this.props = to, this.from = from, this.to = to, !1 !== (null === (_o = this.params.controlOptions) || void 0 === _o ? void 0 : _o.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36226
36251
  }
36227
36252
  onEnd(cb) {
36228
36253
  super.onEnd(cb);
@@ -36325,7 +36350,7 @@
36325
36350
  opacity: 1,
36326
36351
  baseOpacity: 1
36327
36352
  };
36328
- "top" === direction ? (from.y = (null !== (_e = attrs.y) && void 0 !== _e ? _e : 0) - distance, to.y = null !== (_f = attrs.y) && void 0 !== _f ? _f : 0, this.propKeys = ["opacity", "baseOpacity", "y"]) : "bottom" === direction ? (from.y = (null !== (_g = attrs.y) && void 0 !== _g ? _g : 0) + distance, to.y = null !== (_h = attrs.y) && void 0 !== _h ? _h : 0, this.propKeys = ["opacity", "baseOpacity", "y"]) : "left" === direction ? (from.x = (null !== (_j = attrs.x) && void 0 !== _j ? _j : 0) - distance, to.x = null !== (_k = attrs.x) && void 0 !== _k ? _k : 0, this.propKeys = ["opacity", "baseOpacity", "x"]) : (from.x = (null !== (_l = attrs.x) && void 0 !== _l ? _l : 0) + distance, to.x = null !== (_m = attrs.x) && void 0 !== _m ? _m : 0, this.propKeys = ["opacity", "baseOpacity", "x"]), this.from = from, this.to = to, this.props = to, this.target.setAttributes(from);
36353
+ "top" === direction ? (from.y = (null !== (_e = attrs.y) && void 0 !== _e ? _e : 0) - distance, to.y = null !== (_f = attrs.y) && void 0 !== _f ? _f : 0, this.propKeys = ["opacity", "baseOpacity", "y"]) : "bottom" === direction ? (from.y = (null !== (_g = attrs.y) && void 0 !== _g ? _g : 0) + distance, to.y = null !== (_h = attrs.y) && void 0 !== _h ? _h : 0, this.propKeys = ["opacity", "baseOpacity", "y"]) : "left" === direction ? (from.x = (null !== (_j = attrs.x) && void 0 !== _j ? _j : 0) - distance, to.x = null !== (_k = attrs.x) && void 0 !== _k ? _k : 0, this.propKeys = ["opacity", "baseOpacity", "x"]) : (from.x = (null !== (_l = attrs.x) && void 0 !== _l ? _l : 0) + distance, to.x = null !== (_m = attrs.x) && void 0 !== _m ? _m : 0, this.propKeys = ["opacity", "baseOpacity", "x"]), this.from = from, this.to = to, this.props = to, applyAppearStartAttributes(this.target, from);
36329
36354
  }
36330
36355
  onUpdate(end, ratio, out) {
36331
36356
  const attribute = this.target.attribute;
@@ -36353,7 +36378,7 @@
36353
36378
  opacity: 1,
36354
36379
  baseOpacity: 1
36355
36380
  };
36356
- this.propKeys = ["opacity", "baseOpacity"], "x" !== direction && "xy" !== direction || (from.scaleX = fromScale, to.scaleX = null !== (_f = attrs.scaleX) && void 0 !== _f ? _f : 1, this.propKeys.push("scaleX")), "y" !== direction && "xy" !== direction || (from.scaleY = fromScale, to.scaleY = null !== (_g = attrs.scaleY) && void 0 !== _g ? _g : 1, this.propKeys.push("scaleY")), this.from = from, this.to = to, this.props = to, this.target.setAttributes(from);
36381
+ this.propKeys = ["opacity", "baseOpacity"], "x" !== direction && "xy" !== direction || (from.scaleX = fromScale, to.scaleX = null !== (_f = attrs.scaleX) && void 0 !== _f ? _f : 1, this.propKeys.push("scaleX")), "y" !== direction && "xy" !== direction || (from.scaleY = fromScale, to.scaleY = null !== (_g = attrs.scaleY) && void 0 !== _g ? _g : 1, this.propKeys.push("scaleY")), this.from = from, this.to = to, this.props = to, applyAppearStartAttributes(this.target, from);
36357
36382
  }
36358
36383
  onUpdate(end, ratio, out) {
36359
36384
  const attribute = this.target.attribute;
@@ -36387,7 +36412,7 @@
36387
36412
  scaleX: null !== (_h = attrs.scaleX) && void 0 !== _h ? _h : 1,
36388
36413
  scaleY: null !== (_j = attrs.scaleY) && void 0 !== _j ? _j : 1
36389
36414
  };
36390
- this.propKeys = ["opacity", "baseOpacity", "angle", "scaleX", "scaleY"], this.from = from, this.to = to, this.props = to, this.target.setAttributes(from);
36415
+ this.propKeys = ["opacity", "baseOpacity", "angle", "scaleX", "scaleY"], this.from = from, this.to = to, this.props = to, applyAppearStartAttributes(this.target, from);
36391
36416
  }
36392
36417
  onUpdate(end, ratio, out) {
36393
36418
  const attribute = this.target.attribute;
@@ -36434,7 +36459,7 @@
36434
36459
  lineWidth: lineWidth,
36435
36460
  stroke: strokeColor,
36436
36461
  strokeOpacity: fromOpacity
36437
- }, showFill ? (this.from.fillOpacity = fillOpacity, this.to.fillOpacity = null !== (_t = this.originalAttributes.fillOpacity) && void 0 !== _t ? _t : 1) : (this.from.fillOpacity = 0, this.to.fillOpacity = 0), this.propKeys = ["lineDash", "lineDashOffset", "lineWidth", "stroke", "strokeOpacity", "fillOpacity"], this.props = this.to, this.target.setAttributes(this.from);
36462
+ }, showFill ? (this.from.fillOpacity = fillOpacity, this.to.fillOpacity = null !== (_t = this.originalAttributes.fillOpacity) && void 0 !== _t ? _t : 1) : (this.from.fillOpacity = 0, this.to.fillOpacity = 0), this.propKeys = ["lineDash", "lineDashOffset", "lineWidth", "stroke", "strokeOpacity", "fillOpacity"], this.props = this.to, applyAppearStartAttributes(this.target, this.from);
36438
36463
  }
36439
36464
  onUpdate(end, ratio, out) {
36440
36465
  var _a;
@@ -36486,7 +36511,7 @@
36486
36511
  lineWidth: lineWidth,
36487
36512
  stroke: strokeColor,
36488
36513
  strokeOpacity: fromOpacity
36489
- }, showFill ? (this.from.fillOpacity = null !== (_r = this.originalAttributes.fillOpacity) && void 0 !== _r ? _r : 1, this.to.fillOpacity = 0) : (this.from.fillOpacity = 0, this.to.fillOpacity = 0), this.propKeys = ["lineDash", "lineDashOffset", "lineWidth", "stroke", "strokeOpacity", "fillOpacity"], this.props = this.to, this.target.setAttributes(this.from);
36514
+ }, showFill ? (this.from.fillOpacity = null !== (_r = this.originalAttributes.fillOpacity) && void 0 !== _r ? _r : 1, this.to.fillOpacity = 0) : (this.from.fillOpacity = 0, this.to.fillOpacity = 0), this.propKeys = ["lineDash", "lineDashOffset", "lineWidth", "stroke", "strokeOpacity", "fillOpacity"], this.props = this.to, applyAppearStartAttributes(this.target, this.from);
36490
36515
  }
36491
36516
  onUpdate(end, ratio, out) {
36492
36517
  var _a;
@@ -36903,7 +36928,7 @@
36903
36928
  from: from,
36904
36929
  to: to
36905
36930
  } = moveIn(this.target, this.params.options, this.params);
36906
- this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
36931
+ this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36907
36932
  }
36908
36933
  }
36909
36934
  class MoveOut extends MoveBase {
@@ -36962,7 +36987,7 @@
36962
36987
  from: from,
36963
36988
  to: to
36964
36989
  } = rotateIn(this.target, this.params.options);
36965
- this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
36990
+ this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to, null === (_b = (_a = this.target).applyFinalAttributeToAttribute) || void 0 === _b || _b.call(_a), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && applyAppearStartAttributes(this.target, from);
36966
36991
  }
36967
36992
  }
36968
36993
  class RotateOut extends RotateBase {
@@ -36978,8 +37003,8 @@
36978
37003
 
36979
37004
  class MotionPath extends ACustomAnimate {
36980
37005
  constructor(from, to, duration, easing, params) {
36981
- var _a;
36982
- super(from, to, duration, easing, params), params && (this.pathLength = params.path.getLength(), this.path = params.path, this.distance = params.distance, this.totalLength = this.distance * this.pathLength, this.initAngle = null !== (_a = params.initAngle) && void 0 !== _a ? _a : 0, this.changeAngle = !!params.changeAngle, this.cb = params.cb);
37006
+ var _a, _b, _c;
37007
+ super(from, to, duration, easing, params), params && (this.pathLength = params.path.getLength(), this.path = params.path, this.distance = params.distance, this.totalLength = this.distance * this.pathLength, this.initAngle = null !== (_a = params.initAngle) && void 0 !== _a ? _a : 0, this.changeAngle = !!params.changeAngle, this.commitOnEnd = null === (_c = null !== (_b = params.commitOnEnd) && void 0 !== _b ? _b : params.saveOnEnd) || void 0 === _c || _c, this.cb = params.cb);
36983
37008
  }
36984
37009
  onBind() {
36985
37010
  this.from = {
@@ -36994,7 +37019,7 @@
36994
37019
  pos: pos,
36995
37020
  angle: angle
36996
37021
  } = this.path.getAttrAt(at);
36997
- attrs.x = pos.x, attrs.y = pos.y, this.changeAngle && (attrs.angle = angle + this.initAngle), this.cb && this.cb(this.from, this.to, ratio, this.target), this.target.setAttributes(attrs);
37022
+ attrs.x = pos.x, attrs.y = pos.y, this.changeAngle && (attrs.angle = angle + this.initAngle), this.cb && this.cb(this.from, this.to, ratio, this.target), end && this.commitOnEnd ? this.target.setAttributes(attrs) : applyAnimationTransientAttributes(this.target, attrs);
36998
37023
  }
36999
37024
  }
37000
37025
 
@@ -54292,7 +54317,7 @@
54292
54317
  return resolveLegacyApp().createStage(params);
54293
54318
  }
54294
54319
 
54295
- const version = "1.1.0-alpha.2";
54320
+ const version = "1.1.0-alpha.4";
54296
54321
 
54297
54322
  exports.AComponentAnimate = AComponentAnimate;
54298
54323
  exports.ACustomAnimate = ACustomAnimate;