@visactor/vrender 1.0.1 → 1.0.4-alpha.0

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.1";
2
+ export declare const version = "1.0.4-alpha.0";
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.1", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
24
+ exports.version = "1.0.4-alpha.0", (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.1\";\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,eAAe,CAAC;AAEvC,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-alpha.0\";\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
@@ -30318,6 +30318,10 @@ class InterpolateUpdateStore {
30318
30318
  target.attribute.x = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30319
30319
  }, this.y = (key, from, to, ratio, step, target) => {
30320
30320
  target.attribute.y = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30321
+ }, this.dx = (key, from, to, ratio, step, target) => {
30322
+ target.attribute.dx = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30323
+ }, this.dy = (key, from, to, ratio, step, target) => {
30324
+ target.attribute.dy = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30321
30325
  }, this.angle = (key, from, to, ratio, step, target) => {
30322
30326
  target.attribute.angle = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30323
30327
  }, this.scaleX = (key, from, to, ratio, step, target) => {
@@ -30590,7 +30594,9 @@ class Animate {
30590
30594
  return this._timeline;
30591
30595
  }
30592
30596
  bind(target) {
30593
- return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30597
+ return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
30598
+ this.stop(), this.target.animates.delete(this.id);
30599
+ }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30594
30600
  }
30595
30601
  to(props, duration = 300, easing = "linear") {
30596
30602
  const step = new Step(AnimateStepType.to, props, duration, easing);
@@ -30804,8 +30810,8 @@ class DefaultTicker extends EventEmitter {
30804
30810
  }
30805
30811
  init() {
30806
30812
  this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
30807
- this.initHandler();
30808
- }), application.global.env && this.initHandler();
30813
+ this.initHandler(!1);
30814
+ }), application.global.env && this.initHandler(!1);
30809
30815
  }
