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

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;
@@ -33854,7 +33867,9 @@
33854
33867
  const parts = formattedNumber.toString().split(".");
33855
33868
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), formattedWithBasicFormat = parts.join(".");
33856
33869
  } else formattedWithBasicFormat = formattedNumber;
33857
- formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat, this.target.setAttribute("text", formattedText);
33870
+ formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat, applyAnimationTransientAttributes(this.target, {
33871
+ text: formattedText
33872
+ });
33858
33873
  }
33859
33874
  }
33860
33875
 
@@ -33961,7 +33976,7 @@
33961
33976
  onUpdate(end, ratio, out) {
33962
33977
  const target = this.target,
33963
33978
  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);
33979
+ 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
33980
  }
33966
33981
  }
33967
33982
  const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
@@ -34192,7 +34207,9 @@
34192
34207
  const blinkRate = .1;
34193
34208
  Math.floor(ratio / blinkRate) % 2 == 0 && (displayText = this.beforeText + currentText + this.cursorChar + this.afterText);
34194
34209
  } else displayText = this.beforeText + currentText + this.cursorChar + this.afterText;
34195
- this.target.setAttribute("text", displayText);
34210
+ applyAnimationTransientAttributes(this.target, {
34211
+ text: displayText
34212
+ });
34196
34213
  }
34197
34214
  }
34198
34215
 
@@ -34201,11 +34218,9 @@
34201
34218
  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
34219
  }
34203
34220
  onBind() {
34204
- super.onBind(), this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, this._group.setAttributes({
34221
+ super.onBind(), this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, applyAppearStartAttributes(this._group, {
34205
34222
  clip: !0,
34206
34223
  path: [this._clipGraphic]
34207
- }, !1, {
34208
- type: exports.AttributeUpdateType.ANIMATE_BIND
34209
34224
  }));
34210
34225
  }
34211
34226
  onEnd() {
@@ -34418,7 +34433,7 @@
34418
34433
  return newPoint.context = point.context, newPoint;
34419
34434
  }), this.clipRange) {
34420
34435
  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({
34436
+ applyAnimationTransientAttributes(this.target, {
34422
34437
  clipRange: this.clipRange + (1 - this.clipRange) * ratio
34423
34438
  });
34424
34439
  }
@@ -34451,7 +34466,7 @@
34451
34466
  this.keys.forEach(key => {
34452
34467
  var _a, _b, _c;
34453
34468
  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);
34469
+ }), 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
34470
  }
34456
34471
  onUpdate(end, ratio, out) {
34457
34472
  const attribute = this.target.attribute;
@@ -34705,7 +34720,7 @@
34705
34720
  to: to
34706
34721
  } = growAngleIn(this.target, this.params.options, this.params),
34707
34722
  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();
34723
+ 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
34724
  }
34710
34725
  }
34711
34726
  class GrowAngleOut extends GrowAngleBase {
@@ -34855,7 +34870,7 @@
34855
34870
  to: to
34856
34871
  } = growCenterIn(this.target, this.params.options, this.params),
34857
34872
  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);
34873
+ 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
34874
  }
34860
34875
  onEnd(cb) {
34861
34876
  super.onEnd(cb);
@@ -34960,7 +34975,7 @@
34960
34975
  to: to
34961
34976
  } = growHeightIn(this.target, this.params.options, this.params),
34962
34977
  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);
34978
+ 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
34979
  }
34965
34980
  onEnd(cb) {
34966
34981
  super.onEnd(cb);
@@ -35074,7 +35089,7 @@
35074
35089
  from: from,
35075
35090
  to: to
35076
35091
  } = 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);
35092
+ 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
35093
  } else this.valid = !1;
35079
35094
  }
35080
35095
  }
@@ -35136,7 +35151,7 @@
35136
35151
  from: from,
35137
35152
  to: to
35138
35153
  } = 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);
35154
+ 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
35155
  } else this.valid = !1;
35141
35156
  }
35142
35157
  }
@@ -35198,7 +35213,7 @@
35198
35213
  from: from,
35199
35214
  to: to
35200
35215
  } = 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);
35216
+ 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
35217
  } else this.valid = !1;
35203
35218
  }
35204
35219
  }
@@ -35310,7 +35325,7 @@
35310
35325
  to: to
