@visactor/vrender-core 0.23.0-alpha.3 → 1.0.0-alpha.10

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 (382) hide show
  1. package/cjs/animate/config.d.ts +0 -1
  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/color-string/interpolate.js +5 -2
  7. package/cjs/color-string/interpolate.js.map +1 -1
  8. package/cjs/common/canvas-utils.js +6 -3
  9. package/cjs/common/canvas-utils.js.map +1 -1
  10. package/cjs/common/custom-path2d.js +2 -2
  11. package/cjs/common/custom-path2d.js.map +1 -1
  12. package/cjs/common/diff.d.ts +1 -0
  13. package/cjs/common/diff.js +19 -0
  14. package/cjs/common/diff.js.map +1 -0
  15. package/cjs/common/enums.d.ts +0 -16
  16. package/cjs/common/enums.js +4 -12
  17. package/cjs/common/enums.js.map +1 -1
  18. package/cjs/common/morphing-utils.js +32 -124
  19. package/cjs/common/morphing-utils.js.map +1 -1
  20. package/cjs/common/segment/index.d.ts +1 -0
  21. package/cjs/common/segment/index.js +4 -1
  22. package/cjs/common/segment/index.js.map +1 -1
  23. package/cjs/common/segment/step.d.ts +6 -0
  24. package/cjs/common/segment/step.js +19 -2
  25. package/cjs/common/segment/step.js.map +1 -1
  26. package/cjs/common/shape/arc.d.ts +1 -1
  27. package/cjs/common/shape/arc.js +7 -3
  28. package/cjs/common/shape/arc.js.map +1 -1
  29. package/cjs/common/split-path.js +2 -3
  30. package/cjs/common/split-path.js.map +1 -1
  31. package/cjs/common/store.js +2 -1
  32. package/cjs/common/utils.d.ts +0 -2
  33. package/cjs/common/utils.js +4 -8
  34. package/cjs/common/utils.js.map +1 -1
  35. package/cjs/core/global-module.js +2 -0
  36. package/cjs/core/stage.d.ts +5 -2
  37. package/cjs/core/stage.js +19 -10
  38. package/cjs/core/stage.js.map +1 -1
  39. package/cjs/event/event-system.js +6 -7
  40. package/cjs/event/event-system.js.map +1 -1
  41. package/cjs/event/federated-event/base-event.js +1 -1
  42. package/cjs/event/federated-event/base-event.js.map +1 -1
  43. package/cjs/graphic/arc.d.ts +1 -2
  44. package/cjs/graphic/arc.js +4 -3
  45. package/cjs/graphic/arc.js.map +1 -1
  46. package/cjs/graphic/area.d.ts +1 -2
  47. package/cjs/graphic/area.js +5 -2
  48. package/cjs/graphic/area.js.map +1 -1
  49. package/cjs/graphic/circle.d.ts +1 -2
  50. package/cjs/graphic/circle.js +7 -3
  51. package/cjs/graphic/circle.js.map +1 -1
  52. package/cjs/graphic/config.d.ts +2 -1
  53. package/cjs/graphic/config.js +10 -3
  54. package/cjs/graphic/config.js.map +1 -1
  55. package/cjs/graphic/constants.d.ts +1 -0
  56. package/cjs/graphic/constants.js +4 -3
  57. package/cjs/graphic/constants.js.map +1 -1
  58. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  59. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  60. package/cjs/graphic/graphic.d.ts +10 -10
  61. package/cjs/graphic/graphic.js +42 -98
  62. package/cjs/graphic/graphic.js.map +1 -1
  63. package/cjs/graphic/group.js +14 -7
  64. package/cjs/graphic/group.js.map +1 -1
  65. package/cjs/graphic/image.js +2 -1
  66. package/cjs/graphic/image.js.map +1 -1
  67. package/cjs/graphic/index.d.ts +1 -0
  68. package/cjs/graphic/index.js +8 -8
  69. package/cjs/graphic/index.js.map +1 -1
  70. package/cjs/graphic/line.d.ts +1 -2
  71. package/cjs/graphic/line.js +7 -2
  72. package/cjs/graphic/line.js.map +1 -1
  73. package/cjs/graphic/path.js +2 -1
  74. package/cjs/graphic/path.js.map +1 -1
  75. package/cjs/graphic/polygon.js +2 -1
  76. package/cjs/graphic/polygon.js.map +1 -1
  77. package/cjs/graphic/rect.js +7 -3
  78. package/cjs/graphic/rect.js.map +1 -1
  79. package/cjs/graphic/richtext/icon.d.ts +1 -1
  80. package/cjs/graphic/richtext/icon.js.map +1 -1
  81. package/cjs/graphic/richtext/paragraph.d.ts +3 -0
  82. package/cjs/graphic/richtext/paragraph.js +14 -10
  83. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  84. package/cjs/graphic/richtext/utils.js +12 -2
  85. package/cjs/graphic/richtext/utils.js.map +1 -1
  86. package/cjs/graphic/richtext.d.ts +3 -0
  87. package/cjs/graphic/richtext.js +3 -2
  88. package/cjs/graphic/richtext.js.map +1 -1
  89. package/cjs/graphic/star.d.ts +52 -0
  90. package/cjs/graphic/star.js +78 -0
  91. package/cjs/graphic/star.js.map +1 -0
  92. package/cjs/graphic/symbol.js +3 -1
  93. package/cjs/graphic/symbol.js.map +1 -1
  94. package/cjs/graphic/text.js +1 -0
  95. package/cjs/graphic/text.js.map +1 -1
  96. package/cjs/graphic/theme.js +2 -0
  97. package/cjs/graphic/theme.js.map +1 -1
  98. package/cjs/index.d.ts +3 -0
  99. package/cjs/index.js +14 -12
  100. package/cjs/index.js.map +1 -1
  101. package/cjs/interface/animate.d.ts +1 -165
  102. package/cjs/interface/animate.js +1 -4
  103. package/cjs/interface/animate.js.map +1 -1
  104. package/cjs/interface/animation/animate.d.ts +117 -0
  105. package/cjs/interface/animation/animate.js +10 -0
  106. package/cjs/interface/animation/animate.js.map +1 -0
  107. package/cjs/interface/animation/easing.d.ts +3 -0
  108. package/cjs/interface/animation/easing.js +6 -0
  109. package/cjs/interface/animation/easing.js.map +1 -0
  110. package/cjs/interface/animation/index.d.ts +5 -0
  111. package/cjs/interface/animation/index.js +23 -0
  112. package/cjs/interface/animation/index.js.map +1 -0
  113. package/cjs/interface/animation/ticker.d.ts +39 -0
  114. package/cjs/interface/animation/ticker.js +11 -0
  115. package/cjs/interface/animation/ticker.js.map +1 -0
  116. package/cjs/interface/animation/timeline.d.ts +17 -0
  117. package/cjs/interface/animation/timeline.js +6 -0
  118. package/cjs/interface/animation/timeline.js.map +1 -0
  119. package/cjs/interface/animation/type.d.ts +13 -0
  120. package/cjs/interface/animation/type.js +15 -0
  121. package/cjs/interface/animation/type.js.map +1 -0
  122. package/cjs/interface/common.d.ts +1 -1
  123. package/cjs/interface/common.js.map +1 -1
  124. package/cjs/interface/contribution.d.ts +2 -0
  125. package/cjs/interface/contribution.js.map +1 -1
  126. package/cjs/interface/graphic/index.d.ts +1 -0
  127. package/cjs/interface/graphic/index.js +3 -2
  128. package/cjs/interface/graphic/index.js.map +1 -1
  129. package/cjs/interface/graphic/richText.d.ts +3 -0
  130. package/cjs/interface/graphic/richText.js.map +1 -1
  131. package/cjs/interface/graphic/star.d.ts +12 -0
  132. package/cjs/interface/graphic/star.js +6 -0
  133. package/cjs/interface/graphic/star.js.map +1 -0
  134. package/cjs/interface/graphic/theme.d.ts +3 -0
  135. package/cjs/interface/graphic/theme.js.map +1 -1
  136. package/cjs/interface/graphic.d.ts +12 -1
  137. package/cjs/interface/graphic.js.map +1 -1
  138. package/cjs/interface/index.d.ts +1 -1
  139. package/cjs/interface/index.js +1 -1
  140. package/cjs/interface/index.js.map +1 -1
  141. package/cjs/interface/render.d.ts +1 -0
  142. package/cjs/interface/render.js.map +1 -1
  143. package/cjs/interface/stage.d.ts +3 -1
  144. package/cjs/interface/stage.js.map +1 -1
  145. package/cjs/modules.d.ts +2 -1
  146. package/cjs/modules.js +4 -3
  147. package/cjs/modules.js.map +1 -1
  148. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  149. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  150. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  151. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  152. package/cjs/plugins/builtin-plugin/edit-module.js +11 -8
  153. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  154. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  155. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  156. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  157. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  158. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  159. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  160. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +1 -1
  161. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  162. package/cjs/register/register-star.d.ts +1 -0
  163. package/cjs/register/register-star.js +14 -0
  164. package/cjs/register/register-star.js.map +1 -0
  165. package/cjs/render/contributions/render/area-render.js +2 -2
  166. package/cjs/render/contributions/render/area-render.js.map +1 -1
  167. package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
  168. package/cjs/render/contributions/render/contributions/constants.js +3 -2
  169. package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
  170. package/cjs/render/contributions/render/contributions/index.d.ts +1 -0
  171. package/cjs/render/contributions/render/contributions/index.js +2 -2
  172. package/cjs/render/contributions/render/contributions/index.js.map +1 -1
  173. package/cjs/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  174. package/cjs/render/contributions/render/contributions/star-contribution-render.js +11 -0
  175. package/cjs/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  176. package/cjs/render/contributions/render/draw-contribution.js +1 -1
  177. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  178. package/cjs/render/contributions/render/line-render.js +1 -1
  179. package/cjs/render/contributions/render/line-render.js.map +1 -1
  180. package/cjs/render/contributions/render/star-module.d.ts +2 -0
  181. package/cjs/render/contributions/render/star-module.js +15 -0
  182. package/cjs/render/contributions/render/star-module.js.map +1 -0
  183. package/cjs/render/contributions/render/star-render.d.ts +10 -0
  184. package/cjs/render/contributions/render/star-render.js +54 -0
  185. package/cjs/render/contributions/render/star-render.js.map +1 -0
  186. package/cjs/render/contributions/render/symbol.d.ts +1 -0
  187. package/cjs/render/contributions/render/symbol.js +2 -2
  188. package/cjs/render/contributions/render/symbol.js.map +1 -1
  189. package/cjs/render/render-service.d.ts +1 -1
  190. package/cjs/render/render-service.js.map +1 -1
  191. package/dist/index.es.js +12578 -12435
  192. package/es/animate/config.d.ts +0 -1
  193. package/es/animate/config.js +0 -5
  194. package/es/animate/config.js.map +1 -1
  195. package/es/application.d.ts +2 -1
  196. package/es/application.js.map +1 -1
  197. package/es/color-string/interpolate.js +4 -1
  198. package/es/color-string/interpolate.js.map +1 -1
  199. package/es/common/canvas-utils.js +6 -3
  200. package/es/common/canvas-utils.js.map +1 -1
  201. package/es/common/custom-path2d.js +2 -2
  202. package/es/common/custom-path2d.js.map +1 -1
  203. package/es/common/diff.d.ts +1 -0
  204. package/es/common/diff.js +11 -0
  205. package/es/common/diff.js.map +1 -0
  206. package/es/common/enums.d.ts +0 -16
  207. package/es/common/enums.js +2 -21
  208. package/es/common/enums.js.map +1 -1
  209. package/es/common/morphing-utils.js +29 -124
  210. package/es/common/morphing-utils.js.map +1 -1
  211. package/es/common/segment/index.d.ts +1 -0
  212. package/es/common/segment/index.js +6 -1
  213. package/es/common/segment/index.js.map +1 -1
  214. package/es/common/segment/step.d.ts +6 -0
  215. package/es/common/segment/step.js +13 -0
  216. package/es/common/segment/step.js.map +1 -1
  217. package/es/common/shape/arc.d.ts +1 -1
  218. package/es/common/shape/arc.js +7 -3
  219. package/es/common/shape/arc.js.map +1 -1
  220. package/es/common/split-path.js +2 -3
  221. package/es/common/split-path.js.map +1 -1
  222. package/es/common/store.js +2 -1
  223. package/es/common/utils.d.ts +0 -2
  224. package/es/common/utils.js +0 -4
  225. package/es/common/utils.js.map +1 -1
  226. package/es/core/global-module.js +2 -0
  227. package/es/core/stage.d.ts +5 -2
  228. package/es/core/stage.js +20 -9
  229. package/es/core/stage.js.map +1 -1
  230. package/es/event/event-system.js +6 -7
  231. package/es/event/event-system.js.map +1 -1
  232. package/es/event/federated-event/base-event.js +1 -1
  233. package/es/event/federated-event/base-event.js.map +1 -1
  234. package/es/graphic/arc.d.ts +1 -2
  235. package/es/graphic/arc.js +4 -3
  236. package/es/graphic/arc.js.map +1 -1
  237. package/es/graphic/area.d.ts +1 -2
  238. package/es/graphic/area.js +5 -2
  239. package/es/graphic/area.js.map +1 -1
  240. package/es/graphic/circle.d.ts +1 -2
  241. package/es/graphic/circle.js +6 -3
  242. package/es/graphic/circle.js.map +1 -1
  243. package/es/graphic/config.d.ts +2 -1
  244. package/es/graphic/config.js +11 -2
  245. package/es/graphic/config.js.map +1 -1
  246. package/es/graphic/constants.d.ts +1 -0
  247. package/es/graphic/constants.js +2 -0
  248. package/es/graphic/constants.js.map +1 -1
  249. package/es/graphic/graphic-service/graphic-module.js +1 -1
  250. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  251. package/es/graphic/graphic.d.ts +10 -10
  252. package/es/graphic/graphic.js +44 -100
  253. package/es/graphic/graphic.js.map +1 -1
  254. package/es/graphic/group.js +15 -8
  255. package/es/graphic/group.js.map +1 -1
  256. package/es/graphic/image.js +2 -1
  257. package/es/graphic/image.js.map +1 -1
  258. package/es/graphic/index.d.ts +1 -0
  259. package/es/graphic/index.js +2 -0
  260. package/es/graphic/index.js.map +1 -1
  261. package/es/graphic/line.d.ts +1 -2
  262. package/es/graphic/line.js +7 -2
  263. package/es/graphic/line.js.map +1 -1
  264. package/es/graphic/path.js +2 -1
  265. package/es/graphic/path.js.map +1 -1
  266. package/es/graphic/polygon.js +2 -1
  267. package/es/graphic/polygon.js.map +1 -1
  268. package/es/graphic/rect.js +7 -3
  269. package/es/graphic/rect.js.map +1 -1
  270. package/es/graphic/richtext/icon.d.ts +1 -1
  271. package/es/graphic/richtext/icon.js.map +1 -1
  272. package/es/graphic/richtext/paragraph.d.ts +3 -0
  273. package/es/graphic/richtext/paragraph.js +14 -10
  274. package/es/graphic/richtext/paragraph.js.map +1 -1
  275. package/es/graphic/richtext/utils.js +12 -2
  276. package/es/graphic/richtext/utils.js.map +1 -1
  277. package/es/graphic/richtext.d.ts +3 -0
  278. package/es/graphic/richtext.js +3 -2
  279. package/es/graphic/richtext.js.map +1 -1
  280. package/es/graphic/star.d.ts +52 -0
  281. package/es/graphic/star.js +82 -0
  282. package/es/graphic/star.js.map +1 -0
  283. package/es/graphic/symbol.js +3 -1
  284. package/es/graphic/symbol.js.map +1 -1
  285. package/es/graphic/text.js +1 -0
  286. package/es/graphic/text.js.map +1 -1
  287. package/es/graphic/theme.js +3 -1
  288. package/es/graphic/theme.js.map +1 -1
  289. package/es/index.d.ts +3 -0
  290. package/es/index.js +6 -0
  291. package/es/index.js.map +1 -1
  292. package/es/interface/animate.d.ts +1 -165
  293. package/es/interface/animate.js +2 -1
  294. package/es/interface/animate.js.map +1 -1
  295. package/es/interface/animation/animate.d.ts +117 -0
  296. package/es/interface/animation/animate.js +6 -0
  297. package/es/interface/animation/animate.js.map +1 -0
  298. package/es/interface/animation/easing.d.ts +3 -0
  299. package/es/interface/animation/easing.js +2 -0
  300. package/es/interface/animation/easing.js.map +1 -0
  301. package/es/interface/animation/index.d.ts +5 -0
  302. package/es/interface/animation/index.js +10 -0
  303. package/es/interface/animation/index.js.map +1 -0
  304. package/es/interface/animation/ticker.d.ts +39 -0
  305. package/es/interface/animation/ticker.js +7 -0
  306. package/es/interface/animation/ticker.js.map +1 -0
  307. package/es/interface/animation/timeline.d.ts +17 -0
  308. package/es/interface/animation/timeline.js +2 -0
  309. package/es/interface/animation/timeline.js.map +1 -0
  310. package/es/interface/animation/type.d.ts +13 -0
  311. package/es/interface/animation/type.js +14 -0
  312. package/es/interface/animation/type.js.map +1 -0
  313. package/es/interface/common.d.ts +1 -1
  314. package/es/interface/common.js.map +1 -1
  315. package/es/interface/contribution.d.ts +2 -0
  316. package/es/interface/contribution.js.map +1 -1
  317. package/es/interface/graphic/index.d.ts +1 -0
  318. package/es/interface/graphic/index.js +2 -0
  319. package/es/interface/graphic/index.js.map +1 -1
  320. package/es/interface/graphic/richText.d.ts +3 -0
  321. package/es/interface/graphic/richText.js.map +1 -1
  322. package/es/interface/graphic/star.d.ts +12 -0
  323. package/es/interface/graphic/star.js +2 -0
  324. package/es/interface/graphic/star.js.map +1 -0
  325. package/es/interface/graphic/theme.d.ts +3 -0
  326. package/es/interface/graphic/theme.js.map +1 -1
  327. package/es/interface/graphic.d.ts +12 -1
  328. package/es/interface/graphic.js.map +1 -1
  329. package/es/interface/index.d.ts +1 -1
  330. package/es/interface/index.js +1 -1
  331. package/es/interface/index.js.map +1 -1
  332. package/es/interface/render.d.ts +1 -0
  333. package/es/interface/render.js.map +1 -1
  334. package/es/interface/stage.d.ts +3 -1
  335. package/es/interface/stage.js.map +1 -1
  336. package/es/modules.d.ts +2 -1
  337. package/es/modules.js +6 -0
  338. package/es/modules.js.map +1 -1
  339. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  340. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  341. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  342. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  343. package/es/plugins/builtin-plugin/edit-module.js +11 -8
  344. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  345. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  346. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  347. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  348. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  349. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  350. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  351. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +1 -1
  352. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  353. package/es/register/register-star.d.ts +1 -0
  354. package/es/register/register-star.js +8 -0
  355. package/es/register/register-star.js.map +1 -0
  356. package/es/render/contributions/render/area-render.js +2 -2
  357. package/es/render/contributions/render/area-render.js.map +1 -1
  358. package/es/render/contributions/render/contributions/constants.d.ts +1 -0
  359. package/es/render/contributions/render/contributions/constants.js +2 -0
  360. package/es/render/contributions/render/contributions/constants.js.map +1 -1
  361. package/es/render/contributions/render/contributions/index.d.ts +1 -0
  362. package/es/render/contributions/render/contributions/index.js +2 -0
  363. package/es/render/contributions/render/contributions/index.js.map +1 -1
  364. package/es/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  365. package/es/render/contributions/render/contributions/star-contribution-render.js +8 -0
  366. package/es/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  367. package/es/render/contributions/render/draw-contribution.js +1 -1
  368. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  369. package/es/render/contributions/render/line-render.js +1 -1
  370. package/es/render/contributions/render/line-render.js.map +1 -1
  371. package/es/render/contributions/render/star-module.d.ts +2 -0
  372. package/es/render/contributions/render/star-module.js +13 -0
  373. package/es/render/contributions/render/star-module.js.map +1 -0
  374. package/es/render/contributions/render/star-render.d.ts +10 -0
  375. package/es/render/contributions/render/star-render.js +59 -0
  376. package/es/render/contributions/render/star-render.js.map +1 -0
  377. package/es/render/contributions/render/symbol.d.ts +1 -0
  378. package/es/render/contributions/render/symbol.js +2 -0
  379. package/es/render/contributions/render/symbol.js.map +1 -1
  380. package/es/render/render-service.d.ts +1 -1
  381. package/es/render/render-service.js.map +1 -1
  382. package/package.json +2 -2
