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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1018) 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/constants.js +2 -1
  11. package/cjs/canvas/contributions/base-canvas.js +2 -2
  12. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  13. package/cjs/canvas/util.d.ts +2 -3
  14. package/cjs/canvas/util.js +17 -7
  15. package/cjs/canvas/util.js.map +1 -1
  16. package/cjs/color-string/index.js +1 -2
  17. package/cjs/common/contribution-provider.d.ts +27 -0
  18. package/cjs/common/contribution-provider.js +51 -0
  19. package/cjs/common/contribution-provider.js.map +1 -0
  20. package/cjs/common/diff.js +1 -2
  21. package/cjs/common/enums.d.ts +2 -0
  22. package/cjs/common/enums.js +3 -1
  23. package/cjs/common/enums.js.map +1 -1
  24. package/cjs/common/event-listener-manager.d.ts +18 -1
  25. package/cjs/common/event-listener-manager.js +40 -10
  26. package/cjs/common/event-listener-manager.js.map +1 -1
  27. package/cjs/common/event-transformer.js +41 -5
  28. package/cjs/common/event-transformer.js.map +1 -1
  29. package/cjs/common/explicit-binding.d.ts +5 -0
  30. package/cjs/common/explicit-binding.js +16 -0
  31. package/cjs/common/explicit-binding.js.map +1 -0
  32. package/cjs/common/performance-raf.d.ts +1 -0
  33. package/cjs/common/performance-raf.js +7 -2
  34. package/cjs/common/performance-raf.js.map +1 -1
  35. package/cjs/common/seg-context.js +1 -2
  36. package/cjs/common/sort.js +2 -1
  37. package/cjs/core/camera.js +1 -1
  38. package/cjs/core/constants.js +1 -1
  39. package/cjs/core/contributions/env/modules.d.ts +4 -0
  40. package/cjs/core/contributions/env/modules.js +14 -0
  41. package/cjs/core/contributions/env/modules.js.map +1 -0
  42. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
  43. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  44. package/cjs/core/contributions/layerHandler/empty-contribution.js +2 -2
  45. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  46. package/cjs/core/contributions/layerHandler/modules.d.ts +4 -0
  47. package/cjs/core/contributions/layerHandler/modules.js +14 -0
  48. package/cjs/core/contributions/layerHandler/modules.js.map +1 -0
  49. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
  50. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  51. package/cjs/core/contributions/modules.d.ts +2 -1
  52. package/cjs/core/contributions/modules.js +20 -2
  53. package/cjs/core/contributions/modules.js.map +1 -1
  54. package/cjs/core/contributions/textMeasure/modules.d.ts +4 -0
  55. package/cjs/core/contributions/textMeasure/modules.js +15 -0
  56. package/cjs/core/contributions/textMeasure/modules.js.map +1 -0
  57. package/cjs/core/core-modules.d.ts +4 -0
  58. package/cjs/core/core-modules.js +19 -0
  59. package/cjs/core/core-modules.js.map +1 -0
  60. package/cjs/core/global-module.d.ts +1 -0
  61. package/cjs/core/global-module.js +3 -0
  62. package/cjs/core/global-module.js.map +1 -0
  63. package/cjs/core/global.d.ts +4 -2
  64. package/cjs/core/global.js +8 -5
  65. package/cjs/core/global.js.map +1 -1
  66. package/cjs/core/graphic-utils.d.ts +3 -4
  67. package/cjs/core/graphic-utils.js +4 -5
  68. package/cjs/core/graphic-utils.js.map +1 -1
  69. package/cjs/core/layer-service.d.ts +7 -2
  70. package/cjs/core/layer-service.js +23 -13
  71. package/cjs/core/layer-service.js.map +1 -1
  72. package/cjs/core/layer.d.ts +1 -1
  73. package/cjs/core/layer.js +3 -3
  74. package/cjs/core/layer.js.map +1 -1
  75. package/cjs/core/stage.d.ts +17 -3
  76. package/cjs/core/stage.js +47 -25
  77. package/cjs/core/stage.js.map +1 -1
  78. package/cjs/core/window.d.ts +7 -5
  79. package/cjs/core/window.js +11 -7
  80. package/cjs/core/window.js.map +1 -1
  81. package/cjs/create.d.ts +1 -2
  82. package/cjs/create.js +2 -2
  83. package/cjs/create.js.map +1 -1
  84. package/cjs/entries/app-context.d.ts +30 -0
  85. package/cjs/entries/app-context.js +84 -0
  86. package/cjs/entries/app-context.js.map +1 -0
  87. package/cjs/entries/browser.d.ts +25 -0
  88. package/cjs/entries/browser.js +44 -0
  89. package/cjs/entries/browser.js.map +1 -0
  90. package/cjs/entries/index.d.ts +7 -0
  91. package/cjs/entries/index.js +32 -0
  92. package/cjs/entries/index.js.map +1 -0
  93. package/cjs/entries/miniapp.d.ts +6 -0
  94. package/cjs/entries/miniapp.js +20 -0
  95. package/cjs/entries/miniapp.js.map +1 -0
  96. package/cjs/entries/node.d.ts +6 -0
  97. package/cjs/entries/node.js +20 -0
  98. package/cjs/entries/node.js.map +1 -0
  99. package/cjs/entries/runtime-installer.d.ts +11 -0
  100. package/cjs/entries/runtime-installer.js +111 -0
  101. package/cjs/entries/runtime-installer.js.map +1 -0
  102. package/cjs/entries/types.d.ts +29 -0
  103. package/cjs/entries/types.js.map +1 -0
  104. package/cjs/env-check.js +3 -3
  105. package/cjs/env-check.js.map +1 -1
  106. package/cjs/event/event-manager.js +4 -1
  107. package/cjs/event/event-manager.js.map +1 -1
  108. package/cjs/event/util.d.ts +1 -1
  109. package/cjs/factory/graphic-factory.d.ts +7 -0
  110. package/cjs/factory/graphic-factory.js +23 -0
  111. package/cjs/factory/graphic-factory.js.map +1 -0
  112. package/cjs/factory/index.d.ts +4 -0
  113. package/cjs/factory/index.js +22 -0
  114. package/cjs/factory/index.js.map +1 -0
  115. package/cjs/factory/layer-factory.d.ts +7 -0
  116. package/cjs/factory/layer-factory.js +19 -0
  117. package/cjs/factory/layer-factory.js.map +1 -0
  118. package/cjs/factory/stage-factory.d.ts +8 -0
  119. package/cjs/factory/stage-factory.js +20 -0
  120. package/cjs/factory/stage-factory.js.map +1 -0
  121. package/cjs/factory/types.d.ts +34 -0
  122. package/cjs/factory/types.js +6 -0
  123. package/cjs/factory/types.js.map +1 -0
  124. package/cjs/factory.d.ts +1 -0
  125. package/cjs/factory.js +16 -1
  126. package/cjs/factory.js.map +1 -1
  127. package/cjs/global.d.ts +2 -0
  128. package/cjs/global.js +11 -0
  129. package/cjs/global.js.map +1 -0
  130. package/cjs/graphic/arc.js +3 -3
  131. package/cjs/graphic/arc.js.map +1 -1
  132. package/cjs/graphic/arc3d.js +3 -3
  133. package/cjs/graphic/arc3d.js.map +1 -1
  134. package/cjs/graphic/area.js +3 -3
  135. package/cjs/graphic/area.js.map +1 -1
  136. package/cjs/graphic/bounds.js +3 -3
  137. package/cjs/graphic/bounds.js.map +1 -1
  138. package/cjs/graphic/circle.js +3 -3
  139. package/cjs/graphic/circle.js.map +1 -1
  140. package/cjs/graphic/config.js +7 -1
  141. package/cjs/graphic/config.js.map +1 -1
  142. package/cjs/graphic/glyph.js +9 -3
  143. package/cjs/graphic/glyph.js.map +1 -1
  144. package/cjs/graphic/graphic-creator.d.ts +9 -4
  145. package/cjs/graphic/graphic-creator.js +35 -7
  146. package/cjs/graphic/graphic-creator.js.map +1 -1
  147. package/cjs/graphic/graphic-service/graphic-module.d.ts +4 -0
  148. package/cjs/graphic/graphic-service/graphic-module.js +14 -0
  149. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -0
  150. package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -3
  151. package/cjs/graphic/graphic-service/graphic-service.js +3 -4
  152. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  153. package/cjs/graphic/graphic.d.ts +81 -7
  154. package/cjs/graphic/graphic.js +517 -146
  155. package/cjs/graphic/graphic.js.map +1 -1
  156. package/cjs/graphic/group.d.ts +11 -1
  157. package/cjs/graphic/group.js +49 -13
  158. package/cjs/graphic/group.js.map +1 -1
  159. package/cjs/graphic/image.d.ts +1 -0
  160. package/cjs/graphic/image.js +4 -3
  161. package/cjs/graphic/image.js.map +1 -1
  162. package/cjs/graphic/index.d.ts +3 -0
  163. package/cjs/graphic/index.js +34 -15
  164. package/cjs/graphic/index.js.map +1 -1
  165. package/cjs/graphic/line.js +3 -3
  166. package/cjs/graphic/line.js.map +1 -1
  167. package/cjs/graphic/path.js +3 -3
  168. package/cjs/graphic/path.js.map +1 -1
  169. package/cjs/graphic/polygon.js +3 -3
  170. package/cjs/graphic/polygon.js.map +1 -1
  171. package/cjs/graphic/pyramid3d.js +3 -2
  172. package/cjs/graphic/pyramid3d.js.map +1 -1
  173. package/cjs/graphic/rect.d.ts +2 -0
  174. package/cjs/graphic/rect.js +47 -3
  175. package/cjs/graphic/rect.js.map +1 -1
  176. package/cjs/graphic/richtext/utils.js +3 -3
  177. package/cjs/graphic/richtext/utils.js.map +1 -1
  178. package/cjs/graphic/richtext.js +4 -4
  179. package/cjs/graphic/richtext.js.map +1 -1
  180. package/cjs/graphic/star.js +3 -3
  181. package/cjs/graphic/star.js.map +1 -1
  182. package/cjs/graphic/state/attribute-update-classifier.d.ts +13 -0
  183. package/cjs/graphic/state/attribute-update-classifier.js +67 -0
  184. package/cjs/graphic/state/attribute-update-classifier.js.map +1 -0
  185. package/cjs/graphic/state/shared-state-refresh.d.ts +6 -0
  186. package/cjs/graphic/state/shared-state-refresh.js +55 -0
  187. package/cjs/graphic/state/shared-state-refresh.js.map +1 -0
  188. package/cjs/graphic/state/shared-state-scope.d.ts +25 -0
  189. package/cjs/graphic/state/shared-state-scope.js +98 -0
  190. package/cjs/graphic/state/shared-state-scope.js.map +1 -0
  191. package/cjs/graphic/state/state-batch-scheduler.d.ts +42 -0
  192. package/cjs/graphic/state/state-batch-scheduler.js +285 -0
  193. package/cjs/graphic/state/state-batch-scheduler.js.map +1 -0
  194. package/cjs/graphic/state/state-definition-compiler.d.ts +6 -0
  195. package/cjs/graphic/state/state-definition-compiler.js +91 -0
  196. package/cjs/graphic/state/state-definition-compiler.js.map +1 -0
  197. package/cjs/graphic/state/state-definition.d.ts +44 -0
  198. package/cjs/graphic/state/state-definition.js +6 -0
  199. package/cjs/graphic/state/state-definition.js.map +1 -0
  200. package/cjs/graphic/state/state-engine.d.ts +38 -0
  201. package/cjs/graphic/state/state-engine.js +220 -0
  202. package/cjs/graphic/state/state-engine.js.map +1 -0
  203. package/cjs/graphic/state/state-model.d.ts +43 -0
  204. package/cjs/graphic/state/state-model.js +143 -0
  205. package/cjs/graphic/state/state-model.js.map +1 -0
  206. package/cjs/graphic/state/state-perf-monitor.d.ts +119 -0
  207. package/cjs/graphic/state/state-perf-monitor.js +217 -0
  208. package/cjs/graphic/state/state-perf-monitor.js.map +1 -0
  209. package/cjs/graphic/state/state-style-resolver.d.ts +22 -0
  210. package/cjs/graphic/state/state-style-resolver.js +73 -0
  211. package/cjs/graphic/state/state-style-resolver.js.map +1 -0
  212. package/cjs/graphic/state/state-transition-orchestrator.d.ts +46 -0
  213. package/cjs/graphic/state/state-transition-orchestrator.js +86 -0
  214. package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -0
  215. package/cjs/graphic/symbol.js +3 -3
  216. package/cjs/graphic/symbol.js.map +1 -1
  217. package/cjs/graphic/text.d.ts +3 -2
  218. package/cjs/graphic/text.js +29 -20
  219. package/cjs/graphic/text.js.map +1 -1
  220. package/cjs/graphic/theme.d.ts +5 -0
  221. package/cjs/graphic/theme.js +7 -0
  222. package/cjs/graphic/theme.js.map +1 -1
  223. package/cjs/graphic/tools.js +2 -2
  224. package/cjs/graphic/tools.js.map +1 -1
  225. package/cjs/graphic/wrap-text.d.ts +1 -1
  226. package/cjs/graphic/wrap-text.js +18 -15
  227. package/cjs/graphic/wrap-text.js.map +1 -1
  228. package/cjs/index.d.ts +26 -4
  229. package/cjs/index.js +83 -45
  230. package/cjs/index.js.map +1 -1
  231. package/cjs/interface/canvas.d.ts +1 -1
  232. package/cjs/interface/canvas.js.map +1 -1
  233. package/cjs/interface/global.d.ts +2 -0
  234. package/cjs/interface/global.js.map +1 -1
  235. package/cjs/interface/graphic/group.d.ts +6 -0
  236. package/cjs/interface/graphic/group.js.map +1 -1
  237. package/cjs/interface/graphic/image.d.ts +7 -1
  238. package/cjs/interface/graphic/image.js.map +1 -1
  239. package/cjs/interface/graphic/theme.d.ts +3 -0
  240. package/cjs/interface/graphic/theme.js.map +1 -1
  241. package/cjs/interface/graphic.d.ts +34 -5
  242. package/cjs/interface/graphic.js.map +1 -1
  243. package/cjs/interface/layer.d.ts +3 -2
  244. package/cjs/interface/layer.js.map +1 -1
  245. package/cjs/interface/plugin.d.ts +2 -0
  246. package/cjs/interface/plugin.js.map +1 -1
  247. package/cjs/interface/render.d.ts +1 -1
  248. package/cjs/interface/render.js.map +1 -1
  249. package/cjs/interface/stage.d.ts +9 -0
  250. package/cjs/interface/stage.js.map +1 -1
  251. package/cjs/interface/theme-service.js.map +1 -1
  252. package/cjs/legacy/binding-context.d.ts +24 -0
  253. package/cjs/legacy/binding-context.js +98 -0
  254. package/cjs/legacy/binding-context.js.map +1 -0
  255. package/cjs/legacy/bootstrap.d.ts +10 -0
  256. package/cjs/legacy/bootstrap.js +72 -0
  257. package/cjs/legacy/bootstrap.js.map +1 -0
  258. package/cjs/legacy/module-types.d.ts +2 -0
  259. package/cjs/legacy/module-types.js +6 -0
  260. package/cjs/legacy/module-types.js.map +1 -0
  261. package/cjs/modules.d.ts +5 -6
  262. package/cjs/modules.js +54 -9
  263. package/cjs/modules.js.map +1 -1
  264. package/cjs/picker/global-picker-service.js +2 -2
  265. package/cjs/picker/global-picker-service.js.map +1 -1
  266. package/cjs/picker/pick-modules.d.ts +5 -0
  267. package/cjs/picker/pick-modules.js +24 -0
  268. package/cjs/picker/pick-modules.js.map +1 -0
  269. package/cjs/picker/picker-service.d.ts +13 -4
  270. package/cjs/picker/picker-service.js +15 -8
  271. package/cjs/picker/picker-service.js.map +1 -1
  272. package/cjs/plugins/base-plugin.d.ts +8 -0
  273. package/cjs/plugins/base-plugin.js +15 -0
  274. package/cjs/plugins/base-plugin.js.map +1 -0
  275. package/cjs/plugins/browser-env-plugin.d.ts +8 -0
  276. package/cjs/plugins/browser-env-plugin.js +24 -0
  277. package/cjs/plugins/browser-env-plugin.js.map +1 -0
  278. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +6 -5
  279. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
  280. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  281. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
  282. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +25 -4
  283. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  284. package/cjs/plugins/builtin-plugin/edit-module.js +4 -3
  285. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  286. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  287. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +8 -8
  288. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  289. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +2 -2
  290. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  291. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +3 -3
  292. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  293. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +13 -9
  294. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  295. package/cjs/plugins/index.d.ts +5 -0
  296. package/cjs/plugins/index.js +23 -0
  297. package/cjs/plugins/index.js.map +1 -0
  298. package/cjs/plugins/picker-plugin.d.ts +7 -0
  299. package/cjs/plugins/picker-plugin.js +19 -0
  300. package/cjs/plugins/picker-plugin.js.map +1 -0
  301. package/cjs/plugins/plugin-modules.d.ts +4 -0
  302. package/cjs/plugins/plugin-modules.js +14 -0
  303. package/cjs/plugins/plugin-modules.js.map +1 -0
  304. package/cjs/plugins/plugin-service.d.ts +16 -2
  305. package/cjs/plugins/plugin-service.js +23 -11
  306. package/cjs/plugins/plugin-service.js.map +1 -1
  307. package/cjs/plugins/renderer-plugin.d.ts +7 -0
  308. package/cjs/plugins/renderer-plugin.js +19 -0
  309. package/cjs/plugins/renderer-plugin.js.map +1 -0
  310. package/cjs/plugins/types.d.ts +28 -0
  311. package/cjs/plugins/types.js +6 -0
  312. package/cjs/plugins/types.js.map +1 -0
  313. package/cjs/register/register-arc.js +1 -1
  314. package/cjs/register/register-arc.js.map +1 -1
  315. package/cjs/register/register-arc3d.js +1 -1
  316. package/cjs/register/register-arc3d.js.map +1 -1
  317. package/cjs/register/register-area.js +1 -1
  318. package/cjs/register/register-area.js.map +1 -1
  319. package/cjs/register/register-circle.js +1 -1
  320. package/cjs/register/register-circle.js.map +1 -1
  321. package/cjs/register/register-glyph.js +1 -1
  322. package/cjs/register/register-glyph.js.map +1 -1
  323. package/cjs/register/register-group.js +1 -1
  324. package/cjs/register/register-group.js.map +1 -1
  325. package/cjs/register/register-image.js +1 -1
  326. package/cjs/register/register-image.js.map +1 -1
  327. package/cjs/register/register-line.js +1 -1
  328. package/cjs/register/register-line.js.map +1 -1
  329. package/cjs/register/register-path.js +1 -1
  330. package/cjs/register/register-path.js.map +1 -1
  331. package/cjs/register/register-polygon.js +1 -1
  332. package/cjs/register/register-polygon.js.map +1 -1
  333. package/cjs/register/register-pyramid3d.js +1 -1
  334. package/cjs/register/register-pyramid3d.js.map +1 -1
  335. package/cjs/register/register-rect.js +1 -1
  336. package/cjs/register/register-rect.js.map +1 -1
  337. package/cjs/register/register-rect3d.js +1 -1
  338. package/cjs/register/register-rect3d.js.map +1 -1
  339. package/cjs/register/register-richtext.js +1 -1
  340. package/cjs/register/register-richtext.js.map +1 -1
  341. package/cjs/register/register-shadowRoot.js +1 -1
  342. package/cjs/register/register-shadowRoot.js.map +1 -1
  343. package/cjs/register/register-star.js +1 -1
  344. package/cjs/register/register-star.js.map +1 -1
  345. package/cjs/register/register-symbol.js +1 -1
  346. package/cjs/register/register-symbol.js.map +1 -1
  347. package/cjs/register/register-text.js +1 -1
  348. package/cjs/register/register-text.js.map +1 -1
  349. package/cjs/register/register-wraptext.js +1 -1
  350. package/cjs/register/register-wraptext.js.map +1 -1
  351. package/cjs/registry/contribution-registry.d.ts +9 -0
  352. package/cjs/registry/contribution-registry.js +33 -0
  353. package/cjs/registry/contribution-registry.js.map +1 -0
  354. package/cjs/registry/index.d.ts +5 -0
  355. package/cjs/registry/index.js +23 -0
  356. package/cjs/registry/index.js.map +1 -0
  357. package/cjs/registry/picker-registry.d.ts +10 -0
  358. package/cjs/registry/picker-registry.js +29 -0
  359. package/cjs/registry/picker-registry.js.map +1 -0
  360. package/cjs/registry/plugin-registry.d.ts +10 -0
  361. package/cjs/registry/plugin-registry.js +29 -0
  362. package/cjs/registry/plugin-registry.js.map +1 -0
  363. package/cjs/registry/renderer-registry.d.ts +11 -0
  364. package/cjs/registry/renderer-registry.js +37 -0
  365. package/cjs/registry/renderer-registry.js.map +1 -0
  366. package/cjs/registry/types.d.ts +34 -0
  367. package/cjs/registry/types.js +6 -0
  368. package/cjs/registry/types.js.map +1 -0
  369. package/cjs/render/contributions/modules.d.ts +2 -0
  370. package/cjs/render/contributions/modules.js +22 -0
  371. package/cjs/render/contributions/modules.js.map +1 -0
  372. package/cjs/render/contributions/render/arc-module.d.ts +4 -0
  373. package/cjs/render/contributions/render/arc-module.js +19 -0
  374. package/cjs/render/contributions/render/arc-module.js.map +1 -0
  375. package/cjs/render/contributions/render/arc-render.d.ts +2 -2
  376. package/cjs/render/contributions/render/arc-render.js +4 -5
  377. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  378. package/cjs/render/contributions/render/arc3d-module.d.ts +4 -0
  379. package/cjs/render/contributions/render/arc3d-module.js +17 -0
  380. package/cjs/render/contributions/render/arc3d-module.js.map +1 -0
  381. package/cjs/render/contributions/render/area-module.d.ts +4 -0
  382. package/cjs/render/contributions/render/area-module.js +20 -0
  383. package/cjs/render/contributions/render/area-module.js.map +1 -0
  384. package/cjs/render/contributions/render/area-render.d.ts +2 -2
  385. package/cjs/render/contributions/render/area-render.js +4 -5
  386. package/cjs/render/contributions/render/area-render.js.map +1 -1
  387. package/cjs/render/contributions/render/base-render.js +1 -1
  388. package/cjs/render/contributions/render/base-render.js.map +1 -1
  389. package/cjs/render/contributions/render/circle-module.d.ts +4 -0
  390. package/cjs/render/contributions/render/circle-module.js +19 -0
  391. package/cjs/render/contributions/render/circle-module.js.map +1 -0
  392. package/cjs/render/contributions/render/circle-render.d.ts +2 -2
  393. package/cjs/render/contributions/render/circle-render.js +4 -5
  394. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  395. package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +29 -11
  396. package/cjs/render/contributions/render/contributions/base-contribution-render.js +150 -39
  397. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  398. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +4 -2
  399. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +84 -31
  400. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  401. package/cjs/render/contributions/render/contributions/group-contribution-render.js +8 -6
  402. package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  403. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +2 -1
  404. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  405. package/cjs/render/contributions/render/contributions/text-contribution-render.js +20 -16
  406. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  407. package/cjs/render/contributions/render/draw-contribution.d.ts +13 -4
  408. package/cjs/render/contributions/render/draw-contribution.js +37 -13
  409. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  410. package/cjs/render/contributions/render/draw-interceptor.js +2 -3
  411. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  412. package/cjs/render/contributions/render/glyph-module.d.ts +4 -0
  413. package/cjs/render/contributions/render/glyph-module.js +17 -0
  414. package/cjs/render/contributions/render/glyph-module.js.map +1 -0
  415. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  416. package/cjs/render/contributions/render/group-render.js +3 -5
  417. package/cjs/render/contributions/render/group-render.js.map +1 -1
  418. package/cjs/render/contributions/render/image-module.d.ts +4 -0
  419. package/cjs/render/contributions/render/image-module.js +18 -0
  420. package/cjs/render/contributions/render/image-module.js.map +1 -0
  421. package/cjs/render/contributions/render/image-render.d.ts +16 -3
  422. package/cjs/render/contributions/render/image-render.js +101 -24
  423. package/cjs/render/contributions/render/image-render.js.map +1 -1
  424. package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +5 -3
  425. package/cjs/render/contributions/render/incremental-draw-contribution.js +5 -7
  426. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  427. package/cjs/render/contributions/render/index.d.ts +4 -12
  428. package/cjs/render/contributions/render/index.js +7 -11
  429. package/cjs/render/contributions/render/index.js.map +1 -1
  430. package/cjs/render/contributions/render/line-module.d.ts +4 -0
  431. package/cjs/render/contributions/render/line-module.js +19 -0
  432. package/cjs/render/contributions/render/line-module.js.map +1 -0
  433. package/cjs/render/contributions/render/module.d.ts +4 -0
  434. package/cjs/render/contributions/render/module.js +27 -0
  435. package/cjs/render/contributions/render/module.js.map +1 -0
  436. package/cjs/render/contributions/render/path-module.d.ts +4 -0
  437. package/cjs/render/contributions/render/path-module.js +19 -0
  438. package/cjs/render/contributions/render/path-module.js.map +1 -0
  439. package/cjs/render/contributions/render/path-render.d.ts +2 -2
  440. package/cjs/render/contributions/render/path-render.js +4 -5
  441. package/cjs/render/contributions/render/path-render.js.map +1 -1
  442. package/cjs/render/contributions/render/polygon-module.d.ts +4 -0
  443. package/cjs/render/contributions/render/polygon-module.js +18 -0
  444. package/cjs/render/contributions/render/polygon-module.js.map +1 -0
  445. package/cjs/render/contributions/render/polygon-render.d.ts +2 -2
  446. package/cjs/render/contributions/render/polygon-render.js +4 -5
  447. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  448. package/cjs/render/contributions/render/pyramid3d-module.d.ts +4 -0
  449. package/cjs/render/contributions/render/pyramid3d-module.js +17 -0
  450. package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -0
  451. package/cjs/render/contributions/render/rect-module.d.ts +4 -0
  452. package/cjs/render/contributions/render/rect-module.js +23 -0
  453. package/cjs/render/contributions/render/rect-module.js.map +1 -0
  454. package/cjs/render/contributions/render/rect-render.d.ts +2 -2
  455. package/cjs/render/contributions/render/rect-render.js +4 -5
  456. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  457. package/cjs/render/contributions/render/rect3d-module.d.ts +4 -0
  458. package/cjs/render/contributions/render/rect3d-module.js +17 -0
  459. package/cjs/render/contributions/render/rect3d-module.js.map +1 -0
  460. package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
  461. package/cjs/render/contributions/render/render-slector.js.map +1 -1
  462. package/cjs/render/contributions/render/richtext-module.d.ts +4 -0
  463. package/cjs/render/contributions/render/richtext-module.js +17 -0
  464. package/cjs/render/contributions/render/richtext-module.js.map +1 -0
  465. package/cjs/render/contributions/render/star-module.d.ts +4 -0
  466. package/cjs/render/contributions/render/star-module.js +18 -0
  467. package/cjs/render/contributions/render/star-module.js.map +1 -0
  468. package/cjs/render/contributions/render/star-render.d.ts +2 -2
  469. package/cjs/render/contributions/render/star-render.js +4 -5
  470. package/cjs/render/contributions/render/star-render.js.map +1 -1
  471. package/cjs/render/contributions/render/symbol-module.d.ts +4 -0
  472. package/cjs/render/contributions/render/symbol-module.js +19 -0
  473. package/cjs/render/contributions/render/symbol-module.js.map +1 -0
  474. package/cjs/render/contributions/render/symbol-render.d.ts +2 -2
  475. package/cjs/render/contributions/render/symbol-render.js +4 -5
  476. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  477. package/cjs/render/contributions/render/symbol.d.ts +0 -2
  478. package/cjs/render/contributions/render/symbol.js +1 -3
  479. package/cjs/render/contributions/render/symbol.js.map +1 -1
  480. package/cjs/render/contributions/render/text-module.d.ts +4 -0
  481. package/cjs/render/contributions/render/text-module.js +18 -0
  482. package/cjs/render/contributions/render/text-module.js.map +1 -0
  483. package/cjs/render/contributions/render/text-render.d.ts +2 -2
  484. package/cjs/render/contributions/render/text-render.js +4 -5
  485. package/cjs/render/contributions/render/text-render.js.map +1 -1
  486. package/cjs/render/render-modules.d.ts +4 -0
  487. package/cjs/render/render-modules.js +14 -0
  488. package/cjs/render/render-modules.js.map +1 -0
  489. package/cjs/render/render-service.d.ts +1 -1
  490. package/cjs/render/render-service.js +3 -1
  491. package/cjs/render/render-service.js.map +1 -1
  492. package/cjs/resource-loader/loader.js +6 -6
  493. package/cjs/resource-loader/loader.js.map +1 -1
  494. package/dist/index.es.js +23943 -20059
  495. package/es/allocator/canvas-allocate.js +6 -8
  496. package/es/allocator/canvas-allocate.js.map +1 -1
  497. package/es/allocator/graphic-allocate.js +17 -17
  498. package/es/allocator/graphic-allocate.js.map +1 -1
  499. package/es/application.d.ts +19 -18
  500. package/es/application.js +1 -39
  501. package/es/application.js.map +1 -1
  502. package/es/canvas/conical-gradient.js +2 -2
  503. package/es/canvas/conical-gradient.js.map +1 -1
  504. package/es/canvas/constants.js +2 -1
  505. package/es/canvas/contributions/base-canvas.js +2 -2
  506. package/es/canvas/contributions/base-canvas.js.map +1 -1
  507. package/es/canvas/util.d.ts +2 -3
  508. package/es/canvas/util.js +16 -8
  509. package/es/canvas/util.js.map +1 -1
  510. package/es/color-string/index.js +1 -2
  511. package/es/common/contribution-provider.d.ts +27 -0
  512. package/es/common/contribution-provider.js +43 -0
  513. package/es/common/contribution-provider.js.map +1 -0
  514. package/es/common/diff.js +1 -2
  515. package/es/common/enums.d.ts +2 -0
  516. package/es/common/enums.js +3 -1
  517. package/es/common/enums.js.map +1 -1
  518. package/es/common/event-listener-manager.d.ts +18 -1
  519. package/es/common/event-listener-manager.js +40 -10
  520. package/es/common/event-listener-manager.js.map +1 -1
  521. package/es/common/event-transformer.js +41 -5
  522. package/es/common/event-transformer.js.map +1 -1
  523. package/es/common/explicit-binding.d.ts +5 -0
  524. package/es/common/explicit-binding.js +10 -0
  525. package/es/common/explicit-binding.js.map +1 -0
  526. package/es/common/performance-raf.d.ts +1 -0
  527. package/es/common/performance-raf.js +7 -2
  528. package/es/common/performance-raf.js.map +1 -1
  529. package/es/common/seg-context.js +1 -2
  530. package/es/common/sort.js +2 -1
  531. package/es/core/camera.js +1 -1
  532. package/es/core/constants.js +1 -1
  533. package/es/core/contributions/env/modules.d.ts +4 -0
  534. package/es/core/contributions/env/modules.js +10 -0
  535. package/es/core/contributions/env/modules.js.map +1 -0
  536. package/es/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
  537. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  538. package/es/core/contributions/layerHandler/empty-contribution.js +2 -2
  539. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  540. package/es/core/contributions/layerHandler/modules.d.ts +4 -0
  541. package/es/core/contributions/layerHandler/modules.js +10 -0
  542. package/es/core/contributions/layerHandler/modules.js.map +1 -0
  543. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
  544. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  545. package/es/core/contributions/modules.d.ts +2 -1
  546. package/es/core/contributions/modules.js +15 -1
  547. package/es/core/contributions/modules.js.map +1 -1
  548. package/es/core/contributions/textMeasure/modules.d.ts +4 -0
  549. package/es/core/contributions/textMeasure/modules.js +11 -0
  550. package/es/core/contributions/textMeasure/modules.js.map +1 -0
  551. package/es/core/core-modules.d.ts +4 -0
  552. package/es/core/core-modules.js +24 -0
  553. package/es/core/core-modules.js.map +1 -0
  554. package/es/core/global-module.d.ts +1 -0
  555. package/es/core/global-module.js +3 -0
  556. package/es/core/global-module.js.map +1 -0
  557. package/es/core/global.d.ts +4 -2
  558. package/es/core/global.js +7 -8
  559. package/es/core/global.js.map +1 -1
  560. package/es/core/graphic-utils.d.ts +3 -4
  561. package/es/core/graphic-utils.js +6 -11
  562. package/es/core/graphic-utils.js.map +1 -1
  563. package/es/core/layer-service.d.ts +7 -2
  564. package/es/core/layer-service.js +23 -17
  565. package/es/core/layer-service.js.map +1 -1
  566. package/es/core/layer.d.ts +1 -1
  567. package/es/core/layer.js +3 -3
  568. package/es/core/layer.js.map +1 -1
  569. package/es/core/stage.d.ts +17 -3
  570. package/es/core/stage.js +58 -30
  571. package/es/core/stage.js.map +1 -1
  572. package/es/core/window.d.ts +7 -5
  573. package/es/core/window.js +11 -9
  574. package/es/core/window.js.map +1 -1
  575. package/es/create.d.ts +1 -2
  576. package/es/create.js +4 -2
  577. package/es/create.js.map +1 -1
  578. package/es/entries/app-context.d.ts +30 -0
  579. package/es/entries/app-context.js +86 -0
  580. package/es/entries/app-context.js.map +1 -0
  581. package/es/entries/browser.d.ts +25 -0
  582. package/es/entries/browser.js +36 -0
  583. package/es/entries/browser.js.map +1 -0
  584. package/es/entries/index.d.ts +7 -0
  585. package/es/entries/index.js +14 -0
  586. package/es/entries/index.js.map +1 -0
  587. package/es/entries/miniapp.d.ts +6 -0
  588. package/es/entries/miniapp.js +12 -0
  589. package/es/entries/miniapp.js.map +1 -0
  590. package/es/entries/node.d.ts +6 -0
  591. package/es/entries/node.js +12 -0
  592. package/es/entries/node.js.map +1 -0
  593. package/es/entries/runtime-installer.d.ts +11 -0
  594. package/es/entries/runtime-installer.js +130 -0
  595. package/es/entries/runtime-installer.js.map +1 -0
  596. package/es/entries/types.d.ts +29 -0
  597. package/es/entries/types.js.map +1 -0
  598. package/es/env-check.js +3 -3
  599. package/es/env-check.js.map +1 -1
  600. package/es/event/event-manager.js +4 -1
  601. package/es/event/event-manager.js.map +1 -1
  602. package/es/event/util.d.ts +1 -1
  603. package/es/factory/graphic-factory.d.ts +7 -0
  604. package/es/factory/graphic-factory.js +15 -0
  605. package/es/factory/graphic-factory.js.map +1 -0
  606. package/es/factory/index.d.ts +4 -0
  607. package/es/factory/index.js +8 -0
  608. package/es/factory/index.js.map +1 -0
  609. package/es/factory/layer-factory.d.ts +7 -0
  610. package/es/factory/layer-factory.js +11 -0
  611. package/es/factory/layer-factory.js.map +1 -0
  612. package/es/factory/stage-factory.d.ts +8 -0
  613. package/es/factory/stage-factory.js +12 -0
  614. package/es/factory/stage-factory.js.map +1 -0
  615. package/es/factory/types.d.ts +34 -0
  616. package/es/factory/types.js +2 -0
  617. package/es/factory/types.js.map +1 -0
  618. package/es/factory.d.ts +1 -0
  619. package/es/factory.js +2 -0
  620. package/es/factory.js.map +1 -1
  621. package/es/global.d.ts +2 -0
  622. package/es/global.js +10 -0
  623. package/es/global.js.map +1 -0
  624. package/es/graphic/arc.js +3 -3
  625. package/es/graphic/arc.js.map +1 -1
  626. package/es/graphic/arc3d.js +4 -3
  627. package/es/graphic/arc3d.js.map +1 -1
  628. package/es/graphic/area.js +3 -3
  629. package/es/graphic/area.js.map +1 -1
  630. package/es/graphic/bounds.js +3 -3
  631. package/es/graphic/bounds.js.map +1 -1
  632. package/es/graphic/circle.js +3 -3
  633. package/es/graphic/circle.js.map +1 -1
  634. package/es/graphic/config.js +7 -1
  635. package/es/graphic/config.js.map +1 -1
  636. package/es/graphic/glyph.js +9 -3
  637. package/es/graphic/glyph.js.map +1 -1
  638. package/es/graphic/graphic-creator.d.ts +9 -4
  639. package/es/graphic/graphic-creator.js +32 -5
  640. package/es/graphic/graphic-creator.js.map +1 -1
  641. package/es/graphic/graphic-service/graphic-module.d.ts +4 -0
  642. package/es/graphic/graphic-service/graphic-module.js +12 -0
  643. package/es/graphic/graphic-service/graphic-module.js.map +1 -0
  644. package/es/graphic/graphic-service/graphic-service.d.ts +2 -3
  645. package/es/graphic/graphic-service/graphic-service.js +3 -5
  646. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  647. package/es/graphic/graphic.d.ts +81 -7
  648. package/es/graphic/graphic.js +516 -140
  649. package/es/graphic/graphic.js.map +1 -1
  650. package/es/graphic/group.d.ts +11 -1
  651. package/es/graphic/group.js +49 -13
  652. package/es/graphic/group.js.map +1 -1
  653. package/es/graphic/image.d.ts +1 -0
  654. package/es/graphic/image.js +5 -4
  655. package/es/graphic/image.js.map +1 -1
  656. package/es/graphic/index.d.ts +3 -0
  657. package/es/graphic/index.js +4 -0
  658. package/es/graphic/index.js.map +1 -1
  659. package/es/graphic/line.js +3 -3
  660. package/es/graphic/line.js.map +1 -1
  661. package/es/graphic/path.js +3 -3
  662. package/es/graphic/path.js.map +1 -1
  663. package/es/graphic/polygon.js +3 -3
  664. package/es/graphic/polygon.js.map +1 -1
  665. package/es/graphic/pyramid3d.js +2 -2
  666. package/es/graphic/pyramid3d.js.map +1 -1
  667. package/es/graphic/rect.d.ts +2 -0
  668. package/es/graphic/rect.js +47 -3
  669. package/es/graphic/rect.js.map +1 -1
  670. package/es/graphic/richtext/utils.js +3 -3
  671. package/es/graphic/richtext/utils.js.map +1 -1
  672. package/es/graphic/richtext.js +4 -4
  673. package/es/graphic/richtext.js.map +1 -1
  674. package/es/graphic/star.js +3 -3
  675. package/es/graphic/star.js.map +1 -1
  676. package/es/graphic/state/attribute-update-classifier.d.ts +13 -0
  677. package/es/graphic/state/attribute-update-classifier.js +61 -0
  678. package/es/graphic/state/attribute-update-classifier.js.map +1 -0
  679. package/es/graphic/state/shared-state-refresh.d.ts +6 -0
  680. package/es/graphic/state/shared-state-refresh.js +46 -0
  681. package/es/graphic/state/shared-state-refresh.js.map +1 -0
  682. package/es/graphic/state/shared-state-scope.d.ts +25 -0
  683. package/es/graphic/state/shared-state-scope.js +90 -0
  684. package/es/graphic/state/shared-state-scope.js.map +1 -0
  685. package/es/graphic/state/state-batch-scheduler.d.ts +42 -0
  686. package/es/graphic/state/state-batch-scheduler.js +278 -0
  687. package/es/graphic/state/state-batch-scheduler.js.map +1 -0
  688. package/es/graphic/state/state-definition-compiler.d.ts +6 -0
  689. package/es/graphic/state/state-definition-compiler.js +83 -0
  690. package/es/graphic/state/state-definition-compiler.js.map +1 -0
  691. package/es/graphic/state/state-definition.d.ts +44 -0
  692. package/es/graphic/state/state-definition.js +2 -0
  693. package/es/graphic/state/state-definition.js.map +1 -0
  694. package/es/graphic/state/state-engine.d.ts +38 -0
  695. package/es/graphic/state/state-engine.js +212 -0
  696. package/es/graphic/state/state-engine.js.map +1 -0
  697. package/es/graphic/state/state-model.d.ts +43 -0
  698. package/es/graphic/state/state-model.js +135 -0
  699. package/es/graphic/state/state-model.js.map +1 -0
  700. package/es/graphic/state/state-perf-monitor.d.ts +119 -0
  701. package/es/graphic/state/state-perf-monitor.js +207 -0
  702. package/es/graphic/state/state-perf-monitor.js.map +1 -0
  703. package/es/graphic/state/state-style-resolver.d.ts +22 -0
  704. package/es/graphic/state/state-style-resolver.js +65 -0
  705. package/es/graphic/state/state-style-resolver.js.map +1 -0
  706. package/es/graphic/state/state-transition-orchestrator.d.ts +46 -0
  707. package/es/graphic/state/state-transition-orchestrator.js +80 -0
  708. package/es/graphic/state/state-transition-orchestrator.js.map +1 -0
  709. package/es/graphic/symbol.js +3 -3
  710. package/es/graphic/symbol.js.map +1 -1
  711. package/es/graphic/text.d.ts +3 -2
  712. package/es/graphic/text.js +28 -19
  713. package/es/graphic/text.js.map +1 -1
  714. package/es/graphic/theme.d.ts +5 -0
  715. package/es/graphic/theme.js +7 -0
  716. package/es/graphic/theme.js.map +1 -1
  717. package/es/graphic/tools.js +2 -2
  718. package/es/graphic/tools.js.map +1 -1
  719. package/es/graphic/wrap-text.d.ts +1 -1
  720. package/es/graphic/wrap-text.js +20 -15
  721. package/es/graphic/wrap-text.js.map +1 -1
  722. package/es/index.d.ts +26 -4
  723. package/es/index.js +49 -5
  724. package/es/index.js.map +1 -1
  725. package/es/interface/canvas.d.ts +1 -1
  726. package/es/interface/canvas.js.map +1 -1
  727. package/es/interface/global.d.ts +2 -0
  728. package/es/interface/global.js.map +1 -1
  729. package/es/interface/graphic/group.d.ts +6 -0
  730. package/es/interface/graphic/group.js.map +1 -1
  731. package/es/interface/graphic/image.d.ts +7 -1
  732. package/es/interface/graphic/image.js.map +1 -1
  733. package/es/interface/graphic/theme.d.ts +3 -0
  734. package/es/interface/graphic/theme.js.map +1 -1
  735. package/es/interface/graphic.d.ts +34 -5
  736. package/es/interface/graphic.js.map +1 -1
  737. package/es/interface/layer.d.ts +3 -2
  738. package/es/interface/layer.js.map +1 -1
  739. package/es/interface/plugin.d.ts +2 -0
  740. package/es/interface/plugin.js.map +1 -1
  741. package/es/interface/render.d.ts +1 -1
  742. package/es/interface/render.js.map +1 -1
  743. package/es/interface/stage.d.ts +9 -0
  744. package/es/interface/stage.js.map +1 -1
  745. package/es/interface/theme-service.js.map +1 -1
  746. package/es/legacy/binding-context.d.ts +24 -0
  747. package/es/legacy/binding-context.js +90 -0
  748. package/es/legacy/binding-context.js.map +1 -0
  749. package/es/legacy/bootstrap.d.ts +10 -0
  750. package/es/legacy/bootstrap.js +73 -0
  751. package/es/legacy/bootstrap.js.map +1 -0
  752. package/es/legacy/module-types.d.ts +2 -0
  753. package/es/legacy/module-types.js +2 -0
  754. package/es/legacy/module-types.js.map +1 -0
  755. package/es/modules.d.ts +5 -6
  756. package/es/modules.js +44 -14
  757. package/es/modules.js.map +1 -1
  758. package/es/picker/global-picker-service.js +2 -2
  759. package/es/picker/global-picker-service.js.map +1 -1
  760. package/es/picker/pick-modules.d.ts +5 -0
  761. package/es/picker/pick-modules.js +18 -0
  762. package/es/picker/pick-modules.js.map +1 -0
  763. package/es/picker/picker-service.d.ts +13 -4
  764. package/es/picker/picker-service.js +16 -11
  765. package/es/picker/picker-service.js.map +1 -1
  766. package/es/plugins/base-plugin.d.ts +8 -0
  767. package/es/plugins/base-plugin.js +7 -0
  768. package/es/plugins/base-plugin.js.map +1 -0
  769. package/es/plugins/browser-env-plugin.d.ts +8 -0
  770. package/es/plugins/browser-env-plugin.js +16 -0
  771. package/es/plugins/browser-env-plugin.js.map +1 -0
  772. package/es/plugins/builtin-plugin/auto-refresh-plugin.js +6 -6
  773. package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
  774. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  775. package/es/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
  776. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +26 -3
  777. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  778. package/es/plugins/builtin-plugin/edit-module.js +3 -3
  779. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  780. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  781. package/es/plugins/builtin-plugin/html-attribute-plugin.js +8 -8
  782. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  783. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +2 -2
  784. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  785. package/es/plugins/builtin-plugin/react-attribute-plugin.js +3 -3
  786. package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  787. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +9 -7
  788. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  789. package/es/plugins/index.d.ts +5 -0
  790. package/es/plugins/index.js +10 -0
  791. package/es/plugins/index.js.map +1 -0
  792. package/es/plugins/picker-plugin.d.ts +7 -0
  793. package/es/plugins/picker-plugin.js +11 -0
  794. package/es/plugins/picker-plugin.js.map +1 -0
  795. package/es/plugins/plugin-modules.d.ts +4 -0
  796. package/es/plugins/plugin-modules.js +14 -0
  797. package/es/plugins/plugin-modules.js.map +1 -0
  798. package/es/plugins/plugin-service.d.ts +16 -2
  799. package/es/plugins/plugin-service.js +24 -12
  800. package/es/plugins/plugin-service.js.map +1 -1
  801. package/es/plugins/renderer-plugin.d.ts +7 -0
  802. package/es/plugins/renderer-plugin.js +11 -0
  803. package/es/plugins/renderer-plugin.js.map +1 -0
  804. package/es/plugins/types.d.ts +28 -0
  805. package/es/plugins/types.js +2 -0
  806. package/es/plugins/types.js.map +1 -0
  807. package/es/register/register-arc.js +2 -2
  808. package/es/register/register-arc.js.map +1 -1
  809. package/es/register/register-arc3d.js +2 -2
  810. package/es/register/register-arc3d.js.map +1 -1
  811. package/es/register/register-area.js +2 -2
  812. package/es/register/register-area.js.map +1 -1
  813. package/es/register/register-circle.js +2 -2
  814. package/es/register/register-circle.js.map +1 -1
  815. package/es/register/register-glyph.js +2 -2
  816. package/es/register/register-glyph.js.map +1 -1
  817. package/es/register/register-group.js +2 -2
  818. package/es/register/register-group.js.map +1 -1
  819. package/es/register/register-image.js +2 -2
  820. package/es/register/register-image.js.map +1 -1
  821. package/es/register/register-line.js +2 -2
  822. package/es/register/register-line.js.map +1 -1
  823. package/es/register/register-path.js +2 -2
  824. package/es/register/register-path.js.map +1 -1
  825. package/es/register/register-polygon.js +2 -2
  826. package/es/register/register-polygon.js.map +1 -1
  827. package/es/register/register-pyramid3d.js +2 -2
  828. package/es/register/register-pyramid3d.js.map +1 -1
  829. package/es/register/register-rect.js +2 -2
  830. package/es/register/register-rect.js.map +1 -1
  831. package/es/register/register-rect3d.js +2 -2
  832. package/es/register/register-rect3d.js.map +1 -1
  833. package/es/register/register-richtext.js +2 -2
  834. package/es/register/register-richtext.js.map +1 -1
  835. package/es/register/register-shadowRoot.js +2 -2
  836. package/es/register/register-shadowRoot.js.map +1 -1
  837. package/es/register/register-star.js +2 -2
  838. package/es/register/register-star.js.map +1 -1
  839. package/es/register/register-symbol.js +2 -2
  840. package/es/register/register-symbol.js.map +1 -1
  841. package/es/register/register-text.js +2 -2
  842. package/es/register/register-text.js.map +1 -1
  843. package/es/register/register-wraptext.js +2 -2
  844. package/es/register/register-wraptext.js.map +1 -1
  845. package/es/registry/contribution-registry.d.ts +9 -0
  846. package/es/registry/contribution-registry.js +25 -0
  847. package/es/registry/contribution-registry.js.map +1 -0
  848. package/es/registry/index.d.ts +5 -0
  849. package/es/registry/index.js +10 -0
  850. package/es/registry/index.js.map +1 -0
  851. package/es/registry/picker-registry.d.ts +10 -0
  852. package/es/registry/picker-registry.js +21 -0
  853. package/es/registry/picker-registry.js.map +1 -0
  854. package/es/registry/plugin-registry.d.ts +10 -0
  855. package/es/registry/plugin-registry.js +21 -0
  856. package/es/registry/plugin-registry.js.map +1 -0
  857. package/es/registry/renderer-registry.d.ts +11 -0
  858. package/es/registry/renderer-registry.js +29 -0
  859. package/es/registry/renderer-registry.js.map +1 -0
  860. package/es/registry/types.d.ts +34 -0
  861. package/es/registry/types.js +2 -0
  862. package/es/registry/types.js.map +1 -0
  863. package/es/render/contributions/modules.d.ts +2 -0
  864. package/es/render/contributions/modules.js +8 -0
  865. package/es/render/contributions/modules.js.map +1 -0
  866. package/es/render/contributions/render/arc-module.d.ts +4 -0
  867. package/es/render/contributions/render/arc-module.js +21 -0
  868. package/es/render/contributions/render/arc-module.js.map +1 -0
  869. package/es/render/contributions/render/arc-render.d.ts +2 -2
  870. package/es/render/contributions/render/arc-render.js +3 -8
  871. package/es/render/contributions/render/arc-render.js.map +1 -1
  872. package/es/render/contributions/render/arc3d-module.d.ts +4 -0
  873. package/es/render/contributions/render/arc3d-module.js +13 -0
  874. package/es/render/contributions/render/arc3d-module.js.map +1 -0
  875. package/es/render/contributions/render/area-module.d.ts +4 -0
  876. package/es/render/contributions/render/area-module.js +23 -0
  877. package/es/render/contributions/render/area-module.js.map +1 -0
  878. package/es/render/contributions/render/area-render.d.ts +2 -2
  879. package/es/render/contributions/render/area-render.js +3 -8
  880. package/es/render/contributions/render/area-render.js.map +1 -1
  881. package/es/render/contributions/render/base-render.js +1 -1
  882. package/es/render/contributions/render/base-render.js.map +1 -1
  883. package/es/render/contributions/render/circle-module.d.ts +4 -0
  884. package/es/render/contributions/render/circle-module.js +21 -0
  885. package/es/render/contributions/render/circle-module.js.map +1 -0
  886. package/es/render/contributions/render/circle-render.d.ts +2 -2
  887. package/es/render/contributions/render/circle-render.js +3 -8
  888. package/es/render/contributions/render/circle-render.js.map +1 -1
  889. package/es/render/contributions/render/contributions/base-contribution-render.d.ts +29 -11
  890. package/es/render/contributions/render/contributions/base-contribution-render.js +142 -41
  891. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  892. package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +4 -2
  893. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +85 -30
  894. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  895. package/es/render/contributions/render/contributions/group-contribution-render.js +9 -7
  896. package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  897. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +2 -1
  898. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  899. package/es/render/contributions/render/contributions/text-contribution-render.js +20 -16
  900. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  901. package/es/render/contributions/render/draw-contribution.d.ts +13 -4
  902. package/es/render/contributions/render/draw-contribution.js +40 -19
  903. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  904. package/es/render/contributions/render/draw-interceptor.js +2 -3
  905. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  906. package/es/render/contributions/render/glyph-module.d.ts +4 -0
  907. package/es/render/contributions/render/glyph-module.js +13 -0
  908. package/es/render/contributions/render/glyph-module.js.map +1 -0
  909. package/es/render/contributions/render/group-render.d.ts +2 -2
  910. package/es/render/contributions/render/group-render.js +3 -9
  911. package/es/render/contributions/render/group-render.js.map +1 -1
  912. package/es/render/contributions/render/image-module.d.ts +4 -0
  913. package/es/render/contributions/render/image-module.js +20 -0
  914. package/es/render/contributions/render/image-module.js.map +1 -0
  915. package/es/render/contributions/render/image-render.d.ts +16 -3
  916. package/es/render/contributions/render/image-render.js +95 -25
  917. package/es/render/contributions/render/image-render.js.map +1 -1
  918. package/es/render/contributions/render/incremental-draw-contribution.d.ts +5 -3
  919. package/es/render/contributions/render/incremental-draw-contribution.js +4 -12
  920. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  921. package/es/render/contributions/render/index.d.ts +4 -12
  922. package/es/render/contributions/render/index.js +8 -24
  923. package/es/render/contributions/render/index.js.map +1 -1
  924. package/es/render/contributions/render/line-module.d.ts +4 -0
  925. package/es/render/contributions/render/line-module.js +16 -0
  926. package/es/render/contributions/render/line-module.js.map +1 -0
  927. package/es/render/contributions/render/module.d.ts +4 -0
  928. package/es/render/contributions/render/module.js +28 -0
  929. package/es/render/contributions/render/module.js.map +1 -0
  930. package/es/render/contributions/render/path-module.d.ts +4 -0
  931. package/es/render/contributions/render/path-module.js +21 -0
  932. package/es/render/contributions/render/path-module.js.map +1 -0
  933. package/es/render/contributions/render/path-render.d.ts +2 -2
  934. package/es/render/contributions/render/path-render.js +3 -8
  935. package/es/render/contributions/render/path-render.js.map +1 -1
  936. package/es/render/contributions/render/polygon-module.d.ts +4 -0
  937. package/es/render/contributions/render/polygon-module.js +20 -0
  938. package/es/render/contributions/render/polygon-module.js.map +1 -0
  939. package/es/render/contributions/render/polygon-render.d.ts +2 -2
  940. package/es/render/contributions/render/polygon-render.js +3 -8
  941. package/es/render/contributions/render/polygon-render.js.map +1 -1
  942. package/es/render/contributions/render/pyramid3d-module.d.ts +4 -0
  943. package/es/render/contributions/render/pyramid3d-module.js +13 -0
  944. package/es/render/contributions/render/pyramid3d-module.js.map +1 -0
  945. package/es/render/contributions/render/rect-module.d.ts +4 -0
  946. package/es/render/contributions/render/rect-module.js +23 -0
  947. package/es/render/contributions/render/rect-module.js.map +1 -0
  948. package/es/render/contributions/render/rect-render.d.ts +2 -2
  949. package/es/render/contributions/render/rect-render.js +3 -8
  950. package/es/render/contributions/render/rect-render.js.map +1 -1
  951. package/es/render/contributions/render/rect3d-module.d.ts +4 -0
  952. package/es/render/contributions/render/rect3d-module.js +13 -0
  953. package/es/render/contributions/render/rect3d-module.js.map +1 -0
  954. package/es/render/contributions/render/rect3d-render.js.map +1 -1
  955. package/es/render/contributions/render/render-slector.js.map +1 -1
  956. package/es/render/contributions/render/richtext-module.d.ts +4 -0
  957. package/es/render/contributions/render/richtext-module.js +13 -0
  958. package/es/render/contributions/render/richtext-module.js.map +1 -0
  959. package/es/render/contributions/render/star-module.d.ts +4 -0
  960. package/es/render/contributions/render/star-module.js +17 -0
  961. package/es/render/contributions/render/star-module.js.map +1 -0
  962. package/es/render/contributions/render/star-render.d.ts +2 -2
  963. package/es/render/contributions/render/star-render.js +3 -8
  964. package/es/render/contributions/render/star-render.js.map +1 -1
  965. package/es/render/contributions/render/symbol-module.d.ts +4 -0
  966. package/es/render/contributions/render/symbol-module.js +21 -0
  967. package/es/render/contributions/render/symbol-module.js.map +1 -0
  968. package/es/render/contributions/render/symbol-render.d.ts +2 -2
  969. package/es/render/contributions/render/symbol-render.js +3 -8
  970. package/es/render/contributions/render/symbol-render.js.map +1 -1
  971. package/es/render/contributions/render/symbol.d.ts +0 -2
  972. package/es/render/contributions/render/symbol.js +0 -4
  973. package/es/render/contributions/render/symbol.js.map +1 -1
  974. package/es/render/contributions/render/text-module.d.ts +4 -0
  975. package/es/render/contributions/render/text-module.js +20 -0
  976. package/es/render/contributions/render/text-module.js.map +1 -0
  977. package/es/render/contributions/render/text-render.d.ts +2 -2
  978. package/es/render/contributions/render/text-render.js +2 -7
  979. package/es/render/contributions/render/text-render.js.map +1 -1
  980. package/es/render/render-modules.d.ts +4 -0
  981. package/es/render/render-modules.js +10 -0
  982. package/es/render/render-modules.js.map +1 -0
  983. package/es/render/render-service.d.ts +1 -1
  984. package/es/render/render-service.js +3 -1
  985. package/es/render/render-service.js.map +1 -1
  986. package/es/resource-loader/loader.js +6 -6
  987. package/es/resource-loader/loader.js.map +1 -1
  988. package/package.json +8 -7
  989. package/cjs/common/registry/contribution-registry.d.ts +0 -24
  990. package/cjs/common/registry/contribution-registry.js +0 -61
  991. package/cjs/common/registry/contribution-registry.js.map +0 -1
  992. package/cjs/common/registry/index.d.ts +0 -5
  993. package/cjs/common/registry/index.js +0 -34
  994. package/cjs/common/registry/index.js.map +0 -1
  995. package/cjs/common/registry/service-registry.d.ts +0 -16
  996. package/cjs/common/registry/service-registry.js +0 -57
  997. package/cjs/common/registry/service-registry.js.map +0 -1
  998. package/cjs/common/registry/types.d.ts +0 -1
  999. package/cjs/common/registry/types.js.map +0 -1
  1000. package/cjs/register-modules.d.ts +0 -9
  1001. package/cjs/register-modules.js +0 -79
  1002. package/cjs/register-modules.js.map +0 -1
  1003. package/es/common/registry/contribution-registry.d.ts +0 -24
  1004. package/es/common/registry/contribution-registry.js +0 -55
  1005. package/es/common/registry/contribution-registry.js.map +0 -1
  1006. package/es/common/registry/index.d.ts +0 -5
  1007. package/es/common/registry/index.js +0 -4
  1008. package/es/common/registry/index.js.map +0 -1
  1009. package/es/common/registry/service-registry.d.ts +0 -16
  1010. package/es/common/registry/service-registry.js +0 -51
  1011. package/es/common/registry/service-registry.js.map +0 -1
  1012. package/es/common/registry/types.d.ts +0 -1
  1013. package/es/common/registry/types.js.map +0 -1
  1014. package/es/register-modules.d.ts +0 -9
  1015. package/es/register-modules.js +0 -117
  1016. package/es/register-modules.js.map +0 -1
  1017. /package/cjs/{common/registry → entries}/types.js +0 -0
  1018. /package/es/{common/registry → entries}/types.js +0 -0
