@visactor/vrender-core 0.22.10 → 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 (535) 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/contribution-provider.d.ts +16 -0
  15. package/cjs/common/contribution-provider.js +21 -2
  16. package/cjs/common/contribution-provider.js.map +1 -1
  17. package/cjs/common/custom-path2d.js +2 -2
  18. package/cjs/common/custom-path2d.js.map +1 -1
  19. package/cjs/common/diff.d.ts +1 -0
  20. package/cjs/common/diff.js +19 -0
  21. package/cjs/common/diff.js.map +1 -0
  22. package/cjs/common/enums.d.ts +0 -16
  23. package/cjs/common/enums.js +2 -11
  24. package/cjs/common/enums.js.map +1 -1
  25. package/cjs/common/event-listener-manager.d.ts +14 -0
  26. package/cjs/common/event-listener-manager.js +52 -0
  27. package/cjs/common/event-listener-manager.js.map +1 -0
  28. package/cjs/common/event-transformer.d.ts +12 -0
  29. package/cjs/common/event-transformer.js +91 -0
  30. package/cjs/common/event-transformer.js.map +1 -0
  31. package/cjs/common/morphing-utils.js +32 -124
  32. package/cjs/common/morphing-utils.js.map +1 -1
  33. package/cjs/common/performance-raf.d.ts +8 -0
  34. package/cjs/common/performance-raf.js +32 -0
  35. package/cjs/common/performance-raf.js.map +1 -0
  36. package/cjs/common/polygon.js +4 -2
  37. package/cjs/common/polygon.js.map +1 -1
  38. package/cjs/common/render-area.js +1 -0
  39. package/cjs/common/segment/curve/cubic-bezier.d.ts +1 -2
  40. package/cjs/common/segment/curve/cubic-bezier.js +3 -8
  41. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  42. package/cjs/common/segment/curve/quadratic-bezier.d.ts +1 -0
  43. package/cjs/common/segment/curve/quadratic-bezier.js +10 -3
  44. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  45. package/cjs/common/segment/index.d.ts +1 -0
  46. package/cjs/common/segment/index.js +1 -1
  47. package/cjs/common/segment/index.js.map +1 -1
  48. package/cjs/common/shape/arc.d.ts +1 -1
  49. package/cjs/common/shape/arc.js +7 -3
  50. package/cjs/common/shape/arc.js.map +1 -1
  51. package/cjs/common/simplify.js +1 -2
  52. package/cjs/common/split-path.js +1 -1
  53. package/cjs/common/split-path.js.map +1 -1
  54. package/cjs/common/store.js +1 -1
  55. package/cjs/common/text.js +1 -1
  56. package/cjs/common/utils.d.ts +0 -2
  57. package/cjs/common/utils.js +5 -9
  58. package/cjs/common/utils.js.map +1 -1
  59. package/cjs/core/application.js +1 -1
  60. package/cjs/core/camera.js +1 -1
  61. package/cjs/core/global.d.ts +10 -5
  62. package/cjs/core/global.js +23 -12
  63. package/cjs/core/global.js.map +1 -1
  64. package/cjs/core/stage.d.ts +9 -3
  65. package/cjs/core/stage.js +37 -20
  66. package/cjs/core/stage.js.map +1 -1
  67. package/cjs/core/window.d.ts +5 -4
  68. package/cjs/core/window.js +14 -13
  69. package/cjs/core/window.js.map +1 -1
  70. package/cjs/event/event-system.js +11 -10
  71. package/cjs/event/event-system.js.map +1 -1
  72. package/cjs/graphic/arc.d.ts +1 -2
  73. package/cjs/graphic/arc.js +3 -2
  74. package/cjs/graphic/arc.js.map +1 -1
  75. package/cjs/graphic/area.d.ts +1 -2
  76. package/cjs/graphic/area.js +4 -1
  77. package/cjs/graphic/area.js.map +1 -1
  78. package/cjs/graphic/circle.d.ts +1 -2
  79. package/cjs/graphic/circle.js +5 -2
  80. package/cjs/graphic/circle.js.map +1 -1
  81. package/cjs/graphic/config.js +2 -1
  82. package/cjs/graphic/config.js.map +1 -1
  83. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  84. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  85. package/cjs/graphic/graphic-service/graphic-service.js +2 -3
  86. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  87. package/cjs/graphic/graphic.d.ts +9 -12
  88. package/cjs/graphic/graphic.js +48 -105
  89. package/cjs/graphic/graphic.js.map +1 -1
  90. package/cjs/graphic/group.js +8 -8
  91. package/cjs/graphic/group.js.map +1 -1
  92. package/cjs/graphic/line.d.ts +1 -2
  93. package/cjs/graphic/line.js +5 -1
  94. package/cjs/graphic/line.js.map +1 -1
  95. package/cjs/graphic/rect.js +5 -2
  96. package/cjs/graphic/rect.js.map +1 -1
  97. package/cjs/graphic/richtext/icon.d.ts +1 -1
  98. package/cjs/graphic/richtext/icon.js.map +1 -1
  99. package/cjs/graphic/richtext/paragraph.js +2 -2
  100. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  101. package/cjs/graphic/star.d.ts +1 -2
  102. package/cjs/graphic/star.js +4 -2
  103. package/cjs/graphic/star.js.map +1 -1
  104. package/cjs/index.d.ts +4 -3
  105. package/cjs/index.js +13 -13
  106. package/cjs/index.js.map +1 -1
  107. package/cjs/interface/animate.d.ts +1 -160
  108. package/cjs/interface/animate.js +1 -4
  109. package/cjs/interface/animate.js.map +1 -1
  110. package/cjs/interface/animation/animate.d.ts +117 -0
  111. package/cjs/interface/animation/animate.js +10 -0
  112. package/cjs/interface/animation/animate.js.map +1 -0
  113. package/cjs/interface/animation/easing.d.ts +3 -0
  114. package/cjs/interface/animation/easing.js +6 -0
  115. package/cjs/interface/animation/easing.js.map +1 -0
  116. package/cjs/interface/animation/index.d.ts +5 -0
  117. package/cjs/{animate/Ticker → interface/animation}/index.js +3 -3
  118. package/cjs/interface/animation/index.js.map +1 -0
  119. package/cjs/interface/animation/ticker.d.ts +39 -0
  120. package/cjs/{animate/Ticker/type.js → interface/animation/ticker.js} +1 -1
  121. package/cjs/interface/animation/ticker.js.map +1 -0
  122. package/cjs/interface/animation/timeline.d.ts +17 -0
  123. package/cjs/interface/animation/timeline.js +6 -0
  124. package/cjs/interface/animation/timeline.js.map +1 -0
  125. package/cjs/interface/animation/type.d.ts +13 -0
  126. package/cjs/interface/animation/type.js +15 -0
  127. package/cjs/interface/animation/type.js.map +1 -0
  128. package/cjs/interface/context.d.ts +1 -0
  129. package/cjs/interface/context.js.map +1 -1
  130. package/cjs/interface/event-listener-manager.d.ts +7 -0
  131. package/cjs/interface/event-listener-manager.js +6 -0
  132. package/cjs/interface/event-listener-manager.js.map +1 -0
  133. package/cjs/interface/global.d.ts +4 -1
  134. package/cjs/interface/global.js.map +1 -1
  135. package/cjs/interface/graphic.d.ts +11 -3
  136. package/cjs/interface/graphic.js.map +1 -1
  137. package/cjs/interface/index.d.ts +1 -1
  138. package/cjs/interface/index.js +9 -9
  139. package/cjs/interface/index.js.map +1 -1
  140. package/cjs/interface/picker.d.ts +1 -0
  141. package/cjs/interface/picker.js.map +1 -1
  142. package/cjs/interface/render.d.ts +10 -0
  143. package/cjs/interface/render.js.map +1 -1
  144. package/cjs/interface/stage.d.ts +4 -1
  145. package/cjs/interface/stage.js.map +1 -1
  146. package/cjs/interface/window.d.ts +1 -0
  147. package/cjs/interface/window.js.map +1 -1
  148. package/cjs/modules.d.ts +2 -1
  149. package/cjs/modules.js +4 -3
  150. package/cjs/modules.js.map +1 -1
  151. package/cjs/picker/global-picker-service.d.ts +1 -0
  152. package/cjs/picker/global-picker-service.js +1 -0
  153. package/cjs/picker/global-picker-service.js.map +1 -1
  154. package/cjs/picker/picker-service.d.ts +1 -0
  155. package/cjs/picker/picker-service.js +3 -0
  156. package/cjs/picker/picker-service.js.map +1 -1
  157. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  158. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  159. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  160. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  161. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  162. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  163. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  164. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  165. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  166. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  167. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  168. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +6 -5
  169. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  170. package/cjs/render/contributions/render/arc-render.d.ts +6 -4
  171. package/cjs/render/contributions/render/arc-render.js +22 -20
  172. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  173. package/cjs/render/contributions/render/area-render.d.ts +2 -2
  174. package/cjs/render/contributions/render/area-render.js +5 -5
  175. package/cjs/render/contributions/render/area-render.js.map +1 -1
  176. package/cjs/render/contributions/render/base-render.d.ts +4 -2
  177. package/cjs/render/contributions/render/base-render.js +5 -2
  178. package/cjs/render/contributions/render/base-render.js.map +1 -1
  179. package/cjs/render/contributions/render/circle-render.d.ts +2 -2
  180. package/cjs/render/contributions/render/circle-render.js +3 -3
  181. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  182. package/cjs/render/contributions/render/draw-contribution.d.ts +2 -0
  183. package/cjs/render/contributions/render/draw-contribution.js +28 -19
  184. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  185. package/cjs/render/contributions/render/draw-interceptor.js +2 -1
  186. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  187. package/cjs/render/contributions/render/glyph-render.d.ts +1 -0
  188. package/cjs/render/contributions/render/glyph-render.js +1 -0
  189. package/cjs/render/contributions/render/glyph-render.js.map +1 -1
  190. package/cjs/render/contributions/render/graphic-render.d.ts +1 -0
  191. package/cjs/render/contributions/render/graphic-render.js.map +1 -1
  192. package/cjs/render/contributions/render/group-render.d.ts +3 -2
  193. package/cjs/render/contributions/render/group-render.js +19 -11
  194. package/cjs/render/contributions/render/group-render.js.map +1 -1
  195. package/cjs/render/contributions/render/image-render.d.ts +2 -2
  196. package/cjs/render/contributions/render/image-render.js +3 -3
  197. package/cjs/render/contributions/render/image-render.js.map +1 -1
  198. package/cjs/render/contributions/render/line-render.js +1 -1
  199. package/cjs/render/contributions/render/line-render.js.map +1 -1
  200. package/cjs/render/contributions/render/path-render.d.ts +2 -2
  201. package/cjs/render/contributions/render/path-render.js +3 -3
  202. package/cjs/render/contributions/render/path-render.js.map +1 -1
  203. package/cjs/render/contributions/render/polygon-render.d.ts +2 -2
  204. package/cjs/render/contributions/render/polygon-render.js +3 -3
  205. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  206. package/cjs/render/contributions/render/rect-render.d.ts +5 -3
  207. package/cjs/render/contributions/render/rect-render.js +20 -18
  208. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  209. package/cjs/render/contributions/render/symbol-render.d.ts +6 -4
  210. package/cjs/render/contributions/render/symbol-render.js +19 -14
  211. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  212. package/cjs/render/contributions/render/text-render.d.ts +2 -2
  213. package/cjs/render/contributions/render/text-render.js +3 -3
  214. package/cjs/render/contributions/render/text-render.js.map +1 -1
  215. package/cjs/render/render-service.d.ts +2 -1
  216. package/cjs/render/render-service.js +3 -0
  217. package/cjs/render/render-service.js.map +1 -1
  218. package/dist/index.es.js +5531 -8162
  219. package/es/animate/config.d.ts +1 -2
  220. package/es/animate/config.js +0 -5
  221. package/es/animate/config.js.map +1 -1
  222. package/es/application.d.ts +2 -1
  223. package/es/application.js.map +1 -1
  224. package/es/canvas/constants.js +1 -2
  225. package/es/canvas/empty-context.d.ts +1 -0
  226. package/es/canvas/empty-context.js +4 -0
  227. package/es/canvas/empty-context.js.map +1 -1
  228. package/es/color-string/interpolate.d.ts +1 -0
  229. package/es/color-string/interpolate.js +8 -1
  230. package/es/color-string/interpolate.js.map +1 -1
  231. package/es/color-string/store.js +2 -1
  232. package/es/common/contribution-provider.d.ts +16 -0
  233. package/es/common/contribution-provider.js +20 -1
  234. package/es/common/contribution-provider.js.map +1 -1
  235. package/es/common/custom-path2d.js +2 -2
  236. package/es/common/custom-path2d.js.map +1 -1
  237. package/es/common/diff.d.ts +1 -0
  238. package/es/common/diff.js +11 -0
  239. package/es/common/diff.js.map +1 -0
  240. package/es/common/enums.d.ts +0 -16
  241. package/es/common/enums.js +0 -20
  242. package/es/common/enums.js.map +1 -1
  243. package/es/common/event-listener-manager.d.ts +14 -0
  244. package/es/common/event-listener-manager.js +44 -0
  245. package/es/common/event-listener-manager.js.map +1 -0
  246. package/es/common/event-transformer.d.ts +12 -0
  247. package/es/common/event-transformer.js +81 -0
  248. package/es/common/event-transformer.js.map +1 -0
  249. package/es/common/morphing-utils.js +29 -124
  250. package/es/common/morphing-utils.js.map +1 -1
  251. package/es/common/performance-raf.d.ts +8 -0
  252. package/es/common/performance-raf.js +24 -0
  253. package/es/common/performance-raf.js.map +1 -0
  254. package/es/common/polygon.js +4 -2
  255. package/es/common/polygon.js.map +1 -1
  256. package/es/common/render-area.js +2 -1
  257. package/es/common/segment/curve/cubic-bezier.d.ts +1 -2
  258. package/es/common/segment/curve/cubic-bezier.js +1 -8
  259. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  260. package/es/common/segment/curve/quadratic-bezier.d.ts +1 -0
  261. package/es/common/segment/curve/quadratic-bezier.js +5 -2
  262. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  263. package/es/common/segment/index.d.ts +1 -0
  264. package/es/common/segment/index.js +2 -0
  265. package/es/common/segment/index.js.map +1 -1
  266. package/es/common/shape/arc.d.ts +1 -1
  267. package/es/common/shape/arc.js +7 -3
  268. package/es/common/shape/arc.js.map +1 -1
  269. package/es/common/simplify.js +1 -2
  270. package/es/common/split-path.js +1 -1
  271. package/es/common/split-path.js.map +1 -1
  272. package/es/common/store.js +1 -1
  273. package/es/common/text.js +1 -1
  274. package/es/common/utils.d.ts +0 -2
  275. package/es/common/utils.js +1 -5
  276. package/es/common/utils.js.map +1 -1
  277. package/es/core/application.js +1 -1
  278. package/es/core/camera.js +1 -1
  279. package/es/core/global.d.ts +10 -5
  280. package/es/core/global.js +26 -11
  281. package/es/core/global.js.map +1 -1
  282. package/es/core/stage.d.ts +9 -3
  283. package/es/core/stage.js +38 -22
  284. package/es/core/stage.js.map +1 -1
  285. package/es/core/window.d.ts +5 -4
  286. package/es/core/window.js +15 -12
  287. package/es/core/window.js.map +1 -1
  288. package/es/event/event-system.js +11 -10
  289. package/es/event/event-system.js.map +1 -1
  290. package/es/graphic/arc.d.ts +1 -2
  291. package/es/graphic/arc.js +3 -2
  292. package/es/graphic/arc.js.map +1 -1
  293. package/es/graphic/area.d.ts +1 -2
  294. package/es/graphic/area.js +4 -1
  295. package/es/graphic/area.js.map +1 -1
  296. package/es/graphic/circle.d.ts +1 -2
  297. package/es/graphic/circle.js +4 -2
  298. package/es/graphic/circle.js.map +1 -1
  299. package/es/graphic/config.js +2 -1
  300. package/es/graphic/config.js.map +1 -1
  301. package/es/graphic/graphic-service/graphic-module.js +1 -1
  302. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  303. package/es/graphic/graphic-service/graphic-service.js +1 -4
  304. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  305. package/es/graphic/graphic.d.ts +9 -12
  306. package/es/graphic/graphic.js +52 -109
  307. package/es/graphic/graphic.js.map +1 -1
  308. package/es/graphic/group.js +7 -7
  309. package/es/graphic/group.js.map +1 -1
  310. package/es/graphic/line.d.ts +1 -2
  311. package/es/graphic/line.js +5 -1
  312. package/es/graphic/line.js.map +1 -1
  313. package/es/graphic/rect.js +5 -2
  314. package/es/graphic/rect.js.map +1 -1
  315. package/es/graphic/richtext/icon.d.ts +1 -1
  316. package/es/graphic/richtext/icon.js.map +1 -1
  317. package/es/graphic/richtext/paragraph.js +2 -2
  318. package/es/graphic/richtext/paragraph.js.map +1 -1
  319. package/es/graphic/star.d.ts +1 -2
  320. package/es/graphic/star.js +4 -2
  321. package/es/graphic/star.js.map +1 -1
  322. package/es/index.d.ts +4 -3
  323. package/es/index.js +7 -5
  324. package/es/index.js.map +1 -1
  325. package/es/interface/animate.d.ts +1 -160
  326. package/es/interface/animate.js +2 -1
  327. package/es/interface/animate.js.map +1 -1
  328. package/es/interface/animation/animate.d.ts +117 -0
  329. package/es/interface/animation/animate.js +6 -0
  330. package/es/interface/animation/animate.js.map +1 -0
  331. package/es/interface/animation/easing.d.ts +3 -0
  332. package/es/interface/animation/easing.js +2 -0
  333. package/es/interface/animation/easing.js.map +1 -0
  334. package/es/interface/animation/index.d.ts +5 -0
  335. package/es/interface/animation/index.js +10 -0
  336. package/es/interface/animation/index.js.map +1 -0
  337. package/es/interface/animation/ticker.d.ts +39 -0
  338. package/es/{animate/Ticker/type.js → interface/animation/ticker.js} +1 -1
  339. package/es/interface/animation/ticker.js.map +1 -0
  340. package/es/interface/animation/timeline.d.ts +17 -0
  341. package/es/interface/animation/timeline.js +2 -0
  342. package/es/interface/animation/timeline.js.map +1 -0
  343. package/es/interface/animation/type.d.ts +13 -0
  344. package/es/interface/animation/type.js +14 -0
  345. package/es/interface/animation/type.js.map +1 -0
  346. package/es/interface/context.d.ts +1 -0
  347. package/es/interface/context.js.map +1 -1
  348. package/es/interface/event-listener-manager.d.ts +7 -0
  349. package/es/interface/event-listener-manager.js +2 -0
  350. package/es/interface/event-listener-manager.js.map +1 -0
  351. package/es/interface/global.d.ts +4 -1
  352. package/es/interface/global.js.map +1 -1
  353. package/es/interface/graphic.d.ts +11 -3
  354. package/es/interface/graphic.js.map +1 -1
  355. package/es/interface/index.d.ts +1 -1
  356. package/es/interface/index.js +2 -2
  357. package/es/interface/index.js.map +1 -1
  358. package/es/interface/picker.d.ts +1 -0
  359. package/es/interface/picker.js.map +1 -1
  360. package/es/interface/render.d.ts +10 -0
  361. package/es/interface/render.js.map +1 -1
  362. package/es/interface/stage.d.ts +4 -1
  363. package/es/interface/stage.js.map +1 -1
  364. package/es/interface/window.d.ts +1 -0
  365. package/es/interface/window.js.map +1 -1
  366. package/es/modules.d.ts +2 -1
  367. package/es/modules.js +6 -0
  368. package/es/modules.js.map +1 -1
  369. package/es/picker/global-picker-service.d.ts +1 -0
  370. package/es/picker/global-picker-service.js +1 -0
  371. package/es/picker/global-picker-service.js.map +1 -1
  372. package/es/picker/picker-service.d.ts +1 -0
  373. package/es/picker/picker-service.js +3 -0
  374. package/es/picker/picker-service.js.map +1 -1
  375. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  376. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  377. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  378. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  379. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  380. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  381. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  382. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  383. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  384. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  385. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  386. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +4 -5
  387. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  388. package/es/render/contributions/render/arc-render.d.ts +6 -4
  389. package/es/render/contributions/render/arc-render.js +22 -20
  390. package/es/render/contributions/render/arc-render.js.map +1 -1
  391. package/es/render/contributions/render/area-render.d.ts +2 -2
  392. package/es/render/contributions/render/area-render.js +5 -5
  393. package/es/render/contributions/render/area-render.js.map +1 -1
  394. package/es/render/contributions/render/base-render.d.ts +4 -2
  395. package/es/render/contributions/render/base-render.js +5 -2
  396. package/es/render/contributions/render/base-render.js.map +1 -1
  397. package/es/render/contributions/render/circle-render.d.ts +2 -2
  398. package/es/render/contributions/render/circle-render.js +3 -3
  399. package/es/render/contributions/render/circle-render.js.map +1 -1
  400. package/es/render/contributions/render/draw-contribution.d.ts +2 -0
  401. package/es/render/contributions/render/draw-contribution.js +28 -19
  402. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  403. package/es/render/contributions/render/draw-interceptor.js +2 -1
  404. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  405. package/es/render/contributions/render/glyph-render.d.ts +1 -0
  406. package/es/render/contributions/render/glyph-render.js +1 -0
  407. package/es/render/contributions/render/glyph-render.js.map +1 -1
  408. package/es/render/contributions/render/graphic-render.d.ts +1 -0
  409. package/es/render/contributions/render/graphic-render.js.map +1 -1
  410. package/es/render/contributions/render/group-render.d.ts +3 -2
  411. package/es/render/contributions/render/group-render.js +19 -11
  412. package/es/render/contributions/render/group-render.js.map +1 -1
  413. package/es/render/contributions/render/image-render.d.ts +2 -2
  414. package/es/render/contributions/render/image-render.js +3 -3
  415. package/es/render/contributions/render/image-render.js.map +1 -1
  416. package/es/render/contributions/render/line-render.js +1 -1
  417. package/es/render/contributions/render/line-render.js.map +1 -1
  418. package/es/render/contributions/render/path-render.d.ts +2 -2
  419. package/es/render/contributions/render/path-render.js +3 -3
  420. package/es/render/contributions/render/path-render.js.map +1 -1
  421. package/es/render/contributions/render/polygon-render.d.ts +2 -2
  422. package/es/render/contributions/render/polygon-render.js +3 -3
  423. package/es/render/contributions/render/polygon-render.js.map +1 -1
  424. package/es/render/contributions/render/rect-render.d.ts +5 -3
  425. package/es/render/contributions/render/rect-render.js +20 -17
  426. package/es/render/contributions/render/rect-render.js.map +1 -1
  427. package/es/render/contributions/render/symbol-render.d.ts +6 -4
  428. package/es/render/contributions/render/symbol-render.js +19 -14
  429. package/es/render/contributions/render/symbol-render.js.map +1 -1
  430. package/es/render/contributions/render/text-render.d.ts +2 -2
  431. package/es/render/contributions/render/text-render.js +3 -3
  432. package/es/render/contributions/render/text-render.js.map +1 -1
  433. package/es/render/render-service.d.ts +2 -1
  434. package/es/render/render-service.js +3 -0
  435. package/es/render/render-service.js.map +1 -1
  436. package/package.json +2 -2
  437. package/cjs/animate/Ticker/default-ticker.d.ts +0 -40
  438. package/cjs/animate/Ticker/default-ticker.js +0 -140
  439. package/cjs/animate/Ticker/default-ticker.js.map +0 -1
  440. package/cjs/animate/Ticker/index.d.ts +0 -5
  441. package/cjs/animate/Ticker/index.js.map +0 -1
  442. package/cjs/animate/Ticker/manual-ticker-handler.d.ts +0 -15
  443. package/cjs/animate/Ticker/manual-ticker-handler.js +0 -36
  444. package/cjs/animate/Ticker/manual-ticker-handler.js.map +0 -1
  445. package/cjs/animate/Ticker/manual-ticker.d.ts +0 -19
  446. package/cjs/animate/Ticker/manual-ticker.js +0 -37
  447. package/cjs/animate/Ticker/manual-ticker.js.map +0 -1
  448. package/cjs/animate/Ticker/raf-tick-handler.d.ts +0 -9
  449. package/cjs/animate/Ticker/raf-tick-handler.js +0 -30
  450. package/cjs/animate/Ticker/raf-tick-handler.js.map +0 -1
  451. package/cjs/animate/Ticker/timeout-tick-handler.d.ts +0 -9
  452. package/cjs/animate/Ticker/timeout-tick-handler.js +0 -28
  453. package/cjs/animate/Ticker/timeout-tick-handler.js.map +0 -1
  454. package/cjs/animate/Ticker/type.d.ts +0 -6
  455. package/cjs/animate/Ticker/type.js.map +0 -1
  456. package/cjs/animate/animate.d.ts +0 -147
  457. package/cjs/animate/animate.js +0 -403
  458. package/cjs/animate/animate.js.map +0 -1
  459. package/cjs/animate/custom-animate.d.ts +0 -236
  460. package/cjs/animate/custom-animate.js +0 -722
  461. package/cjs/animate/custom-animate.js.map +0 -1
  462. package/cjs/animate/default-ticker.d.ts +0 -2
  463. package/cjs/animate/default-ticker.js +0 -14
  464. package/cjs/animate/default-ticker.js.map +0 -1
  465. package/cjs/animate/easing-func.d.ts +0 -1
  466. package/cjs/animate/easing-func.js +0 -16
  467. package/cjs/animate/easing-func.js.map +0 -1
  468. package/cjs/animate/easing.d.ts +0 -49
  469. package/cjs/animate/easing.js +0 -141
  470. package/cjs/animate/easing.js.map +0 -1
  471. package/cjs/animate/group-fade.d.ts +0 -16
  472. package/cjs/animate/group-fade.js +0 -66
  473. package/cjs/animate/group-fade.js.map +0 -1
  474. package/cjs/animate/index.d.ts +0 -8
  475. package/cjs/animate/index.js +0 -24
  476. package/cjs/animate/index.js.map +0 -1
  477. package/cjs/animate/morphing.d.ts +0 -52
  478. package/cjs/animate/morphing.js +0 -292
  479. package/cjs/animate/morphing.js.map +0 -1
  480. package/cjs/animate/timeline.d.ts +0 -17
  481. package/cjs/animate/timeline.js +0 -46
  482. package/cjs/animate/timeline.js.map +0 -1
  483. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  484. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  485. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
  486. package/es/animate/Ticker/default-ticker.d.ts +0 -40
  487. package/es/animate/Ticker/default-ticker.js +0 -138
  488. package/es/animate/Ticker/default-ticker.js.map +0 -1
  489. package/es/animate/Ticker/index.d.ts +0 -5
  490. package/es/animate/Ticker/index.js +0 -10
  491. package/es/animate/Ticker/index.js.map +0 -1
  492. package/es/animate/Ticker/manual-ticker-handler.d.ts +0 -15
  493. package/es/animate/Ticker/manual-ticker-handler.js +0 -28
  494. package/es/animate/Ticker/manual-ticker-handler.js.map +0 -1
  495. package/es/animate/Ticker/manual-ticker.d.ts +0 -19
  496. package/es/animate/Ticker/manual-ticker.js +0 -31
  497. package/es/animate/Ticker/manual-ticker.js.map +0 -1
  498. package/es/animate/Ticker/raf-tick-handler.d.ts +0 -9
  499. package/es/animate/Ticker/raf-tick-handler.js +0 -22
  500. package/es/animate/Ticker/raf-tick-handler.js.map +0 -1
  501. package/es/animate/Ticker/timeout-tick-handler.d.ts +0 -9
  502. package/es/animate/Ticker/timeout-tick-handler.js +0 -20
  503. package/es/animate/Ticker/timeout-tick-handler.js.map +0 -1
  504. package/es/animate/Ticker/type.d.ts +0 -6
  505. package/es/animate/Ticker/type.js.map +0 -1
  506. package/es/animate/animate.d.ts +0 -147
  507. package/es/animate/animate.js +0 -398
  508. package/es/animate/animate.js.map +0 -1
  509. package/es/animate/custom-animate.d.ts +0 -236
  510. package/es/animate/custom-animate.js +0 -699
  511. package/es/animate/custom-animate.js.map +0 -1
  512. package/es/animate/default-ticker.d.ts +0 -2
  513. package/es/animate/default-ticker.js +0 -12
  514. package/es/animate/default-ticker.js.map +0 -1
  515. package/es/animate/easing-func.d.ts +0 -1
  516. package/es/animate/easing-func.js +0 -10
  517. package/es/animate/easing-func.js.map +0 -1
  518. package/es/animate/easing.d.ts +0 -49
  519. package/es/animate/easing.js +0 -134
  520. package/es/animate/easing.js.map +0 -1
  521. package/es/animate/group-fade.d.ts +0 -16
  522. package/es/animate/group-fade.js +0 -56
  523. package/es/animate/group-fade.js.map +0 -1
  524. package/es/animate/index.d.ts +0 -8
  525. package/es/animate/index.js +0 -16
  526. package/es/animate/index.js.map +0 -1
  527. package/es/animate/morphing.d.ts +0 -52
  528. package/es/animate/morphing.js +0 -295
  529. package/es/animate/morphing.js.map +0 -1
  530. package/es/animate/timeline.d.ts +0 -17
  531. package/es/animate/timeline.js +0 -42
  532. package/es/animate/timeline.js.map +0 -1
  533. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  534. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  535. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