@@ -3,7 +3,7 @@ import type { Dict, IPointLike, IAABBBounds, IOBBBounds } from '@visactor/vutils
3
3
  import { Matrix, Point } from '@visactor/vutils';
4
4
  import type { GraphicType, IAnimateConfig, IGraphicAttribute, IGraphic, IGraphicJson, ISetAttributeContext, ITransform, GraphicReleaseStatus } from '../interface/graphic';
5
5
  import { Node } from './node-tree';
6
- import type { IAnimate, IAnimateTarget, IGlyphGraphicAttribute, ILayer, IPickerService, IShadowRoot, IStage, IStep, ISubAnimate, ISymbolClass } from '../interface';
6
+ import type { IAnimate, IAnimateTarget, IGlyphGraphicAttribute, ILayer, IPickerService, IShadowRoot, IStage, IStep, ISymbolClass } from '../interface';
7
7
  import { IContainPointMode } from '../common/enums';
8
8
  import { CustomSymbolClass } from './builtin-symbol';
9
9
  export declare const PURE_STYLE_KEY: string[];
@@ -61,6 +61,10 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
61
61
  glyphHost?: IGraphic<IGlyphGraphicAttribute>;
62
62
  _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;
63
63
  in3dMode?: boolean;
64
+ widthWithoutTransform?: number;
65
+ heightWithoutTransform?: number;
66
+ x1WithoutTransform?: number;
67
+ y1WithoutTransform?: number;
64
68
  protected _AABBBounds: IAABBBounds;
