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