@visactor/vrender-core 1.1.0-alpha.11 → 1.1.0-alpha.13

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.
Files changed (92) hide show
  1. package/cjs/common/canvas-utils.js +1 -0
  2. package/cjs/common/diff.js +1 -2
  3. package/cjs/common/explicit-binding.js +1 -1
  4. package/cjs/common/generator.js +1 -1
  5. package/cjs/common/matrix.js +1 -1
  6. package/cjs/common/morphing-utils.js +1 -1
  7. package/cjs/common/path-svg.js +1 -1
  8. package/cjs/common/performance-raf.js +1 -1
  9. package/cjs/common/polygon.js +2 -2
  10. package/cjs/common/rect-utils.js +1 -1
  11. package/cjs/common/render-area.js +1 -1
  12. package/cjs/common/render-command-list.js +1 -1
  13. package/cjs/common/render-curve.js +1 -1
  14. package/cjs/common/render-utils.js +1 -1
  15. package/cjs/common/seg-context.js +1 -2
  16. package/cjs/common/simplify.js +1 -1
  17. package/cjs/common/sort.js +1 -1
  18. package/cjs/common/split-path.js +1 -1
  19. package/cjs/common/store.js +1 -1
  20. package/cjs/common/text.js +1 -1
  21. package/cjs/common/utils.js +1 -1
  22. package/cjs/core/camera.js +1 -1
  23. package/cjs/core/constants.js +1 -1
  24. package/cjs/core/core-modules.js +1 -1
  25. package/cjs/core/global-module.js +2 -0
  26. package/cjs/core/global.js +1 -1
  27. package/cjs/core/graphic-utils.js +1 -1
  28. package/cjs/core/index.js +1 -1
  29. package/cjs/core/layer-service.js +2 -1
  30. package/cjs/core/layer.js +1 -1
  31. package/cjs/core/light.js +1 -1
  32. package/cjs/core/stage.js +1 -1
  33. package/cjs/core/window.js +1 -1
  34. package/cjs/entries/app-context.js +1 -1
  35. package/cjs/entries/browser.js +1 -1
  36. package/cjs/entries/index.js +1 -1
  37. package/cjs/entries/miniapp.js +1 -1
  38. package/cjs/entries/node.js +1 -1
  39. package/cjs/entries/runtime-installer.js +1 -1
  40. package/cjs/entries/types.js +1 -1
  41. package/cjs/graphic/graphic.d.ts +4 -0
  42. package/cjs/graphic/graphic.js +31 -4
  43. package/cjs/graphic/graphic.js.map +1 -1
  44. package/cjs/interface/animation/animate.d.ts +1 -0
  45. package/cjs/interface/animation/animate.js.map +1 -1
  46. package/dist/index.es.js +77 -3
  47. package/es/common/canvas-utils.js +2 -1
  48. package/es/common/diff.js +1 -2
  49. package/es/common/explicit-binding.js +1 -1
  50. package/es/common/generator.js +1 -1
  51. package/es/common/matrix.js +1 -1
  52. package/es/common/morphing-utils.js +1 -1
  53. package/es/common/path-svg.js +1 -1
  54. package/es/common/performance-raf.js +1 -1
  55. package/es/common/polygon.js +1 -1
  56. package/es/common/rect-utils.js +1 -1
  57. package/es/common/render-area.js +1 -1
  58. package/es/common/render-command-list.js +1 -1
  59. package/es/common/render-curve.js +1 -1
  60. package/es/common/render-utils.js +1 -1
  61. package/es/common/seg-context.js +1 -2
  62. package/es/common/simplify.js +1 -1
  63. package/es/common/sort.js +1 -1
  64. package/es/common/split-path.js +1 -1
  65. package/es/common/store.js +1 -1
  66. package/es/common/text.js +1 -1
  67. package/es/common/utils.js +1 -1
  68. package/es/core/camera.js +1 -1
  69. package/es/core/constants.js +1 -1
  70. package/es/core/core-modules.js +1 -1
  71. package/es/core/global-module.js +2 -0
  72. package/es/core/global.js +1 -1
  73. package/es/core/graphic-utils.js +1 -1
  74. package/es/core/index.js +1 -1
  75. package/es/core/layer-service.js +2 -1
  76. package/es/core/layer.js +1 -1
  77. package/es/core/light.js +1 -1
  78. package/es/core/stage.js +1 -1
  79. package/es/core/window.js +1 -1
  80. package/es/entries/app-context.js +1 -1
  81. package/es/entries/browser.js +1 -1
  82. package/es/entries/index.js +1 -1
  83. package/es/entries/miniapp.js +1 -1
  84. package/es/entries/node.js +1 -1
  85. package/es/entries/runtime-installer.js +1 -1
  86. package/es/entries/types.js +1 -1
  87. package/es/graphic/graphic.d.ts +4 -0
  88. package/es/graphic/graphic.js +31 -4
  89. package/es/graphic/graphic.js.map +1 -1
  90. package/es/interface/animation/animate.d.ts +1 -0
  91. package/es/interface/animation/animate.js.map +1 -1
  92. package/package.json +3 -3
