@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
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), interpolate_1 = require("../color-string/interpolate"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), _tempBounds = new vutils_2.AABBBounds, tempMatrix = new vutils_2.Matrix, tempBounds = new vutils_2.AABBBounds;
7
+ const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), _tempBounds = new vutils_2.AABBBounds, tempMatrix = new vutils_2.Matrix, tempBounds = new vutils_2.AABBBounds;
8
8
 
9
9
  exports.PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ],
10
10
  exports.GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
@@ -96,12 +96,13 @@ class Graphic extends node_tree_1.Node {
96
96
  this._emitCustomEvent("animate-bind", animate);
97
97
  }
98
98
  tryUpdateAABBBounds() {
99
+ var _a, _b;
99
100
  const full = "imprecise" === this.attribute.boundsMode;
100
101
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
101
102
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
102
- application_1.application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
103
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
103
104
  const bounds = this.doUpdateAABBBounds(full);
104
- return application_1.application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
105
+ return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
105
106
  "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
106
107
  }
107
108
  tryUpdateOBBBounds() {
@@ -235,6 +236,16 @@ class Graphic extends node_tree_1.Node {
235
236
  y: y
236
237
  });
237
238
  }
239
+ setWidthHeightWithoutTransform(aabbBounds) {
240
+ this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
241
+ }
242
+ setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
243
+ this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
244
+ Object.keys(params).forEach((key => {
245
+ animate.preventAttr(key);
246
+ }));
247
+ }));
248
+ }
238
249
  setAttributes(params, forceUpdateTag = !1, context) {
239
250
  (params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
240
251
  this._setAttributes(params, forceUpdateTag, context);
@@ -376,7 +387,8 @@ class Graphic extends node_tree_1.Node {
376
387
  return this;
377
388
  }
378
389
  onAttributeUpdate(context) {
379
- context && context.skipUpdateCallback || (application_1.application.graphicService.onAttributeUpdate(this),
390
+ var _a;
391
+ context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this),
380
392
  this._emitCustomEvent("afterAttributeUpdate", context));
381
393
  }
382
394
  update(d) {
@@ -398,7 +410,7 @@ class Graphic extends node_tree_1.Node {
398
410
  keys.forEach((key => {
399
411
  noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
400
412
  }));
401
- const stateAnimateConfig = null !== (_b = null !== (_a = this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : config_2.DefaultStateAnimateConfig;
413
+ const stateAnimateConfig = null !== (_b = null !== (_a = this.context && this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : config_2.DefaultStateAnimateConfig;
402
414
  this.applyAnimationState([ "state" ], [ {
403
415
  name: "state",
404
416
  animation: {
@@ -407,10 +419,13 @@ class Graphic extends node_tree_1.Node {
407
419
  duration: stateAnimateConfig.duration,
408
420
  easing: stateAnimateConfig.easing
409
421
  }
410
- } ]), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
422
+ } ]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
411
423
  type: enums_1.AttributeUpdateType.STATE
412
424
  });
413
- } else this.stopStateAnimates(), this.setAttributes(attrs, !1, {
425
+ } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
426
+ type: enums_1.AttributeUpdateType.STATE
427
+ });
428
+ this._emitCustomEvent("afterStateUpdate", {
414
429
  type: enums_1.AttributeUpdateType.STATE
415
430
  });
416
431
  }
@@ -430,13 +445,9 @@ class Graphic extends node_tree_1.Node {
430
445
  }));
431
446
  }
432
447
  getNormalAttribute(key) {
433
- let value = this.attribute[key];
434
- return this.animates && this.animates.forEach((animate => {
435
- if (animate.stateNames) {
436
- const endProps = animate.getEndProps();
437
- (0, vutils_2.has)(endProps, key) && (value = endProps[key]);
438
- }
439
- })), value;
448
+ var _a, _b;
449
+ const value = this.attribute[key];
450
+ 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];
440
451
  }
441
452
  clearStates(hasAnimation) {
442
453
  this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [],
@@ -511,19 +522,12 @@ class Graphic extends node_tree_1.Node {
511
522
  needUpdateLayout() {
512
523
  return !!(this._updateTag & enums_1.UpdateTag.UPDATE_LAYOUT);
513
524
  }
514
- getAnchor(anchor, params) {
525
+ getAnchor(anchor, params, resetScale) {
515
526
  const _anchor = [ 0, 0 ], getBounds = () => {
516
527
  if (params.b) return params.b;
517
- const {scaleX: scaleX, scaleY: scaleY, angle: angle} = this.attribute;
518
- return tempBounds.copy(this._AABBBounds), this.setAttributes({
519
- scaleX: 1,
520
- scaleY: 1,
521
- angle: 0
522
- }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
523
- scaleX: scaleX,
524
- scaleY: scaleY,
525
- angle: angle
526
- }), params.b;
528
+ const graphic = this.clone();
529
+ return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1,
530
+ graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
527
531
  };
528
532
  if ("string" == typeof anchor[0]) {
529
533
  const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
@@ -539,11 +543,11 @@ class Graphic extends node_tree_1.Node {
539
543
  const {x: x = config_1.DefaultTransform.x, y: y = config_1.DefaultTransform.y, scaleX: scaleX = config_1.DefaultTransform.scaleX, scaleY: scaleY = config_1.DefaultTransform.scaleY, angle: angle = config_1.DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute;
540
544
  let _anchor = [ 0, 0 ];
541
545
  const params = {};
542
- if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
546
+ if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
543
547
  vutils_2.normalTransform)(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
544
548
  const m = this._transMatrix;
545
549
  m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
546
- m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
550
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
547
551
  x: _anchor[0],
548
552
  y: _anchor[1]
549
553
  });
@@ -562,6 +566,7 @@ class Graphic extends node_tree_1.Node {
562
566
  }
563
567
  }
564
568
  setStage(stage, layer) {
569
+ var _a;
565
570
  if (this.stage !== stage) {
566
571
  if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
567
572
  this.animates && this.animates.size) {
@@ -570,7 +575,7 @@ class Graphic extends node_tree_1.Node {
570
575
  a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
571
576
  }));
572
577
  }
573
- this._onSetStage && this._onSetStage(this, stage, layer), application_1.application.graphicService.onSetStage(this, stage);
578
+ this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
574
579
  }
575
580
  }
