@visactor/vrender-core 1.1.0-alpha.0 → 1.1.0-alpha.2

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 (1030) hide show
  1. package/cjs/allocator/canvas-allocate.js +5 -7
  2. package/cjs/allocator/canvas-allocate.js.map +1 -1
  3. package/cjs/allocator/graphic-allocate.js +17 -17
  4. package/cjs/allocator/graphic-allocate.js.map +1 -1
  5. package/cjs/application.d.ts +19 -18
  6. package/cjs/application.js +1 -31
  7. package/cjs/application.js.map +1 -1
  8. package/cjs/canvas/conical-gradient.js +2 -2
  9. package/cjs/canvas/conical-gradient.js.map +1 -1
  10. package/cjs/canvas/contributions/base-canvas.js +2 -2
  11. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  12. package/cjs/canvas/util.d.ts +2 -3
  13. package/cjs/canvas/util.js +17 -7
  14. package/cjs/canvas/util.js.map +1 -1
  15. package/cjs/common/contribution-provider.d.ts +27 -0
  16. package/cjs/common/contribution-provider.js +51 -0
  17. package/cjs/common/contribution-provider.js.map +1 -0
  18. package/cjs/common/enums.d.ts +2 -0
  19. package/cjs/common/enums.js +3 -1
  20. package/cjs/common/enums.js.map +1 -1
  21. package/cjs/common/event-listener-manager.d.ts +18 -1
  22. package/cjs/common/event-listener-manager.js +40 -10
  23. package/cjs/common/event-listener-manager.js.map +1 -1
  24. package/cjs/common/event-transformer.js +42 -7
  25. package/cjs/common/event-transformer.js.map +1 -1
  26. package/cjs/common/explicit-binding.d.ts +5 -0
  27. package/cjs/common/explicit-binding.js +16 -0
  28. package/cjs/common/explicit-binding.js.map +1 -0
  29. package/cjs/common/performance-raf.d.ts +1 -0
  30. package/cjs/common/performance-raf.js +7 -2
  31. package/cjs/common/performance-raf.js.map +1 -1
  32. package/cjs/common/rect-utils.js +1 -1
  33. package/cjs/common/render-area.js +1 -1
  34. package/cjs/common/render-command-list.js +1 -1
  35. package/cjs/common/render-curve.js +1 -1
  36. package/cjs/common/render-utils.js +1 -1
  37. package/cjs/common/seg-context.js +1 -1
  38. package/cjs/common/simplify.js +1 -1
  39. package/cjs/common/sort.js +2 -1
  40. package/cjs/common/split-path.js +1 -1
  41. package/cjs/common/store.js +1 -1
  42. package/cjs/common/text.js +1 -1
  43. package/cjs/common/utils.js +1 -1
  44. package/cjs/core/contributions/env/modules.d.ts +4 -0
  45. package/cjs/core/contributions/env/modules.js +14 -0
  46. package/cjs/core/contributions/env/modules.js.map +1 -0
  47. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
  48. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  49. package/cjs/core/contributions/layerHandler/empty-contribution.js +2 -2
  50. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  51. package/cjs/core/contributions/layerHandler/modules.d.ts +4 -0
  52. package/cjs/core/contributions/layerHandler/modules.js +14 -0
  53. package/cjs/core/contributions/layerHandler/modules.js.map +1 -0
  54. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
  55. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  56. package/cjs/core/contributions/modules.d.ts +2 -1
  57. package/cjs/core/contributions/modules.js +20 -2
  58. package/cjs/core/contributions/modules.js.map +1 -1
  59. package/cjs/core/contributions/textMeasure/modules.d.ts +4 -0
  60. package/cjs/core/contributions/textMeasure/modules.js +15 -0
  61. package/cjs/core/contributions/textMeasure/modules.js.map +1 -0
  62. package/cjs/core/core-modules.d.ts +4 -0
  63. package/cjs/core/core-modules.js +19 -0
  64. package/cjs/core/core-modules.js.map +1 -0
  65. package/cjs/core/global-module.d.ts +1 -0
  66. package/cjs/core/global-module.js +1 -0
  67. package/cjs/core/global-module.js.map +1 -0
  68. package/cjs/core/global.d.ts +4 -2
  69. package/cjs/core/global.js +9 -6
  70. package/cjs/core/global.js.map +1 -1
  71. package/cjs/core/graphic-utils.d.ts +3 -4
  72. package/cjs/core/graphic-utils.js +5 -6
  73. package/cjs/core/graphic-utils.js.map +1 -1
  74. package/cjs/core/index.js +1 -1
  75. package/cjs/core/layer-service.d.ts +7 -2
  76. package/cjs/core/layer-service.js +24 -15
  77. package/cjs/core/layer-service.js.map +1 -1
  78. package/cjs/core/layer.d.ts +1 -1
  79. package/cjs/core/layer.js +4 -4
  80. package/cjs/core/layer.js.map +1 -1
  81. package/cjs/core/light.js +1 -1
  82. package/cjs/core/stage.d.ts +17 -3
  83. package/cjs/core/stage.js +48 -26
  84. package/cjs/core/stage.js.map +1 -1
  85. package/cjs/core/window.d.ts +7 -5
  86. package/cjs/core/window.js +12 -8
  87. package/cjs/core/window.js.map +1 -1
  88. package/cjs/create.d.ts +1 -2
  89. package/cjs/create.js +2 -2
  90. package/cjs/create.js.map +1 -1
  91. package/cjs/entries/app-context.d.ts +30 -0
  92. package/cjs/entries/app-context.js +84 -0
  93. package/cjs/entries/app-context.js.map +1 -0
  94. package/cjs/entries/browser.d.ts +25 -0
  95. package/cjs/entries/browser.js +44 -0
  96. package/cjs/entries/browser.js.map +1 -0
  97. package/cjs/entries/index.d.ts +7 -0
  98. package/cjs/entries/index.js +32 -0
  99. package/cjs/entries/index.js.map +1 -0
  100. package/cjs/entries/miniapp.d.ts +6 -0
  101. package/cjs/entries/miniapp.js +20 -0
  102. package/cjs/entries/miniapp.js.map +1 -0
  103. package/cjs/entries/node.d.ts +6 -0
  104. package/cjs/entries/node.js +20 -0
  105. package/cjs/entries/node.js.map +1 -0
  106. package/cjs/entries/runtime-installer.d.ts +11 -0
  107. package/cjs/entries/runtime-installer.js +111 -0
  108. package/cjs/entries/runtime-installer.js.map +1 -0
  109. package/cjs/entries/types.d.ts +29 -0
  110. package/cjs/entries/types.js.map +1 -0
  111. package/cjs/env-check.js +3 -3
  112. package/cjs/env-check.js.map +1 -1
  113. package/cjs/event/event-manager.js +4 -1
  114. package/cjs/event/event-manager.js.map +1 -1
  115. package/cjs/event/util.d.ts +1 -1
  116. package/cjs/factory/graphic-factory.d.ts +7 -0
  117. package/cjs/factory/graphic-factory.js +23 -0
  118. package/cjs/factory/graphic-factory.js.map +1 -0
  119. package/cjs/factory/index.d.ts +4 -0
  120. package/cjs/factory/index.js +22 -0
  121. package/cjs/factory/index.js.map +1 -0
  122. package/cjs/factory/layer-factory.d.ts +7 -0
  123. package/cjs/factory/layer-factory.js +19 -0
  124. package/cjs/factory/layer-factory.js.map +1 -0
  125. package/cjs/factory/stage-factory.d.ts +8 -0
  126. package/cjs/factory/stage-factory.js +20 -0
  127. package/cjs/factory/stage-factory.js.map +1 -0
  128. package/cjs/factory/types.d.ts +34 -0
  129. package/cjs/factory/types.js +6 -0
  130. package/cjs/factory/types.js.map +1 -0
  131. package/cjs/factory.d.ts +1 -0
  132. package/cjs/factory.js +16 -1
  133. package/cjs/factory.js.map +1 -1
  134. package/cjs/global.d.ts +2 -0
  135. package/cjs/global.js +11 -0
  136. package/cjs/global.js.map +1 -0
  137. package/cjs/graphic/arc.js +3 -3
  138. package/cjs/graphic/arc.js.map +1 -1
  139. package/cjs/graphic/arc3d.js +3 -3
  140. package/cjs/graphic/arc3d.js.map +1 -1
  141. package/cjs/graphic/area.js +3 -3
  142. package/cjs/graphic/area.js.map +1 -1
  143. package/cjs/graphic/bounds.js +3 -3
  144. package/cjs/graphic/bounds.js.map +1 -1
  145. package/cjs/graphic/circle.js +3 -3
  146. package/cjs/graphic/circle.js.map +1 -1
  147. package/cjs/graphic/config.js +7 -1
  148. package/cjs/graphic/config.js.map +1 -1
  149. package/cjs/graphic/glyph.js +9 -3
  150. package/cjs/graphic/glyph.js.map +1 -1
  151. package/cjs/graphic/graphic-creator.d.ts +9 -4
  152. package/cjs/graphic/graphic-creator.js +35 -7
  153. package/cjs/graphic/graphic-creator.js.map +1 -1
  154. package/cjs/graphic/graphic-service/graphic-module.d.ts +4 -0
  155. package/cjs/graphic/graphic-service/graphic-module.js +14 -0
  156. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -0
  157. package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -3
  158. package/cjs/graphic/graphic-service/graphic-service.js +3 -4
  159. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  160. package/cjs/graphic/graphic.d.ts +78 -7
  161. package/cjs/graphic/graphic.js +491 -146
  162. package/cjs/graphic/graphic.js.map +1 -1
  163. package/cjs/graphic/group.d.ts +11 -1
  164. package/cjs/graphic/group.js +49 -13
  165. package/cjs/graphic/group.js.map +1 -1
  166. package/cjs/graphic/image.d.ts +1 -0
  167. package/cjs/graphic/image.js +4 -3
  168. package/cjs/graphic/image.js.map +1 -1
  169. package/cjs/graphic/index.d.ts +3 -0
  170. package/cjs/graphic/index.js +34 -15
  171. package/cjs/graphic/index.js.map +1 -1
  172. package/cjs/graphic/line.js +3 -3
  173. package/cjs/graphic/line.js.map +1 -1
  174. package/cjs/graphic/path.js +3 -3
  175. package/cjs/graphic/path.js.map +1 -1
  176. package/cjs/graphic/polygon.js +3 -3
  177. package/cjs/graphic/polygon.js.map +1 -1
  178. package/cjs/graphic/pyramid3d.js +3 -2
  179. package/cjs/graphic/pyramid3d.js.map +1 -1
  180. package/cjs/graphic/rect.js +3 -3
  181. package/cjs/graphic/rect.js.map +1 -1
  182. package/cjs/graphic/richtext/utils.js +3 -3
  183. package/cjs/graphic/richtext/utils.js.map +1 -1
  184. package/cjs/graphic/richtext.js +4 -4
  185. package/cjs/graphic/richtext.js.map +1 -1
  186. package/cjs/graphic/star.js +3 -3
  187. package/cjs/graphic/star.js.map +1 -1
  188. package/cjs/graphic/state/attribute-update-classifier.d.ts +13 -0
  189. package/cjs/graphic/state/attribute-update-classifier.js +67 -0
  190. package/cjs/graphic/state/attribute-update-classifier.js.map +1 -0
  191. package/cjs/graphic/state/shared-state-refresh.d.ts +6 -0
  192. package/cjs/graphic/state/shared-state-refresh.js +55 -0
  193. package/cjs/graphic/state/shared-state-refresh.js.map +1 -0
  194. package/cjs/graphic/state/shared-state-scope.d.ts +25 -0
  195. package/cjs/graphic/state/shared-state-scope.js +98 -0
  196. package/cjs/graphic/state/shared-state-scope.js.map +1 -0
  197. package/cjs/graphic/state/state-batch-scheduler.d.ts +42 -0
  198. package/cjs/graphic/state/state-batch-scheduler.js +285 -0
  199. package/cjs/graphic/state/state-batch-scheduler.js.map +1 -0
  200. package/cjs/graphic/state/state-definition-compiler.d.ts +6 -0
  201. package/cjs/graphic/state/state-definition-compiler.js +91 -0
  202. package/cjs/graphic/state/state-definition-compiler.js.map +1 -0
  203. package/cjs/graphic/state/state-definition.d.ts +44 -0
  204. package/cjs/graphic/state/state-definition.js +6 -0
  205. package/cjs/graphic/state/state-definition.js.map +1 -0
  206. package/cjs/graphic/state/state-engine.d.ts +38 -0
  207. package/cjs/graphic/state/state-engine.js +220 -0
  208. package/cjs/graphic/state/state-engine.js.map +1 -0
  209. package/cjs/graphic/state/state-model.d.ts +43 -0
  210. package/cjs/graphic/state/state-model.js +143 -0
  211. package/cjs/graphic/state/state-model.js.map +1 -0
  212. package/cjs/graphic/state/state-perf-monitor.d.ts +119 -0
  213. package/cjs/graphic/state/state-perf-monitor.js +217 -0
  214. package/cjs/graphic/state/state-perf-monitor.js.map +1 -0
  215. package/cjs/graphic/state/state-style-resolver.d.ts +22 -0
  216. package/cjs/graphic/state/state-style-resolver.js +73 -0
  217. package/cjs/graphic/state/state-style-resolver.js.map +1 -0
  218. package/cjs/graphic/state/state-transition-orchestrator.d.ts +41 -0
  219. package/cjs/graphic/state/state-transition-orchestrator.js +74 -0
  220. package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -0
  221. package/cjs/graphic/symbol.js +3 -3
  222. package/cjs/graphic/symbol.js.map +1 -1
  223. package/cjs/graphic/text.d.ts +3 -2
  224. package/cjs/graphic/text.js +29 -20
  225. package/cjs/graphic/text.js.map +1 -1
  226. package/cjs/graphic/theme.d.ts +5 -0
  227. package/cjs/graphic/theme.js +7 -0
  228. package/cjs/graphic/theme.js.map +1 -1
  229. package/cjs/graphic/tools.js +2 -2
  230. package/cjs/graphic/tools.js.map +1 -1
  231. package/cjs/graphic/wrap-text.d.ts +1 -1
  232. package/cjs/graphic/wrap-text.js +18 -15
  233. package/cjs/graphic/wrap-text.js.map +1 -1
  234. package/cjs/index.d.ts +26 -4
  235. package/cjs/index.js +83 -45
  236. package/cjs/index.js.map +1 -1
  237. package/cjs/interface/canvas.d.ts +1 -1
  238. package/cjs/interface/canvas.js.map +1 -1
  239. package/cjs/interface/global.d.ts +2 -0
  240. package/cjs/interface/global.js.map +1 -1
  241. package/cjs/interface/graphic/group.d.ts +6 -0
  242. package/cjs/interface/graphic/group.js.map +1 -1
  243. package/cjs/interface/graphic/image.d.ts +7 -1
  244. package/cjs/interface/graphic/image.js.map +1 -1
  245. package/cjs/interface/graphic/theme.d.ts +3 -0
  246. package/cjs/interface/graphic/theme.js.map +1 -1
  247. package/cjs/interface/graphic.d.ts +34 -5
  248. package/cjs/interface/graphic.js.map +1 -1
  249. package/cjs/interface/layer.d.ts +3 -2
  250. package/cjs/interface/layer.js.map +1 -1
  251. package/cjs/interface/plugin.d.ts +2 -0
  252. package/cjs/interface/plugin.js.map +1 -1
  253. package/cjs/interface/render.d.ts +1 -1
  254. package/cjs/interface/render.js.map +1 -1
  255. package/cjs/interface/stage.d.ts +9 -0
  256. package/cjs/interface/stage.js.map +1 -1
  257. package/cjs/interface/theme-service.js.map +1 -1
  258. package/cjs/legacy/binding-context.d.ts +24 -0
  259. package/cjs/legacy/binding-context.js +98 -0
  260. package/cjs/legacy/binding-context.js.map +1 -0
  261. package/cjs/legacy/bootstrap.d.ts +10 -0
  262. package/cjs/legacy/bootstrap.js +72 -0
  263. package/cjs/legacy/bootstrap.js.map +1 -0
  264. package/cjs/legacy/module-types.d.ts +2 -0
  265. package/cjs/legacy/module-types.js +6 -0
  266. package/cjs/legacy/module-types.js.map +1 -0
  267. package/cjs/modules.d.ts +5 -6
  268. package/cjs/modules.js +54 -9
  269. package/cjs/modules.js.map +1 -1
  270. package/cjs/picker/global-picker-service.js +2 -2
  271. package/cjs/picker/global-picker-service.js.map +1 -1
  272. package/cjs/picker/pick-modules.d.ts +5 -0
  273. package/cjs/picker/pick-modules.js +24 -0
  274. package/cjs/picker/pick-modules.js.map +1 -0
  275. package/cjs/picker/picker-service.d.ts +13 -4
  276. package/cjs/picker/picker-service.js +15 -8
  277. package/cjs/picker/picker-service.js.map +1 -1
  278. package/cjs/plugins/base-plugin.d.ts +8 -0
  279. package/cjs/plugins/base-plugin.js +15 -0
  280. package/cjs/plugins/base-plugin.js.map +1 -0
  281. package/cjs/plugins/browser-env-plugin.d.ts +8 -0
  282. package/cjs/plugins/browser-env-plugin.js +24 -0
  283. package/cjs/plugins/browser-env-plugin.js.map +1 -0
  284. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +6 -5
  285. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
  286. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  287. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
  288. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +25 -4
  289. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  290. package/cjs/plugins/builtin-plugin/edit-module.js +4 -3
  291. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  292. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  293. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +8 -8
  294. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  295. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +2 -2
  296. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  297. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +3 -3
  298. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  299. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +13 -9
  300. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  301. package/cjs/plugins/index.d.ts +5 -0
  302. package/cjs/plugins/index.js +23 -0
  303. package/cjs/plugins/index.js.map +1 -0
  304. package/cjs/plugins/picker-plugin.d.ts +7 -0
  305. package/cjs/plugins/picker-plugin.js +19 -0
  306. package/cjs/plugins/picker-plugin.js.map +1 -0
  307. package/cjs/plugins/plugin-modules.d.ts +4 -0
  308. package/cjs/plugins/plugin-modules.js +14 -0
  309. package/cjs/plugins/plugin-modules.js.map +1 -0
  310. package/cjs/plugins/plugin-service.d.ts +16 -2
  311. package/cjs/plugins/plugin-service.js +23 -11
  312. package/cjs/plugins/plugin-service.js.map +1 -1
  313. package/cjs/plugins/renderer-plugin.d.ts +7 -0
  314. package/cjs/plugins/renderer-plugin.js +19 -0
  315. package/cjs/plugins/renderer-plugin.js.map +1 -0
  316. package/cjs/plugins/types.d.ts +28 -0
  317. package/cjs/plugins/types.js +6 -0
  318. package/cjs/plugins/types.js.map +1 -0
  319. package/cjs/register/register-arc.js +1 -1
  320. package/cjs/register/register-arc.js.map +1 -1
  321. package/cjs/register/register-arc3d.js +1 -1
  322. package/cjs/register/register-arc3d.js.map +1 -1
  323. package/cjs/register/register-area.js +1 -1
  324. package/cjs/register/register-area.js.map +1 -1
  325. package/cjs/register/register-circle.js +1 -1
  326. package/cjs/register/register-circle.js.map +1 -1
  327. package/cjs/register/register-glyph.js +1 -1
  328. package/cjs/register/register-glyph.js.map +1 -1
  329. package/cjs/register/register-group.js +1 -1
  330. package/cjs/register/register-group.js.map +1 -1
  331. package/cjs/register/register-image.js +1 -1
  332. package/cjs/register/register-image.js.map +1 -1
  333. package/cjs/register/register-line.js +1 -1
  334. package/cjs/register/register-line.js.map +1 -1
  335. package/cjs/register/register-path.js +1 -1
  336. package/cjs/register/register-path.js.map +1 -1
  337. package/cjs/register/register-polygon.js +1 -1
  338. package/cjs/register/register-polygon.js.map +1 -1
  339. package/cjs/register/register-pyramid3d.js +1 -1
  340. package/cjs/register/register-pyramid3d.js.map +1 -1
  341. package/cjs/register/register-rect.js +1 -1
  342. package/cjs/register/register-rect.js.map +1 -1
  343. package/cjs/register/register-rect3d.js +1 -1
  344. package/cjs/register/register-rect3d.js.map +1 -1
  345. package/cjs/register/register-richtext.js +1 -1
  346. package/cjs/register/register-richtext.js.map +1 -1
  347. package/cjs/register/register-shadowRoot.js +1 -1
  348. package/cjs/register/register-shadowRoot.js.map +1 -1
  349. package/cjs/register/register-star.js +1 -1
  350. package/cjs/register/register-star.js.map +1 -1
  351. package/cjs/register/register-symbol.js +1 -1
  352. package/cjs/register/register-symbol.js.map +1 -1
  353. package/cjs/register/register-text.js +1 -1
  354. package/cjs/register/register-text.js.map +1 -1
  355. package/cjs/register/register-wraptext.js +1 -1
  356. package/cjs/register/register-wraptext.js.map +1 -1
  357. package/cjs/registry/contribution-registry.d.ts +9 -0
  358. package/cjs/registry/contribution-registry.js +33 -0
  359. package/cjs/registry/contribution-registry.js.map +1 -0
  360. package/cjs/registry/index.d.ts +5 -0
  361. package/cjs/registry/index.js +23 -0
  362. package/cjs/registry/index.js.map +1 -0
  363. package/cjs/registry/picker-registry.d.ts +10 -0
  364. package/cjs/registry/picker-registry.js +29 -0
  365. package/cjs/registry/picker-registry.js.map +1 -0
  366. package/cjs/registry/plugin-registry.d.ts +10 -0
  367. package/cjs/registry/plugin-registry.js +29 -0
  368. package/cjs/registry/plugin-registry.js.map +1 -0
  369. package/cjs/registry/renderer-registry.d.ts +11 -0
  370. package/cjs/registry/renderer-registry.js +37 -0
  371. package/cjs/registry/renderer-registry.js.map +1 -0
  372. package/cjs/registry/types.d.ts +34 -0
  373. package/cjs/registry/types.js +6 -0
  374. package/cjs/registry/types.js.map +1 -0
  375. package/cjs/render/contributions/modules.d.ts +2 -0
  376. package/cjs/render/contributions/modules.js +22 -0
  377. package/cjs/render/contributions/modules.js.map +1 -0
  378. package/cjs/render/contributions/render/arc-module.d.ts +4 -0
  379. package/cjs/render/contributions/render/arc-module.js +19 -0
  380. package/cjs/render/contributions/render/arc-module.js.map +1 -0
  381. package/cjs/render/contributions/render/arc-render.d.ts +2 -2
  382. package/cjs/render/contributions/render/arc-render.js +4 -5
  383. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  384. package/cjs/render/contributions/render/arc3d-module.d.ts +4 -0
  385. package/cjs/render/contributions/render/arc3d-module.js +17 -0
  386. package/cjs/render/contributions/render/arc3d-module.js.map +1 -0
  387. package/cjs/render/contributions/render/area-module.d.ts +4 -0
  388. package/cjs/render/contributions/render/area-module.js +20 -0
  389. package/cjs/render/contributions/render/area-module.js.map +1 -0
  390. package/cjs/render/contributions/render/area-render.d.ts +2 -2
  391. package/cjs/render/contributions/render/area-render.js +4 -5
  392. package/cjs/render/contributions/render/area-render.js.map +1 -1
  393. package/cjs/render/contributions/render/base-render.js +1 -1
  394. package/cjs/render/contributions/render/base-render.js.map +1 -1
  395. package/cjs/render/contributions/render/circle-module.d.ts +4 -0
  396. package/cjs/render/contributions/render/circle-module.js +19 -0
  397. package/cjs/render/contributions/render/circle-module.js.map +1 -0
  398. package/cjs/render/contributions/render/circle-render.d.ts +2 -2
  399. package/cjs/render/contributions/render/circle-render.js +4 -5
  400. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  401. package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +29 -11
  402. package/cjs/render/contributions/render/contributions/base-contribution-render.js +150 -39
  403. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  404. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +4 -2
  405. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +84 -31
  406. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  407. package/cjs/render/contributions/render/contributions/group-contribution-render.js +8 -6
  408. package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  409. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +2 -1
  410. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  411. package/cjs/render/contributions/render/contributions/text-contribution-render.js +20 -16
  412. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  413. package/cjs/render/contributions/render/draw-contribution.d.ts +13 -4
  414. package/cjs/render/contributions/render/draw-contribution.js +37 -13
  415. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  416. package/cjs/render/contributions/render/draw-interceptor.js +2 -3
  417. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  418. package/cjs/render/contributions/render/glyph-module.d.ts +4 -0
  419. package/cjs/render/contributions/render/glyph-module.js +17 -0
  420. package/cjs/render/contributions/render/glyph-module.js.map +1 -0
  421. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  422. package/cjs/render/contributions/render/group-render.js +3 -5
  423. package/cjs/render/contributions/render/group-render.js.map +1 -1
  424. package/cjs/render/contributions/render/image-module.d.ts +4 -0
  425. package/cjs/render/contributions/render/image-module.js +18 -0
  426. package/cjs/render/contributions/render/image-module.js.map +1 -0
  427. package/cjs/render/contributions/render/image-render.d.ts +16 -3
  428. package/cjs/render/contributions/render/image-render.js +101 -24
  429. package/cjs/render/contributions/render/image-render.js.map +1 -1
  430. package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +5 -3
  431. package/cjs/render/contributions/render/incremental-draw-contribution.js +5 -7
  432. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  433. package/cjs/render/contributions/render/index.d.ts +4 -12
  434. package/cjs/render/contributions/render/index.js +7 -11
  435. package/cjs/render/contributions/render/index.js.map +1 -1
  436. package/cjs/render/contributions/render/line-module.d.ts +4 -0
  437. package/cjs/render/contributions/render/line-module.js +19 -0
  438. package/cjs/render/contributions/render/line-module.js.map +1 -0
  439. package/cjs/render/contributions/render/module.d.ts +4 -0
  440. package/cjs/render/contributions/render/module.js +27 -0
  441. package/cjs/render/contributions/render/module.js.map +1 -0
  442. package/cjs/render/contributions/render/path-module.d.ts +4 -0
  443. package/cjs/render/contributions/render/path-module.js +19 -0
  444. package/cjs/render/contributions/render/path-module.js.map +1 -0
  445. package/cjs/render/contributions/render/path-render.d.ts +2 -2
  446. package/cjs/render/contributions/render/path-render.js +4 -5
  447. package/cjs/render/contributions/render/path-render.js.map +1 -1
  448. package/cjs/render/contributions/render/polygon-module.d.ts +4 -0
  449. package/cjs/render/contributions/render/polygon-module.js +18 -0
  450. package/cjs/render/contributions/render/polygon-module.js.map +1 -0
  451. package/cjs/render/contributions/render/polygon-render.d.ts +2 -2
  452. package/cjs/render/contributions/render/polygon-render.js +4 -5
  453. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  454. package/cjs/render/contributions/render/pyramid3d-module.d.ts +4 -0
  455. package/cjs/render/contributions/render/pyramid3d-module.js +17 -0
  456. package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -0
  457. package/cjs/render/contributions/render/rect-module.d.ts +4 -0
  458. package/cjs/render/contributions/render/rect-module.js +23 -0
  459. package/cjs/render/contributions/render/rect-module.js.map +1 -0
  460. package/cjs/render/contributions/render/rect-render.d.ts +2 -2
  461. package/cjs/render/contributions/render/rect-render.js +4 -5
  462. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  463. package/cjs/render/contributions/render/rect3d-module.d.ts +4 -0
  464. package/cjs/render/contributions/render/rect3d-module.js +17 -0
  465. package/cjs/render/contributions/render/rect3d-module.js.map +1 -0
  466. package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
  467. package/cjs/render/contributions/render/render-slector.js.map +1 -1
  468. package/cjs/render/contributions/render/richtext-module.d.ts +4 -0
  469. package/cjs/render/contributions/render/richtext-module.js +17 -0
  470. package/cjs/render/contributions/render/richtext-module.js.map +1 -0
  471. package/cjs/render/contributions/render/star-module.d.ts +4 -0
  472. package/cjs/render/contributions/render/star-module.js +18 -0
  473. package/cjs/render/contributions/render/star-module.js.map +1 -0
  474. package/cjs/render/contributions/render/star-render.d.ts +2 -2
  475. package/cjs/render/contributions/render/star-render.js +4 -5
  476. package/cjs/render/contributions/render/star-render.js.map +1 -1
  477. package/cjs/render/contributions/render/symbol-module.d.ts +4 -0
  478. package/cjs/render/contributions/render/symbol-module.js +19 -0
  479. package/cjs/render/contributions/render/symbol-module.js.map +1 -0
  480. package/cjs/render/contributions/render/symbol-render.d.ts +2 -2
  481. package/cjs/render/contributions/render/symbol-render.js +4 -5
  482. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  483. package/cjs/render/contributions/render/symbol.d.ts +0 -2
  484. package/cjs/render/contributions/render/symbol.js +1 -3
  485. package/cjs/render/contributions/render/symbol.js.map +1 -1
  486. package/cjs/render/contributions/render/text-module.d.ts +4 -0
  487. package/cjs/render/contributions/render/text-module.js +18 -0
  488. package/cjs/render/contributions/render/text-module.js.map +1 -0
  489. package/cjs/render/contributions/render/text-render.d.ts +2 -2
  490. package/cjs/render/contributions/render/text-render.js +4 -5
  491. package/cjs/render/contributions/render/text-render.js.map +1 -1
  492. package/cjs/render/render-modules.d.ts +4 -0
  493. package/cjs/render/render-modules.js +14 -0
  494. package/cjs/render/render-modules.js.map +1 -0
  495. package/cjs/render/render-service.d.ts +1 -1
  496. package/cjs/render/render-service.js +3 -1
  497. package/cjs/render/render-service.js.map +1 -1
  498. package/cjs/resource-loader/loader.js +6 -6
  499. package/cjs/resource-loader/loader.js.map +1 -1
  500. package/dist/index.es.js +23955 -20200
  501. package/es/allocator/canvas-allocate.js +6 -8
  502. package/es/allocator/canvas-allocate.js.map +1 -1
  503. package/es/allocator/graphic-allocate.js +17 -17
  504. package/es/allocator/graphic-allocate.js.map +1 -1
  505. package/es/application.d.ts +19 -18
  506. package/es/application.js +1 -39
  507. package/es/application.js.map +1 -1
  508. package/es/canvas/conical-gradient.js +2 -2
  509. package/es/canvas/conical-gradient.js.map +1 -1
  510. package/es/canvas/contributions/base-canvas.js +2 -2
  511. package/es/canvas/contributions/base-canvas.js.map +1 -1
  512. package/es/canvas/util.d.ts +2 -3
  513. package/es/canvas/util.js +16 -8
  514. package/es/canvas/util.js.map +1 -1
  515. package/es/common/contribution-provider.d.ts +27 -0
  516. package/es/common/contribution-provider.js +43 -0
  517. package/es/common/contribution-provider.js.map +1 -0
  518. package/es/common/enums.d.ts +2 -0
  519. package/es/common/enums.js +3 -1
  520. package/es/common/enums.js.map +1 -1
  521. package/es/common/event-listener-manager.d.ts +18 -1
  522. package/es/common/event-listener-manager.js +40 -10
  523. package/es/common/event-listener-manager.js.map +1 -1
  524. package/es/common/event-transformer.js +42 -7
  525. package/es/common/event-transformer.js.map +1 -1
  526. package/es/common/explicit-binding.d.ts +5 -0
  527. package/es/common/explicit-binding.js +10 -0
  528. package/es/common/explicit-binding.js.map +1 -0
  529. package/es/common/performance-raf.d.ts +1 -0
  530. package/es/common/performance-raf.js +7 -2
  531. package/es/common/performance-raf.js.map +1 -1
  532. package/es/common/rect-utils.js +1 -1
  533. package/es/common/render-area.js +1 -1
  534. package/es/common/render-command-list.js +1 -1
  535. package/es/common/render-curve.js +1 -1
  536. package/es/common/render-utils.js +1 -1
  537. package/es/common/seg-context.js +1 -1
  538. package/es/common/simplify.js +1 -1
  539. package/es/common/sort.js +2 -1
  540. package/es/common/split-path.js +1 -1
  541. package/es/common/store.js +1 -1
  542. package/es/common/text.js +1 -1
  543. package/es/common/utils.js +1 -1
  544. package/es/core/contributions/env/modules.d.ts +4 -0
  545. package/es/core/contributions/env/modules.js +10 -0
  546. package/es/core/contributions/env/modules.js.map +1 -0
  547. package/es/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
  548. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  549. package/es/core/contributions/layerHandler/empty-contribution.js +2 -2
  550. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  551. package/es/core/contributions/layerHandler/modules.d.ts +4 -0
  552. package/es/core/contributions/layerHandler/modules.js +10 -0
  553. package/es/core/contributions/layerHandler/modules.js.map +1 -0
  554. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
  555. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  556. package/es/core/contributions/modules.d.ts +2 -1
  557. package/es/core/contributions/modules.js +15 -1
  558. package/es/core/contributions/modules.js.map +1 -1
  559. package/es/core/contributions/textMeasure/modules.d.ts +4 -0
  560. package/es/core/contributions/textMeasure/modules.js +11 -0
  561. package/es/core/contributions/textMeasure/modules.js.map +1 -0
  562. package/es/core/core-modules.d.ts +4 -0
  563. package/es/core/core-modules.js +24 -0
  564. package/es/core/core-modules.js.map +1 -0
  565. package/es/core/global-module.d.ts +1 -0
  566. package/es/core/global-module.js +1 -0
  567. package/es/core/global-module.js.map +1 -0
  568. package/es/core/global.d.ts +4 -2
  569. package/es/core/global.js +8 -9
  570. package/es/core/global.js.map +1 -1
  571. package/es/core/graphic-utils.d.ts +3 -4
  572. package/es/core/graphic-utils.js +7 -12
  573. package/es/core/graphic-utils.js.map +1 -1
  574. package/es/core/index.js +1 -1
  575. package/es/core/layer-service.d.ts +7 -2
  576. package/es/core/layer-service.js +24 -19
  577. package/es/core/layer-service.js.map +1 -1
  578. package/es/core/layer.d.ts +1 -1
  579. package/es/core/layer.js +4 -4
  580. package/es/core/layer.js.map +1 -1
  581. package/es/core/light.js +1 -1
  582. package/es/core/stage.d.ts +17 -3
  583. package/es/core/stage.js +59 -31
  584. package/es/core/stage.js.map +1 -1
  585. package/es/core/window.d.ts +7 -5
  586. package/es/core/window.js +12 -10
  587. package/es/core/window.js.map +1 -1
  588. package/es/create.d.ts +1 -2
  589. package/es/create.js +4 -2
  590. package/es/create.js.map +1 -1
  591. package/es/entries/app-context.d.ts +30 -0
  592. package/es/entries/app-context.js +86 -0
  593. package/es/entries/app-context.js.map +1 -0
  594. package/es/entries/browser.d.ts +25 -0
  595. package/es/entries/browser.js +36 -0
  596. package/es/entries/browser.js.map +1 -0
  597. package/es/entries/index.d.ts +7 -0
  598. package/es/entries/index.js +14 -0
  599. package/es/entries/index.js.map +1 -0
  600. package/es/entries/miniapp.d.ts +6 -0
  601. package/es/entries/miniapp.js +12 -0
  602. package/es/entries/miniapp.js.map +1 -0
  603. package/es/entries/node.d.ts +6 -0
  604. package/es/entries/node.js +12 -0
  605. package/es/entries/node.js.map +1 -0
  606. package/es/entries/runtime-installer.d.ts +11 -0
  607. package/es/entries/runtime-installer.js +130 -0
  608. package/es/entries/runtime-installer.js.map +1 -0
  609. package/es/entries/types.d.ts +29 -0
  610. package/es/entries/types.js.map +1 -0
  611. package/es/env-check.js +3 -3
  612. package/es/env-check.js.map +1 -1
  613. package/es/event/event-manager.js +4 -1
  614. package/es/event/event-manager.js.map +1 -1
  615. package/es/event/util.d.ts +1 -1
  616. package/es/factory/graphic-factory.d.ts +7 -0
  617. package/es/factory/graphic-factory.js +15 -0
  618. package/es/factory/graphic-factory.js.map +1 -0
  619. package/es/factory/index.d.ts +4 -0
  620. package/es/factory/index.js +8 -0
  621. package/es/factory/index.js.map +1 -0
  622. package/es/factory/layer-factory.d.ts +7 -0
  623. package/es/factory/layer-factory.js +11 -0
  624. package/es/factory/layer-factory.js.map +1 -0
  625. package/es/factory/stage-factory.d.ts +8 -0
  626. package/es/factory/stage-factory.js +12 -0
  627. package/es/factory/stage-factory.js.map +1 -0
  628. package/es/factory/types.d.ts +34 -0
  629. package/es/factory/types.js +2 -0
  630. package/es/factory/types.js.map +1 -0
  631. package/es/factory.d.ts +1 -0
  632. package/es/factory.js +2 -0
  633. package/es/factory.js.map +1 -1
  634. package/es/global.d.ts +2 -0
  635. package/es/global.js +10 -0
  636. package/es/global.js.map +1 -0
  637. package/es/graphic/arc.js +3 -3
  638. package/es/graphic/arc.js.map +1 -1
  639. package/es/graphic/arc3d.js +4 -3
  640. package/es/graphic/arc3d.js.map +1 -1
  641. package/es/graphic/area.js +3 -3
  642. package/es/graphic/area.js.map +1 -1
  643. package/es/graphic/bounds.js +3 -3
  644. package/es/graphic/bounds.js.map +1 -1
  645. package/es/graphic/circle.js +3 -3
  646. package/es/graphic/circle.js.map +1 -1
  647. package/es/graphic/config.js +7 -1
  648. package/es/graphic/config.js.map +1 -1
  649. package/es/graphic/glyph.js +9 -3
  650. package/es/graphic/glyph.js.map +1 -1
  651. package/es/graphic/graphic-creator.d.ts +9 -4
  652. package/es/graphic/graphic-creator.js +32 -5
  653. package/es/graphic/graphic-creator.js.map +1 -1
  654. package/es/graphic/graphic-service/graphic-module.d.ts +4 -0
  655. package/es/graphic/graphic-service/graphic-module.js +12 -0
  656. package/es/graphic/graphic-service/graphic-module.js.map +1 -0
  657. package/es/graphic/graphic-service/graphic-service.d.ts +2 -3
  658. package/es/graphic/graphic-service/graphic-service.js +3 -5
  659. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  660. package/es/graphic/graphic.d.ts +78 -7
  661. package/es/graphic/graphic.js +490 -140
  662. package/es/graphic/graphic.js.map +1 -1
  663. package/es/graphic/group.d.ts +11 -1
  664. package/es/graphic/group.js +49 -13
  665. package/es/graphic/group.js.map +1 -1
  666. package/es/graphic/image.d.ts +1 -0
  667. package/es/graphic/image.js +5 -4
  668. package/es/graphic/image.js.map +1 -1
  669. package/es/graphic/index.d.ts +3 -0
  670. package/es/graphic/index.js +4 -0
  671. package/es/graphic/index.js.map +1 -1
  672. package/es/graphic/line.js +3 -3
  673. package/es/graphic/line.js.map +1 -1
  674. package/es/graphic/path.js +3 -3
  675. package/es/graphic/path.js.map +1 -1
  676. package/es/graphic/polygon.js +3 -3
  677. package/es/graphic/polygon.js.map +1 -1
  678. package/es/graphic/pyramid3d.js +2 -2
  679. package/es/graphic/pyramid3d.js.map +1 -1
  680. package/es/graphic/rect.js +3 -3
  681. package/es/graphic/rect.js.map +1 -1
  682. package/es/graphic/richtext/utils.js +3 -3
  683. package/es/graphic/richtext/utils.js.map +1 -1
  684. package/es/graphic/richtext.js +4 -4
  685. package/es/graphic/richtext.js.map +1 -1
  686. package/es/graphic/star.js +3 -3
  687. package/es/graphic/star.js.map +1 -1
  688. package/es/graphic/state/attribute-update-classifier.d.ts +13 -0
  689. package/es/graphic/state/attribute-update-classifier.js +61 -0
  690. package/es/graphic/state/attribute-update-classifier.js.map +1 -0
  691. package/es/graphic/state/shared-state-refresh.d.ts +6 -0
  692. package/es/graphic/state/shared-state-refresh.js +46 -0
  693. package/es/graphic/state/shared-state-refresh.js.map +1 -0
  694. package/es/graphic/state/shared-state-scope.d.ts +25 -0
  695. package/es/graphic/state/shared-state-scope.js +90 -0
  696. package/es/graphic/state/shared-state-scope.js.map +1 -0
  697. package/es/graphic/state/state-batch-scheduler.d.ts +42 -0
  698. package/es/graphic/state/state-batch-scheduler.js +278 -0
  699. package/es/graphic/state/state-batch-scheduler.js.map +1 -0
  700. package/es/graphic/state/state-definition-compiler.d.ts +6 -0
  701. package/es/graphic/state/state-definition-compiler.js +83 -0
  702. package/es/graphic/state/state-definition-compiler.js.map +1 -0
  703. package/es/graphic/state/state-definition.d.ts +44 -0
  704. package/es/graphic/state/state-definition.js +2 -0
  705. package/es/graphic/state/state-definition.js.map +1 -0
  706. package/es/graphic/state/state-engine.d.ts +38 -0
  707. package/es/graphic/state/state-engine.js +212 -0
  708. package/es/graphic/state/state-engine.js.map +1 -0
  709. package/es/graphic/state/state-model.d.ts +43 -0
  710. package/es/graphic/state/state-model.js +135 -0
  711. package/es/graphic/state/state-model.js.map +1 -0
  712. package/es/graphic/state/state-perf-monitor.d.ts +119 -0
  713. package/es/graphic/state/state-perf-monitor.js +207 -0
  714. package/es/graphic/state/state-perf-monitor.js.map +1 -0
  715. package/es/graphic/state/state-style-resolver.d.ts +22 -0
  716. package/es/graphic/state/state-style-resolver.js +65 -0
  717. package/es/graphic/state/state-style-resolver.js.map +1 -0
  718. package/es/graphic/state/state-transition-orchestrator.d.ts +41 -0
  719. package/es/graphic/state/state-transition-orchestrator.js +68 -0
  720. package/es/graphic/state/state-transition-orchestrator.js.map +1 -0
  721. package/es/graphic/symbol.js +3 -3
  722. package/es/graphic/symbol.js.map +1 -1
  723. package/es/graphic/text.d.ts +3 -2
  724. package/es/graphic/text.js +28 -19
  725. package/es/graphic/text.js.map +1 -1
  726. package/es/graphic/theme.d.ts +5 -0
  727. package/es/graphic/theme.js +7 -0
  728. package/es/graphic/theme.js.map +1 -1
  729. package/es/graphic/tools.js +2 -2
  730. package/es/graphic/tools.js.map +1 -1
  731. package/es/graphic/wrap-text.d.ts +1 -1
  732. package/es/graphic/wrap-text.js +20 -15
  733. package/es/graphic/wrap-text.js.map +1 -1
  734. package/es/index.d.ts +26 -4
  735. package/es/index.js +49 -5
  736. package/es/index.js.map +1 -1
  737. package/es/interface/canvas.d.ts +1 -1
  738. package/es/interface/canvas.js.map +1 -1
  739. package/es/interface/global.d.ts +2 -0
  740. package/es/interface/global.js.map +1 -1
  741. package/es/interface/graphic/group.d.ts +6 -0
  742. package/es/interface/graphic/group.js.map +1 -1
  743. package/es/interface/graphic/image.d.ts +7 -1
  744. package/es/interface/graphic/image.js.map +1 -1
  745. package/es/interface/graphic/theme.d.ts +3 -0
  746. package/es/interface/graphic/theme.js.map +1 -1
  747. package/es/interface/graphic.d.ts +34 -5
  748. package/es/interface/graphic.js.map +1 -1
  749. package/es/interface/layer.d.ts +3 -2
  750. package/es/interface/layer.js.map +1 -1
  751. package/es/interface/plugin.d.ts +2 -0
  752. package/es/interface/plugin.js.map +1 -1
  753. package/es/interface/render.d.ts +1 -1
  754. package/es/interface/render.js.map +1 -1
  755. package/es/interface/stage.d.ts +9 -0
  756. package/es/interface/stage.js.map +1 -1
  757. package/es/interface/theme-service.js.map +1 -1
  758. package/es/legacy/binding-context.d.ts +24 -0
  759. package/es/legacy/binding-context.js +90 -0
  760. package/es/legacy/binding-context.js.map +1 -0
  761. package/es/legacy/bootstrap.d.ts +10 -0
  762. package/es/legacy/bootstrap.js +73 -0
  763. package/es/legacy/bootstrap.js.map +1 -0
  764. package/es/legacy/module-types.d.ts +2 -0
  765. package/es/legacy/module-types.js +2 -0
  766. package/es/legacy/module-types.js.map +1 -0
  767. package/es/modules.d.ts +5 -6
  768. package/es/modules.js +44 -14
  769. package/es/modules.js.map +1 -1
  770. package/es/picker/global-picker-service.js +2 -2
  771. package/es/picker/global-picker-service.js.map +1 -1
  772. package/es/picker/pick-modules.d.ts +5 -0
  773. package/es/picker/pick-modules.js +18 -0
  774. package/es/picker/pick-modules.js.map +1 -0
  775. package/es/picker/picker-service.d.ts +13 -4
  776. package/es/picker/picker-service.js +16 -11
  777. package/es/picker/picker-service.js.map +1 -1
  778. package/es/plugins/base-plugin.d.ts +8 -0
  779. package/es/plugins/base-plugin.js +7 -0
  780. package/es/plugins/base-plugin.js.map +1 -0
  781. package/es/plugins/browser-env-plugin.d.ts +8 -0
  782. package/es/plugins/browser-env-plugin.js +16 -0
  783. package/es/plugins/browser-env-plugin.js.map +1 -0
  784. package/es/plugins/builtin-plugin/auto-refresh-plugin.js +6 -6
  785. package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
  786. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  787. package/es/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
  788. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +26 -3
  789. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  790. package/es/plugins/builtin-plugin/edit-module.js +3 -3
  791. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  792. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  793. package/es/plugins/builtin-plugin/html-attribute-plugin.js +8 -8
  794. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  795. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +2 -2
  796. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  797. package/es/plugins/builtin-plugin/react-attribute-plugin.js +3 -3
  798. package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  799. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +9 -7
  800. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  801. package/es/plugins/index.d.ts +5 -0
  802. package/es/plugins/index.js +10 -0
  803. package/es/plugins/index.js.map +1 -0
  804. package/es/plugins/picker-plugin.d.ts +7 -0
  805. package/es/plugins/picker-plugin.js +11 -0
  806. package/es/plugins/picker-plugin.js.map +1 -0
  807. package/es/plugins/plugin-modules.d.ts +4 -0
  808. package/es/plugins/plugin-modules.js +14 -0
  809. package/es/plugins/plugin-modules.js.map +1 -0
  810. package/es/plugins/plugin-service.d.ts +16 -2
  811. package/es/plugins/plugin-service.js +24 -12
  812. package/es/plugins/plugin-service.js.map +1 -1
  813. package/es/plugins/renderer-plugin.d.ts +7 -0
  814. package/es/plugins/renderer-plugin.js +11 -0
  815. package/es/plugins/renderer-plugin.js.map +1 -0
  816. package/es/plugins/types.d.ts +28 -0
  817. package/es/plugins/types.js +2 -0
  818. package/es/plugins/types.js.map +1 -0
  819. package/es/register/register-arc.js +2 -2
  820. package/es/register/register-arc.js.map +1 -1
  821. package/es/register/register-arc3d.js +2 -2
  822. package/es/register/register-arc3d.js.map +1 -1
  823. package/es/register/register-area.js +2 -2
  824. package/es/register/register-area.js.map +1 -1
  825. package/es/register/register-circle.js +2 -2
  826. package/es/register/register-circle.js.map +1 -1
  827. package/es/register/register-glyph.js +2 -2
  828. package/es/register/register-glyph.js.map +1 -1
  829. package/es/register/register-group.js +2 -2
  830. package/es/register/register-group.js.map +1 -1
  831. package/es/register/register-image.js +2 -2
  832. package/es/register/register-image.js.map +1 -1
  833. package/es/register/register-line.js +2 -2
  834. package/es/register/register-line.js.map +1 -1
  835. package/es/register/register-path.js +2 -2
  836. package/es/register/register-path.js.map +1 -1
  837. package/es/register/register-polygon.js +2 -2
  838. package/es/register/register-polygon.js.map +1 -1
  839. package/es/register/register-pyramid3d.js +2 -2
  840. package/es/register/register-pyramid3d.js.map +1 -1
  841. package/es/register/register-rect.js +2 -2
  842. package/es/register/register-rect.js.map +1 -1
  843. package/es/register/register-rect3d.js +2 -2
  844. package/es/register/register-rect3d.js.map +1 -1
  845. package/es/register/register-richtext.js +2 -2
  846. package/es/register/register-richtext.js.map +1 -1
  847. package/es/register/register-shadowRoot.js +2 -2
  848. package/es/register/register-shadowRoot.js.map +1 -1
  849. package/es/register/register-star.js +2 -2
  850. package/es/register/register-star.js.map +1 -1
  851. package/es/register/register-symbol.js +2 -2
  852. package/es/register/register-symbol.js.map +1 -1
  853. package/es/register/register-text.js +2 -2
  854. package/es/register/register-text.js.map +1 -1
  855. package/es/register/register-wraptext.js +2 -2
  856. package/es/register/register-wraptext.js.map +1 -1
  857. package/es/registry/contribution-registry.d.ts +9 -0
  858. package/es/registry/contribution-registry.js +25 -0
  859. package/es/registry/contribution-registry.js.map +1 -0
  860. package/es/registry/index.d.ts +5 -0
  861. package/es/registry/index.js +10 -0
  862. package/es/registry/index.js.map +1 -0
  863. package/es/registry/picker-registry.d.ts +10 -0
  864. package/es/registry/picker-registry.js +21 -0
  865. package/es/registry/picker-registry.js.map +1 -0
  866. package/es/registry/plugin-registry.d.ts +10 -0
  867. package/es/registry/plugin-registry.js +21 -0
  868. package/es/registry/plugin-registry.js.map +1 -0
  869. package/es/registry/renderer-registry.d.ts +11 -0
  870. package/es/registry/renderer-registry.js +29 -0
  871. package/es/registry/renderer-registry.js.map +1 -0
  872. package/es/registry/types.d.ts +34 -0
  873. package/es/registry/types.js +2 -0
  874. package/es/registry/types.js.map +1 -0
  875. package/es/render/contributions/modules.d.ts +2 -0
  876. package/es/render/contributions/modules.js +8 -0
  877. package/es/render/contributions/modules.js.map +1 -0
  878. package/es/render/contributions/render/arc-module.d.ts +4 -0
  879. package/es/render/contributions/render/arc-module.js +21 -0
  880. package/es/render/contributions/render/arc-module.js.map +1 -0
  881. package/es/render/contributions/render/arc-render.d.ts +2 -2
  882. package/es/render/contributions/render/arc-render.js +3 -8
  883. package/es/render/contributions/render/arc-render.js.map +1 -1
  884. package/es/render/contributions/render/arc3d-module.d.ts +4 -0
  885. package/es/render/contributions/render/arc3d-module.js +13 -0
  886. package/es/render/contributions/render/arc3d-module.js.map +1 -0
  887. package/es/render/contributions/render/area-module.d.ts +4 -0
  888. package/es/render/contributions/render/area-module.js +23 -0
  889. package/es/render/contributions/render/area-module.js.map +1 -0
  890. package/es/render/contributions/render/area-render.d.ts +2 -2
  891. package/es/render/contributions/render/area-render.js +3 -8
  892. package/es/render/contributions/render/area-render.js.map +1 -1
  893. package/es/render/contributions/render/base-render.js +1 -1
  894. package/es/render/contributions/render/base-render.js.map +1 -1
  895. package/es/render/contributions/render/circle-module.d.ts +4 -0
  896. package/es/render/contributions/render/circle-module.js +21 -0
  897. package/es/render/contributions/render/circle-module.js.map +1 -0
  898. package/es/render/contributions/render/circle-render.d.ts +2 -2
  899. package/es/render/contributions/render/circle-render.js +3 -8
  900. package/es/render/contributions/render/circle-render.js.map +1 -1
  901. package/es/render/contributions/render/contributions/base-contribution-render.d.ts +29 -11
  902. package/es/render/contributions/render/contributions/base-contribution-render.js +142 -41
  903. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  904. package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +4 -2
  905. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +85 -30
  906. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  907. package/es/render/contributions/render/contributions/group-contribution-render.js +9 -7
  908. package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  909. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +2 -1
  910. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  911. package/es/render/contributions/render/contributions/text-contribution-render.js +20 -16
  912. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  913. package/es/render/contributions/render/draw-contribution.d.ts +13 -4
  914. package/es/render/contributions/render/draw-contribution.js +40 -19
  915. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  916. package/es/render/contributions/render/draw-interceptor.js +2 -3
  917. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  918. package/es/render/contributions/render/glyph-module.d.ts +4 -0
  919. package/es/render/contributions/render/glyph-module.js +13 -0
  920. package/es/render/contributions/render/glyph-module.js.map +1 -0
  921. package/es/render/contributions/render/group-render.d.ts +2 -2
  922. package/es/render/contributions/render/group-render.js +3 -9
  923. package/es/render/contributions/render/group-render.js.map +1 -1
  924. package/es/render/contributions/render/image-module.d.ts +4 -0
  925. package/es/render/contributions/render/image-module.js +20 -0
  926. package/es/render/contributions/render/image-module.js.map +1 -0
  927. package/es/render/contributions/render/image-render.d.ts +16 -3
  928. package/es/render/contributions/render/image-render.js +95 -25
  929. package/es/render/contributions/render/image-render.js.map +1 -1
  930. package/es/render/contributions/render/incremental-draw-contribution.d.ts +5 -3
  931. package/es/render/contributions/render/incremental-draw-contribution.js +4 -12
  932. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  933. package/es/render/contributions/render/index.d.ts +4 -12
  934. package/es/render/contributions/render/index.js +8 -24
  935. package/es/render/contributions/render/index.js.map +1 -1
  936. package/es/render/contributions/render/line-module.d.ts +4 -0
  937. package/es/render/contributions/render/line-module.js +16 -0
  938. package/es/render/contributions/render/line-module.js.map +1 -0
  939. package/es/render/contributions/render/module.d.ts +4 -0
  940. package/es/render/contributions/render/module.js +28 -0
  941. package/es/render/contributions/render/module.js.map +1 -0
  942. package/es/render/contributions/render/path-module.d.ts +4 -0
  943. package/es/render/contributions/render/path-module.js +21 -0
  944. package/es/render/contributions/render/path-module.js.map +1 -0
  945. package/es/render/contributions/render/path-render.d.ts +2 -2
  946. package/es/render/contributions/render/path-render.js +3 -8
  947. package/es/render/contributions/render/path-render.js.map +1 -1
  948. package/es/render/contributions/render/polygon-module.d.ts +4 -0
  949. package/es/render/contributions/render/polygon-module.js +20 -0
  950. package/es/render/contributions/render/polygon-module.js.map +1 -0
  951. package/es/render/contributions/render/polygon-render.d.ts +2 -2
  952. package/es/render/contributions/render/polygon-render.js +3 -8
  953. package/es/render/contributions/render/polygon-render.js.map +1 -1
  954. package/es/render/contributions/render/pyramid3d-module.d.ts +4 -0
  955. package/es/render/contributions/render/pyramid3d-module.js +13 -0
  956. package/es/render/contributions/render/pyramid3d-module.js.map +1 -0
  957. package/es/render/contributions/render/rect-module.d.ts +4 -0
  958. package/es/render/contributions/render/rect-module.js +23 -0
  959. package/es/render/contributions/render/rect-module.js.map +1 -0
  960. package/es/render/contributions/render/rect-render.d.ts +2 -2
  961. package/es/render/contributions/render/rect-render.js +3 -8
  962. package/es/render/contributions/render/rect-render.js.map +1 -1
  963. package/es/render/contributions/render/rect3d-module.d.ts +4 -0
  964. package/es/render/contributions/render/rect3d-module.js +13 -0
  965. package/es/render/contributions/render/rect3d-module.js.map +1 -0
  966. package/es/render/contributions/render/rect3d-render.js.map +1 -1
  967. package/es/render/contributions/render/render-slector.js.map +1 -1
  968. package/es/render/contributions/render/richtext-module.d.ts +4 -0
  969. package/es/render/contributions/render/richtext-module.js +13 -0
  970. package/es/render/contributions/render/richtext-module.js.map +1 -0
  971. package/es/render/contributions/render/star-module.d.ts +4 -0
  972. package/es/render/contributions/render/star-module.js +17 -0
  973. package/es/render/contributions/render/star-module.js.map +1 -0
  974. package/es/render/contributions/render/star-render.d.ts +2 -2
  975. package/es/render/contributions/render/star-render.js +3 -8
  976. package/es/render/contributions/render/star-render.js.map +1 -1
  977. package/es/render/contributions/render/symbol-module.d.ts +4 -0
  978. package/es/render/contributions/render/symbol-module.js +21 -0
  979. package/es/render/contributions/render/symbol-module.js.map +1 -0
  980. package/es/render/contributions/render/symbol-render.d.ts +2 -2
  981. package/es/render/contributions/render/symbol-render.js +3 -8
  982. package/es/render/contributions/render/symbol-render.js.map +1 -1
  983. package/es/render/contributions/render/symbol.d.ts +0 -2
  984. package/es/render/contributions/render/symbol.js +0 -4
  985. package/es/render/contributions/render/symbol.js.map +1 -1
  986. package/es/render/contributions/render/text-module.d.ts +4 -0
  987. package/es/render/contributions/render/text-module.js +20 -0
  988. package/es/render/contributions/render/text-module.js.map +1 -0
  989. package/es/render/contributions/render/text-render.d.ts +2 -2
  990. package/es/render/contributions/render/text-render.js +2 -7
  991. package/es/render/contributions/render/text-render.js.map +1 -1
  992. package/es/render/render-modules.d.ts +4 -0
  993. package/es/render/render-modules.js +10 -0
  994. package/es/render/render-modules.js.map +1 -0
  995. package/es/render/render-service.d.ts +1 -1
  996. package/es/render/render-service.js +3 -1
  997. package/es/render/render-service.js.map +1 -1
  998. package/es/resource-loader/loader.js +6 -6
  999. package/es/resource-loader/loader.js.map +1 -1
  1000. package/package.json +8 -7
  1001. package/cjs/common/registry/contribution-registry.d.ts +0 -24
  1002. package/cjs/common/registry/contribution-registry.js +0 -61
  1003. package/cjs/common/registry/contribution-registry.js.map +0 -1
  1004. package/cjs/common/registry/index.d.ts +0 -5
  1005. package/cjs/common/registry/index.js +0 -34
  1006. package/cjs/common/registry/index.js.map +0 -1
  1007. package/cjs/common/registry/service-registry.d.ts +0 -16
  1008. package/cjs/common/registry/service-registry.js +0 -57
  1009. package/cjs/common/registry/service-registry.js.map +0 -1
  1010. package/cjs/common/registry/types.d.ts +0 -1
  1011. package/cjs/common/registry/types.js.map +0 -1
  1012. package/cjs/register-modules.d.ts +0 -9
  1013. package/cjs/register-modules.js +0 -79
  1014. package/cjs/register-modules.js.map +0 -1
  1015. package/es/common/registry/contribution-registry.d.ts +0 -24
  1016. package/es/common/registry/contribution-registry.js +0 -55
  1017. package/es/common/registry/contribution-registry.js.map +0 -1
  1018. package/es/common/registry/index.d.ts +0 -5
  1019. package/es/common/registry/index.js +0 -4
  1020. package/es/common/registry/index.js.map +0 -1
  1021. package/es/common/registry/service-registry.d.ts +0 -16
  1022. package/es/common/registry/service-registry.js +0 -51
  1023. package/es/common/registry/service-registry.js.map +0 -1
  1024. package/es/common/registry/types.d.ts +0 -1
  1025. package/es/common/registry/types.js.map +0 -1
  1026. package/es/register-modules.d.ts +0 -9
  1027. package/es/register-modules.js +0 -117
  1028. package/es/register-modules.js.map +0 -1
  1029. /package/cjs/{common/registry → entries}/types.js +0 -0
  1030. /package/es/{common/registry → entries}/types.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graphic/state/state-style-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AW,EAAE;oBACjF,SAAS;iBACV;gBACA,eAAuC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAE,WAAmC,CAAC,GAAG,CAAC,CAAC,CAAC;aACvG;SACF;QAED,OAAO;YACL,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,eAAe;SAC7B,CAAC;IACJ,CAAC;CACF","file":"state-style-resolver.js","sourcesContent":["import type { CompiledStateDefinition } from './state-definition';\nimport type { StateProxy, StateSort } from './state-model';\n\nexport type StateMergeMode = 'shallow' | 'deep';\n\nexport interface IStateStyleResolverOptions {\n mergeMode?: StateMergeMode;\n}\n\nexport interface IStateStyleBackupResult<T> {\n attrs: Partial<T>;\n normalAttrs: Partial<T>;\n}\n\nexport interface IStateStyleResolver<T> {\n resolve: (\n normalAttrs: Partial<T>,\n states: Record<string, Partial<T>> | undefined,\n stateProxy: StateProxy<T> | undefined,\n currentStates: string[],\n stateSort?: StateSort\n ) => Partial<T>;\n resolveWithCompiled: (\n normalAttrs: Partial<T>,\n compiledDefinitions: Map<string, CompiledStateDefinition<T>>,\n stateProxy: StateProxy<T> | undefined,\n effectiveStates: string[],\n resolvedPatch: Partial<T>\n ) => Partial<T>;\n computeNormalAttrsBackup: (\n normalAttrs: Partial<T> | null | undefined,\n targetAttrs: Partial<T>,\n finalAttribute: Record<string, any>\n ) => IStateStyleBackupResult<T>;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, any> {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction cloneValue<T>(value: T): T {\n if (!isPlainObject(value)) {\n return value;\n }\n\n const clone: Record<string, any> = {};\n for (const key in value) {\n if (!Object.prototype.hasOwnProperty.call(value, key)) {\n continue;\n }\n clone[key] = cloneValue((value as Record<string, any>)[key]);\n }\n return clone as T;\n}\n\nfunction deepMerge(base: Record<string, any>, value: Record<string, any>): Record<string, any> {\n const result: Record<string, any> = cloneValue(base) || {};\n\n for (const key in value) {\n if (!Object.prototype.hasOwnProperty.call(value, key)) {\n continue;\n }\n\n const nextValue = value[key];\n const previousValue = result[key];\n\n if (isPlainObject(previousValue) && isPlainObject(nextValue)) {\n result[key] = deepMerge(previousValue, nextValue);\n } else {\n result[key] = cloneValue(nextValue);\n }\n }\n\n return result;\n}\n\nexport class StateStyleResolver<T extends Record<string, any> = Record<string, any>> implements IStateStyleResolver<T> {\n constructor(private readonly options: IStateStyleResolverOptions = {}) {}\n\n resolve(\n normalAttrs: Partial<T>,\n states: Record<string, Partial<T>> | undefined,\n stateProxy: StateProxy<T> | undefined,\n currentStates: string[],\n stateSort?: StateSort\n ): Partial<T> {\n const mergeMode = this.options.mergeMode ?? 'shallow';\n const sortedStates = stateSort ? currentStates.slice().sort(stateSort) : currentStates.slice();\n const resolvedAttrs: Partial<T> = {};\n\n sortedStates.forEach(stateName => {\n const attrs = stateProxy ? stateProxy(stateName, sortedStates) : states?.[stateName];\n\n if (attrs == null) {\n return;\n }\n\n for (const key in attrs) {\n if (!Object.prototype.hasOwnProperty.call(attrs, key)) {\n continue;\n }\n\n const nextValue = attrs[key];\n\n if (\n mergeMode === 'deep' &&\n isPlainObject(nextValue) &&\n (isPlainObject((resolvedAttrs as Record<string, any>)[key]) ||\n isPlainObject((normalAttrs as Record<string, any>)[key]))\n ) {\n const baseValue = isPlainObject((resolvedAttrs as Record<string, any>)[key])\n ? (resolvedAttrs as Record<string, any>)[key]\n : isPlainObject((normalAttrs as Record<string, any>)[key])\n ? (normalAttrs as Record<string, any>)[key]\n : {};\n (resolvedAttrs as Record<string, any>)[key] = deepMerge(baseValue, nextValue);\n } else {\n (resolvedAttrs as Record<string, any>)[key] = cloneValue(nextValue);\n }\n }\n });\n\n return resolvedAttrs;\n }\n\n resolveWithCompiled(\n normalAttrs: Partial<T>,\n compiledDefinitions: Map<string, CompiledStateDefinition<T>>,\n stateProxy: StateProxy<T> | undefined,\n effectiveStates: string[],\n resolvedPatch: Partial<T>\n ): Partial<T> {\n const mergeMode = this.options.mergeMode ?? 'shallow';\n const resolvedAttrs = cloneValue(resolvedPatch) ?? {};\n\n effectiveStates.forEach(stateName => {\n const proxyPatch = stateProxy?.(stateName, effectiveStates);\n if (proxyPatch == null) {\n return;\n }\n\n Object.keys(proxyPatch).forEach(key => {\n const nextValue = (proxyPatch as Record<string, any>)[key];\n const hasCompiledDefinition = compiledDefinitions.has(stateName);\n\n if (\n mergeMode === 'deep' &&\n isPlainObject(nextValue) &&\n (isPlainObject((resolvedAttrs as Record<string, any>)[key]) ||\n (!hasCompiledDefinition && isPlainObject((normalAttrs as Record<string, any>)[key])))\n ) {\n const baseValue = isPlainObject((resolvedAttrs as Record<string, any>)[key])\n ? (resolvedAttrs as Record<string, any>)[key]\n : isPlainObject((normalAttrs as Record<string, any>)[key])\n ? (normalAttrs as Record<string, any>)[key]\n : {};\n (resolvedAttrs as Record<string, any>)[key] = deepMerge(baseValue, nextValue);\n return;\n }\n\n (resolvedAttrs as Record<string, any>)[key] = cloneValue(nextValue);\n });\n });\n\n return resolvedAttrs;\n }\n\n computeNormalAttrsBackup(\n normalAttrs: Partial<T> | null | undefined,\n targetAttrs: Partial<T>,\n finalAttribute: Record<string, any>\n ): IStateStyleBackupResult<T> {\n const nextNormalAttrs: Partial<T> = {};\n const nextTargetAttrs = { ...targetAttrs };\n\n for (const key in targetAttrs) {\n if (!Object.prototype.hasOwnProperty.call(targetAttrs, key)) {\n continue;\n }\n\n if (normalAttrs && key in normalAttrs) {\n (nextNormalAttrs as Record<string, any>)[key] = cloneValue((normalAttrs as Record<string, any>)[key]);\n } else {\n (nextNormalAttrs as Record<string, any>)[key] = cloneValue(finalAttribute[key]);\n }\n }\n\n if (normalAttrs) {\n for (const key in normalAttrs) {\n if (!Object.prototype.hasOwnProperty.call(normalAttrs, key) || key in targetAttrs) {\n continue;\n }\n (nextTargetAttrs as Record<string, any>)[key] = cloneValue((normalAttrs as Record<string, any>)[key]);\n }\n }\n\n return {\n attrs: nextTargetAttrs,\n normalAttrs: nextNormalAttrs\n };\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { AttributeUpdateType } from '../../common/enums';
2
+ import type { IAnimateConfig } from '../../interface/graphic';
3
+ export interface IStateTransitionPlan<T> {
4
+ stateNames?: string[];
5
+ targetAttrs: Partial<T>;
6
+ animateAttrs: Partial<T>;
7
+ jumpAttrs: Partial<T>;
8
+ noAnimateAttrs: Partial<T>;
9
+ }
10
+ export interface IStateTransitionAnalysisOptions {
11
+ noWorkAnimateAttr?: Record<string, number>;
12
+ isClear?: boolean;
13
+ getDefaultAttribute?: (key: string) => unknown;
14
+ animateConfig?: IAnimateConfig;
15
+ }
16
+ export interface IStateTransitionApplyOptions {
17
+ animateConfig?: IAnimateConfig;
18
+ }
19
+ export interface IStateTransitionGraphic<T> {
20
+ finalAttribute?: Record<string, any>;
21
+ applyAnimationState?: (state: string[], animations: Array<Record<string, any>>) => void;
22
+ setAttributesAndPreventAnimate: (attrs: Partial<T>, forceUpdateTag?: boolean, context?: {
23
+ type: AttributeUpdateType;
24
+ }) => void;
25
+ stopStateAnimates: () => void;
26
+ _emitCustomEvent: (type: string, context?: {
27
+ type: AttributeUpdateType;
28
+ }) => void;
29
+ getNoWorkAnimateAttr?: () => Record<string, number>;
30
+ getDefaultAttribute?: (key: string) => unknown;
31
+ }
32
+ export interface IStateTransitionOrchestrator<T> {
33
+ analyzeTransition: (currentAttrs: Partial<T>, targetAttrs: Partial<T>, stateNames?: string[], hasAnimation?: boolean, options?: IStateTransitionAnalysisOptions) => IStateTransitionPlan<T>;
34
+ applyTransition: (graphic: IStateTransitionGraphic<T>, plan: IStateTransitionPlan<T>, hasAnimation?: boolean, options?: IStateTransitionApplyOptions) => IStateTransitionPlan<T>;
35
+ applyClearTransition: (graphic: IStateTransitionGraphic<T>, targetAttrs: Partial<T>, hasAnimation?: boolean, stateNames?: string[], options?: IStateTransitionApplyOptions) => IStateTransitionPlan<T>;
36
+ }
37
+ export declare class StateTransitionOrchestrator<T extends Record<string, any> = Record<string, any>> implements IStateTransitionOrchestrator<T> {
38
+ analyzeTransition(_currentAttrs: Partial<T>, targetAttrs: Partial<T>, stateNames?: string[], hasAnimation?: boolean, options?: IStateTransitionAnalysisOptions): IStateTransitionPlan<T>;
39
+ applyTransition(graphic: IStateTransitionGraphic<T>, plan: IStateTransitionPlan<T>, hasAnimation?: boolean, options?: IStateTransitionApplyOptions): IStateTransitionPlan<T>;
40
+ applyClearTransition(graphic: IStateTransitionGraphic<T>, targetAttrs: Partial<T>, hasAnimation?: boolean, stateNames?: string[], options?: IStateTransitionApplyOptions): IStateTransitionPlan<T>;
41
+ }
@@ -0,0 +1,68 @@
1
+ import { DefaultStateAnimateConfig } from "../../animate/config";
2
+
3
+ import { AttributeUpdateType } from "../../common/enums";
4
+
5
+ function hasOwnKeys(value) {
6
+ return Object.keys(value).length > 0;
7
+ }
8
+
9
+ function normalizeNoAnimateAttrConfig(config) {
10
+ return config ? Array.isArray(config) ? config.reduce(((acc, key) => (acc[key] = 1,
11
+ acc)), {}) : Object.keys(config).reduce(((acc, key) => (config[key] && (acc[key] = 1),
12
+ acc)), {}) : {};
13
+ }
14
+
15
+ export class StateTransitionOrchestrator {
16
+ analyzeTransition(_currentAttrs, targetAttrs, stateNames, hasAnimation, options = {}) {
17
+ var _a, _b;
18
+ const plan = {
19
+ stateNames: stateNames,
20
+ targetAttrs: Object.assign({}, targetAttrs),
21
+ animateAttrs: {},
22
+ jumpAttrs: {},
23
+ noAnimateAttrs: {}
24
+ };
25
+ if (!hasAnimation) return plan;
26
+ const noWorkAnimateAttr = Object.assign(Object.assign({}, null !== (_a = options.noWorkAnimateAttr) && void 0 !== _a ? _a : {}), normalizeNoAnimateAttrConfig(null === (_b = options.animateConfig) || void 0 === _b ? void 0 : _b.noAnimateAttrs)), isClear = !0 === options.isClear, getDefaultAttribute = options.getDefaultAttribute;
27
+ for (const key in targetAttrs) {
28
+ if (!Object.prototype.hasOwnProperty.call(targetAttrs, key)) continue;
29
+ const value = targetAttrs[key];
30
+ noWorkAnimateAttr[key] ? (plan.jumpAttrs[key] = value, plan.noAnimateAttrs[key] = value) : plan.animateAttrs[key] = isClear && void 0 === value && getDefaultAttribute ? getDefaultAttribute(key) : value;
31
+ }
32
+ return plan;
33
+ }
34
+ applyTransition(graphic, plan, hasAnimation, options = {}) {
35
+ var _a, _b;
36
+ if (hasAnimation) {
37
+ const stateAnimateConfig = null !== (_a = options.animateConfig) && void 0 !== _a ? _a : DefaultStateAnimateConfig;
38
+ null === (_b = graphic.applyAnimationState) || void 0 === _b || _b.call(graphic, [ "state" ], [ {
39
+ name: "state",
40
+ animation: {
41
+ type: "state",
42
+ to: plan.animateAttrs,
43
+ duration: stateAnimateConfig.duration,
44
+ easing: stateAnimateConfig.easing
45
+ }
46
+ } ]), hasOwnKeys(plan.noAnimateAttrs) && graphic.setAttributesAndPreventAnimate(plan.noAnimateAttrs, !1, {
47
+ type: AttributeUpdateType.STATE
48
+ });
49
+ } else graphic.stopStateAnimates(), graphic.setAttributesAndPreventAnimate(plan.targetAttrs, !1, {
50
+ type: AttributeUpdateType.STATE
51
+ });
52
+ return graphic.finalAttribute && Object.assign(graphic.finalAttribute, plan.targetAttrs),
53
+ graphic._emitCustomEvent("afterStateUpdate", {
54
+ type: AttributeUpdateType.STATE
55
+ }), plan;
56
+ }
57
+ applyClearTransition(graphic, targetAttrs, hasAnimation, stateNames, options = {}) {
58
+ var _a, _b;
59
+ const plan = this.analyzeTransition({}, targetAttrs, stateNames, hasAnimation, {
60
+ noWorkAnimateAttr: null === (_a = graphic.getNoWorkAnimateAttr) || void 0 === _a ? void 0 : _a.call(graphic),
61
+ isClear: !0,
62
+ getDefaultAttribute: null === (_b = graphic.getDefaultAttribute) || void 0 === _b ? void 0 : _b.bind(graphic),
63
+ animateConfig: options.animateConfig
64
+ });
65
+ return this.applyTransition(graphic, plan, hasAnimation, options);
66
+ }
67
+ }
68
+ //# sourceMappingURL=state-transition-orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graphic/state/state-transition-orchestrator.ts"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M;qBAClC;iBACF;aACF,CACF,CAAC;YAEF,IAAI,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;gBACnC,OAAO,CAAC,8BAA8B,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC;aACzG;SACF;aAAM;YACL,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC5B,OAAO,CAAC,8BAA8B,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC;SACtG;QAED,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACzD;QAED,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC;QAElF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oBAAoB,CAClB,OAAmC,EACnC,WAAuB,EACvB,YAAsB,EACtB,UAAqB,EACrB,UAAwC,EAAE;;QAE1C,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE;YAC7E,iBAAiB,EAAE,MAAA,OAAO,CAAC,oBAAoB,uDAAI;YACnD,OAAO,EAAE,IAAI;YACb,mBAAmB,EAAE,MAAA,OAAO,CAAC,mBAAmB,0CAAE,IAAI,CAAC,OAAO,CAAC;YAC/D,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF","file":"state-transition-orchestrator.js","sourcesContent":["import { DefaultStateAnimateConfig } from '../../animate/config';\nimport { AttributeUpdateType } from '../../common/enums';\nimport type { IAnimateConfig } from '../../interface/graphic';\n\nexport interface IStateTransitionPlan<T> {\n stateNames?: string[];\n targetAttrs: Partial<T>;\n animateAttrs: Partial<T>;\n jumpAttrs: Partial<T>;\n noAnimateAttrs: Partial<T>;\n}\n\nexport interface IStateTransitionAnalysisOptions {\n noWorkAnimateAttr?: Record<string, number>;\n isClear?: boolean;\n getDefaultAttribute?: (key: string) => unknown;\n animateConfig?: IAnimateConfig;\n}\n\nexport interface IStateTransitionApplyOptions {\n animateConfig?: IAnimateConfig;\n}\n\nexport interface IStateTransitionGraphic<T> {\n finalAttribute?: Record<string, any>;\n applyAnimationState?: (state: string[], animations: Array<Record<string, any>>) => void;\n setAttributesAndPreventAnimate: (\n attrs: Partial<T>,\n forceUpdateTag?: boolean,\n context?: { type: AttributeUpdateType }\n ) => void;\n stopStateAnimates: () => void;\n _emitCustomEvent: (type: string, context?: { type: AttributeUpdateType }) => void;\n getNoWorkAnimateAttr?: () => Record<string, number>;\n getDefaultAttribute?: (key: string) => unknown;\n}\n\nexport interface IStateTransitionOrchestrator<T> {\n analyzeTransition: (\n currentAttrs: Partial<T>,\n targetAttrs: Partial<T>,\n stateNames?: string[],\n hasAnimation?: boolean,\n options?: IStateTransitionAnalysisOptions\n ) => IStateTransitionPlan<T>;\n applyTransition: (\n graphic: IStateTransitionGraphic<T>,\n plan: IStateTransitionPlan<T>,\n hasAnimation?: boolean,\n options?: IStateTransitionApplyOptions\n ) => IStateTransitionPlan<T>;\n applyClearTransition: (\n graphic: IStateTransitionGraphic<T>,\n targetAttrs: Partial<T>,\n hasAnimation?: boolean,\n stateNames?: string[],\n options?: IStateTransitionApplyOptions\n ) => IStateTransitionPlan<T>;\n}\n\nfunction hasOwnKeys(value: object): boolean {\n return Object.keys(value).length > 0;\n}\n\nfunction normalizeNoAnimateAttrConfig(config?: IAnimateConfig['noAnimateAttrs']): Record<string, number> {\n if (!config) {\n return {};\n }\n\n if (Array.isArray(config)) {\n return config.reduce<Record<string, number>>((acc, key) => {\n acc[key] = 1;\n return acc;\n }, {});\n }\n\n return Object.keys(config).reduce<Record<string, number>>((acc, key) => {\n if ((config as Record<string, boolean | number>)[key]) {\n acc[key] = 1;\n }\n return acc;\n }, {});\n}\n\nexport class StateTransitionOrchestrator<T extends Record<string, any> = Record<string, any>>\n implements IStateTransitionOrchestrator<T>\n{\n analyzeTransition(\n _currentAttrs: Partial<T>,\n targetAttrs: Partial<T>,\n stateNames?: string[],\n hasAnimation?: boolean,\n options: IStateTransitionAnalysisOptions = {}\n ): IStateTransitionPlan<T> {\n const plan: IStateTransitionPlan<T> = {\n stateNames,\n targetAttrs: { ...targetAttrs },\n animateAttrs: {},\n jumpAttrs: {},\n noAnimateAttrs: {}\n };\n\n if (!hasAnimation) {\n return plan;\n }\n\n const noWorkAnimateAttr = {\n ...(options.noWorkAnimateAttr ?? {}),\n ...normalizeNoAnimateAttrConfig(options.animateConfig?.noAnimateAttrs)\n };\n const isClear = options.isClear === true;\n const getDefaultAttribute = options.getDefaultAttribute;\n\n for (const key in targetAttrs) {\n if (!Object.prototype.hasOwnProperty.call(targetAttrs, key)) {\n continue;\n }\n\n const value = (targetAttrs as Record<string, any>)[key];\n\n if (noWorkAnimateAttr[key]) {\n (plan.jumpAttrs as Record<string, any>)[key] = value;\n (plan.noAnimateAttrs as Record<string, any>)[key] = value;\n continue;\n }\n\n (plan.animateAttrs as Record<string, any>)[key] =\n isClear && value === undefined && getDefaultAttribute ? getDefaultAttribute(key) : value;\n }\n\n return plan;\n }\n\n applyTransition(\n graphic: IStateTransitionGraphic<T>,\n plan: IStateTransitionPlan<T>,\n hasAnimation?: boolean,\n options: IStateTransitionApplyOptions = {}\n ): IStateTransitionPlan<T> {\n if (hasAnimation) {\n const stateAnimateConfig = options.animateConfig ?? DefaultStateAnimateConfig;\n graphic.applyAnimationState?.(\n ['state'],\n [\n {\n name: 'state',\n animation: {\n type: 'state',\n to: plan.animateAttrs,\n duration: stateAnimateConfig.duration,\n easing: stateAnimateConfig.easing\n }\n }\n ]\n );\n\n if (hasOwnKeys(plan.noAnimateAttrs)) {\n graphic.setAttributesAndPreventAnimate(plan.noAnimateAttrs, false, { type: AttributeUpdateType.STATE });\n }\n } else {\n graphic.stopStateAnimates();\n graphic.setAttributesAndPreventAnimate(plan.targetAttrs, false, { type: AttributeUpdateType.STATE });\n }\n\n if (graphic.finalAttribute) {\n Object.assign(graphic.finalAttribute, plan.targetAttrs);\n }\n\n graphic._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n\n return plan;\n }\n\n applyClearTransition(\n graphic: IStateTransitionGraphic<T>,\n targetAttrs: Partial<T>,\n hasAnimation?: boolean,\n stateNames?: string[],\n options: IStateTransitionApplyOptions = {}\n ): IStateTransitionPlan<T> {\n const plan = this.analyzeTransition({}, targetAttrs, stateNames, hasAnimation, {\n noWorkAnimateAttr: graphic.getNoWorkAnimateAttr?.(),\n isClear: true,\n getDefaultAttribute: graphic.getDefaultAttribute?.bind(graphic),\n animateConfig: options.animateConfig\n });\n\n return this.applyTransition(graphic, plan, hasAnimation, options);\n }\n}\n"]}
@@ -4,7 +4,7 @@ import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from "./graphic"
4
4
 
5
5
  import { getTheme } from "./theme";
6
6
 
7
- import { graphicService } from "../modules";
7
+ import { application } from "../application";
8
8
 
9
9
  import { CustomPath2D } from "../common/custom-path2d";
10
10
 
@@ -51,13 +51,13 @@ export class Symbol extends Graphic {
51
51
  }
52
52
  updateAABBBounds(attribute, symbolTheme, aabbBounds, full) {
53
53
  this.updatePathProxyAABBBounds(aabbBounds) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds));
54
- const {tb1: tb1, tb2: tb2} = graphicService.updateTempAABBBounds(aabbBounds);
54
+ const {tb1: tb1, tb2: tb2} = application.graphicService.updateTempAABBBounds(aabbBounds);
55
55
  updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1),
56
56
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1,
57
57
  this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, this.x1WithoutTransform = aabbBounds.x1,
58
58
  this.y1WithoutTransform = aabbBounds.y1;
59
59
  const {lineJoin: lineJoin = symbolTheme.lineJoin} = attribute;
60
- return graphicService.transformAABBBounds(attribute, aabbBounds, symbolTheme, "miter" === lineJoin, this),
60
+ return application.graphicService.transformAABBBounds(attribute, aabbBounds, symbolTheme, "miter" === lineJoin, this),
61
61
  aabbBounds;
62
62
  }
63
63
  updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/symbol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAW,cAAc,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAE/F,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAKhF,MAAM,OAAO,MAAO,SAAQ,OAAgC;IAQ1D,YAAY,SAAkC,EAAE,UAAU,EAAE,QAAQ,EAAE;QACpE,KAAK,CAAC,MAAM,CAAC,CAAC;QARhB,SAAI,GAAa,QAAQ,CAAC;QASxB,IAAI,CAAC,UAAU,GA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C;SACb;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE1D,OAAO,cAAc,CAAC,IAAI;YACxB,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;YACpG,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AA9IM,0BAAmB,mBACxB,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AA8IJ,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"symbol.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isArray } from '@visactor/vutils';\nimport type { ISymbol, ISymbolClass, ISymbolGraphicAttribute } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { vglobal, graphicService } from '../modules';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { SYMBOL_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfSymbolOuterBorder } from './graphic-service/symbol-outer-border-bounds';\n\nconst SYMBOL_UPDATE_TAG_KEY = ['symbolType', 'size', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * symbol\n */\nexport class Symbol extends Graphic<ISymbolGraphicAttribute> implements ISymbol {\n type: 'symbol' = 'symbol';\n\n static NOWORK_ANIMATE_ATTR = {\n symbolType: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: ISymbolGraphicAttribute = { symbolType: 'circle' }) {\n super(params);\n this.numberType = SYMBOL_NUMBER_TYPE;\n }\n\n protected _parsedPath?: ISymbolClass;\n\n getParsedPath(): ISymbolClass {\n if (this.shouldUpdateShape()) {\n this._parsedPath = this.doUpdateParsedPath();\n this.clearUpdateShapeTag();\n }\n return this._parsedPath as ISymbolClass;\n }\n\n getParsedPath2D(x = 0, y = 0, size = 1): Path2D | null {\n let path: Path2D | null = null;\n try {\n path = new Path2D();\n } catch (err) {\n return null;\n }\n const parsedPath = this.getParsedPath();\n if (!parsedPath) {\n return null;\n }\n parsedPath.draw(path, size, x, y);\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { size } = this.attribute;\n return isArray(size) ? size.length === 2 && size.every(this._validNumber) : this._validNumber(size);\n }\n\n protected doUpdateParsedPath(): ISymbolClass {\n const { symbolType = 'circle' } = this.attribute;\n return super.parsePath(symbolType);\n }\n\n getGraphicTheme(): Required<ISymbolGraphicAttribute> {\n return getTheme(this).symbol;\n }\n\n protected updateAABBBounds(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n full\n ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds)\n : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds);\n }\n\n const { tb1, tb2 } = graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n this.x1WithoutTransform = aabbBounds.x1;\n this.y1WithoutTransform = aabbBounds.y1;\n\n const { lineJoin = symbolTheme.lineJoin } = attribute;\n graphicService.transformAABBBounds(attribute, aabbBounds, symbolTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected updateSymbolAABBBoundsImprecise(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n // 当做正方形计算\n const { size = symbolTheme.size } = attribute;\n\n if (isArray(size)) {\n aabbBounds.set(-size[0] / 2, -size[1] / 2, size[0] / 2, size[1] / 2);\n } else {\n const halfWH = size / 2;\n\n aabbBounds.set(-halfWH, -halfWH, halfWH, halfWH);\n }\n\n return aabbBounds;\n }\n\n protected updateSymbolAABBBoundsAccurate(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const { size = symbolTheme.size } = attribute;\n\n const symbolClass = this.getParsedPath();\n if (!symbolClass) {\n return aabbBounds;\n }\n symbolClass.bounds(size, aabbBounds);\n\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const symbolInstance = this.getParsedPath();\n if (!symbolInstance) {\n return null;\n }\n const size = this.attribute.size;\n const x = 0;\n const y = 0;\n const formattedSize = isArray(size) ? size : [size, size];\n\n return symbolInstance.path\n ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, x, y, formattedSize[0], formattedSize[1])\n : new CustomPath2D().fromString(symbolInstance.pathStr, x, y, formattedSize[0], formattedSize[1]);\n }\n\n clone() {\n return new Symbol({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Symbol.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createSymbol(attributes: ISymbolGraphicAttribute): ISymbol {\n return new Symbol(attributes);\n}\n\n// addAttributeToPrototype(DefaultSymbolStyle, Symbol, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/symbol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAE/F,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAKhF,MAAM,OAAO,MAAO,SAAQ,OAAgC;IAQ1D,YAAY,SAAkC,EAAE,UAAU,EAAE,QAAQ,EAAE;QACpE,KAAK,CAAC,MAAM,CAAC,CAAC;QARhB,SAAI,GAAa,QAAQ,CAAC;QASxB,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC;IACvC,CAAC;IAID,aAAa;QACX,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE;YAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC7C,IAAI,CAAC,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Z,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE1D,OAAO,cAAc,CAAC,IAAI;YACxB,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;YACpG,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AA9IM,0BAAmB,mBACxB,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AA8IJ,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"symbol.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isArray } from '@visactor/vutils';\nimport type { ISymbol, ISymbolClass, ISymbolGraphicAttribute } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { SYMBOL_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfSymbolOuterBorder } from './graphic-service/symbol-outer-border-bounds';\n\nconst SYMBOL_UPDATE_TAG_KEY = ['symbolType', 'size', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * symbol\n */\nexport class Symbol extends Graphic<ISymbolGraphicAttribute> implements ISymbol {\n type: 'symbol' = 'symbol';\n\n static NOWORK_ANIMATE_ATTR = {\n symbolType: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: ISymbolGraphicAttribute = { symbolType: 'circle' }) {\n super(params);\n this.numberType = SYMBOL_NUMBER_TYPE;\n }\n\n protected _parsedPath?: ISymbolClass;\n\n getParsedPath(): ISymbolClass {\n if (this.shouldUpdateShape()) {\n this._parsedPath = this.doUpdateParsedPath();\n this.clearUpdateShapeTag();\n }\n return this._parsedPath as ISymbolClass;\n }\n\n getParsedPath2D(x = 0, y = 0, size = 1): Path2D | null {\n let path: Path2D | null = null;\n try {\n path = new Path2D();\n } catch (err) {\n return null;\n }\n const parsedPath = this.getParsedPath();\n if (!parsedPath) {\n return null;\n }\n parsedPath.draw(path, size, x, y);\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { size } = this.attribute;\n return isArray(size) ? size.length === 2 && size.every(this._validNumber) : this._validNumber(size);\n }\n\n protected doUpdateParsedPath(): ISymbolClass {\n const { symbolType = 'circle' } = this.attribute;\n return super.parsePath(symbolType);\n }\n\n getGraphicTheme(): Required<ISymbolGraphicAttribute> {\n return getTheme(this).symbol;\n }\n\n protected updateAABBBounds(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n full\n ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds)\n : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds);\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n this.x1WithoutTransform = aabbBounds.x1;\n this.y1WithoutTransform = aabbBounds.y1;\n\n const { lineJoin = symbolTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, symbolTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected updateSymbolAABBBoundsImprecise(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n // 当做正方形计算\n const { size = symbolTheme.size } = attribute;\n\n if (isArray(size)) {\n aabbBounds.set(-size[0] / 2, -size[1] / 2, size[0] / 2, size[1] / 2);\n } else {\n const halfWH = size / 2;\n\n aabbBounds.set(-halfWH, -halfWH, halfWH, halfWH);\n }\n\n return aabbBounds;\n }\n\n protected updateSymbolAABBBoundsAccurate(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const { size = symbolTheme.size } = attribute;\n\n const symbolClass = this.getParsedPath();\n if (!symbolClass) {\n return aabbBounds;\n }\n symbolClass.bounds(size, aabbBounds);\n\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const symbolInstance = this.getParsedPath();\n if (!symbolInstance) {\n return null;\n }\n const size = this.attribute.size;\n const x = 0;\n const y = 0;\n const formattedSize = isArray(size) ? size : [size, size];\n\n return symbolInstance.path\n ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, x, y, formattedSize[0], formattedSize[1])\n : new CustomPath2D().fromString(symbolInstance.pathStr, x, y, formattedSize[0], formattedSize[1]);\n }\n\n clone() {\n return new Symbol({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Symbol.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createSymbol(attributes: ISymbolGraphicAttribute): ISymbol {\n return new Symbol(attributes);\n}\n\n// addAttributeToPrototype(DefaultSymbolStyle, Symbol, PURE_STYLE_KEY);\n"]}
@@ -1,4 +1,4 @@
1
- import type { IAABBBounds, IOBBBounds } from '@visactor/vutils';
1
+ import { type IAABBBounds, type IOBBBounds } from '@visactor/vutils';
2
2
  import type { IText, ITextCache, ITextGraphicAttribute, LayoutType } from '../interface';
3
3
  import { Graphic } from './graphic';
4
4
  export declare class Text extends Graphic<ITextGraphicAttribute> implements IText {
@@ -40,7 +40,7 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
40
40
  fontFamily: number;
41
41
  fontWeight: number;
42
42
  };
43
- cache: ITextCache;
43
+ cache?: ITextCache;
44
44
  _font: string;
45
45
  protected obbText?: Text;
46
46
  get font(): string;
@@ -50,6 +50,7 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
50
50
  get multilineLayout(): LayoutType | undefined;
51
51
  get isMultiLine(): boolean;
52
52
  constructor(params?: ITextGraphicAttribute);
53
+ protected getOrCreateCache(): ITextCache;
53
54
  isValid(): boolean;
54
55
  protected _isValid(): boolean;
55
56
  getGraphicTheme(): Required<ITextGraphicAttribute>;
@@ -4,7 +4,7 @@ import { textDrawOffsetX, textLayoutOffsetY } from "../common/text";
4
4
 
5
5
  import { CanvasTextLayout } from "../core/contributions/textMeasure/layout";
6
6
 
7
- import { graphicService, graphicUtil } from "../modules";
7
+ import { application } from "../application";
8
8
 
9
9
  import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from "./graphic";
10
10
 
@@ -24,15 +24,16 @@ export class Text extends Graphic {
24
24
  return this._font || (this._font = getContextFont(this.attribute, textTheme)), this._font;
25
25
  }
26
26
  get clipedText() {
27
- var _a;
27
+ var _a, _b;
28
28
  const attribute = this.attribute, textTheme = this.getGraphicTheme(), maxWidth = this.getMaxWidth(textTheme);
29
- return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
29
+ return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), null === (_b = this.cache) || void 0 === _b ? void 0 : _b.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
30
30
  }
31
31
  get clipedWidth() {
32
- return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
32
+ var _a;
33
+ return this.tryUpdateAABBBounds(), null === (_a = this.cache) || void 0 === _a ? void 0 : _a.clipedWidth;
33
34
  }
34
35
  get cliped() {
35
- var _a, _b;
36
+ var _a, _b, _c;
36
37
  const textTheme = this.getGraphicTheme(), attribute = this.attribute, maxWidth = this.getMaxWidth(textTheme);
37
38
  if (!Number.isFinite(maxWidth)) return !1;
38
39
  const {text: text} = this.attribute;
@@ -43,10 +44,11 @@ export class Text extends Graphic {
43
44
  }));
44
45
  return (Array.isArray(text) ? text.join("") : text).toString() !== mergedText;
45
46
  }
