@visactor/vrender 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "1.0.3";
2
+ export declare const version = "1.0.4";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
5
5
  export * from '@visactor/vrender-animate';
package/cjs/index.js CHANGED
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
23
23
 
24
- exports.version = "1.0.3", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
24
+ exports.version = "1.0.4", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
25
25
  vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
26
26
  vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
27
27
  (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"1.0.3\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"1.0.4\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\n"]}
package/dist/index.es.js CHANGED
@@ -9191,9 +9191,9 @@ class Graphic extends Node {
9191
9191
  setWidthHeightWithoutTransform(aabbBounds) {
9192
9192
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
9193
9193
  }
9194
- setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
9194
+ setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
9195
9195
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
9196
- Object.keys(params).forEach(key => {
9196
+ (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
9197
9197
  animate.preventAttr(key);
9198
9198
  });
9199
9199
  });
@@ -9364,7 +9364,7 @@ class Graphic extends Node {
9364
9364
  });
9365
9365
  } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
9366
9366
  type: AttributeUpdateType.STATE
9367
- });
9367
+ }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
9368
9368
  this._emitCustomEvent("afterStateUpdate", {
9369
9369
  type: AttributeUpdateType.STATE
9370
9370
  });
@@ -30498,7 +30498,7 @@ class DefaultTimeline extends EventEmitter {
30498
30498
  return this._animateCount;
30499
30499
  }
30500
30500
  constructor() {
30501
- super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
30501
+ super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this._animationEndFlag = !0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
30502
30502
  }
30503
30503
  isRunning() {
30504
30504
  return !this.paused && this._animateCount > 0;
@@ -30527,10 +30527,11 @@ class DefaultTimeline extends EventEmitter {
30527
30527
  }
30528
30528
  tick(delta) {
30529
30529
  if (this.paused) return;
30530
+ this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
30530
30531
  const scaledDelta = delta * this._playSpeed;
30531
30532
  this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
30532
30533
  animate.status === AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== AnimateStatus.RUNNING && animate.status !== AnimateStatus.INITIAL || animate.advance(scaledDelta);
30533
- }), 0 === this._animateCount && this.emit("animationEnd");
30534
+ }), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
30534
30535
  }
30535
30536
  clear() {
30536
30537
  this.forEachAccessAnimate(animate => {
@@ -30594,7 +30595,9 @@ class Animate {
30594
30595
  return this._timeline;
30595
30596
  }
30596
30597
  bind(target) {
30597
- return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30598
+ return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
30599
+ this.stop(), this.target.animates.delete(this.id);
30600
+ }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30598
30601
  }
30599
30602
  to(props, duration = 300, easing = "linear") {
30600
30603
  const step = new Step(AnimateStepType.to, props, duration, easing);
@@ -30808,8 +30811,8 @@ class DefaultTicker extends EventEmitter {
30808
30811
  }
30809
30812
  init() {
30810
30813
  this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
30811
- this.initHandler();
30812
- }), application.global.env && this.initHandler();
30814
+ this.initHandler(!1);
30815
+ }), application.global.env && this.initHandler(!1);
30813
30816
  }