576
581
  setStageToShadowRoot(stage, layer) {
@@ -582,76 +587,6 @@ class Graphic extends node_tree_1.Node {
582
587
  type: enums_1.AttributeUpdateType.ANIMATE_END
583
588
  });
584
589
  }
585
- onStep(subAnimate, animate, step, ratio, end) {
586
- const nextAttributes = {};
587
- if (step.customAnimate) step.customAnimate.update(end, ratio, nextAttributes); else {
588
- const nextProps = step.props, nextParsedProps = step.parsedProps, propKeys = step.propKeys;
589
- this.stepInterpolate(subAnimate, animate, nextAttributes, step, ratio, end, nextProps, void 0, nextParsedProps, propKeys);
590
- }
591
- this.setAttributes(nextAttributes, !1, {
592
- type: enums_1.AttributeUpdateType.ANIMATE_UPDATE,
593
- animationState: {
594
- ratio: ratio,
595
- end: end,
596
- step: step,
597
- isFirstFrameOfStep: subAnimate.getLastStep() !== step
598
- }
599
- }), this.stage && this.stage.renderNextFrame();
600
- }
601
- stepInterpolate(subAnimate, animate, nextAttributes, step, ratio, end, nextProps, lastProps, nextParsedProps, propKeys) {
602
- propKeys || (propKeys = Object.keys(nextProps), step.propKeys = propKeys), end ? step.propKeys.forEach((key => {
603
- animate.validAttr(key) && (nextAttributes[key] = nextProps[key]);
604
- })) : propKeys.forEach((key => {
605
- var _a;
606
- if (!animate.validAttr(key)) return;
607
- const nextStepVal = nextProps[key], lastStepVal = null !== (_a = lastProps && lastProps[key]) && void 0 !== _a ? _a : subAnimate.getLastPropByName(key, step);
608
- if (null == nextStepVal || null == lastStepVal || nextStepVal === lastStepVal) return void (nextAttributes[key] = nextStepVal);
609
- let match;
610
- match = animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes),
611
- match || (match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes),
612
- match || this.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) || this._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes));
613
- })), step.parsedProps = nextParsedProps;
614
- }
615
- defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) {
616
- if (Number.isFinite(nextStepVal) && Number.isFinite(lastStepVal)) return nextAttributes[key] = lastStepVal + (nextStepVal - lastStepVal) * ratio,
617
- !0;
618
- if ("fill" === key) {
619
- nextParsedProps || (nextParsedProps = {});
620
- const fillColorArray = nextParsedProps.fillColorArray, color = (0, interpolate_1.interpolateColor)(lastStepVal, null != fillColorArray ? fillColorArray : nextStepVal, ratio, !1, ((fArray, tArray) => {
621
- nextParsedProps.fillColorArray = tArray;
622
- }));
623
- return color && (nextAttributes[key] = color), !0;
624
- }
625
- if ("stroke" === key) {
626
- nextParsedProps || (nextParsedProps = {});
627
- const strokeColorArray = nextParsedProps.strokeColorArray, color = (0, interpolate_1.interpolateColor)(lastStepVal, null != strokeColorArray ? strokeColorArray : nextStepVal, ratio, !1, ((fArray, tArray) => {
628
- nextParsedProps.strokeColorArray = tArray;
629
- }));
630
- return color && (nextAttributes[key] = color), !0;
631
- }
632
- if ("shadowColor" === key) {
633
- nextParsedProps || (nextParsedProps = {});
634
- const shadowColorArray = nextParsedProps.shadowColorArray, color = (0, interpolate_1.interpolateColor)(lastStepVal, null != shadowColorArray ? shadowColorArray : nextStepVal, ratio, !0, ((fArray, tArray) => {
635
- nextParsedProps.shadowColorArray = tArray;
636
- }));
637
- return color && (nextAttributes[key] = color), !0;
638
- }
639
- if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
640
- const nextList = [];
641
- let valid = !0;
642
- for (let i = 0; i < nextStepVal.length; i++) {
643
- const v = lastStepVal[i], val = v + (nextStepVal[i] - v) * ratio;
644
- if (!Number.isFinite(val)) {
645
- valid = !1;
646
- break;
647
- }
648
- nextList.push(val);
649
- }
650
- valid && (nextAttributes[key] = nextList);
651
- }
652
- return !1;
653
- }
654
- _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
655
590
  getDefaultAttribute(name) {
656
591
  return this.getGraphicTheme()[name];
657
592
  }
@@ -734,6 +669,15 @@ class Graphic extends node_tree_1.Node {
734
669
  this.dispatchEvent(changeEvent);
735
670
  }
736
671
  }
672
+ toCustomPath() {
673
+ var _a, _b, _c;
674
+ const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application_1.application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
675
+ if (renderer) {
676
+ const context = new canvas_1.EmptyContext2d(null, 1);
677
+ return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
678
+ }
679
+ return null;
680
+ }
737
681
  }
738
682
 
739
683
  function backgroundNotImage(image) {