@visactor/vrender-core 0.22.12 → 0.22.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +40 -0
  2. package/cjs/animate/Ticker/default-ticker.js +140 -0
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -0
  4. package/cjs/animate/Ticker/index.d.ts +5 -0
  5. package/cjs/{interface/animation → animate/Ticker}/index.js +3 -3
  6. package/cjs/animate/Ticker/index.js.map +1 -0
  7. package/cjs/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  8. package/cjs/animate/Ticker/manual-ticker-handler.js +36 -0
  9. package/cjs/animate/Ticker/manual-ticker-handler.js.map +1 -0
  10. package/cjs/animate/Ticker/manual-ticker.d.ts +19 -0
  11. package/cjs/animate/Ticker/manual-ticker.js +37 -0
  12. package/cjs/animate/Ticker/manual-ticker.js.map +1 -0
  13. package/cjs/animate/Ticker/raf-tick-handler.d.ts +9 -0
  14. package/cjs/animate/Ticker/raf-tick-handler.js +30 -0
  15. package/cjs/animate/Ticker/raf-tick-handler.js.map +1 -0
  16. package/cjs/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  17. package/cjs/animate/Ticker/timeout-tick-handler.js +28 -0
  18. package/cjs/animate/Ticker/timeout-tick-handler.js.map +1 -0
  19. package/cjs/animate/Ticker/type.d.ts +6 -0
  20. package/cjs/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
  21. package/cjs/animate/Ticker/type.js.map +1 -0
  22. package/cjs/animate/animate.d.ts +147 -0
  23. package/cjs/animate/animate.js +403 -0
  24. package/cjs/animate/animate.js.map +1 -0
  25. package/cjs/animate/config.d.ts +2 -1
  26. package/cjs/animate/config.js +5 -1
  27. package/cjs/animate/config.js.map +1 -1
  28. package/cjs/animate/custom-animate.d.ts +236 -0
  29. package/cjs/animate/custom-animate.js +726 -0
  30. package/cjs/animate/custom-animate.js.map +1 -0
  31. package/cjs/animate/default-ticker.d.ts +2 -0
  32. package/cjs/animate/default-ticker.js +14 -0
  33. package/cjs/animate/default-ticker.js.map +1 -0
  34. package/cjs/animate/easing-func.d.ts +1 -0
  35. package/cjs/animate/easing-func.js +16 -0
  36. package/cjs/animate/easing-func.js.map +1 -0
  37. package/cjs/animate/easing.d.ts +49 -0
  38. package/cjs/animate/easing.js +141 -0
  39. package/cjs/animate/easing.js.map +1 -0
  40. package/cjs/animate/group-fade.d.ts +16 -0
  41. package/cjs/animate/group-fade.js +66 -0
  42. package/cjs/animate/group-fade.js.map +1 -0
  43. package/cjs/animate/index.d.ts +8 -0
  44. package/cjs/animate/index.js +24 -0
  45. package/cjs/animate/index.js.map +1 -0
  46. package/cjs/animate/morphing.d.ts +52 -0
  47. package/cjs/animate/morphing.js +292 -0
  48. package/cjs/animate/morphing.js.map +1 -0
  49. package/cjs/animate/timeline.d.ts +17 -0
  50. package/cjs/animate/timeline.js +46 -0
  51. package/cjs/animate/timeline.js.map +1 -0
  52. package/cjs/application.d.ts +1 -2
  53. package/cjs/application.js.map +1 -1
  54. package/cjs/canvas/constants.js +2 -1
  55. package/cjs/canvas/empty-context.d.ts +0 -1
  56. package/cjs/canvas/empty-context.js +0 -4
  57. package/cjs/canvas/empty-context.js.map +1 -1
  58. package/cjs/color-string/interpolate.d.ts +0 -1
  59. package/cjs/color-string/interpolate.js +4 -12
  60. package/cjs/color-string/interpolate.js.map +1 -1
  61. package/cjs/color-string/store.js +1 -2
  62. package/cjs/common/custom-path2d.js +2 -2
  63. package/cjs/common/custom-path2d.js.map +1 -1
  64. package/cjs/common/enums.d.ts +16 -0
  65. package/cjs/common/enums.js +11 -2
  66. package/cjs/common/enums.js.map +1 -1
  67. package/cjs/common/morphing-utils.js +124 -32
  68. package/cjs/common/morphing-utils.js.map +1 -1
  69. package/cjs/common/polygon.js +2 -5
  70. package/cjs/common/polygon.js.map +1 -1
  71. package/cjs/common/segment/curve/cubic-bezier.d.ts +2 -1
  72. package/cjs/common/segment/curve/cubic-bezier.js +8 -3
  73. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  74. package/cjs/common/segment/curve/quadratic-bezier.d.ts +0 -1
  75. package/cjs/common/segment/curve/quadratic-bezier.js +3 -10
  76. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  77. package/cjs/common/segment/index.d.ts +0 -1
  78. package/cjs/common/segment/index.js +1 -1
  79. package/cjs/common/segment/index.js.map +1 -1
  80. package/cjs/common/shape/arc.d.ts +1 -1
  81. package/cjs/common/shape/arc.js +3 -7
  82. package/cjs/common/shape/arc.js.map +1 -1
  83. package/cjs/common/simplify.js +2 -1
  84. package/cjs/common/sort.js +1 -1
  85. package/cjs/common/split-path.js +2 -2
  86. package/cjs/common/split-path.js.map +1 -1
  87. package/cjs/common/store.js +1 -1
  88. package/cjs/common/text.js +1 -1
  89. package/cjs/common/utils.d.ts +2 -0
  90. package/cjs/common/utils.js +9 -5
  91. package/cjs/common/utils.js.map +1 -1
  92. package/cjs/core/application.js +1 -1
  93. package/cjs/core/camera.js +1 -1
  94. package/cjs/core/global.d.ts +0 -3
  95. package/cjs/core/global.js +3 -14
  96. package/cjs/core/global.js.map +1 -1
  97. package/cjs/core/stage.d.ts +3 -8
  98. package/cjs/core/stage.js +20 -34
  99. package/cjs/core/stage.js.map +1 -1
  100. package/cjs/graphic/arc.d.ts +2 -1
  101. package/cjs/graphic/arc.js +2 -3
  102. package/cjs/graphic/arc.js.map +1 -1
  103. package/cjs/graphic/area.d.ts +2 -1
  104. package/cjs/graphic/area.js +1 -4
  105. package/cjs/graphic/area.js.map +1 -1
  106. package/cjs/graphic/circle.d.ts +2 -1
  107. package/cjs/graphic/circle.js +2 -5
  108. package/cjs/graphic/circle.js.map +1 -1
  109. package/cjs/graphic/config.js +1 -2
  110. package/cjs/graphic/config.js.map +1 -1
  111. package/cjs/graphic/graphic-service/graphic-module.js +2 -1
  112. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  113. package/cjs/graphic/graphic-service/graphic-service.js +3 -2
  114. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  115. package/cjs/graphic/graphic.d.ts +12 -9
  116. package/cjs/graphic/graphic.js +105 -48
  117. package/cjs/graphic/graphic.js.map +1 -1
  118. package/cjs/graphic/group.js +8 -8
  119. package/cjs/graphic/group.js.map +1 -1
  120. package/cjs/graphic/line.d.ts +2 -1
  121. package/cjs/graphic/line.js +1 -5
  122. package/cjs/graphic/line.js.map +1 -1
  123. package/cjs/graphic/rect.js +2 -5
  124. package/cjs/graphic/rect.js.map +1 -1
  125. package/cjs/graphic/richtext/icon.d.ts +1 -1
  126. package/cjs/graphic/richtext/icon.js.map +1 -1
  127. package/cjs/graphic/richtext/paragraph.js +2 -2
  128. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  129. package/cjs/graphic/star.d.ts +2 -1
  130. package/cjs/graphic/star.js +2 -4
  131. package/cjs/graphic/star.js.map +1 -1
  132. package/cjs/index.d.ts +3 -2
  133. package/cjs/index.js +16 -14
  134. package/cjs/index.js.map +1 -1
  135. package/cjs/interface/animate.d.ts +160 -1
  136. package/cjs/interface/animate.js +4 -1
  137. package/cjs/interface/animate.js.map +1 -1
  138. package/cjs/interface/context.d.ts +0 -1
  139. package/cjs/interface/context.js.map +1 -1
  140. package/cjs/interface/global.d.ts +0 -2
  141. package/cjs/interface/global.js.map +1 -1
  142. package/cjs/interface/graphic.d.ts +3 -11
  143. package/cjs/interface/graphic.js.map +1 -1
  144. package/cjs/interface/index.d.ts +1 -1
  145. package/cjs/interface/index.js +9 -9
  146. package/cjs/interface/index.js.map +1 -1
  147. package/cjs/interface/render.d.ts +0 -7
  148. package/cjs/interface/render.js.map +1 -1
  149. package/cjs/interface/stage.d.ts +1 -4
  150. package/cjs/interface/stage.js.map +1 -1
  151. package/cjs/modules.d.ts +1 -2
  152. package/cjs/modules.js +3 -4
  153. package/cjs/modules.js.map +1 -1
  154. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +8 -9
  155. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  156. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +11 -14
  157. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  158. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +10 -13
  159. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  160. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
  161. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  162. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
  163. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  164. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  165. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  166. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  167. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  168. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +5 -6
  169. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  170. package/cjs/render/contributions/render/arc-render.d.ts +2 -4
  171. package/cjs/render/contributions/render/arc-render.js +17 -19
  172. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  173. package/cjs/render/contributions/render/area-render.js +2 -2
  174. package/cjs/render/contributions/render/area-render.js.map +1 -1
  175. package/cjs/render/contributions/render/base-render.d.ts +2 -2
  176. package/cjs/render/contributions/render/base-render.js +2 -2
  177. package/cjs/render/contributions/render/base-render.js.map +1 -1
  178. package/cjs/render/contributions/render/draw-contribution.d.ts +0 -1
  179. package/cjs/render/contributions/render/draw-contribution.js +19 -23
  180. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  181. package/cjs/render/contributions/render/draw-interceptor.js +1 -2
  182. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  183. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  184. package/cjs/render/contributions/render/group-render.js +11 -15
  185. package/cjs/render/contributions/render/group-render.js.map +1 -1
  186. package/cjs/render/contributions/render/line-render.js +1 -1
  187. package/cjs/render/contributions/render/line-render.js.map +1 -1
  188. package/cjs/render/contributions/render/rect-render.d.ts +1 -3
  189. package/cjs/render/contributions/render/rect-render.js +15 -17
  190. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  191. package/cjs/render/contributions/render/symbol-render.d.ts +2 -4
  192. package/cjs/render/contributions/render/symbol-render.js +11 -16
  193. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  194. package/cjs/render/render-service.d.ts +1 -1
  195. package/cjs/render/render-service.js.map +1 -1
  196. package/dist/index.es.js +8867 -6020
  197. package/es/animate/Ticker/default-ticker.d.ts +40 -0
  198. package/es/animate/Ticker/default-ticker.js +138 -0
  199. package/es/animate/Ticker/default-ticker.js.map +1 -0
  200. package/es/animate/Ticker/index.d.ts +5 -0
  201. package/es/animate/Ticker/index.js +10 -0
  202. package/es/animate/Ticker/index.js.map +1 -0
  203. package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  204. package/es/animate/Ticker/manual-ticker-handler.js +28 -0
  205. package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
  206. package/es/animate/Ticker/manual-ticker.d.ts +19 -0
  207. package/es/animate/Ticker/manual-ticker.js +31 -0
  208. package/es/animate/Ticker/manual-ticker.js.map +1 -0
  209. package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
  210. package/es/animate/Ticker/raf-tick-handler.js +22 -0
  211. package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
  212. package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  213. package/es/animate/Ticker/timeout-tick-handler.js +20 -0
  214. package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
  215. package/es/animate/Ticker/type.d.ts +6 -0
  216. package/es/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
  217. package/es/animate/Ticker/type.js.map +1 -0
  218. package/es/animate/animate.d.ts +147 -0
  219. package/es/animate/animate.js +398 -0
  220. package/es/animate/animate.js.map +1 -0
  221. package/es/animate/config.d.ts +2 -1
  222. package/es/animate/config.js +5 -0
  223. package/es/animate/config.js.map +1 -1
  224. package/es/animate/custom-animate.d.ts +236 -0
  225. package/es/animate/custom-animate.js +703 -0
  226. package/es/animate/custom-animate.js.map +1 -0
  227. package/es/animate/default-ticker.d.ts +2 -0
  228. package/es/animate/default-ticker.js +12 -0
  229. package/es/animate/default-ticker.js.map +1 -0
  230. package/es/animate/easing-func.d.ts +1 -0
  231. package/es/animate/easing-func.js +10 -0
  232. package/es/animate/easing-func.js.map +1 -0
  233. package/es/animate/easing.d.ts +49 -0
  234. package/es/animate/easing.js +134 -0
  235. package/es/animate/easing.js.map +1 -0
  236. package/es/animate/group-fade.d.ts +16 -0
  237. package/es/animate/group-fade.js +56 -0
  238. package/es/animate/group-fade.js.map +1 -0
  239. package/es/animate/index.d.ts +8 -0
  240. package/es/animate/index.js +16 -0
  241. package/es/animate/index.js.map +1 -0
  242. package/es/animate/morphing.d.ts +52 -0
  243. package/es/animate/morphing.js +295 -0
  244. package/es/animate/morphing.js.map +1 -0
  245. package/es/animate/timeline.d.ts +17 -0
  246. package/es/animate/timeline.js +42 -0
  247. package/es/animate/timeline.js.map +1 -0
  248. package/es/application.d.ts +1 -2
  249. package/es/application.js.map +1 -1
  250. package/es/canvas/constants.js +2 -1
  251. package/es/canvas/empty-context.d.ts +0 -1
  252. package/es/canvas/empty-context.js +0 -4
  253. package/es/canvas/empty-context.js.map +1 -1
  254. package/es/color-string/interpolate.d.ts +0 -1
  255. package/es/color-string/interpolate.js +1 -8
  256. package/es/color-string/interpolate.js.map +1 -1
  257. package/es/color-string/store.js +1 -2
  258. package/es/common/custom-path2d.js +2 -2
  259. package/es/common/custom-path2d.js.map +1 -1
  260. package/es/common/enums.d.ts +16 -0
  261. package/es/common/enums.js +20 -0
  262. package/es/common/enums.js.map +1 -1
  263. package/es/common/morphing-utils.js +124 -29
  264. package/es/common/morphing-utils.js.map +1 -1
  265. package/es/common/polygon.js +3 -6
  266. package/es/common/polygon.js.map +1 -1
  267. package/es/common/segment/curve/cubic-bezier.d.ts +2 -1
  268. package/es/common/segment/curve/cubic-bezier.js +8 -1
  269. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  270. package/es/common/segment/curve/quadratic-bezier.d.ts +0 -1
  271. package/es/common/segment/curve/quadratic-bezier.js +2 -5
  272. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  273. package/es/common/segment/index.d.ts +0 -1
  274. package/es/common/segment/index.js +0 -2
  275. package/es/common/segment/index.js.map +1 -1
  276. package/es/common/shape/arc.d.ts +1 -1
  277. package/es/common/shape/arc.js +3 -7
  278. package/es/common/shape/arc.js.map +1 -1
  279. package/es/common/simplify.js +2 -1
  280. package/es/common/sort.js +1 -1
  281. package/es/common/split-path.js +2 -2
  282. package/es/common/split-path.js.map +1 -1
  283. package/es/common/store.js +1 -1
  284. package/es/common/text.js +1 -1
  285. package/es/common/utils.d.ts +2 -0
  286. package/es/common/utils.js +5 -1
  287. package/es/common/utils.js.map +1 -1
  288. package/es/core/application.js +1 -1
  289. package/es/core/camera.js +1 -1
  290. package/es/core/global.d.ts +0 -3
  291. package/es/core/global.js +2 -15
  292. package/es/core/global.js.map +1 -1
  293. package/es/core/stage.d.ts +3 -8
  294. package/es/core/stage.js +22 -35
  295. package/es/core/stage.js.map +1 -1
  296. package/es/graphic/arc.d.ts +2 -1
  297. package/es/graphic/arc.js +2 -3
  298. package/es/graphic/arc.js.map +1 -1
  299. package/es/graphic/area.d.ts +2 -1
  300. package/es/graphic/area.js +1 -4
  301. package/es/graphic/area.js.map +1 -1
  302. package/es/graphic/circle.d.ts +2 -1
  303. package/es/graphic/circle.js +2 -4
  304. package/es/graphic/circle.js.map +1 -1
  305. package/es/graphic/config.js +1 -2
  306. package/es/graphic/config.js.map +1 -1
  307. package/es/graphic/graphic-service/graphic-module.js +1 -1
  308. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  309. package/es/graphic/graphic-service/graphic-service.js +4 -1
  310. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  311. package/es/graphic/graphic.d.ts +12 -9
  312. package/es/graphic/graphic.js +109 -52
  313. package/es/graphic/graphic.js.map +1 -1
  314. package/es/graphic/group.js +7 -7
  315. package/es/graphic/group.js.map +1 -1
  316. package/es/graphic/line.d.ts +2 -1
  317. package/es/graphic/line.js +1 -5
  318. package/es/graphic/line.js.map +1 -1
  319. package/es/graphic/rect.js +2 -5
  320. package/es/graphic/rect.js.map +1 -1
  321. package/es/graphic/richtext/icon.d.ts +1 -1
  322. package/es/graphic/richtext/icon.js.map +1 -1
  323. package/es/graphic/richtext/paragraph.js +2 -2
  324. package/es/graphic/richtext/paragraph.js.map +1 -1
  325. package/es/graphic/star.d.ts +2 -1
  326. package/es/graphic/star.js +2 -4
  327. package/es/graphic/star.js.map +1 -1
  328. package/es/index.d.ts +3 -2
  329. package/es/index.js +6 -4
  330. package/es/index.js.map +1 -1
  331. package/es/interface/animate.d.ts +160 -1
  332. package/es/interface/animate.js +1 -2
  333. package/es/interface/animate.js.map +1 -1
  334. package/es/interface/context.d.ts +0 -1
  335. package/es/interface/context.js.map +1 -1
  336. package/es/interface/global.d.ts +0 -2
  337. package/es/interface/global.js.map +1 -1
  338. package/es/interface/graphic.d.ts +3 -11
  339. package/es/interface/graphic.js.map +1 -1
  340. package/es/interface/index.d.ts +1 -1
  341. package/es/interface/index.js +2 -2
  342. package/es/interface/index.js.map +1 -1
  343. package/es/interface/render.d.ts +0 -7
  344. package/es/interface/render.js.map +1 -1
  345. package/es/interface/stage.d.ts +1 -4
  346. package/es/interface/stage.js.map +1 -1
  347. package/es/modules.d.ts +1 -2
  348. package/es/modules.js +0 -6
  349. package/es/modules.js.map +1 -1
  350. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  351. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  352. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +12 -13
  353. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  354. package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -12
  355. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  356. package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
  357. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  358. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
  359. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  360. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  361. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  362. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  363. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  364. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +5 -4
  365. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  366. package/es/render/contributions/render/arc-render.d.ts +2 -4
  367. package/es/render/contributions/render/arc-render.js +17 -19
  368. package/es/render/contributions/render/arc-render.js.map +1 -1
  369. package/es/render/contributions/render/area-render.js +2 -2
  370. package/es/render/contributions/render/area-render.js.map +1 -1
  371. package/es/render/contributions/render/base-render.d.ts +2 -2
  372. package/es/render/contributions/render/base-render.js +2 -2
  373. package/es/render/contributions/render/base-render.js.map +1 -1
  374. package/es/render/contributions/render/draw-contribution.d.ts +0 -1
  375. package/es/render/contributions/render/draw-contribution.js +19 -23
  376. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  377. package/es/render/contributions/render/draw-interceptor.js +1 -2
  378. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  379. package/es/render/contributions/render/group-render.d.ts +2 -2
  380. package/es/render/contributions/render/group-render.js +11 -15
  381. package/es/render/contributions/render/group-render.js.map +1 -1
  382. package/es/render/contributions/render/line-render.js +1 -1
  383. package/es/render/contributions/render/line-render.js.map +1 -1
  384. package/es/render/contributions/render/rect-render.d.ts +1 -3
  385. package/es/render/contributions/render/rect-render.js +14 -17
  386. package/es/render/contributions/render/rect-render.js.map +1 -1
  387. package/es/render/contributions/render/symbol-render.d.ts +2 -4
  388. package/es/render/contributions/render/symbol-render.js +11 -16
  389. package/es/render/contributions/render/symbol-render.js.map +1 -1
  390. package/es/render/render-service.d.ts +1 -1
  391. package/es/render/render-service.js.map +1 -1
  392. package/package.json +2 -2
  393. package/cjs/common/diff.d.ts +0 -1
  394. package/cjs/common/diff.js +0 -19
  395. package/cjs/common/diff.js.map +0 -1
  396. package/cjs/common/performance-raf.d.ts +0 -8
  397. package/cjs/common/performance-raf.js +0 -32
  398. package/cjs/common/performance-raf.js.map +0 -1
  399. package/cjs/interface/animation/animate.d.ts +0 -117
  400. package/cjs/interface/animation/animate.js +0 -10
  401. package/cjs/interface/animation/animate.js.map +0 -1
  402. package/cjs/interface/animation/easing.d.ts +0 -3
  403. package/cjs/interface/animation/easing.js +0 -6
  404. package/cjs/interface/animation/easing.js.map +0 -1
  405. package/cjs/interface/animation/index.d.ts +0 -5
  406. package/cjs/interface/animation/index.js.map +0 -1
  407. package/cjs/interface/animation/ticker.d.ts +0 -39
  408. package/cjs/interface/animation/ticker.js.map +0 -1
  409. package/cjs/interface/animation/timeline.d.ts +0 -17
  410. package/cjs/interface/animation/timeline.js +0 -6
  411. package/cjs/interface/animation/timeline.js.map +0 -1
  412. package/cjs/interface/animation/type.d.ts +0 -13
  413. package/cjs/interface/animation/type.js +0 -15
  414. package/cjs/interface/animation/type.js.map +0 -1
  415. package/es/common/diff.d.ts +0 -1
  416. package/es/common/diff.js +0 -11
  417. package/es/common/diff.js.map +0 -1
  418. package/es/common/performance-raf.d.ts +0 -8
  419. package/es/common/performance-raf.js +0 -24
  420. package/es/common/performance-raf.js.map +0 -1
  421. package/es/interface/animation/animate.d.ts +0 -117
  422. package/es/interface/animation/animate.js +0 -6
  423. package/es/interface/animation/animate.js.map +0 -1
  424. package/es/interface/animation/easing.d.ts +0 -3
  425. package/es/interface/animation/easing.js +0 -2
  426. package/es/interface/animation/easing.js.map +0 -1
  427. package/es/interface/animation/index.d.ts +0 -5
  428. package/es/interface/animation/index.js +0 -10
  429. package/es/interface/animation/index.js.map +0 -1
  430. package/es/interface/animation/ticker.d.ts +0 -39
  431. package/es/interface/animation/ticker.js.map +0 -1
  432. package/es/interface/animation/timeline.d.ts +0 -17
  433. package/es/interface/animation/timeline.js +0 -2
  434. package/es/interface/animation/timeline.js.map +0 -1
  435. package/es/interface/animation/type.d.ts +0 -13
  436. package/es/interface/animation/type.js +0 -14
  437. package/es/interface/animation/type.js.map +0 -1