46
- return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map((item => item.text)).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
47
+ return "vertical" === attribute.direction && (null === (_c = this.cache) || void 0 === _c ? void 0 : _c.verticalList) && this.cache.verticalList[0] ? this.cache.verticalList[0].map((item => item.text)).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
47
48
  }
48
49
  get multilineLayout() {
49
- return this.tryUpdateAABBBounds(), this.cache.layoutData;
50
+ var _a;
51
+ return this.tryUpdateAABBBounds(), null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData;
50
52
  }
51
53
  get isMultiLine() {
52
54
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
@@ -55,7 +57,10 @@ export class Text extends Graphic {
55
57
  text: "",
56
58
  fontSize: 16
57
59
  }) {
58
- super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
60
+ super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE;
61
+ }
62
+ getOrCreateCache() {
63
+ return this.cache || (this.cache = {}), this.cache;
59
64
  }
60
65
  isValid() {
61
66
  return super.isValid() && this._isValid();
@@ -91,21 +96,21 @@ export class Text extends Graphic {
91
96
  updateAABBBounds(attribute, textTheme, aabbBounds) {
92
97
  const {text: text = textTheme.text} = this.attribute;
93
98
  Array.isArray(text) ? this.updateMultilineAABBBounds(text) : this.updateSingallineAABBBounds(text);
94
- const {tb1: tb1} = graphicService.updateTempAABBBounds(aabbBounds), {scaleX: scaleX = textTheme.scaleX, scaleY: scaleY = textTheme.scaleY, shadowBlur: shadowBlur = textTheme.shadowBlur, strokeBoundsBuffer: strokeBoundsBuffer = textTheme.strokeBoundsBuffer} = attribute;
99
+ const {tb1: tb1} = application.graphicService.updateTempAABBBounds(aabbBounds), {scaleX: scaleX = textTheme.scaleX, scaleY: scaleY = textTheme.scaleY, shadowBlur: shadowBlur = textTheme.shadowBlur, strokeBoundsBuffer: strokeBoundsBuffer = textTheme.strokeBoundsBuffer} = attribute;
95
100
  if (shadowBlur) {
96
101
  const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
97
102
  boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
98
103
  }
99
- return graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds),
104
+ return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds),
100
105
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1,
101
106
  transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
102
107
  }