@@ -35,6 +35,7 @@ export interface IStep {
35
35
  getFromProps: () => Record<string, any> | void;
36
36
  getMergedEndProps: () => Record<string, any> | void;
37
37
  deleteSelfAttr: (key: string) => void;
38
+ deleteSelfAttrs: (keys: string[]) => void;
38
39
  stop: () => void;
39
40
  release: () => void;
40
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/animation/animate.ts"],"names":[],"mappings":";;;AAyKA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n\n // 停止\n stop: () => void;\n\n // 释放\n release: () => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/animation/animate.ts"],"names":[],"mappings":";;;AA2KA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n // 批量屏蔽自身属性,避免大量图元切换时反复 splice/delete\n deleteSelfAttrs: (keys: string[]) => void;\n\n // 停止\n stop: () => void;\n\n // 释放\n release: () => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n"]}
package/dist/index.es.js CHANGED
@@ -11309,16 +11309,90 @@ class Graphic extends Node {
11309
11309
  this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
11310
11310
  }
11311
11311
  setAttributesAndPreventAnimate(params, forceUpdateTag = false, context, ignorePriority) {
11312
+ if (!params) {
11313
+ return;
11314
+ }
11315
+ const keys = Object.keys(params);
11316
+ this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context);
11312
11317
  this.visitTrackedAnimates(animate => {
11313
11318
  if (animate.priority === Infinity && !ignorePriority) {
11314
11319
  return;
11315
11320
  }
11316
- Object.keys(params).forEach(key => {
11317
- animate.preventAttr(key);
11318
- });
11321
+ animate.preventAttrs(keys);
11319
11322
  });
11320
11323
  this.applyTransientAttributes(params, forceUpdateTag, context);
11321
11324
  }