@@ -1,6 +1,4 @@
1
- import { isArray, max, OBBBounds } from "@visactor/vutils";
2
-
3
- import { AABBBounds, Matrix, normalTransform, Point, isNil, isString, isValidUrl, isBase64, isObject } from "@visactor/vutils";
1
+ import { AABBBounds, isArray, isEqual, max, Matrix, OBBBounds, normalTransform, Point, isNil, isString, isValidUrl, isBase64, isObject } from "@visactor/vutils";
4
2
 
5
3
  import { Node } from "./node-tree";
6
4
 
@@ -8,11 +6,7 @@ import { EventTarget, CustomEvent } from "../event";
8
6
 
9
7
  import { DefaultTransform } from "./config";
10
8
 
11
- import { graphicService, transformUtil } from "../modules";
12
-
13
- import { serviceRegistry } from "../common/registry";
14
-
15
- import { RenderService } from "../render/constants";
9
+ import { application } from "../application";
16
10
 
17
11
  import { CustomPath2D } from "../common/custom-path2d";
18
12
 
@@ -36,13 +30,70 @@ import { DefaultStateAnimateConfig } from "../animate/config";
36
30
 
37
31
  import { EmptyContext2d } from "../canvas";
38
32
 
39
- const _tempBounds = new AABBBounds, tempMatrix = new Matrix, tempBounds = new AABBBounds;
33
+ import { StateDefinitionCompiler } from "./state/state-definition-compiler";
34
+
35
+ import { StateEngine } from "./state/state-engine";
36
+
37
+ import { StateModel } from "./state/state-model";
38
+
39
+ import { UpdateCategory, classifyAttributeDelta } from "./state/attribute-update-classifier";
40
+
41
+ import { StateStyleResolver } from "./state/state-style-resolver";
42
+
43
+ import { StateTransitionOrchestrator } from "./state/state-transition-orchestrator";
44
+
45
+ import { collectSharedStateScopeChain, ensureSharedStateScopeFresh } from "./state/shared-state-scope";
46
+
47
+ import { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from "./state/shared-state-refresh";
48
+
49
+ import { getStageStatePerfMonitor } from "./state/state-perf-monitor";
50
+
51
+ const _tempBounds = new AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new Matrix;
40
52
 
41
53
  export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
42
54
 
43
55
  export const GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
44
56
 
45
- const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], point = new Point;
57
+ const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]), point = new Point;
58
+
59
+ function isPlainObjectValue(value) {
60
+ return "object" == typeof value && null != value && !isArray(value);
61
+ }
62
+
63
+ function cloneAttributeValue(value) {
64
+ if (!isPlainObjectValue(value)) return value;
65
+ const source = value, clone = {};
66
+ return Object.keys(source).forEach((key => {
67
+ const nextValue = source[key];
68
+ clone[key] = isPlainObjectValue(nextValue) ? cloneAttributeValue(nextValue) : nextValue;
69
+ })), clone;
70
+ }
71
+
72
+ function cloneSimpleAttributeRecord(value) {
73
+ return isPlainObjectValue(value) ? Object.assign({}, value) : value;
74
+ }
75
+
76
+ export function shouldUseSimpleAttributeFastPath(value) {
77
+ return !!isPlainObjectValue(value) && !Object.keys(value).some((key => isPlainObjectValue(value[key])));
78
+ }
79
+
80
+ function cloneAttributeSurface(value) {
81
+ if (!isPlainObjectValue(value)) return value;
82
+ const source = value, clone = {};
83
+ return Object.keys(source).forEach((key => {
84
+ const nextValue = source[key];
85
+ clone[key] = isPlainObjectValue(nextValue) ? Object.assign({}, nextValue) : nextValue;
86
+ })), clone;
87
+ }
88
+
89
+ function deepMergeAttributeValue(base, value) {
90
+ var _a;
91
+ const result = null !== (_a = cloneAttributeValue(base)) && void 0 !== _a ? _a : {};
92
+ return Object.keys(value).forEach((key => {
93
+ const nextValue = value[key], previousValue = result[key];
94
+ isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue) ? result[key] = deepMergeAttributeValue(previousValue, nextValue) : result[key] = cloneAttributeValue(nextValue);
95
+ })), result;
96
+ }
46
97
 