30814
30817
  addTimeline(timeline) {
30815
30818
  this.timelines.push(timeline);
@@ -30820,10 +30823,11 @@ class DefaultTicker extends EventEmitter {
30820
30823
  getTimelines() {
30821
30824
  return this.timelines;
30822
30825
  }
30823
- initHandler() {
30824
- this.setupTickHandler();
30826
+ initHandler(force = !1) {
30827
+ this.setupTickHandler(force);
30825
30828
  }
30826
- setupTickHandler() {
30829
+ setupTickHandler(force = !1) {
30830
+ if (!force && this.tickerHandler) return !0;
30827
30831
  const handler = new RAFTickHandler();
30828
30832
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
30829
30833
  }
@@ -30874,7 +30878,7 @@ class DefaultTicker extends EventEmitter {
30874
30878
  return this.status = STATUS$1.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
30875
30879
  }
30876
30880
  stop() {
30877
- this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
30881
+ this.status = STATUS$1.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
30878
30882
  }
30879
30883
  trySyncTickStatus() {
30880
30884
  this.status === STATUS$1.INITIAL && this.timelines.some(timeline => timeline.isRunning()) ? this.start() : this.status === STATUS$1.RUNNING && this.timelines.every(timeline => !timeline.isRunning()) && this.stop();
@@ -31187,10 +31191,11 @@ class AnimateExecutor {
31187
31191
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
31188
31192
  var _a, _b, _c, _d;
31189
31193
  if (custom && customType) {
31190
- const customParams = this.resolveValue(customParameters, graphic, {
31194
+ const customParams = Object.assign({
31191
31195
  width: graphic.stage.width,
31192
- height: graphic.stage.height
31193
- }),
31196
+ height: graphic.stage.height,
31197
+ group: this._target.parent
31198
+ }, this.resolveValue(customParameters, graphic)),
31194
31199
  objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
31195
31200
  customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
31196
31201
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
@@ -31455,7 +31460,6 @@ class AnimateExtension {
31455
31460
  }
31456
31461
  animate(params) {
31457
31462
  var _a, _b, _c;
31458
- this.animates || (this.animates = new Map());
31459
31463
  const animate = new Animate(null == params ? void 0 : params.id, null !== (_b = null !== (_a = null == params ? void 0 : params.timeline) && void 0 !== _a ? _a : this.stage && this.stage.getTimeline()) && void 0 !== _b ? _b : defaultTimeline, null == params ? void 0 : params.slience);
31460
31464
  if (animate.bind(this), params) {
31461
31465
  const {
@@ -31465,9 +31469,7 @@ class AnimateExtension {
31465
31469
  } = params;
31466
31470
  null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
31467
31471
  }
31468
- return this.animates.set(animate.id, animate), animate.onRemove(() => {
31469
- animate.stop(), this.animates.delete(animate.id);
31470
- }), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31472
+ return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31471
31473
  }
31472
31474
  createTimeline() {
31473
31475
  return new DefaultTimeline();
@@ -31506,7 +31508,7 @@ function registerAnimate() {
31506
31508
 
31507
31509
  class ACustomAnimate extends Step {
31508
31510
  constructor(customFrom, customTo, duration, easing, params) {
31509
- super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
31511
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
31510
31512
  }
31511
31513
  update(end, ratio, out) {
31512
31514
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -34668,18 +34670,19 @@ const moveIn = (graphic, options, animationParameters) => {
34668
34670
  }
34669
34671
  };
34670
34672
  const moveOut = (graphic, options, animationParameters) => {
34671
- var _a, _b, _c, _d, _e, _f;
34673
+ var _a, _b, _c, _d;
34672
34674
  const {
34673
34675
  offset = 0,
34674
34676
  orient: orient,
34675
34677
  direction: direction,
34676
34678
  point: pointOpt
34677
34679
  } = null != options ? options : {},
34678
- groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth,
34679
- groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight,
34680
+ groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
34681
+ groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
34682
+ groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
34680
34683
  changedX = ("negative" === orient ? groupWidth : 0) + offset,
34681
34684
  changedY = ("negative" === orient ? groupHeight : 0) + offset,
34682
- point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, animationParameters) : pointOpt,
34685
+ point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt,
34683
34686
  fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
34684
34687
  fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
34685
34688
  switch (direction) {
@@ -34852,6 +34855,9 @@ class FromTo extends ACustomAnimate {
34852
34855
  this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
34853
34856
  }), this.target.setAttributes(this.from);
34854
34857
  }
34858
+ deleteSelfAttr(key) {
34859
+ super.deleteSelfAttr(key), delete this.from[key];
34860
+ }
34855
34861
  update(end, ratio, out) {
34856
34862
  if (this.onStart(), !this.props || !this.propKeys) return;
34857
34863
  const easedRatio = this.easing(ratio);
@@ -35048,7 +35054,7 @@ const registerCustomAnimate = () => {
35048
35054
  AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("fromTo", FromTo), AnimateExecutor.registerBuiltInAnimate("scaleIn", ScaleIn), AnimateExecutor.registerBuiltInAnimate("scaleOut", ScaleOut), AnimateExecutor.registerBuiltInAnimate("growHeightIn", GrowHeightIn), AnimateExecutor.registerBuiltInAnimate("growHeightOut", GrowHeightOut), AnimateExecutor.registerBuiltInAnimate("growWidthIn", GrowWidthIn), AnimateExecutor.registerBuiltInAnimate("growWidthOut", GrowWidthOut), AnimateExecutor.registerBuiltInAnimate("growCenterIn", GrowCenterIn), AnimateExecutor.registerBuiltInAnimate("growCenterOut", GrowCenterOut), AnimateExecutor.registerBuiltInAnimate("clipIn", ClipIn), AnimateExecutor.registerBuiltInAnimate("clipOut", ClipOut), AnimateExecutor.registerBuiltInAnimate("fadeIn", FadeIn), AnimateExecutor.registerBuiltInAnimate("fadeOut", FadeOut), AnimateExecutor.registerBuiltInAnimate("growPointsIn", GrowPointsIn), AnimateExecutor.registerBuiltInAnimate("growPointsOut", GrowPointsOut), AnimateExecutor.registerBuiltInAnimate("growPointsXIn", GrowPointsXIn), AnimateExecutor.registerBuiltInAnimate("growPointsXOut", GrowPointsXOut), AnimateExecutor.registerBuiltInAnimate("growPointsYIn", GrowPointsYIn), AnimateExecutor.registerBuiltInAnimate("growPointsYOut", GrowPointsYOut), AnimateExecutor.registerBuiltInAnimate("growAngleIn", GrowAngleIn), AnimateExecutor.registerBuiltInAnimate("growAngleOut", GrowAngleOut), AnimateExecutor.registerBuiltInAnimate("growRadiusIn", GrowRadiusIn), AnimateExecutor.registerBuiltInAnimate("growRadiusOut", GrowRadiusOut), AnimateExecutor.registerBuiltInAnimate("moveIn", MoveIn), AnimateExecutor.registerBuiltInAnimate("moveOut", MoveOut), AnimateExecutor.registerBuiltInAnimate("rotateIn", RotateIn), AnimateExecutor.registerBuiltInAnimate("rotateOut", RotateOut), AnimateExecutor.registerBuiltInAnimate("update", Update), AnimateExecutor.registerBuiltInAnimate("state", State), AnimateExecutor.registerBuiltInAnimate("labelItemAppear", LabelItemAppear), AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", LabelItemDisappear), AnimateExecutor.registerBuiltInAnimate("poptipAppear", PoptipAppear), AnimateExecutor.registerBuiltInAnimate("poptipDisappear", PoptipDisappear), AnimateExecutor.registerBuiltInAnimate("inputText", InputText), AnimateExecutor.registerBuiltInAnimate("inputRichText", InputRichText), AnimateExecutor.registerBuiltInAnimate("outputRichText", OutputRichText), AnimateExecutor.registerBuiltInAnimate("slideRichText", SlideRichText), AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn), AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn), AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn), AnimateExecutor.registerBuiltInAnimate("strokeIn", StrokeIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut), AnimateExecutor.registerBuiltInAnimate("strokeOut", StrokeOut), AnimateExecutor.registerBuiltInAnimate("pulse", PulseAnimate), AnimateExecutor.registerBuiltInAnimate("MotionPath", MotionPath), AnimateExecutor.registerBuiltInAnimate("streamLight", StreamLight);
35049
35055
  };
35050
35056
 
35051
- const version = "1.0.3";
35057
+ const version = "1.0.4";
35052
35058
  preLoadAllModule();
35053
35059
  if (isBrowserEnv()) {
35054
35060
  loadBrowserEnv(container);
package/dist/index.js CHANGED
@@ -9197,9 +9197,9 @@
9197
9197
  setWidthHeightWithoutTransform(aabbBounds) {
9198
9198
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
9199
9199
  }
9200
- setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
9200
+ setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
9201
9201
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
9202
- Object.keys(params).forEach(key => {
9202
+ (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
9203
9203
  animate.preventAttr(key);
9204
9204
  });
9205
9205
  });
@@ -9370,7 +9370,7 @@
9370
9370
  });
9371
9371
  } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
9372
9372
  type: exports.AttributeUpdateType.STATE
9373
- });
9373
+ }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
9374
9374
  this._emitCustomEvent("afterStateUpdate", {
9375
9375
  type: exports.AttributeUpdateType.STATE
9376
9376
  });
@@ -30504,7 +30504,7 @@
30504
30504
  return this._animateCount;
30505
30505
  }
30506
30506
  constructor() {
30507
- super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
30507
+ super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this._animationEndFlag = !0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
30508
30508
  }
30509
30509
  isRunning() {
30510
30510
  return !this.paused && this._animateCount > 0;
@@ -30533,10 +30533,11 @@
30533
30533
  }
30534
30534
  tick(delta) {
30535
30535
  if (this.paused) return;
30536
+ this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
30536
30537
  const scaledDelta = delta * this._playSpeed;
30537
30538
  this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
30538
30539
  animate.status === exports.AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== exports.AnimateStatus.RUNNING && animate.status !== exports.AnimateStatus.INITIAL || animate.advance(scaledDelta);
30539
- }), 0 === this._animateCount && this.emit("animationEnd");
30540
+ }), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
30540
30541
  }