@@ -0,0 +1,726 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.AnimateGroup1 = exports.AnimateGroup = exports.AttributeAnimate = exports.RotateBySphereAnimate = exports.ClipDirectionAnimate = exports.ClipRadiusAnimate = exports.ClipAngleAnimate = exports.ClipGraphicAnimate = exports.GraphicAnimate = exports.TagPointsUpdate = exports.MotionPath = exports.Meteor = exports.StreamLight = exports.InputText = exports.FadeInPlus = exports.IncreaseCount = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils"), application_1 = require("../application"), enums_1 = require("../common/enums"), custom_path2d_1 = require("../common/custom-path2d"), animate_1 = require("./animate"), easing_1 = require("./easing"), utils_1 = require("../common/utils"), cubic_bezier_1 = require("../common/segment/curve/cubic-bezier");
8
+
9
+ class IncreaseCount extends animate_1.ACustomAnimate {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(from, to, duration, easing, params);
12
+ }
13
+ getEndProps() {
14
+ return !1 === this.valid ? {} : {
15
+ text: this.to
16
+ };
17
+ }
18
+ onBind() {
19
+ var _a, _b, _c, _d, _e, _f, _g, _h;
20
+ this.fromNumber = (0, vutils_1.isNumber)(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text),
21
+ this.toNumber = (0, vutils_1.isNumber)(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text),
22
+ Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1),
23
+ !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max((0,
24
+ vutils_1.getDecimalPlaces)(this.fromNumber), (0, vutils_1.getDecimalPlaces)(this.toNumber)));
25
+ }
26
+ onEnd() {}
27
+ onUpdate(end, ratio, out) {
28
+ var _a;
29
+ !1 !== this.valid && (out.text = end ? null === (_a = this.to) || void 0 === _a ? void 0 : _a.text : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
30
+ }
31
+ }
32
+
33
+ var Direction;
34
+
35
+ exports.IncreaseCount = IncreaseCount, function(Direction) {
36
+ Direction[Direction.LEFT_TO_RIGHT = 0] = "LEFT_TO_RIGHT", Direction[Direction.RIGHT_TO_LEFT = 1] = "RIGHT_TO_LEFT",
37
+ Direction[Direction.TOP_TO_BOTTOM = 2] = "TOP_TO_BOTTOM", Direction[Direction.BOTTOM_TO_TOP = 3] = "BOTTOM_TO_TOP",
38
+ Direction[Direction.STROKE = 4] = "STROKE";
39
+ }(Direction || (Direction = {}));
40
+
41
+ class FadeInPlus extends animate_1.ACustomAnimate {
42
+ constructor(from, to, duration, easing, params) {
43
+ super(from, to, duration, easing, params);
44
+ const {direction: direction = Direction.LEFT_TO_RIGHT, fill: fill = !0, stroke: stroke = !0} = params || {};
45
+ this.direction = direction, this.fill = fill, this.stroke = stroke, this.fillGradient = {
46
+ gradient: "linear",
47
+ stops: []
48
+ }, this.strokeGradient = {
49
+ gradient: "linear",
50
+ stops: []
51
+ };
52
+ }
53
+ getEndProps() {
54
+ return {
55
+ fill: this.toFill,
56
+ stroke: this.toStroke
57
+ };
58
+ }
59
+ onBind() {
60
+ this.toFill = this.target.getComputedAttribute("fill"), this.toStroke = this.target.getComputedAttribute("stroke");
61
+ }
62
+ onEnd() {}
63
+ onUpdate(end, ratio, out) {
64
+ if (this.toFill && this.toStroke) switch (this.direction) {
65
+ case Direction.RIGHT_TO_LEFT:
66
+ this.rightToLeft(end, ratio, out);
67
+ break;
68
+
69
+ case Direction.TOP_TO_BOTTOM:
70
+ this.topToBottom(end, ratio, out);
71
+ break;
72
+
73
+ case Direction.BOTTOM_TO_TOP:
74
+ this.bottomToTop(end, ratio, out);
75
+ break;
76
+
77
+ case Direction.STROKE:
78
+ this.strokePath(end, ratio, out);
79
+ break;
80
+
81
+ default:
82
+ this.leftToRight(end, ratio, out);
83
+ }
84
+ }
85
+ leftToRight(end, ratio, out) {
86
+ if (this.fill) {
87
+ const toFillColor = this.toFill;
88
+ this.fillGradient.x0 = 0, this.fillGradient.y0 = 0, this.fillGradient.x1 = 1, this.fillGradient.y1 = 0,
89
+ this.fillGradient.stops = [ {
90
+ offset: 0,
91
+ color: toFillColor
92
+ }, {
93
+ offset: ratio,
94
+ color: toFillColor
95
+ }, {
96
+ offset: Math.min(1, 2 * ratio),
97
+ color: "transparent"
98
+ } ], out.fill = this.fillGradient;
99
+ }
100
+ if (this.stroke) {
101
+ const toStrokeColor = this.toStroke;
102
+ this.strokeGradient.x0 = 0, this.strokeGradient.y0 = 0, this.strokeGradient.x1 = 1,
103
+ this.strokeGradient.y1 = 0, this.strokeGradient.stops = [ {
104
+ offset: 0,
105
+ color: toStrokeColor
106
+ }, {
107
+ offset: ratio,
108
+ color: toStrokeColor
109
+ }, {
110
+ offset: Math.min(1, 6 * ratio),
111
+ color: "transparent"
112
+ } ], out.stroke = this.strokeGradient;
113
+ }
114
+ }
115
+ strokePath(end, ratio, out) {
116
+ if (this.fill) {
117
+ const toFillColor = this.toFill;
118
+ this.fillGradient.x0 = 0, this.fillGradient.y0 = 0, this.fillGradient.x1 = 1, this.fillGradient.y1 = 0,
119
+ this.fillGradient.stops = [ {
120
+ offset: 0,
121
+ color: toFillColor
122
+ }, {
123
+ offset: ratio,
124
+ color: toFillColor
125
+ }, {
126
+ offset: Math.min(1, 2 * ratio),
127
+ color: "transparent"
128
+ } ], out.fill = this.fillGradient;
129
+ }
130
+ if (this.stroke) {
131
+ const dashLen = 300, offset = ratio * dashLen;
132
+ out.lineDash = [ offset, dashLen - offset ];
133
+ }
134
+ }
135
+ rightToLeft(end, ratio, out) {}
136
+ topToBottom(end, ratio, out) {}
137
+ bottomToTop(end, ratio, out) {}
138
+ }
139
+
140
+ exports.FadeInPlus = FadeInPlus;
141
+
142
+ class InputText extends animate_1.ACustomAnimate {
143
+ constructor() {
144
+ super(...arguments), this.fromText = "", this.toText = "";
145
+ }
146
+ getEndProps() {
147
+ return !1 === this.valid ? {} : {
148
+ text: this.to
149
+ };
150
+ }
151
+ onBind() {
152
+ var _a, _b, _c;
153
+ this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "",
154
+ this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "",
155
+ (!this.toText || (0, vutils_1.isArray)(this.toText) && 0 === this.toText.length) && (this.valid = !1),
156
+ (0, vutils_1.isArray)(this.toText) && (this.toText = this.toText.map((item => (item || "").toString())));
157
+ }
158
+ onEnd() {
159
+ this.target.detachShadow();
160
+ }
161
+ onUpdate(end, ratio, out) {
162
+ if (!1 === this.valid) return;
163
+ const fromCount = this.fromText.length, toTextIsArray = (0, vutils_1.isArray)(this.toText), toCount = toTextIsArray ? this.toText.reduce(((c, t) => c + (t || "").length), 0) : this.toText.length, count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
164
+ if (toTextIsArray) {
165
+ out.text = [];
166
+ let len = 0;
167
+ this.toText.forEach((t => {
168
+ len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t),
169
+ len += t.length);
170
+ }));
171
+ } else out.text = this.toText.substr(0, count);
172
+ }
173
+ }
174
+
175
+ exports.InputText = InputText;
176
+
177
+ class StreamLight extends animate_1.ACustomAnimate {
178
+ constructor(from, to, duration, easing, params) {
179
+ super(from, to, duration, easing, params);
180
+ }
181
+ getEndProps() {
182
+ return {};
183
+ }
184
+ onStart() {
185
+ this.target && ("rect" === this.target.type ? this.onStartRect() : "line" === this.target.type ? this.onStartLineOrArea("line") : "area" === this.target.type && this.onStartLineOrArea("area"));
186
+ }
187
+ onStartLineOrArea(type) {
188
+ var _a;
189
+ const root = this.target.attachShadow(), line = application_1.application.graphicService.creator[type](Object.assign({}, null === (_a = this.params) || void 0 === _a ? void 0 : _a.attribute));
190
+ this[type] = line, line.pathProxy = new custom_path2d_1.CustomPath2D, root.add(line);
191
+ }
192
+ onStartRect() {
193
+ var _a, _b, _c;
194
+ const root = this.target.attachShadow(), isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, sizeAttr = isHorizontal ? "height" : "width", otherSizeAttr = isHorizontal ? "width" : "height", size = this.target.AABBBounds[sizeAttr](), y = isHorizontal ? 0 : this.target.AABBBounds.y1, rect = application_1.application.graphicService.creator.rect(Object.assign(Object.assign({
195
+ [sizeAttr]: size,
196
+ fill: "#bcdeff",
197
+ shadowBlur: 30,
198
+ shadowColor: "#bcdeff"
199
+ }, null === (_c = this.params) || void 0 === _c ? void 0 : _c.attribute), {
200
+ x: 0,
201
+ y: y,
202
+ [otherSizeAttr]: 0
203
+ }));
204
+ this.rect = rect, root.add(rect);
205
+ }
206
+ onBind() {}
207
+ onEnd() {
208
+ this.target.detachShadow();
209
+ }
210
+ onUpdate(end, ratio, out) {
211
+ return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
212
+ }
213
+ onUpdateRect(end, ratio, out) {
214
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
215
+ const isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, parentAttr = this.target.attribute;
216
+ if (isHorizontal) {
217
+ const parentWidth = null !== (_d = null !== (_c = parentAttr.width) && void 0 !== _c ? _c : Math.abs(parentAttr.x1 - parentAttr.x)) && void 0 !== _d ? _d : 250, streamLength = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.streamLength) && void 0 !== _f ? _f : parentWidth, maxLength = null !== (_j = null === (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.attribute) || void 0 === _h ? void 0 : _h.width) && void 0 !== _j ? _j : 60, startX = -maxLength, currentX = startX + (streamLength - startX) * ratio, x = Math.max(currentX, 0), w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX), width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
218
+ this.rect.setAttributes({
219
+ x: x,
220
+ width: width,
221
+ dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
222
+ }, !1, {
223
+ type: enums_1.AttributeUpdateType.ANIMATE_PLAY,
224
+ animationState: {
225
+ ratio: ratio,
226
+ end: end
227
+ }
228
+ });
229
+ } else {
230
+ const parentHeight = null !== (_l = null !== (_k = parentAttr.height) && void 0 !== _k ? _k : Math.abs(parentAttr.y1 - parentAttr.y)) && void 0 !== _l ? _l : 250, streamLength = null !== (_o = null === (_m = this.params) || void 0 === _m ? void 0 : _m.streamLength) && void 0 !== _o ? _o : parentHeight, maxLength = null !== (_r = null === (_q = null === (_p = this.params) || void 0 === _p ? void 0 : _p.attribute) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 60, currentY = parentHeight - (streamLength + maxLength) * ratio;
231
+ let y = Math.min(currentY, parentHeight);
232
+ const h = Math.min(parentHeight - currentY, maxLength);
233
+ let height;
234
+ y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
235
+ y: y,
236
+ height: height,
237
+ dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
238
+ }, !1, {
239
+ type: enums_1.AttributeUpdateType.ANIMATE_PLAY,
240
+ animationState: {
241
+ ratio: ratio,
242
+ end: end
243
+ }
244
+ });
245
+ }
246
+ }
247
+ onUpdateLineOrArea(end, ratio, out) {
248
+ const target = this.line || this.area;
249
+ if (!target) return;
250
+ const customPath = target.pathProxy, targetLine = this.target;
251
+ targetLine.cache || targetLine.cacheArea ? this._onUpdateLineOrAreaWithCache(customPath, targetLine, end, ratio, out) : this._onUpdateLineWithoutCache(customPath, targetLine, end, ratio, out);
252
+ const targetAttrs = targetLine.attribute;
253
+ target.setAttributes(Object.assign({
254
+ stroke: targetAttrs.stroke
255
+ }, target.attribute)), target.addUpdateBoundTag();
256
+ }
257
+ _onUpdateLineOrAreaWithCache(customPath, g, end, ratio, out) {
258
+ var _a, _b;
259
+ if (customPath.clear(), "line" === g.type) {
260
+ let cache = g.cache;
261
+ Array.isArray(cache) || (cache = [ cache ]);
262
+ const totalLen = cache.reduce(((l, c) => l + c.getLength()), 0), curves = [];
263
+ return cache.forEach((c => {
264
+ c.curves.forEach((ci => curves.push(ci)));
265
+ })), this._updateCurves(customPath, curves, totalLen, ratio);
266
+ }
267
+ if ("area" === g.type && (null === (_b = null === (_a = g.cacheArea) || void 0 === _a ? void 0 : _a.top) || void 0 === _b ? void 0 : _b.curves)) {
268
+ const cache = g.cacheArea, totalLen = cache.top.curves.reduce(((a, b) => a + b.getLength()), 0);
269
+ return this._updateCurves(customPath, cache.top.curves, totalLen, ratio);
270
+ }
271
+ }
272
+ _updateCurves(customPath, curves, totalLen, ratio) {
273
+ var _a, _b;
274
+ const startLen = totalLen * ratio, endLen = Math.min(null !== (_b = startLen + (null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength)) && void 0 !== _b ? _b : 10, totalLen);
275
+ let lastLen = 0, start = !1;
276
+ for (let i = 0; i < curves.length; i++) if (!1 !== curves[i].defined) {
277
+ const curveItem = curves[i], len = curveItem.getLength(), startPercent = 1 - (lastLen + len - startLen) / len;
278
+ let curveForStart, endPercent = 1 - (lastLen + len - endLen) / len;
279
+ if (lastLen < startLen && lastLen + len > startLen) if (start = !0, curveItem.p2 && curveItem.p3) {
280
+ const [_, curve2] = (0, cubic_bezier_1.divideCubic)(curveItem, startPercent);
281
+ customPath.moveTo(curve2.p0.x, curve2.p0.y), curveForStart = curve2;
282
+ } else {
283
+ const p = curveItem.getPointAt(startPercent);
284
+ customPath.moveTo(p.x, p.y);
285
+ }
286
+ if (lastLen < endLen && lastLen + len > endLen) {
287
+ if (curveItem.p2 && curveItem.p3) {
288
+ curveForStart && (endPercent = (endLen - startLen) / curveForStart.getLength());
289
+ const [curve1] = (0, cubic_bezier_1.divideCubic)(curveForStart || curveItem, endPercent);
290
+ customPath.bezierCurveTo(curve1.p1.x, curve1.p1.y, curve1.p2.x, curve1.p2.y, curve1.p3.x, curve1.p3.y);
291
+ } else {
292
+ const p = curveItem.getPointAt(endPercent);
293
+ customPath.lineTo(p.x, p.y);
294
+ }
295
+ break;
296
+ }
297
+ if (start) if (curveItem.p2 && curveItem.p3) {
298
+ const curve = curveForStart || curveItem;
299
+ customPath.bezierCurveTo(curve.p1.x, curve.p1.y, curve.p2.x, curve.p2.y, curve.p3.x, curve.p3.y);
300
+ } else customPath.lineTo(curveItem.p1.x, curveItem.p1.y);
301
+ lastLen += len;
302
+ }
303
+ }
304
+ _onUpdateLineWithoutCache(customPath, line, end, ratio, out) {
305
+ var _a, _b;
306
+ const {points: points, curveType: curveType} = line.attribute;
307
+ if (!points || points.length < 2 || "linear" !== curveType) return;
308
+ let totalLen = 0;
309
+ for (let i = 1; i < points.length; i++) totalLen += vutils_1.PointService.distancePP(points[i], points[i - 1]);
310
+ const startLen = totalLen * ratio, endLen = Math.min(null !== (_b = startLen + (null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength)) && void 0 !== _b ? _b : 10, totalLen), nextPoints = [];
311
+ let lastLen = 0;
312
+ for (let i = 1; i < points.length; i++) {
313
+ const len = vutils_1.PointService.distancePP(points[i], points[i - 1]);
314
+ if (lastLen < startLen && lastLen + len > startLen && nextPoints.push(vutils_1.PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - startLen) / len)),
315
+ lastLen < endLen && lastLen + len > endLen) {
316
+ nextPoints.push(vutils_1.PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - endLen) / len));
317
+ break;
318
+ }
319
+ nextPoints.length && nextPoints.push(points[i]), lastLen += len;
320
+ }
321
+ if (nextPoints.length && !(nextPoints.length < 2)) {
322
+ customPath.clear(), customPath.moveTo(nextPoints[0].x, nextPoints[0].y);
323
+ for (let i = 1; i < nextPoints.length; i++) customPath.lineTo(nextPoints[i].x, nextPoints[i].y);
324
+ }
325
+ }
326
+ }
327
+
328
+ exports.StreamLight = StreamLight;
329
+
330
+ class Meteor extends animate_1.ACustomAnimate {
331
+ get lastPos() {
332
+ return this.posList[this.posList.length - 1];
333
+ }
334
+ constructor(size, duration, easing, params) {
335
+ super(null, null, duration, easing, params), this.size = size, this.posList = [];
336
+ }
337
+ onBind() {
338
+ const root = this.target.attachShadow();
339
+ this.root = root;
340
+ for (let i = 0; i < this.size; i++) {
341
+ const g = this.target.clone(), scale = Math.min((this.size - i) / this.size * 3, 1), opacity = Math.min(.2 + .7 / this.size);
342
+ g.setAttributes({
343
+ x: 0,
344
+ y: 0,
345
+ dx: 0,
346
+ dy: 0,
347
+ scaleX: scale,
348
+ scaleY: scale,
349
+ opacity: opacity
350
+ }, !1, {
351
+ type: enums_1.AttributeUpdateType.ANIMATE_BIND
352
+ }), root.add(g);
353
+ }
354
+ }
355
+ onUpdate(end, ratio, out) {
356
+ if (end) return this.target.detachShadow(), void (this.posList.length = 0);
357
+ const x = this.target.getComputedAttribute("x"), y = this.target.getComputedAttribute("y"), nextPos = new vutils_1.Point(x, y);
358
+ this.posList.length ? (this.target.shadowRoot.forEachChildren(((g, i) => {
359
+ const pos = this.posList[Math.max(this.posList.length - i - 1, 0)];
360
+ g.setAttributes({
361
+ x: pos.x - x,
362
+ y: pos.y - y
363
+ }, !1);
364
+ })), this.posList.push(nextPos)) : this.posList.push(nextPos);
365
+ }
366
+ }
367
+
368
+ exports.Meteor = Meteor;
369
+
370
+ class MotionPath extends animate_1.ACustomAnimate {
371
+ constructor(from, to, duration, easing, params) {
372
+ var _a;
373
+ super(from, to, duration, easing, params), params && (this.pathLength = params.path.getLength(),
374
+ this.path = params.path, this.distance = params.distance, this.to = params.distance * this.pathLength,
375
+ this.initAngle = null !== (_a = params.initAngle) && void 0 !== _a ? _a : 0, this.changeAngle = !!params.changeAngle,
376
+ this.cb = params.cb);
377
+ }
378
+ onUpdate(end, ratio, out) {
379
+ const at = this.to * ratio, {pos: pos, angle: angle} = this.path.getAttrAt(at);
380
+ out.x = pos.x, out.y = pos.y, this.changeAngle && (out.angle = angle + this.initAngle),
381
+ this.cb && this.cb(this.from, this.to, ratio, this.target);
382
+ }
383
+ }
384
+
385
+ exports.MotionPath = MotionPath;
386
+
387
+ class TagPointsUpdate extends animate_1.ACustomAnimate {
388
+ constructor(from, to, duration, easing, params) {
389
+ var _a, _b;
390
+ super(from, to, duration, easing, params), this.newPointAnimateType = null !== (_a = null == params ? void 0 : params.newPointAnimateType) && void 0 !== _a ? _a : "grow",
391
+ this.clipRangeByDimension = null !== (_b = null == params ? void 0 : params.clipRangeByDimension) && void 0 !== _b ? _b : "x";
392
+ }
393
+ getPoints(attribute, cache = !1) {
394
+ if (attribute.points) return attribute.points;
395
+ if (attribute.segments) {
396
+ const points = [];
397
+ return this.segmentsCache || (this.segmentsCache = []), attribute.segments.map((segment => {
398
+ var _a, _b;
399
+ segment.points && points.push(...segment.points), cache && this.segmentsCache.push(null !== (_b = null === (_a = segment.points) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0);
400
+ })), points;
401
+ }
402
+ return [];
403
+ }
404
+ onBind() {
405
+ const originFromPoints = this.getPoints(this.from), originToPoints = this.getPoints(this.to, !0);
406
+ this.fromPoints = originFromPoints ? Array.isArray(originFromPoints) ? originFromPoints : [ originFromPoints ] : [],
407
+ this.toPoints = originToPoints ? Array.isArray(originToPoints) ? originToPoints : [ originToPoints ] : [];
408
+ const tagMap = new Map;
409
+ this.fromPoints.forEach((point => {
410
+ point.context && tagMap.set(point.context, point);
411
+ }));
412
+ let firstMatchedPoint, lastMatchedPoint, firstMatchedIndex = 1 / 0, lastMatchedIndex = -1 / 0;
413
+ for (let i = 0; i < this.toPoints.length; i += 1) if (tagMap.has(this.toPoints[i].context)) {
414
+ firstMatchedIndex = i, firstMatchedPoint = tagMap.get(this.toPoints[i].context);
415
+ break;
416
+ }
417
+ for (let i = this.toPoints.length - 1; i >= 0; i -= 1) if (tagMap.has(this.toPoints[i].context)) {
418
+ lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
419
+ break;
420
+ }
421
+ "clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension],
422
+ 1 === this.clipRange && (this.shrinkClipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension]),
423
+ (0, vutils_1.isValidNumber)(this.clipRange) ? this.clipRange = (0, vutils_1.clamp)(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
424
+ let prevMatchedPoint = this.toPoints[0];
425
+ this.interpolatePoints = this.toPoints.map(((point, index) => {
426
+ const matchedPoint = tagMap.get(point.context);
427
+ return matchedPoint ? (prevMatchedPoint = matchedPoint, [ matchedPoint, point ]) : "appear" === this.newPointAnimateType || "clip" === this.newPointAnimateType ? [ point, point ] : index < firstMatchedIndex && firstMatchedPoint ? [ firstMatchedPoint, point ] : index > lastMatchedIndex && lastMatchedPoint ? [ lastMatchedPoint, point ] : [ prevMatchedPoint, point ];
428
+ })), this.points = this.interpolatePoints.map((interpolate => {
429
+ const fromPoint = interpolate[0], toPoint = interpolate[1], newPoint = new vutils_1.Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);
430
+ return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
431
+ }));
432
+ }
433
+ onFirstRun() {
434
+ const lastClipRange = this.target.attribute.clipRange;
435
+ (0, vutils_1.isValidNumber)(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
436
+ }
437
+ onUpdate(end, ratio, out) {
438
+ if (end) Object.keys(this.to).forEach((k => {
439
+ out[k] = this.to[k];
440
+ })); else {
441
+ if (this.points = this.points.map(((point, index) => {
442
+ const newPoint = (0, utils_1.pointInterpolation)(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
443
+ return newPoint.context = point.context, newPoint;
444
+ })), this.clipRange) {
445
+ if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints,
446
+ out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
447
+ out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
448
+ }
449
+ if (this.segmentsCache && this.to.segments) {
450
+ let start = 0;
451
+ out.segments = this.to.segments.map(((segment, index) => {
452
+ const end = start + this.segmentsCache[index], points = this.points.slice(start, end);
453
+ return start = end, Object.assign(Object.assign({}, segment), {
454
+ points: points
455
+ });
456
+ }));
457
+ } else out.points = this.points;
458
+ }
459
+ }
460
+ }
461
+
462
+ exports.TagPointsUpdate = TagPointsUpdate;
463
+
464
+ class GraphicAnimate extends animate_1.ACustomAnimate {
465
+ constructor(from, to, duration, easing, params) {
466
+ super(from, to, duration, easing, params), this.graphic = null == params ? void 0 : params.graphic;
467
+ }
468
+ onUpdate(end, ratio, out) {
469
+ this.graphic && Object.keys(this.from).forEach((k => {
470
+ out[k] = this.from[k] + (this.to[k] - this.from[k]) * ratio;
471
+ }));
472
+ }
473
+ }
474
+
475
+ exports.GraphicAnimate = GraphicAnimate;
476
+
477
+ class ClipGraphicAnimate extends animate_1.ACustomAnimate {
478
+ constructor(from, to, duration, easing, params) {
479
+ super(null, null, duration, easing, params), this.clipFromAttribute = from, this.clipToAttribute = to,
480
+ this._group = null == params ? void 0 : params.group, this._clipGraphic = null == params ? void 0 : params.clipGraphic;
481
+ }
482
+ onBind() {
483
+ this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip,
484
+ this._lastPath = this._group.attribute.path, this._group.setAttributes({
485
+ clip: !0,
486
+ path: [ this._clipGraphic ]
487
+ }, !1, {
488
+ type: enums_1.AttributeUpdateType.ANIMATE_BIND
489
+ }));
490
+ }
491
+ onEnd() {
492
+ this._group && this._group.setAttributes({
493
+ clip: this._lastClip,
494
+ path: this._lastPath
495
+ }, !1, {
496
+ type: enums_1.AttributeUpdateType.ANIMATE_END
497
+ });
498
+ }
499
+ onUpdate(end, ratio, out) {
500
+ if (!this._clipGraphic) return;
501
+ const res = {};
502
+ Object.keys(this.clipFromAttribute).forEach((k => {
503
+ res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;
504
+ })), this._clipGraphic.setAttributes(res, !1, {
505
+ type: enums_1.AttributeUpdateType.ANIMATE_UPDATE,
506
+ animationState: {
507
+ ratio: ratio,
508
+ end: end
509
+ }
510
+ });
511
+ }
512
+ }
513
+
514
+ exports.ClipGraphicAnimate = ClipGraphicAnimate;
515
+
516
+ class ClipAngleAnimate extends ClipGraphicAnimate {
517
+ constructor(from, to, duration, easing, params) {
518
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
519
+ const groupAttribute = null !== (_b = null === (_a = null == params ? void 0 : params.group) || void 0 === _a ? void 0 : _a.attribute) && void 0 !== _b ? _b : {}, width = null !== (_c = groupAttribute.width) && void 0 !== _c ? _c : 0, height = null !== (_d = groupAttribute.height) && void 0 !== _d ? _d : 0, animationType = null !== (_e = null == params ? void 0 : params.animationType) && void 0 !== _e ? _e : "in", startAngle = null !== (_f = null == params ? void 0 : params.startAngle) && void 0 !== _f ? _f : 0, orient = null !== (_g = null == params ? void 0 : params.orient) && void 0 !== _g ? _g : "clockwise";
520
+ let arcStartAngle = 0, arcEndAngle = 0;
521
+ "anticlockwise" === orient ? (arcEndAngle = "in" === animationType ? startAngle + 2 * Math.PI : startAngle,
522
+ arcEndAngle = startAngle + 2 * Math.PI) : (arcStartAngle = startAngle, arcEndAngle = "out" === animationType ? startAngle + 2 * Math.PI : startAngle);
523
+ const arc = application_1.application.graphicService.creator.arc({
524
+ x: null !== (_j = null === (_h = null == params ? void 0 : params.center) || void 0 === _h ? void 0 : _h.x) && void 0 !== _j ? _j : width / 2,
525
+ y: null !== (_l = null === (_k = null == params ? void 0 : params.center) || void 0 === _k ? void 0 : _k.y) && void 0 !== _l ? _l : height / 2,
526
+ outerRadius: null !== (_m = null == params ? void 0 : params.radius) && void 0 !== _m ? _m : (width + height) / 2,
527
+ innerRadius: 0,
528
+ startAngle: arcStartAngle,
529
+ endAngle: arcEndAngle,
530
+ fill: !0
531
+ });
532
+ let fromAttributes, toAttributes;
533
+ "anticlockwise" === orient ? (fromAttributes = {
534
+ startAngle: startAngle + 2 * Math.PI
535
+ }, toAttributes = {
536
+ startAngle: startAngle
537
+ }) : (fromAttributes = {
538
+ endAngle: startAngle
539
+ }, toAttributes = {
540
+ endAngle: startAngle + 2 * Math.PI
541
+ }), super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
542
+ group: null == params ? void 0 : params.group,
543
+ clipGraphic: arc
544
+ });
545
+ }
546
+ }
547
+
548
+ exports.ClipAngleAnimate = ClipAngleAnimate;
549
+
550
+ class ClipRadiusAnimate extends ClipGraphicAnimate {
551
+ constructor(from, to, duration, easing, params) {
552
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
553
+ const groupAttribute = null !== (_b = null === (_a = null == params ? void 0 : params.group) || void 0 === _a ? void 0 : _a.attribute) && void 0 !== _b ? _b : {}, width = null !== (_c = groupAttribute.width) && void 0 !== _c ? _c : 0, height = null !== (_d = groupAttribute.height) && void 0 !== _d ? _d : 0, animationType = null !== (_e = null == params ? void 0 : params.animationType) && void 0 !== _e ? _e : "in", startRadius = null !== (_f = null == params ? void 0 : params.startRadius) && void 0 !== _f ? _f : 0, endRadius = null !== (_g = null == params ? void 0 : params.endRadius) && void 0 !== _g ? _g : Math.sqrt((width / 2) ** 2 + (height / 2) ** 2), arc = application_1.application.graphicService.creator.arc({
554
+ x: null !== (_j = null === (_h = null == params ? void 0 : params.center) || void 0 === _h ? void 0 : _h.x) && void 0 !== _j ? _j : width / 2,
555
+ y: null !== (_l = null === (_k = null == params ? void 0 : params.center) || void 0 === _k ? void 0 : _k.y) && void 0 !== _l ? _l : height / 2,
556
+ outerRadius: "out" === animationType ? endRadius : startRadius,
557
+ innerRadius: 0,
558
+ startAngle: 0,
559
+ endAngle: 2 * Math.PI,
560
+ fill: !0
561
+ }), fromAttributes = {
562
+ outerRadius: startRadius
563
+ }, toAttributes = {
564
+ outerRadius: endRadius
565
+ };
566
+ super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
567
+ group: null == params ? void 0 : params.group,
568
+ clipGraphic: arc
569
+ });
570
+ }
571
+ }
572
+
573
+ exports.ClipRadiusAnimate = ClipRadiusAnimate;
574
+
575
+ class ClipDirectionAnimate extends ClipGraphicAnimate {
576
+ constructor(from, to, duration, easing, params) {
577
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
578
+ const groupAttribute = null !== (_b = null === (_a = null == params ? void 0 : params.group) || void 0 === _a ? void 0 : _a.attribute) && void 0 !== _b ? _b : {}, width = null !== (_d = null !== (_c = null == params ? void 0 : params.width) && void 0 !== _c ? _c : groupAttribute.width) && void 0 !== _d ? _d : 0, height = null !== (_f = null !== (_e = null == params ? void 0 : params.height) && void 0 !== _e ? _e : groupAttribute.height) && void 0 !== _f ? _f : 0, animationType = null !== (_g = null == params ? void 0 : params.animationType) && void 0 !== _g ? _g : "in", direction = null !== (_h = null == params ? void 0 : params.direction) && void 0 !== _h ? _h : "x", orient = null !== (_j = null == params ? void 0 : params.orient) && void 0 !== _j ? _j : "positive", rect = application_1.application.graphicService.creator.rect({
579
+ x: 0,
580
+ y: 0,
581
+ width: "in" === animationType && "x" === direction ? 0 : width,
582
+ height: "in" === animationType && "y" === direction ? 0 : height,
583
+ fill: !0
584
+ });
585
+ let fromAttributes = {}, toAttributes = {};
586
+ "y" === direction ? "negative" === orient ? (fromAttributes = {
587
+ y: height,
588
+ height: 0
589
+ }, toAttributes = {
590
+ y: 0,
591
+ height: height
592
+ }) : (fromAttributes = {
593
+ height: 0
594
+ }, toAttributes = {
595
+ height: height
596
+ }) : "negative" === orient ? (fromAttributes = {
597
+ x: width,
598
+ width: 0
599
+ }, toAttributes = {
600
+ x: 0,
601
+ width: width
602
+ }) : (fromAttributes = {
603
+ width: 0
604
+ }, toAttributes = {
605
+ width: width
606
+ }), super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
607
+ group: null == params ? void 0 : params.group,
608
+ clipGraphic: rect
609
+ });
610
+ }
611
+ }
612
+
613
+ exports.ClipDirectionAnimate = ClipDirectionAnimate;
614
+
615
+ class RotateBySphereAnimate extends animate_1.ACustomAnimate {
616
+ onStart() {
617
+ const {center: center, r: r} = "function" == typeof this.params ? this.params() : this.params, startX = this.target.getComputedAttribute("x"), startY = this.target.getComputedAttribute("y"), startZ = this.target.getComputedAttribute("z"), phi = Math.acos((startY - center.y) / r);
618
+ let theta = Math.acos((startX - center.x) / r / Math.sin(phi));
619
+ startZ - center.z < 0 && (theta = vutils_1.pi2 - theta), this.theta = theta, this.phi = phi;
620
+ }
621
+ onBind() {}
622
+ onEnd() {}
623
+ onUpdate(end, ratio, out) {
624
+ if (null == this.phi || null == this.theta) return;
625
+ const {center: center, r: r, cb: cb} = "function" == typeof this.params ? this.params() : this.params, deltaAngle = 2 * Math.PI * ratio, theta = this.theta + deltaAngle, phi = this.phi, x = r * Math.sin(phi) * Math.cos(theta) + center.x, y = r * Math.cos(phi) + center.y, z = r * Math.sin(phi) * Math.sin(theta) + center.z;
626
+ for (out.x = x, out.y = y, out.z = z, out.alpha = theta + vutils_1.pi / 2; out.alpha > vutils_1.pi2; ) out.alpha -= vutils_1.pi2;
627
+ out.alpha = vutils_1.pi2 - out.alpha, out.zIndex = -1e4 * out.z, cb && cb(out);
628
+ }
629
+ }
630
+
631
+ exports.RotateBySphereAnimate = RotateBySphereAnimate;
632
+
633
+ class AttributeAnimate extends animate_1.ACustomAnimate {
634
+ constructor(to, duration, easing) {
635
+ super({}, to, duration, easing);
636
+ }
637
+ getEndProps() {
638
+ return this.to;
639
+ }
640
+ onBind() {
641
+ Object.keys(this.to).forEach((k => {
642
+ this.from[k] = this.target.getComputedAttribute(k);
643
+ }));
644
+ }
645
+ onEnd() {}
646
+ onUpdate(end, ratio, out) {
647
+ this.target.stepInterpolate(this.subAnimate, this.subAnimate.animate, out, this.step, ratio, end, this.to, this.from);
648
+ }
649
+ }
650
+
651
+ exports.AttributeAnimate = AttributeAnimate;
652
+
653
+ class AnimateGroup extends animate_1.ACustomAnimate {
654
+ constructor(duration, customAnimates) {
655
+ super(null, null, duration, "linear"), this.customAnimates = customAnimates;
656
+ }
657
+ initAnimates() {
658
+ this.customAnimates.forEach((a => {
659
+ a.step = this.step, a.subAnimate = this.subAnimate, a.target = this.target;
660
+ }));
661
+ }
662
+ getEndProps() {
663
+ const props = {};
664
+ return this.customAnimates.forEach((a => {
665
+ Object.assign(props, a.getEndProps());
666
+ })), props;
667
+ }
668
+ onBind() {
669
+ this.initAnimates(), this.customAnimates.forEach((a => {
670
+ a.onBind();
671
+ }));
672
+ }
673
+ onEnd() {
674
+ this.customAnimates.forEach((a => {
675
+ a.onEnd();
676
+ }));
677
+ }
678
+ onStart() {
679
+ this.customAnimates.forEach((a => {
680
+ a.onStart();
681
+ }));
682
+ }
683
+ onUpdate(end, ratio, out) {
684
+ this.updating || (this.updating = !0, this.customAnimates.forEach((a => {
685
+ const easing = a.easing, easingFunc = "string" == typeof easing ? easing_1.Easing[easing] : easing;
686
+ ratio = easingFunc(ratio), a.onUpdate(end, ratio, out);
687
+ })), this.updating = !1);
688
+ }
689
+ }
690
+
691
+ exports.AnimateGroup = AnimateGroup;
692
+
693
+ class AnimateGroup1 extends animate_1.ACustomAnimate {
694
+ constructor(duration, customAnimates) {
695
+ super(null, null, duration, "linear"), this.customAnimates = customAnimates;
696
+ }
697
+ initAnimates() {
698
+ this.customAnimates.forEach((a => {
699
+ a.step = this.step, a.subAnimate = this.subAnimate, a.target = this.target;
700
+ }));
701
+ }
702
+ getEndProps() {
703
+ const props = {};
704
+ return this.customAnimates.forEach((a => {
705
+ Object.assign(props, a.getEndProps());
706
+ })), props;
707
+ }
708
+ onBind() {
709
+ this.initAnimates(), this.customAnimates.forEach((a => {
710
+ a.onBind();
711
+ }));
712
+ }
713
+ onEnd() {
714
+ this.customAnimates.forEach((a => {
715
+ a.onEnd();
716
+ }));
717
+ }
718
+ onUpdate(end, ratio, out) {
719
+ this.updating || (this.updating = !0, this.customAnimates.forEach((a => {
720
+ const easing = a.easing, easingFunc = "string" == typeof easing ? easing_1.Easing[easing] : easing;
721
+ ratio = easingFunc(ratio), a.onUpdate(end, ratio, out);
722
+ })), this.updating = !1);
723
+ }
724
+ }
725
+
726
+ exports.AnimateGroup1 = AnimateGroup1;