47
98
  export const NOWORK_ANIMATE_ATTR = {
48
99
  strokeSeg: 1,
@@ -100,16 +151,238 @@ export class Graphic extends Node {
100
151
  }
101
152
  constructor(params = {}) {
102
153
  var _a;
103
- super(), this._AABBBounds = new AABBBounds, this._updateTag = UpdateTag.INIT, this.attribute = params,
104
- this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
154
+ super(), this.resolverEpoch = 0, this._AABBBounds = new AABBBounds, this._updateTag = UpdateTag.INIT;
155
+ const useSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath(params), initialBaseAttributes = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params);
156
+ this.baseAttributes = initialBaseAttributes, this.attribute = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(initialBaseAttributes) : cloneAttributeSurface(initialBaseAttributes),
157
+ this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0),
158
+ isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
159
+ }
160
+ get normalAttrs() {
161
+ return this.baseAttributes;
162
+ }
163
+ set normalAttrs(value) {
164
+ this._deprecatedNormalAttrsView = null != value ? value : void 0;
105
165
  }
106
166
  getGraphicService() {
107
167
  var _a, _b;
108
- return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : graphicService;
168
+ return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : application.graphicService;
109
169
  }
110
170
  getAttributes() {
111
171
  return this.attribute;
112
172
  }