30810
30816
  addTimeline(timeline) {
30811
30817
  this.timelines.push(timeline);
@@ -30816,10 +30822,11 @@ class DefaultTicker extends EventEmitter {
30816
30822
  getTimelines() {
30817
30823
  return this.timelines;
30818
30824
  }
30819
- initHandler() {
30820
- this.setupTickHandler();
30825
+ initHandler(force = !1) {
30826
+ this.setupTickHandler(force);
30821
30827
  }
30822
- setupTickHandler() {
30828
+ setupTickHandler(force = !1) {
30829
+ if (!force && this.tickerHandler) return !0;
30823
30830
  const handler = new RAFTickHandler();
30824
30831
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
30825
30832
  }
@@ -30870,7 +30877,7 @@ class DefaultTicker extends EventEmitter {
30870
30877
  return this.status = STATUS$1.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
30871
30878
  }
30872
30879
  stop() {
30873
- this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
30880
+ this.status = STATUS$1.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
30874
30881
  }
30875
30882
  trySyncTickStatus() {
30876
30883
  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();
@@ -31183,7 +31190,11 @@ class AnimateExecutor {
31183
31190
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
31184
31191
  var _a, _b, _c, _d;
31185
31192
  if (custom && customType) {
31186
- const customParams = this.resolveValue(customParameters, graphic, {}),
31193
+ const customParams = Object.assign({
31194
+ width: graphic.stage.width,
31195
+ height: graphic.stage.height,
31196
+ group: this._target.parent
31197
+ }, this.resolveValue(customParameters, graphic)),
31187
31198
  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;
31188
31199
  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);
31189
31200
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
@@ -31448,7 +31459,6 @@ class AnimateExtension {
31448
31459
  }
31449
31460
  animate(params) {
31450
31461
  var _a, _b, _c;
31451
- this.animates || (this.animates = new Map());
31452
31462
  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);
31453
31463
  if (animate.bind(this), params) {
31454
31464
  const {
@@ -31458,9 +31468,7 @@ class AnimateExtension {
31458
31468
  } = params;
31459
31469
  null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
31460
31470
  }
31461
- return this.animates.set(animate.id, animate), animate.onRemove(() => {
31462
- animate.stop(), this.animates.delete(animate.id);
31463
- }), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31471
+ return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31464
31472
  }
31465
31473
  createTimeline() {
31466
31474
  return new DefaultTimeline();
@@ -31499,7 +31507,7 @@ function registerAnimate() {
31499
31507
 
31500
31508
  class ACustomAnimate extends Step {
31501
31509
  constructor(customFrom, customTo, duration, easing, params) {
31502
- super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
31510
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
31503
31511
  }
31504
31512
  update(end, ratio, out) {
31505
31513
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -34661,18 +34669,19 @@ const moveIn = (graphic, options, animationParameters) => {
34661
34669
  }
34662
34670
  };
34663
34671
  const moveOut = (graphic, options, animationParameters) => {
34664
- var _a, _b, _c, _d, _e, _f;
34672
+ var _a, _b, _c, _d;
34665
34673
  const {
34666
34674
  offset = 0,
34667
34675
  orient: orient,
34668
34676
  direction: direction,
34669
34677
  point: pointOpt
34670
34678
  } = null != options ? options : {},
34671
- groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth,
34672
- groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight,
34679
+ groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
34680
+ groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
34681
+ groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
34673
34682
  changedX = ("negative" === orient ? groupWidth : 0) + offset,
34674
34683
  changedY = ("negative" === orient ? groupHeight : 0) + offset,
34675
- 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,
34684
+ 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,
34676
34685
  fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
34677
34686
  fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
34678
34687
  switch (direction) {
@@ -34831,11 +34840,11 @@ class FromTo extends ACustomAnimate {
34831
34840
  }
34832
34841
  onBind() {
34833
34842
  var _a, _b;
34834
- super.onBind();
34843
+ super.onBind(), Object.keys(this.from).forEach(key => {
34844
+ null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
34845
+ });
34835
34846
  const finalAttribute = this.target.getFinalAttribute();
34836
- Object.keys(this.from).forEach(key => {
34837
- null == this.props[key] && (this.props[key] = finalAttribute[key]);
34838
- }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
34847
+ "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
34839
34848
  }
34840
34849
  onFirstRun() {
34841
34850
  this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
@@ -35041,7 +35050,7 @@ const registerCustomAnimate = () => {
35041
35050
  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);
35042
35051
  };
35043
35052
 
35044
- const version = "1.0.1";
35053
+ const version = "1.0.4-alpha.0";
35045
35054
  preLoadAllModule();
35046
35055
  if (isBrowserEnv()) {
35047
35056
  loadBrowserEnv(container);
package/dist/index.js CHANGED
@@ -30324,6 +30324,10 @@
30324
30324
  target.attribute.x = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30325
30325
  }, this.y = (key, from, to, ratio, step, target) => {
30326
30326
  target.attribute.y = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30327
+ }, this.dx = (key, from, to, ratio, step, target) => {
30328
+ target.attribute.dx = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30329
+ }, this.dy = (key, from, to, ratio, step, target) => {
30330
+ target.attribute.dy = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30327
30331
  }, this.angle = (key, from, to, ratio, step, target) => {
30328
30332
  target.attribute.angle = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
30329
30333
  }, this.scaleX = (key, from, to, ratio, step, target) => {
@@ -30596,7 +30600,9 @@
30596
30600
  return this._timeline;
30597
30601
  }
30598
30602
  bind(target) {
30599
- return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30603
+ return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
30604
+ this.stop(), this.target.animates.delete(this.id);
30605
+ }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
30600
30606
  }
30601
30607
  to(props, duration = 300, easing = "linear") {
30602
30608
  const step = new Step(exports.AnimateStepType.to, props, duration, easing);
@@ -30810,8 +30816,8 @@
30810
30816
  }
30811
30817
  init() {
30812
30818
  this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
30813
- this.initHandler();
30814
- }), application.global.env && this.initHandler();
30819
+ this.initHandler(!1);
30820
+ }), application.global.env && this.initHandler(!1);
30815
30821
  }
30816
30822
  addTimeline(timeline) {
30817
30823
  this.timelines.push(timeline);
@@ -30822,10 +30828,11 @@
30822
30828
  getTimelines() {
30823
30829
  return this.timelines;
30824
30830
  }
30825
- initHandler() {
30826
- this.setupTickHandler();
30831
+ initHandler(force = !1) {
30832
+ this.setupTickHandler(force);
30827
30833
  }
30828
- setupTickHandler() {
30834
+ setupTickHandler(force = !1) {
30835
+ if (!force && this.tickerHandler) return !0;
30829
30836
  const handler = new RAFTickHandler();
30830
30837
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
30831
30838
  }
@@ -30876,7 +30883,7 @@
30876
30883
  return this.status = exports.STATUS.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
30877
30884
  }
30878
30885
  stop() {
30879
- this.status = exports.STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
30886
+ this.status = exports.STATUS.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
30880
30887
  }
30881
30888
  trySyncTickStatus() {
30882
30889
  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();
@@ -31189,7 +31196,11 @@
31189
31196
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
31190
31197
  var _a, _b, _c, _d;
31191
31198
  if (custom && customType) {
31192
- const customParams = this.resolveValue(customParameters, graphic, {}),
31199
+ const customParams = Object.assign({
31200
+ width: graphic.stage.width,
31201
+ height: graphic.stage.height,
31202
+ group: this._target.parent
31203
+ }, this.resolveValue(customParameters, graphic)),
31193
31204
  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;
31194
31205
  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);
31195
31206
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
@@ -31454,7 +31465,6 @@
31454
31465
  }
31455
31466
  animate(params) {
31456
31467
  var _a, _b, _c;
31457
- this.animates || (this.animates = new Map());
31458
31468
  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);
31459
31469
  if (animate.bind(this), params) {
31460
31470
  const {
@@ -31464,9 +31474,7 @@
31464
31474
  } = params;
31465
31475
  null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
31466
31476
  }
31467
- return this.animates.set(animate.id, animate), animate.onRemove(() => {
31468
- animate.stop(), this.animates.delete(animate.id);
31469
- }), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31477
+ return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
31470
31478
  }
31471
31479
  createTimeline() {
31472
31480
  return new DefaultTimeline();
@@ -31505,7 +31513,7 @@
31505
31513
 
31506
31514
  class ACustomAnimate extends Step {
31507
31515
  constructor(customFrom, customTo, duration, easing, params) {
31508
- super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
31516
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
31509
31517
  }
31510
31518
  update(end, ratio, out) {
31511
31519
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -34667,18 +34675,19 @@
34667
34675
  }
34668
34676
  };
34669
34677
  const moveOut = (graphic, options, animationParameters) => {
34670
- var _a, _b, _c, _d, _e, _f;
34678
+ var _a, _b, _c, _d;
34671
34679
  const {
34672
34680
  offset = 0,
34673
34681
  orient: orient,
34674
34682
  direction: direction,
34675
34683
  point: pointOpt
34676
34684
  } = null != options ? options : {},
34677
- groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth,
34678
- groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight,
34685
+ groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
34686
+ groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
34687
+ groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
34679
34688
  changedX = ("negative" === orient ? groupWidth : 0) + offset,
34680
34689
  changedY = ("negative" === orient ? groupHeight : 0) + offset,
34681
- 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,
34690
+ 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,
34682
34691
  fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
34683
34692
  fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
34684
34693
  switch (direction) {
@@ -34837,11 +34846,11 @@
34837
34846
  }
34838
34847
  onBind() {
34839
34848
  var _a, _b;
34840
- super.onBind();
34849
+ super.onBind(), Object.keys(this.from).forEach(key => {
34850
+ null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
34851
+ });
34841
34852
  const finalAttribute = this.target.getFinalAttribute();
34842
- Object.keys(this.from).forEach(key => {
34843
- null == this.props[key] && (this.props[key] = finalAttribute[key]);
34844
- }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
34853
+ "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
34845
34854
  }
34846
34855
  onFirstRun() {
34847
34856
  this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
@@ -35047,7 +35056,7 @@
35047
35056
  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);
35048
35057
  };
35049
35058
 
35050
- const version = "1.0.1";
35059
+ const version = "1.0.4-alpha.0";
35051
35060
  preLoadAllModule();
35052
35061
  if (isBrowserEnv()) {
35053
35062
  loadBrowserEnv(container);