@visactor/vrender-core 0.21.1-alpha.1 → 0.21.2-vstory.1

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 (264) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +2 -0
  2. package/cjs/animate/Ticker/default-ticker.js +7 -1
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  4. package/cjs/animate/animate.js +1 -1
  5. package/cjs/animate/animate.js.map +1 -1
  6. package/cjs/animate/easing-func.d.ts +1 -0
  7. package/cjs/animate/easing-func.js +16 -0
  8. package/cjs/animate/easing-func.js.map +1 -0
  9. package/cjs/animate/easing.d.ts +4 -0
  10. package/cjs/animate/easing.js +12 -1
  11. package/cjs/animate/easing.js.map +1 -1
  12. package/cjs/animate/index.d.ts +1 -0
  13. package/cjs/animate/index.js +1 -1
  14. package/cjs/animate/index.js.map +1 -1
  15. package/cjs/color-string/store.js +1 -2
  16. package/cjs/common/3d-interceptor.js +2 -1
  17. package/cjs/common/bezier-utils.d.ts +3 -0
  18. package/cjs/common/bezier-utils.js +17 -2
  19. package/cjs/common/bezier-utils.js.map +1 -1
  20. package/cjs/common/custom-path2d.d.ts +4 -0
  21. package/cjs/common/custom-path2d.js +43 -11
  22. package/cjs/common/custom-path2d.js.map +1 -1
  23. package/cjs/common/render-area.js +0 -1
  24. package/cjs/common/render-command-list.js +2 -1
  25. package/cjs/common/render-curve.js +1 -1
  26. package/cjs/common/render-curve.js.map +1 -1
  27. package/cjs/common/segment/curve/arc.d.ts +4 -1
  28. package/cjs/common/segment/curve/arc.js +10 -1
  29. package/cjs/common/segment/curve/arc.js.map +1 -1
  30. package/cjs/common/segment/curve/base.d.ts +4 -1
  31. package/cjs/common/segment/curve/base.js.map +1 -1
  32. package/cjs/common/segment/curve/cubic-bezier.d.ts +5 -1
  33. package/cjs/common/segment/curve/cubic-bezier.js +24 -3
  34. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  35. package/cjs/common/segment/curve/curve-context.js +5 -4
  36. package/cjs/common/segment/curve/curve-context.js.map +1 -1
  37. package/cjs/common/segment/curve/ellipse.d.ts +4 -1
  38. package/cjs/common/segment/curve/ellipse.js +9 -0
  39. package/cjs/common/segment/curve/ellipse.js.map +1 -1
  40. package/cjs/common/segment/curve/line.d.ts +4 -1
  41. package/cjs/common/segment/curve/line.js +18 -0
  42. package/cjs/common/segment/curve/line.js.map +1 -1
  43. package/cjs/common/segment/curve/move.d.ts +4 -1
  44. package/cjs/common/segment/curve/move.js +9 -0
  45. package/cjs/common/segment/curve/move.js.map +1 -1
  46. package/cjs/common/segment/curve/path.d.ts +2 -1
  47. package/cjs/common/segment/curve/path.js +5 -2
  48. package/cjs/common/segment/curve/path.js.map +1 -1
  49. package/cjs/common/segment/curve/quadratic-bezier.d.ts +6 -2
  50. package/cjs/common/segment/curve/quadratic-bezier.js +23 -5
  51. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  52. package/cjs/common/store.js +1 -1
  53. package/cjs/constants.d.ts +1 -0
  54. package/cjs/constants.js +3 -2
  55. package/cjs/constants.js.map +1 -1
  56. package/cjs/graphic/builtin-symbol/rect.d.ts +2 -1
  57. package/cjs/graphic/builtin-symbol/rect.js +28 -0
  58. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  59. package/cjs/graphic/builtin-symbol/utils.d.ts +2 -1
  60. package/cjs/graphic/builtin-symbol/utils.js +5 -0
  61. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  62. package/cjs/graphic/config.js +6 -1
  63. package/cjs/graphic/config.js.map +1 -1
  64. package/cjs/graphic/graphic.js +2 -1
  65. package/cjs/graphic/graphic.js.map +1 -1
  66. package/cjs/graphic/group.js +10 -5
  67. package/cjs/graphic/group.js.map +1 -1
  68. package/cjs/graphic/node-tree.js +3 -3
  69. package/cjs/graphic/node-tree.js.map +1 -1
  70. package/cjs/graphic/richtext/utils.js +3 -3
  71. package/cjs/graphic/richtext/utils.js.map +1 -1
  72. package/cjs/graphic/richtext/wrapper.d.ts +1 -0
  73. package/cjs/graphic/richtext/wrapper.js +1 -1
  74. package/cjs/graphic/richtext/wrapper.js.map +1 -1
  75. package/cjs/graphic/richtext.js +3 -2
  76. package/cjs/graphic/richtext.js.map +1 -1
  77. package/cjs/index.d.ts +1 -0
  78. package/cjs/index.js +1 -1
  79. package/cjs/index.js.map +1 -1
  80. package/cjs/interface/animate.d.ts +5 -39
  81. package/cjs/interface/animate.js.map +1 -1
  82. package/cjs/interface/graphic/path.d.ts +1 -0
  83. package/cjs/interface/graphic/path.js.map +1 -1
  84. package/cjs/interface/graphic/symbol.d.ts +2 -0
  85. package/cjs/interface/graphic/symbol.js.map +1 -1
  86. package/cjs/interface/graphic.d.ts +6 -2
  87. package/cjs/interface/graphic.js.map +1 -1
  88. package/cjs/interface/path.d.ts +5 -0
  89. package/cjs/interface/path.js.map +1 -1
  90. package/cjs/interface/picker.d.ts +13 -0
  91. package/cjs/interface/picker.js.map +1 -1
  92. package/cjs/picker/constants.d.ts +2 -0
  93. package/cjs/picker/constants.js +3 -2
  94. package/cjs/picker/constants.js.map +1 -1
  95. package/cjs/picker/pick-interceptor.d.ts +7 -2
  96. package/cjs/picker/pick-interceptor.js +19 -2
  97. package/cjs/picker/pick-interceptor.js.map +1 -1
  98. package/cjs/picker/pick-modules.js +7 -4
  99. package/cjs/picker/pick-modules.js.map +1 -1
  100. package/cjs/picker/picker-service.d.ts +4 -2
  101. package/cjs/picker/picker-service.js +13 -12
  102. package/cjs/picker/picker-service.js.map +1 -1
  103. package/cjs/plugins/builtin-plugin/edit-module.d.ts +6 -5
  104. package/cjs/plugins/builtin-plugin/edit-module.js +84 -28
  105. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  106. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  107. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  108. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  109. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +49 -30
  110. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +280 -217
  111. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  112. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  113. package/cjs/render/contributions/render/base-render.d.ts +1 -0
  114. package/cjs/render/contributions/render/base-render.js +20 -2
  115. package/cjs/render/contributions/render/base-render.js.map +1 -1
  116. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  117. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +29 -2
  118. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  119. package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +8 -1
  120. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +30 -2
  121. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  122. package/cjs/render/contributions/render/draw-contribution.d.ts +1 -0
  123. package/cjs/render/contributions/render/draw-contribution.js +15 -7
  124. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  125. package/cjs/render/contributions/render/path-render.js.map +1 -1
  126. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  127. package/cjs/render/contributions/render/symbol-render.js +15 -12
  128. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  129. package/cjs/render/contributions/render/utils.d.ts +1 -2
  130. package/cjs/render/contributions/render/utils.js +4 -20
  131. package/cjs/render/contributions/render/utils.js.map +1 -1
  132. package/dist/index.es.js +8282 -7662
  133. package/es/animate/Ticker/default-ticker.d.ts +2 -0
  134. package/es/animate/Ticker/default-ticker.js +7 -1
  135. package/es/animate/Ticker/default-ticker.js.map +1 -1
  136. package/es/animate/animate.js +1 -1
  137. package/es/animate/animate.js.map +1 -1
  138. package/es/animate/easing-func.d.ts +1 -0
  139. package/es/animate/easing-func.js +10 -0
  140. package/es/animate/easing-func.js.map +1 -0
  141. package/es/animate/easing.d.ts +4 -0
  142. package/es/animate/easing.js +12 -1
  143. package/es/animate/easing.js.map +1 -1
  144. package/es/animate/index.d.ts +1 -0
  145. package/es/animate/index.js +2 -0
  146. package/es/animate/index.js.map +1 -1
  147. package/es/color-string/store.js +1 -2
  148. package/es/common/3d-interceptor.js +2 -1
  149. package/es/common/bezier-utils.d.ts +3 -0
  150. package/es/common/bezier-utils.js +14 -0
  151. package/es/common/bezier-utils.js.map +1 -1
  152. package/es/common/custom-path2d.d.ts +4 -0
  153. package/es/common/custom-path2d.js +44 -12
  154. package/es/common/custom-path2d.js.map +1 -1
  155. package/es/common/render-area.js +1 -2
  156. package/es/common/render-command-list.js +2 -1
  157. package/es/common/render-curve.js +1 -1
  158. package/es/common/render-curve.js.map +1 -1
  159. package/es/common/segment/curve/arc.d.ts +4 -1
  160. package/es/common/segment/curve/arc.js +10 -1
  161. package/es/common/segment/curve/arc.js.map +1 -1
  162. package/es/common/segment/curve/base.d.ts +4 -1
  163. package/es/common/segment/curve/base.js.map +1 -1
  164. package/es/common/segment/curve/cubic-bezier.d.ts +5 -1
  165. package/es/common/segment/curve/cubic-bezier.js +22 -1
  166. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  167. package/es/common/segment/curve/curve-context.js +6 -3
  168. package/es/common/segment/curve/curve-context.js.map +1 -1
  169. package/es/common/segment/curve/ellipse.d.ts +4 -1
  170. package/es/common/segment/curve/ellipse.js +9 -0
  171. package/es/common/segment/curve/ellipse.js.map +1 -1
  172. package/es/common/segment/curve/line.d.ts +4 -1
  173. package/es/common/segment/curve/line.js +18 -0
  174. package/es/common/segment/curve/line.js.map +1 -1
  175. package/es/common/segment/curve/move.d.ts +4 -1
  176. package/es/common/segment/curve/move.js +9 -0
  177. package/es/common/segment/curve/move.js.map +1 -1
  178. package/es/common/segment/curve/path.d.ts +2 -1
  179. package/es/common/segment/curve/path.js +5 -2
  180. package/es/common/segment/curve/path.js.map +1 -1
  181. package/es/common/segment/curve/quadratic-bezier.d.ts +6 -2
  182. package/es/common/segment/curve/quadratic-bezier.js +28 -5
  183. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  184. package/es/common/store.js +1 -1
  185. package/es/constants.d.ts +1 -0
  186. package/es/constants.js +2 -0
  187. package/es/constants.js.map +1 -1
  188. package/es/graphic/builtin-symbol/rect.d.ts +2 -1
  189. package/es/graphic/builtin-symbol/rect.js +28 -0
  190. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  191. package/es/graphic/builtin-symbol/utils.d.ts +2 -1
  192. package/es/graphic/builtin-symbol/utils.js +5 -0
  193. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  194. package/es/graphic/config.js +6 -1
  195. package/es/graphic/config.js.map +1 -1
  196. package/es/graphic/graphic.js +2 -1
  197. package/es/graphic/graphic.js.map +1 -1
  198. package/es/graphic/group.js +10 -5
  199. package/es/graphic/group.js.map +1 -1
  200. package/es/graphic/node-tree.js +3 -3
  201. package/es/graphic/node-tree.js.map +1 -1
  202. package/es/graphic/richtext/utils.js +4 -2
  203. package/es/graphic/richtext/utils.js.map +1 -1
  204. package/es/graphic/richtext/wrapper.d.ts +1 -0
  205. package/es/graphic/richtext/wrapper.js +1 -1
  206. package/es/graphic/richtext/wrapper.js.map +1 -1
  207. package/es/graphic/richtext.js +3 -2
  208. package/es/graphic/richtext.js.map +1 -1
  209. package/es/index.d.ts +1 -0
  210. package/es/index.js +2 -0
  211. package/es/index.js.map +1 -1
  212. package/es/interface/animate.d.ts +5 -39
  213. package/es/interface/animate.js.map +1 -1
  214. package/es/interface/graphic/path.d.ts +1 -0
  215. package/es/interface/graphic/path.js.map +1 -1
  216. package/es/interface/graphic/symbol.d.ts +2 -0
  217. package/es/interface/graphic/symbol.js.map +1 -1
  218. package/es/interface/graphic.d.ts +6 -2
  219. package/es/interface/graphic.js.map +1 -1
  220. package/es/interface/path.d.ts +5 -0
  221. package/es/interface/path.js.map +1 -1
  222. package/es/interface/picker.d.ts +13 -0
  223. package/es/interface/picker.js.map +1 -1
  224. package/es/picker/constants.d.ts +2 -0
  225. package/es/picker/constants.js +4 -0
  226. package/es/picker/constants.js.map +1 -1
  227. package/es/picker/pick-interceptor.d.ts +7 -2
  228. package/es/picker/pick-interceptor.js +19 -1
  229. package/es/picker/pick-interceptor.js.map +1 -1
  230. package/es/picker/pick-modules.js +5 -3
  231. package/es/picker/pick-modules.js.map +1 -1
  232. package/es/picker/picker-service.d.ts +4 -2
  233. package/es/picker/picker-service.js +13 -13
  234. package/es/picker/picker-service.js.map +1 -1
  235. package/es/plugins/builtin-plugin/edit-module.d.ts +6 -5
  236. package/es/plugins/builtin-plugin/edit-module.js +79 -25
  237. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  238. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  239. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  240. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  241. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +49 -30
  242. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +283 -214
  243. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  244. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  245. package/es/render/contributions/render/base-render.d.ts +1 -0
  246. package/es/render/contributions/render/base-render.js +21 -2
  247. package/es/render/contributions/render/base-render.js.map +1 -1
  248. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  249. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +29 -2
  250. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  251. package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +8 -1
  252. package/es/render/contributions/render/contributions/symbol-contribution-render.js +26 -0
  253. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  254. package/es/render/contributions/render/draw-contribution.d.ts +1 -0
  255. package/es/render/contributions/render/draw-contribution.js +15 -7
  256. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  257. package/es/render/contributions/render/path-render.js.map +1 -1
  258. package/es/render/contributions/render/polygon-render.js.map +1 -1
  259. package/es/render/contributions/render/symbol-render.js +16 -13
  260. package/es/render/contributions/render/symbol-render.js.map +1 -1
  261. package/es/render/contributions/render/utils.d.ts +1 -2
  262. package/es/render/contributions/render/utils.js +0 -18
  263. package/es/render/contributions/render/utils.js.map +1 -1
  264. package/package.json +4 -4