173
+ getStateStyleResolver(mergeMode) {
174
+ return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
175
+ mergeMode: "deep"
176
+ })), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver),
177
+ this.stateStyleResolver);
178
+ }
179
+ getStateTransitionOrchestrator() {
180
+ return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator),
181
+ this.stateTransitionOrchestrator;
182
+ }
183
+ resolveBoundSharedStateScope() {
184
+ var _a;
185
+ let parent = this.parent;
186
+ for (;parent; ) {
187
+ if (parent.sharedStateScope) return parent.sharedStateScope;
188
+ parent = parent.parent;
189
+ }
190
+ return null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope;
191
+ }
192
+ syncSharedStateScopeBindingFromTree(markDirty = !0) {
193
+ var _a;
194
+ const nextScope = this.resolveBoundSharedStateScope();
195
+ return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
196
+ !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
197
+ this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0,
198
+ this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
199
+ this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(),
200
+ markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
201
+ !0);
202
+ }
203
+ syncSharedStateActiveRegistrations() {
204
+ var _a, _b;
205
+ const nextScopes = (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.boundSharedStateScope ? new Set(collectSharedStateScopeChain(this.boundSharedStateScope)) : new Set;
206
+ (null !== (_b = this.registeredActiveScopes) && void 0 !== _b ? _b : new Set).forEach((scope => {
207
+ nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
208
+ })), nextScopes.forEach((scope => {
209
+ scope.subtreeActiveDescendants.add(this);
210
+ })), this.registeredActiveScopes = nextScopes;
211
+ }
212
+ clearSharedStateActiveRegistrations() {
213
+ const previousScopes = this.registeredActiveScopes;
214
+ previousScopes && (previousScopes.forEach((scope => {
215
+ scope.subtreeActiveDescendants.delete(this);
216
+ })), previousScopes.clear()), this.registeredActiveScopes = void 0;
217
+ }
218
+ markSharedStateDirty() {
219
+ this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this),
220
+ scheduleStageSharedStateRefresh(this.stage);
221
+ }
222
+ onParentSharedStateTreeChanged(stage, layer) {
223
+ this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingFromTree() : this.setStage(stage, layer);
224
+ }
225
+ refreshSharedStateBeforeRender() {
226
+ var _a;
227
+ (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? (this.syncSharedStateScopeBindingFromTree(!1),
228
+ this.boundSharedStateScope && ensureSharedStateScopeFresh(this.boundSharedStateScope),
229
+ this.recomputeCurrentStatePatch(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
230
+ type: AttributeUpdateType.STATE
231
+ }), this._emitCustomEvent("afterStateUpdate", {
232
+ type: AttributeUpdateType.STATE
233
+ }), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
234
+ }
235
+ getLocalStatesVersion() {
236
+ var _a, _b;
237
+ return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
238
+ this.localFallbackVersion = (null !== (_a = this.localFallbackVersion) && void 0 !== _a ? _a : 0) + 1),
239
+ null !== (_b = this.localFallbackVersion) && void 0 !== _b ? _b : 0;
240
+ }
241
+ resolveEffectiveCompiledDefinitions() {
242
+ this.syncSharedStateScopeBindingFromTree(!1);
243
+ const boundScope = this.boundSharedStateScope;
244
+ boundScope && (ensureSharedStateScopeFresh(boundScope), this.boundSharedStateRevision = boundScope.revision);
245
+ const hasStates = !!this.states && Object.keys(this.states).length > 0;
246
+ if (!boundScope) {
247
+ if (!hasStates) return {
248
+ compiledDefinitions: void 0,
249
+ stateProxyModeKey: "none"
250
+ };
251
+ const cacheKey = `local:${this.getLocalStatesVersion()}`;
252
+ return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new StateDefinitionCompiler).compile(this.states),
253
+ this.compiledStateDefinitionsCacheKey = cacheKey), {
254
+ compiledDefinitions: this.compiledStateDefinitions,
255
+ stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
256
+ };
257
+ }
258
+ const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions, sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none", sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
259
+ if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
260
+ compiledDefinitions: sharedCompiledDefinitions,
261
+ stateProxyModeKey: sharedStateProxyModeKey,
262
+ stateProxyEligibility: sharedStateProxyEligibility
263
+ };
264
+ const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
265
+ if (Object.keys(localStates).forEach((stateName => {
266
+ sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
267
+ missingStateNames.push(stateName));
268
+ })), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
269
+ {
270
+ compiledDefinitions: sharedCompiledDefinitions,
271
+ stateProxyModeKey: sharedStateProxyModeKey,
272
+ stateProxyEligibility: sharedStateProxyEligibility
273
+ };
274
+ const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
275
+ return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
276
+ this.compiledStateDefinitionsCacheKey = cacheKey), {
277
+ compiledDefinitions: this.localFallbackCompiledDefinitions,
278
+ stateProxyModeKey: stateProxyModeKey,
279
+ stateProxyEligibility: sharedStateProxyEligibility
280
+ };
281
+ }
282
+ recomputeCurrentStatePatch() {
283
+ var _a, _b, _c, _d;
284
+ if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
285
+ this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
286
+ const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute, stateModel = this.createStateModel();
287
+ null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs);
288
+ const transition = stateModel.useStates(this.currentStates), effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
289
+ this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
290
+ this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs), this.syncSharedStateActiveRegistrations();
291
+ }
292
+ buildStaticAttributeSnapshot() {
293
+ var _a;
294
+ const snapshot = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {}), resolvedPatch = this.resolvedStatePatch;
295
+ return resolvedPatch ? (Object.keys(resolvedPatch).forEach((key => {
296
+ const nextValue = resolvedPatch[key], previousValue = snapshot[key];
297
+ "deep" === this.stateMergeMode && isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue) ? snapshot[key] = deepMergeAttributeValue(previousValue, nextValue) : snapshot[key] = cloneAttributeValue(nextValue);
298
+ })), snapshot) : snapshot;
299
+ }
300
+ buildRemovedStateAnimationAttrs(targetStateAttrs, previousResolvedStatePatch) {
301
+ const extraAttrs = {};
302
+ if (!previousResolvedStatePatch) return extraAttrs;
303
+ const snapshot = this.buildStaticAttributeSnapshot(), staticTargetAttrs = snapshot;
304
+ return Object.keys(previousResolvedStatePatch).forEach((key => {
305
+ const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);
306
+ if (hasTargetAttr && void 0 !== targetStateAttrs[key]) return;
307
+ const assignFallbackAttr = value => {
308
+ void 0 === value && this.shouldSkipStateTransitionDefaultAttribute(key, staticTargetAttrs) || (extraAttrs[key] = void 0 === value ? value : cloneAttributeValue(value));
309
+ };
310
+ if (hasTargetAttr) assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs)); else if (Object.prototype.hasOwnProperty.call(snapshot, key)) {
311
+ const snapshotValue = snapshot[key];
312
+ assignFallbackAttr(void 0 === snapshotValue ? this.getStateTransitionDefaultAttribute(key, staticTargetAttrs) : snapshotValue);
313
+ } else assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));
314
+ })), extraAttrs;
315
+ }
316
+ syncObjectToSnapshot(target, snapshot) {
317
+ const delta = new Map;
318
+ return new Set([ ...Object.keys(target), ...Object.keys(snapshot) ]).forEach((key => {
319
+ const hasNext = Object.prototype.hasOwnProperty.call(snapshot, key), previousValue = target[key];
320
+ if (!hasNext) return void (Object.prototype.hasOwnProperty.call(target, key) && (delta.set(key, {
321
+ prev: previousValue,
322
+ next: void 0
323
+ }), delete target[key]));
324
+ const nextValue = snapshot[key];
325
+ isEqual(previousValue, nextValue) || (delta.set(key, {
326
+ prev: previousValue,
327
+ next: nextValue
328
+ }), target[key] = cloneAttributeValue(nextValue));
329
+ })), delta;
330
+ }
331
+ _syncAttribute() {
332
+ const snapshot = this.buildStaticAttributeSnapshot(), delta = this.syncObjectToSnapshot(this.attribute, snapshot);
333
+ return this.valid = this.isValid(), delta;
334
+ }
335
+ _syncFinalAttributeFromStaticTruth() {
336
+ const target = this.finalAttribute;
337
+ if (!target) return;
338
+ const snapshot = this.buildStaticAttributeSnapshot();
339
+ this.syncObjectToSnapshot(target, snapshot);
340
+ }
341
+ submitUpdateByDelta(delta, forceUpdateTag = !1) {
342
+ var _a;
343
+ if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
344
+ void this.addUpdateLayoutTag();
345
+ let category = UpdateCategory.NONE;
346
+ delta.forEach(((entry, key) => {
347
+ let nextCategory = classifyAttributeDelta(key, entry.prev, entry.next);
348
+ nextCategory & UpdateCategory.PICK && (nextCategory |= UpdateCategory.BOUNDS), nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS),
349
+ category |= nextCategory;
350
+ })), category !== UpdateCategory.NONE && (null === (_a = getStageStatePerfMonitor(this.stage)) || void 0 === _a || _a.recordCategory(category)),
351
+ category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
352
+ category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
353
+ category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag();
354
+ }
355
+ commitBaseAttributeMutation(forceUpdateTag = !1, context) {
356
+ var _a, _b;
357
+ (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch += 1,
358
+ null === (_b = this.stateEngine) || void 0 === _b || _b.invalidateResolverCache(),
359
+ this.recomputeCurrentStatePatch());
360
+ const delta = this._syncAttribute();
361
+ this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
362
+ }
363
+ applyBaseAttributes(params) {
364
+ const keys = Object.keys(params);
365
+ for (let i = 0; i < keys.length; i++) {
366
+ const key = keys[i];
367
+ this.baseAttributes[key] = cloneAttributeValue(params[key]);
368
+ }
369
+ }
370
+ applyTransientAttributes(params, forceUpdateTag = !1, context) {
371
+ const delta = new Map, keys = Object.keys(params);
372
+ for (let i = 0; i < keys.length; i++) {
373
+ const key = keys[i], previousValue = this.attribute[key], nextValue = params[key];
374
+ isEqual(previousValue, nextValue) || (delta.set(key, {
375
+ prev: previousValue,
376
+ next: nextValue
377
+ }), this.attribute[key] = cloneAttributeValue(nextValue));
378
+ }
379
+ this.valid = this.isValid(), this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
380
+ }
381
+ _restoreAttributeFromStaticTruth(context) {
382
+ this._syncFinalAttributeFromStaticTruth();
383
+ const delta = this._syncAttribute();
384
+ this.submitUpdateByDelta(delta), this.onAttributeUpdate(context);
385
+ }
113
386
  setMode(mode) {
114
387
  "3d" === mode ? this.set3dMode() : this.set2dMode();
115
388
  }