65
69
  get AABBBounds(): IAABBBounds;
66
70
  protected _OBBBounds?: IOBBBounds;
@@ -83,9 +87,6 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
83
87
  stateProxy?: (stateName: string, targetStates?: string[]) => T;
84
88
  animates: Map<string | number, IAnimate>;
85
89
  animate?: () => IAnimate;
86
- nextAttrs?: T;
87
- prevAttrs?: T;
88
- finalAttrs?: T;
89
90
  pathProxy?: ICustomPath2D;
90
91
  attachedThemeGraphic?: IGraphic;
91
92
  protected updateAABBBoundsStamp: number;
@@ -97,7 +98,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
97
98
  set3dMode(): void;
98
99
  set2dMode(): void;
99
100
  getOffsetXY(attr?: ITransform, includeScroll?: boolean): Point;
100
- onAnimateBind(animate: IAnimate | ISubAnimate): void;
101
+ onAnimateBind(animate: IAnimate): void;
101
102
  protected tryUpdateAABBBounds(): IAABBBounds;
102
103
  protected tryUpdateOBBBounds(): IOBBBounds;
103
104
  protected combindShadowAABBBounds(bounds: IAABBBounds): void;
@@ -120,6 +121,8 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
120
121
  shouldUpdateShape(): boolean;