@@ -17,6 +17,7 @@ export declare class DefaultTicker extends EventEmitter implements ITicker {
17
17
  init(): void;
18
18
  addTimeline(timeline: ITimeline): void;
19
19
  remTimeline(timeline: ITimeline): void;
20
+ getTimelines(): ITimeline[];
20
21
  protected initHandler(): ITickHandler | null;
21
22
  protected setupTickHandler(): boolean;
22
23
  setInterval(interval: number): void;
@@ -34,5 +35,6 @@ export declare class DefaultTicker extends EventEmitter implements ITicker {
34
35
  once?: boolean;
35
36
  }) => void;
36
37
  protected _handlerTick: () => void;
38
+ release(): void;
37
39
  trySyncTickStatus(): void;
38
40
  }
@@ -25,7 +25,7 @@ export class DefaultTicker extends EventEmitter {
25
25
  this.lastFrameTime >= 0 && (delta = time - this.lastFrameTime), this.lastFrameTime = time,
26
26
  this.status === STATUS.RUNNING && (this.tickCounts++, this.timelines.forEach((t => {
27
27
  t.tick(delta);
28
- })), this.emit("afterTick"));
28
+ })), this.emit("tick", delta));
29
29
  }, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.timelines = timelines,
30
30
  this.autoStop = !0;
31
31
  }