11325
+ captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
11326
+ var _a;
11327
+ const graphicContext = this.context;
11328
+ const diffAttrs = graphicContext === null || graphicContext === void 0 ? void 0 : graphicContext.diffAttrs;
11329
+ const updateType = context === null || context === void 0 ? void 0 : context.type;
11330
+ if (!keys.length ||
11331
+ !graphicContext ||
11332
+ !diffAttrs ||
11333
+ updateType === AttributeUpdateType.STATE ||
11334
+ (updateType != null &&
11335
+ updateType >= AttributeUpdateType.ANIMATE_BIND &&
11336
+ updateType <= AttributeUpdateType.ANIMATE_END)) {
11337
+ return;
11338
+ }
11339
+ let fromAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs
11340
+ ? (_a = this.transientFromAttrsBeforePreventAnimate) !== null && _a !== void 0 ? _a : null
11341
+ : null;
11342
+ let captured = false;
11343
+ for (let i = 0; i < keys.length; i++) {
11344
+ const key = keys[i];
11345
+ if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) {
11346
+ continue;
11347
+ }
11348
+ const previousValue = this.attribute[key];
11349
+ const nextValue = params[key];
11350
+ if (isEqual(previousValue, nextValue)) {
11351
+ continue;
11352
+ }
11353
+ fromAttrs !== null && fromAttrs !== void 0 ? fromAttrs : (fromAttrs = {});
11354
+ fromAttrs[key] = cloneAttributeValue(previousValue);
11355
+ captured = true;
11356
+ }
11357
+ if (captured) {
11358
+ this.transientFromAttrsBeforePreventAnimate = fromAttrs;
11359
+ this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs;
11360
+ }
11361
+ }
11362
+ consumeTransientFromAttrsBeforePreventAnimate(rawDiffAttrs, diffAttrs) {
11363
+ const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate;
11364
+ if (!transientFromAttrs || this.transientFromAttrsBeforePreventAnimateDiffAttrs !== rawDiffAttrs) {
11365
+ return null;
11366
+ }
11367
+ let fromAttrs = null;
11368
+ let remaining = false;
11369
+ for (const key in transientFromAttrs) {
11370
+ if (!Object.prototype.hasOwnProperty.call(transientFromAttrs, key)) {
11371
+ continue;
11372
+ }
11373
+ if (Object.prototype.hasOwnProperty.call(diffAttrs, key)) {
11374
+ fromAttrs !== null && fromAttrs !== void 0 ? fromAttrs : (fromAttrs = {});
11375
+ fromAttrs[key] = transientFromAttrs[key];
11376
+ continue;
11377
+ }
11378
+ remaining = true;
11379
+ }
11380
+ if (remaining) {
11381
+ const nextTransientFromAttrs = {};
11382
+ for (const key in transientFromAttrs) {
11383
+ if (Object.prototype.hasOwnProperty.call(transientFromAttrs, key) &&
11384
+ !Object.prototype.hasOwnProperty.call(diffAttrs, key)) {
11385
+ nextTransientFromAttrs[key] = transientFromAttrs[key];
11386
+ }
11387
+ }
11388
+ this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;
11389
+ }
11390
+ else {
11391
+ this.transientFromAttrsBeforePreventAnimate = null;
11392
+ this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
11393
+ }
11394
+ return fromAttrs;
11395
+ }
11322
11396
  setAttributes(params, forceUpdateTag = false, context) {
11323
11397
  if (!params) {
11324
11398
  return;
@@ -51,4 +51,5 @@ function createConicGradient(context, color, x, y, w, h) {
51
51
  return color.stops.forEach((stop => {
52
52
  canvasGradient.addColorStop(stop.offset, stop.color);
53
53
  })), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
54
- }
54
+ }
55
+ //# sourceMappingURL=canvas-utils.js.map
package/es/common/diff.js CHANGED
@@ -8,5 +8,4 @@ export function diff(oldAttrs, newAttrs, getAttr) {
8
8
  void 0 !== value && (diffObj[key] = value);
9
9
  }
10
10
  return diffObj;
11
- }
12
- //# sourceMappingURL=diff.js.map
11
+ }
@@ -7,4 +7,4 @@ export function resolveContainerBinding(container, serviceIdentifier) {
7
7
  if (null == instance) throw new Error(`No binding found for ${describeServiceIdentifier(serviceIdentifier)}.`);
8
8
  return instance;
9
9
  }
10
- //# sourceMappingURL=explicit-binding.js.map
10
+ //# sourceMappingURL=explicit-binding.js.map
@@ -5,4 +5,4 @@ export class Generator {
5
5
  }
6
6
 
7
7
  Generator.auto_increment_id = 0;
8
- //# sourceMappingURL=generator.js.map
8
+ //# sourceMappingURL=generator.js.map
@@ -118,4 +118,4 @@ export function transformMat4(out, a, m) {
118
118
  return w = w || 1, out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w, out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w,
119
119
  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
120
120
  }
121
- //# sourceMappingURL=matrix.js.map
121
+ //# sourceMappingURL=matrix.js.map
@@ -189,4 +189,4 @@ export function bezierCurversToPath(bezierCurves) {
189
189
  }
190
190
  return path;
191
191
  }
192
- //# sourceMappingURL=morphing-utils.js.map
192
+ //# sourceMappingURL=morphing-utils.js.map
@@ -55,4 +55,4 @@ export function parseSvgPath(str) {
55
55
  } else result.push(currCommandData);
56
56
  return result;
57
57
  }
58
- //# sourceMappingURL=path-svg.js.map
58
+ //# sourceMappingURL=path-svg.js.map
@@ -26,4 +26,4 @@ export class PerformanceRAF {
26
26
  }));
27
27
  }
28
28
  }
29
- //# sourceMappingURL=performance-raf.js.map
29
+ //# sourceMappingURL=performance-raf.js.map
@@ -38,4 +38,4 @@ function getProportionPoint(point, segment, length, dx, dy) {
38
38
  y: point.y - dy * factor
39
39
  };
40
40
  }