@@ -131,6 +404,17 @@ export class Graphic extends Node {
131
404
  onAnimateBind(animate) {
132
405
  this._emitCustomEvent("animate-bind", animate);
133
406
  }
407
+ visitTrackedAnimates(cb) {
408
+ const hook = this.forEachTrackedAnimate;
409
+ "function" != typeof hook ? this.animates && this.animates.forEach(cb) : hook.call(this, cb);
410
+ }
411
+ hasAnyTrackedAnimate() {
412
+ var _a;
413
+ const hook = this.hasTrackedAnimate;
414
+ if ("function" == typeof hook) return hook.call(this);
415
+ const getTrackedAnimates = this.getTrackedAnimates;
416
+ return "function" == typeof getTrackedAnimates ? getTrackedAnimates.call(this).size > 0 : !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size);
417
+ }
134
418
  tryUpdateAABBBounds() {
135
419
  const full = "imprecise" === this.attribute.boundsMode;
136
420
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
@@ -271,34 +555,27 @@ export class Graphic extends Node {
271
555
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
272
556
  }
273
557
  setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
274
- this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
558
+ this.visitTrackedAnimates((animate => {
275
559
  (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach((key => {
276
560
  animate.preventAttr(key);
277
561
  }));
278
- }));
562
+ })), this.applyTransientAttributes(params, forceUpdateTag, context);
279
563
  }