103
108
  updateSingallineAABBBounds(text) {
104
109
  this.updateMultilineAABBBounds([ text ]);
105
- const layoutData = this.cache.layoutData;
110
+ const cache = this.getOrCreateCache(), layoutData = cache.layoutData;
106
111
  if (layoutData && layoutData.lines && layoutData.lines.length) {
107
112
  const line = layoutData.lines[0];
108
- this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
113
+ cache.clipedText = line.str, cache.clipedWidth = line.width;
109
114
  }
110
115
  return this._AABBBounds;
111
116
  }
@@ -126,7 +131,7 @@ export class Text extends Graphic {
126
131
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
127
132
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
128
133
  }
129
- const textMeasure = graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_b = this.stage) || void 0 === _b ? void 0 : _b.textMeasureId)), layoutData = new CanvasTextLayout(fontFamily, {
134
+ const textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_b = this.stage) || void 0 === _b ? void 0 : _b.textMeasureId)), layoutData = new CanvasTextLayout(fontFamily, {
130
135
  fontSize: fontSize,
131
136
  fontWeight: fontWeight,
132
137
  fontFamily: fontFamily,
@@ -137,7 +142,8 @@ export class Text extends Graphic {
137
142
  measureMode: measureMode,
138
143
  keepCenterInLine: keepCenterInLine
139
144
  }), {bbox: bbox} = layoutData;
140
- return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
145
+ return this.getOrCreateCache().layoutData = layoutData, this.clearUpdateShapeTag(),
146
+ this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
141
147
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
142
148
  }
