@visactor/vrender 1.1.0-alpha.1 → 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
@@ -8987,11 +8987,13 @@
8987
8987
  stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
8988
8988
  };
8989
8989
  }
8990
- const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions;
8990
+ const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions,
8991
+ sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none",
8992
+ sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
8991
8993
  if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
8992
8994
  compiledDefinitions: sharedCompiledDefinitions,
8993
- stateProxyModeKey: this.stateProxy ? "shared-disabled" : "none",
8994
- stateProxyEligibility: this.stateProxy ? () => !1 : void 0
8995
+ stateProxyModeKey: sharedStateProxyModeKey,
8996
+ stateProxyEligibility: sharedStateProxyEligibility
8995
8997
  };
8996
8998
  const localStates = this.states,
8997
8999
  missingLocalStateDefinitions = {},
@@ -9000,8 +9002,8 @@
9000
9002
  sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName], missingStateNames.push(stateName));
9001
9003
  }), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0, {
9002
9004
  compiledDefinitions: sharedCompiledDefinitions,
9003
- stateProxyModeKey: this.stateProxy ? "shared-disabled" : "none",
9004
- stateProxyEligibility: this.stateProxy ? () => !1 : void 0
9005
+ stateProxyModeKey: sharedStateProxyModeKey,
9006
+ stateProxyEligibility: sharedStateProxyEligibility
9005
9007
  };
9006
9008
  const localStatesVersion = this.getLocalStatesVersion(),
9007
9009
  stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none",
@@ -9009,7 +9011,7 @@
9009
9011
  return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = new StateDefinitionCompiler().compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)), this.compiledStateDefinitionsCacheKey = cacheKey), {
9010
9012
  compiledDefinitions: this.localFallbackCompiledDefinitions,
9011
9013
  stateProxyModeKey: stateProxyModeKey,
9012
- stateProxyEligibility: this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0
9014
+ stateProxyEligibility: sharedStateProxyEligibility
9013
9015
  };
9014
9016
  }
9015
9017
  recomputeCurrentStatePatch() {
@@ -32341,6 +32343,19 @@
32341
32343
  return !1;
32342
32344
  }
32343
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
+
32344
32359
  function noop() {}
32345
32360
  class Step {
32346
32361
  constructor(type, props, duration, easing) {
@@ -32466,7 +32481,7 @@
32466
32481
  onStart() {
32467
32482
  super.onStart();
32468
32483
  const fromProps = this.getFromProps();
32469
- this.target.setAttributes(fromProps);
32484
+ applyAnimationTransientAttributes(this.target, fromProps, exports.AttributeUpdateType.ANIMATE_START);
32470
32485
  }
32471
32486
  update(end, ratio, out) {
32472
32487
  this.onStart();
@@ -32828,7 +32843,7 @@
32828
32843
  const currentLoop = Math.floor((nextTime - this._startTime) / this._duration);
32829
32844
  newLoop = currentLoop > this._currentLoop, this._currentLoop = currentLoop, bounceTime = this._bounce && currentLoop % 2 == 1, bounceTime && (cycleTime = this._duration - cycleTime);
32830
32845
  }
32831
- newLoop && !bounceTime && this.target.setAttributes(this._startProps);
32846
+ newLoop && !bounceTime && applyAnimationTransientAttributes(this.target, this._startProps, exports.AttributeUpdateType.ANIMATE_START);
32832
32847
  let targetStep = null;
32833
32848
  if (this._lastStep === this._firstStep) targetStep = this._firstStep;else {
32834
32849
  let currentStep = this._firstStep;
@@ -33852,7 +33867,9 @@
33852
33867
  const parts = formattedNumber.toString().split(".");
33853
33868
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), formattedWithBasicFormat = parts.join(".");
33854
33869
  } else formattedWithBasicFormat = formattedNumber;
33855
- 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
+ });
33856
33873
  }
33857
33874
  }