280
564
  setAttributes(params, forceUpdateTag = !1, context) {
281
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
565
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
566
+ isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
282
567
  this._setAttributes(params, forceUpdateTag, context));
283
568
  }
284
569
  _setAttributes(params, forceUpdateTag = !1, context) {
285
- const keys = Object.keys(params);
286
- for (let i = 0; i < keys.length; i++) {
287
- const key = keys[i];
288
- this.attribute[key] = params[key];
289
- }
290
- this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
291
- this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context);
570
+ this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context);
292
571
  }
293
572
  setAttribute(key, value, forceUpdateTag, context) {
294
- var _a;
295
573
  const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
296
574
  [key]: value
297
575
  }, this.attribute, key, context);
298
- params ? this._setAttributes(params, forceUpdateTag, context) : isNil(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value,
299
- this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
300
- this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value,
301
- "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
576
+ params ? this._setAttributes(params, forceUpdateTag, context) : (this.applyBaseAttributes({
577
+ [key]: value
578
+ }), this.commitBaseAttributeMutation(!!forceUpdateTag, context)), "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
302
579
  }
303
580
  needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
304
581
  for (let i = 0; i < k.length; i++) {
@@ -318,7 +595,9 @@ export class Graphic extends Node {
318
595
  type: AttributeUpdateType.INIT
319
596
  };
320
597
  params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params,
321
- this.attribute = params, params.background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
598
+ this.baseAttributes = cloneAttributeValue(params), this.attribute || (this.attribute = {}),
599
+ this.resolvedStatePatch = void 0, this._syncAttribute(), params.background && this.loadImage(params.background, !0),
600
+ isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
322
601
  this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
323
602
  }
