@visactor/vrender 1.1.0-alpha.10 → 1.1.0-alpha.12

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
@@ -32432,6 +32432,18 @@
32432
32432
  return !1;
32433
32433
  }
32434
32434
 
32435
+ const animateUpdateContext = {
32436
+ type: exports.AttributeUpdateType.ANIMATE_UPDATE
32437
+ };
32438
+ function applyAnimationFrameAttributes(target, attributes) {
32439
+ var _a;
32440
+ if (!attributes) return;
32441
+ const transientTarget = target;
32442
+ transientTarget.attribute || (transientTarget.attribute = {});
32443
+ const targetAttribute = transientTarget.attribute;
32444
+ for (const key in attributes) Object.prototype.hasOwnProperty.call(attributes, key) && (targetAttribute[key] = attributes[key]);
32445
+ null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, animateUpdateContext);
32446
+ }
32435
32447
  function applyAnimationTransientAttributes(target, attributes, type = exports.AttributeUpdateType.ANIMATE_UPDATE) {
32436
32448
  var _a;
32437
32449
  if (!attributes) return;
@@ -32446,6 +32458,10 @@
32446
32458
  }
32447
32459
 
32448
32460
  function noop() {}
32461
+ function includesKey$1(keys, key) {
32462
+ for (let i = 0; i < keys.length; i++) if (keys[i] === key) return !0;
32463
+ return !1;
32464
+ }
32449
32465
  class Step {
32450
32466
  constructor(type, props, duration, easing) {
32451
32467
  var _a;
@@ -32501,6 +32517,17 @@
32501
32517
  onBind() {
32502
32518
  "glyph" === this.target.type && (this.syncAttributeUpdate = this._syncAttributeUpdate);
32503
32519
  }
32520
+ runInterpolateUpdate(fromProps, toProps, ratio) {
32521
+ if (this.animate.interpolateUpdateFunction) return void this.animate.interpolateUpdateFunction(fromProps, toProps, ratio, this, this.target);
32522
+ const funcs = this.interpolateUpdateFunctions,
32523
+ propKeys = this.propKeys;
32524
+ if (funcs && propKeys) for (let index = 0; index < funcs.length; index++) {
32525
+ const key = propKeys[index],
32526
+ fromValue = fromProps[key],
32527
+ toValue = toProps[key];
32528
+ funcs[index](key, fromValue, toValue, ratio, this, this.target);
32529
+ }
32530
+ }
32504
32531
  onFirstRun() {}
32505
32532
  onStart() {
32506
32533
  if (!this._hasFirstRun) {
@@ -32515,23 +32542,49 @@
32515
32542
  tryPreventConflict() {
32516
32543
  var _a, _b;
32517
32544
  const animate = this.animate,
32518
- target = this.target;
32519
- (null !== (_b = null === (_a = target.forEachTrackedAnimate) || void 0 === _a ? void 0 : _a.bind(target)) && void 0 !== _b ? _b : cb => {
32520
- var _a;
32521
- null === (_a = target.animates) || void 0 === _a || _a.forEach(cb);
32522
- })(a => {
32545
+ target = this.target,
32546
+ forEachTrackedAnimate = null !== (_b = null === (_a = target.forEachTrackedAnimate) || void 0 === _a ? void 0 : _a.bind(target)) && void 0 !== _b ? _b : cb => {
32547
+ var _a;
32548
+ null === (_a = target.animates) || void 0 === _a || _a.forEach(cb);
32549
+ },
32550
+ propKeys = this.propKeys;
32551
+ forEachTrackedAnimate(a => {
32523
32552
  if (a === animate || a.priority > animate.priority || a.priority === 1 / 0) return;
32524
32553
  const fromProps = a.getStartProps();
32525
- this.propKeys.forEach(key => {
32526
- null != fromProps[key] && a.preventAttr(key);
32527
- });
32554
+ let conflictKeys = null;
32555
+ for (let i = 0; i < propKeys.length; i++) {
32556
+ const key = propKeys[i];
32557
+ null != fromProps[key] && (null != conflictKeys ? conflictKeys : conflictKeys = []).push(key);
32558
+ }
32559
+ conflictKeys && a.preventAttrs(conflictKeys);
32528
32560
  });
32529
32561
  }
32562
+ removeKeysFromRecord(record, keys) {
32563
+ if (!record) return record;
32564
+ let hasBlockedKey = !1;
32565
+ for (const key in record) if (Object.prototype.hasOwnProperty.call(record, key) && includesKey$1(keys, key)) {
32566
+ hasBlockedKey = !0;
32567
+ break;
32568
+ }
32569
+ if (!hasBlockedKey) return record;
32570
+ const nextRecord = {};
32571
+ for (const key in record) Object.prototype.hasOwnProperty.call(record, key) && !includesKey$1(keys, key) && (nextRecord[key] = record[key]);
32572
+ return nextRecord;
32573
+ }
32530
32574
  deleteSelfAttr(key) {
32575
+ this.deleteSelfAttrs([key]);
32576
+ }
32577
+ deleteSelfAttrs(keys) {
32531
32578
  var _a;
32532
- delete this.props[key], this.fromProps && delete this.fromProps[key];
32533
- const index = this.propKeys.indexOf(key);
32534
- -1 !== index && (this.propKeys.splice(index, 1), null === (_a = this.interpolateUpdateFunctions) || void 0 === _a || _a.splice(index, 1));
32579
+ if ((null == keys ? void 0 : keys.length) && (this.props = this.removeKeysFromRecord(this.props, keys), this.fromProps = this.removeKeysFromRecord(this.fromProps, keys), this.fromParsedProps = this.removeKeysFromRecord(this.fromParsedProps, keys), this.toParsedProps = this.removeKeysFromRecord(this.toParsedProps, keys), null === (_a = this.propKeys) || void 0 === _a ? void 0 : _a.length)) {
32580
+ const funcs = this.interpolateUpdateFunctions;
32581
+ let writeIndex = 0;
32582
+ for (let readIndex = 0; readIndex < this.propKeys.length; readIndex++) {
32583
+ const propKey = this.propKeys[readIndex];
32584
+ includesKey$1(keys, propKey) || (writeIndex !== readIndex && (this.propKeys[writeIndex] = propKey, funcs && (funcs[writeIndex] = funcs[readIndex])), writeIndex++);
32585
+ }
32586
+ this.propKeys.length = writeIndex, funcs && (funcs.length = writeIndex);
32587
+ }
32535
32588
  }
32536
32589
  trySyncStartProps() {
32537
32590
  this.propKeys.forEach(key => {
@@ -32541,11 +32594,7 @@
32541
32594
  update(end, ratio, out) {
32542
32595
  if (this.onStart(), !this.props || !this.propKeys) return;
32543
32596
  const easedRatio = this.easing(ratio);
32544
- this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.fromProps, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach((func, index) => {
32545
- if (!this.animate.validAttr(this.propKeys[index])) return;
32546
- const key = this.propKeys[index];
32547
- func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
32548
- }), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
32597
+ this.runInterpolateUpdate(this.fromProps, this.props, easedRatio), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
32549
32598
  }
32550
32599
  onUpdate(end, ratio, out) {}
32551
32600
  onEnd(cb) {
@@ -32749,19 +32798,34 @@
32749
32798
  }), this.applyTransientFromAttributes();
32750
32799
  }
32751
32800
  deleteSelfAttr(key) {
32752
- super.deleteSelfAttr(key), delete this.from[key];
32801
+ this.deleteSelfAttrs([key]);
32802
+ }
32803
+ deleteSelfAttrs(keys) {
32804
+ super.deleteSelfAttrs(keys), this.from = this.removeKeysFromRecord(this.from, keys);
32753
32805
  }
32754
32806
  update(end, ratio, out) {
32755
32807
  if (this.onStart(), !this.props || !this.propKeys) return;
32756
32808
  const easedRatio = this.easing(ratio);
32757
- this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.from, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach((func, index) => {
32758
- if (!this.animate.validAttr(this.propKeys[index])) return;
32759
- const key = this.propKeys[index];
32760
- func(key, this.from[key], this.props[key], easedRatio, this, this.target);
32761
- }), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
32809
+ this.runInterpolateUpdate(this.from, this.props, easedRatio), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
32762
32810
  }
32763
32811
  }
32764
32812
 
32813
+ function includesKey(keys, key) {
32814
+ for (let i = 0; i < keys.length; i++) if (keys[i] === key) return !0;
32815
+ return !1;
32816
+ }
32817
+ function removeKeysFromRecord(record, keys) {
32818
+ if (!record) return record;
32819
+ let hasBlockedKey = !1;
32820
+ for (const key in record) if (Object.prototype.hasOwnProperty.call(record, key) && includesKey(keys, key)) {
32821
+ hasBlockedKey = !0;
32822
+ break;
32823
+ }
32824
+ if (!hasBlockedKey) return record;
32825
+ const nextRecord = {};
32826
+ for (const key in record) Object.prototype.hasOwnProperty.call(record, key) && !includesKey(keys, key) && (nextRecord[key] = record[key]);
32827
+ return nextRecord;
32828
+ }
32765
32829
  class Animate {
32766
32830
  constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
32767
32831
  this.id = id, this.status = exports.AnimateStatus.INITIAL, this._timeline = timeline, timeline.addAnimate(this), this.slience = slience, this._startTime = 0, this._duration = 0, this._totalDuration = 0, this._loopCount = 0, this._currentLoop = 0, this._bounce = !1, this._firstStep = null, this._lastStep = null, this._startProps = {}, this._endProps = {}, this._preventAttrs = new Set(), this.currentTime = 0, this.interpolateUpdateFunction = null, this.priority = 0;
@@ -32849,12 +32913,14 @@
32849
32913
  cb ? (this._onRemove || (this._onRemove = []), this._onRemove.push(cb)) : null === (_a = this._onRemove) || void 0 === _a || _a.forEach(cb => cb());
32850
32914
  }
32851
32915
  preventAttr(key) {
32852
- this._preventAttrs.add(key), delete this._startProps[key], delete this._endProps[key];
32853
- let step = this._firstStep;
32854
- for (; step;) step.deleteSelfAttr(key), step = step.next;
32916
+ this.preventAttrs([key]);
32855
32917
  }
32856
32918
  preventAttrs(keys) {
32857
- keys.forEach(key => this._preventAttrs.add(key));
32919
+ if (!(null == keys ? void 0 : keys.length)) return;
32920
+ for (let i = 0; i < keys.length; i++) this._preventAttrs.add(keys[i]);
32921
+ this._startProps = removeKeysFromRecord(this._startProps, keys), this._endProps = removeKeysFromRecord(this._endProps, keys);
32922
+ let step = this._firstStep;
32923
+ for (; step;) step.deleteSelfAttrs(keys), step = step.next;
32858
32924
  }
32859
32925
  validAttr(key) {
32860
32926
  return !this._preventAttrs.has(key);
@@ -33854,8 +33920,11 @@
33854
33920
  }), this));
33855
33921
  }
33856
33922
  deleteSelfAttr(key) {
33923
+ this.deleteSelfAttrs([key]);
33924
+ }
33925
+ deleteSelfAttrs(keys) {
33857
33926
  this.tasks.forEach(task => {
33858
- task.animate && task.animate.forEach(animate => animate.preventAttr(key));
33927
+ task.animate && task.animate.forEach(animate => animate.preventAttrs(keys));
33859
33928
  });
33860
33929
  }
33861
33930
  stop(type) {
@@ -34449,6 +34518,25 @@
34449
34518
  }
34450
34519
  }
34451
34520
 
34521
+ function buildAnimationStaticCommitAttrs(target, keys, animate, fallbackAttrs) {
34522
+ var _a;
34523
+ const commitTarget = target,
34524
+ contextFinalAttrs = null === (_a = commitTarget.context) || void 0 === _a ? void 0 : _a.finalAttrs,
34525
+ finalAttribute = "function" == typeof commitTarget.getFinalAttribute ? commitTarget.getFinalAttribute() : commitTarget.finalAttribute;
34526
+ let commitAttrs = null;
34527
+ for (let i = 0; i < keys.length; i++) {
34528
+ const key = keys[i];
34529
+ animate && !animate.validAttr(key) || (contextFinalAttrs && Object.prototype.hasOwnProperty.call(contextFinalAttrs, key) ? (null != commitAttrs || (commitAttrs = {}), commitAttrs[key] = contextFinalAttrs[key]) : finalAttribute && Object.prototype.hasOwnProperty.call(finalAttribute, key) ? (null != commitAttrs || (commitAttrs = {}), commitAttrs[key] = finalAttribute[key]) : fallbackAttrs && Object.prototype.hasOwnProperty.call(fallbackAttrs, key) && (null != commitAttrs || (commitAttrs = {}), commitAttrs[key] = fallbackAttrs[key]));
34530
+ }
34531
+ return commitAttrs;
34532
+ }
34533
+ function commitAnimationStaticAttrs(target, keys, animate, fallbackAttrs) {
34534
+ const commitAttrs = buildAnimationStaticCommitAttrs(target, keys, animate, fallbackAttrs);
34535
+ return !!commitAttrs && (target.setAttributes(commitAttrs, !1, {
34536
+ type: exports.AttributeUpdateType.ANIMATE_END
34537
+ }), !0);
34538
+ }
34539
+
34452
34540
  class TagPointsUpdate extends ACustomAnimate {
34453
34541
  constructor(from, to, duration, easing, params) {
34454
34542
  var _a, _b;
@@ -34467,21 +34555,9 @@
34467
34555
  }
34468
34556
  onBind() {
34469
34557
  super.onBind();
34470
- const {
34471
- points: points,
34472
- segments: segments
34473
- } = this.target.attribute,
34474
- {
34475
- points: pointsTo,
34476
- segments: segmentsTo
34477
- } = this.target.getFinalAttribute();
34478
- this.from = {
34479
- points: points,
34480
- segments: segments
34481
- }, this.to = {
34482
- points: pointsTo,
34483
- segments: segmentsTo
34484
- }, this.props = this.to;
34558
+ const currentAttribute = this.target.attribute,
34559
+ finalAttribute = this.target.getFinalAttribute();
34560
+ this.from = {}, this.to = {}, Object.prototype.hasOwnProperty.call(currentAttribute, "points") && (this.from.points = currentAttribute.points), Object.prototype.hasOwnProperty.call(currentAttribute, "segments") && (this.from.segments = currentAttribute.segments), finalAttribute && Object.prototype.hasOwnProperty.call(finalAttribute, "points") && (this.to.points = finalAttribute.points), finalAttribute && Object.prototype.hasOwnProperty.call(finalAttribute, "segments") && (this.to.segments = finalAttribute.segments), this.props = this.to;
34485
34561
  const originFromPoints = this.getPoints(this.from),
34486
34562
  originToPoints = this.getPoints(this.to, !0);
34487
34563
  this.fromPoints = originFromPoints ? Array.isArray(originFromPoints) ? originFromPoints : [originFromPoints] : [], this.toPoints = originToPoints ? Array.isArray(originToPoints) ? originToPoints : [originToPoints] : [];
@@ -34517,31 +34593,42 @@
34517
34593
  const lastClipRange = this.target.attribute.clipRange;
34518
34594
  isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
34519
34595
  }
34596
+ onEnd(cb) {
34597
+ cb ? super.onEnd(cb) : (this.to && commitAnimationStaticAttrs(this.target, Object.keys(this.to), this.animate, this.to), super.onEnd());
34598
+ }
34599
+ applyPointTransientAttributes(attributes) {
34600
+ const validAttrs = {};
34601
+ Object.keys(attributes).forEach(key => {
34602
+ this.animate.validAttr(key) && (validAttrs[key] = attributes[key]);
34603
+ }), Object.keys(validAttrs).length && (applyAnimationFrameAttributes(this.target, validAttrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
34604
+ }
34520
34605
  onUpdate(end, ratio, out) {
34521
- if (end) return Object.keys(this.to).forEach(k => {
34522
- this.target.attribute[k] = this.to[k];
34523
- }), this.target.addUpdatePositionTag(), void this.target.addUpdateShapeAndBoundsTag();
34524
- if (this.points = this.points.map((point, index) => {
34525
- const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
34526
- return newPoint.context = point.context, newPoint;
34527
- }), this.clipRange) {
34528
- 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));
34529
- applyAnimationTransientAttributes(this.target, {
34530
- clipRange: this.clipRange + (1 - this.clipRange) * ratio
34531
- });
34532
- }
34533
- if (this.segmentsCache && this.to.segments) {
34534
- let start = 0;
34535
- const segments = this.to.segments.map((segment, index) => {
34536
- const end = start + this.segmentsCache[index],
34537
- points = this.points.slice(start, end);
34538
- return start = end, Object.assign(Object.assign({}, segment), {
34539
- points: points
34606
+ if (end) this.applyPointTransientAttributes(this.to);else {
34607
+ if (this.points = this.points.map((point, index) => {
34608
+ const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
34609
+ return newPoint.context = point.context, newPoint;
34610
+ }), this.clipRange) {
34611
+ 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));
34612
+ applyAnimationTransientAttributes(this.target, {
34613
+ clipRange: this.clipRange + (1 - this.clipRange) * ratio
34614
+ });
34615
+ }
34616
+ if (this.segmentsCache && this.to.segments) {
34617
+ let start = 0;
34618
+ const segments = this.to.segments.map((segment, index) => {
34619
+ const end = start + this.segmentsCache[index],
34620
+ points = this.points.slice(start, end);
34621
+ return start = end, Object.assign(Object.assign({}, segment), {
34622
+ points: points
34623
+ });
34540
34624
  });
34625
+ this.applyPointTransientAttributes({
34626
+ segments: segments
34627
+ });
34628
+ } else this.applyPointTransientAttributes({
34629
+ points: this.points
34541
34630
  });
34542
- this.target.attribute.segments = segments;
34543
- } else this.target.attribute.points = this.points;
34544
- this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34631
+ }
34545
34632
  }
34546
34633
  }
34547
34634
 
@@ -34562,10 +34649,10 @@
34562
34649
  }), 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);