@@ -40,6 +40,9 @@ export class DefaultTicker extends EventEmitter {
40
40
  remTimeline(timeline) {
41
41
  this.timelines = this.timelines.filter((t => t !== timeline));
42
42
  }
43
+ getTimelines() {
44
+ return this.timelines;
45
+ }
43
46
  initHandler() {
44
47
  if (this._mode) return null;
45
48
  const ticks = [ {
@@ -125,6 +128,9 @@ export class DefaultTicker extends EventEmitter {
125
128
  stop() {
126
129
  this.status = STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
127
130
  }
131
+ release() {
132
+ this.stop(), this.timelines = [], this.tickerHandler.release(), this.emit("afterTick");
133
+ }
128
134
  trySyncTickStatus() {
129
135
  this.status === STATUS.RUNNING && this._handlerTick();
130
136
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animate/Ticker/default-ticker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,OAAO,aAAc,SAAQ,YAAY;IAU7C,IAAI,IAAI,CAAC,CAAa;QACpB,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE;YACpB,OAAO;SACR;QACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,YAAY,YAAyB,EAAE;QACrC,KAAK,EAAE,CAAC;QAiKA,eAAU,GAAG,CAAC,OAAqB,EAAE,MAA2B,EAAE,EAAE;YAC5E,MAAM,EAAE,IAAI,GAAG,KAAK,EAAE,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;YAEtC,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;gBACpB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACZ,OAAO;aACR;YACD,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAC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AC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI;QAEF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAC1B,CAAC;IAyCD,iBAAiB;QACf,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE;YAClC,IAAI,CAAC,YAAY,EAAE,CAAC;SACrB;IACH,CAAC;CACF","file":"default-ticker.js","sourcesContent":["import { EventEmitter, Logger } from '@visactor/vutils';\nimport type { ITickHandler, ITickerHandlerStatic, ITimeline, ITicker } from '../../interface';\nimport { application } from '../../application';\nimport type { TickerMode } from './type';\nimport { STATUS } from './type';\nimport { RAFTickHandler } from './raf-tick-handler';\nimport { TimeOutTickHandler } from './timeout-tick-handler';\n\nexport class DefaultTicker extends EventEmitter implements ITicker {\n protected interval: number;\n protected tickerHandler: ITickHandler;\n protected _mode: TickerMode;\n protected status: STATUS;\n protected lastFrameTime: number;\n protected tickCounts: number;\n protected timelines: ITimeline[];\n autoStop: boolean;\n\n set mode(m: TickerMode) {\n if (this._mode === m) {\n return;\n }\n this._mode = m;\n this.setupTickHandler();\n }\n get mode(): TickerMode {\n return this._mode;\n }\n\n constructor(timelines: ITimeline[] = []) {\n super();\n this.init();\n this.lastFrameTime = -1;\n this.tickCounts = 0;\n this.timelines = timelines;\n this.autoStop = true;\n }\n\n init() {\n this.interval = NaN;\n this.status = STATUS.INITIAL;\n application.global.hooks.onSetEnv.tap('default-ticker', () => {\n this.initHandler();\n });\n if (application.global.env) {\n this.initHandler();\n }\n }\n\n addTimeline(timeline: ITimeline) {\n this.timelines.push(timeline);\n }\n remTimeline(timeline: ITimeline) {\n this.timelines = this.timelines.filter(t => t !== timeline);\n }\n\n protected initHandler(): ITickHandler | null {\n if (this._mode) {\n return null;\n }\n const ticks: { mode: TickerMode; cons: ITickerHandlerStatic }[] = [\n { mode: 'raf', cons: RAFTickHandler },\n { mode: 'timeout', cons: TimeOutTickHandler }\n ];\n for (let i = 0; i < ticks.length; i++) {\n if (ticks[i].cons.Avaliable()) {\n this.mode = ticks[i].mode;\n break;\n }\n }\n return null;\n }\n\n /**\n * 设置tickHandler\n * @returns 返回true表示设置成功,false表示设置失败\n */\n protected setupTickHandler(): boolean {\n let handler: ITickHandler;\n // 创建下一个tickHandler\n switch (this._mode) {\n case 'raf':\n handler = new RAFTickHandler();\n break;\n case 'timeout':\n handler = new TimeOutTickHandler();\n break;\n // case 'manual':\n // handler = new ManualTickHandler();\n // break;\n default:\n Logger.getInstance().warn('非法的计时器模式');\n handler = new RAFTickHandler();\n break;\n }\n if (!handler.avaliable()) {\n return false;\n }\n\n // 销毁上一个tickerHandler\n if (this.tickerHandler) {\n this.tickerHandler.release();\n }\n this.tickerHandler = handler;\n return true;\n }\n\n setInterval(interval: number) {\n this.interval = interval;\n }\n getInterval(): number {\n return this.interval;\n }\n\n setFPS(fps: number): void {\n this.setInterval(1000 / fps);\n }\n getFPS(): number {\n return 1000 / this.interval;\n }\n tick(interval: number): void {\n this.tickerHandler.tick(interval, (handler: ITickHandler) => {\n this.handleTick(handler, { once: true });\n });\n }\n tickTo(t: number): void {\n if (!this.tickerHandler.tickTo) {\n return;\n }\n this.tickerHandler.tickTo(t, (handler: ITickHandler) => {\n this.handleTick(handler, { once: true });\n });\n }\n pause(): boolean {\n if (this.status === STATUS.INITIAL) {\n return false;\n }\n this.status = STATUS.PAUSE;\n return true;\n }\n resume(): boolean {\n if (this.status === STATUS.INITIAL) {\n return false;\n }\n this.status = STATUS.RUNNING;\n return true;\n }\n\n ifCanStop(): boolean {\n if (this.autoStop) {\n if (!this.timelines.length) {\n return true;\n }\n if (this.timelines.reduce((a, b) => a + b.animateCount, 0) === 0) {\n return true;\n }\n }\n return false;\n }\n\n start(force: boolean = false): boolean {\n if (this.status === STATUS.RUNNING) {\n return false;\n }\n if (!this.tickerHandler) {\n return false;\n }\n // 如果不需要start,那就不start\n if (!force) {\n // 暂停状态不执行\n if (this.status === STATUS.PAUSE) {\n return false;\n }\n if (!this.timelines.length) {\n return false;\n }\n if (this.timelines.reduce((a, b) => a + b.animateCount, 0) === 0) {\n return false;\n }\n }\n this.status = STATUS.RUNNING;\n this.tickerHandler.tick(0, this.handleTick);\n return true;\n }\n stop(): void {\n // 重新设置tickHandler\n this.status = STATUS.INITIAL;\n this.setupTickHandler();\n this.lastFrameTime = -1;\n }\n\n protected handleTick = (handler: ITickHandler, params?: { once?: boolean }) => {\n const { once = false } = params ?? {};\n // 尝试停止\n if (this.ifCanStop()) {\n this.stop();\n return;\n }\n this._handlerTick();\n if (!once) {\n handler.tick(this.interval, this.handleTick);\n }\n };\n\n protected _handlerTick = () => {\n // 具体执行函数\n const tickerHandler = this.tickerHandler;\n const time = tickerHandler.getTime();\n // 上一帧经过的时间\n let delta = 0;\n if (this.lastFrameTime >= 0) {\n delta = time - this.lastFrameTime;\n }\n this.lastFrameTime = time;\n\n if (this.status !== STATUS.RUNNING) {\n return;\n }\n this.tickCounts++;\n\n this.timelines.forEach(t => {\n t.tick(delta);\n });\n this.emit('afterTick');\n };\n\n /**\n * 同步tick状态,需要手动触发tick执行,保证属性为走完动画的属性\n * 【注】grammar会设置属性到最终值,然后调用render,这时候需要VRender手动触发tick,保证属性为走完动画的属性,而不是Grammar设置上的属性\n */\n trySyncTickStatus() {\n if (this.status === STATUS.RUNNING) {\n this._handlerTick();\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/animate/Ticker/default-ticker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAA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,CAAC;IACzB,CAAC;IAMD,iBAAiB;QACf,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE;YAClC,IAAI,CAAC,YAAY,EAAE,CAAC;SACrB;IACH,CAAC;CACF","file":"default-ticker.js","sourcesContent":["import { EventEmitter, Logger } from '@visactor/vutils';\nimport type { ITickHandler, ITickerHandlerStatic, ITimeline, ITicker } from '../../interface';\nimport { application } from '../../application';\nimport type { TickerMode } from './type';\nimport { STATUS } from './type';\nimport { RAFTickHandler } from './raf-tick-handler';\nimport { TimeOutTickHandler } from './timeout-tick-handler';\n\nexport class DefaultTicker extends EventEmitter implements ITicker {\n protected interval: number;\n protected tickerHandler: ITickHandler;\n protected _mode: TickerMode;\n protected status: STATUS;\n protected lastFrameTime: number;\n protected tickCounts: number;\n protected timelines: ITimeline[];\n autoStop: boolean;\n\n set mode(m: TickerMode) {\n if (this._mode === m) {\n return;\n }\n this._mode = m;\n this.setupTickHandler();\n }\n get mode(): TickerMode {\n return this._mode;\n }\n\n constructor(timelines: ITimeline[] = []) {\n super();\n this.init();\n this.lastFrameTime = -1;\n this.tickCounts = 0;\n this.timelines = timelines;\n this.autoStop = true;\n }\n\n init() {\n this.interval = NaN;\n this.status = STATUS.INITIAL;\n application.global.hooks.onSetEnv.tap('default-ticker', () => {\n this.initHandler();\n });\n if (application.global.env) {\n this.initHandler();\n }\n }\n\n addTimeline(timeline: ITimeline) {\n this.timelines.push(timeline);\n }\n remTimeline(timeline: ITimeline) {\n this.timelines = this.timelines.filter(t => t !== timeline);\n }\n getTimelines(): ITimeline[] {\n return this.timelines;\n }\n\n protected initHandler(): ITickHandler | null {\n if (this._mode) {\n return null;\n }\n const ticks: { mode: TickerMode; cons: ITickerHandlerStatic }[] = [\n { mode: 'raf', cons: RAFTickHandler },\n { mode: 'timeout', cons: TimeOutTickHandler }\n ];\n for (let i = 0; i < ticks.length; i++) {\n if (ticks[i].cons.Avaliable()) {\n this.mode = ticks[i].mode;\n break;\n }\n }\n return null;\n }\n\n /**\n * 设置tickHandler\n * @returns 返回true表示设置成功,false表示设置失败\n */\n protected setupTickHandler(): boolean {\n let handler: ITickHandler;\n // 创建下一个tickHandler\n switch (this._mode) {\n case 'raf':\n handler = new RAFTickHandler();\n break;\n case 'timeout':\n handler = new TimeOutTickHandler();\n break;\n // case 'manual':\n // handler = new ManualTickHandler();\n // break;\n default:\n Logger.getInstance().warn('非法的计时器模式');\n handler = new RAFTickHandler();\n break;\n }\n if (!handler.avaliable()) {\n return false;\n }\n\n // 销毁上一个tickerHandler\n if (this.tickerHandler) {\n this.tickerHandler.release();\n }\n this.tickerHandler = handler;\n return true;\n }\n\n setInterval(interval: number) {\n this.interval = interval;\n }\n getInterval(): number {\n return this.interval;\n }\n\n setFPS(fps: number): void {\n this.setInterval(1000 / fps);\n }\n getFPS(): number {\n return 1000 / this.interval;\n }\n tick(interval: number): void {\n this.tickerHandler.tick(interval, (handler: ITickHandler) => {\n this.handleTick(handler, { once: true });\n });\n }\n tickTo(t: number): void {\n if (!this.tickerHandler.tickTo) {\n return;\n }\n this.tickerHandler.tickTo(t, (handler: ITickHandler) => {\n this.handleTick(handler, { once: true });\n });\n }\n pause(): boolean {\n if (this.status === STATUS.INITIAL) {\n return false;\n }\n this.status = STATUS.PAUSE;\n return true;\n }\n resume(): boolean {\n if (this.status === STATUS.INITIAL) {\n return false;\n }\n this.status = STATUS.RUNNING;\n return true;\n }\n\n ifCanStop(): boolean {\n if (this.autoStop) {\n if (!this.timelines.length) {\n return true;\n }\n if (this.timelines.reduce((a, b) => a + b.animateCount, 0) === 0) {\n return true;\n }\n }\n return false;\n }\n\n start(force: boolean = false): boolean {\n if (this.status === STATUS.RUNNING) {\n return false;\n }\n if (!this.tickerHandler) {\n return false;\n }\n // 如果不需要start,那就不start\n if (!force) {\n // 暂停状态不执行\n if (this.status === STATUS.PAUSE) {\n return false;\n }\n if (!this.timelines.length) {\n return false;\n }\n if (this.timelines.reduce((a, b) => a + b.animateCount, 0) === 0) {\n return false;\n }\n }\n this.status = STATUS.RUNNING;\n this.tickerHandler.tick(0, this.handleTick);\n return true;\n }\n stop(): void {\n // 重新设置tickHandler\n this.status = STATUS.INITIAL;\n this.setupTickHandler();\n this.lastFrameTime = -1;\n }\n\n protected handleTick = (handler: ITickHandler, params?: { once?: boolean }) => {\n const { once = false } = params ?? {};\n // 尝试停止\n if (this.ifCanStop()) {\n this.stop();\n return;\n }\n this._handlerTick();\n if (!once) {\n handler.tick(this.interval, this.handleTick);\n }\n };\n\n protected _handlerTick = () => {\n // 具体执行函数\n const tickerHandler = this.tickerHandler;\n const time = tickerHandler.getTime();\n // 上一帧经过的时间\n let delta = 0;\n if (this.lastFrameTime >= 0) {\n delta = time - this.lastFrameTime;\n }\n this.lastFrameTime = time;\n\n if (this.status !== STATUS.RUNNING) {\n return;\n }\n this.tickCounts++;\n\n this.timelines.forEach(t => {\n t.tick(delta);\n });\n this.emit('tick', delta);\n };\n\n release(): void {\n this.stop();\n this.timelines = [];\n this.tickerHandler.release();\n this.emit('afterTick');\n }\n\n /**\n * 同步tick状态,需要手动触发tick执行,保证属性为走完动画的属性\n * 【注】grammar会设置属性到最终值,然后调用render,这时候需要VRender手动触发tick,保证属性为走完动画的属性,而不是Grammar设置上的属性\n */\n trySyncTickStatus() {\n if (this.status === STATUS.RUNNING) {\n this._handlerTick();\n }\n }\n}\n"]}
@@ -259,7 +259,7 @@ export class SubAnimate {
259
259
  (null == duration || duration < 0) && (duration = 0);
260
260
  const easingFunc = "string" == typeof easing ? Easing[easing] : easing, step = this._addStep(duration, null, easingFunc);
261
261
  return step.type = AnimateStepType.to, this._appendProps(props, step, !!params && params.tempProps),
262
- step.propKeys || (step.propKeys = Object.keys(step.props)), params && params.noPreventAttrs || this.target.animates.forEach((a => {
262
+ step.propKeys || (step.propKeys = Object.keys(step.props)), params && params.noPreventAttrs || this.target.animates && this.target.animates.forEach((a => {
263
263
  a.id !== this.animate.id && a.preventAttrs(step.propKeys);
264
264
  })), this;
265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,IAAU;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,YAAY;QACV,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,OAAO,IAAI,EAAE;YACX,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;iBAAM,IAAI,IAAI,CAAC,aAAa,EAAE;gBAC7B,OAAO,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;aAC/C;YACD,IAAI,GAAG,IAAI,CAAC,IAAW,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"animate.js","sourcesContent":["import type {\n EasingType,\n EasingTypeFunc,\n IAnimate,\n IAnimateStepType,\n IAnimateTarget,\n ICustomAnimate,\n IGraphic,\n IStep,\n IStepConfig,\n ISubAnimate,\n ITimeline\n} from '../interface';\nimport { AnimateMode, AnimateStatus, AnimateStepType, AttributeUpdateType } from '../common/enums';\nimport { Easing } from './easing';\nimport { Logger, max } from '@visactor/vutils';\nimport { defaultTimeline } from './timeline';\nimport { Generator } from '../common/generator';\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\n/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\nexport abstract class ACustomAnimate<T> implements ICustomAnimate {\n declare from: T;\n declare to: T;\n declare duration: number;\n declare easing: EasingType;\n declare params: any;\n declare target: IAnimateTarget;\n declare updateCount: number;\n declare subAnimate: ISubAnimate;\n declare step?: IStep;\n declare mode?: AnimateMode;\n\n // 用于判断是否一致\n declare _endProps?: any;\n declare _mergedEndProps?: any;\n\n constructor(from: T, to: T, duration: number, easing: EasingType, params?: any) {\n this.from = from;\n this.to = to;\n this.duration = duration;\n this.easing = easing;\n this.params = params;\n this.updateCount = 0;\n }\n\n bind(target: IAnimateTarget, subAni: ISubAnimate) {\n this.target = target;\n this.subAnimate = subAni;\n this.onBind();\n }\n\n // 在第一次调用的时候触发\n onBind() {\n return;\n }\n\n // 第一次执行的时候调用\n onFirstRun() {\n return;\n }\n\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart() {\n return;\n }\n\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd() {\n return;\n }\n\n getEndProps(): Record<string, any> | void {\n return this.to;\n }\n\n getFromProps(): Record<string, any> | void {\n return this.from;\n }\n\n getMergedEndProps(): Record<string, any> | void {\n const thisEndProps = this.getEndProps();\n if (thisEndProps) {\n if (this._endProps === thisEndProps) {\n return this._mergedEndProps;\n }\n this._endProps = thisEndProps;\n this._mergedEndProps = Object.assign({}, this.step.prev.getLastProps() ?? {}, thisEndProps);\n return;\n }\n return this.step.prev ? this.step.prev.getLastProps() : thisEndProps;\n }\n\n // abstract getFromValue(key: string): any;\n // abstract getToValue(key: string): any;\n\n abstract onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updateCount === 0) {\n this.onFirstRun();\n // out添加之前的props\n const props = this.step.getLastProps();\n Object.keys(props).forEach(k => {\n if (this.subAnimate.animate.validAttr(k)) {\n out[k] = props[k];\n }\n });\n }\n this.updateCount += 1;\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n}\n\nexport class CbAnimate extends ACustomAnimate<null> {\n cb: () => void;\n\n constructor(cb: () => void) {\n super(null, null, 0, 'linear');\n this.cb = cb;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n return;\n }\n\n onStart(): void {\n this.cb();\n }\n}\n\ntype InterpolateFunc = (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n out: Record<string, any>\n) => boolean;\n\nexport class Animate implements IAnimate {\n static mode: AnimateMode = AnimateMode.NORMAL;\n declare target: IAnimateTarget;\n declare timeline: ITimeline;\n declare nextAnimate?: IAnimate;\n declare prevAnimate?: IAnimate;\n // 当前Animate的状态,正常,暂停,结束\n declare status: AnimateStatus;\n declare readonly id: string | number;\n // 开始时间\n protected declare _startTime: number;\n protected declare _duringTime: number;\n declare subAnimates: SubAnimate[];\n declare tailAnimate: SubAnimate;\n\n // 绝对的位置\n declare rawPosition: number;\n // 时间倍速缩放\n declare timeScale: number;\n\n declare interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n declare _onStart?: (() => void)[];\n declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n declare _onEnd?: (() => void)[];\n declare _onRemove?: (() => void)[];\n declare _preventAttrs?: Set<string>;\n static interpolateMap: Map<string, InterpolateFunc> = new Map();\n slience?: boolean;\n\n constructor(\n id: string | number = Generator.GenAutoIncrementId(),\n timeline: ITimeline = defaultTimeline,\n slience?: boolean\n ) {\n this.id = id;\n this.timeline = timeline;\n this.status = AnimateStatus.INITIAL;\n this.tailAnimate = new SubAnimate(this);\n this.subAnimates = [this.tailAnimate];\n this.timeScale = 1;\n this.rawPosition = -1;\n this._startTime = 0;\n this._duringTime = 0;\n this.timeline.addAnimate(this);\n this.slience = slience;\n }\n\n setTimeline(timeline: ITimeline) {\n if (timeline === this.timeline) {\n return;\n }\n this.timeline.removeAnimate(this, false);\n timeline.addAnimate(this);\n }\n\n getStartTime(): number {\n return this._startTime;\n }\n\n getDuration(): number {\n return this.subAnimates.reduce((t, subAnimate) => t + subAnimate.totalDuration, 0);\n }\n\n after(animate: IAnimate) {\n const t = animate.getDuration();\n this._startTime = t;\n return this;\n }\n\n afterAll(list: IAnimate[]) {\n let maxT = -Infinity;\n list.forEach(a => {\n maxT = max(a.getDuration(), maxT);\n });\n this._startTime = maxT;\n return this;\n }\n\n parallel(animate: IAnimate) {\n this._startTime = animate.getStartTime();\n return this;\n }\n\n static AddInterpolate(name: string, cb: InterpolateFunc) {\n Animate.interpolateMap.set(name, cb);\n }\n\n play(customAnimate: ICustomAnimate) {\n this.tailAnimate.play(customAnimate);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n if (this.subAnimates.length === 1 && this.tailAnimate.totalDuration === customAnimate.duration) {\n this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode);\n }\n return this;\n }\n\n trySetAttribute(attr: Record<string, any> | void, mode: AnimateMode = Animate.mode) {\n if (attr && mode & AnimateMode.SET_ATTR_IMMEDIATELY) {\n (this.target as any).setAttributes &&\n (this.target as any).setAttributes(attr, false, { type: AttributeUpdateType.ANIMATE_PLAY });\n }\n }\n\n runCb(cb: (a: IAnimate, step: IStep) => void) {\n // this.tailAnimate.runCb(cb);\n const customAnimate = new CbAnimate(() => {\n cb(this, customAnimate.step.prev);\n });\n this.tailAnimate.play(customAnimate);\n return this;\n }\n\n /**\n * 自定义插值,返回false表示没有匹配上\n * @param key\n * @param from\n * @param to\n */\n customInterpolate(\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ): boolean {\n const func = Animate.interpolateMap.get(key) || Animate.interpolateMap.get('');\n if (!func) {\n return false;\n }\n return func(key, ratio, from, to, target, ret);\n }\n\n pause() {\n if (this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.PAUSED;\n }\n }\n\n resume() {\n if (this.status === AnimateStatus.PAUSED) {\n this.status = AnimateStatus.RUNNING;\n }\n }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.to(props, duration, easing, params);\n // 默认开始动画\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n // if (this.subAnimates.length === 1 && this.tailAnimate.duration === duration) {\n // this.trySetAttribute(props);\n // }\n return this;\n }\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.from(props, duration, easing, params);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n wait(duration: number) {\n this.tailAnimate.wait(duration);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n startAt(t: number) {\n this.tailAnimate.startAt(t);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n loop(l: number) {\n this.tailAnimate.loop = l;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n reversed(r: boolean) {\n this.tailAnimate.reversed = r;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n bounce(b: boolean) {\n this.tailAnimate.bounce = b;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n subAnimate() {\n const sa = new SubAnimate(this, this.tailAnimate);\n this.tailAnimate = sa;\n this.subAnimates.push(sa);\n sa.bind(this.target);\n return this;\n }\n\n getStartProps(): Record<string, any> {\n return this.subAnimates[0].getStartProps();\n }\n\n getEndProps(): Record<string, any> {\n return this.tailAnimate.getEndProps();\n }\n\n depreventAttr(key: string) {\n if (!this._preventAttrs) {\n return;\n }\n this._preventAttrs.delete(key);\n }\n preventAttr(key: string) {\n if (!this._preventAttrs) {\n this._preventAttrs = new Set();\n }\n this._preventAttrs.add(key);\n }\n preventAttrs(keys: string[]) {\n keys.forEach(key => this.preventAttr(key));\n }\n validAttr(key: string): boolean {\n if (!this._preventAttrs) {\n return true;\n }\n return !this._preventAttrs.has(key);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n\n if (this.target.onAnimateBind && !this.slience) {\n this.target.onAnimateBind(this);\n }\n\n this.subAnimates.forEach(sa => {\n sa.bind(target);\n });\n return this;\n }\n\n advance(delta: number) {\n // startTime之前的时间不计入耗时\n if (this._duringTime < this._startTime) {\n if (this._duringTime + delta * this.timeScale < this._startTime) {\n this._duringTime += delta * this.timeScale;\n return;\n }\n delta = this._duringTime + delta * this.timeScale - this._startTime;\n this._duringTime = this._startTime;\n }\n // 执行advance\n if (this.status === AnimateStatus.INITIAL) {\n this.status = AnimateStatus.RUNNING;\n this._onStart && this._onStart.forEach(cb => cb());\n }\n const end = this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale);\n if (end && this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.END;\n this._onEnd && this._onEnd.forEach(cb => cb());\n }\n }\n\n setPosition(rawPosition: number): boolean {\n let d = 0;\n let sa: SubAnimate | undefined;\n const prevRawPos = this.rawPosition;\n const maxRawPos = this.subAnimates.reduce((a, b) => a + b.totalDuration, 0);\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n\n const end = rawPosition >= maxRawPos;\n\n if (end) {\n rawPosition = maxRawPos;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // 查找对应的subAnimate\n for (let i = 0; i < this.subAnimates.length; i++) {\n sa = this.subAnimates[i];\n if (d + sa.totalDuration >= rawPosition) {\n break;\n } else {\n d += sa.totalDuration;\n sa = undefined;\n }\n }\n this.rawPosition = rawPosition;\n sa.setPosition(rawPosition - d);\n\n return end;\n }\n\n onStart(cb: () => void) {\n if (!this._onStart) {\n this._onStart = [];\n }\n this._onStart.push(cb);\n }\n onEnd(cb: () => void) {\n if (!this._onEnd) {\n this._onEnd = [];\n }\n this._onEnd.push(cb);\n }\n onRemove(cb: () => void) {\n if (!this._onRemove) {\n this._onRemove = [];\n }\n this._onRemove.push(cb);\n }\n onFrame(cb: (step: IStep, ratio: number) => void) {\n if (!this._onFrame) {\n this._onFrame = [];\n }\n this._onFrame.push(cb);\n }\n release() {\n this.status = AnimateStatus.END;\n return;\n }\n\n stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n if (!nextVal) {\n this.target.onStop();\n }\n if (nextVal === 'start') {\n this.target.onStop(this.getStartProps());\n } else if (nextVal === 'end') {\n this.target.onStop(this.getEndProps());\n } else {\n this.target.onStop(nextVal);\n }\n this.release();\n }\n}\n\n// Animate.mode |= AnimateMode.SET_ATTR_IMMEDIATELY;\n\nexport class SubAnimate implements ISubAnimate {\n declare target: IAnimateTarget;\n declare animate: IAnimate;\n // 默认的初始step,一定存在,且stepHead的props一定保存整个subAnimate阶段所有属性的最初\n protected declare stepHead: Step;\n protected declare stepTail: Step;\n // 结束时反转动画\n declare bounce: boolean;\n // 是否reverse\n declare reversed: boolean;\n // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n declare loop: number;\n // 持续时间,不包括循环\n declare duration: number;\n // 位置,在[0, duration]之间\n declare position: number;\n // 绝对的位置,在[0, loops * duration]之间\n declare rawPosition: number;\n declare dirty: boolean;\n\n declare _totalDuration: number;\n declare _startAt: number;\n declare _lastStep: IStep;\n declare _deltaPosition: number;\n\n get totalDuration(): number {\n this.calcAttr();\n return this._totalDuration + this._startAt;\n }\n\n constructor(animate: IAnimate, lastSubAnimate?: SubAnimate) {\n this.rawPosition = -1;\n this.position = 0;\n this.loop = 0;\n this.duration = 0;\n this.animate = animate;\n if (lastSubAnimate) {\n this.stepHead = new Step(0, 0, Object.assign({}, lastSubAnimate.stepTail.props));\n } else {\n this.stepHead = new Step(0, 0, {});\n }\n this.stepTail = this.stepHead;\n this.dirty = true;\n this._startAt = 0;\n }\n\n // 计算按需计算的属性\n protected calcAttr() {\n if (!this.dirty) {\n return;\n }\n\n this._totalDuration = this.duration * (this.loop + 1);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n return this;\n }\n\n play(customAnimate: ICustomAnimate) {\n let duration = customAnimate.duration;\n if (duration == null || duration < 0) {\n duration = 0;\n }\n const easing = customAnimate.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.customAnimate;\n this._appendProps(customAnimate.getEndProps(), step, false);\n this._appendCustomAnimate(customAnimate, step);\n return this;\n }\n\n // _appendPlayProps(step: IStep) {\n\n // return;\n // }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n if (duration == null || duration < 0) {\n duration = 0;\n }\n\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.to;\n this._appendProps(props, step, params ? params.tempProps : false);\n // this._appendPlayProps(step);\n\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n if (!(params && params.noPreventAttrs)) {\n this.target.animates.forEach(a => {\n if (a.id !== this.animate.id) {\n a.preventAttrs(step.propKeys);\n }\n });\n }\n return this;\n }\n\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.to(props, 0, easing, params);\n const toProps = {};\n if (!this.stepTail.propKeys) {\n this.stepTail.propKeys = Object.keys(this.stepTail.props);\n }\n this.stepTail.propKeys.forEach(k => {\n toProps[k] = this.getLastPropByName(k, this.stepTail);\n });\n this.to(toProps, duration, easing, params);\n this.stepTail.type = AnimateStepType.from;\n }\n\n startAt(t: number) {\n if (t < 0) {\n t = 0;\n }\n this._startAt = t;\n return this;\n }\n\n getStartProps() {\n return this.stepHead?.props;\n }\n\n getEndProps() {\n return this.stepTail.props;\n }\n\n getLastStep() {\n return this._lastStep;\n }\n\n wait(duration: number) {\n if (duration > 0) {\n const step = this._addStep(+duration, null);\n\n step.type = AnimateStepType.wait;\n // TODO 这里如果跳帧的话会存在bug\n if (step.prev.customAnimate) {\n step.props = step.prev.customAnimate.getEndProps();\n } else {\n step.props = step.prev.props;\n }\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n // this._appendPlayProps(step);\n }\n return this;\n }\n\n protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n const step = new Step(this.duration, duration, props, easingFunc);\n this.duration += duration;\n this.stepTail.append(step);\n this.stepTail = step;\n return step;\n }\n\n protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n if (tempProps) {\n step.props = props;\n } else {\n // todo: 是否需要深拷贝props\n step.props = Object.assign({}, props);\n }\n let lastStep = step.prev;\n const _props = step.props;\n // 将undefined的属性设置到默认值\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n step.propKeys.forEach(k => {\n if (step.props[k] === undefined) {\n step.props[k] = this.target.getDefaultAttribute(k);\n }\n });\n // 拷贝之前的step阶段属性\n while (lastStep.prev) {\n if (lastStep.props) {\n if (!lastStep.propKeys) {\n lastStep.propKeys = Object.keys(lastStep.props);\n }\n lastStep.propKeys.forEach(key => {\n if (_props[key] === undefined) {\n _props[key] = lastStep.props[key];\n }\n });\n }\n // 重置propKeys\n step.propKeys = Object.keys(step.props);\n lastStep = lastStep.prev;\n }\n\n // 设置最初的props属性\n const initProps = this.stepHead.props;\n if (!step.propKeys) {\n step.propKeys = Object.keys(_props);\n }\n step.propKeys.forEach(key => {\n if (initProps[key] === undefined) {\n const parentAnimateInitProps = this.animate.getStartProps();\n initProps[key] = parentAnimateInitProps[key] = this.target.getComputedAttribute(key);\n }\n });\n\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n }\n\n protected _appendCustomAnimate(customAnimate: ICustomAnimate, step: Step) {\n step.customAnimate = customAnimate;\n customAnimate.step = step;\n customAnimate.bind(this.target, this);\n }\n\n setPosition(rawPosition: number) {\n const d = this.duration;\n const loopCount = this.loop;\n const prevRawPos = this.rawPosition;\n let end = false;\n let loop: number; // 当前是第几次循环\n let position: number; // 当前周期的时间\n const startAt = this._startAt ?? 0;\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n if (rawPosition < startAt) {\n this.rawPosition = rawPosition;\n return false;\n }\n rawPosition = rawPosition - startAt;\n if (d <= 0) {\n // 如果不用执行,跳过\n end = true;\n // 小于0的话,直接return,如果等于0,那还是得走动画逻辑,将end属性设置上去\n if (d < 0) {\n return end;\n }\n }\n loop = Math.floor(rawPosition / d);\n position = rawPosition - loop * d;\n\n // 计算rawPosition\n end = rawPosition >= loopCount * d + d;\n // 如果结束,跳过\n if (end) {\n position = d;\n loop = loopCount;\n rawPosition = position * loop + d;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // reverse动画\n const rev = !this.reversed !== !(this.bounce && loop % 2);\n if (rev) {\n position = d - position;\n }\n\n this._deltaPosition = position - this.position;\n this.position = position;\n this.rawPosition = rawPosition + startAt;\n\n this.updatePosition(end, rev);\n\n return end;\n }\n\n protected updatePosition(end: boolean, rev: boolean) {\n if (!this.stepHead) {\n return;\n }\n let step = this.stepHead.next;\n const position = this.position;\n const duration = this.duration;\n if (this.target && step) {\n let stepNext = step.next;\n while (stepNext && stepNext.position <= position) {\n step = stepNext;\n stepNext = step.next;\n }\n let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n if (step.easing) {\n ratio = step.easing(ratio);\n }\n // 判断这次和上次过程中是否经历了自定义step,如果跳过了自定义step那么执行自定义step的onEnd\n this.tryCallCustomAnimateLifeCycle(step, this._lastStep || (rev ? this.stepTail : this.stepHead), rev);\n // if (step !== this._lastStep) {\n // if (this._deltaPosition > 0) {\n // let _step = step.prev;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.prev;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // } else if (this._deltaPosition < 0) {\n // let _step = step.next;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.next;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // }\n // }\n this.updateTarget(step, ratio, end);\n this._lastStep = step;\n\n this.animate._onFrame && this.animate._onFrame.forEach(cb => cb(step, ratio));\n }\n }\n\n // 如果动画卡顿跳过了自定义动画,那么尝试执行自定义动画的生命周期\n tryCallCustomAnimateLifeCycle(step: IStep, lastStep: IStep, rev: boolean) {\n if (step === lastStep) {\n return;\n }\n if (rev) {\n let _step = lastStep.prev;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = step.prev;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n } else {\n let _step = lastStep.next;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = _step.next;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n }\n }\n\n /**\n * 获取这个属性的上一个值\n * @param name\n * @param step\n * @returns\n */\n getLastPropByName(name: string, step: Step): any {\n let lastStep = step.prev;\n while (lastStep) {\n if (lastStep.props && lastStep.props[name] !== undefined) {\n return lastStep.props[name];\n } else if (lastStep.customAnimate) {\n const val = lastStep.customAnimate.getEndProps()[name];\n if (val !== undefined) {\n return val;\n }\n }\n lastStep = lastStep.prev;\n }\n\n Logger.getInstance().warn('未知错误,step中找不到属性');\n return step.props[name];\n }\n\n protected updateTarget(step: Step, ratio: number, end: boolean) {\n if (step.props == null && step.customAnimate == null) {\n return;\n }\n this.target.onStep(this, this.animate, step, ratio, end);\n }\n}\n\n// export class Animate implements IAnimate {\n// declare target: IAnimateTarget;\n// declare timeline: ITimeline;\n// protected declare stepHead: Step;\n// protected declare stepTail: Step;\n// declare nextAnimate?: Animate;\n// declare prevAnimate?: Animate;\n// // 结束时反转动画\n// declare bounce: boolean;\n// // 是否reverse\n// declare reversed: boolean;\n// // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n// declare loop: number;\n// // 持续时间,不包括循环\n// declare duration: number;\n// // 当前Animate的状态,正常,暂停,结束\n// declare status: AnimateStatus;\n// // 位置,在[0, duration]之间\n// declare position: number;\n// // 绝对的位置,在[0, loops * duration]之间\n// declare rawPosition: number;\n// // 开始时间\n// protected declare _startAt: number;\n// // 时间的缩放,例如2表示2倍速\n// declare timeScale: number;\n// declare props: Record<string, any>;\n// declare readonly id: string | number;\n\n// protected declare _onStart?: (() => void)[];\n// protected declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n// protected declare _onEnd?: (() => void)[];\n// declare _onRemove?: (() => void)[];\n// declare _preventAttrs?: Set<string>;\n\n// constructor(id: string | number = Generator.GenAutoIncrementId(), timeline: ITimeline = defaultTimeline) {\n// this.timeline = timeline;\n// this.status = AnimateStatus.INITIAL;\n// this.rawPosition = -1;\n// this.position = 0;\n// this.loop = 0;\n// this.timeline.addAnimate(this);\n// this.timeScale = 1;\n// this.id = id;\n// this.props = {};\n// this.stepHead = new Step(0, 0, {});\n// this.stepTail = this.stepHead;\n// }\n\n// preventAttr(key: string) {\n// if (!this._preventAttrs) {\n// this._preventAttrs = new Set();\n// }\n// this._preventAttrs.add(key);\n// }\n// preventAttrs(keys: string[]) {\n// keys.forEach(key => this.preventAttr(key));\n// }\n// validAttr(key: string): boolean {\n// if (!this._preventAttrs) {\n// return true;\n// }\n// return !this._preventAttrs.has(key);\n// }\n\n// getLastPropByName(name: string, step: Step): any {\n// let lastStep = step.prev;\n// while (lastStep) {\n// if (lastStep.props && lastStep.props[name] !== undefined) {\n// return lastStep.props[name];\n// }\n// lastStep = lastStep.prev;\n// }\n// let val = this.props[name];\n// if (!val) {\n// console.warn('未知错误,step中找不到属性');\n// val = this.target.getComputedAttribute(name);\n// this.props[name] = val;\n// }\n\n// return val;\n// }\n\n// bind(target: IAnimateTarget) {\n// this.target = target;\n// this.duration = 0;\n// return this;\n// }\n\n// startAt(t: number) {\n// if (t < 0) {\n// return this;\n// }\n// this._startAt = t;\n// return this;\n// }\n\n// to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n// if (duration == null || duration < 0) {\n// duration = 0;\n// }\n\n// const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n// const step = this._addStep(duration, null, easingFunc);\n// this._appendProps(props, step, params ? params.tempProps : false);\n// return this;\n// }\n\n// wait(duration: number) {\n// if (duration > 0) {\n// const step = this._addStep(+duration, null);\n// if (step.prev) {\n// step.props = step.prev.props;\n// }\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n// return this;\n// }\n\n// protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n// const step = new Step(this.duration, duration, props, easingFunc);\n// this.duration += duration;\n// this.stepTail.append(step);\n// this.stepTail = step;\n// return step;\n// }\n\n// protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n// if (tempProps) {\n// step.props = props;\n// } else {\n// // todo: 是否需要深拷贝props\n// step.props = Object.assign({}, props);\n// }\n// let lastStep = step.prev;\n// const _props = step.props;\n// // 拷贝之前的step阶段属性\n// while (lastStep.prev) {\n// if (lastStep.props) {\n// if (!lastStep.propKeys) {\n// lastStep.propKeys = Object.keys(lastStep.props);\n// }\n// lastStep.propKeys.forEach(key => {\n// if (_props[key] === undefined) {\n// _props[key] = lastStep.props[key];\n// }\n// });\n// }\n// lastStep = lastStep.prev;\n// }\n\n// // 设置最初的props属性\n// const initProps = this.stepHead.props;\n// if (!step.propKeys) {\n// step.propKeys = Object.keys(_props);\n// step.propKeys.forEach(key => {\n// initProps[key] = this.target.getComputedAttribute(key);\n// });\n// }\n\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n\n// advance(delta: number) {\n// if (this.status === AnimateStatus.INITIAL) {\n// this.status = AnimateStatus.RUNNING;\n// this._onStart && this._onStart.forEach(cb => cb());\n// }\n// const end = this.setPosition(this.rawPosition + delta * this.timeScale);\n// if (end && this.status === AnimateStatus.RUNNING) {\n// this.status = AnimateStatus.END;\n// this._onEnd && this._onEnd.forEach(cb => cb());\n// }\n// }\n\n// setPosition(rawPosition: number) {\n// const d = this.duration;\n// const loopCount = this.loop;\n// const prevRawPos = this.rawPosition;\n// let end = false;\n// let loop: number; // 当前是第几次循环\n// let position: number; // 当前周期的时间\n// const startAt = this._startAt ?? 0;\n\n// if (rawPosition < 0) {\n// rawPosition = 0;\n// }\n// if (rawPosition < startAt) {\n// this.rawPosition = rawPosition;\n// return false;\n// }\n// rawPosition = rawPosition - startAt;\n// if (d <= 0) {\n// // 如果不用执行,跳过\n// end = true;\n// return end;\n// }\n// loop = Math.floor(rawPosition / d);\n// position = rawPosition - loop * d;\n\n// // 计算rawPosition\n// end = rawPosition >= loopCount * d + d;\n// // 如果结束,跳过\n// if (end) {\n// position = d;\n// loop = loopCount;\n// rawPosition = position * loop + d;\n// }\n\n// if (rawPosition === prevRawPos) {\n// return end;\n// }\n\n// // reverse动画\n// const rev = !this.reversed !== !(this.bounce && loop % 2);\n// if (rev) {\n// position = d - position;\n// }\n\n// this.position = position;\n// this.rawPosition = rawPosition + startAt;\n\n// this.updatePosition(end);\n\n// return end;\n// }\n\n// protected updatePosition(end: boolean) {\n// if (!this.stepHead) {\n// return;\n// }\n// let step = this.stepHead;\n// const position = this.position;\n// const duration = this.duration;\n// if (this.target && step) {\n// let stepNext = step.next;\n// while (stepNext && stepNext.position <= position) {\n// step = step.next;\n// stepNext = step.next;\n// }\n// let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n// if (step.easing) {\n// ratio = step.easing(ratio);\n// }\n// this.updateTarget(step, ratio, end);\n// this._onFrame && this._onFrame.forEach(cb => cb(step, ratio));\n// }\n// }\n\n// protected updateTarget(step: Step, ratio: number, end: boolean) {\n// if (step.props == null) {\n// return;\n// }\n// this.target.onStep(this, step, ratio, end);\n// }\n\n// onStart(cb: () => void) {\n// if (!this._onStart) {\n// this._onStart = [];\n// }\n// this._onStart.push(cb);\n// }\n// onEnd(cb: () => void) {\n// if (!this._onEnd) {\n// this._onEnd = [];\n// }\n// this._onEnd.push(cb);\n// }\n// onRemove(cb: () => void) {\n// if (!this._onRemove) {\n// this._onRemove = [];\n// }\n// this._onRemove.push(cb);\n// }\n// onFrame(cb: (step: IStep, ratio: number) => void) {\n// if (!this._onFrame) {\n// this._onFrame = [];\n// }\n// this._onFrame.push(cb);\n// }\n\n// getStartProps() {\n// return this.stepHead?.props;\n// }\n\n// getEndProps(target: Record<string, any> = {}) {\n// let step = this.stepHead;\n// while (step) {\n// if (step.props) {\n// Object.assign(target, step.props);\n// }\n// step = step.next;\n// }\n\n// return target;\n// }\n\n// stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n// this.status = AnimateStatus.END;\n// if (!nextVal) {\n// this.target.onStop();\n// }\n// if (nextVal === 'start') {\n// this.target.onStop(this.getStartProps());\n// } else if (nextVal === 'end') {\n// this.target.onStop(this.getEndProps());\n// } else {\n// this.target.onStop(nextVal);\n// }\n// }\n\n// release() {\n// this.status = AnimateStatus.END;\n// return;\n// }\n// }\n\nclass Step implements IStep {\n declare prev?: Step;\n // 持续时间\n declare duration: number;\n // 在animate中的位置\n declare position: number;\n declare next?: Step;\n declare props: any;\n // 保存解析后的props,用于性能优化\n declare parsedProps?: any;\n declare propKeys?: string[];\n declare easing?: EasingTypeFunc;\n declare customAnimate?: ICustomAnimate;\n // passive: boolean;\n // index: number;\n type: IAnimateStepType;\n\n constructor(position: number, duration: number, props?: any, easing?: EasingTypeFunc) {\n this.duration = duration;\n this.position = position;\n this.props = props;\n this.easing = easing;\n }\n\n append(step: Step) {\n step.prev = this;\n step.next = this.next;\n this.next = step;\n }\n\n getLastProps() {\n let step = this.prev;\n while (step) {\n if (step.props) {\n return step.props;\n } else if (step.customAnimate) {\n return step.customAnimate.getMergedEndProps();\n }\n step = step.prev as any;\n }\n return null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/animate/animate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AA2BhD,MAAM,OAAgB,cAAc;IAgBlC,YAAY,IAAO,EAAE,EAAK,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAC5E,IAAI,CAAC,IAAI,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CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"animate.js","sourcesContent":["import type {\n EasingType,\n EasingTypeFunc,\n IAnimate,\n IAnimateStepType,\n IAnimateTarget,\n ICustomAnimate,\n IGraphic,\n IStep,\n IStepConfig,\n ISubAnimate,\n ITimeline\n} from '../interface';\nimport { AnimateMode, AnimateStatus, AnimateStepType, AttributeUpdateType } from '../common/enums';\nimport { Easing } from './easing';\nimport { Logger, max } from '@visactor/vutils';\nimport { defaultTimeline } from './timeline';\nimport { Generator } from '../common/generator';\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\n/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\nexport abstract class ACustomAnimate<T> implements ICustomAnimate {\n declare from: T;\n declare to: T;\n declare duration: number;\n declare easing: EasingType;\n declare params: any;\n declare target: IAnimateTarget;\n declare updateCount: number;\n declare subAnimate: ISubAnimate;\n declare step?: IStep;\n declare mode?: AnimateMode;\n\n // 用于判断是否一致\n declare _endProps?: any;\n declare _mergedEndProps?: any;\n\n constructor(from: T, to: T, duration: number, easing: EasingType, params?: any) {\n this.from = from;\n this.to = to;\n this.duration = duration;\n this.easing = easing;\n this.params = params;\n this.updateCount = 0;\n }\n\n bind(target: IAnimateTarget, subAni: ISubAnimate) {\n this.target = target;\n this.subAnimate = subAni;\n this.onBind();\n }\n\n // 在第一次调用的时候触发\n onBind() {\n return;\n }\n\n // 第一次执行的时候调用\n onFirstRun() {\n return;\n }\n\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart() {\n return;\n }\n\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd() {\n return;\n }\n\n getEndProps(): Record<string, any> | void {\n return this.to;\n }\n\n getFromProps(): Record<string, any> | void {\n return this.from;\n }\n\n getMergedEndProps(): Record<string, any> | void {\n const thisEndProps = this.getEndProps();\n if (thisEndProps) {\n if (this._endProps === thisEndProps) {\n return this._mergedEndProps;\n }\n this._endProps = thisEndProps;\n this._mergedEndProps = Object.assign({}, this.step.prev.getLastProps() ?? {}, thisEndProps);\n return;\n }\n return this.step.prev ? this.step.prev.getLastProps() : thisEndProps;\n }\n\n // abstract getFromValue(key: string): any;\n // abstract getToValue(key: string): any;\n\n abstract onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updateCount === 0) {\n this.onFirstRun();\n // out添加之前的props\n const props = this.step.getLastProps();\n Object.keys(props).forEach(k => {\n if (this.subAnimate.animate.validAttr(k)) {\n out[k] = props[k];\n }\n });\n }\n this.updateCount += 1;\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n}\n\nexport class CbAnimate extends ACustomAnimate<null> {\n cb: () => void;\n\n constructor(cb: () => void) {\n super(null, null, 0, 'linear');\n this.cb = cb;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n return;\n }\n\n onStart(): void {\n this.cb();\n }\n}\n\ntype InterpolateFunc = (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n out: Record<string, any>\n) => boolean;\n\nexport class Animate implements IAnimate {\n static mode: AnimateMode = AnimateMode.NORMAL;\n declare target: IAnimateTarget;\n declare timeline: ITimeline;\n declare nextAnimate?: IAnimate;\n declare prevAnimate?: IAnimate;\n // 当前Animate的状态,正常,暂停,结束\n declare status: AnimateStatus;\n declare readonly id: string | number;\n // 开始时间\n protected declare _startTime: number;\n protected declare _duringTime: number;\n declare subAnimates: SubAnimate[];\n declare tailAnimate: SubAnimate;\n\n // 绝对的位置\n declare rawPosition: number;\n // 时间倍速缩放\n declare timeScale: number;\n\n declare interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n declare _onStart?: (() => void)[];\n declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n declare _onEnd?: (() => void)[];\n declare _onRemove?: (() => void)[];\n declare _preventAttrs?: Set<string>;\n static interpolateMap: Map<string, InterpolateFunc> = new Map();\n slience?: boolean;\n\n constructor(\n id: string | number = Generator.GenAutoIncrementId(),\n timeline: ITimeline = defaultTimeline,\n slience?: boolean\n ) {\n this.id = id;\n this.timeline = timeline;\n this.status = AnimateStatus.INITIAL;\n this.tailAnimate = new SubAnimate(this);\n this.subAnimates = [this.tailAnimate];\n this.timeScale = 1;\n this.rawPosition = -1;\n this._startTime = 0;\n this._duringTime = 0;\n this.timeline.addAnimate(this);\n this.slience = slience;\n }\n\n setTimeline(timeline: ITimeline) {\n if (timeline === this.timeline) {\n return;\n }\n this.timeline.removeAnimate(this, false);\n timeline.addAnimate(this);\n }\n\n getStartTime(): number {\n return this._startTime;\n }\n\n getDuration(): number {\n return this.subAnimates.reduce((t, subAnimate) => t + subAnimate.totalDuration, 0);\n }\n\n after(animate: IAnimate) {\n const t = animate.getDuration();\n this._startTime = t;\n return this;\n }\n\n afterAll(list: IAnimate[]) {\n let maxT = -Infinity;\n list.forEach(a => {\n maxT = max(a.getDuration(), maxT);\n });\n this._startTime = maxT;\n return this;\n }\n\n parallel(animate: IAnimate) {\n this._startTime = animate.getStartTime();\n return this;\n }\n\n static AddInterpolate(name: string, cb: InterpolateFunc) {\n Animate.interpolateMap.set(name, cb);\n }\n\n play(customAnimate: ICustomAnimate) {\n this.tailAnimate.play(customAnimate);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n if (this.subAnimates.length === 1 && this.tailAnimate.totalDuration === customAnimate.duration) {\n this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode);\n }\n return this;\n }\n\n trySetAttribute(attr: Record<string, any> | void, mode: AnimateMode = Animate.mode) {\n if (attr && mode & AnimateMode.SET_ATTR_IMMEDIATELY) {\n (this.target as any).setAttributes &&\n (this.target as any).setAttributes(attr, false, { type: AttributeUpdateType.ANIMATE_PLAY });\n }\n }\n\n runCb(cb: (a: IAnimate, step: IStep) => void) {\n // this.tailAnimate.runCb(cb);\n const customAnimate = new CbAnimate(() => {\n cb(this, customAnimate.step.prev);\n });\n this.tailAnimate.play(customAnimate);\n return this;\n }\n\n /**\n * 自定义插值,返回false表示没有匹配上\n * @param key\n * @param from\n * @param to\n */\n customInterpolate(\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ): boolean {\n const func = Animate.interpolateMap.get(key) || Animate.interpolateMap.get('');\n if (!func) {\n return false;\n }\n return func(key, ratio, from, to, target, ret);\n }\n\n pause() {\n if (this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.PAUSED;\n }\n }\n\n resume() {\n if (this.status === AnimateStatus.PAUSED) {\n this.status = AnimateStatus.RUNNING;\n }\n }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.to(props, duration, easing, params);\n // 默认开始动画\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n // if (this.subAnimates.length === 1 && this.tailAnimate.duration === duration) {\n // this.trySetAttribute(props);\n // }\n return this;\n }\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.from(props, duration, easing, params);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n wait(duration: number) {\n this.tailAnimate.wait(duration);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n startAt(t: number) {\n this.tailAnimate.startAt(t);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n loop(l: number) {\n this.tailAnimate.loop = l;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n reversed(r: boolean) {\n this.tailAnimate.reversed = r;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n bounce(b: boolean) {\n this.tailAnimate.bounce = b;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n subAnimate() {\n const sa = new SubAnimate(this, this.tailAnimate);\n this.tailAnimate = sa;\n this.subAnimates.push(sa);\n sa.bind(this.target);\n return this;\n }\n\n getStartProps(): Record<string, any> {\n return this.subAnimates[0].getStartProps();\n }\n\n getEndProps(): Record<string, any> {\n return this.tailAnimate.getEndProps();\n }\n\n depreventAttr(key: string) {\n if (!this._preventAttrs) {\n return;\n }\n this._preventAttrs.delete(key);\n }\n preventAttr(key: string) {\n if (!this._preventAttrs) {\n this._preventAttrs = new Set();\n }\n this._preventAttrs.add(key);\n }\n preventAttrs(keys: string[]) {\n keys.forEach(key => this.preventAttr(key));\n }\n validAttr(key: string): boolean {\n if (!this._preventAttrs) {\n return true;\n }\n return !this._preventAttrs.has(key);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n\n if (this.target.onAnimateBind && !this.slience) {\n this.target.onAnimateBind(this);\n }\n\n this.subAnimates.forEach(sa => {\n sa.bind(target);\n });\n return this;\n }\n\n advance(delta: number) {\n // startTime之前的时间不计入耗时\n if (this._duringTime < this._startTime) {\n if (this._duringTime + delta * this.timeScale < this._startTime) {\n this._duringTime += delta * this.timeScale;\n return;\n }\n delta = this._duringTime + delta * this.timeScale - this._startTime;\n this._duringTime = this._startTime;\n }\n // 执行advance\n if (this.status === AnimateStatus.INITIAL) {\n this.status = AnimateStatus.RUNNING;\n this._onStart && this._onStart.forEach(cb => cb());\n }\n const end = this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale);\n if (end && this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.END;\n this._onEnd && this._onEnd.forEach(cb => cb());\n }\n }\n\n setPosition(rawPosition: number): boolean {\n let d = 0;\n let sa: SubAnimate | undefined;\n const prevRawPos = this.rawPosition;\n const maxRawPos = this.subAnimates.reduce((a, b) => a + b.totalDuration, 0);\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n\n const end = rawPosition >= maxRawPos;\n\n if (end) {\n rawPosition = maxRawPos;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // 查找对应的subAnimate\n for (let i = 0; i < this.subAnimates.length; i++) {\n sa = this.subAnimates[i];\n if (d + sa.totalDuration >= rawPosition) {\n break;\n } else {\n d += sa.totalDuration;\n sa = undefined;\n }\n }\n this.rawPosition = rawPosition;\n sa.setPosition(rawPosition - d);\n\n return end;\n }\n\n onStart(cb: () => void) {\n if (!this._onStart) {\n this._onStart = [];\n }\n this._onStart.push(cb);\n }\n onEnd(cb: () => void) {\n if (!this._onEnd) {\n this._onEnd = [];\n }\n this._onEnd.push(cb);\n }\n onRemove(cb: () => void) {\n if (!this._onRemove) {\n this._onRemove = [];\n }\n this._onRemove.push(cb);\n }\n onFrame(cb: (step: IStep, ratio: number) => void) {\n if (!this._onFrame) {\n this._onFrame = [];\n }\n this._onFrame.push(cb);\n }\n release() {\n this.status = AnimateStatus.END;\n return;\n }\n\n stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n if (!nextVal) {\n this.target.onStop();\n }\n if (nextVal === 'start') {\n this.target.onStop(this.getStartProps());\n } else if (nextVal === 'end') {\n this.target.onStop(this.getEndProps());\n } else {\n this.target.onStop(nextVal);\n }\n this.release();\n }\n}\n\n// Animate.mode |= AnimateMode.SET_ATTR_IMMEDIATELY;\n\nexport class SubAnimate implements ISubAnimate {\n declare target: IAnimateTarget;\n declare animate: IAnimate;\n // 默认的初始step,一定存在,且stepHead的props一定保存整个subAnimate阶段所有属性的最初\n protected declare stepHead: Step;\n protected declare stepTail: Step;\n // 结束时反转动画\n declare bounce: boolean;\n // 是否reverse\n declare reversed: boolean;\n // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n declare loop: number;\n // 持续时间,不包括循环\n declare duration: number;\n // 位置,在[0, duration]之间\n declare position: number;\n // 绝对的位置,在[0, loops * duration]之间\n declare rawPosition: number;\n declare dirty: boolean;\n\n declare _totalDuration: number;\n declare _startAt: number;\n declare _lastStep: IStep;\n declare _deltaPosition: number;\n\n get totalDuration(): number {\n this.calcAttr();\n return this._totalDuration + this._startAt;\n }\n\n constructor(animate: IAnimate, lastSubAnimate?: SubAnimate) {\n this.rawPosition = -1;\n this.position = 0;\n this.loop = 0;\n this.duration = 0;\n this.animate = animate;\n if (lastSubAnimate) {\n this.stepHead = new Step(0, 0, Object.assign({}, lastSubAnimate.stepTail.props));\n } else {\n this.stepHead = new Step(0, 0, {});\n }\n this.stepTail = this.stepHead;\n this.dirty = true;\n this._startAt = 0;\n }\n\n // 计算按需计算的属性\n protected calcAttr() {\n if (!this.dirty) {\n return;\n }\n\n this._totalDuration = this.duration * (this.loop + 1);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n return this;\n }\n\n play(customAnimate: ICustomAnimate) {\n let duration = customAnimate.duration;\n if (duration == null || duration < 0) {\n duration = 0;\n }\n const easing = customAnimate.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.customAnimate;\n this._appendProps(customAnimate.getEndProps(), step, false);\n this._appendCustomAnimate(customAnimate, step);\n return this;\n }\n\n // _appendPlayProps(step: IStep) {\n\n // return;\n // }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n if (duration == null || duration < 0) {\n duration = 0;\n }\n\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.to;\n this._appendProps(props, step, params ? params.tempProps : false);\n // this._appendPlayProps(step);\n\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n if (!(params && params.noPreventAttrs)) {\n this.target.animates &&\n this.target.animates.forEach(a => {\n if (a.id !== this.animate.id) {\n a.preventAttrs(step.propKeys);\n }\n });\n }\n return this;\n }\n\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.to(props, 0, easing, params);\n const toProps = {};\n if (!this.stepTail.propKeys) {\n this.stepTail.propKeys = Object.keys(this.stepTail.props);\n }\n this.stepTail.propKeys.forEach(k => {\n toProps[k] = this.getLastPropByName(k, this.stepTail);\n });\n this.to(toProps, duration, easing, params);\n this.stepTail.type = AnimateStepType.from;\n }\n\n startAt(t: number) {\n if (t < 0) {\n t = 0;\n }\n this._startAt = t;\n return this;\n }\n\n getStartProps() {\n return this.stepHead?.props;\n }\n\n getEndProps() {\n return this.stepTail.props;\n }\n\n getLastStep() {\n return this._lastStep;\n }\n\n wait(duration: number) {\n if (duration > 0) {\n const step = this._addStep(+duration, null);\n\n step.type = AnimateStepType.wait;\n // TODO 这里如果跳帧的话会存在bug\n if (step.prev.customAnimate) {\n step.props = step.prev.customAnimate.getEndProps();\n } else {\n step.props = step.prev.props;\n }\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n // this._appendPlayProps(step);\n }\n return this;\n }\n\n protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n const step = new Step(this.duration, duration, props, easingFunc);\n this.duration += duration;\n this.stepTail.append(step);\n this.stepTail = step;\n return step;\n }\n\n protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n if (tempProps) {\n step.props = props;\n } else {\n // todo: 是否需要深拷贝props\n step.props = Object.assign({}, props);\n }\n let lastStep = step.prev;\n const _props = step.props;\n // 将undefined的属性设置到默认值\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n step.propKeys.forEach(k => {\n if (step.props[k] === undefined) {\n step.props[k] = this.target.getDefaultAttribute(k);\n }\n });\n // 拷贝之前的step阶段属性\n while (lastStep.prev) {\n if (lastStep.props) {\n if (!lastStep.propKeys) {\n lastStep.propKeys = Object.keys(lastStep.props);\n }\n lastStep.propKeys.forEach(key => {\n if (_props[key] === undefined) {\n _props[key] = lastStep.props[key];\n }\n });\n }\n // 重置propKeys\n step.propKeys = Object.keys(step.props);\n lastStep = lastStep.prev;\n }\n\n // 设置最初的props属性\n const initProps = this.stepHead.props;\n if (!step.propKeys) {\n step.propKeys = Object.keys(_props);\n }\n step.propKeys.forEach(key => {\n if (initProps[key] === undefined) {\n const parentAnimateInitProps = this.animate.getStartProps();\n initProps[key] = parentAnimateInitProps[key] = this.target.getComputedAttribute(key);\n }\n });\n\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n }\n\n protected _appendCustomAnimate(customAnimate: ICustomAnimate, step: Step) {\n step.customAnimate = customAnimate;\n customAnimate.step = step;\n customAnimate.bind(this.target, this);\n }\n\n setPosition(rawPosition: number) {\n const d = this.duration;\n const loopCount = this.loop;\n const prevRawPos = this.rawPosition;\n let end = false;\n let loop: number; // 当前是第几次循环\n let position: number; // 当前周期的时间\n const startAt = this._startAt ?? 0;\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n if (rawPosition < startAt) {\n this.rawPosition = rawPosition;\n return false;\n }\n rawPosition = rawPosition - startAt;\n if (d <= 0) {\n // 如果不用执行,跳过\n end = true;\n // 小于0的话,直接return,如果等于0,那还是得走动画逻辑,将end属性设置上去\n if (d < 0) {\n return end;\n }\n }\n loop = Math.floor(rawPosition / d);\n position = rawPosition - loop * d;\n\n // 计算rawPosition\n end = rawPosition >= loopCount * d + d;\n // 如果结束,跳过\n if (end) {\n position = d;\n loop = loopCount;\n rawPosition = position * loop + d;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // reverse动画\n const rev = !this.reversed !== !(this.bounce && loop % 2);\n if (rev) {\n position = d - position;\n }\n\n this._deltaPosition = position - this.position;\n this.position = position;\n this.rawPosition = rawPosition + startAt;\n\n this.updatePosition(end, rev);\n\n return end;\n }\n\n protected updatePosition(end: boolean, rev: boolean) {\n if (!this.stepHead) {\n return;\n }\n let step = this.stepHead.next;\n const position = this.position;\n const duration = this.duration;\n if (this.target && step) {\n let stepNext = step.next;\n while (stepNext && stepNext.position <= position) {\n step = stepNext;\n stepNext = step.next;\n }\n let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n if (step.easing) {\n ratio = step.easing(ratio);\n }\n // 判断这次和上次过程中是否经历了自定义step,如果跳过了自定义step那么执行自定义step的onEnd\n this.tryCallCustomAnimateLifeCycle(step, this._lastStep || (rev ? this.stepTail : this.stepHead), rev);\n // if (step !== this._lastStep) {\n // if (this._deltaPosition > 0) {\n // let _step = step.prev;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.prev;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // } else if (this._deltaPosition < 0) {\n // let _step = step.next;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.next;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // }\n // }\n this.updateTarget(step, ratio, end);\n this._lastStep = step;\n\n this.animate._onFrame && this.animate._onFrame.forEach(cb => cb(step, ratio));\n }\n }\n\n // 如果动画卡顿跳过了自定义动画,那么尝试执行自定义动画的生命周期\n tryCallCustomAnimateLifeCycle(step: IStep, lastStep: IStep, rev: boolean) {\n if (step === lastStep) {\n return;\n }\n if (rev) {\n let _step = lastStep.prev;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = step.prev;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n } else {\n let _step = lastStep.next;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = _step.next;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n }\n }\n\n /**\n * 获取这个属性的上一个值\n * @param name\n * @param step\n * @returns\n */\n getLastPropByName(name: string, step: Step): any {\n let lastStep = step.prev;\n while (lastStep) {\n if (lastStep.props && lastStep.props[name] !== undefined) {\n return lastStep.props[name];\n } else if (lastStep.customAnimate) {\n const val = lastStep.customAnimate.getEndProps()[name];\n if (val !== undefined) {\n return val;\n }\n }\n lastStep = lastStep.prev;\n }\n\n Logger.getInstance().warn('未知错误,step中找不到属性');\n return step.props[name];\n }\n\n protected updateTarget(step: Step, ratio: number, end: boolean) {\n if (step.props == null && step.customAnimate == null) {\n return;\n }\n this.target.onStep(this, this.animate, step, ratio, end);\n }\n}\n\n// export class Animate implements IAnimate {\n// declare target: IAnimateTarget;\n// declare timeline: ITimeline;\n// protected declare stepHead: Step;\n// protected declare stepTail: Step;\n// declare nextAnimate?: Animate;\n// declare prevAnimate?: Animate;\n// // 结束时反转动画\n// declare bounce: boolean;\n// // 是否reverse\n// declare reversed: boolean;\n// // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n// declare loop: number;\n// // 持续时间,不包括循环\n// declare duration: number;\n// // 当前Animate的状态,正常,暂停,结束\n// declare status: AnimateStatus;\n// // 位置,在[0, duration]之间\n// declare position: number;\n// // 绝对的位置,在[0, loops * duration]之间\n// declare rawPosition: number;\n// // 开始时间\n// protected declare _startAt: number;\n// // 时间的缩放,例如2表示2倍速\n// declare timeScale: number;\n// declare props: Record<string, any>;\n// declare readonly id: string | number;\n\n// protected declare _onStart?: (() => void)[];\n// protected declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n// protected declare _onEnd?: (() => void)[];\n// declare _onRemove?: (() => void)[];\n// declare _preventAttrs?: Set<string>;\n\n// constructor(id: string | number = Generator.GenAutoIncrementId(), timeline: ITimeline = defaultTimeline) {\n// this.timeline = timeline;\n// this.status = AnimateStatus.INITIAL;\n// this.rawPosition = -1;\n// this.position = 0;\n// this.loop = 0;\n// this.timeline.addAnimate(this);\n// this.timeScale = 1;\n// this.id = id;\n// this.props = {};\n// this.stepHead = new Step(0, 0, {});\n// this.stepTail = this.stepHead;\n// }\n\n// preventAttr(key: string) {\n// if (!this._preventAttrs) {\n// this._preventAttrs = new Set();\n// }\n// this._preventAttrs.add(key);\n// }\n// preventAttrs(keys: string[]) {\n// keys.forEach(key => this.preventAttr(key));\n// }\n// validAttr(key: string): boolean {\n// if (!this._preventAttrs) {\n// return true;\n// }\n// return !this._preventAttrs.has(key);\n// }\n\n// getLastPropByName(name: string, step: Step): any {\n// let lastStep = step.prev;\n// while (lastStep) {\n// if (lastStep.props && lastStep.props[name] !== undefined) {\n// return lastStep.props[name];\n// }\n// lastStep = lastStep.prev;\n// }\n// let val = this.props[name];\n// if (!val) {\n// console.warn('未知错误,step中找不到属性');\n// val = this.target.getComputedAttribute(name);\n// this.props[name] = val;\n// }\n\n// return val;\n// }\n\n// bind(target: IAnimateTarget) {\n// this.target = target;\n// this.duration = 0;\n// return this;\n// }\n\n// startAt(t: number) {\n// if (t < 0) {\n// return this;\n// }\n// this._startAt = t;\n// return this;\n// }\n\n// to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n// if (duration == null || duration < 0) {\n// duration = 0;\n// }\n\n// const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n// const step = this._addStep(duration, null, easingFunc);\n// this._appendProps(props, step, params ? params.tempProps : false);\n// return this;\n// }\n\n// wait(duration: number) {\n// if (duration > 0) {\n// const step = this._addStep(+duration, null);\n// if (step.prev) {\n// step.props = step.prev.props;\n// }\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n// return this;\n// }\n\n// protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n// const step = new Step(this.duration, duration, props, easingFunc);\n// this.duration += duration;\n// this.stepTail.append(step);\n// this.stepTail = step;\n// return step;\n// }\n\n// protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n// if (tempProps) {\n// step.props = props;\n// } else {\n// // todo: 是否需要深拷贝props\n// step.props = Object.assign({}, props);\n// }\n// let lastStep = step.prev;\n// const _props = step.props;\n// // 拷贝之前的step阶段属性\n// while (lastStep.prev) {\n// if (lastStep.props) {\n// if (!lastStep.propKeys) {\n// lastStep.propKeys = Object.keys(lastStep.props);\n// }\n// lastStep.propKeys.forEach(key => {\n// if (_props[key] === undefined) {\n// _props[key] = lastStep.props[key];\n// }\n// });\n// }\n// lastStep = lastStep.prev;\n// }\n\n// // 设置最初的props属性\n// const initProps = this.stepHead.props;\n// if (!step.propKeys) {\n// step.propKeys = Object.keys(_props);\n// step.propKeys.forEach(key => {\n// initProps[key] = this.target.getComputedAttribute(key);\n// });\n// }\n\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n\n// advance(delta: number) {\n// if (this.status === AnimateStatus.INITIAL) {\n// this.status = AnimateStatus.RUNNING;\n// this._onStart && this._onStart.forEach(cb => cb());\n// }\n// const end = this.setPosition(this.rawPosition + delta * this.timeScale);\n// if (end && this.status === AnimateStatus.RUNNING) {\n// this.status = AnimateStatus.END;\n// this._onEnd && this._onEnd.forEach(cb => cb());\n// }\n// }\n\n// setPosition(rawPosition: number) {\n// const d = this.duration;\n// const loopCount = this.loop;\n// const prevRawPos = this.rawPosition;\n// let end = false;\n// let loop: number; // 当前是第几次循环\n// let position: number; // 当前周期的时间\n// const startAt = this._startAt ?? 0;\n\n// if (rawPosition < 0) {\n// rawPosition = 0;\n// }\n// if (rawPosition < startAt) {\n// this.rawPosition = rawPosition;\n// return false;\n// }\n// rawPosition = rawPosition - startAt;\n// if (d <= 0) {\n// // 如果不用执行,跳过\n// end = true;\n// return end;\n// }\n// loop = Math.floor(rawPosition / d);\n// position = rawPosition - loop * d;\n\n// // 计算rawPosition\n// end = rawPosition >= loopCount * d + d;\n// // 如果结束,跳过\n// if (end) {\n// position = d;\n// loop = loopCount;\n// rawPosition = position * loop + d;\n// }\n\n// if (rawPosition === prevRawPos) {\n// return end;\n// }\n\n// // reverse动画\n// const rev = !this.reversed !== !(this.bounce && loop % 2);\n// if (rev) {\n// position = d - position;\n// }\n\n// this.position = position;\n// this.rawPosition = rawPosition + startAt;\n\n// this.updatePosition(end);\n\n// return end;\n// }\n\n// protected updatePosition(end: boolean) {\n// if (!this.stepHead) {\n// return;\n// }\n// let step = this.stepHead;\n// const position = this.position;\n// const duration = this.duration;\n// if (this.target && step) {\n// let stepNext = step.next;\n// while (stepNext && stepNext.position <= position) {\n// step = step.next;\n// stepNext = step.next;\n// }\n// let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n// if (step.easing) {\n// ratio = step.easing(ratio);\n// }\n// this.updateTarget(step, ratio, end);\n// this._onFrame && this._onFrame.forEach(cb => cb(step, ratio));\n// }\n// }\n\n// protected updateTarget(step: Step, ratio: number, end: boolean) {\n// if (step.props == null) {\n// return;\n// }\n// this.target.onStep(this, step, ratio, end);\n// }\n\n// onStart(cb: () => void) {\n// if (!this._onStart) {\n// this._onStart = [];\n// }\n// this._onStart.push(cb);\n// }\n// onEnd(cb: () => void) {\n// if (!this._onEnd) {\n// this._onEnd = [];\n// }\n// this._onEnd.push(cb);\n// }\n// onRemove(cb: () => void) {\n// if (!this._onRemove) {\n// this._onRemove = [];\n// }\n// this._onRemove.push(cb);\n// }\n// onFrame(cb: (step: IStep, ratio: number) => void) {\n// if (!this._onFrame) {\n// this._onFrame = [];\n// }\n// this._onFrame.push(cb);\n// }\n\n// getStartProps() {\n// return this.stepHead?.props;\n// }\n\n// getEndProps(target: Record<string, any> = {}) {\n// let step = this.stepHead;\n// while (step) {\n// if (step.props) {\n// Object.assign(target, step.props);\n// }\n// step = step.next;\n// }\n\n// return target;\n// }\n\n// stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n// this.status = AnimateStatus.END;\n// if (!nextVal) {\n// this.target.onStop();\n// }\n// if (nextVal === 'start') {\n// this.target.onStop(this.getStartProps());\n// } else if (nextVal === 'end') {\n// this.target.onStop(this.getEndProps());\n// } else {\n// this.target.onStop(nextVal);\n// }\n// }\n\n// release() {\n// this.status = AnimateStatus.END;\n// return;\n// }\n// }\n\nclass Step implements IStep {\n declare prev?: Step;\n // 持续时间\n declare duration: number;\n // 在animate中的位置\n declare position: number;\n declare next?: Step;\n declare props: any;\n // 保存解析后的props,用于性能优化\n declare parsedProps?: any;\n declare propKeys?: string[];\n declare easing?: EasingTypeFunc;\n declare customAnimate?: ICustomAnimate;\n // passive: boolean;\n // index: number;\n type: IAnimateStepType;\n\n constructor(position: number, duration: number, props?: any, easing?: EasingTypeFunc) {\n this.duration = duration;\n this.position = position;\n this.props = props;\n this.easing = easing;\n }\n\n append(step: Step) {\n step.prev = this;\n step.next = this.next;\n this.next = step;\n }\n\n getLastProps() {\n let step = this.prev;\n while (step) {\n if (step.props) {\n return step.props;\n } else if (step.customAnimate) {\n return step.customAnimate.getMergedEndProps();\n }\n step = step.prev as any;\n }\n return null;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function generatorPathEasingFunc(path: string): (x: number) => number;
@@ -0,0 +1,10 @@
1
+ import { CustomPath2D } from "../common/custom-path2d";
2
+
3
+ import { CurveContext } from "../common/segment";
4
+
5
+ export function generatorPathEasingFunc(path) {
6
+ const customPath = new CustomPath2D;
7
+ return customPath.setCtx(new CurveContext(customPath)), customPath.fromString(path, 0, 0, 1, 1),
8
+ x => customPath.getYAt(x);
9
+ }
10
+ //# sourceMappingURL=easing-func.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animate/easing-func.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,MAAM,UAAU,GAAG,IAAI,YAAY,EAAE,CAAC;IACtC,UAAU,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IAChD,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAExC,OAAO,CAAC,CAAS,EAAE,EAAE;QACnB,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC;AACJ,CAAC","file":"easing-func.js","sourcesContent":["import { CustomPath2D } from '../common/custom-path2d';\nimport { CurveContext } from '../common/segment';\n\nexport function generatorPathEasingFunc(path: string) {\n const customPath = new CustomPath2D();\n customPath.setCtx(new CurveContext(customPath));\n customPath.fromString(path, 0, 0, 1, 1);\n\n return (x: number) => {\n return customPath.getYAt(x);\n };\n}\n"]}
@@ -42,4 +42,8 @@ export declare class Easing {
42
42
  static elasticIn: (t: number) => number;
43
43
  static elasticOut: (t: number) => number;
44
44
  static elasticInOut: (t: number) => number;
45
+ static easeInOutQuad: (t: number) => number;
46
+ static easeOutElastic: (x: number) => number;
47
+ static easeInOutElastic: (x: number) => number;
48
+ static registerFunc(name: string, func: (t: number) => number): void;
45
49
  }
@@ -99,6 +99,9 @@ export class Easing {
99
99
  return (t *= 2) < 1 ? amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * -.5 : amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * .5 + 1;
100
100
  };
101
101
  }
102
+ static registerFunc(name, func) {
103
+ Easing[name] = func;
104
+ }
102
105
  }
103
106
 
104
107
  Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing.quadInOut = Easing.getPowInOut(2),
@@ -107,5 +110,13 @@ Easing.quartIn = Easing.getPowIn(4), Easing.quartOut = Easing.getPowOut(4), Easi
107
110
  Easing.quintIn = Easing.getPowIn(5), Easing.quintOut = Easing.getPowOut(5), Easing.quintInOut = Easing.getPowInOut(5),
108
111
  Easing.backIn = Easing.getBackIn(1.7), Easing.backOut = Easing.getBackOut(1.7),
109
112
  Easing.backInOut = Easing.getBackInOut(1.7), Easing.elasticIn = Easing.getElasticIn(1, .3),
110
- Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5);
113
+ Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5),
114
+ Easing.easeInOutQuad = t => (t /= .5) < 1 ? .5 * Math.pow(t, 2) : -.5 * ((t -= 2) * t - 2),
115
+ Easing.easeOutElastic = x => {
116
+ const c4 = 2 * Math.PI / 3;
117
+ return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
118
+ }, Easing.easeInOutElastic = x => {
119
+ const c5 = 2 * Math.PI / 4.5;
120
+ return 0 === x ? 0 : 1 === x ? 1 : x < .5 ? -Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
121
+ };
111
122
  //# sourceMappingURL=easing.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animate/easing.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAMvC,MAAM,OAAO,MAAM;IACjB;IAEA,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,CAAS;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAOD,MAAM,CAAC,GAAG,CAAC,MAAc;QACvB,IAAI,MAAM,GAAG,CAAC,CAAC,EAAE;YACf,MAAM,GAAG,CAAC,CAAC,CAAC;SACb;aAAM,IAAI,MAAM,GAAG,CAAC,EAAE;YACrB,MAAM,GAAG,CAAC,CAAC;SACZ;QAED,OAAO,UAAU,CAAS;YACxB,IAAI,MAAM,KAAK,CAAC,EAAE;gBAChB,OAAO,CAAC,CAAC;aACV;YACD,IAAI,MAAM,GAAG,CAAC,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;aACvC;YACD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QAC/C,CAAC,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C;AACxC,iBAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1C,mBAAY,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC","file":"easing.js","sourcesContent":["/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\nimport { pi2 } from '@visactor/vutils';\n\n/**\n * 代码迁移自createjs\n * 部分缓动函数参考https://easings.net/\n */\nexport class Easing {\n private constructor() {\n // do nothing\n }\n\n static linear(t: number): number {\n return t;\n }\n\n static none() {\n return this.linear;\n }\n\n /**\n * 获取缓动函数,amount指示这个缓动函数的插值方式\n * @param amount\n * @returns\n */\n static get(amount: number) {\n if (amount < -1) {\n amount = -1;\n } else if (amount > 1) {\n amount = 1;\n }\n\n return function (t: number) {\n if (amount === 0) {\n return t;\n }\n if (amount < 0) {\n return t * (t * -amount + 1 + amount);\n }\n return t * ((2 - t) * amount + (1 - amount));\n };\n }\n\n /* 语法糖 */\n static getPowIn(pow: number) {\n return function (t: number) {\n return Math.pow(t, pow);\n };\n }\n\n static getPowOut(pow: number) {\n return function (t: number) {\n return 1 - Math.pow(1 - t, pow);\n };\n }\n\n static getPowInOut(pow: number) {\n return function (t: number) {\n if ((t *= 2) < 1) {\n return 0.5 * Math.pow(t, pow);\n }\n return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));\n };\n }\n\n // 插值函数\n static quadIn = Easing.getPowIn(2);\n static quadOut = Easing.getPowOut(2);\n\n static quadInOut = Easing.getPowInOut(2);\n static cubicIn = Easing.getPowIn(3);\n static cubicOut = Easing.getPowOut(3);\n static cubicInOut = Easing.getPowInOut(3);\n static quartIn = Easing.getPowIn(4);\n static quartOut = Easing.getPowOut(4);\n static quartInOut = Easing.getPowInOut(4);\n static quintIn = Easing.getPowIn(5);\n static quintOut = Easing.getPowOut(5);\n static quintInOut = Easing.getPowInOut(5);\n\n /* 语法糖 */\n static getBackIn(amount: number) {\n return function (t: number) {\n return t * t * ((amount + 1) * t - amount);\n };\n }\n static getBackOut(amount: number) {\n return function (t: number) {\n return --t * t * ((amount + 1) * t + amount) + 1;\n };\n }\n static getBackInOut(amount: number) {\n amount *= 1.525;\n return function (t: number) {\n if ((t *= 2) < 1) {\n return 0.5 * (t * t * ((amount + 1) * t - amount));\n }\n return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);\n };\n }\n\n // 插值函数\n static backIn = Easing.getBackIn(1.7);\n static backOut = Easing.getBackOut(1.7);\n static backInOut = Easing.getBackInOut(1.7);\n\n static sineIn(t: number): number {\n return 1 - Math.cos((t * Math.PI) / 2);\n }\n\n static sineOut(t: number): number {\n return Math.sin((t * Math.PI) / 2);\n }\n\n static sineInOut(t: number): number {\n return -(Math.cos(Math.PI * t) - 1) / 2;\n }\n\n static expoIn(t: number): number {\n return t === 0 ? 0 : Math.pow(2, 10 * t - 10);\n }\n\n static expoOut(t: number): number {\n return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);\n }\n\n static expoInOut(t: number): number {\n return t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2;\n }\n\n // 插值函数\n static circIn(t: number) {\n return -(Math.sqrt(1 - t * t) - 1);\n }\n\n static circOut(t: number) {\n return Math.sqrt(1 - --t * t);\n }\n\n static circInOut(t: number) {\n if ((t *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n }\n static bounceOut(t: number) {\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n } else if (t < 2 / 2.75) {\n return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;\n } else if (t < 2.5 / 2.75) {\n return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;\n }\n return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;\n }\n static bounceIn(t: number) {\n return 1 - Easing.bounceOut(1 - t);\n }\n\n static bounceInOut(t: number) {\n if (t < 0.5) {\n return Easing.bounceIn(t * 2) * 0.5;\n }\n return Easing.bounceOut(t * 2 - 1) * 0.5 + 0.5;\n }\n\n /* 语法糖 */\n static getElasticIn(amplitude: number, period: number) {\n return function (t: number) {\n if (t === 0 || t === 1) {\n return t;\n }\n const s = (period / pi2) * Math.asin(1 / amplitude);\n return -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * pi2) / period));\n };\n }\n static getElasticOut(amplitude: number, period: number) {\n return function (t: number) {\n if (t === 0 || t === 1) {\n return t;\n }\n const s = (period / pi2) * Math.asin(1 / amplitude);\n return amplitude * Math.pow(2, -10 * t) * Math.sin(((t - s) * pi2) / period) + 1;\n };\n }\n static getElasticInOut(amplitude: number, period: number) {\n return function (t: number) {\n const s = (period / pi2) * Math.asin(1 / amplitude);\n if ((t *= 2) < 1) {\n return -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * pi2) / period));\n }\n return amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s) * pi2) / period) * 0.5 + 1;\n };\n }\n\n // 插值函数\n static elasticIn = Easing.getElasticIn(1, 0.3);\n static elasticOut = Easing.getElasticOut(1, 0.3);\n static elasticInOut = Easing.getElasticInOut(1, 0.3 * 1.5);\n}\n"]}
1
+ {"version":3,"sources":["../src/animate/easing.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAMvC,MAAM,OAAO,MAAM;IACjB;IAEA,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,CAAS;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAOD,MAAM,CAAC,GAAG,CAAC,MAAc;QACvB,IAAI,MAAM,GAAG,CAAC,CAAC,EAAE;YACf,MAAM,GAAG,CAAC,CAAC,CAAC;SACb;aAAM,IAAI,MAAM,GAAG,CAAC,EAAE;YACrB,MAAM,GAAG,CAAC,CAAC;SACZ;QAED,OAAO,UAAU,CAAS;YACxB,IAAI,MAAM,KAAK,CAAC,EAAE;gBAChB,OAAO,CAAC,CAAC;aACV;YACD,IAAI,MAAM,GAAG,CAAC,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;aACvC;YACD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC;IACJ,CAAC;IAGD,MAAM,CAAC,QAAQ,CAAC,GAAW;QACzB,OAAO,UAAU,CAAS;YACxB,OAAO,IAAI,CAAC,GAAG,CAA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,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;gBACpE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC,CAAC","file":"easing.js","sourcesContent":["/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\nimport { pi2 } from '@visactor/vutils';\n\n/**\n * 代码迁移自createjs\n * 部分缓动函数参考https://easings.net/\n */\nexport class Easing {\n private constructor() {\n // do nothing\n }\n\n static linear(t: number): number {\n return t;\n }\n\n static none() {\n return this.linear;\n }\n\n /**\n * 获取缓动函数,amount指示这个缓动函数的插值方式\n * @param amount\n * @returns\n */\n static get(amount: number) {\n if (amount < -1) {\n amount = -1;\n } else if (amount > 1) {\n amount = 1;\n }\n\n return function (t: number) {\n if (amount === 0) {\n return t;\n }\n if (amount < 0) {\n return t * (t * -amount + 1 + amount);\n }\n return t * ((2 - t) * amount + (1 - amount));\n };\n }\n\n /* 语法糖 */\n static getPowIn(pow: number) {\n return function (t: number) {\n return Math.pow(t, pow);\n };\n }\n\n static getPowOut(pow: number) {\n return function (t: number) {\n return 1 - Math.pow(1 - t, pow);\n };\n }\n\n static getPowInOut(pow: number) {\n return function (t: number) {\n if ((t *= 2) < 1) {\n return 0.5 * Math.pow(t, pow);\n }\n return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));\n };\n }\n\n // 插值函数\n static quadIn = Easing.getPowIn(2);\n static quadOut = Easing.getPowOut(2);\n\n static quadInOut = Easing.getPowInOut(2);\n static cubicIn = Easing.getPowIn(3);\n static cubicOut = Easing.getPowOut(3);\n static cubicInOut = Easing.getPowInOut(3);\n static quartIn = Easing.getPowIn(4);\n static quartOut = Easing.getPowOut(4);\n static quartInOut = Easing.getPowInOut(4);\n static quintIn = Easing.getPowIn(5);\n static quintOut = Easing.getPowOut(5);\n static quintInOut = Easing.getPowInOut(5);\n\n /* 语法糖 */\n static getBackIn(amount: number) {\n return function (t: number) {\n return t * t * ((amount + 1) * t - amount);\n };\n }\n static getBackOut(amount: number) {\n return function (t: number) {\n return --t * t * ((amount + 1) * t + amount) + 1;\n };\n }\n static getBackInOut(amount: number) {\n amount *= 1.525;\n return function (t: number) {\n if ((t *= 2) < 1) {\n return 0.5 * (t * t * ((amount + 1) * t - amount));\n }\n return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);\n };\n }\n\n // 插值函数\n static backIn = Easing.getBackIn(1.7);\n static backOut = Easing.getBackOut(1.7);\n static backInOut = Easing.getBackInOut(1.7);\n\n static sineIn(t: number): number {\n return 1 - Math.cos((t * Math.PI) / 2);\n }\n\n static sineOut(t: number): number {\n return Math.sin((t * Math.PI) / 2);\n }\n\n static sineInOut(t: number): number {\n return -(Math.cos(Math.PI * t) - 1) / 2;\n }\n\n static expoIn(t: number): number {\n return t === 0 ? 0 : Math.pow(2, 10 * t - 10);\n }\n\n static expoOut(t: number): number {\n return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);\n }\n\n static expoInOut(t: number): number {\n return t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2;\n }\n\n // 插值函数\n static circIn(t: number) {\n return -(Math.sqrt(1 - t * t) - 1);\n }\n\n static circOut(t: number) {\n return Math.sqrt(1 - --t * t);\n }\n\n static circInOut(t: number) {\n if ((t *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n }\n static bounceOut(t: number) {\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n } else if (t < 2 / 2.75) {\n return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;\n } else if (t < 2.5 / 2.75) {\n return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;\n }\n return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;\n }\n static bounceIn(t: number) {\n return 1 - Easing.bounceOut(1 - t);\n }\n\n static bounceInOut(t: number) {\n if (t < 0.5) {\n return Easing.bounceIn(t * 2) * 0.5;\n }\n return Easing.bounceOut(t * 2 - 1) * 0.5 + 0.5;\n }\n\n /* 语法糖 */\n static getElasticIn(amplitude: number, period: number) {\n return function (t: number) {\n if (t === 0 || t === 1) {\n return t;\n }\n const s = (period / pi2) * Math.asin(1 / amplitude);\n return -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * pi2) / period));\n };\n }\n static getElasticOut(amplitude: number, period: number) {\n return function (t: number) {\n if (t === 0 || t === 1) {\n return t;\n }\n const s = (period / pi2) * Math.asin(1 / amplitude);\n return amplitude * Math.pow(2, -10 * t) * Math.sin(((t - s) * pi2) / period) + 1;\n };\n }\n static getElasticInOut(amplitude: number, period: number) {\n return function (t: number) {\n const s = (period / pi2) * Math.asin(1 / amplitude);\n if ((t *= 2) < 1) {\n return -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * pi2) / period));\n }\n return amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s) * pi2) / period) * 0.5 + 1;\n };\n }\n\n // 插值函数\n static elasticIn = Easing.getElasticIn(1, 0.3);\n static elasticOut = Easing.getElasticOut(1, 0.3);\n static elasticInOut = Easing.getElasticInOut(1, 0.3 * 1.5);\n\n static easeInOutQuad = (t: number) => {\n if ((t /= 0.5) < 1) {\n return 0.5 * Math.pow(t, 2);\n }\n return -0.5 * ((t -= 2) * t - 2);\n };\n\n static easeOutElastic = (x: number) => {\n const c4 = (2 * Math.PI) / 3;\n\n return x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1;\n };\n\n static easeInOutElastic = (x: number) => {\n const c5 = (2 * Math.PI) / 4.5;\n\n return x === 0\n ? 0\n : x === 1\n ? 1\n : x < 0.5\n ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2\n : (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1;\n };\n static registerFunc(name: string, func: (t: number) => number) {\n (Easing as any)[name] = func;\n }\n}\n"]}
@@ -5,3 +5,4 @@ export * from './custom-animate';
5
5
  export * from './morphing';
6
6
  export * from './timeline';
7
7
  export * from './group-fade';
8
+ export * from './easing';
@@ -11,4 +11,6 @@ export * from "./morphing";
11
11
  export * from "./timeline";
12
12
 
13
13
  export * from "./group-fade";
14
+
15
+ export * from "./easing";
14
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animate/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC","file":"index.js","sourcesContent":["export * from './Ticker';\nexport * from './animate';\nexport * from './config';\nexport * from './custom-animate';\nexport * from './morphing';\nexport * from './timeline';\nexport * from './group-fade';\n"]}
1
+ {"version":3,"sources":["../src/animate/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["export * from './Ticker';\nexport * from './animate';\nexport * from './config';\nexport * from './custom-animate';\nexport * from './morphing';\nexport * from './timeline';\nexport * from './group-fade';\nexport * from './easing';\n"]}
@@ -44,5 +44,4 @@ export class ColorStore {
44
44
  }
45
45
  }
46
46
 
47
- ColorStore.store255 = {}, ColorStore.store1 = {};
48
- //# sourceMappingURL=store.js.map
47
+ ColorStore.store255 = {}, ColorStore.store1 = {};
@@ -43,4 +43,5 @@ export const draw3dItem = (context, graphic, callback, output) => {
43
43
  }));
44
44
  } else result = callback(isPie, is3d);
45
45
  return result;
46
- };
46
+ };
47
+ //# sourceMappingURL=3d-interceptor.js.map
@@ -3,3 +3,6 @@ export declare function snapLength(xArr: number[], yArr: number[]): number;
3
3
  export declare function cubicLength(p0: IPointLike, p1: IPointLike, p2: IPointLike, p3: IPointLike, iterationCount: number): number;
4
4
  export declare function cubicCalc(p0: number, p1: number, p2: number, p3: number, t: number): number;
5
5
  export declare function cubicPointAt(p0: IPointLike, p1: IPointLike, p2: IPointLike, p3: IPointLike, t: number): IPoint;
6
+ export declare function quadCalc(p0: number, p1: number, p2: number, t: number): number;
7
+ export declare function quadPointAt(p0: IPointLike, p1: IPointLike, p2: IPointLike, t: number): IPoint;
8
+ export declare function quadLength(p0: IPointLike, p1: IPointLike, p2: IPointLike, iterationCount: number): number;