121
122
  clearUpdateShapeTag(): void;
122
123
  containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
124
+ protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
125
+ setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
123
126
  setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
124
127
  _setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
125
128
  setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
@@ -163,17 +166,13 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
163
166
  protected needUpdateLayout(): boolean;
164
167
  protected getAnchor(anchor: [string | number, string | number], params: {
165
168
  b?: IAABBBounds;
166
- }): [number, number];
169
+ }, resetScale?: boolean): [number, number];
167
170
  protected doUpdateLocalMatrix(): void;
168
171
  protected doUpdateGlobalMatrix(): void;
169
172
  setStage(stage?: IStage, layer?: ILayer): void;
170
173
  setStageToShadowRoot(stage?: IStage, layer?: ILayer): void;
171
174
  onAddStep(step: IStep): void;
172
175
  onStop(props?: Partial<T>): void;
173
- onStep(subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean): void;
174
- stepInterpolate(subAnimate: ISubAnimate, animate: IAnimate, nextAttributes: Record<string, any>, step: IStep, ratio: number, end: boolean, nextProps: Record<string, any>, lastProps?: Record<string, any>, nextParsedProps?: any, propKeys?: string[]): void;
175
- defaultInterpolate(nextStepVal: any, lastStepVal: any, key: string, nextAttributes: Record<string, any>, nextParsedProps: any, ratio: number): boolean;
176
- protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any): void;
177
176
  getDefaultAttribute(name: string): any;