33858
33875
 
@@ -33959,7 +33976,7 @@
33959
33976
  onUpdate(end, ratio, out) {
33960
33977
  const target = this.target,
33961
33978
  pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
33962
- 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);
33963
33980
  }
33964
33981
  }
33965
33982
  const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
@@ -34190,7 +34207,9 @@
34190
34207
  const blinkRate = .1;
34191
34208
  Math.floor(ratio / blinkRate) % 2 == 0 && (displayText = this.beforeText + currentText + this.cursorChar + this.afterText);
34192
34209
  } else displayText = this.beforeText + currentText + this.cursorChar + this.afterText;
34193
- this.target.setAttribute("text", displayText);
34210
+ applyAnimationTransientAttributes(this.target, {
34211
+ text: displayText
34212
+ });
34194
34213
  }
34195
34214
  }
34196
34215
 
@@ -34199,11 +34218,9 @@
34199
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;
34200
34219
  }
34201
34220
  onBind() {
34202
- 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, {
34203
34222
  clip: !0,
34204
34223
  path: [this._clipGraphic]
34205
- }, !1, {
34206
- type: exports.AttributeUpdateType.ANIMATE_BIND
34207
34224
  }));
34208
34225
  }
34209
34226
  onEnd() {
@@ -34416,7 +34433,7 @@
34416
34433
  return newPoint.context = point.context, newPoint;
34417
34434
  }), this.clipRange) {
34418
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));
34419
- this.target.setAttributes({
34436
+ applyAnimationTransientAttributes(this.target, {
34420
34437
  clipRange: this.clipRange + (1 - this.clipRange) * ratio
34421
34438
  });
34422
34439
  }
@@ -34449,7 +34466,7 @@
34449
34466
  this.keys.forEach(key => {
34450
34467
  var _a, _b, _c;
34451
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;
34452
- }), 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);
34453
34470
  }
34454
34471
  onUpdate(end, ratio, out) {
34455
34472
  const attribute = this.target.attribute;
@@ -34703,7 +34720,7 @@
34703
34720
  to: to
34704
34721
  } = growAngleIn(this.target, this.params.options, this.params),
34705
34722
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34706
- 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();
34707
34724
  }
34708
34725
  }
34709
34726
  class GrowAngleOut extends GrowAngleBase {
@@ -34853,7 +34870,7 @@
34853
34870
  to: to
34854
34871
  } = growCenterIn(this.target, this.params.options, this.params),
34855
34872
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34856
- 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);
34857
34874
  }
34858
34875
  onEnd(cb) {
34859
34876
  super.onEnd(cb);
@@ -34958,7 +34975,7 @@
34958
34975
  to: to
34959
34976
  } = growHeightIn(this.target, this.params.options, this.params),
34960
34977
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34961
- 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);
34962
34979
  }
34963
34980
  onEnd(cb) {
34964
34981
  super.onEnd(cb);
@@ -35072,7 +35089,7 @@
35072
35089
  from: from,
35073
35090
  to: to
35074
35091
  } = growPointsIn(this.target, this.params.options, this.params);
35075
- 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);
35076
35093
  } else this.valid = !1;
35077
35094
  }
35078
35095
  }
@@ -35134,7 +35151,7 @@
35134
35151
  from: from,
35135
35152
  to: to
35136
35153
  } = growPointsXIn(this.target, this.params.options, this.params);
35137
- 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);
35138
35155
  } else this.valid = !1;
35139
35156
  }
35140
35157
  }
@@ -35196,7 +35213,7 @@
35196
35213
  from: from,
35197
35214
  to: to
35198
35215
  } = growPointsYIn(this.target, this.params.options, this.params);
35199
- 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);
35200
35217
  } else this.valid = !1;
35201
35218
  }
35202
35219
  }
@@ -35308,7 +35325,7 @@
35308
35325
  to: to