@@ -1,52 +0,0 @@
1
- import type { IGraphic, MorphingAnimateConfig, EasingType, MultiMorphingAnimateConfig, IGraphicAttribute } from './../interface';
2
- import { CustomPath2D } from '../common/custom-path2d';
3
- import { ACustomAnimate } from './animate';
4
- import type { IMatrix } from '@visactor/vutils';
5
- interface MorphingDataItem {
6
- from: number[];
7
- to: number[];
8
- fromCp: number[];
9
- toCp: number[];
10
- rotation: number;
11
- }
12
- interface OtherAttrItem {
13
- from: any;
14
- to: any;
15
- key: string;
16
- }
17
- export declare class MorphingPath extends ACustomAnimate<number> {
18
- path: CustomPath2D;
19
- saveOnEnd?: boolean;
20
- otherAttrs?: OtherAttrItem[];
21
- constructor(config: {
22
- morphingData: MorphingDataItem[];
23
- otherAttrs?: OtherAttrItem[];
24
- saveOnEnd?: boolean;
25
- }, duration: number, easing: EasingType);
26
- private morphingData?;
27
- getEndProps(): Record<string, any>;
28
- onBind(): void;
29
- onEnd(): void;
30
- onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
31
- }
32
- export declare const morphPath: (fromGraphic: IGraphic | null, toGraphic: IGraphic, animationConfig?: MorphingAnimateConfig, fromGraphicTransform?: IMatrix) => import("./../interface").IAnimate;
33
- export declare const oneToMultiMorph: (fromGraphic: IGraphic, toGraphics: IGraphic[], animationConfig?: MultiMorphingAnimateConfig) => void;
34
- export declare class MultiToOneMorphingPath extends ACustomAnimate<number> {
35
- path: CustomPath2D;
36
- otherAttrs?: OtherAttrItem[][];
37
- constructor(config: {
38
- morphingData: MorphingDataItem[][];
39
- otherAttrs?: OtherAttrItem[][];
40
- }, duration: number, easing: EasingType);
41
- private morphingData?;
42
- getEndProps(): Record<string, any>;
43
- onBind(): void;
44
- private addPathProxy;
45
- private clearPathProxy;
46
- onEnd(): void;
47
- onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
48
- }
49
- export declare const cloneGraphic: (graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic<Partial<IGraphicAttribute>>[];
50
- export declare const splitGraphic: (graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic<Partial<IGraphicAttribute>>[];
51
- export declare const multiToOneMorph: (fromGraphics: IGraphic[], toGraphic: IGraphic, animationConfig?: MultiMorphingAnimateConfig) => void;
52
- export {};
@@ -1,292 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.multiToOneMorph = exports.splitGraphic = exports.cloneGraphic = exports.MultiToOneMorphingPath = exports.oneToMultiMorph = exports.morphPath = exports.MorphingPath = void 0;
6
-
7
- const split_path_1 = require("./../common/split-path"), custom_path2d_1 = require("../common/custom-path2d"), animate_1 = require("./animate"), morphing_utils_1 = require("../common/morphing-utils"), application_1 = require("../application"), vutils_1 = require("@visactor/vutils"), interpolate_1 = require("../color-string/interpolate"), color_string_1 = require("../color-string"), config_1 = require("./config"), utils_1 = require("../common/utils"), enums_1 = require("../common/enums"), interpolateOtherAttrs = (attrs, out, ratio) => {
8
- attrs.forEach((entry => {
9
- if (Number.isFinite(entry.to)) out[entry.key] = entry.from + (entry.to - entry.from) * ratio; else if ("fill" === entry.key || "stroke" === entry.key) {
10
- const color = (0, interpolate_1.interpolateColor)(entry.from, entry.to, ratio, !1);
11
- color && (out[entry.key] = color);
12
- }
13
- }));
14
- }, interpolateMorphingData = (morphingData, path, ratio) => {
15
- const tmpArr = [], newCp = [];
16
- path.clear();
17
- for (let i = 0; i < morphingData.length; i++) {
18
- const item = morphingData[i], from = item.from, to = item.to, angle = item.rotation * ratio, fromCp = item.fromCp, toCp = item.toCp, sa = Math.sin(angle), ca = Math.cos(angle);
19
- newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio, newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;
20
- for (let m = 0; m < from.length; m += 2) {
21
- const x0 = from[m], y0 = from[m + 1], x = x0 * (1 - ratio) + to[m] * ratio, y = y0 * (1 - ratio) + to[m + 1] * ratio;
22
- tmpArr[m] = x * ca - y * sa + newCp[0], tmpArr[m + 1] = x * sa + y * ca + newCp[1];
23
- }
24
- let x0 = tmpArr[0], y0 = tmpArr[1];
25
- path.moveTo(x0, y0);
26
- for (let m = 2; m < from.length; m += 6) {
27
- const x1 = tmpArr[m], y1 = tmpArr[m + 1], x2 = tmpArr[m + 2], y2 = tmpArr[m + 3], x3 = tmpArr[m + 4], y3 = tmpArr[m + 5];
28
- x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3 ? path.lineTo(x3, y3) : path.bezierCurveTo(x1, y1, x2, y2, x3, y3),
29
- x0 = x3, y0 = y3;
30
- }
31
- }
32
- }, parseMorphingData = (fromPath, toPath, config) => {
33
- const fromBezier = fromPath ? (0, morphing_utils_1.pathToBezierCurves)(fromPath) : [], toBezier = (0,
34
- morphing_utils_1.pathToBezierCurves)(toPath);
35
- config && fromBezier && (config.fromTransform && (0, morphing_utils_1.applyTransformOnBezierCurves)(fromBezier, config.fromTransform.clone().getInverse()),
36
- (0, morphing_utils_1.applyTransformOnBezierCurves)(fromBezier, config.toTransfrom));
37
- const [fromBezierCurves, toBezierCurves] = (0, morphing_utils_1.alignBezierCurves)(fromBezier, toBezier);
38
- return fromPath ? (0, morphing_utils_1.findBestMorphingRotation)(fromBezierCurves, toBezierCurves, 10, Math.PI) : toBezierCurves.map(((to, index) => ({
39
- from: fromBezierCurves[index],
40
- to: to,
41
- fromCp: [ 0, 0 ],
42
- toCp: [ 0, 0 ],
43
- rotation: 0
44
- })));
45
- }, validateOtherAttrs = [ "fill", "fillOpacity", "shadowBlur", "shadowColor", "shadowOffsetX", "shadowOffsetY", "stroke", "strokeOpacity", "lineDashOffset" ], parseOtherAnimateAttrs = (fromAttrs, toAttrs) => {
46
- if (!fromAttrs || !toAttrs) return null;
47
- const res = [];
48
- let hasAttr = !1;
49
- return Object.keys(fromAttrs).forEach((fromKey => {
50
- if (!validateOtherAttrs.includes(fromKey)) return;
51
- const toValue = toAttrs[fromKey];
52
- (0, vutils_1.isNil)(toValue) || (0, vutils_1.isNil)(fromAttrs[fromKey]) || toValue === fromAttrs[fromKey] || ("fill" === fromKey || "stroke" === fromKey ? res.push({
53
- from: "string" == typeof fromAttrs[fromKey] ? color_string_1.ColorStore.Get(fromAttrs[fromKey], color_string_1.ColorType.Color255) : fromAttrs[fromKey],
54
- to: "string" == typeof toValue ? color_string_1.ColorStore.Get(toValue, color_string_1.ColorType.Color255) : toValue,
55
- key: fromKey
56
- }) : res.push({
57
- from: fromAttrs[fromKey],
58
- to: toValue,
59
- key: fromKey
60
- }), hasAttr = !0);
61
- })), hasAttr ? res : null;
62
- };
63
-
64
- class MorphingPath extends animate_1.ACustomAnimate {
65
- constructor(config, duration, easing) {
66
- super(0, 1, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs,
67
- this.saveOnEnd = config.saveOnEnd;
68
- }
69
- getEndProps() {
70
- return {};
71
- }
72
- onBind() {
73
- this.target.createPathProxy(), this.onUpdate(!1, 0, this.target.attribute);
74
- }
75
- onEnd() {}
76
- onUpdate(end, ratio, out) {
77
- const target = this.target, pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
78
- interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio),
79
- end && !this.saveOnEnd && (this.target.pathProxy = null);
80
- }
81
- }
82
-
83
- exports.MorphingPath = MorphingPath;
84
-
85
- const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
86
- var _a, _b, _c;
87
- if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) return __DEV__ && console.error(fromGraphic, " is not validate"),
88
- null;
89
- if (!toGraphic.valid || !toGraphic.toCustomPath) return __DEV__ && console.error(toGraphic, " is not validate"),
90
- null;
91
- let fromTransform = null == fromGraphic ? void 0 : fromGraphic.globalTransMatrix;
92
- fromGraphicTransform && fromTransform && (fromTransform = fromGraphicTransform.clone().multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f));
93
- const morphingData = parseMorphingData(null === (_a = null == fromGraphic ? void 0 : fromGraphic.toCustomPath) || void 0 === _a ? void 0 : _a.call(fromGraphic), toGraphic.toCustomPath(), {
94
- fromTransform: fromTransform,
95
- toTransfrom: toGraphic.globalTransMatrix
96
- }), attrs = parseOtherAnimateAttrs(null == fromGraphic ? void 0 : fromGraphic.attribute, toGraphic.attribute), animate = toGraphic.animate(animationConfig);
97
- return (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
98
- animate.play(new MorphingPath({
99
- morphingData: morphingData,
100
- otherAttrs: attrs
101
- }, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : config_1.DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : config_1.DefaultMorphingAnimateConfig.easing)),
102
- animate;
103
- };
104
-
105
- exports.morphPath = morphPath;
106
-
107
- const oneToMultiMorph = (fromGraphic, toGraphics, animationConfig) => {
108
- var _a;
109
- const validateToGraphics = toGraphics.filter((graphic => graphic && graphic.toCustomPath && graphic.valid));
110
- validateToGraphics.length || __DEV__ && console.error(validateToGraphics, " is not validate"),
111
- fromGraphic.valid && fromGraphic.toCustomPath || __DEV__ && console.error(fromGraphic, " is not validate");
112
- const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? exports.cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : exports.splitGraphic)(fromGraphic, validateToGraphics.length, !1), oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd;
113
- let count = validateToGraphics.length;
114
- const onEachEnd = () => {
115
- count--, 0 === count && oldOnEnd && oldOnEnd();
116
- };
117
- validateToGraphics.forEach(((toChild, index) => {
118
- var _a;
119
- const fromChild = childGraphics[index], delay = (null !== (_a = null == animationConfig ? void 0 : animationConfig.delay) && void 0 !== _a ? _a : 0) + ((null == animationConfig ? void 0 : animationConfig.individualDelay) ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild) : 0);
120
- (0, exports.morphPath)(fromChild, toChild, Object.assign({}, animationConfig, {
121
- onEnd: onEachEnd,
122
- delay: delay
123
- }), fromGraphic.globalTransMatrix);
124
- }));
125
- };
126
-
127
- exports.oneToMultiMorph = oneToMultiMorph;
128
-
129
- class MultiToOneMorphingPath extends animate_1.ACustomAnimate {
130
- constructor(config, duration, easing) {
131
- super(0, 1, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs;
132
- }
133
- getEndProps() {
134
- return {};
135
- }
136
- onBind() {
137
- this.addPathProxy();
138
- }
139
- addPathProxy() {
140
- this.target.shadowRoot.forEachChildren((child => {
141
- child.createPathProxy();
142
- })), this.onUpdate(!1, 0, this.target.attribute);
143
- }
144
- clearPathProxy() {
145
- this.target.shadowRoot.forEachChildren((child => {
146
- child.pathProxy = null;
147
- }));
148
- }
149
- onEnd() {}
150
- onUpdate(end, ratio, out) {
151
- this.target.shadowRoot.forEachChildren(((child, index) => {
152
- var _a;
153
- interpolateMorphingData(this.morphingData[index], "function" == typeof child.pathProxy ? child.pathProxy(child.attribute) : child.pathProxy, ratio),
154
- (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);
155
- })), end && (this.clearPathProxy(), this.morphingData = null);
156
- }
157
- }
158
-
159
- exports.MultiToOneMorphingPath = MultiToOneMorphingPath;
160
-
161
- const parseShadowChildAttrs = graphicAttrs => {
162
- const attrs = {};
163
- return Object.keys(graphicAttrs).forEach((key => {
164
- (0, utils_1.isTransformKey)(key) || (attrs[key] = graphicAttrs[key]);
165
- })), attrs;
166
- }, appendShadowChildrenToGraphic = (graphic, children, count) => {
167
- const childAttrs = parseShadowChildAttrs(graphic.attribute), shadowRoot = graphic.attachShadow();
168
- if (children.length) shadowRoot.setTheme({
169
- [children[0].type]: childAttrs
170
- }), children.forEach((element => {
171
- element.setAttributes({
172
- pickable: !1
173
- }), shadowRoot.appendChild(element);
174
- })); else {
175
- const box = graphic.AABBBounds, width = box.width(), height = box.height();
176
- shadowRoot.setTheme({
177
- rect: childAttrs
178
- }), new Array(count).fill(0).forEach((el => {
179
- const child = application_1.application.graphicService.creator.rect({
180
- x: 0,
181
- y: 0,
182
- width: width,
183
- height: height,
184
- pickable: !1
185
- });
186
- shadowRoot.appendChild(child), children.push(child);
187
- }));
188
- }
189
- }, cloneGraphic = (graphic, count, needAppend) => {
190
- const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute), path = graphic.toCustomPath();
191
- for (let i = 0; i < count; i++) {
192
- const element = {
193
- path: (new custom_path2d_1.CustomPath2D).fromCustomPath2D(path)
194
- };
195
- children.push(application_1.application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element)));
196
- }
197
- return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
198
- };
199
-
200
- exports.cloneGraphic = cloneGraphic;
201
-
202
- const splitGraphic = (graphic, count, needAppend) => {
203
- const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);
204
- if ("rect" === graphic.type) {
205
- (0, split_path_1.splitRect)(graphic, count).forEach((element => {
206
- children.push(application_1.application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element)));
207
- }));
208
- } else if ("arc" === graphic.type) {
209
- (0, split_path_1.splitArc)(graphic, count).forEach((element => {
210
- children.push(application_1.application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
211
- }));
212
- } else if ("circle" === graphic.type) {
213
- (0, split_path_1.splitCircle)(graphic, count).forEach((element => {
214
- children.push(application_1.application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
215
- }));
216
- } else if ("line" === graphic.type) {
217
- const childrenAttrs = (0, split_path_1.splitLine)(graphic, count), defaultSymbol = {
218
- size: 10,
219
- symbolType: "circle"
220
- };
221
- childrenAttrs.forEach((element => {
222
- children.push(application_1.application.graphicService.creator.symbol(needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)));
223
- }));
224
- } else if ("polygon" === graphic.type) {
225
- (0, split_path_1.splitPolygon)(graphic, count).forEach((element => {
226
- children.push(application_1.application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
227
- }));
228
- } else if ("area" === graphic.type) {
229
- (0, split_path_1.splitArea)(graphic, count).forEach((element => {
230
- children.push(application_1.application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
231
- }));
232
- } else if ("path" === graphic.type) {
233
- (0, split_path_1.splitPath)(graphic, count).forEach((element => {
234
- "path" in element ? children.push(application_1.application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))) : children.push(application_1.application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
235
- }));
236
- }
237
- return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
238
- };
239
-
240
- exports.splitGraphic = splitGraphic;
241
-
242
- const multiToOneMorph = (fromGraphics, toGraphic, animationConfig) => {
243
- var _a, _b, _c;
244
- const validateFromGraphics = fromGraphics.filter((graphic => graphic.toCustomPath && graphic.valid));
245
- validateFromGraphics.length || __DEV__ && console.error(fromGraphics, " is not validate"),
246
- toGraphic.valid && toGraphic.toCustomPath || __DEV__ && console.error(toGraphic, " is not validate");
247
- const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? exports.cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : exports.splitGraphic)(toGraphic, validateFromGraphics.length, !0), toAttrs = toGraphic.attribute;
248
- toGraphic.setAttribute("visible", !1);
249
- const morphingData = validateFromGraphics.map(((graphic, index) => parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {
250
- fromTransform: graphic.globalTransMatrix,
251
- toTransfrom: childGraphics[index].globalTransMatrix
252
- }))), otherAttrs = validateFromGraphics.map(((graphic, index) => parseOtherAnimateAttrs(graphic.attribute, toAttrs)));
253
- if (null == animationConfig ? void 0 : animationConfig.individualDelay) {
254
- const oldOnEnd = animationConfig.onEnd;
255
- let count = validateFromGraphics.length;
256
- const onEachEnd = () => {
257
- count--, 0 === count && (toGraphic.setAttributes({
258
- visible: !0,
259
- ratio: null
260
- }, !1, {
261
- type: enums_1.AttributeUpdateType.ANIMATE_END
262
- }), toGraphic.detachShadow(), oldOnEnd && oldOnEnd());
263
- };
264
- childGraphics.forEach(((to, index) => {
265
- var _a, _b, _c;
266
- const delay = (null !== (_a = animationConfig.delay) && void 0 !== _a ? _a : 0) + animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to), animate = to.animate(Object.assign({}, animationConfig, {
267
- onEnd: onEachEnd
268
- }));
269
- animate.wait(delay), animate.play(new MorphingPath({
270
- morphingData: morphingData[index],
271
- saveOnEnd: !0,
272
- otherAttrs: otherAttrs[index]
273
- }, null !== (_b = animationConfig.duration) && void 0 !== _b ? _b : config_1.DefaultMorphingAnimateConfig.duration, null !== (_c = animationConfig.easing) && void 0 !== _c ? _c : config_1.DefaultMorphingAnimateConfig.easing));
274
- }));
275
- } else {
276
- const oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd, config = animationConfig ? Object.assign({}, animationConfig) : {};
277
- config.onEnd = () => {
278
- toGraphic.setAttribute("visible", !0, !1, {
279
- type: enums_1.AttributeUpdateType.ANIMATE_END
280
- }), toGraphic.detachShadow(), oldOnEnd && oldOnEnd();
281
- };
282
- const animate = toGraphic.animate(config);
283
- (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
284
- animate.play(new MultiToOneMorphingPath({
285
- morphingData: morphingData,
286
- otherAttrs: otherAttrs
287
- }, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : config_1.DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : config_1.DefaultMorphingAnimateConfig.easing));
288
- }
289
- };
290
-
291
- exports.multiToOneMorph = multiToOneMorph;
292
- //# sourceMappingURL=morphing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animate/morphing.ts"],"names":[],"mappings":";;;AAAA,uDAQgC;AAgBhC,2DAAuD;AACvD,uCAA2C;AAC3C,6DAKkC;AAClC,gDAA6C;AAE7C,6CAAyC;AACzC,6DAA+D;AAC/D,kDAAwD;AACxD,qCAAwD;AACxD,2CAAiD;AACjD,2CAAsD;AAkBtD,MAAM,qBAAqB,GAAG,CAAC,KAAsB,EAAE,GAAQ,EAAE,KAAa,EAAE,EAAE;IAChF,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACpB,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YAC7B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;SAC/D;aAAM,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;YAEzD,MAAM,KAAK,GAAG,IAAA,8BAAgB,EAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACnE,IAAI,KAAK,EAAE;gBACT,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACxB;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAUF,MAAM,uBAAuB,GAAG,CAAC,YAAgC,EAAE,IAAmB,EAAE,KAAa,EAAE,EAAE;IACvG,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,KAAK,EAAE,CAAC;IAEb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,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AAO,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE;YAC1B,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,CAAC,IAAI,CACV,IAAI,sBAAsB,CACxB,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,mCAAI,qCAA4B,CAAC,QAAQ,EAClE,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,mCAAI,qCAA4B,CAAC,MAAM,CAC/D,CACF,CAAC;KACH;AACH,CAAC,CAAC;AAhGW,QAAA,eAAe,mBAgG1B","file":"morphing.js","sourcesContent":["import {\n splitArc,\n splitCircle,\n splitLine,\n splitRect,\n splitPolygon,\n splitArea,\n splitPath\n} from './../common/split-path';\nimport type {\n ICustomPath2D,\n IGraphic,\n MorphingAnimateConfig,\n IRect,\n EasingType,\n MultiMorphingAnimateConfig,\n IArc,\n ICircle,\n IGraphicAttribute,\n ILine,\n IPolygon,\n IArea,\n IPath\n} from './../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ACustomAnimate } from './animate';\nimport {\n alignBezierCurves,\n applyTransformOnBezierCurves,\n findBestMorphingRotation,\n pathToBezierCurves\n} from '../common/morphing-utils';\nimport { application } from '../application';\nimport type { IMatrix } from '@visactor/vutils';\nimport { isNil } from '@visactor/vutils';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { ColorStore, ColorType } from '../color-string';\nimport { DefaultMorphingAnimateConfig } from './config';\nimport { isTransformKey } from '../common/utils';\nimport { AttributeUpdateType } from '../common/enums';\n\ndeclare const __DEV__: boolean;\n\ninterface MorphingDataItem {\n from: number[];\n to: number[];\n fromCp: number[];\n toCp: number[];\n rotation: number;\n}\n\ninterface OtherAttrItem {\n from: any;\n to: any;\n key: string;\n}\n\nconst interpolateOtherAttrs = (attrs: OtherAttrItem[], out: any, ratio: number) => {\n attrs.forEach(entry => {\n if (Number.isFinite(entry.to)) {\n out[entry.key] = entry.from + (entry.to - entry.from) * ratio;\n } else if (entry.key === 'fill' || entry.key === 'stroke') {\n // 保存解析的结果到step\n const color = interpolateColor(entry.from, entry.to, ratio, false);\n if (color) {\n out[entry.key] = color;\n }\n }\n });\n};\n\n/* Adapted from zrender by ecomfe\n * https://github.com/ecomfe/zrender\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/ecomfe/zrender/blob/master/src/tool/morphPath.ts\n * License: https://github.com/ecomfe/zrender/blob/master/LICENSE\n * @license\n */\nconst interpolateMorphingData = (morphingData: MorphingDataItem[], path: ICustomPath2D, ratio: number) => {\n const tmpArr: number[] = [];\n const newCp: number[] = [];\n path.clear();\n\n for (let i = 0; i < morphingData.length; i++) {\n const item = morphingData[i];\n const from = item.from;\n const to = item.to;\n const angle = item.rotation * ratio;\n const fromCp = item.fromCp;\n const toCp = item.toCp;\n const sa = Math.sin(angle);\n const ca = Math.cos(angle);\n\n newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio;\n newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;\n\n for (let m = 0; m < from.length; m += 2) {\n const x0 = from[m];\n const y0 = from[m + 1];\n const x1 = to[m];\n const y1 = to[m + 1];\n\n const x = x0 * (1 - ratio) + x1 * ratio;\n const y = y0 * (1 - ratio) + y1 * ratio;\n\n tmpArr[m] = x * ca - y * sa + newCp[0];\n tmpArr[m + 1] = x * sa + y * ca + newCp[1];\n }\n\n let x0 = tmpArr[0];\n let y0 = tmpArr[1];\n\n path.moveTo(x0, y0);\n\n for (let m = 2; m < from.length; m += 6) {\n const x1 = tmpArr[m];\n const y1 = tmpArr[m + 1];\n const x2 = tmpArr[m + 2];\n const y2 = tmpArr[m + 3];\n const x3 = tmpArr[m + 4];\n const y3 = tmpArr[m + 5];\n\n // Is a line.\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n } else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n};\n\nconst parseMorphingData = (\n fromPath: ICustomPath2D | null,\n toPath: ICustomPath2D,\n config?: {\n fromTransform?: IMatrix;\n toTransfrom: IMatrix;\n }\n) => {\n const fromBezier = fromPath ? pathToBezierCurves(fromPath) : [];\n const toBezier = pathToBezierCurves(toPath);\n\n if (config && fromBezier) {\n config.fromTransform && applyTransformOnBezierCurves(fromBezier, config.fromTransform.clone().getInverse());\n applyTransformOnBezierCurves(fromBezier, config.toTransfrom);\n // applyTransformOnBezierCurves(toBezier, config.toTransfrom.clone().getInverse());\n }\n\n const [fromBezierCurves, toBezierCurves] = alignBezierCurves(fromBezier, toBezier);\n\n return fromPath\n ? findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI)\n : toBezierCurves.map((to, index) => {\n return {\n from: fromBezierCurves[index],\n to,\n fromCp: [0, 0],\n toCp: [0, 0],\n rotation: 0\n };\n });\n};\n\nconst validateOtherAttrs = [\n 'fill',\n 'fillOpacity',\n 'shadowBlur',\n 'shadowColor',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'stroke',\n 'strokeOpacity',\n 'lineDashOffset'\n // 'lineWidth'\n];\n\nconst parseOtherAnimateAttrs = (\n fromAttrs: Partial<IGraphicAttribute> | null,\n toAttrs: Partial<IGraphicAttribute> | null\n) => {\n if (!fromAttrs || !toAttrs) {\n return null;\n }\n const res: OtherAttrItem[] = [];\n let hasAttr = false;\n\n Object.keys(fromAttrs).forEach(fromKey => {\n if (!validateOtherAttrs.includes(fromKey)) {\n return;\n }\n\n const toValue = toAttrs[fromKey];\n if (!isNil(toValue) && !isNil(fromAttrs[fromKey]) && toValue !== fromAttrs[fromKey]) {\n if (fromKey === 'fill' || fromKey === 'stroke') {\n res.push({\n from:\n typeof fromAttrs[fromKey] === 'string'\n ? ColorStore.Get(fromAttrs[fromKey] as unknown as string, ColorType.Color255)\n : fromAttrs[fromKey],\n to: typeof toValue === 'string' ? ColorStore.Get(toValue as string, ColorType.Color255) : toValue,\n key: fromKey\n });\n } else {\n res.push({ from: fromAttrs[fromKey], to: toValue, key: fromKey });\n }\n\n hasAttr = true;\n }\n });\n\n return hasAttr ? res : null;\n};\n\nexport class MorphingPath extends ACustomAnimate<number> {\n declare path: CustomPath2D;\n\n saveOnEnd?: boolean;\n otherAttrs?: OtherAttrItem[];\n\n constructor(\n config: { morphingData: MorphingDataItem[]; otherAttrs?: OtherAttrItem[]; saveOnEnd?: boolean },\n duration: number,\n easing: EasingType\n ) {\n super(0, 1, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n this.saveOnEnd = config.saveOnEnd;\n }\n\n private morphingData?: MorphingDataItem[];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n (this.target as IGraphic).createPathProxy();\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const target = this.target as IGraphic;\n const pathProxy = typeof target.pathProxy === 'function' ? target.pathProxy(target.attribute) : target.pathProxy;\n interpolateMorphingData(this.morphingData, pathProxy, ratio);\n if (this.otherAttrs && this.otherAttrs.length) {\n interpolateOtherAttrs(this.otherAttrs, out, ratio);\n }\n // 计算位置\n if (end && !this.saveOnEnd) {\n (this.target as IGraphic).pathProxy = null;\n }\n }\n}\n\nexport const morphPath = (\n fromGraphic: IGraphic | null,\n toGraphic: IGraphic,\n animationConfig?: MorphingAnimateConfig,\n fromGraphicTransform?: IMatrix\n) => {\n if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n return null;\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n return null;\n }\n\n let fromTransform = fromGraphic?.globalTransMatrix;\n\n if (fromGraphicTransform && fromTransform) {\n fromTransform = fromGraphicTransform\n .clone()\n .multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f);\n }\n const morphingData = parseMorphingData(fromGraphic?.toCustomPath?.(), toGraphic.toCustomPath(), {\n fromTransform,\n toTransfrom: toGraphic.globalTransMatrix\n });\n\n const attrs = parseOtherAnimateAttrs(fromGraphic?.attribute, toGraphic.attribute);\n const animate = toGraphic.animate(animationConfig);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MorphingPath(\n { morphingData, otherAttrs: attrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n\n return animate;\n};\n\nexport const oneToMultiMorph = (\n fromGraphic: IGraphic,\n toGraphics: IGraphic[],\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateToGraphics = toGraphics.filter(graphic => graphic && graphic.toCustomPath && graphic.valid);\n if (!validateToGraphics.length) {\n if (__DEV__) {\n console.error(validateToGraphics, ' is not validate');\n }\n }\n\n if (!fromGraphic.valid || !fromGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(fromGraphic, validateToGraphics.length, false);\n\n const oldOnEnd = animationConfig?.onEnd;\n let count = validateToGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0 && oldOnEnd) {\n oldOnEnd();\n }\n };\n\n validateToGraphics.forEach((toChild, index) => {\n const fromChild = childGraphics[index];\n const delay =\n (animationConfig?.delay ?? 0) +\n (animationConfig?.individualDelay\n ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild)\n : 0);\n morphPath(\n fromChild,\n toChild,\n Object.assign({}, animationConfig, { onEnd: onEachEnd, delay }),\n fromGraphic.globalTransMatrix\n );\n });\n};\n\nexport class MultiToOneMorphingPath extends ACustomAnimate<number> {\n declare path: CustomPath2D;\n\n otherAttrs?: OtherAttrItem[][];\n\n constructor(\n config: { morphingData: MorphingDataItem[][]; otherAttrs?: OtherAttrItem[][] },\n duration: number,\n easing: EasingType\n ) {\n super(0, 1, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n }\n\n private morphingData?: MorphingDataItem[][];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.addPathProxy();\n }\n\n private addPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).createPathProxy();\n });\n\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n private clearPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).pathProxy = null;\n });\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren((child: IGraphic, index) => {\n interpolateMorphingData(\n this.morphingData[index],\n typeof child.pathProxy === 'function' ? child.pathProxy(child.attribute) : child.pathProxy,\n ratio\n );\n\n if (this.otherAttrs?.[index] && this.otherAttrs[index].length) {\n interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);\n }\n });\n\n // 计算位置\n if (end) {\n this.clearPathProxy();\n this.morphingData = null;\n }\n }\n}\n\nconst parseShadowChildAttrs = (graphicAttrs: Partial<IGraphicAttribute>) => {\n const attrs: Partial<IGraphicAttribute> = {};\n\n Object.keys(graphicAttrs).forEach(key => {\n if (!isTransformKey(key)) {\n attrs[key] = graphicAttrs[key];\n }\n });\n\n // if (attrs.fill == null) {\n // attrs.fill = !!attrs.fillColor;\n // }\n // if (attrs.stroke == null) {\n // attrs.stroke = !!attrs.strokeColor;\n // }\n\n return attrs;\n};\n\nconst appendShadowChildrenToGraphic = (graphic: IGraphic, children: IGraphic[], count: number) => {\n const childAttrs = parseShadowChildAttrs(graphic.attribute);\n const shadowRoot = graphic.attachShadow();\n\n if (children.length) {\n shadowRoot.setTheme({\n [children[0].type]: childAttrs\n });\n children.forEach(element => {\n element.setAttributes({ pickable: false });\n shadowRoot.appendChild(element);\n });\n } else {\n const box = graphic.AABBBounds;\n const width = box.width();\n const height = box.height();\n\n shadowRoot.setTheme({\n rect: childAttrs\n });\n new Array(count).fill(0).forEach(el => {\n const child = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width,\n height: height,\n pickable: false\n });\n shadowRoot.appendChild(child);\n children.push(child);\n });\n }\n};\n\nexport const cloneGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n const path = graphic.toCustomPath();\n\n for (let i = 0; i < count; i++) {\n const element = {\n path: new CustomPath2D().fromCustomPath2D(path)\n };\n\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\nexport const splitGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n\n if (graphic.type === 'rect') {\n const childrenAttrs = splitRect(graphic as IRect, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'arc') {\n const childrenAttrs = splitArc(graphic as IArc, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'circle') {\n const childrenAttrs = splitCircle(graphic as ICircle, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'line') {\n const childrenAttrs = splitLine(graphic as ILine, count);\n const defaultSymbol = { size: 10, symbolType: 'circle' };\n\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.symbol(\n needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)\n )\n );\n });\n } else if (graphic.type === 'polygon') {\n const childrenAttrs = splitPolygon(graphic as IPolygon, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'area') {\n const childrenAttrs = splitArea(graphic as IArea, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'path') {\n const childrenAttrs = splitPath(graphic as IPath, count);\n childrenAttrs.forEach(element => {\n if ('path' in element) {\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n } else {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n });\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\n/**\n * 多对一动画\n * @param fromGraphics\n * @param toGraphic\n * @param animationConfig\n */\nexport const multiToOneMorph = (\n fromGraphics: IGraphic[],\n toGraphic: IGraphic,\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateFromGraphics = fromGraphics.filter(graphic => graphic.toCustomPath && graphic.valid);\n if (!validateFromGraphics.length) {\n if (__DEV__) {\n console.error(fromGraphics, ' is not validate');\n }\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(toGraphic, validateFromGraphics.length, true);\n\n const toAttrs = toGraphic.attribute;\n toGraphic.setAttribute('visible', false);\n\n const morphingData = validateFromGraphics.map((graphic, index) => {\n return parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {\n fromTransform: graphic.globalTransMatrix,\n toTransfrom: childGraphics[index].globalTransMatrix\n });\n });\n const otherAttrs = validateFromGraphics.map((graphic, index) => {\n return parseOtherAnimateAttrs(graphic.attribute, toAttrs);\n });\n\n if (animationConfig?.individualDelay) {\n const oldOnEnd = animationConfig.onEnd;\n let count = validateFromGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0) {\n toGraphic.setAttributes({ visible: true, ratio: null } as any, false, {\n type: AttributeUpdateType.ANIMATE_END\n });\n toGraphic.detachShadow();\n if (oldOnEnd) {\n oldOnEnd();\n }\n }\n };\n childGraphics.forEach((to, index) => {\n const delay =\n (animationConfig.delay ?? 0) +\n animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to);\n const animate = to.animate(Object.assign({}, animationConfig, { onEnd: onEachEnd }));\n animate.wait(delay);\n\n animate.play(\n new MorphingPath(\n {\n morphingData: morphingData[index],\n saveOnEnd: true,\n otherAttrs: otherAttrs[index]\n },\n animationConfig.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n });\n } else {\n const oldOnEnd = animationConfig?.onEnd;\n const config = animationConfig ? Object.assign({}, animationConfig) : {};\n\n config.onEnd = () => {\n toGraphic.setAttribute('visible', true, false, { type: AttributeUpdateType.ANIMATE_END });\n toGraphic.detachShadow();\n\n if (oldOnEnd) {\n oldOnEnd();\n }\n };\n\n const animate = toGraphic.animate(config);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MultiToOneMorphingPath(\n { morphingData, otherAttrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n }\n};\n"]}
@@ -1,17 +0,0 @@
1
- import type { IAnimate, ITimeline } from '../interface';
2
- export declare class DefaultTimeline implements ITimeline {
3
- id: number;
4
- protected animateHead: IAnimate | null;
5
- protected animateTail: IAnimate | null;
6
- protected ticker: any;
7
- animateCount: number;
8
- protected paused: boolean;
9
- constructor();
10
- addAnimate(animate: IAnimate): void;
11
- pause(): void;
12
- resume(): void;
13
- tick(delta: number): void;
14
- clear(): void;
15
- removeAnimate(animate: IAnimate, release?: boolean): void;
16
- }
17
- export declare const defaultTimeline: DefaultTimeline;
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.defaultTimeline = exports.DefaultTimeline = void 0;
6
-
7
- const enums_1 = require("../common/enums"), generator_1 = require("../common/generator");
8
-
9
- class DefaultTimeline {
10
- constructor() {
11
- this.id = generator_1.Generator.GenAutoIncrementId(), this.animateHead = null, this.animateTail = null,
12
- this.animateCount = 0, this.paused = !1;
13
- }
14
- addAnimate(animate) {
15
- this.animateTail ? (this.animateTail.nextAnimate = animate, animate.prevAnimate = this.animateTail,
16
- this.animateTail = animate, animate.nextAnimate = null) : (this.animateHead = animate,
17
- this.animateTail = animate), this.animateCount++;
18
- }
19
- pause() {
20
- this.paused = !0;
21
- }
22
- resume() {
23
- this.paused = !1;
24
- }
25
- tick(delta) {
26
- if (this.paused) return;
27
- let animate = this.animateHead;
28
- for (this.animateCount = 0; animate; ) animate.status === enums_1.AnimateStatus.END ? this.removeAnimate(animate) : animate.status === enums_1.AnimateStatus.RUNNING || animate.status === enums_1.AnimateStatus.INITIAL ? (this.animateCount++,
29
- animate.advance(delta)) : animate.status === enums_1.AnimateStatus.PAUSED && this.animateCount++,
30
- animate = animate.nextAnimate;
31
- }
32
- clear() {
33
- let animate = this.animateHead;
34
- for (;animate; ) animate.release(), animate = animate.nextAnimate;
35
- this.animateHead = null, this.animateTail = null, this.animateCount = 0;
36
- }
37
- removeAnimate(animate, release = !0) {
38
- animate._onRemove && animate._onRemove.forEach((cb => cb())), animate === this.animateHead ? (this.animateHead = animate.nextAnimate,
39
- animate === this.animateTail ? this.animateTail = null : this.animateHead.prevAnimate = null) : animate === this.animateTail ? (this.animateTail = animate.prevAnimate,
40
- this.animateTail.nextAnimate = null) : (animate.prevAnimate.nextAnimate = animate.nextAnimate,
41
- animate.nextAnimate.prevAnimate = animate.prevAnimate), release && animate.release();
42
- }
43
- }
44
-
45
- exports.DefaultTimeline = DefaultTimeline, exports.defaultTimeline = new DefaultTimeline;
46
- //# sourceMappingURL=timeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animate/timeline.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAChD,mDAAgD;AAIhD,MAAa,eAAe;IAQ1B;QACE,IAAI,CAAC,EAAE,GAAG,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,UAAU,CAAC,OAAiB;QAC1B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACrB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;SAC5B;aAAM;YACL,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC;YACvC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YACvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;YAC3B,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;SAC5B;QACD,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,IAA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AAI,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE;YAChC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACvC,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE;gBAEhC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aACzB;iBAAM;gBAEL,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;aACrC;SACF;aAAM,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE;YAEvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACvC,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;SAErC;aAAM;YACL,OAAO,CAAC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACtD,OAAO,CAAC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;SAIvD;QACD,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAE7B,OAAO;IACT,CAAC;CACF;AA9FD,0CA8FC;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","file":"timeline.js","sourcesContent":["import { AnimateStatus } from '../common/enums';\nimport { Generator } from '../common/generator';\nimport type { IAnimate, ITimeline } from '../interface';\n\n// 管理一组动画\nexport class DefaultTimeline implements ITimeline {\n declare id: number;\n protected declare animateHead: IAnimate | null;\n protected declare animateTail: IAnimate | null;\n protected declare ticker: any;\n declare animateCount: number;\n protected declare paused: boolean;\n\n constructor() {\n this.id = Generator.GenAutoIncrementId();\n this.animateHead = null;\n this.animateTail = null;\n this.animateCount = 0;\n this.paused = false;\n }\n\n addAnimate(animate: IAnimate) {\n if (!this.animateTail) {\n this.animateHead = animate;\n this.animateTail = animate;\n } else {\n this.animateTail.nextAnimate = animate;\n animate.prevAnimate = this.animateTail;\n this.animateTail = animate;\n animate.nextAnimate = null;\n }\n this.animateCount++;\n }\n\n pause() {\n this.paused = true;\n }\n resume() {\n this.paused = false;\n }\n\n tick(delta: number) {\n if (this.paused) {\n return;\n }\n let animate = this.animateHead;\n this.animateCount = 0;\n while (animate) {\n if (animate.status === AnimateStatus.END) {\n this.removeAnimate(animate);\n } else if (animate.status === AnimateStatus.RUNNING || animate.status === AnimateStatus.INITIAL) {\n this.animateCount++;\n animate.advance(delta);\n } else if (animate.status === AnimateStatus.PAUSED) {\n // 暂停\n this.animateCount++;\n }\n animate = animate.nextAnimate;\n }\n }\n\n clear() {\n let animate = this.animateHead;\n while (animate) {\n animate.release();\n animate = animate.nextAnimate;\n }\n this.animateHead = null;\n this.animateTail = null;\n this.animateCount = 0;\n }\n\n removeAnimate(animate: IAnimate, release: boolean = true) {\n animate._onRemove && animate._onRemove.forEach(cb => cb());\n if (animate === this.animateHead) {\n this.animateHead = animate.nextAnimate;\n if (animate === this.animateTail) {\n // 只有一个元素\n this.animateTail = null;\n } else {\n // 有多个元素\n this.animateHead.prevAnimate = null;\n }\n } else if (animate === this.animateTail) {\n // 有多个元素\n this.animateTail = animate.prevAnimate;\n this.animateTail.nextAnimate = null;\n // animate.prevAnimate = null;\n } else {\n animate.prevAnimate.nextAnimate = animate.nextAnimate;\n animate.nextAnimate.prevAnimate = animate.prevAnimate;\n // animate不支持二次复用,不需要重置\n // animate.prevAnimate = null;\n // animate.nextAnimate = null;\n }\n release && animate.release();\n\n return;\n }\n}\n\nexport const defaultTimeline = new DefaultTimeline();\n"]}
@@ -1,3 +0,0 @@
1
-
2
-
3
- //# sourceMappingURL=richtext-edit-plugin-old.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/richtext-edit-plugin-old.ts"],"names":[],"mappings":"","file":"richtext-edit-plugin-old.js","sourcesContent":["// import type { IPointLike } from '@visactor/vutils';\n// import { isObject, isString, max, merge } from '@visactor/vutils';\n// import { Generator } from '../../common/generator';\n// import { createGroup, createLine, createRect } from '../../graphic';\n// import type {\n// IGroup,\n// ILine,\n// IPlugin,\n// IPluginService,\n// IRect,\n// IRichText,\n// IRichTextCharacter,\n// IRichTextFrame,\n// IRichTextIcon,\n// IRichTextLine,\n// IRichTextParagraph,\n// IRichTextParagraphCharacter,\n// ITicker,\n// ITimeline\n// } from '../../interface';\n// import { EditModule, findCursorIndexIgnoreLinebreak } from './edit-module';\n// import { Animate, DefaultTicker, DefaultTimeline } from '../../animate';\n\n// type UpdateType = 'input' | 'change' | 'onfocus' | 'defocus' | 'selection' | 'dispatch';\n\n// class Selection {\n// cacheSelectionStartCursorIdx: number;\n// cacheCurCursorIdx: number;\n// selectionStartCursorIdx: number;\n// curCursorIdx: number;\n// rt: IRichText;\n\n// constructor(\n// cacheSelectionStartCursorIdx: number,\n// cacheCurCursorIdx: number,\n// selectionStartCursorIdx: number,\n// curCursorIdx: number,\n// rt: IRichText\n// ) {\n// this.curCursorIdx = curCursorIdx;\n// this.selectionStartCursorIdx = selectionStartCursorIdx;\n// this.cacheCurCursorIdx = cacheCurCursorIdx;\n// this.cacheSelectionStartCursorIdx = cacheSelectionStartCursorIdx;\n// this.rt = rt;\n// }\n\n// isEmpty(): boolean {\n// return this.selectionStartCursorIdx === this.curCursorIdx;\n// }\n\n// hasFormat(key: string): boolean {\n// return this.getFormat(key) != null;\n// }\n\n// /**\n// * 获取第idx中key的值\n// * @param key\n// * @param idx cursor左侧字符的值,如果idx为-1则认为是特殊情况,为右侧字符的值\n// */\n// _getFormat(key: string, idx: number) {\n// if (!this.rt) {\n// return null;\n// }\n// const config = this.rt.attribute.textConfig as any;\n// if (idx < 0) {\n// idx = 0;\n// }\n// if (idx >= config.length) {\n// return null;\n// }\n// return config[idx][key] ?? (this.rt.attribute as any)[key];\n// }\n// getFormat(key: string): any {\n// return this.getAllFormat(key)[0];\n// }\n\n// getAllFormat(key: string): any {\n// const valSet = new Set();\n// let minCursorIdx = Math.min(this.selectionStartCursorIdx, this.curCursorIdx);\n// let maxCursorIdx = Math.max(this.selectionStartCursorIdx, this.curCursorIdx);\n// if (minCursorIdx === maxCursorIdx) {\n// return [this._getFormat(key, minCursorIdx)];\n// }\n// minCursorIdx++;\n// maxCursorIdx++;\n// const maxConfigIdx = this.rt.attribute.textConfig.length - 1;\n// if (minCursorIdx > maxConfigIdx) {\n// minCursorIdx = maxConfigIdx;\n// }\n// if (maxCursorIdx > maxConfigIdx) {\n// maxCursorIdx = maxConfigIdx;\n// }\n// for (let i = minCursorIdx; i < maxCursorIdx; i++) {\n// const val = this._getFormat(key, i);\n// val && valSet.add(val);\n// }\n// return Array.from(valSet.values());\n// }\n// }\n\n// export const FORMAT_TEXT_COMMAND = 'FORMAT_TEXT_COMMAND';\n// export const FORMAT_ELEMENT_COMMAND = 'FORMAT_ELEMENT_COMMAND';\n// export class RichTextEditPlugin implements IPlugin {\n// name: 'RichTextEditPlugin' = 'RichTextEditPlugin';\n// activeEvent: 'onRegister' = 'onRegister';\n// pluginService: IPluginService;\n// _uid: number = Generator.GenAutoIncrementId();\n// key: string = this.name + this._uid;\n// editing: boolean = false;\n// editLine: ILine;\n// editBg: IGroup;\n// pointerDown: boolean = false;\n// // 用于selection中保存上一次click时候的位置\n// lastPoint?: IPointLike;\n// editModule: EditModule;\n// currRt: IRichText;\n\n// // 当前的cursor信息\n// // 0.1为第一个字符右侧, -0.1为第一个字符左侧\n// // 1.1为第二个字符右侧,0.9为第二个字符左侧\n// curCursorIdx: number;\n// selectionStartCursorIdx: number;\n\n// commandCbs: Map<string, Array<(payload: any, p: RichTextEditPlugin) => void>>;\n// updateCbs: Array<(type: UpdateType, p: RichTextEditPlugin) => void>;\n\n// ticker: ITicker;\n// timeline: ITimeline;\n\n// // 富文本有align或者baseline的时候,需要对光标做偏移\n// protected declare deltaX: number;\n// protected declare deltaY: number;\n\n// constructor() {\n// this.commandCbs = new Map();\n// this.commandCbs.set(FORMAT_TEXT_COMMAND, [this.formatTextCommandCb]);\n// this.updateCbs = [];\n// this.timeline = new DefaultTimeline();\n// this.ticker = new DefaultTicker([this.timeline]);\n// this.deltaX = 0;\n// this.deltaY = 0;\n// }\n\n// static CreateSelection(rt: IRichText) {\n// if (!rt) {\n// return null;\n// }\n// const { textConfig = [] } = rt.attribute;\n// return new Selection(\n// -1,\n// textConfig.length - 1,\n// findCursorIndexIgnoreLinebreak(textConfig, -1),\n// findCursorIndexIgnoreLinebreak(textConfig, textConfig.length - 1),\n// rt\n// );\n// }\n\n// /**\n// * 获取当前选择的区间范围\n// * @param defaultAll 如果force为true,又没有选择,则认为选择了所有然后进行匹配,如果为false,则认为什么都没有选择,返回null\n// * @returns\n// */\n// getSelection(defaultAll: boolean = false) {\n// if (!this.currRt) {\n// return null;\n// }\n// if (\n// this.selectionStartCursorIdx != null &&\n// this.curCursorIdx != null\n// // this.selectionStartCursorIdx !== this.curCursorIdx &&\n// ) {\n// return new Selection(\n// this.selectionStartCursorIdx,\n// this.curCursorIdx,\n// findCursorIndexIgnoreLinebreak(this.currRt.attribute.textConfig, this.selectionStartCursorIdx),\n// findCursorIndexIgnoreLinebreak(this.currRt.attribute.textConfig, this.curCursorIdx),\n// this.currRt\n// );\n// } else if (defaultAll) {\n// return RichTextEditPlugin.CreateSelection(this.currRt);\n// }\n// return null;\n// }\n\n// /* command */\n// formatTextCommandCb(payload: string, p: RichTextEditPlugin) {\n// const rt = p.currRt;\n// if (!rt) {\n// return;\n// }\n// const selectionData = p.getSelection();\n// if (!selectionData) {\n// return;\n// }\n// const { selectionStartCursorIdx, curCursorIdx } = selectionData;\n// const minCursorIdx = Math.min(selectionStartCursorIdx, curCursorIdx);\n// const maxCursorIdx = Math.max(selectionStartCursorIdx, curCursorIdx);\n// const config = rt.attribute.textConfig.slice(minCursorIdx + 1, maxCursorIdx + 1);\n// if (payload === 'bold') {\n// config.forEach((item: IRichTextParagraphCharacter) => (item.fontWeight = 'bold'));\n// } else if (payload === 'italic') {\n// config.forEach((item: IRichTextParagraphCharacter) => (item.fontStyle = 'italic'));\n// } else if (payload === 'underline') {\n// config.forEach((item: IRichTextParagraphCharacter) => (item.underline = true));\n// } else if (payload === 'lineThrough') {\n// config.forEach((item: IRichTextParagraphCharacter) => (item.lineThrough = true));\n// } else if (isObject(payload)) {\n// config.forEach((item: IRichTextParagraphCharacter) => merge(item, payload));\n// }\n// rt.setAttributes(rt.attribute);\n// }\n\n// dispatchCommand(command: string, payload: any) {\n// const cbs = this.commandCbs.get(command);\n// cbs && cbs.forEach(cb => cb(payload, this));\n// this.updateCbs.forEach(cb => cb('dispatch', this));\n// }\n\n// registerCommand(command: string, cb: (payload: any, p: RichTextEditPlugin) => void) {\n// const cbs: Array<(payload: any, p: RichTextEditPlugin) => void> = this.commandCbs.get(command) || [];\n// cbs.push(cb);\n// }\n\n// registerUpdateListener(cb: (type: UpdateType, p: RichTextEditPlugin) => void) {\n// const cbs = this.updateCbs || [];\n// cbs.push(cb);\n// }\n\n// activate(context: IPluginService): void {\n// this.pluginService = context;\n// this.editModule = new EditModule();\n// // context.stage.on('click', this.handleClick);\n// context.stage.on('pointermove', this.handleMove);\n// context.stage.on('pointerdown', this.handlePointerDown);\n// context.stage.on('pointerup', this.handlePointerUp);\n// context.stage.on('pointerleave', this.handlePointerUp);\n\n// this.editModule.onInput(this.handleInput);\n// this.editModule.onChange(this.handleChange);\n// }\n\n// handleInput = (text: string, isComposing: boolean, cursorIdx: number, rt: IRichText, orient: 'left' | 'right') => {\n// // 修改cursor的位置,但并不同步,因为这可能是临时的\n// const p = this.getPointByColumnIdx(cursorIdx, rt, orient);\n// this.hideSelection();\n// this.setCursor(p.x, p.y1, p.y2);\n// this.updateCbs.forEach(cb => cb('input', this));\n// };\n// handleChange = (text: string, isComposing: boolean, cursorIdx: number, rt: IRichText, orient: 'left' | 'right') => {\n// // 修改cursor的位置,并同步到editModule\n// const p = this.getPointByColumnIdx(cursorIdx, rt, orient);\n// this.curCursorIdx = cursorIdx;\n// this.selectionStartCursorIdx = cursorIdx;\n// this.setCursorAndTextArea(p.x, p.y1, p.y2, rt);\n// this.hideSelection();\n// this.updateCbs.forEach(cb => cb('change', this));\n// };\n\n// handleMove = (e: PointerEvent) => {\n// if (!this.isRichtext(e)) {\n// return;\n// }\n// this.currRt = e.target as IRichText;\n// this.handleEnter(e);\n// (e.target as any).once('pointerleave', this.handleLeave);\n\n// this.showSelection(e);\n// };\n\n// showSelection(e: PointerEvent) {\n// const cache = (e.target as IRichText).getFrameCache();\n// if (!(cache && this.editBg)) {\n// return;\n// }\n// if (this.pointerDown) {\n// let p0 = this.lastPoint;\n// // 计算p1在字符中的位置\n// let p1 = this.getEventPosition(e);\n// let line1Info = this.getLineByPoint(cache, p1);\n// if (!line1Info) {\n// return;\n// }\n// const column1 = this.getColumnByLinePoint(line1Info, p1);\n// const y1 = line1Info.top;\n// const y2 = line1Info.top + line1Info.height;\n// let x = column1.left + column1.width;\n// let cursorIndex = this.getColumnIndex(cache, column1);\n// if (p1.x < column1.left + column1.width / 2) {\n// x = column1.left;\n// cursorIndex -= 1;\n// }\n// p1.x = x;\n// p1.y = (y1 + y2) / 2;\n// let line0Info = this.getLineByPoint(cache, p0);\n// if (p0.y > p1.y || (p0.y === p1.y && p0.x > p1.x)) {\n// [p0, p1] = [p1, p0];\n// [line1Info, line0Info] = [line0Info, line1Info];\n// }\n\n// this.editBg.removeAllChild();\n// if (line0Info === line1Info) {\n// // const column0 = this.getColumnByLinePoint(line0Info, p0);\n// this.editBg.setAttributes({\n// x: p0.x,\n// y: line0Info.top,\n// width: p1.x - p0.x,\n// height: line0Info.height,\n// fill: '#336df4',\n// fillOpacity: 0.2\n// });\n// } else {\n// this.editBg.setAttributes({ x: 0, y: line0Info.top, width: 0, height: 0 });\n// const startIdx = cache.lines.findIndex(item => item === line0Info);\n// const endIdx = cache.lines.findIndex(item => item === line1Info);\n// let y = 0;\n// for (let i = startIdx; i <= endIdx; i++) {\n// const line = cache.lines[i];\n// if (i === startIdx) {\n// const p = line.paragraphs[line.paragraphs.length - 1];\n// this.editBg.add(\n// createRect({\n// x: p0.x,\n// y,\n// width: p.left + p.width - p0.x,\n// height: line.height,\n// fill: '#336df4',\n// fillOpacity: 0.2\n// })\n// );\n// } else if (i === endIdx) {\n// const p = line.paragraphs[0];\n// this.editBg.add(\n// createRect({\n// x: p.left,\n// y,\n// width: p1.x - p.left,\n// height: line.height,\n// fill: '#336df4',\n// fillOpacity: 0.2\n// })\n// );\n// } else {\n// const p0 = line.paragraphs[0];\n// const p1 = line.paragraphs[line.paragraphs.length - 1];\n// this.editBg.add(\n// createRect({\n// x: p0.left,\n// y,\n// width: p1.left + p1.width - p0.left,\n// height: line.height,\n// fill: '#336df4',\n// fillOpacity: 0.2\n// })\n// );\n// }\n// y += line.height;\n// }\n// }\n\n// this.curCursorIdx = cursorIndex;\n// this.setCursorAndTextArea(x, y1 + 2, y2 - 2, e.target as IRichText);\n\n// this.applyUpdate();\n// this.updateCbs.forEach(cb => cb('selection', this));\n// }\n// }\n\n// hideSelection() {\n// if (this.editBg) {\n// this.editBg.removeAllChild();\n// this.editBg.setAttributes({ fill: 'transparent' });\n// }\n// }\n\n// handlePointerDown = (e: PointerEvent) => {\n// if (this.editing) {\n// this.onFocus(e);\n// } else {\n// this.deFocus(e);\n// }\n// this.applyUpdate();\n// this.pointerDown = true;\n// this.updateCbs.forEach(cb => cb(this.editing ? 'onfocus' : 'defocus', this));\n// console.log(this.selectionStartCursorIdx);\n// };\n// handlePointerUp = (e: PointerEvent) => {\n// this.pointerDown = false;\n// };\n\n// forceFocus(e: PointerEvent) {\n// this.handleEnter(e);\n// this.handlePointerDown(e);\n// this.handlePointerUp(e);\n// }\n\n// // 鼠标进入\n// handleEnter = (e: PointerEvent) => {\n// this.editing = true;\n// this.pluginService.stage.setCursor('text');\n// };\n\n// // 鼠标离开\n// handleLeave = (e: PointerEvent) => {\n// this.editing = false;\n// this.pluginService.stage.setCursor('default');\n// };\n\n// isRichtext(e: PointerEvent) {\n// return !!(e.target && (e.target as any).type === 'richtext' && (e.target as any).attribute.editable);\n// }\n\n// protected getEventPosition(e: PointerEvent): IPointLike {\n// const p = this.pluginService.stage.eventPointTransform(e);\n\n// const p1 = { x: 0, y: 0 };\n// (e.target as IRichText).globalTransMatrix.transformPoint(p, p1);\n// p1.x -= this.deltaX;\n// p1.y -= this.deltaY;\n// return p1;\n// }\n\n// protected getLineByPoint(cache: IRichTextFrame, p1: IPointLike): IRichTextLine {\n// let lineInfo = cache.lines[0];\n// for (let i = 0; i < cache.lines.length; i++) {\n// if (lineInfo.top <= p1.y && lineInfo.top + lineInfo.height >= p1.y) {\n// break;\n// }\n// lineInfo = cache.lines[i + 1];\n// }\n\n// return lineInfo;\n// }\n// protected getColumnByLinePoint(lineInfo: IRichTextLine, p1: IPointLike): IRichTextParagraph | IRichTextIcon {\n// let columnInfo = lineInfo.paragraphs[0];\n// for (let i = 0; i < lineInfo.paragraphs.length; i++) {\n// if (columnInfo.left <= p1.x && columnInfo.left + columnInfo.width >= p1.x) {\n// break;\n// }\n// columnInfo = lineInfo.paragraphs[i];\n// }\n\n// return columnInfo;\n// }\n\n// onFocus(e: PointerEvent) {\n// this.deFocus(e);\n// this.currRt = e.target as IRichText;\n\n// // 添加shadowGraphic\n// const target = e.target as IRichText;\n// RichTextEditPlugin.tryUpdateRichtext(target);\n// const shadowRoot = target.attachShadow();\n// const cache = target.getFrameCache();\n// if (!cache) {\n// return;\n// }\n\n// this.deltaX = 0;\n// this.deltaY = 0;\n// const height = cache.actualHeight;\n// const width = cache.lines.reduce((w, item) => Math.max(w, item.actualWidth), 0);\n// if (cache.globalAlign === 'center') {\n// this.deltaX = -width / 2;\n// } else if (cache.globalAlign === 'right') {\n// this.deltaX = -width;\n// }\n// if (cache.globalBaseline === 'middle') {\n// this.deltaY = -height / 2;\n// } else if (cache.globalBaseline === 'bottom') {\n// this.deltaY = -height;\n// }\n\n// shadowRoot.setAttributes({ shadowRootIdx: -1, x: this.deltaX, y: this.deltaY });\n// if (!this.editLine) {\n// const line = createLine({ x: 0, y: 0, lineWidth: 1, stroke: 'black' });\n// // 不使用stage的Ticker,避免影响其他的动画以及受到其他动画影响\n// const animate = line.animate();\n// animate.setTimeline(this.timeline);\n// animate.to({ opacity: 1 }, 10, 'linear').wait(700).to({ opacity: 0 }, 10, 'linear').wait(700).loop(Infinity);\n// this.editLine = line;\n// this.ticker.start(true);\n\n// const g = createGroup({ x: 0, y: 0, width: 0, height: 0 });\n// this.editBg = g;\n// shadowRoot.add(this.editLine);\n// shadowRoot.add(this.editBg);\n// }\n\n// const p1 = this.getEventPosition(e);\n\n// const lineInfo = this.getLineByPoint(cache, p1);\n\n// if (lineInfo) {\n// const columnInfo = this.getColumnByLinePoint(lineInfo, p1);\n// if (!columnInfo) {\n// return;\n// }\n\n// let y1 = lineInfo.top;\n// let y2 = lineInfo.top + lineInfo.height;\n// let x = columnInfo.left + columnInfo.width;\n// y1 += 2;\n// y2 -= 2;\n// let cursorIndex = this.getColumnIndex(cache, columnInfo);\n// if (p1.x < columnInfo.left + columnInfo.width / 2) {\n// x = columnInfo.left;\n// cursorIndex -= 1;\n// }\n\n// this.lastPoint = { x, y: (y1 + y2) / 2 };\n\n// this.curCursorIdx = cursorIndex;\n// this.selectionStartCursorIdx = cursorIndex;\n// this.setCursorAndTextArea(x, y1, y2, target);\n// }\n// }\n\n// protected getPointByColumnIdx(idx: number, rt: IRichText, orient: 'left' | 'right') {\n// const cache = rt.getFrameCache();\n// const column = this.getColumnByIndex(cache, idx);\n// const height = rt.attribute.fontSize ?? (rt.attribute.textConfig?.[0] as any)?.fontSize;\n// if (!column) {\n// return {\n// x: 0,\n// y1: 0,\n// y2: height\n// };\n// }\n// const { lineInfo, columnInfo } = column;\n// let y1 = lineInfo.top;\n// let y2 = lineInfo.top + lineInfo.height;\n// const x = columnInfo.left + (orient === 'left' ? 0 : columnInfo.width);\n// y1 += 2;\n// y2 -= 2;\n\n// return { x, y1, y2 };\n// }\n\n// protected getColumnIndex(cache: IRichTextFrame, cInfo: IRichTextParagraph | IRichTextIcon) {\n// // TODO 认为都是单个字符拆分的\n// let inputIndex = -1;\n// for (let i = 0; i < cache.lines.length; i++) {\n// const line = cache.lines[i];\n// for (let j = 0; j < line.paragraphs.length; j++) {\n// inputIndex++;\n// if (cInfo === line.paragraphs[j]) {\n// return inputIndex;\n// }\n// }\n// }\n// return -1;\n// }\n// protected getColumnByIndex(\n// cache: IRichTextFrame,\n// index: number\n// ): {\n// lineInfo: IRichTextLine;\n// columnInfo: IRichTextParagraph | IRichTextIcon;\n// } | null {\n// // TODO 认为都是单个字符拆分的\n// let inputIndex = -1;\n// for (let i = 0; i < cache.lines.length; i++) {\n// const lineInfo = cache.lines[i];\n// for (let j = 0; j < lineInfo.paragraphs.length; j++) {\n// const columnInfo = lineInfo.paragraphs[j];\n// inputIndex++;\n// if (inputIndex === index) {\n// return {\n// lineInfo,\n// columnInfo\n// };\n// }\n// }\n// }\n// return null;\n// }\n\n// protected setCursorAndTextArea(x: number, y1: number, y2: number, rt: IRichText) {\n// this.editLine.setAttributes({\n// points: [\n// { x, y: y1 },\n// { x, y: y2 }\n// ]\n// });\n// const out = { x: 0, y: 0 };\n// rt.globalTransMatrix.getInverse().transformPoint({ x, y: y1 }, out);\n// // TODO 考虑stage变换\n// const { left, top } = this.pluginService.stage.window.getBoundingClientRect();\n// out.x += left;\n// out.y += top;\n\n// this.editModule.moveTo(out.x, out.y, rt, this.curCursorIdx, this.selectionStartCursorIdx);\n// }\n// protected setCursor(x: number, y1: number, y2: number) {\n// this.editLine.setAttributes({\n// points: [\n// { x, y: y1 },\n// { x, y: y2 }\n// ]\n// });\n// }\n\n// applyUpdate() {\n// this.pluginService.stage.renderNextFrame();\n// }\n// deFocus(e: PointerEvent) {\n// const target = this.currRt as IRichText;\n// if (!target) {\n// return;\n// }\n// target.detachShadow();\n// this.currRt = null;\n// if (this.editLine) {\n// this.editLine.parent.removeChild(this.editLine);\n// this.editLine.release();\n// this.editLine = null;\n\n// this.editBg.parent.removeChild(this.editBg);\n// this.editBg.release();\n// this.editBg = null;\n// }\n// }\n\n// static splitText(text: string) {\n// // 😁这种emoji长度算两个,所以得处理一下\n// return Array.from(text);\n// }\n\n// static tryUpdateRichtext(richtext: IRichText) {\n// const cache = richtext.getFrameCache();\n// if (\n// !cache.lines.every(line =>\n// line.paragraphs.every(\n// item => !(item.text && isString(item.text) && RichTextEditPlugin.splitText(item.text).length > 1)\n// )\n// )\n// ) {\n// const tc: IRichTextCharacter[] = [];\n// richtext.attribute.textConfig.forEach((item: IRichTextParagraphCharacter) => {\n// const textList = RichTextEditPlugin.splitText(item.text.toString());\n// if (isString(item.text) && textList.length > 1) {\n// // 拆分\n// for (let i = 0; i < textList.length; i++) {\n// const t = textList[i];\n// tc.push({ ...item, text: t });\n// }\n// } else {\n// tc.push(item);\n// }\n// });\n// richtext.setAttributes({ textConfig: tc });\n// richtext.doUpdateFrameCache(tc);\n// }\n// }\n\n// onSelect() {\n// return;\n// }\n\n// deactivate(context: IPluginService): void {\n// // context.stage.off('pointerdown', this.handleClick);\n// context.stage.off('pointermove', this.handleMove);\n// context.stage.off('pointerdown', this.handlePointerDown);\n// context.stage.off('pointerup', this.handlePointerUp);\n// context.stage.off('pointerleave', this.handlePointerUp);\n// }\n\n// release() {\n// this.editModule.release();\n// }\n// }\n"]}