@visactor/vrender-core 0.22.11 → 0.22.12

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/config.d.ts +1 -2
  2. package/cjs/animate/config.js +1 -5
  3. package/cjs/animate/config.js.map +1 -1
  4. package/cjs/application.d.ts +2 -1
  5. package/cjs/application.js.map +1 -1
  6. package/cjs/canvas/constants.js +1 -2
  7. package/cjs/canvas/empty-context.d.ts +1 -0
  8. package/cjs/canvas/empty-context.js +4 -0
  9. package/cjs/canvas/empty-context.js.map +1 -1
  10. package/cjs/color-string/interpolate.d.ts +1 -0
  11. package/cjs/color-string/interpolate.js +12 -4
  12. package/cjs/color-string/interpolate.js.map +1 -1
  13. package/cjs/color-string/store.js +2 -1
  14. package/cjs/common/custom-path2d.js +2 -2
  15. package/cjs/common/custom-path2d.js.map +1 -1
  16. package/cjs/common/diff.d.ts +1 -0
  17. package/cjs/common/diff.js +19 -0
  18. package/cjs/common/diff.js.map +1 -0
  19. package/cjs/common/enums.d.ts +0 -16
  20. package/cjs/common/enums.js +2 -11
  21. package/cjs/common/enums.js.map +1 -1
  22. package/cjs/common/morphing-utils.js +32 -124
  23. package/cjs/common/morphing-utils.js.map +1 -1
  24. package/cjs/common/performance-raf.d.ts +8 -0
  25. package/cjs/common/performance-raf.js +32 -0
  26. package/cjs/common/performance-raf.js.map +1 -0
  27. package/cjs/common/polygon.js +5 -2
  28. package/cjs/common/polygon.js.map +1 -1
  29. package/cjs/common/segment/curve/cubic-bezier.d.ts +1 -2
  30. package/cjs/common/segment/curve/cubic-bezier.js +3 -8
  31. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  32. package/cjs/common/segment/curve/quadratic-bezier.d.ts +1 -0
  33. package/cjs/common/segment/curve/quadratic-bezier.js +10 -3
  34. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  35. package/cjs/common/segment/index.d.ts +1 -0
  36. package/cjs/common/segment/index.js +1 -1
  37. package/cjs/common/segment/index.js.map +1 -1
  38. package/cjs/common/shape/arc.d.ts +1 -1
  39. package/cjs/common/shape/arc.js +7 -3
  40. package/cjs/common/shape/arc.js.map +1 -1
  41. package/cjs/common/simplify.js +1 -2
  42. package/cjs/common/sort.js +1 -1
  43. package/cjs/common/split-path.js +2 -2
  44. package/cjs/common/split-path.js.map +1 -1
  45. package/cjs/common/store.js +1 -1
  46. package/cjs/common/text.js +1 -1
  47. package/cjs/common/utils.d.ts +0 -2
  48. package/cjs/common/utils.js +5 -9
  49. package/cjs/common/utils.js.map +1 -1
  50. package/cjs/core/application.js +1 -1
  51. package/cjs/core/camera.js +1 -1
  52. package/cjs/core/global.d.ts +3 -0
  53. package/cjs/core/global.js +14 -3
  54. package/cjs/core/global.js.map +1 -1
  55. package/cjs/core/stage.d.ts +8 -3
  56. package/cjs/core/stage.js +34 -20
  57. package/cjs/core/stage.js.map +1 -1
  58. package/cjs/graphic/arc.d.ts +1 -2
  59. package/cjs/graphic/arc.js +3 -2
  60. package/cjs/graphic/arc.js.map +1 -1
  61. package/cjs/graphic/area.d.ts +1 -2
  62. package/cjs/graphic/area.js +4 -1
  63. package/cjs/graphic/area.js.map +1 -1
  64. package/cjs/graphic/circle.d.ts +1 -2
  65. package/cjs/graphic/circle.js +5 -2
  66. package/cjs/graphic/circle.js.map +1 -1
  67. package/cjs/graphic/config.js +2 -1
  68. package/cjs/graphic/config.js.map +1 -1
  69. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  70. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  71. package/cjs/graphic/graphic-service/graphic-service.js +2 -3
  72. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  73. package/cjs/graphic/graphic.d.ts +9 -12
  74. package/cjs/graphic/graphic.js +48 -105
  75. package/cjs/graphic/graphic.js.map +1 -1
  76. package/cjs/graphic/group.js +8 -8
  77. package/cjs/graphic/group.js.map +1 -1
  78. package/cjs/graphic/line.d.ts +1 -2
  79. package/cjs/graphic/line.js +5 -1
  80. package/cjs/graphic/line.js.map +1 -1
  81. package/cjs/graphic/rect.js +5 -2
  82. package/cjs/graphic/rect.js.map +1 -1
  83. package/cjs/graphic/richtext/icon.d.ts +1 -1
  84. package/cjs/graphic/richtext/icon.js.map +1 -1
  85. package/cjs/graphic/richtext/paragraph.js +2 -2
  86. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  87. package/cjs/graphic/star.d.ts +1 -2
  88. package/cjs/graphic/star.js +4 -2
  89. package/cjs/graphic/star.js.map +1 -1
  90. package/cjs/index.d.ts +2 -3
  91. package/cjs/index.js +14 -16
  92. package/cjs/index.js.map +1 -1
  93. package/cjs/interface/animate.d.ts +1 -160
  94. package/cjs/interface/animate.js +1 -4
  95. package/cjs/interface/animate.js.map +1 -1
  96. package/cjs/interface/animation/animate.d.ts +117 -0
  97. package/cjs/interface/animation/animate.js +10 -0
  98. package/cjs/interface/animation/animate.js.map +1 -0
  99. package/cjs/interface/animation/easing.d.ts +3 -0
  100. package/cjs/interface/animation/easing.js +6 -0
  101. package/cjs/interface/animation/easing.js.map +1 -0
  102. package/cjs/interface/animation/index.d.ts +5 -0
  103. package/cjs/{animate/Ticker → interface/animation}/index.js +3 -3
  104. package/cjs/interface/animation/index.js.map +1 -0
  105. package/cjs/interface/animation/ticker.d.ts +39 -0
  106. package/cjs/{animate/Ticker/type.js → interface/animation/ticker.js} +1 -1
  107. package/cjs/interface/animation/ticker.js.map +1 -0
  108. package/cjs/interface/animation/timeline.d.ts +17 -0
  109. package/cjs/interface/animation/timeline.js +6 -0
  110. package/cjs/interface/animation/timeline.js.map +1 -0
  111. package/cjs/interface/animation/type.d.ts +13 -0
  112. package/cjs/interface/animation/type.js +15 -0
  113. package/cjs/interface/animation/type.js.map +1 -0
  114. package/cjs/interface/context.d.ts +1 -0
  115. package/cjs/interface/context.js.map +1 -1
  116. package/cjs/interface/global.d.ts +2 -0
  117. package/cjs/interface/global.js.map +1 -1
  118. package/cjs/interface/graphic.d.ts +11 -3
  119. package/cjs/interface/graphic.js.map +1 -1
  120. package/cjs/interface/index.d.ts +1 -1
  121. package/cjs/interface/index.js +9 -9
  122. package/cjs/interface/index.js.map +1 -1
  123. package/cjs/interface/render.d.ts +7 -0
  124. package/cjs/interface/render.js.map +1 -1
  125. package/cjs/interface/stage.d.ts +4 -1
  126. package/cjs/interface/stage.js.map +1 -1
  127. package/cjs/modules.d.ts +2 -1
  128. package/cjs/modules.js +4 -3
  129. package/cjs/modules.js.map +1 -1
  130. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  131. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  132. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  133. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  134. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  135. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  136. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  137. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  138. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  139. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  140. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  141. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +6 -5
  142. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  143. package/cjs/render/contributions/render/arc-render.d.ts +4 -2
  144. package/cjs/render/contributions/render/arc-render.js +19 -17
  145. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  146. package/cjs/render/contributions/render/area-render.js +2 -2
  147. package/cjs/render/contributions/render/area-render.js.map +1 -1
  148. package/cjs/render/contributions/render/base-render.d.ts +2 -2
  149. package/cjs/render/contributions/render/base-render.js +2 -2
  150. package/cjs/render/contributions/render/base-render.js.map +1 -1
  151. package/cjs/render/contributions/render/draw-contribution.d.ts +1 -0
  152. package/cjs/render/contributions/render/draw-contribution.js +23 -19
  153. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  154. package/cjs/render/contributions/render/draw-interceptor.js +2 -1
  155. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  156. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  157. package/cjs/render/contributions/render/group-render.js +15 -11
  158. package/cjs/render/contributions/render/group-render.js.map +1 -1
  159. package/cjs/render/contributions/render/line-render.js +1 -1
  160. package/cjs/render/contributions/render/line-render.js.map +1 -1
  161. package/cjs/render/contributions/render/rect-render.d.ts +3 -1
  162. package/cjs/render/contributions/render/rect-render.js +17 -15
  163. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  164. package/cjs/render/contributions/render/symbol-render.d.ts +4 -2
  165. package/cjs/render/contributions/render/symbol-render.js +16 -11
  166. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  167. package/cjs/render/render-service.d.ts +1 -1
  168. package/cjs/render/render-service.js.map +1 -1
  169. package/dist/index.es.js +5990 -8837
  170. package/es/animate/config.d.ts +1 -2
  171. package/es/animate/config.js +0 -5
  172. package/es/animate/config.js.map +1 -1
  173. package/es/application.d.ts +2 -1
  174. package/es/application.js.map +1 -1
  175. package/es/canvas/constants.js +1 -2
  176. package/es/canvas/empty-context.d.ts +1 -0
  177. package/es/canvas/empty-context.js +4 -0
  178. package/es/canvas/empty-context.js.map +1 -1
  179. package/es/color-string/interpolate.d.ts +1 -0
  180. package/es/color-string/interpolate.js +8 -1
  181. package/es/color-string/interpolate.js.map +1 -1
  182. package/es/color-string/store.js +2 -1
  183. package/es/common/custom-path2d.js +2 -2
  184. package/es/common/custom-path2d.js.map +1 -1
  185. package/es/common/diff.d.ts +1 -0
  186. package/es/common/diff.js +11 -0
  187. package/es/common/diff.js.map +1 -0
  188. package/es/common/enums.d.ts +0 -16
  189. package/es/common/enums.js +0 -20
  190. package/es/common/enums.js.map +1 -1
  191. package/es/common/morphing-utils.js +29 -124
  192. package/es/common/morphing-utils.js.map +1 -1
  193. package/es/common/performance-raf.d.ts +8 -0
  194. package/es/common/performance-raf.js +24 -0
  195. package/es/common/performance-raf.js.map +1 -0
  196. package/es/common/polygon.js +6 -3
  197. package/es/common/polygon.js.map +1 -1
  198. package/es/common/segment/curve/cubic-bezier.d.ts +1 -2
  199. package/es/common/segment/curve/cubic-bezier.js +1 -8
  200. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  201. package/es/common/segment/curve/quadratic-bezier.d.ts +1 -0
  202. package/es/common/segment/curve/quadratic-bezier.js +5 -2
  203. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  204. package/es/common/segment/index.d.ts +1 -0
  205. package/es/common/segment/index.js +2 -0
  206. package/es/common/segment/index.js.map +1 -1
  207. package/es/common/shape/arc.d.ts +1 -1
  208. package/es/common/shape/arc.js +7 -3
  209. package/es/common/shape/arc.js.map +1 -1
  210. package/es/common/simplify.js +1 -2
  211. package/es/common/sort.js +1 -1
  212. package/es/common/split-path.js +2 -2
  213. package/es/common/split-path.js.map +1 -1
  214. package/es/common/store.js +1 -1
  215. package/es/common/text.js +1 -1
  216. package/es/common/utils.d.ts +0 -2
  217. package/es/common/utils.js +1 -5
  218. package/es/common/utils.js.map +1 -1
  219. package/es/core/application.js +1 -1
  220. package/es/core/camera.js +1 -1
  221. package/es/core/global.d.ts +3 -0
  222. package/es/core/global.js +15 -2
  223. package/es/core/global.js.map +1 -1
  224. package/es/core/stage.d.ts +8 -3
  225. package/es/core/stage.js +35 -22
  226. package/es/core/stage.js.map +1 -1
  227. package/es/graphic/arc.d.ts +1 -2
  228. package/es/graphic/arc.js +3 -2
  229. package/es/graphic/arc.js.map +1 -1
  230. package/es/graphic/area.d.ts +1 -2
  231. package/es/graphic/area.js +4 -1
  232. package/es/graphic/area.js.map +1 -1
  233. package/es/graphic/circle.d.ts +1 -2
  234. package/es/graphic/circle.js +4 -2
  235. package/es/graphic/circle.js.map +1 -1
  236. package/es/graphic/config.js +2 -1
  237. package/es/graphic/config.js.map +1 -1
  238. package/es/graphic/graphic-service/graphic-module.js +1 -1
  239. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  240. package/es/graphic/graphic-service/graphic-service.js +1 -4
  241. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  242. package/es/graphic/graphic.d.ts +9 -12
  243. package/es/graphic/graphic.js +52 -109
  244. package/es/graphic/graphic.js.map +1 -1
  245. package/es/graphic/group.js +7 -7
  246. package/es/graphic/group.js.map +1 -1
  247. package/es/graphic/line.d.ts +1 -2
  248. package/es/graphic/line.js +5 -1
  249. package/es/graphic/line.js.map +1 -1
  250. package/es/graphic/rect.js +5 -2
  251. package/es/graphic/rect.js.map +1 -1
  252. package/es/graphic/richtext/icon.d.ts +1 -1
  253. package/es/graphic/richtext/icon.js.map +1 -1
  254. package/es/graphic/richtext/paragraph.js +2 -2
  255. package/es/graphic/richtext/paragraph.js.map +1 -1
  256. package/es/graphic/star.d.ts +1 -2
  257. package/es/graphic/star.js +4 -2
  258. package/es/graphic/star.js.map +1 -1
  259. package/es/index.d.ts +2 -3
  260. package/es/index.js +4 -6
  261. package/es/index.js.map +1 -1
  262. package/es/interface/animate.d.ts +1 -160
  263. package/es/interface/animate.js +2 -1
  264. package/es/interface/animate.js.map +1 -1
  265. package/es/interface/animation/animate.d.ts +117 -0
  266. package/es/interface/animation/animate.js +6 -0
  267. package/es/interface/animation/animate.js.map +1 -0
  268. package/es/interface/animation/easing.d.ts +3 -0
  269. package/es/interface/animation/easing.js +2 -0
  270. package/es/interface/animation/easing.js.map +1 -0
  271. package/es/interface/animation/index.d.ts +5 -0
  272. package/es/interface/animation/index.js +10 -0
  273. package/es/interface/animation/index.js.map +1 -0
  274. package/es/interface/animation/ticker.d.ts +39 -0
  275. package/es/{animate/Ticker/type.js → interface/animation/ticker.js} +1 -1
  276. package/es/interface/animation/ticker.js.map +1 -0
  277. package/es/interface/animation/timeline.d.ts +17 -0
  278. package/es/interface/animation/timeline.js +2 -0
  279. package/es/interface/animation/timeline.js.map +1 -0
  280. package/es/interface/animation/type.d.ts +13 -0
  281. package/es/interface/animation/type.js +14 -0
  282. package/es/interface/animation/type.js.map +1 -0
  283. package/es/interface/context.d.ts +1 -0
  284. package/es/interface/context.js.map +1 -1
  285. package/es/interface/global.d.ts +2 -0
  286. package/es/interface/global.js.map +1 -1
  287. package/es/interface/graphic.d.ts +11 -3
  288. package/es/interface/graphic.js.map +1 -1
  289. package/es/interface/index.d.ts +1 -1
  290. package/es/interface/index.js +2 -2
  291. package/es/interface/index.js.map +1 -1
  292. package/es/interface/render.d.ts +7 -0
  293. package/es/interface/render.js.map +1 -1
  294. package/es/interface/stage.d.ts +4 -1
  295. package/es/interface/stage.js.map +1 -1
  296. package/es/modules.d.ts +2 -1
  297. package/es/modules.js +6 -0
  298. package/es/modules.js.map +1 -1
  299. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  300. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  301. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  302. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  303. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  304. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  305. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  306. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  307. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  308. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  309. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  310. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +4 -5
  311. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  312. package/es/render/contributions/render/arc-render.d.ts +4 -2
  313. package/es/render/contributions/render/arc-render.js +19 -17
  314. package/es/render/contributions/render/arc-render.js.map +1 -1
  315. package/es/render/contributions/render/area-render.js +2 -2
  316. package/es/render/contributions/render/area-render.js.map +1 -1
  317. package/es/render/contributions/render/base-render.d.ts +2 -2
  318. package/es/render/contributions/render/base-render.js +2 -2
  319. package/es/render/contributions/render/base-render.js.map +1 -1
  320. package/es/render/contributions/render/draw-contribution.d.ts +1 -0
  321. package/es/render/contributions/render/draw-contribution.js +23 -19
  322. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  323. package/es/render/contributions/render/draw-interceptor.js +2 -1
  324. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  325. package/es/render/contributions/render/group-render.d.ts +2 -2
  326. package/es/render/contributions/render/group-render.js +15 -11
  327. package/es/render/contributions/render/group-render.js.map +1 -1
  328. package/es/render/contributions/render/line-render.js +1 -1
  329. package/es/render/contributions/render/line-render.js.map +1 -1
  330. package/es/render/contributions/render/rect-render.d.ts +3 -1
  331. package/es/render/contributions/render/rect-render.js +17 -14
  332. package/es/render/contributions/render/rect-render.js.map +1 -1
  333. package/es/render/contributions/render/symbol-render.d.ts +4 -2
  334. package/es/render/contributions/render/symbol-render.js +16 -11
  335. package/es/render/contributions/render/symbol-render.js.map +1 -1
  336. package/es/render/render-service.d.ts +1 -1
  337. package/es/render/render-service.js.map +1 -1
  338. package/package.json +4 -4
  339. package/cjs/animate/Ticker/default-ticker.d.ts +0 -40
  340. package/cjs/animate/Ticker/default-ticker.js +0 -140
  341. package/cjs/animate/Ticker/default-ticker.js.map +0 -1
  342. package/cjs/animate/Ticker/index.d.ts +0 -5
  343. package/cjs/animate/Ticker/index.js.map +0 -1
  344. package/cjs/animate/Ticker/manual-ticker-handler.d.ts +0 -15
  345. package/cjs/animate/Ticker/manual-ticker-handler.js +0 -36
  346. package/cjs/animate/Ticker/manual-ticker-handler.js.map +0 -1
  347. package/cjs/animate/Ticker/manual-ticker.d.ts +0 -19
  348. package/cjs/animate/Ticker/manual-ticker.js +0 -37
  349. package/cjs/animate/Ticker/manual-ticker.js.map +0 -1
  350. package/cjs/animate/Ticker/raf-tick-handler.d.ts +0 -9
  351. package/cjs/animate/Ticker/raf-tick-handler.js +0 -30
  352. package/cjs/animate/Ticker/raf-tick-handler.js.map +0 -1
  353. package/cjs/animate/Ticker/timeout-tick-handler.d.ts +0 -9
  354. package/cjs/animate/Ticker/timeout-tick-handler.js +0 -28
  355. package/cjs/animate/Ticker/timeout-tick-handler.js.map +0 -1
  356. package/cjs/animate/Ticker/type.d.ts +0 -6
  357. package/cjs/animate/Ticker/type.js.map +0 -1
  358. package/cjs/animate/animate.d.ts +0 -147
  359. package/cjs/animate/animate.js +0 -403
  360. package/cjs/animate/animate.js.map +0 -1
  361. package/cjs/animate/custom-animate.d.ts +0 -236
  362. package/cjs/animate/custom-animate.js +0 -726
  363. package/cjs/animate/custom-animate.js.map +0 -1
  364. package/cjs/animate/default-ticker.d.ts +0 -2
  365. package/cjs/animate/default-ticker.js +0 -14
  366. package/cjs/animate/default-ticker.js.map +0 -1
  367. package/cjs/animate/easing-func.d.ts +0 -1
  368. package/cjs/animate/easing-func.js +0 -16
  369. package/cjs/animate/easing-func.js.map +0 -1
  370. package/cjs/animate/easing.d.ts +0 -49
  371. package/cjs/animate/easing.js +0 -141
  372. package/cjs/animate/easing.js.map +0 -1
  373. package/cjs/animate/group-fade.d.ts +0 -16
  374. package/cjs/animate/group-fade.js +0 -66
  375. package/cjs/animate/group-fade.js.map +0 -1
  376. package/cjs/animate/index.d.ts +0 -8
  377. package/cjs/animate/index.js +0 -24
  378. package/cjs/animate/index.js.map +0 -1
  379. package/cjs/animate/morphing.d.ts +0 -52
  380. package/cjs/animate/morphing.js +0 -292
  381. package/cjs/animate/morphing.js.map +0 -1
  382. package/cjs/animate/timeline.d.ts +0 -17
  383. package/cjs/animate/timeline.js +0 -46
  384. package/cjs/animate/timeline.js.map +0 -1
  385. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  386. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  387. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
  388. package/es/animate/Ticker/default-ticker.d.ts +0 -40
  389. package/es/animate/Ticker/default-ticker.js +0 -138
  390. package/es/animate/Ticker/default-ticker.js.map +0 -1
  391. package/es/animate/Ticker/index.d.ts +0 -5
  392. package/es/animate/Ticker/index.js +0 -10
  393. package/es/animate/Ticker/index.js.map +0 -1
  394. package/es/animate/Ticker/manual-ticker-handler.d.ts +0 -15
  395. package/es/animate/Ticker/manual-ticker-handler.js +0 -28
  396. package/es/animate/Ticker/manual-ticker-handler.js.map +0 -1
  397. package/es/animate/Ticker/manual-ticker.d.ts +0 -19
  398. package/es/animate/Ticker/manual-ticker.js +0 -31
  399. package/es/animate/Ticker/manual-ticker.js.map +0 -1
  400. package/es/animate/Ticker/raf-tick-handler.d.ts +0 -9
  401. package/es/animate/Ticker/raf-tick-handler.js +0 -22
  402. package/es/animate/Ticker/raf-tick-handler.js.map +0 -1
  403. package/es/animate/Ticker/timeout-tick-handler.d.ts +0 -9
  404. package/es/animate/Ticker/timeout-tick-handler.js +0 -20
  405. package/es/animate/Ticker/timeout-tick-handler.js.map +0 -1
  406. package/es/animate/Ticker/type.d.ts +0 -6
  407. package/es/animate/Ticker/type.js.map +0 -1
  408. package/es/animate/animate.d.ts +0 -147
  409. package/es/animate/animate.js +0 -398
  410. package/es/animate/animate.js.map +0 -1
  411. package/es/animate/custom-animate.d.ts +0 -236
  412. package/es/animate/custom-animate.js +0 -703
  413. package/es/animate/custom-animate.js.map +0 -1
  414. package/es/animate/default-ticker.d.ts +0 -2
  415. package/es/animate/default-ticker.js +0 -12
  416. package/es/animate/default-ticker.js.map +0 -1
  417. package/es/animate/easing-func.d.ts +0 -1
  418. package/es/animate/easing-func.js +0 -10
  419. package/es/animate/easing-func.js.map +0 -1
  420. package/es/animate/easing.d.ts +0 -49
  421. package/es/animate/easing.js +0 -134
  422. package/es/animate/easing.js.map +0 -1
  423. package/es/animate/group-fade.d.ts +0 -16
  424. package/es/animate/group-fade.js +0 -56
  425. package/es/animate/group-fade.js.map +0 -1
  426. package/es/animate/index.d.ts +0 -8
  427. package/es/animate/index.js +0 -16
  428. package/es/animate/index.js.map +0 -1
  429. package/es/animate/morphing.d.ts +0 -52
  430. package/es/animate/morphing.js +0 -295
  431. package/es/animate/morphing.js.map +0 -1
  432. package/es/animate/timeline.d.ts +0 -17
  433. package/es/animate/timeline.js +0 -42
  434. package/es/animate/timeline.js.map +0 -1
  435. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  436. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  437. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
@@ -1,726 +0,0 @@
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;