178
177
  getComputedAttribute(name: string): any;
179
178
  onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate?: boolean): void;
@@ -191,4 +190,5 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
191
190
  protected _emitCustomEvent(type: string, context?: any): void;
192
191
  abstract getNoWorkAnimateAttr(): Record<string, number>;
193
192
  abstract clone(): IGraphic<any>;
193
+ toCustomPath(): ICustomPath2D;
194
194
  }
@@ -1,6 +1,6 @@
1
1
  import { isArray, max, OBBBounds } from "@visactor/vutils";
2
2
 
3
- import { AABBBounds, Matrix, normalTransform, Point, isNil, has, isString, isValidUrl, isBase64, isObject } from "@visactor/vutils";
3
+ import { AABBBounds, Matrix, normalTransform, Point, isNil, isString, isValidUrl, isBase64, isObject } from "@visactor/vutils";
4
4
 
5
5
  import { Node } from "./node-tree";
6
6
 
@@ -10,8 +10,6 @@ import { DefaultTransform } from "./config";
10
10
 
11
11
  import { application } from "../application";
12
12
 
13
- import { interpolateColor } from "../color-string/interpolate";
14
-
15
13
  import { CustomPath2D } from "../common/custom-path2d";
16
14
 
17
15
  import { ResourceLoader } from "../resource-loader/loader";