35309
35326
  } = growRadiusIn(this.target, this.params.options, this.params),
35310
35327
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
35311
- 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);
35312
35329
  }
35313
35330
  }
35314
35331
  class GrowRadiusOut extends GrowPointsBase {
@@ -35430,7 +35447,7 @@
35430
35447
  to: to
35431
35448
  } = growWidthIn(this.target, this.params.options, this.params),
35432
35449
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
35433
- 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);
35434
35451
  }
35435
35452
  onEnd(cb) {
35436
35453
  super.onEnd(cb);
@@ -35481,7 +35498,7 @@
35481
35498
  } = this.params,
35482
35499
  symbolTime = duration / 10;
35483
35500
  let symbolStartOuterFrom, symbolStartOuterTo;
35484
- if (target._symbolStart.setAttributes({
35501
+ if (applyAppearStartAttributes(target._symbolStart, {
35485
35502
  scaleX: 0,
35486
35503
  scaleY: 0
35487
35504
  }), animator.animate(target._symbolStart, {
@@ -35502,12 +35519,12 @@
35502
35519
  clipRange: 0
35503
35520
  }, symbolStartOuterTo = {
35504
35521
  clipRange: 1
35505
- }), target._symbolStartOuter.setAttributes(symbolStartOuterFrom), animator.animate(target._symbolStartOuter, {
35522
+ }), applyAppearStartAttributes(target._symbolStartOuter, symbolStartOuterFrom), animator.animate(target._symbolStartOuter, {
35506
35523
  type: "to",
35507
35524
  to: symbolStartOuterTo,
35508
35525
  duration: 5 * symbolTime,
35509
35526
  easing: easing
35510
- }), target._symbolEnd.setAttributes({
35527
+ }), applyAppearStartAttributes(target._symbolEnd, {
35511
35528
  scaleX: 0,
35512
35529
  scaleY: 0
35513
35530
  }), animator.animate(target._symbolEnd, {
@@ -35519,7 +35536,7 @@
35519
35536
  duration: 2 * symbolTime,
35520
35537
  delay: 8 * symbolTime,
35521
35538
  easing: easing
35522
- }), target._line.setAttributes({
35539
+ }), applyAppearStartAttributes(target._line, {
35523
35540
  clipRange: 0
35524
35541
  }), animator.animate(target._line, {
35525
35542
  type: "to",
@@ -35530,7 +35547,7 @@
35530
35547
  easing: easing
35531
35548
  }), "typewriter" === titleType) {
35532
35549
  const titleTopText = target._titleTop.attribute.text;
35533
- target._titleTop.setAttributes({
35550
+ applyAppearStartAttributes(target._titleTop, {
35534
35551
  text: ""
35535
35552
  }), animator.animate(target._titleTop, {
35536
35553
  type: "custom",
@@ -35543,7 +35560,7 @@
35543
35560
  custom: InputText
35544
35561
  });
35545
35562
  const titleBottomText = target._titleBottom.attribute.text;
35546
- target._titleBottom.setAttributes({
35563
+ applyAppearStartAttributes(target._titleBottom, {
35547
35564
  text: ""
35548
35565
  }), animator.animate(target._titleBottom, {
35549
35566
  type: "custom",
@@ -35555,7 +35572,7 @@
35555
35572
  },
35556
35573
  custom: InputText
35557
35574
  });
35558
- } else target._titleTop.setAttributes({
35575
+ } else applyAppearStartAttributes(target._titleTop, {
35559
35576
  dy: target._titleTop.AABBBounds.height() + 10
35560
35577
  }), animator.animate(target._titleTop, {
35561
35578
  type: "to",
@@ -35565,7 +35582,7 @@
35565
35582
  delay: 5 * symbolTime,
35566
35583
  duration: 4 * symbolTime,
35567
35584
  easing: "linear"
35568
- }), target._titleBottom.setAttributes({
35585
+ }), applyAppearStartAttributes(target._titleBottom, {
35569
35586
  dy: -(10 + target._titleBottom.AABBBounds.height())
35570
35587
  }), animator.animate(target._titleBottom, {
35571
35588
  type: "to",
@@ -35579,7 +35596,7 @@
35579
35596
  "scale" === titlePanelType ? [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {
35580
35597
  var _a;
35581
35598
  const scaleX = null !== (_a = panel.attribute.scaleX) && void 0 !== _a ? _a : 1;
35582
- panel.setAttributes({
35599
+ applyAppearStartAttributes(panel, {
35583
35600
  scaleX: 0
35584
35601
  }), animator.animate(panel, {
35585
35602
  type: "to",
@@ -35592,7 +35609,7 @@
35592
35609
  }) : "stroke" === titlePanelType && [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {
35593
35610
  const b = panel.AABBBounds,
35594
35611
  totalLen = 2 * (b.width() + b.height());
35595
- panel.setAttributes({
35612
+ applyAppearStartAttributes(panel, {
35596
35613
  lineDash: [0, 10 * totalLen]
35597
35614
  }), animator.animate(panel, {
35598
35615
  type: "to",
@@ -35699,7 +35716,7 @@
35699
35716
  {
35700
35717
  wave: wave
35701
35718
  } = this.params;
35702
- if (target.setAttributes({
35719
+ if (applyAppearStartAttributes(target, {
35703
35720
  scaleX: 0,
35704
35721
  scaleY: 0
35705
35722
  }), animator.animate(target, {
@@ -35852,7 +35869,9 @@
35852
35869
  }
35853
35870
  }
35854
35871
  }
35855
- this.target.setAttribute("textConfig", currentTextConfig);
35872
+ applyAnimationTransientAttributes(this.target, {
35873
+ textConfig: currentTextConfig
35874
+ });
35856
35875
  }
35857
35876
  }
35858
35877
 
@@ -35879,18 +35898,21 @@
35879
35898
  displayedLength = Math.round(fromItems * (1 - adjustedRatio));
35880
35899
  } else displayedLength = Math.round(fromItems * (1 - ratio));
35881
35900
  let currentTextConfig = "forward" === this.direction ? this.fromTextConfig.slice(fromItems - displayedLength) : this.fromTextConfig.slice(0, displayedLength);
35882
- 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
+ });
35883
35904
  } else {
35884
35905
  if (this.fadeOutChars) {
35885
35906
  const adjustedRatio = Math.min(1, ratio / maxTextHideRatio);
35886
35907
  displayedLength = Math.round(fromItems * (1 - adjustedRatio));
35887
35908
  } else displayedLength = Math.round(fromItems * (1 - ratio));
35888
35909
  let currentTextConfig = this.fromTextConfig.slice(0, displayedLength);
35889
- 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
+ });
35890
35913
  }
35891
35914
  }
35892
35915
  applyFadeEffect(textConfig, ratio, totalItems, displayedLength) {
35893
- "forward" === this.direction ? totalItems - displayedLength : displayedLength;
35894
35916
  const fadeProgress = (ratio - (1 - this.fadeOutDuration)) / this.fadeOutDuration,
35895
35917
  fadeOpacity = Math.max(0, 1 - Math.min(1, fadeProgress));
35896
35918
  return textConfig.map((item, index) => {
@@ -35992,7 +36014,9 @@
35992
36014
  if (!this.valid) return;
35993
36015
  const maxTextShowRatio = 1 - this.fadeInDuration;
35994
36016
  let updatedTextConfig;
35995
- 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
+ });
35996
36020
  }
35997
36021
  updateByWord(ratio, maxTextShowRatio) {
35998
36022
  const totalGroups = this.wordGroups.length,
@@ -36121,7 +36145,9 @@
36121
36145
  if (!this.valid) return;
36122
36146
  const maxTextShowRatio = 1 - this.fadeOutDuration;
36123
36147
  let updatedTextConfig;
36124
- 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
+ });
36125
36151
  }
36126
36152
  updateByWord(ratio, maxTextShowRatio) {
36127
36153
  const totalGroups = this.wordGroups.length,
@@ -36220,7 +36246,7 @@
36220
36246
  scaleY: null !== (_k = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _k ? _k : 1
36221
36247
  }, this._updateFunction = this.updateXY;
36222
36248
  }
36223
- 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);
36224
36250
  }
36225
36251
  onEnd(cb) {
36226
36252
  super.onEnd(cb);
@@ -36323,7 +36349,7 @@
36323
36349
  opacity: 1,
36324
36350
  baseOpacity: 1
36325
36351
  };
36326
- "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);
36327
36353
  }
36328
36354
  onUpdate(end, ratio, out) {
36329
36355
  const attribute = this.target.attribute;
@@ -36351,7 +36377,7 @@
36351
36377
  opacity: 1,
36352
36378
  baseOpacity: 1
36353
36379
  };
36354
- 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);
36355
36381
  }
36356
36382
  onUpdate(end, ratio, out) {
36357
36383
  const attribute = this.target.attribute;
@@ -36385,7 +36411,7 @@
36385
36411
  scaleX: null !== (_h = attrs.scaleX) && void 0 !== _h ? _h : 1,
36386
36412
  scaleY: null !== (_j = attrs.scaleY) && void 0 !== _j ? _j : 1
36387
36413
  };
36388
- 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);
36389
36415
  }
36390
36416
  onUpdate(end, ratio, out) {
36391
36417
  const attribute = this.target.attribute;
@@ -36432,7 +36458,7 @@
36432
36458
  lineWidth: lineWidth,
36433
36459
  stroke: strokeColor,
36434
36460
  strokeOpacity: fromOpacity
36435
- }, 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);
36436
36462
  }
36437
36463
  onUpdate(end, ratio, out) {
36438
36464
  var _a;
@@ -36484,7 +36510,7 @@
36484
36510
  lineWidth: lineWidth,
36485
36511
  stroke: strokeColor,
36486
36512
  strokeOpacity: fromOpacity
36487
- }, 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);
36488
36514
  }