41
- //# sourceMappingURL=polygon.js.map
41
+ //# sourceMappingURL=polygon.js.map
@@ -17,4 +17,4 @@ export const normalizeRectAttributes = attribute => {
17
17
  height: height
18
18
  };
19
19
  };
20
- //# sourceMappingURL=rect-utils.js.map
20
+ //# sourceMappingURL=rect-utils.js.map
@@ -61,4 +61,4 @@ function drawAreaBlock(path, topList, bottomList, params) {
61
61
  }
62
62
  path.closePath();
63
63
  }
64
- //# sourceMappingURL=render-area.js.map
64
+ //# sourceMappingURL=render-area.js.map
@@ -6,4 +6,4 @@ export function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy
6
6
  commandFuncs[command[0]](command, context, x, y, sx, sy, z);
7
7
  }
8
8
  }
9
- //# sourceMappingURL=render-command-list.js.map
9
+ //# sourceMappingURL=render-command-list.js.map
@@ -93,4 +93,4 @@ export function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
93
93
  path.closePath();
94
94
  }));
95
95
  }
96
- //# sourceMappingURL=render-curve.js.map
96
+ //# sourceMappingURL=render-curve.js.map
@@ -11,4 +11,4 @@ export function drawSegItem(ctx, curve, endPercent, params) {
11
11
  ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
12
12
  }
13
13
  }
14
- //# sourceMappingURL=render-utils.js.map
14
+ //# sourceMappingURL=render-utils.js.map
@@ -90,5 +90,4 @@ export class ReflectSegContext extends SegContext {
90
90
  clear() {
91
91
  return super.clear();
92
92
  }
93
- }
94
- //# sourceMappingURL=seg-context.js.map
93
+ }
@@ -30,4 +30,4 @@ export function flatten_simplify(points, tolerance, highestQuality) {
30
30
  if (points.length <= 10) return points;
31
31
  return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
32
32
  }
33
- //# sourceMappingURL=simplify.js.map
33
+ //# sourceMappingURL=simplify.js.map
package/es/common/sort.js CHANGED
@@ -94,4 +94,4 @@ export function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
94
94
  !1)), reverse);
95
95
  return result;
96
96
  }
97
- //# sourceMappingURL=sort.js.map
97
+ //# sourceMappingURL=sort.js.map
@@ -248,4 +248,4 @@ export const splitPath = (path, count) => {
248
248
  }
249
249
  return res;
250
250
  };
251
- //# sourceMappingURL=split-path.js.map
251
+ //# sourceMappingURL=split-path.js.map
@@ -1,2 +1,2 @@
1
1
  class StageStore {}
2
- //# sourceMappingURL=store.js.map
2
+ //# sourceMappingURL=store.js.map
package/es/common/text.js CHANGED
@@ -24,4 +24,4 @@ export function textAttributesToStyle(attrs) {
24
24
  attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"),
25
25
  attrs.fill && isString(attrs.fill) && (style.color = attrs.fill), style;
26
26
  }
27
- //# sourceMappingURL=text.js.map
27
+ //# sourceMappingURL=text.js.map
@@ -148,4 +148,4 @@ export const calculateLineHeight = (lineHeight, fontSize) => {
148
148
  const _lh = _calculateLineHeight(lineHeight, fontSize);
149
149
  return isNaN(_lh) ? _lh : Math.max(fontSize, _lh);
150
150
  };
151
- //# sourceMappingURL=utils.js.map
151
+ //# sourceMappingURL=utils.js.map
package/es/core/camera.js CHANGED
@@ -66,4 +66,4 @@ export class OrthoCamera {
66
66
  export const registerOrthoCamera = () => {
67
67
  Factory.registerPlugin("OrthoCamera", OrthoCamera);
68
68
  };
69
- //# sourceMappingURL=camera.js.map
69
+ //# sourceMappingURL=camera.js.map
@@ -9,4 +9,4 @@ export const StaticLayerHandlerContribution = Symbol.for("StaticLayerHandlerCont
9
9
  export const DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution");
10
10
 
11
11
  export const VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
12
- //# sourceMappingURL=constants.js.map
12
+ //# sourceMappingURL=constants.js.map
@@ -21,4 +21,4 @@ export function bindCoreModules({bind: bind}) {
21
21
  }
22
22
 
23
23
  export default bindCoreModules;
24
- //# sourceMappingURL=core-modules.js.map
24
+ //# sourceMappingURL=core-modules.js.map
@@ -1 +1,3 @@
1
+
2
+
1
3
  //# sourceMappingURL=global-module.js.map
package/es/core/global.js CHANGED
@@ -222,4 +222,4 @@ export class DefaultGlobal extends EventListenerManager {
222
222
  return this._env || this.setEnv("browser"), this.envContribution.copyToClipBoard(text);
223
223
  }
224
224
  }
225
- //# sourceMappingURL=global.js.map
225
+ //# sourceMappingURL=global.js.map
@@ -162,4 +162,4 @@ export class DefaultTransformUtil {
162
162
  return this;
163
163
  }
164
164
  }