@@ -32,6 +30,8 @@ import { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from "./constan
32
30
 
33
31
  import { DefaultStateAnimateConfig } from "../animate/config";
34
32
 
33
+ import { EmptyContext2d } from "../canvas";
34
+
35
35
  const _tempBounds = new AABBBounds, tempMatrix = new Matrix, tempBounds = new AABBBounds;
36
36
 
37
37
  export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
@@ -124,12 +124,13 @@ export class Graphic extends Node {
124
124
  this._emitCustomEvent("animate-bind", animate);
125
125
  }
126
126
  tryUpdateAABBBounds() {
127
+ var _a, _b;
127
128
  const full = "imprecise" === this.attribute.boundsMode;
128
129
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
129
130
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
130
- application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
131
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
131
132
  const bounds = this.doUpdateAABBBounds(full);
132
- return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
133
+ return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
133
134
  "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
134
135
  }
135
136
  tryUpdateOBBBounds() {
@@ -259,6 +260,16 @@ export class Graphic extends Node {
259
260
  y: y
260
261
  });
261
262
  }
263
+ setWidthHeightWithoutTransform(aabbBounds) {
264
+ this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
265
+ }
266
+ setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
267
+ this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
268
+ Object.keys(params).forEach((key => {
269
+ animate.preventAttr(key);
270
+ }));
271
+ }));
272
+ }
262
273
  setAttributes(params, forceUpdateTag = !1, context) {
263
274
  (params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
264
275
  this._setAttributes(params, forceUpdateTag, context);
@@ -398,7 +409,8 @@ export class Graphic extends Node {
398
409
  return this;
399
410
  }
400
411
  onAttributeUpdate(context) {
401
- context && context.skipUpdateCallback || (application.graphicService.onAttributeUpdate(this),
412
+ var _a;
413
+ context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this),
402
414
  this._emitCustomEvent("afterAttributeUpdate", context));
403
415
  }
404
416
  update(d) {
@@ -420,7 +432,7 @@ export class Graphic extends Node {
420
432
  keys.forEach((key => {
421
433
  noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
422
434
  }));
423
- const stateAnimateConfig = null !== (_b = null !== (_a = this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : DefaultStateAnimateConfig;
435
+ const stateAnimateConfig = null !== (_b = null !== (_a = this.context && this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : DefaultStateAnimateConfig;
424
436
  this.applyAnimationState([ "state" ], [ {
425
437
  name: "state",
426
438
  animation: {
@@ -429,10 +441,13 @@ export class Graphic extends Node {
429
441
  duration: stateAnimateConfig.duration,
430
442
  easing: stateAnimateConfig.easing
431
443
  }
432
- } ]), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
444
+ } ]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
433
445
  type: AttributeUpdateType.STATE
434
446
  });
435
- } else this.stopStateAnimates(), this.setAttributes(attrs, !1, {
447
+ } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
448
+ type: AttributeUpdateType.STATE
449
+ });
450
+ this._emitCustomEvent("afterStateUpdate", {
436
451
  type: AttributeUpdateType.STATE
437
452
  });
438
453
  }
@@ -452,13 +467,9 @@ export class Graphic extends Node {
452
467
  }));