324
603
  translate(x, y) {
@@ -330,15 +609,14 @@ export class Graphic extends Node {
330
609
  x: x,
331
610
  y: y
332
611
  }, this.attribute, tempConstantXYKey, context);
333
- params && (x = params.x, y = params.y, delete params.x, delete params.y, this._setAttributes(params));
334
- const attribute = this.attribute, postMatrix = attribute.postMatrix;
335
- return postMatrix ? transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y) : (attribute.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x,
612
+ params && (x = params.x, y = params.y, delete params.x, delete params.y, this.applyBaseAttributes(params));
613
+ const attribute = this.baseAttributes, postMatrix = attribute.postMatrix;
614
+ return postMatrix ? application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y) : (attribute.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x,
336
615
  attribute.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : DefaultTransform.y) + y),
337
- this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
338
- this.onAttributeUpdate(context), this;
616
+ this.commitBaseAttributeMutation(!1, context), this;
339
617
  }
340
618
  translateTo(x, y) {
341
- const attribute = this.attribute;
619
+ const attribute = this.baseAttributes;
342
620
  if (attribute.x === x && attribute.y === y) return this;
343
621
  const context = {
344
622
  type: AttributeUpdateType.TRANSLATE_TO
@@ -346,9 +624,9 @@ export class Graphic extends Node {
346
624
  x: x,
347
625
  y: y
348
626
  }, this.attribute, tempConstantXYKey, context);
349
- return params ? (this._setAttributes(params, !1, context), this) : (attribute.x = x,
350
- attribute.y = y, this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
351
- this.onAttributeUpdate(context), this);
627
+ return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
628
+ this) : (attribute.x = x, attribute.y = y, this.commitBaseAttributeMutation(!1, context),
629
+ this);
352
630
  }
353
631
  scale(scaleX, scaleY, scaleCenter) {
354
632
  var _a, _b;
@@ -361,18 +639,17 @@ export class Graphic extends Node {
361
639
  scaleCenter: scaleCenter
362
640
  }, this.attribute, tempConstantScaleXYKey, context);
363
641
  params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX,
364
- delete params.scaleY, this._setAttributes(params));
365
- const attribute = this.attribute;
642
+ delete params.scaleY, this.applyBaseAttributes(params));
643
+ const attribute = this.baseAttributes;
366
644
  if (scaleCenter) {
367
645
  let {postMatrix: postMatrix} = this.attribute;
368
- postMatrix || (postMatrix = new Matrix, attribute.postMatrix = postMatrix), transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
646
+ postMatrix || (postMatrix = new Matrix, attribute.postMatrix = postMatrix), application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
369
647
  } else attribute.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : DefaultTransform.scaleX) * scaleX,
370
648
  attribute.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : DefaultTransform.scaleY) * scaleY;
371
- return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
372
- this.onAttributeUpdate(context), this;
649
+ return this.commitBaseAttributeMutation(!1, context), this;
373
650
  }
374
651
  scaleTo(scaleX, scaleY) {
375
- const attribute = this.attribute;
652
+ const attribute = this.baseAttributes;
376
653
  if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) return this;
377
654
  const context = {
378
655
  type: AttributeUpdateType.SCALE_TO
@@ -380,9 +657,9 @@ export class Graphic extends Node {
380
657
  scaleX: scaleX,
381
658
  scaleY: scaleY
382
659
  }, this.attribute, tempConstantScaleXYKey, context);
383
- return params ? (this._setAttributes(params, !1, context), this) : (attribute.scaleX = scaleX,
384
- attribute.scaleY = scaleY, this.addUpdatePositionTag(), this.addUpdateBoundTag(),
385
- this.addUpdateLayoutTag(), this.onAttributeUpdate(context), this);
660
+ return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
661
+ this) : (attribute.scaleX = scaleX, attribute.scaleY = scaleY, this.commitBaseAttributeMutation(!1, context),
662
+ this);
386
663
  }
387
664
  rotate(angle, rotateCenter) {
388
665
  var _a;
@@ -393,24 +670,24 @@ export class Graphic extends Node {
393
670
  angle: angle,
394
671
  rotateCenter: rotateCenter
395
672
  }, this.attribute, tempConstantAngleKey, context);
396
- params && (delete params.angle, this._setAttributes(params, !1, context));
397
- const attribute = this.attribute;
673
+ params && (delete params.angle, this.applyBaseAttributes(params));
674
+ const attribute = this.baseAttributes;
398
675
  if (rotateCenter) {
399
- let {postMatrix: postMatrix} = this.attribute;
400
- postMatrix || (postMatrix = new Matrix, attribute.postMatrix = postMatrix), transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);
676
+ let {postMatrix: postMatrix} = this.baseAttributes;
677
+ postMatrix || (postMatrix = new Matrix, this.baseAttributes.postMatrix = postMatrix),
678
+ application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);
401
679
  } else attribute.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : DefaultTransform.angle) + angle;
402
- return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
403
- this.onAttributeUpdate(context), this;
680
+ return this.commitBaseAttributeMutation(!1, context), this;
404
681
  }
405
682
  rotateTo(angle) {
406
- const attribute = this.attribute;
683
+ const attribute = this.baseAttributes;
407
684
  if (attribute.angle === angle) return this;
408
685
  const context = {
409
686
  type: AttributeUpdateType.ROTATE_TO
410
687
  }, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
411
- return params ? (this._setAttributes(params, !1, context), this) : (attribute.angle = angle,
412
- this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
413
- this.onAttributeUpdate(context), this);
688
+ return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
689
+ this) : (attribute.angle = angle, this.commitBaseAttributeMutation(!1, context),
690
+ this);
414
691
  }
415
692
  skewTo(b, c) {
416
693
  return this;
@@ -430,93 +707,149 @@ export class Graphic extends Node {
430
707
  var _a;
431
708
  return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
432
709
  }
433
- applyStateAttrs(attrs, stateNames, hasAnimation, isClear) {
434
- var _a, _b;
435
- if (hasAnimation) {
436
- const keys = Object.keys(attrs), noWorkAttrs = this.getNoWorkAnimateAttr(), animateAttrs = {};
437
- let noAnimateAttrs;
438
- keys.forEach((key => {
439
- noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
440
- }));
441
- const stateAnimateConfig = null !== (_b = null !== (_a = this.context && this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : DefaultStateAnimateConfig;
442
- this.applyAnimationState([ "state" ], [ {
443
- name: "state",
444
- animation: {
445
- type: "state",
446
- to: animateAttrs,
447
- duration: stateAnimateConfig.duration,
448
- easing: stateAnimateConfig.easing
449
- }
450
- } ]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
451
- type: AttributeUpdateType.STATE
452
- }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
453
- } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
454
- type: AttributeUpdateType.STATE
455
- }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
456
- this._emitCustomEvent("afterStateUpdate", {
457
- type: AttributeUpdateType.STATE
710
+ createStateModel() {
711
+ const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility, stateProxyModeKey: stateProxyModeKey} = this.resolveEffectiveCompiledDefinitions();
712
+ return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateProxy === this.stateProxy && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode && this.stateEngineStateProxyModeKey === stateProxyModeKey || (this.stateEngine = new StateEngine({
713
+ compiledDefinitions: compiledDefinitions,
714
+ stateSort: this.stateSort,
715
+ stateProxy: this.stateProxy,
716
+ stateProxyEligibility: stateProxyEligibility,
717
+ states: this.states,
718
+ mergeMode: this.stateMergeMode
719
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy,
720
+ this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode,
721
+ this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0,
722
+ this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0),
723
+ new StateModel({
724
+ states: this.states,
725
+ currentStates: this.currentStates,
726
+ stateSort: this.stateSort,
727
+ stateProxy: this.stateProxy,
728
+ stateEngine: this.stateEngine
729
+ });
730
+ }
731
+ resolveStateAnimateConfig(animateConfig) {
732
+ var _a, _b, _c;
733
+ return null !== (_c = null !== (_a = null != animateConfig ? animateConfig : this.stateAnimateConfig) && void 0 !== _a ? _a : null === (_b = this.context) || void 0 === _b ? void 0 : _b.stateAnimateConfig) && void 0 !== _c ? _c : DefaultStateAnimateConfig;
734
+ }
735
+ applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig, extraAnimateAttrs) {
736
+ const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : void 0, transitionOptions = resolvedAnimateConfig ? {
737
+ animateConfig: resolvedAnimateConfig,
738
+ extraAnimateAttrs: extraAnimateAttrs,
739
+ shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
740
+ } : void 0;
741
+ if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
742
+ const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
743
+ noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
744
+ animateConfig: resolvedAnimateConfig,
745
+ extraAnimateAttrs: extraAnimateAttrs,
746
+ shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
458
747
  });
748
+ this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
459
749
  }
460
750
  updateNormalAttrs(stateAttrs) {
461
- const newNormalAttrs = {};
462
- this.normalAttrs ? (Object.keys(stateAttrs).forEach((key => {
463
- key in this.normalAttrs ? (newNormalAttrs[key] = this.normalAttrs[key], delete this.normalAttrs[key]) : newNormalAttrs[key] = this.getNormalAttribute(key);
464
- })), Object.keys(this.normalAttrs).forEach((key => {
465
- stateAttrs[key] = this.normalAttrs[key];
466
- }))) : Object.keys(stateAttrs).forEach((key => {
467
- newNormalAttrs[key] = this.getNormalAttribute(key);
468
- })), this.normalAttrs = newNormalAttrs;
751
+ this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
752
+ }
753
+ getStateTransitionDefaultAttribute(key, targetAttrs) {
754
+ return this.getDefaultAttribute(key);
755
+ }
756
+ shouldSkipStateTransitionDefaultAttribute(_key, _targetAttrs) {
757
+ return !1;
469
758
  }
470
759
  stopStateAnimates(type = "end") {
471
- this.animates && this.animates.forEach((animate => {
472
- animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
473
- }));
760
+ const stopAnimationState = this.stopAnimationState;
761
+ if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
762
+ const stateAnimates = [];
763
+ this.visitTrackedAnimates((animate => {
764
+ animate.stateNames && stateAnimates.push(animate);
765
+ })), stateAnimates.forEach((animate => animate.stop(type)));
474
766
  }
475
767
  getNormalAttribute(key) {
476
768
  var _a, _b;
477
769
  const value = this.attribute[key];
478
- return this.animates && this.animates.size ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
770
+ return this.hasAnyTrackedAnimate() ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
479
771
  }
480
772
  clearStates(hasAnimation) {
481
- this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [],
482
- this.normalAttrs = null;
773
+ var _a, _b, _c;
774
+ const previousStates = this.currentStates ? this.currentStates.slice() : [], previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0, transition = this.createStateModel().clearStates();
775
+ if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
776
+ this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
777
+ void this.clearSharedStateActiveRegistrations();
778
+ const resolvedStateAttrs = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {});
779
+ transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
780
+ this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
781
+ this.clearSharedStateActiveRegistrations(), null === (_b = getStageStatePerfMonitor(this.stage)) || void 0 === _b || _b.incrementCounter("stateCommits"),
782
+ null === (_c = getStageStatePerfMonitor(this.stage)) || void 0 === _c || _c.recordEvent("state-commit", {
783
+ graphicId: this._uid,
784
+ targetStates: []
785
+ }), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
786
+ this._restoreAttributeFromStaticTruth({
787
+ type: AttributeUpdateType.STATE
788
+ }), this._emitCustomEvent("afterStateUpdate", {
789
+ type: AttributeUpdateType.STATE
790
+ })));
483
791
  }