30541
30542
  clear() {
30542
30543
  this.forEachAccessAnimate(animate => {
@@ -30600,7 +30601,9 @@
30600
30601
  return this._timeline;
30601
30602
  }
30602
30603
  bind(target) {
30603
- return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30604
+ return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
30605
+ this.stop(), this.target.animates.delete(this.id);
30606
+ }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30604
30607
  }
30605
30608
  to(props, duration = 300, easing = "linear") {
30606
30609
  const step = new Step(exports.AnimateStepType.to, props, duration, easing);
@@ -30814,8 +30817,8 @@
30814
30817
  }
30815
30818
  init() {
30816
30819
  this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
30817
- this.initHandler();
30818
- }), application.global.env && this.initHandler();
30820
+ this.initHandler(!1);
30821
+ }), application.global.env && this.initHandler(!1);
30819
30822
  }
30820
30823
  addTimeline(timeline) {
30821
30824
  this.timelines.push(timeline);
@@ -30826,10 +30829,11 @@
30826
30829
  getTimelines() {
30827
30830
  return this.timelines;
30828
30831
  }
30829
- initHandler() {
30830
- this.setupTickHandler();
30832
+ initHandler(force = !1) {
30833
+ this.setupTickHandler(force);
30831
30834
  }
30832
- setupTickHandler() {
30835
+ setupTickHandler(force = !1) {
30836
+ if (!force && this.tickerHandler) return !0;
30833
30837
  const handler = new RAFTickHandler();
30834
30838
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
30835
30839
  }
@@ -30880,7 +30884,7 @@
30880
30884
  return this.status = exports.STATUS.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
30881
30885
  }
30882
30886
  stop() {
30883
- this.status = exports.STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
30887
+ this.status = exports.STATUS.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
30884
30888
  }
30885
30889
  trySyncTickStatus() {
30886
30890
  this.status === exports.STATUS.INITIAL && this.timelines.some(timeline => timeline.isRunning()) ? this.start() : this.status === exports.STATUS.RUNNING && this.timelines.every(timeline => !timeline.isRunning()) && this.stop();
@@ -31193,10 +31197,11 @@
31193
31197
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
31194
31198
  var _a, _b, _c, _d;
31195
31199
  if (custom && customType) {
31196
- const customParams = this.resolveValue(customParameters, graphic, {
31200
+ const customParams = Object.assign({
31197
31201
  width: graphic.stage.width,
31198
- height: graphic.stage.height
31199
- }),
31202
+ height: graphic.stage.height,
31203
+ group: this._target.parent
31204
+ }, this.resolveValue(customParameters, graphic)),
31200
31205
  objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
31201
31206
  customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
31202
31207
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
@@ -31461,7 +31466,6 @@
31461
31466
  }
31462
31467
  animate(params) {
31463
31468
  var _a, _b, _c;
31464
- this.animates || (this.animates = new Map());
31465
31469
  const animate = new Animate(null == params ? void 0 : params.id, null !== (_b = null !== (_a = null == params ? void 0 : params.timeline) && void 0 !== _a ? _a : this.stage && this.stage.getTimeline()) && void 0 !== _b ? _b : defaultTimeline, null == params ? void 0 : params.slience);
31466
31470
  if (animate.bind(this), params) {
31467
31471
  const {
@@ -31471,9 +31475,7 @@
31471
31475
  } = params;
31472
31476
  null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
31473
31477
  }
31474
- return this.animates.set(animate.id, animate), animate.onRemove(() => {
31475
- animate.stop(), this.animates.delete(animate.id);
31476
- }), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31478
+ return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31477
31479
  }
31478
31480
  createTimeline() {
31479
31481
  return new DefaultTimeline();
@@ -31512,7 +31514,7 @@
31512
31514
 
31513
31515
  class ACustomAnimate extends Step {
31514
31516
  constructor(customFrom, customTo, duration, easing, params) {
31515
- super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
31517
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
31516
31518
  }
31517
31519
  update(end, ratio, out) {
31518
31520
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -34674,18 +34676,19 @@
34674
34676
  }
34675
34677
  };
34676
34678
  const moveOut = (graphic, options, animationParameters) => {
34677
- var _a, _b, _c, _d, _e, _f;
34679
+ var _a, _b, _c, _d;
34678
34680
  const {
34679
34681
  offset = 0,
34680
34682
  orient: orient,
34681
34683
  direction: direction,
34682
34684
  point: pointOpt
34683
34685
  } = null != options ? options : {},
34684
- groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth,
34685
- groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight,
34686
+ groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
34687
+ groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
34688
+ groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
34686
34689
  changedX = ("negative" === orient ? groupWidth : 0) + offset,
34687
34690
  changedY = ("negative" === orient ? groupHeight : 0) + offset,
34688
- point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, animationParameters) : pointOpt,
34691
+ point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt,
34689
34692
  fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
34690
34693
  fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
34691
34694
  switch (direction) {
@@ -34858,6 +34861,9 @@
34858
34861
  this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
34859
34862
  }), this.target.setAttributes(this.from);
34860
34863
  }
34864
+ deleteSelfAttr(key) {
34865
+ super.deleteSelfAttr(key), delete this.from[key];
34866
+ }
34861
34867
  update(end, ratio, out) {
34862
34868
  if (this.onStart(), !this.props || !this.propKeys) return;
34863
34869
  const easedRatio = this.easing(ratio);
@@ -35054,7 +35060,7 @@
35054
35060
  AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("fromTo", FromTo), AnimateExecutor.registerBuiltInAnimate("scaleIn", ScaleIn), AnimateExecutor.registerBuiltInAnimate("scaleOut", ScaleOut), AnimateExecutor.registerBuiltInAnimate("growHeightIn", GrowHeightIn), AnimateExecutor.registerBuiltInAnimate("growHeightOut", GrowHeightOut), AnimateExecutor.registerBuiltInAnimate("growWidthIn", GrowWidthIn), AnimateExecutor.registerBuiltInAnimate("growWidthOut", GrowWidthOut), AnimateExecutor.registerBuiltInAnimate("growCenterIn", GrowCenterIn), AnimateExecutor.registerBuiltInAnimate("growCenterOut", GrowCenterOut), AnimateExecutor.registerBuiltInAnimate("clipIn", ClipIn), AnimateExecutor.registerBuiltInAnimate("clipOut", ClipOut), AnimateExecutor.registerBuiltInAnimate("fadeIn", FadeIn), AnimateExecutor.registerBuiltInAnimate("fadeOut", FadeOut), AnimateExecutor.registerBuiltInAnimate("growPointsIn", GrowPointsIn), AnimateExecutor.registerBuiltInAnimate("growPointsOut", GrowPointsOut), AnimateExecutor.registerBuiltInAnimate("growPointsXIn", GrowPointsXIn), AnimateExecutor.registerBuiltInAnimate("growPointsXOut", GrowPointsXOut), AnimateExecutor.registerBuiltInAnimate("growPointsYIn", GrowPointsYIn), AnimateExecutor.registerBuiltInAnimate("growPointsYOut", GrowPointsYOut), AnimateExecutor.registerBuiltInAnimate("growAngleIn", GrowAngleIn), AnimateExecutor.registerBuiltInAnimate("growAngleOut", GrowAngleOut), AnimateExecutor.registerBuiltInAnimate("growRadiusIn", GrowRadiusIn), AnimateExecutor.registerBuiltInAnimate("growRadiusOut", GrowRadiusOut), AnimateExecutor.registerBuiltInAnimate("moveIn", MoveIn), AnimateExecutor.registerBuiltInAnimate("moveOut", MoveOut), AnimateExecutor.registerBuiltInAnimate("rotateIn", RotateIn), AnimateExecutor.registerBuiltInAnimate("rotateOut", RotateOut), AnimateExecutor.registerBuiltInAnimate("update", Update), AnimateExecutor.registerBuiltInAnimate("state", State), AnimateExecutor.registerBuiltInAnimate("labelItemAppear", LabelItemAppear), AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", LabelItemDisappear), AnimateExecutor.registerBuiltInAnimate("poptipAppear", PoptipAppear), AnimateExecutor.registerBuiltInAnimate("poptipDisappear", PoptipDisappear), AnimateExecutor.registerBuiltInAnimate("inputText", InputText), AnimateExecutor.registerBuiltInAnimate("inputRichText", InputRichText), AnimateExecutor.registerBuiltInAnimate("outputRichText", OutputRichText), AnimateExecutor.registerBuiltInAnimate("slideRichText", SlideRichText), AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn), AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn), AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn), AnimateExecutor.registerBuiltInAnimate("strokeIn", StrokeIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut), AnimateExecutor.registerBuiltInAnimate("strokeOut", StrokeOut), AnimateExecutor.registerBuiltInAnimate("pulse", PulseAnimate), AnimateExecutor.registerBuiltInAnimate("MotionPath", MotionPath), AnimateExecutor.registerBuiltInAnimate("streamLight", StreamLight);
35055
35061
  };
35056
35062
 
35057
- const version = "1.0.3";
35063
+ const version = "1.0.4";
35058
35064
  preLoadAllModule();
35059
35065
  if (isBrowserEnv()) {
35060
35066
  loadBrowserEnv(container);