165
- //# sourceMappingURL=graphic-utils.js.map
165
+ //# sourceMappingURL=graphic-utils.js.map
package/es/core/index.js CHANGED
@@ -15,4 +15,4 @@ export * from "./layer-service";
15
15
  export * from "./constants";
16
16
 
17
17
  export * from "../interface/core";
18
- //# sourceMappingURL=index.js.map
18
+ //# sourceMappingURL=index.js.map
@@ -75,4 +75,5 @@ export class DefaultLayerService {
75
75
  }
76
76
  }
77
77
 
78
- DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0;
78
+ DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0;
79
+ //# sourceMappingURL=layer-service.js.map
package/es/core/layer.js CHANGED
@@ -112,4 +112,4 @@ export class Layer extends Group {
112
112
  }, params)), this.afterDrawCbs.forEach((c => c(this)));
113
113
  }
114
114
  }
115
- //# sourceMappingURL=layer.js.map
115
+ //# sourceMappingURL=layer.js.map
package/es/core/light.js CHANGED
@@ -23,4 +23,4 @@ export class DirectionalLight {
23
23
  export const registerDirectionalLight = () => {
24
24
  Factory.registerPlugin("DirectionalLight", DirectionalLight);
25
25
  };
26
- //# sourceMappingURL=light.js.map
26
+ //# sourceMappingURL=light.js.map
package/es/core/stage.js CHANGED
@@ -605,4 +605,4 @@ export class Stage extends Group {
605
605
  this.renderService.reInit(), this.pickerService.reInit();
606
606
  }
607
607
  }
608
- //# sourceMappingURL=stage.js.map
608
+ //# sourceMappingURL=stage.js.map
package/es/core/window.js CHANGED
@@ -150,4 +150,4 @@ export class DefaultWindow extends EventListenerManager {
150
150
  return this._handler.getTopLeft(baseWindow);
151
151
  }
152
152
  }
153
- //# sourceMappingURL=window.js.map
153
+ //# sourceMappingURL=window.js.map
@@ -83,4 +83,4 @@ export class AppContext {
83
83
  };
84
84
  }
85
85
  }