453
468
  }
454
469
  getNormalAttribute(key) {
455
- let value = this.attribute[key];
456
- return this.animates && this.animates.forEach((animate => {
457
- if (animate.stateNames) {
458
- const endProps = animate.getEndProps();
459
- has(endProps, key) && (value = endProps[key]);
460
- }
461
- })), value;
470
+ var _a, _b;
471
+ const value = this.attribute[key];
472
+ return this.animates ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
462
473
  }
463
474
  clearStates(hasAnimation) {
464
475
  this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [],
@@ -533,19 +544,12 @@ export class Graphic extends Node {
533
544
  needUpdateLayout() {
534
545
  return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
535
546
  }
536
- getAnchor(anchor, params) {
547
+ getAnchor(anchor, params, resetScale) {
537
548
  const _anchor = [ 0, 0 ], getBounds = () => {
538
549
  if (params.b) return params.b;
539
- const {scaleX: scaleX, scaleY: scaleY, angle: angle} = this.attribute;
540
- return tempBounds.copy(this._AABBBounds), this.setAttributes({
541
- scaleX: 1,
542
- scaleY: 1,
543
- angle: 0
544
- }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
545
- scaleX: scaleX,
546
- scaleY: scaleY,
547
- angle: angle
548
- }), params.b;
550
+ const graphic = this.clone();
551
+ return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1,
552
+ graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
549
553
  };
550
554
  if ("string" == typeof anchor[0]) {
551
555
  const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
@@ -561,10 +565,10 @@ export class Graphic extends Node {
561
565
  const {x: x = DefaultTransform.x, y: y = DefaultTransform.y, scaleX: scaleX = DefaultTransform.scaleX, scaleY: scaleY = DefaultTransform.scaleY, angle: angle = DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute;
562
566
  let _anchor = [ 0, 0 ];
563
567
  const params = {};
564
- if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
568
+ if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
565
569
  const m = this._transMatrix;
566
570
  m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
567
- m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
571
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
568
572
  x: _anchor[0],
569
573
  y: _anchor[1]
570
574
  });
@@ -583,6 +587,7 @@ export class Graphic extends Node {
583
587
  }
584
588
  }
585
589
  setStage(stage, layer) {
590
+ var _a;
586
591
  if (this.stage !== stage) {
587
592
  if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
588
593
  this.animates && this.animates.size) {
@@ -591,7 +596,7 @@ export class Graphic extends Node {
591
596
  a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
592
597
  }));
593
598
  }
594
- this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage);
599
+ this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
595
600
  }
596
601
  }
597
602
  setStageToShadowRoot(stage, layer) {
@@ -603,76 +608,6 @@ export class Graphic extends Node {
603
608
  type: AttributeUpdateType.ANIMATE_END
604
609
  });