143
149
  updateWrapAABBBounds(text) {
@@ -148,7 +154,7 @@ export class Text extends Graphic {
148
154
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
149
155
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
150
156
  }
151
- const textMeasure = graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_b = this.stage) || void 0 === _b ? void 0 : _b.textMeasureId)), textOptions = {
157
+ const textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_b = this.stage) || void 0 === _b ? void 0 : _b.textMeasureId)), textOptions = {
152
158
  fontSize: fontSize,
153
159
  fontWeight: fontWeight,
154
160
  fontFamily: fontFamily,
@@ -233,12 +239,13 @@ export class Text extends Graphic {
233
239
  };
234
240
  layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
235
241
  const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
236
- return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
242
+ return this.getOrCreateCache().layoutData = layoutData, this.clearUpdateShapeTag(),
243
+ this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
237
244
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
238
245
  }
239
246
  updateVerticalMultilineAABBBounds(text) {
240
247
  var _a, _b, _c;
241
- const textTheme = this.getGraphicTheme(), textMeasure = graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.textMeasureId));
248
+ const textTheme = this.getGraphicTheme(), textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.textMeasureId));
242
249
  let width;
243
250
  const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = this.getLineHeight(attribute, textTheme, 0);
244
251
  let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
@@ -280,11 +287,13 @@ export class Text extends Graphic {
280
287
  });
281
288
  width += w, t.width = w;
282
289
  }));
283
- })), this.cache.verticalList = verticalLists, this.clearUpdateShapeTag(), this.cache.verticalList.forEach((item => {
290
+ }));
291
+ const cache = this.getOrCreateCache();
292
+ cache.verticalList = verticalLists, this.clearUpdateShapeTag(), cache.verticalList.forEach((item => {
284
293
  const w = item.reduce(((a, b) => a + b.width), 0);
285
294
  width = max(w, width);
286
295
  }));
287
- const dx = textDrawOffsetX(textAlign, width), height = this.cache.verticalList.length * lineHeight, dy = textLayoutOffsetY(textBaseline, height, fontSize);
296
+ const dx = textDrawOffsetX(textAlign, width), height = cache.verticalList.length * lineHeight, dy = textLayoutOffsetY(textBaseline, height, fontSize);
288
297
  return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
289
298
  this._AABBBounds;
290
299
  }