86
- //# sourceMappingURL=app-context.js.map
86
+ //# sourceMappingURL=app-context.js.map
@@ -33,4 +33,4 @@ export class BrowserEntry {
33
33
  export function createBrowserApp(options = {}) {
34
34
  return new BrowserEntry(options);
35
35
  }
36
- //# sourceMappingURL=browser.js.map
36
+ //# sourceMappingURL=browser.js.map
@@ -11,4 +11,4 @@ export * from "./miniapp";
11
11
  export * from "./runtime-installer";
12
12
 
13
13
  export { createBrowserApp as createApp } from "./browser";
14
- //# sourceMappingURL=index.js.map
14
+ //# sourceMappingURL=index.js.map
@@ -9,4 +9,4 @@ export class MiniappEntry extends BrowserEntry {
9
9
  export function createMiniappApp(options = {}) {
10
10
  return new MiniappEntry(options);
11
11
  }
12
- //# sourceMappingURL=miniapp.js.map
12
+ //# sourceMappingURL=miniapp.js.map
@@ -9,4 +9,4 @@ export class NodeEntry extends BrowserEntry {
9
9
  export function createNodeApp(options = {}) {
10
10
  return new NodeEntry(options);
11
11
  }
12
- //# sourceMappingURL=node.js.map
12
+ //# sourceMappingURL=node.js.map
@@ -127,4 +127,4 @@ export function installRuntimePickersToApp(app, serviceIdentifier) {
127
127
  const pickers = bindingContext.getAll(serviceIdentifier);
128
128
  app.registry.picker.clear(), registerRuntimeEntries(((key, picker) => app.registry.picker.register(key, picker)), pickers, "runtime-picker");
129
129
  }
130
- //# sourceMappingURL=runtime-installer.js.map
130
+ //# sourceMappingURL=runtime-installer.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -52,6 +52,8 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
52
52
  static mixin(source: Dict<any>): void;
53
53
  _events?: any;
54
54
  context?: Record<string, any>;
55
+ private transientFromAttrsBeforePreventAnimate?;
56
+ private transientFromAttrsBeforePreventAnimateDiffAttrs?;
55
57
  static userSymbolMap: Record<string, ISymbolClass>;
56
58
  onBeforeAttributeUpdate?: (val: any, attributes: Partial<T>, key: null | string | string[], context?: ISetAttributeContext) => T | undefined;
57
59
  parent: any;
@@ -189,6 +191,8 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
189
191
  containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
190
192
  protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
191
193
  setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext, ignorePriority?: boolean): void;
194
+ protected captureTransientFromAttrsBeforePreventAnimate(params: Partial<T>, keys: string[], context?: ISetAttributeContext): void;
195
+ protected consumeTransientFromAttrsBeforePreventAnimate(rawDiffAttrs: Record<string, any>, diffAttrs: Record<string, any>): Record<string, any> | null;
192
196
  setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
193
197
  _setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
194
198
  setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
@@ -555,12 +555,39 @@ export class Graphic extends Node {
555
555
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
556
556
  }
557
557
  setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
558
- this.visitTrackedAnimates((animate => {
559
- (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach((key => {
560
- animate.preventAttr(key);
561
- }));
558
+ if (!params) return;
559
+ const keys = Object.keys(params);
560
+ this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.visitTrackedAnimates((animate => {
561
+ (animate.priority !== 1 / 0 || ignorePriority) && animate.preventAttrs(keys);
562
562
  })), this.applyTransientAttributes(params, forceUpdateTag, context);
563
563
  }
564
+ captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
565
+ var _a;
566
+ const graphicContext = this.context, diffAttrs = null == graphicContext ? void 0 : graphicContext.diffAttrs, updateType = null == context ? void 0 : context.type;
567
+ if (!keys.length || !graphicContext || !diffAttrs || updateType === AttributeUpdateType.STATE || null != updateType && updateType >= AttributeUpdateType.ANIMATE_BIND && updateType <= AttributeUpdateType.ANIMATE_END) return;
568
+ let fromAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs && null !== (_a = this.transientFromAttrsBeforePreventAnimate) && void 0 !== _a ? _a : null, captured = !1;
569
+ for (let i = 0; i < keys.length; i++) {
570
+ const key = keys[i];
571
+ if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) continue;
572
+ const previousValue = this.attribute[key], nextValue = params[key];
573
+ isEqual(previousValue, nextValue) || (null != fromAttrs || (fromAttrs = {}), fromAttrs[key] = cloneAttributeValue(previousValue),
574
+ captured = !0);
575
+ }
576
+ captured && (this.transientFromAttrsBeforePreventAnimate = fromAttrs, this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs);
577
+ }
578
+ consumeTransientFromAttrsBeforePreventAnimate(rawDiffAttrs, diffAttrs) {
579
+ const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate;
580
+ if (!transientFromAttrs || this.transientFromAttrsBeforePreventAnimateDiffAttrs !== rawDiffAttrs) return null;
581
+ let fromAttrs = null, remaining = !1;
582
+ for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && (Object.prototype.hasOwnProperty.call(diffAttrs, key) ? (null != fromAttrs || (fromAttrs = {}),
583
+ fromAttrs[key] = transientFromAttrs[key]) : remaining = !0);
584
+ if (remaining) {
585
+ const nextTransientFromAttrs = {};
586
+ for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && !Object.prototype.hasOwnProperty.call(diffAttrs, key) && (nextTransientFromAttrs[key] = transientFromAttrs[key]);
587
+ this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;
588
+ } else this.transientFromAttrsBeforePreventAnimate = null, this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
589
+ return fromAttrs;
590
+ }
564
591
  setAttributes(params, forceUpdateTag = !1, context) {
565
592
  params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
566
593
  isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),