605
610
  }
606
- onStep(subAnimate, animate, step, ratio, end) {
607
- const nextAttributes = {};
608
- if (step.customAnimate) step.customAnimate.update(end, ratio, nextAttributes); else {
609
- const nextProps = step.props, nextParsedProps = step.parsedProps, propKeys = step.propKeys;
610
- this.stepInterpolate(subAnimate, animate, nextAttributes, step, ratio, end, nextProps, void 0, nextParsedProps, propKeys);
611
- }
612
- this.setAttributes(nextAttributes, !1, {
613
- type: AttributeUpdateType.ANIMATE_UPDATE,
614
- animationState: {
615
- ratio: ratio,
616
- end: end,
617
- step: step,
618
- isFirstFrameOfStep: subAnimate.getLastStep() !== step
619
- }
620
- }), this.stage && this.stage.renderNextFrame();
621
- }
622
- stepInterpolate(subAnimate, animate, nextAttributes, step, ratio, end, nextProps, lastProps, nextParsedProps, propKeys) {
623
- propKeys || (propKeys = Object.keys(nextProps), step.propKeys = propKeys), end ? step.propKeys.forEach((key => {
624
- animate.validAttr(key) && (nextAttributes[key] = nextProps[key]);
625
- })) : propKeys.forEach((key => {
626
- var _a;
627
- if (!animate.validAttr(key)) return;
628
- const nextStepVal = nextProps[key], lastStepVal = null !== (_a = lastProps && lastProps[key]) && void 0 !== _a ? _a : subAnimate.getLastPropByName(key, step);
629
- if (null == nextStepVal || null == lastStepVal || nextStepVal === lastStepVal) return void (nextAttributes[key] = nextStepVal);
630
- let match;
631
- match = animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes),
632
- match || (match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes),
633
- match || this.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) || this._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes));
634
- })), step.parsedProps = nextParsedProps;
635
- }
636
- defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) {
637
- if (Number.isFinite(nextStepVal) && Number.isFinite(lastStepVal)) return nextAttributes[key] = lastStepVal + (nextStepVal - lastStepVal) * ratio,
638
- !0;
639
- if ("fill" === key) {
640
- nextParsedProps || (nextParsedProps = {});
641
- const fillColorArray = nextParsedProps.fillColorArray, color = interpolateColor(lastStepVal, null != fillColorArray ? fillColorArray : nextStepVal, ratio, !1, ((fArray, tArray) => {
642
- nextParsedProps.fillColorArray = tArray;
643
- }));
644
- return color && (nextAttributes[key] = color), !0;
645
- }
646
- if ("stroke" === key) {
647
- nextParsedProps || (nextParsedProps = {});
648
- const strokeColorArray = nextParsedProps.strokeColorArray, color = interpolateColor(lastStepVal, null != strokeColorArray ? strokeColorArray : nextStepVal, ratio, !1, ((fArray, tArray) => {
649
- nextParsedProps.strokeColorArray = tArray;
650
- }));
651
- return color && (nextAttributes[key] = color), !0;
652
- }
653
- if ("shadowColor" === key) {
654
- nextParsedProps || (nextParsedProps = {});
655
- const shadowColorArray = nextParsedProps.shadowColorArray, color = interpolateColor(lastStepVal, null != shadowColorArray ? shadowColorArray : nextStepVal, ratio, !0, ((fArray, tArray) => {
656
- nextParsedProps.shadowColorArray = tArray;
657
- }));
658
- return color && (nextAttributes[key] = color), !0;
659
- }
660
- if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
661
- const nextList = [];
662
- let valid = !0;
663
- for (let i = 0; i < nextStepVal.length; i++) {
664
- const v = lastStepVal[i], val = v + (nextStepVal[i] - v) * ratio;
665
- if (!Number.isFinite(val)) {
666
- valid = !1;
667
- break;
668
- }
669
- nextList.push(val);
670
- }
671
- valid && (nextAttributes[key] = nextList);
672
- }
673
- return !1;
674
- }
675
- _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
676
611
  getDefaultAttribute(name) {
677
612
  return this.getGraphicTheme()[name];
678
613
  }
@@ -754,6 +689,15 @@ export class Graphic extends Node {
754
689
  this.dispatchEvent(changeEvent);
755
690
  }
756
691
  }
692
+ toCustomPath() {
693
+ var _a, _b, _c;
694
+ const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
695
+ if (renderer) {
696
+ const context = new EmptyContext2d(null, 1);
697
+ return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
698
+ }
699
+ return null;
700
+ }
757
701
  }
758
702
 
759
703
  function backgroundNotImage(image) {