484
792
  removeState(stateName, hasAnimation) {
485
- if (this.currentStates) {
486
- const filter = isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName, newStates = this.currentStates.filter(filter);
487
- newStates.length !== this.currentStates.length && this.useStates(newStates, hasAnimation);
488
- }
793
+ const transition = this.createStateModel().removeState(stateName);
794
+ transition.changed && this.useStates(transition.states, hasAnimation);
489
795
  }
490
796
  toggleState(stateName, hasAnimation) {
491
- if (this.hasState(stateName)) this.removeState(stateName, hasAnimation); else {
492
- if ((this.currentStates ? this.currentStates.indexOf(stateName) : -1) < 0) {
493
- const nextStates = this.currentStates ? this.currentStates.slice() : [];
494
- nextStates.push(stateName), this.useStates(nextStates, hasAnimation);
495
- }
496
- }
797
+ const transition = this.createStateModel().toggleState(stateName);
798
+ transition.changed && this.useStates(transition.states, hasAnimation);
497
799
  }
498
800
  addState(stateName, keepCurrentStates, hasAnimation) {
499
- var _a;
500
- if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return;
501
- const newStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
502
- this.useStates(newStates, hasAnimation);
801
+ const transition = this.createStateModel().addState(stateName, keepCurrentStates);
802
+ transition.changed && this.useStates(transition.states, hasAnimation);
503
803
  }
504
804
  useStates(states, hasAnimation) {
505
- var _a;
805
+ var _a, _b, _c, _d, _e;
506
806
  if (!states.length) return void this.clearStates(hasAnimation);
507
- if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some(((stateName, index) => this.currentStates[index] !== stateName)))) return;
508
- this.stateSort && (states = states.sort(this.stateSort));
509
- const stateAttrs = {};
510
- states.forEach((stateName => {
511
- var _a;
512
- const attrs = this.stateProxy ? this.stateProxy(stateName, states) : null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
513
- attrs && Object.assign(stateAttrs, attrs);
514
- })), this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation);
807
+ const previousStates = this.currentStates ? this.currentStates.slice() : [], previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0, stateResolveBaseAttrs = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute, stateModel = this.createStateModel();
808
+ null === (_b = this.stateEngine) || void 0 === _b || _b.setResolveContext(this, stateResolveBaseAttrs);
809
+ const transition = stateModel.useStates(states);
810
+ if (!transition.changed && this.sameStateNames(previousStates, transition.states)) return;
811
+ const effectiveStates = null !== (_c = transition.effectiveStates) && void 0 !== _c ? _c : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
812
+ this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
813
+ this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
814
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = getStageStatePerfMonitor(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"),
815
+ null === (_e = getStageStatePerfMonitor(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
816
+ graphicId: this._uid,
817
+ targetStates: [ ...transition.states ]
818
+ }), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
819
+ this._restoreAttributeFromStaticTruth({
820
+ type: AttributeUpdateType.STATE
821
+ }), this._emitCustomEvent("afterStateUpdate", {
822
+ type: AttributeUpdateType.STATE
823
+ })));
824
+ }
825
+ invalidateResolver() {
826
+ var _a, _b;
827
+ if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
828
+ const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute;
829
+ this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch += 1,
830
+ this.stateEngine.invalidateResolverCache();
831
+ const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
832
+ this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
833
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(),
834
+ this._restoreAttributeFromStaticTruth({
835
+ type: AttributeUpdateType.STATE
836
+ }), this._emitCustomEvent("afterStateUpdate", {
837
+ type: AttributeUpdateType.STATE
838
+ });
839
+ }
840
+ sameStateNames(left, right) {
841
+ const normalizedLeft = null != left ? left : [], normalizedRight = null != right ? right : [];
842
+ if (normalizedLeft.length !== normalizedRight.length) return !1;
843
+ for (let index = 0; index < normalizedLeft.length; index++) if (normalizedLeft[index] !== normalizedRight[index]) return !1;
844
+ return !0;
515
845
  }
516
846
  addUpdateBoundTag() {
517
847
  this._updateTag |= UpdateTag.UPDATE_BOUNDS, this.parent && this.parent.addChildUpdateBoundTag(),
518
848
  this.glyphHost && this.glyphHost.addUpdateBoundTag();
519
849
  }
850
+ addUpdatePaintTag() {
851
+ this._updateTag |= UpdateTag.UPDATE_PAINT;
852
+ }
520
853
  addUpdateShapeTag() {
521
854
  this._updateTag |= UpdateTag.UPDATE_SHAPE;
522
855
  }
@@ -530,6 +863,9 @@ export class Graphic extends Node {
530
863
  clearUpdateBoundTag() {
531
864
  this._updateTag &= UpdateTag.CLEAR_BOUNDS;
532
865
  }
866
+ clearUpdatePaintTag() {
867
+ this._updateTag &= UpdateTag.CLEAR_PAINT;
868
+ }
533
869
  addUpdatePositionTag() {
534
870
  this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag(), this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;
535
871
  }
@@ -575,7 +911,7 @@ export class Graphic extends Node {
575
911
  if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
576
912
  const m = this._transMatrix;
577
913
  m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
578
- m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
914
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
579
915
  x: _anchor[0],
580
916
  y: _anchor[1]
581
917
  });
@@ -594,23 +930,35 @@ export class Graphic extends Node {
594
930
  }
595
931
  }
596
932
  setStage(stage, layer) {
597
- if (this.stage !== stage) {
598
- if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
599
- this.animates && this.animates.size) {
600
- const timeline = stage.getTimeline();
601
- this.animates.forEach((a => {
602
- a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
933
+ var _a, _b, _c, _d, _e, _f, _g, _h;
934
+ const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService, previousStage = this.stage;
935
+ if (this.stage !== stage || this.layer !== layer) {
936
+ if (this.stage = stage, this.layer = layer, this.syncSharedStateScopeBindingFromTree(!!(null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length)),
937
+ this.setStageToShadowRoot(stage, layer), this.hasAnyTrackedAnimate()) {
938
+ const previousTimeline = null === (_e = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _e ? void 0 : _e.call(previousStage), nextTimeline = null === (_f = null == stage ? void 0 : stage.getTimeline) || void 0 === _f ? void 0 : _f.call(stage), detachedStageAnimates = [];
939
+ this.visitTrackedAnimates((a => {
940
+ (!!previousTimeline && a.timeline === previousTimeline || a.timeline.isGlobal) && (nextTimeline ? a.timeline !== nextTimeline && (previousTimeline && a.timeline === previousTimeline && previousTimeline.removeAnimate(a, !1),
941
+ a.setTimeline(nextTimeline), nextTimeline.addAnimate(a)) : previousTimeline && a.timeline === previousTimeline && (previousTimeline.removeAnimate(a, !1),
942
+ detachedStageAnimates.push(a)));
943
+ })), detachedStageAnimates.length && (detachedStageAnimates.forEach((animate => {
944
+ var _a;
945
+ animate.stop();
946
+ const untrackAnimate = this.untrackAnimate;
947
+ "function" == typeof untrackAnimate ? untrackAnimate.call(this, animate.id) : null === (_a = this.animates) || void 0 === _a || _a.delete(animate.id);
948
+ })), this._restoreAttributeFromStaticTruth({
949
+ type: AttributeUpdateType.ANIMATE_END
603
950
  }));
604
951
  }
605
- this._onSetStage && this._onSetStage(this, stage, layer), this.getGraphicService().onSetStage(this, stage);
952
+ return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (_g = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _g || _g.call(graphicService, this, stage));
606
953
  }
954
+ this.syncSharedStateScopeBindingFromTree(!!(null === (_h = this.currentStates) || void 0 === _h ? void 0 : _h.length));
607
955
  }
608
956
  setStageToShadowRoot(stage, layer) {
609
957
  this.shadowRoot && this.shadowRoot.setStage(stage, layer);
610
958
  }
611
959
  onAddStep(step) {}
612
960
  onStop(props) {
613
- props && this.setAttributes(props, !1, {
961
+ this._restoreAttributeFromStaticTruth({
614
962
  type: AttributeUpdateType.ANIMATE_END
615
963
  });
616
964
  }
@@ -625,7 +973,8 @@ export class Graphic extends Node {
625
973
  this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
626
974
  }
627
975
  attachShadow(shadowRoot) {
628
- return shadowRoot && (shadowRoot.shadowHost = this), this.shadowRoot = null != shadowRoot ? shadowRoot : graphicService.creator.shadowRoot(this),
976
+ var _a, _b, _c;
977
+ return shadowRoot && (shadowRoot.shadowHost = this), this.shadowRoot = null !== (_c = null != shadowRoot ? shadowRoot : null === (_b = (_a = application.graphicService.creator).shadowRoot) || void 0 === _b ? void 0 : _b.call(_a, this)) && void 0 !== _c ? _c : require("./shadow-root").createShadowRoot(this),
629
978
  this.addUpdateBoundTag(), this.shadowRoot.setStage(this.stage, this.layer), this.shadowRoot;
630
979
  }
631
980
  detachShadow() {
@@ -645,7 +994,9 @@ export class Graphic extends Node {
645
994
  this.pathProxy;
646
995
  }
647
996
  loadImage(image, background = !1) {
648
- if (!image || background && backgroundNotImage(image)) return;
997
+ if (background && (null == image ? void 0 : image.background) && (image = image.background),
998
+ background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
999
+ if (!image) return;
649
1000
  const url = image;
650
1001
  this.resources || (this.resources = new Map);
651
1002
  const cache = {
@@ -673,31 +1024,52 @@ export class Graphic extends Node {
673
1024
  const res = this.resources.get(url);
674
1025
  res && (res.state = "fail", cb && cb());
675
1026
  }
676
- _stopAnimates(animates) {
677
- animates && animates.forEach((animate => {
1027
+ _stopAnimates() {
1028
+ const animates = [];
1029
+ this.visitTrackedAnimates((animate => {
1030
+ animates.push(animate);
1031
+ })), animates.forEach((animate => {
678
1032
  animate.stop();
679
1033
  }));
680
1034
  }
681
1035
  stopAnimates(stopChildren = !1) {
682
- this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0),
683
- this.isContainer && stopChildren && this.forEachChildren((c => {
1036
+ this._stopAnimates(), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren((c => {
684
1037
  c.stopAnimates(stopChildren);
685
1038
  }));
686
1039
  }
687
1040
  release() {
688
- this.releaseStatus = "released", this.stopAnimates(), graphicService.onRelease(this);
1041
+ var _a, _b, _c;
1042
+ this.releaseStatus = "released", this.clearSharedStateActiveRegistrations(), this.stopAnimates();
1043
+ const graphicService = null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : application.graphicService;
1044
+ null === (_c = null == graphicService ? void 0 : graphicService.onRelease) || void 0 === _c || _c.call(graphicService, this),
1045
+ super.release();
689
1046
  }
690
- _emitCustomEvent(type, context) {
1047
+ _dispatchCustomEvent(type, context) {
691
1048
  var _a, _b;
692
1049
  if (this._events && type in this._events) {
693
1050
  const changeEvent = new CustomEvent(type, context);
694
- changeEvent.bubbles = !1, changeEvent.manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager,
695
- this.dispatchEvent(changeEvent);
1051
+ changeEvent.bubbles = !1;
1052
+ const manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager;
1053
+ return manager ? (changeEvent.manager = manager, this.dispatchEvent(changeEvent)) : Node.prototype.dispatchEvent.call(this, changeEvent);
696
1054
  }
1055
+ return !0;
1056
+ }
1057
+ beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
1058
+ return this._dispatchCustomEvent("beforeStateUpdate", {
1059
+ type: AttributeUpdateType.STATE,
1060
+ attrs: Object.assign({}, attrs),
1061
+ prevStates: prevStates.slice(),
1062
+ nextStates: nextStates.slice(),
1063
+ hasAnimation: !!hasAnimation,
1064
+ isClear: !!isClear
1065
+ });
1066
+ }
1067
+ _emitCustomEvent(type, context) {
1068
+ this._dispatchCustomEvent(type, context);
697
1069
  }
698
1070
  toCustomPath() {
699
1071
  var _a, _b, _c;
700
- const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || serviceRegistry.createInstance(RenderService)) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
1072
+ const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
701
1073
  if (renderer) {
702
1074
  const context = new EmptyContext2d(null, 1);
703
1075
  return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
@@ -707,7 +1079,11 @@ export class Graphic extends Node {
707
1079
  }
708
1080
 
709
1081
  function backgroundNotImage(image) {
710
- return !(!image.fill && !image.stroke);
1082
+ return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl(image) || image.includes("/") || isBase64(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
1083
+ }
1084
+
1085
+ function isExternalTexture(texture) {
1086
+ return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl(texture) || texture.includes("/") || isBase64(texture)) : isObject(texture));
711
1087
  }
712
1088
 
713
1089
  Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);