34563
34650
  }
34564
34651
  onUpdate(end, ratio, out) {
34565
- const attribute = this.target.attribute;
34652
+ const attrs = {};
34566
34653
  this.propKeys.forEach(key => {
34567
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
34568
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34654
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
34655
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34569
34656
  }
34570
34657
  }
34571
34658
  class CommonOut extends ACustomAnimate {
@@ -34580,16 +34667,16 @@
34580
34667
  this.keys.forEach(key => {
34581
34668
  var _a;
34582
34669
  to[key] = 0, from[key] = null !== (_a = attrs[key]) && void 0 !== _a ? _a : 1;
34583
- }), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, Object.assign(this.target.attribute, from), this.target.addUpdatePositionTag(), this.target.addUpdateBoundTag();
34670
+ }), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, applyAnimationTransientAttributes(this.target, from, exports.AttributeUpdateType.ANIMATE_BIND), this.target.addUpdatePositionTag(), this.target.addUpdateBoundTag();
34584
34671
  }
34585
34672
  onEnd(cb) {
34586
34673
  super.onEnd(cb);
34587
34674
  }
34588
34675
  onUpdate(end, ratio, out) {
34589
- const attribute = this.target.attribute;
34676
+ const attrs = {};
34590
34677
  this.propKeys.forEach(key => {
34591
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
34592
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34678
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
34679
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34593
34680
  }
34594
34681
  }
34595
34682
 
@@ -34632,8 +34719,7 @@
34632
34719
  onEnd() {}
34633
34720
  onUpdate(end, ratio, out) {
34634
34721
  if (null == this.phi || null == this.theta) return;
34635
- const target = this.target,
34636
- {
34722
+ const {
34637
34723
  center: center,
34638
34724
  r: r,
34639
34725
  cb: cb
@@ -34644,8 +34730,15 @@
34644
34730
  x = r * Math.sin(phi) * Math.cos(theta) + center.x,
34645
34731
  y = r * Math.cos(phi) + center.y,
34646
34732
  z = r * Math.sin(phi) * Math.sin(theta) + center.z;
34647
- for (target.attribute.x = x, target.attribute.y = y, target.attribute.z = z, target.attribute.alpha = theta + pi / 2; target.attribute.alpha > pi2;) target.attribute.alpha -= pi2;
34648
- target.attribute.alpha = pi2 - target.attribute.alpha, target.attribute.zIndex = -1e4 * target.attribute.z, cb && cb(out);
34733
+ let alpha = theta + pi / 2;
34734
+ for (; alpha > pi2;) alpha -= pi2;
34735
+ alpha = pi2 - alpha, applyAnimationFrameAttributes(this.target, {
34736
+ x: x,
34737
+ y: y,
34738
+ z: z,
34739
+ alpha: alpha,
34740
+ zIndex: -1e4 * z
34741
+ }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag(), cb && cb(out);
34649
34742
  }
34650
34743
  }
34651
34744
 
@@ -34787,15 +34880,23 @@
34787
34880
  this.propKeys ? this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateAngle : "startAngle" === this.propKeys[0] ? this._updateFunction = this.updateStartAngle : "endAngle" === this.propKeys[0] ? this._updateFunction = this.updateEndAngle : this.valid = !1 : this.valid = !1;
34788
34881
  }
34789
34882
  deleteSelfAttr(key) {
34790
- delete this.props[key], this.fromProps && delete this.fromProps[key];
34791
- const index = this.propKeys.indexOf(key);
34792
- -1 !== index && this.propKeys.splice(index, 1), this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateAngle : "startAngle" === this.propKeys[0] ? this._updateFunction = this.updateStartAngle : "endAngle" === this.propKeys[0] ? this._updateFunction = this.updateEndAngle : this._updateFunction = null;
34883
+ this.deleteSelfAttrs([key]);
34884
+ }
34885
+ deleteSelfAttrs(keys) {
34886
+ var _a;
34887
+ super.deleteSelfAttrs(keys);
34888
+ const firstKey = null === (_a = this.propKeys) || void 0 === _a ? void 0 : _a[0];
34889
+ this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateAngle : this._updateFunction = "startAngle" === firstKey ? this.updateStartAngle : "endAngle" === firstKey ? this.updateEndAngle : null;
34793
34890
  }
34794
34891
  updateStartAngle(ratio) {
34795
- this.target.attribute.startAngle = this.from.startAngle + (this.to.startAngle - this.from.startAngle) * ratio;
34892
+ applyAnimationFrameAttributes(this.target, {
34893
+ startAngle: this.from.startAngle + (this.to.startAngle - this.from.startAngle) * ratio
34894
+ });
34796
34895
  }
34797
34896
  updateEndAngle(ratio) {
34798
- this.target.attribute.endAngle = this.from.endAngle + (this.to.endAngle - this.from.endAngle) * ratio;
34897
+ applyAnimationFrameAttributes(this.target, {
34898
+ endAngle: this.from.endAngle + (this.to.endAngle - this.from.endAngle) * ratio
34899
+ });
34799
34900
  }
34800
34901
  updateAngle(ratio) {
34801
34902
  this.updateStartAngle(ratio), this.updateEndAngle(ratio);
@@ -34969,10 +35070,10 @@
34969
35070
  super.onEnd(cb);
34970
35071
  }
34971
35072
  onUpdate(end, ratio, out) {
34972
- const attribute = this.target.attribute;
35073
+ const attrs = {};
34973
35074
  this.propKeys.forEach(key => {
34974
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
34975
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35075
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35076
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34976
35077
  }
34977
35078
  }
34978
35079
  class GrowCenterOut extends ACustomAnimate {
@@ -34991,10 +35092,10 @@
34991
35092
  super.onEnd(cb);
34992
35093
  }
34993
35094
  onUpdate(end, ratio, out) {
34994
- const attribute = this.target.attribute;
35095
+ const attrs = {};
34995
35096
  this.propKeys.forEach(key => {
34996
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
34997
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35097
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35098
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
34998
35099
  }
34999
35100
  }
35000
35101
 
@@ -35074,10 +35175,10 @@
35074
35175
  super.onEnd(cb);
35075
35176
  }
35076
35177
  onUpdate(end, ratio, out) {
35077
- const attribute = this.target.attribute;
35178
+ const attrs = {};
35078
35179
  this.propKeys.forEach(key => {
35079
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35080
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35180
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35181
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35081
35182
  }
35082
35183
  }
35083
35184
  function growHeightOutIndividual(graphic, options, animationParameters) {
@@ -35135,10 +35236,10 @@
35135
35236
  super.onEnd(cb);
35136
35237
  }
35137
35238
  onUpdate(end, ratio, out) {
35138
- const attribute = this.target.attribute;
35239
+ const attrs = {};
35139
35240
  this.propKeys.forEach(key => {
35140
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35141
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35241
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35242
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35142
35243
  }
35143
35244
  }
35144
35245
 
@@ -35171,7 +35272,9 @@
35171
35272
  var _a, _b;
35172
35273
  const fromPoints = null === (_a = this.from) || void 0 === _a ? void 0 : _a.points,
35173
35274
  toPoints = null === (_b = this.to) || void 0 === _b ? void 0 : _b.points;
35174
- fromPoints && toPoints && (this.target.attribute.points = fromPoints.map((point, index) => pointInterpolation(fromPoints[index], toPoints[index], ratio)), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
35275
+ fromPoints && toPoints && (applyAnimationFrameAttributes(this.target, {
35276
+ points: fromPoints.map((point, index) => pointInterpolation(fromPoints[index], toPoints[index], ratio))
35277
+ }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
35175
35278
  }
35176
35279
  }
35177
35280
  class GrowPointsIn extends GworPointsBase {
@@ -35403,10 +35506,10 @@
35403
35506
  super(from, to, duration, easing, params);
35404
35507
  }
35405
35508
  onUpdate(end, ratio, out) {
35406
- const attribute = this.target.attribute;
35509
+ const attrs = {};
35407
35510
  this.propKeys.forEach(key => {
35408
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35409
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35511
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35512
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35410
35513
  }
35411
35514
  }
35412
35515
  class GrowRadiusIn extends GrowPointsBase {
@@ -35546,10 +35649,10 @@
35546
35649
  super.onEnd(cb);
35547
35650
  }
35548
35651
  onUpdate(end, ratio, out) {
35549
- const attribute = this.target.attribute;
35652
+ const attrs = {};
35550
35653
  this.propKeys.forEach(key => {
35551
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35552
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35654
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35655
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35553
35656
  }
35554
35657
  }
35555
35658
  class GrowWidthOut extends ACustomAnimate {
@@ -35569,10 +35672,10 @@
35569
35672
  super.onEnd(cb);
35570
35673
  }
35571
35674
  onUpdate(end, ratio, out) {
35572
- const attribute = this.target.attribute;
35675
+ const attrs = {};
35573
35676
  this.propKeys.forEach(key => {
35574
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35575
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35677
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
35678
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
35576
35679
  }
35577
35680
  }
35578
35681
 
@@ -36345,18 +36448,26 @@
36345
36448
  super.onEnd(cb);
36346
36449
  }
36347
36450
  updateX(ratio) {
36348
- this.target.attribute.scaleX = this.from.scaleX + (this.to.scaleX - this.from.scaleX) * ratio;
36451
+ this.applyScaleTransientAttrs(ratio, !0, !1);
36349
36452
  }
36350
36453
  updateY(ratio) {
36351
- this.target.attribute.scaleY = this.from.scaleY + (this.to.scaleY - this.from.scaleY) * ratio;
36454
+ this.applyScaleTransientAttrs(ratio, !1, !0);
36352
36455
  }
36353
36456
  updateXY(ratio) {
36354
- this.updateX(ratio), this.updateY(ratio);
36457
+ this.applyScaleTransientAttrs(ratio, !0, !0);
36458
+ }
36459
+ applyScaleTransientAttrs(ratio, scaleX, scaleY) {
36460
+ const attrs = {};
36461
+ scaleX && (attrs.scaleX = this.from.scaleX + (this.to.scaleX - this.from.scaleX) * ratio), scaleY && (attrs.scaleY = this.from.scaleY + (this.to.scaleY - this.from.scaleY) * ratio), applyAnimationFrameAttributes(this.target, attrs);
36355
36462
  }
36356
36463
  deleteSelfAttr(key) {
36357
- delete this.props[key], this.fromProps && delete this.fromProps[key];
36358
- const index = this.propKeys.indexOf(key);
36359
- -1 !== index && this.propKeys.splice(index, 1), this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateXY : "scaleX" === this.propKeys[0] ? this._updateFunction = this.updateX : "scaleY" === this.propKeys[0] ? this._updateFunction = this.updateY : this._updateFunction = null;
36464
+ this.deleteSelfAttrs([key]);
36465
+ }
36466
+ deleteSelfAttrs(keys) {
36467
+ var _a;
36468
+ super.deleteSelfAttrs(keys);
36469
+ const firstKey = null === (_a = this.propKeys) || void 0 === _a ? void 0 : _a[0];
36470
+ this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateXY : this._updateFunction = "scaleX" === firstKey ? this.updateX : "scaleY" === firstKey ? this.updateY : null;
36360
36471
  }
36361
36472
  onUpdate(end, ratio, out) {
36362
36473
  this._updateFunction && (this._updateFunction(ratio), this.target.addUpdatePositionTag(), this.target.addUpdateBoundTag());
@@ -36401,10 +36512,10 @@
36401
36512
  super.onEnd(cb);
36402
36513
  }
36403
36514
  onUpdate(end, ratio, out) {
36404
- const attribute = this.target.attribute;
36515
+ const attrs = {};
36405
36516
  this.propKeys.forEach(key => {
36406
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36407
- }), this.target.addUpdatePositionTag(), this.target.addUpdateBoundTag();
36517
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36518
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateBoundTag();
36408
36519
  }
36409
36520
  }
36410
36521
 
@@ -36415,14 +36526,19 @@
36415
36526
  update(end, ratio, out) {
36416
36527
  if (this.onStart(), !this.props || !this.propKeys) return;
36417
36528
  const easedRatio = this.easing(ratio);
36418
- this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.fromProps, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach((func, index) => {
36419
- if (!this.animate.validAttr(this.propKeys[index])) return;
36420
- const key = this.propKeys[index];
36421
- func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
36422
- }), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
36529
+ this.runInterpolateUpdate(this.fromProps, this.props, easedRatio), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
36423
36530
  }
36424
36531
  }
36425
36532
 
36533
+ function buildInterpolatedAttrs(keys, from, to, ratio) {
36534
+ const attrs = {};
36535
+ return keys.forEach(key => {
36536
+ attrs[key] = from[key] + (to[key] - from[key]) * ratio;
36537
+ }), attrs;
36538
+ }
36539
+ function applyStoryFrame(target, attrs) {
36540
+ applyAnimationFrameAttributes(target, attrs), target.addUpdatePositionTag(), target.addUpdateShapeAndBoundsTag();
36541
+ }
36426
36542
  class SlideIn extends ACustomAnimate {
36427
36543
  constructor(from, to, duration, easing, params) {
36428
36544
  super(from, to, duration, easing, params);
@@ -36445,10 +36561,7 @@
36445
36561
  "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);
36446
36562
  }
36447
36563
  onUpdate(end, ratio, out) {
36448
- const attribute = this.target.attribute;
36449
- this.propKeys.forEach(key => {
36450
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36451
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
36564
+ applyStoryFrame(this.target, buildInterpolatedAttrs(this.propKeys, this.from, this.to, ratio));
36452
36565
  }
36453
36566
  }
36454
36567
  class GrowIn extends ACustomAnimate {
@@ -36473,10 +36586,7 @@
36473
36586
  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);
36474
36587
  }
36475
36588
  onUpdate(end, ratio, out) {
36476
- const attribute = this.target.attribute;
36477
- this.propKeys.forEach(key => {
36478
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36479
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
36589
+ applyStoryFrame(this.target, buildInterpolatedAttrs(this.propKeys, this.from, this.to, ratio));
36480
36590
  }
36481
36591
  }
36482
36592
  class SpinIn extends ACustomAnimate {
@@ -36507,10 +36617,7 @@
36507
36617
  this.propKeys = ["opacity", "baseOpacity", "angle", "scaleX", "scaleY"], this.from = from, this.to = to, this.props = to, applyAppearStartAttributes(this.target, from);
36508
36618
  }
36509
36619
  onUpdate(end, ratio, out) {
36510
- const attribute = this.target.attribute;
36511
- this.propKeys.forEach(key => {
36512
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36513
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
36620
+ applyStoryFrame(this.target, buildInterpolatedAttrs(this.propKeys, this.from, this.to, ratio));
36514
36621
  }
36515
36622
  }
36516
36623
  class StrokeIn extends ACustomAnimate {
@@ -36555,8 +36662,10 @@
36555
36662
  }
36556
36663
  onUpdate(end, ratio, out) {
36557
36664
  var _a;
36558
- const attribute = this.target.attribute;
36559
- attribute.lineDashOffset = this.from.lineDashOffset + (this.to.lineDashOffset - this.from.lineDashOffset) * ratio, (null === (_a = this.params) || void 0 === _a ? void 0 : _a.showFill) && (attribute.fillOpacity = this.from.fillOpacity + (this.to.fillOpacity - this.from.fillOpacity) * ratio);
36665
+ const attrs = {
36666
+ lineDashOffset: this.from.lineDashOffset + (this.to.lineDashOffset - this.from.lineDashOffset) * ratio
36667
+ };
36668
+ (null === (_a = this.params) || void 0 === _a ? void 0 : _a.showFill) && (attrs.fillOpacity = this.from.fillOpacity + (this.to.fillOpacity - this.from.fillOpacity) * ratio), applyAnimationTransientAttributes(this.target, attrs);
36560
36669
  }
36561
36670
  onEnd() {
36562
36671
  var _a;
@@ -36607,8 +36716,10 @@
36607
36716
  }
36608
36717
  onUpdate(end, ratio, out) {
36609
36718
  var _a;
36610
- const attribute = this.target.attribute;
36611
- attribute.lineDashOffset = this.from.lineDashOffset + (this.to.lineDashOffset - this.from.lineDashOffset) * ratio, (null === (_a = this.params) || void 0 === _a ? void 0 : _a.showFill) && (attribute.fillOpacity = this.from.fillOpacity + (this.to.fillOpacity - this.from.fillOpacity) * ratio);
36719
+ const attrs = {
36720
+ lineDashOffset: this.from.lineDashOffset + (this.to.lineDashOffset - this.from.lineDashOffset) * ratio
36721
+ };
36722
+ (null === (_a = this.params) || void 0 === _a ? void 0 : _a.showFill) && (attrs.fillOpacity = this.from.fillOpacity + (this.to.fillOpacity - this.from.fillOpacity) * ratio), applyAnimationTransientAttributes(this.target, attrs);
36612
36723
  }
36613
36724
  }
36614
36725
  class MoveScaleIn extends ACustomAnimate {
@@ -36705,10 +36816,7 @@
36705
36816
  "top" === direction ? (from.y = null !== (_g = attrs.y) && void 0 !== _g ? _g : 0, to.y = (null !== (_h = attrs.y) && void 0 !== _h ? _h : 0) - distance, this.propKeys = ["opacity", "baseOpacity", "y"]) : "bottom" === direction ? (from.y = null !== (_j = attrs.y) && void 0 !== _j ? _j : 0, to.y = (null !== (_k = attrs.y) && void 0 !== _k ? _k : 0) + distance, this.propKeys = ["opacity", "baseOpacity", "y"]) : "left" === direction ? (from.x = null !== (_l = attrs.x) && void 0 !== _l ? _l : 0, to.x = (null !== (_m = attrs.x) && void 0 !== _m ? _m : 0) - distance, this.propKeys = ["opacity", "baseOpacity", "x"]) : (from.x = null !== (_o = attrs.x) && void 0 !== _o ? _o : 0, to.x = (null !== (_p = attrs.x) && void 0 !== _p ? _p : 0) + distance, this.propKeys = ["opacity", "baseOpacity", "x"]), this.from = from, this.to = to, this.props = to;
36706
36817
  }
36707
36818
  onUpdate(end, ratio, out) {
36708
- const attribute = this.target.attribute;
36709
- this.propKeys.forEach(key => {
36710
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36711
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
36819
+ applyStoryFrame(this.target, buildInterpolatedAttrs(this.propKeys, this.from, this.to, ratio));
36712
36820
  }
36713
36821
  }
36714
36822
  class GrowOut extends ACustomAnimate {
@@ -36733,10 +36841,7 @@
36733
36841
  this.propKeys = ["opacity", "baseOpacity"], "x" !== direction && "xy" !== direction || (from.scaleX = null !== (_h = attrs.scaleX) && void 0 !== _h ? _h : 1, to.scaleX = toScale, this.propKeys.push("scaleX")), "y" !== direction && "xy" !== direction || (from.scaleY = null !== (_j = attrs.scaleY) && void 0 !== _j ? _j : 1, to.scaleY = toScale, this.propKeys.push("scaleY")), this.from = from, this.to = to, this.props = to;
36734
36842
  }
36735
36843
  onUpdate(end, ratio, out) {
36736
- const attribute = this.target.attribute;
36737
- this.propKeys.forEach(key => {
36738
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36739
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
36844
+ applyStoryFrame(this.target, buildInterpolatedAttrs(this.propKeys, this.from, this.to, ratio));
36740
36845
  }
36741
36846
  }
36742
36847
  class SpinOut extends ACustomAnimate {
@@ -36767,10 +36872,7 @@
36767
36872
  this.propKeys = ["opacity", "baseOpacity", "angle", "scaleX", "scaleY"], this.from = from, this.to = to, this.props = to;
36768
36873
  }
36769
36874
  onUpdate(end, ratio, out) {
36770
- const attribute = this.target.attribute;
36771
- this.propKeys.forEach(key => {
36772
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
36773
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
36875
+ applyStoryFrame(this.target, buildInterpolatedAttrs(this.propKeys, this.from, this.to, ratio));
36774
36876
  }
36775
36877
  }
36776
36878
  class MoveScaleOut extends ACustomAnimate {
@@ -36855,20 +36957,20 @@
36855
36957
  onUpdate(end, ratio, out) {
36856
36958
  const angle = ratio * Math.PI * this.pulseCount,
36857
36959
  pulseValue = Math.abs(Math.sin(angle)),
36858
- attribute = this.target.attribute;
36960
+ attrs = {};
36859
36961
  if (this.useOpacity) {
36860
36962
  const opacity = 1 + (this.pulseOpacity - 1) * pulseValue;
36861
- this.useStroke && (attribute.strokeOpacity = (this.originalAttributes.strokeOpacity || 1) * opacity), this.useFill && (attribute.fillOpacity = (this.originalAttributes.fillOpacity || 1) * opacity);
36963
+ this.useStroke && (attrs.strokeOpacity = (this.originalAttributes.strokeOpacity || 1) * opacity), this.useFill && (attrs.fillOpacity = (this.originalAttributes.fillOpacity || 1) * opacity);
36862
36964
  }
36863
36965
  if (this.useScale) {
36864
36966
  const scale = 1 + (this.pulseScale - 1) * pulseValue;
36865
- attribute.scaleX = (this.originalAttributes.scaleX || 1) * scale, attribute.scaleY = (this.originalAttributes.scaleY || 1) * scale;
36967
+ attrs.scaleX = (this.originalAttributes.scaleX || 1) * scale, attrs.scaleY = (this.originalAttributes.scaleY || 1) * scale;
36866
36968
  }
36867
- this.useColor && this.pulseColor && this.applyColorPulse(attribute, pulseValue), this.target.addUpdateShapeAndBoundsTag(), this.target.addUpdatePositionTag();
36969
+ this.useColor && this.pulseColor && this.applyColorPulse(attrs, pulseValue), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdateShapeAndBoundsTag(), this.target.addUpdatePositionTag();
36868
36970
  }
36869
- applyColorPulse(attribute, pulseValue) {
36971
+ applyColorPulse(attrs, pulseValue) {
36870
36972
  const colorRatio = this.pulseColorIntensity * pulseValue;
36871
- this.useFill && this.originalFill && this.pulseColor && (attribute.fill = interpolateColor(this.originalFill, this.pulseColor, colorRatio, !0)), this.useStroke && this.originalStroke && this.pulseColor && (attribute.stroke = interpolateColor(this.originalStroke, this.pulseColor, colorRatio, !0));
36973
+ this.useFill && this.originalFill && this.pulseColor && (attrs.fill = interpolateColor(this.originalFill, this.pulseColor, colorRatio, !0)), this.useStroke && this.originalStroke && this.pulseColor && (attrs.stroke = interpolateColor(this.originalStroke, this.pulseColor, colorRatio, !0));
36872
36974
  }
36873
36975
  onEnd() {
36874
36976
  super.onEnd(), this.target.setAttributes(this.originalAttributes);
@@ -36883,12 +36985,22 @@
36883
36985
  width: !0,
36884
36986
  height: !0
36885
36987
  };
36988
+ function includesChannel(channels, key) {
36989
+ for (let i = 0; i < channels.length; i++) if (channels[i] === key) return !0;
36990
+ return !1;
36991
+ }
36992
+ function filterExcludedChannels(diffAttrs, excludeChannels) {
36993
+ if (!(null == excludeChannels ? void 0 : excludeChannels.length)) return diffAttrs;
36994
+ const nextAttrs = {};
36995
+ for (const key in diffAttrs) Object.prototype.hasOwnProperty.call(diffAttrs, key) && !includesChannel(excludeChannels, key) && (nextAttrs[key] = diffAttrs[key]);
36996
+ return nextAttrs;
36997
+ }
36886
36998
  class Update extends ACustomAnimate {
36887
36999
  constructor(from, to, duration, easing, params) {
36888
37000
  super(from, to, duration, easing, params), this.clipPathSyncKeys = null, this.clipPathSyncParent = null, this.clipPathSyncChildIndex = -1, this.clipPathSyncDisabled = !1;
36889
37001
  }
36890
37002
  onBind() {
36891
- var _a, _b;
37003
+ var _a;
36892
37004
  super.onBind();
36893
37005
  let {
36894
37006
  diffAttrs = {}
@@ -36896,39 +37008,19 @@
36896
37008
  const {
36897
37009
  options: options
36898
37010
  } = this.params;
36899
- diffAttrs = Object.assign({}, diffAttrs), (null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) && options.excludeChannels.forEach(channel => {
36900
- delete diffAttrs[channel];
36901
- }), this.props = diffAttrs, this.clipPathSyncKeys = Object.keys(diffAttrs).filter(key => clipPathGeometryAttrs[key]), this.clipPathSyncDisabled = !this.clipPathSyncKeys.length, this.syncParentClipPathToTarget();
36902
- }
36903
- getStaticCommitAttrs() {
36904
- var _a;
36905
- if (!this.props) return null;
36906
- const target = this.target,
36907
- contextFinalAttrs = null === (_a = target.context) || void 0 === _a ? void 0 : _a.finalAttrs,
36908
- finalAttribute = "function" == typeof target.getFinalAttribute ? target.getFinalAttribute() : target.finalAttribute,
36909
- commitAttrs = {};
36910
- return Object.keys(this.props).forEach(key => {
36911
- contextFinalAttrs && Object.prototype.hasOwnProperty.call(contextFinalAttrs, key) ? commitAttrs[key] = contextFinalAttrs[key] : finalAttribute && Object.prototype.hasOwnProperty.call(finalAttribute, key) ? commitAttrs[key] = finalAttribute[key] : this.animate.validAttr(key) && (commitAttrs[key] = this.props[key]);
36912
- }), Object.keys(commitAttrs).length ? commitAttrs : null;
37011
+ diffAttrs = filterExcludedChannels(diffAttrs, null == options ? void 0 : options.excludeChannels), this.props = diffAttrs, this.clipPathSyncKeys = Object.keys(diffAttrs).filter(key => clipPathGeometryAttrs[key]), this.clipPathSyncDisabled = !this.clipPathSyncKeys.length, this.syncParentClipPathToTarget();
36913
37012
  }
36914
37013
  onEnd(cb) {
36915
- if (cb) return void super.onEnd(cb);
36916
- const commitAttrs = this.getStaticCommitAttrs();
36917
- commitAttrs && this.target.setAttributes(commitAttrs, !1, {
36918
- type: exports.AttributeUpdateType.ANIMATE_END
36919
- }), this.syncParentClipPathToTarget(), super.onEnd();
37014
+ var _a;
37015
+ cb ? super.onEnd(cb) : (this.props && commitAnimationStaticAttrs(this.target, null !== (_a = this.propKeys) && void 0 !== _a ? _a : Object.keys(this.props), this.animate, this.props), this.syncParentClipPathToTarget(), super.onEnd());
36920
37016
  }
36921
37017
  update(end, ratio, out) {
36922
37018
  if (this.onStart(), !this.props || !this.propKeys) return;
36923
37019
  const easedRatio = this.easing(ratio);
36924
- this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.fromProps, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach((func, index) => {
36925
- if (!this.animate.validAttr(this.propKeys[index])) return;
36926
- const key = this.propKeys[index];
36927
- func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
36928
- }), this.syncParentClipPathToTarget(), this.onUpdate(end, easedRatio, out);
37020
+ this.runInterpolateUpdate(this.fromProps, this.props, easedRatio), this.syncParentClipPathToTarget(), this.onUpdate(end, easedRatio, out);
36929
37021
  }
36930
37022
  syncParentClipPathToTarget() {
36931
- var _a, _b;
37023
+ var _a, _b, _c, _d;
36932
37024
  if (this.clipPathSyncDisabled) return;
36933
37025
  const target = this.target,
36934
37026
  parent = target.parent,
@@ -36937,9 +37029,9 @@
36937
37029
  const childIndex = this.getClipPathSyncChildIndex(parent);
36938
37030
  if (childIndex < 0 || childIndex >= path.length) return;
36939
37031
  const clipGraphic = path[childIndex];
36940
- if (!(null == clipGraphic ? void 0 : clipGraphic.attribute) || clipGraphic.type !== target.type || !this.isClipPathStaticTarget(clipGraphic)) return void (this.clipPathSyncDisabled = !0);
37032
+ if (!(null == clipGraphic ? void 0 : clipGraphic.attribute) || clipGraphic.type !== target.type || !this.isClipPathStaticTarget(clipGraphic)) return;
36941
37033
  const syncAttrs = this.buildClipPathTransientAttrs(clipGraphic);
36942
- syncAttrs && applyAnimationTransientAttributes(clipGraphic, syncAttrs, exports.AttributeUpdateType.ANIMATE_UPDATE);
37034
+ syncAttrs && (applyAnimationFrameAttributes(clipGraphic, syncAttrs), null === (_c = clipGraphic.addUpdatePositionTag) || void 0 === _c || _c.call(clipGraphic), null === (_d = clipGraphic.addUpdateShapeAndBoundsTag) || void 0 === _d || _d.call(clipGraphic));
36943
37035
  }
36944
37036
  getClipPathSyncChildIndex(parent) {
36945
37037
  var _a;
@@ -37083,10 +37175,10 @@
37083
37175
  super(from, to, duration, easing, params);
37084
37176
  }
37085
37177
  onUpdate(end, ratio, out) {
37086
- const attribute = this.target.attribute;
37178
+ const attrs = {};
37087
37179
  this.propKeys.forEach(key => {
37088
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
37089
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
37180
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
37181
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
37090
37182
  }
37091
37183
  }
37092
37184
  class MoveIn extends MoveBase {
@@ -37142,10 +37234,10 @@
37142
37234
  super(from, to, duration, easing, params);
37143
37235
  }
37144
37236
  onUpdate(end, ratio, out) {
37145
- const attribute = this.target.attribute;
37237
+ const attrs = {};
37146
37238
  this.propKeys.forEach(key => {
37147
- attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
37148
- }), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
37239
+ attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
37240
+ }), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
37149
37241
  }
37150
37242
  }
37151
37243
  class RotateIn extends RotateBase {
@@ -37188,7 +37280,7 @@
37188
37280
  pos: pos,
37189
37281
  angle: angle
37190
37282
  } = this.path.getAttrAt(at);
37191
- 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);
37283
+ 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) : (applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
37192
37284
  }
37193
37285
  }
37194
37286
 
@@ -40941,11 +41033,7 @@
40941
41033
  if (!graphic || !targetAttrs) return;
40942
41034
  const committedTargetAttrs = cloneDeep(targetAttrs),
40943
41035
  transientStartAttrs = cloneDeep(null != startAttrs ? startAttrs : graphic.attribute);
40944
- graphic.setAttributes(committedTargetAttrs);
40945
- const baseAttributes = graphic.baseAttributes;
40946
- baseAttributes && "object" == typeof baseAttributes && Object.keys(committedTargetAttrs).forEach(key => {
40947
- baseAttributes[key] = cloneDeep(committedTargetAttrs[key]);
40948
- }), null === (_b = (_a = graphic).setFinalAttributes) || void 0 === _b || _b.call(_a, committedTargetAttrs), null === (_d = (_c = graphic).setAttributesAndPreventAnimate) || void 0 === _d || _d.call(_c, transientStartAttrs, !1, {
41036
+ graphic.setAttributes(committedTargetAttrs), null === (_b = (_a = graphic).setFinalAttributes) || void 0 === _b || _b.call(_a, committedTargetAttrs), null === (_d = (_c = graphic).setAttributesAndPreventAnimate) || void 0 === _d || _d.call(_c, transientStartAttrs, !1, {
40949
41037
  type: exports.AttributeUpdateType.ANIMATE_BIND
40950
41038
  });
40951
41039
  }
@@ -41685,7 +41773,10 @@
41685
41773
  }), this.completeBind(animator);
41686
41774
  }
41687
41775
  deleteSelfAttr(key) {
41688
- super.deleteSelfAttr(key), this._animator.deleteSelfAttr(key);
41776
+ this.deleteSelfAttrs([key]);
41777
+ }
41778
+ deleteSelfAttrs(keys) {
41779
+ super.deleteSelfAttrs(keys), this._animator.deleteSelfAttrs(keys);
41689
41780
  }
41690
41781
  tryPreventConflict() {}
41691
41782
  }
@@ -54543,7 +54634,7 @@
54543
54634
  return resolveLegacyApp().createStage(params);
54544
54635
  }
54545
54636
 
54546
- const version = "1.1.0-alpha.10";
54637
+ const version = "1.1.0-alpha.12";
54547
54638
 
54548
54639
  exports.AComponentAnimate = AComponentAnimate;
54549
54640
  exports.ACustomAnimate = ACustomAnimate;