35311
35326
  } = growRadiusIn(this.target, this.params.options, this.params),
35312
35327
  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);
35328
+ 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
35329
  }
35315
35330
  }
35316
35331
  class GrowRadiusOut extends GrowPointsBase {
@@ -35432,7 +35447,7 @@
35432
35447
  to: to
35433
35448
  } = growWidthIn(this.target, this.params.options, this.params),
35434
35449
  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);
35450
+ 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
35451
  }
35437
35452
  onEnd(cb) {
35438
35453
  super.onEnd(cb);
@@ -35483,7 +35498,7 @@
35483
35498
  } = this.params,
35484
35499
  symbolTime = duration / 10;
35485
35500
  let symbolStartOuterFrom, symbolStartOuterTo;
35486
- if (target._symbolStart.setAttributes({
35501
+ if (applyAppearStartAttributes(target._symbolStart, {
35487
35502
  scaleX: 0,
35488
35503
  scaleY: 0
35489
35504
  }), animator.animate(target._symbolStart, {
@@ -35504,12 +35519,12 @@
35504
35519
  clipRange: 0
35505
35520
  }, symbolStartOuterTo = {
35506
35521
  clipRange: 1
35507
- }), target._symbolStartOuter.setAttributes(symbolStartOuterFrom), animator.animate(target._symbolStartOuter, {
35522
+ }), applyAppearStartAttributes(target._symbolStartOuter, symbolStartOuterFrom), animator.animate(target._symbolStartOuter, {
35508
35523
  type: "to",
35509
35524
  to: symbolStartOuterTo,
35510
35525
  duration: 5 * symbolTime,
35511
35526
  easing: easing
35512
- }), target._symbolEnd.setAttributes({
35527
+ }), applyAppearStartAttributes(target._symbolEnd, {
35513
35528
  scaleX: 0,
35514
35529
  scaleY: 0
35515
35530
  }), animator.animate(target._symbolEnd, {
@@ -35521,7 +35536,7 @@
35521
35536
  duration: 2 * symbolTime,
35522
35537
  delay: 8 * symbolTime,
35523
35538
  easing: easing
35524
- }), target._line.setAttributes({
35539
+ }), applyAppearStartAttributes(target._line, {
35525
35540
  clipRange: 0
35526
35541
  }), animator.animate(target._line, {
35527
35542
  type: "to",
@@ -35532,7 +35547,7 @@
35532
35547
  easing: easing
35533
35548
  }), "typewriter" === titleType) {
35534
35549
  const titleTopText = target._titleTop.attribute.text;
35535
- target._titleTop.setAttributes({
35550
+ applyAppearStartAttributes(target._titleTop, {
35536
35551
  text: ""
35537
35552
  }), animator.animate(target._titleTop, {
35538
35553
  type: "custom",
@@ -35545,7 +35560,7 @@
35545
35560
  custom: InputText
35546
35561
  });
35547
35562
  const titleBottomText = target._titleBottom.attribute.text;
35548
- target._titleBottom.setAttributes({
35563
+ applyAppearStartAttributes(target._titleBottom, {
35549
35564
  text: ""
35550
35565
  }), animator.animate(target._titleBottom, {
35551
35566
  type: "custom",
@@ -35557,7 +35572,7 @@
35557
35572
  },
35558
35573
  custom: InputText
35559
35574
  });
35560
- } else target._titleTop.setAttributes({
35575
+ } else applyAppearStartAttributes(target._titleTop, {
35561
35576
  dy: target._titleTop.AABBBounds.height() + 10
35562
35577
  }), animator.animate(target._titleTop, {
35563
35578
  type: "to",
@@ -35567,7 +35582,7 @@
35567
35582
  delay: 5 * symbolTime,
35568
35583
  duration: 4 * symbolTime,
35569
35584
  easing: "linear"
35570
- }), target._titleBottom.setAttributes({
35585
+ }), applyAppearStartAttributes(target._titleBottom, {
35571
35586
  dy: -(10 + target._titleBottom.AABBBounds.height())
35572
35587
  }), animator.animate(target._titleBottom, {
35573
35588
  type: "to",
@@ -35581,7 +35596,7 @@
35581
35596
  "scale" === titlePanelType ? [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {
35582
35597
  var _a;
35583
35598
  const scaleX = null !== (_a = panel.attribute.scaleX) && void 0 !== _a ? _a : 1;
35584
- panel.setAttributes({
35599
+ applyAppearStartAttributes(panel, {
35585
35600
  scaleX: 0
35586
35601
  }), animator.animate(panel, {
35587
35602
  type: "to",
@@ -35594,7 +35609,7 @@
35594
35609
  }) : "stroke" === titlePanelType && [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {
35595
35610
  const b = panel.AABBBounds,
35596
35611
  totalLen = 2 * (b.width() + b.height());
35597
- panel.setAttributes({
35612
+ applyAppearStartAttributes(panel, {
35598
35613
  lineDash: [0, 10 * totalLen]
35599
35614
  }), animator.animate(panel, {
35600
35615
  type: "to",
@@ -35701,7 +35716,7 @@
35701
35716
  {
35702
35717
  wave: wave
35703
35718
  } = this.params;
35704
- if (target.setAttributes({
35719
+ if (applyAppearStartAttributes(target, {
35705
35720
  scaleX: 0,
35706
35721
  scaleY: 0
35707
35722
  }), animator.animate(target, {
@@ -35854,7 +35869,9 @@
35854
35869
  }
35855
35870
  }
35856
35871
  }
35857
- this.target.setAttribute("textConfig", currentTextConfig);
35872
+ applyAnimationTransientAttributes(this.target, {
35873
+ textConfig: currentTextConfig
35874
+ });
35858
35875
  }
35859
35876
  }
35860
35877
 
@@ -35881,18 +35898,21 @@
35881
35898
  displayedLength = Math.round(fromItems * (1 - adjustedRatio));
35882
35899
  } else displayedLength = Math.round(fromItems * (1 - ratio));
35883
35900
  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);
35901
+ this.fadeOutChars && (currentTextConfig = this.applyFadeEffect(currentTextConfig, ratio, fromItems, displayedLength)), this.showCursor && displayedLength > 0 && (currentTextConfig = this.addCursor(currentTextConfig, ratio)), applyAnimationTransientAttributes(this.target, {
35902
+ textConfig: currentTextConfig
35903
+ });
35885
35904
  } else {
35886
35905
  if (this.fadeOutChars) {
35887
35906
  const adjustedRatio = Math.min(1, ratio / maxTextHideRatio);
35888
35907
  displayedLength = Math.round(fromItems * (1 - adjustedRatio));
35889
35908
  } else displayedLength = Math.round(fromItems * (1 - ratio));
35890
35909
  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);
35910
+ this.fadeOutChars && (currentTextConfig = this.applyFadeEffect(currentTextConfig, ratio, fromItems, displayedLength)), this.showCursor && displayedLength > 0 && (currentTextConfig = this.addCursor(currentTextConfig, ratio)), applyAnimationTransientAttributes(this.target, {
35911
+ textConfig: currentTextConfig
35912
+ });
35892
35913
  }
35893
35914
  }
35894
35915
  applyFadeEffect(textConfig, ratio, totalItems, displayedLength) {
35895
- "forward" === this.direction ? totalItems - displayedLength : displayedLength;
35896
35916
  const fadeProgress = (ratio - (1 - this.fadeOutDuration)) / this.fadeOutDuration,
35897
35917
  fadeOpacity = Math.max(0, 1 - Math.min(1, fadeProgress));
35898
35918
  return textConfig.map((item, index) => {
@@ -35994,7 +36014,9 @@
35994
36014
  if (!this.valid) return;
35995
36015
  const maxTextShowRatio = 1 - this.fadeInDuration;
35996
36016
  let updatedTextConfig;
35997
- updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), this.target.setAttribute("textConfig", updatedTextConfig);
36017
+ updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), applyAnimationTransientAttributes(this.target, {
36018
+ textConfig: updatedTextConfig
36019
+ });
35998
36020
  }
35999
36021
  updateByWord(ratio, maxTextShowRatio) {
36000
36022
  const totalGroups = this.wordGroups.length,
@@ -36123,7 +36145,9 @@
36123
36145
  if (!this.valid) return;
36124
36146
  const maxTextShowRatio = 1 - this.fadeOutDuration;
36125
36147
  let updatedTextConfig;
36126
- updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), this.target.setAttribute("textConfig", updatedTextConfig);
36148
+ updatedTextConfig = this.wordByWord && this.wordGroups.length > 0 ? this.updateByWord(ratio, maxTextShowRatio) : this.updateByCharacter(ratio, maxTextShowRatio), applyAnimationTransientAttributes(this.target, {
36149
+ textConfig: updatedTextConfig
36150
+ });
36127
36151
  }
36128
36152
  updateByWord(ratio, maxTextShowRatio) {
36129
36153
  const totalGroups = this.wordGroups.length,
@@ -36222,7 +36246,7 @@
36222
36246
  scaleY: null !== (_k = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _k ? _k : 1
36223
36247
  }, this._updateFunction = this.updateXY;
36224
36248
  }
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);
36249
+ 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
36250
  }
36227
36251
  onEnd(cb) {
36228
36252
  super.onEnd(cb);
@@ -36325,7 +36349,7 @@
36325
36349
  opacity: 1,
36326
36350
  baseOpacity: 1
36327
36351
  };
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);
36352
+ "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
36353
  }
36330
36354
  onUpdate(end, ratio, out) {
36331
36355
  const attribute = this.target.attribute;
@@ -36353,7 +36377,7 @@
36353
36377
  opacity: 1,
36354
36378
  baseOpacity: 1
36355
36379
  };
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);
36380
+ 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
36381
  }
36358
36382
  onUpdate(end, ratio, out) {
36359
36383
  const attribute = this.target.attribute;
@@ -36387,7 +36411,7 @@
36387
36411
  scaleX: null !== (_h = attrs.scaleX) && void 0 !== _h ? _h : 1,
36388
36412
  scaleY: null !== (_j = attrs.scaleY) && void 0 !== _j ? _j : 1
36389
36413
  };
36390
- this.propKeys = ["opacity", "baseOpacity", "angle", "scaleX", "scaleY"], this.from = from, this.to = to, this.props = to, this.target.setAttributes(from);
36414
+ this.propKeys = ["opacity", "baseOpacity", "angle", "scaleX", "scaleY"], this.from = from, this.to = to, this.props = to, applyAppearStartAttributes(this.target, from);
36391
36415
  }
36392
36416
  onUpdate(end, ratio, out) {
36393
36417
  const attribute = this.target.attribute;
@@ -36434,7 +36458,7 @@
36434
36458
  lineWidth: lineWidth,
36435
36459
  stroke: strokeColor,
36436
36460
  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);
36461
+ }, 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
36462
  }
36439
36463
  onUpdate(end, ratio, out) {
36440
36464
  var _a;
@@ -36486,7 +36510,7 @@
36486
36510
  lineWidth: lineWidth,
36487
36511
  stroke: strokeColor,
36488
36512
  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);
36513
+ }, 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
36514
  }
36491
36515
  onUpdate(end, ratio, out) {
36492
36516
  var _a;
@@ -36903,7 +36927,7 @@
36903
36927
  from: from,
36904
36928
  to: to
36905
36929
  } = 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);
36930
+ 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
36931
  }
36908
36932
  }
36909
36933
  class MoveOut extends MoveBase {
@@ -36962,7 +36986,7 @@
36962
36986
  from: from,
36963
36987
  to: to
36964
36988
  } = 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);
36989
+ 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
36990
  }
36967
36991
  }
36968
36992
  class RotateOut extends RotateBase {
@@ -36978,8 +37002,8 @@
36978
37002
 
36979
37003
  class MotionPath extends ACustomAnimate {
36980
37004
  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);
37005
+ var _a, _b, _c;
37006
+ 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
37007
  }
36984
37008
  onBind() {
36985
37009
  this.from = {
@@ -36994,7 +37018,7 @@
36994
37018
  pos: pos,
36995
37019
  angle: angle
36996
37020
  } = 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);
37021
+ 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
37022
  }
36999
37023
  }
37000
37024
 
@@ -54292,7 +54316,7 @@
54292
54316
  return resolveLegacyApp().createStage(params);
54293
54317
  }
54294
54318
 
54295
- const version = "1.1.0-alpha.2";
54319
+ const version = "1.1.0-alpha.3";
54296
54320
 
54297
54321
  exports.AComponentAnimate = AComponentAnimate;
54298
54322
  exports.ACustomAnimate = ACustomAnimate;