36489
36515
  onUpdate(end, ratio, out) {
36490
36516
  var _a;
@@ -36901,7 +36927,7 @@
36901
36927
  from: from,
36902
36928
  to: to
36903
36929
  } = moveIn(this.target, this.params.options, this.params);
36904
- 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);
36905
36931
  }
36906
36932
  }
36907
36933
  class MoveOut extends MoveBase {
@@ -36960,7 +36986,7 @@
36960
36986
  from: from,
36961
36987
  to: to
36962
36988
  } = rotateIn(this.target, this.params.options);
36963
- 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);
36964
36990
  }
36965
36991
  }
36966
36992
  class RotateOut extends RotateBase {
@@ -36976,8 +37002,8 @@
36976
37002
 
36977
37003
  class MotionPath extends ACustomAnimate {
36978
37004
  constructor(from, to, duration, easing, params) {
36979
- var _a;
36980
- 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);
36981
37007
  }
36982
37008
  onBind() {
36983
37009
  this.from = {
@@ -36992,7 +37018,7 @@
36992
37018
  pos: pos,
36993
37019
  angle: angle
36994
37020
  } = this.path.getAttrAt(at);
36995
- 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);
36996
37022
  }
36997
37023
  }
36998
37024
 
@@ -54290,7 +54316,7 @@
54290
54316
  return resolveLegacyApp().createStage(params);
54291
54317
  }
54292
54318
 
54293
- const version = "1.1.0-alpha.1";
54319
+ const version = "1.1.0-alpha.3";
54294
54320
 
54295
54321
  exports.AComponentAnimate = AComponentAnimate;
54296
54322
  exports.ACustomAnimate = ACustomAnimate;