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

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/empty-context.js +1 -2
  14. package/cjs/canvas/util.d.ts +2 -3
  15. package/cjs/canvas/util.js +17 -7
  16. package/cjs/canvas/util.js.map +1 -1
  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/application.js +1 -1
  38. package/cjs/core/camera.js +1 -1
  39. package/cjs/core/constants.js +1 -1
  40. package/cjs/core/contributions/env/modules.d.ts +4 -0
  41. package/cjs/core/contributions/env/modules.js +14 -0
  42. package/cjs/core/contributions/env/modules.js.map +1 -0
  43. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
  44. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  45. package/cjs/core/contributions/layerHandler/empty-contribution.js +2 -2
  46. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  47. package/cjs/core/contributions/layerHandler/modules.d.ts +4 -0
  48. package/cjs/core/contributions/layerHandler/modules.js +14 -0
  49. package/cjs/core/contributions/layerHandler/modules.js.map +1 -0
  50. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
  51. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  52. package/cjs/core/contributions/modules.d.ts +2 -1
  53. package/cjs/core/contributions/modules.js +20 -2
  54. package/cjs/core/contributions/modules.js.map +1 -1
  55. package/cjs/core/contributions/textMeasure/modules.d.ts +4 -0
  56. package/cjs/core/contributions/textMeasure/modules.js +15 -0
  57. package/cjs/core/contributions/textMeasure/modules.js.map +1 -0
  58. package/cjs/core/core-modules.d.ts +4 -0
  59. package/cjs/core/core-modules.js +19 -0
  60. package/cjs/core/core-modules.js.map +1 -0
  61. package/cjs/core/global-module.d.ts +1 -0
  62. package/cjs/core/global-module.js +3 -0
  63. package/cjs/core/global-module.js.map +1 -0
  64. package/cjs/core/global.d.ts +4 -2
  65. package/cjs/core/global.js +8 -5
  66. package/cjs/core/global.js.map +1 -1
  67. package/cjs/core/graphic-utils.d.ts +3 -4
  68. package/cjs/core/graphic-utils.js +4 -5
  69. package/cjs/core/graphic-utils.js.map +1 -1
  70. package/cjs/core/layer-service.d.ts +7 -2
  71. package/cjs/core/layer-service.js +23 -13
  72. package/cjs/core/layer-service.js.map +1 -1
  73. package/cjs/core/layer.d.ts +1 -1
  74. package/cjs/core/layer.js +3 -3
  75. package/cjs/core/layer.js.map +1 -1
  76. package/cjs/core/stage.d.ts +17 -3
  77. package/cjs/core/stage.js +47 -25
  78. package/cjs/core/stage.js.map +1 -1
  79. package/cjs/core/window.d.ts +7 -5
  80. package/cjs/core/window.js +11 -7
  81. package/cjs/core/window.js.map +1 -1
  82. package/cjs/create.d.ts +1 -2
  83. package/cjs/create.js +2 -2
  84. package/cjs/create.js.map +1 -1
  85. package/cjs/entries/app-context.d.ts +30 -0
  86. package/cjs/entries/app-context.js +84 -0
  87. package/cjs/entries/app-context.js.map +1 -0
  88. package/cjs/entries/browser.d.ts +25 -0
  89. package/cjs/entries/browser.js +44 -0
  90. package/cjs/entries/browser.js.map +1 -0
  91. package/cjs/entries/index.d.ts +7 -0
  92. package/cjs/entries/index.js +32 -0
  93. package/cjs/entries/index.js.map +1 -0
  94. package/cjs/entries/miniapp.d.ts +6 -0
  95. package/cjs/entries/miniapp.js +20 -0
  96. package/cjs/entries/miniapp.js.map +1 -0
  97. package/cjs/entries/node.d.ts +6 -0
  98. package/cjs/entries/node.js +20 -0
  99. package/cjs/entries/node.js.map +1 -0
  100. package/cjs/entries/runtime-installer.d.ts +11 -0
  101. package/cjs/entries/runtime-installer.js +111 -0
  102. package/cjs/entries/runtime-installer.js.map +1 -0
  103. package/cjs/entries/types.d.ts +29 -0
  104. package/cjs/entries/types.js.map +1 -0
  105. package/cjs/env-check.js +3 -3
  106. package/cjs/env-check.js.map +1 -1
  107. package/cjs/event/event-manager.js +4 -1
  108. package/cjs/event/event-manager.js.map +1 -1
  109. package/cjs/event/util.d.ts +1 -1
  110. package/cjs/factory/graphic-factory.d.ts +7 -0
  111. package/cjs/factory/graphic-factory.js +23 -0
  112. package/cjs/factory/graphic-factory.js.map +1 -0
  113. package/cjs/factory/index.d.ts +4 -0
  114. package/cjs/factory/index.js +22 -0
  115. package/cjs/factory/index.js.map +1 -0
  116. package/cjs/factory/layer-factory.d.ts +7 -0
  117. package/cjs/factory/layer-factory.js +19 -0
  118. package/cjs/factory/layer-factory.js.map +1 -0
  119. package/cjs/factory/stage-factory.d.ts +8 -0
  120. package/cjs/factory/stage-factory.js +20 -0
  121. package/cjs/factory/stage-factory.js.map +1 -0
  122. package/cjs/factory/types.d.ts +34 -0
  123. package/cjs/factory/types.js +6 -0
  124. package/cjs/factory/types.js.map +1 -0
  125. package/cjs/factory.d.ts +1 -0
  126. package/cjs/factory.js +16 -1
  127. package/cjs/factory.js.map +1 -1
  128. package/cjs/global.d.ts +2 -0
  129. package/cjs/global.js +11 -0
  130. package/cjs/global.js.map +1 -0
  131. package/cjs/graphic/arc.js +3 -3
  132. package/cjs/graphic/arc.js.map +1 -1
  133. package/cjs/graphic/arc3d.js +3 -3
  134. package/cjs/graphic/arc3d.js.map +1 -1
  135. package/cjs/graphic/area.js +3 -3
  136. package/cjs/graphic/area.js.map +1 -1
  137. package/cjs/graphic/bounds.js +3 -3
  138. package/cjs/graphic/bounds.js.map +1 -1
  139. package/cjs/graphic/circle.js +3 -3
  140. package/cjs/graphic/circle.js.map +1 -1
  141. package/cjs/graphic/config.js +7 -1
  142. package/cjs/graphic/config.js.map +1 -1
  143. package/cjs/graphic/glyph.js +9 -3
  144. package/cjs/graphic/glyph.js.map +1 -1
  145. package/cjs/graphic/graphic-creator.d.ts +9 -4
  146. package/cjs/graphic/graphic-creator.js +35 -7
  147. package/cjs/graphic/graphic-creator.js.map +1 -1
  148. package/cjs/graphic/graphic-service/graphic-module.d.ts +4 -0
  149. package/cjs/graphic/graphic-service/graphic-module.js +14 -0
  150. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -0
  151. package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -3
  152. package/cjs/graphic/graphic-service/graphic-service.js +3 -4
  153. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  154. package/cjs/graphic/graphic.d.ts +78 -7
  155. package/cjs/graphic/graphic.js +491 -146
  156. package/cjs/graphic/graphic.js.map +1 -1
  157. package/cjs/graphic/group.d.ts +11 -1
  158. package/cjs/graphic/group.js +49 -13
  159. package/cjs/graphic/group.js.map +1 -1
  160. package/cjs/graphic/image.d.ts +1 -0
  161. package/cjs/graphic/image.js +4 -3
  162. package/cjs/graphic/image.js.map +1 -1
  163. package/cjs/graphic/index.d.ts +3 -0
  164. package/cjs/graphic/index.js +34 -15
  165. package/cjs/graphic/index.js.map +1 -1
  166. package/cjs/graphic/line.js +3 -3
  167. package/cjs/graphic/line.js.map +1 -1
  168. package/cjs/graphic/path.js +3 -3
  169. package/cjs/graphic/path.js.map +1 -1
  170. package/cjs/graphic/polygon.js +3 -3
  171. package/cjs/graphic/polygon.js.map +1 -1
  172. package/cjs/graphic/pyramid3d.js +3 -2
  173. package/cjs/graphic/pyramid3d.js.map +1 -1
  174. package/cjs/graphic/rect.js +3 -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 +41 -0
  213. package/cjs/graphic/state/state-transition-orchestrator.js +74 -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 +23953 -20200
  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/empty-context.js +1 -2
  508. package/es/canvas/util.d.ts +2 -3
  509. package/es/canvas/util.js +16 -8
  510. package/es/canvas/util.js.map +1 -1
  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/application.js +1 -1
  532. package/es/core/camera.js +1 -1
  533. package/es/core/constants.js +1 -1
  534. package/es/core/contributions/env/modules.d.ts +4 -0
  535. package/es/core/contributions/env/modules.js +10 -0
  536. package/es/core/contributions/env/modules.js.map +1 -0
  537. package/es/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
  538. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  539. package/es/core/contributions/layerHandler/empty-contribution.js +2 -2
  540. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  541. package/es/core/contributions/layerHandler/modules.d.ts +4 -0
  542. package/es/core/contributions/layerHandler/modules.js +10 -0
  543. package/es/core/contributions/layerHandler/modules.js.map +1 -0
  544. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
  545. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  546. package/es/core/contributions/modules.d.ts +2 -1
  547. package/es/core/contributions/modules.js +15 -1
  548. package/es/core/contributions/modules.js.map +1 -1
  549. package/es/core/contributions/textMeasure/modules.d.ts +4 -0
  550. package/es/core/contributions/textMeasure/modules.js +11 -0
  551. package/es/core/contributions/textMeasure/modules.js.map +1 -0
  552. package/es/core/core-modules.d.ts +4 -0
  553. package/es/core/core-modules.js +24 -0
  554. package/es/core/core-modules.js.map +1 -0
  555. package/es/core/global-module.d.ts +1 -0
  556. package/es/core/global-module.js +3 -0
  557. package/es/core/global-module.js.map +1 -0
  558. package/es/core/global.d.ts +4 -2
  559. package/es/core/global.js +7 -8
  560. package/es/core/global.js.map +1 -1
  561. package/es/core/graphic-utils.d.ts +3 -4
  562. package/es/core/graphic-utils.js +6 -11
  563. package/es/core/graphic-utils.js.map +1 -1
  564. package/es/core/layer-service.d.ts +7 -2
  565. package/es/core/layer-service.js +23 -17
  566. package/es/core/layer-service.js.map +1 -1
  567. package/es/core/layer.d.ts +1 -1
  568. package/es/core/layer.js +3 -3
  569. package/es/core/layer.js.map +1 -1
  570. package/es/core/stage.d.ts +17 -3
  571. package/es/core/stage.js +58 -30
  572. package/es/core/stage.js.map +1 -1
  573. package/es/core/window.d.ts +7 -5
  574. package/es/core/window.js +11 -9
  575. package/es/core/window.js.map +1 -1
  576. package/es/create.d.ts +1 -2
  577. package/es/create.js +4 -2
  578. package/es/create.js.map +1 -1
  579. package/es/entries/app-context.d.ts +30 -0
  580. package/es/entries/app-context.js +86 -0
  581. package/es/entries/app-context.js.map +1 -0
  582. package/es/entries/browser.d.ts +25 -0
  583. package/es/entries/browser.js +36 -0
  584. package/es/entries/browser.js.map +1 -0
  585. package/es/entries/index.d.ts +7 -0
  586. package/es/entries/index.js +14 -0
  587. package/es/entries/index.js.map +1 -0
  588. package/es/entries/miniapp.d.ts +6 -0
  589. package/es/entries/miniapp.js +12 -0
  590. package/es/entries/miniapp.js.map +1 -0
  591. package/es/entries/node.d.ts +6 -0
  592. package/es/entries/node.js +12 -0
  593. package/es/entries/node.js.map +1 -0
  594. package/es/entries/runtime-installer.d.ts +11 -0
  595. package/es/entries/runtime-installer.js +130 -0
  596. package/es/entries/runtime-installer.js.map +1 -0
  597. package/es/entries/types.d.ts +29 -0
  598. package/es/entries/types.js.map +1 -0
  599. package/es/env-check.js +3 -3
  600. package/es/env-check.js.map +1 -1
  601. package/es/event/event-manager.js +4 -1
  602. package/es/event/event-manager.js.map +1 -1
  603. package/es/event/util.d.ts +1 -1
  604. package/es/factory/graphic-factory.d.ts +7 -0
  605. package/es/factory/graphic-factory.js +15 -0
  606. package/es/factory/graphic-factory.js.map +1 -0
  607. package/es/factory/index.d.ts +4 -0
  608. package/es/factory/index.js +8 -0
  609. package/es/factory/index.js.map +1 -0
  610. package/es/factory/layer-factory.d.ts +7 -0
  611. package/es/factory/layer-factory.js +11 -0
  612. package/es/factory/layer-factory.js.map +1 -0
  613. package/es/factory/stage-factory.d.ts +8 -0
  614. package/es/factory/stage-factory.js +12 -0
  615. package/es/factory/stage-factory.js.map +1 -0
  616. package/es/factory/types.d.ts +34 -0
  617. package/es/factory/types.js +2 -0
  618. package/es/factory/types.js.map +1 -0
  619. package/es/factory.d.ts +1 -0
  620. package/es/factory.js +2 -0
  621. package/es/factory.js.map +1 -1
  622. package/es/global.d.ts +2 -0
  623. package/es/global.js +10 -0
  624. package/es/global.js.map +1 -0
  625. package/es/graphic/arc.js +3 -3
  626. package/es/graphic/arc.js.map +1 -1
  627. package/es/graphic/arc3d.js +4 -3
  628. package/es/graphic/arc3d.js.map +1 -1
  629. package/es/graphic/area.js +3 -3
  630. package/es/graphic/area.js.map +1 -1
  631. package/es/graphic/bounds.js +3 -3
  632. package/es/graphic/bounds.js.map +1 -1
  633. package/es/graphic/circle.js +3 -3
  634. package/es/graphic/circle.js.map +1 -1
  635. package/es/graphic/config.js +7 -1
  636. package/es/graphic/config.js.map +1 -1
  637. package/es/graphic/glyph.js +9 -3
  638. package/es/graphic/glyph.js.map +1 -1
  639. package/es/graphic/graphic-creator.d.ts +9 -4
  640. package/es/graphic/graphic-creator.js +32 -5
  641. package/es/graphic/graphic-creator.js.map +1 -1
  642. package/es/graphic/graphic-service/graphic-module.d.ts +4 -0
  643. package/es/graphic/graphic-service/graphic-module.js +12 -0
  644. package/es/graphic/graphic-service/graphic-module.js.map +1 -0
  645. package/es/graphic/graphic-service/graphic-service.d.ts +2 -3
  646. package/es/graphic/graphic-service/graphic-service.js +3 -5
  647. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  648. package/es/graphic/graphic.d.ts +78 -7
  649. package/es/graphic/graphic.js +490 -140
  650. package/es/graphic/graphic.js.map +1 -1
  651. package/es/graphic/group.d.ts +11 -1
  652. package/es/graphic/group.js +49 -13
  653. package/es/graphic/group.js.map +1 -1
  654. package/es/graphic/image.d.ts +1 -0
  655. package/es/graphic/image.js +5 -4
  656. package/es/graphic/image.js.map +1 -1
  657. package/es/graphic/index.d.ts +3 -0
  658. package/es/graphic/index.js +4 -0
  659. package/es/graphic/index.js.map +1 -1
  660. package/es/graphic/line.js +3 -3
  661. package/es/graphic/line.js.map +1 -1
  662. package/es/graphic/path.js +3 -3
  663. package/es/graphic/path.js.map +1 -1
  664. package/es/graphic/polygon.js +3 -3
  665. package/es/graphic/polygon.js.map +1 -1
  666. package/es/graphic/pyramid3d.js +2 -2
  667. package/es/graphic/pyramid3d.js.map +1 -1
  668. package/es/graphic/rect.js +3 -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 +41 -0
  707. package/es/graphic/state/state-transition-orchestrator.js +68 -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,227 @@ 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;
216
+ if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
217
+ compiledDefinitions: sharedCompiledDefinitions,
218
+ stateProxyModeKey: this.stateProxy ? "shared-disabled" : "none",
219
+ stateProxyEligibility: this.stateProxy ? () => !1 : void 0
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: this.stateProxy ? "shared-disabled" : "none",
229
+ stateProxyEligibility: this.stateProxy ? () => !1 : void 0
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: this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0
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
+ syncObjectToSnapshot(target, snapshot) {
258
+ const delta = new Map;
259
+ return new Set([ ...Object.keys(target), ...Object.keys(snapshot) ]).forEach((key => {
260
+ const hasNext = Object.prototype.hasOwnProperty.call(snapshot, key), previousValue = target[key];
261
+ if (!hasNext) return void (Object.prototype.hasOwnProperty.call(target, key) && (delta.set(key, {
262
+ prev: previousValue,
263
+ next: void 0
264
+ }), delete target[key]));
265
+ const nextValue = snapshot[key];
266
+ (0, vutils_1.isEqual)(previousValue, nextValue) || (delta.set(key, {
267
+ prev: previousValue,
268
+ next: nextValue
269
+ }), target[key] = cloneAttributeValue(nextValue));
270
+ })), delta;
271
+ }
272
+ _syncAttribute() {
273
+ const snapshot = this.buildStaticAttributeSnapshot(), delta = this.syncObjectToSnapshot(this.attribute, snapshot);
274
+ return this.valid = this.isValid(), delta;
275
+ }
276
+ _syncFinalAttributeFromStaticTruth() {
277
+ const target = this.finalAttribute;
278
+ if (!target) return;
279
+ const snapshot = this.buildStaticAttributeSnapshot();
280
+ this.syncObjectToSnapshot(target, snapshot);
281
+ }
282
+ submitUpdateByDelta(delta, forceUpdateTag = !1) {
283
+ var _a;
284
+ if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
285
+ void this.addUpdateLayoutTag();
286
+ let category = attribute_update_classifier_1.UpdateCategory.NONE;
287
+ delta.forEach(((entry, key) => {
288
+ let nextCategory = (0, attribute_update_classifier_1.classifyAttributeDelta)(key, entry.prev, entry.next);
289
+ nextCategory & attribute_update_classifier_1.UpdateCategory.PICK && (nextCategory |= attribute_update_classifier_1.UpdateCategory.BOUNDS),
290
+ nextCategory === attribute_update_classifier_1.UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = attribute_update_classifier_1.UpdateCategory.SHAPE | attribute_update_classifier_1.UpdateCategory.BOUNDS),
291
+ category |= nextCategory;
292
+ })), category !== attribute_update_classifier_1.UpdateCategory.NONE && (null === (_a = (0,
293
+ state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _a || _a.recordCategory(category)),
294
+ category & attribute_update_classifier_1.UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & attribute_update_classifier_1.UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
295
+ category & attribute_update_classifier_1.UpdateCategory.PAINT && this.addUpdatePaintTag(),
296
+ category & attribute_update_classifier_1.UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
297
+ category & attribute_update_classifier_1.UpdateCategory.LAYOUT && this.addUpdateLayoutTag();
298
+ }
299
+ commitBaseAttributeMutation(forceUpdateTag = !1, context) {
300
+ var _a, _b;
301
+ (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch += 1,
302
+ null === (_b = this.stateEngine) || void 0 === _b || _b.invalidateResolverCache(),
303
+ this.recomputeCurrentStatePatch());
304
+ const delta = this._syncAttribute();
305
+ this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
306
+ }
307
+ applyBaseAttributes(params) {
308
+ const keys = Object.keys(params);
309
+ for (let i = 0; i < keys.length; i++) {
310
+ const key = keys[i];
311
+ this.baseAttributes[key] = cloneAttributeValue(params[key]);
312
+ }
313
+ }
314
+ applyTransientAttributes(params, forceUpdateTag = !1, context) {
315
+ const delta = new Map, keys = Object.keys(params);
316
+ for (let i = 0; i < keys.length; i++) {
317
+ const key = keys[i], previousValue = this.attribute[key], nextValue = params[key];
318
+ (0, vutils_1.isEqual)(previousValue, nextValue) || (delta.set(key, {
319
+ prev: previousValue,
320
+ next: nextValue
321
+ }), this.attribute[key] = cloneAttributeValue(nextValue));
322
+ }
323
+ this.valid = this.isValid(), this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
324
+ }
325
+ _restoreAttributeFromStaticTruth(context) {
326
+ this._syncFinalAttributeFromStaticTruth();
327
+ const delta = this._syncAttribute();
328
+ this.submitUpdateByDelta(delta), this.onAttributeUpdate(context);
329
+ }
81
330
  setMode(mode) {
82
331
  "3d" === mode ? this.set3dMode() : this.set2dMode();
83
332
  }
@@ -99,6 +348,17 @@ class Graphic extends node_tree_1.Node {
99
348
  onAnimateBind(animate) {
100
349
  this._emitCustomEvent("animate-bind", animate);
101
350
  }
351
+ visitTrackedAnimates(cb) {
352
+ const hook = this.forEachTrackedAnimate;
353
+ "function" != typeof hook ? this.animates && this.animates.forEach(cb) : hook.call(this, cb);
354
+ }
355
+ hasAnyTrackedAnimate() {
356
+ var _a;
357
+ const hook = this.hasTrackedAnimate;
358
+ if ("function" == typeof hook) return hook.call(this);
359
+ const getTrackedAnimates = this.getTrackedAnimates;
360
+ return "function" == typeof getTrackedAnimates ? getTrackedAnimates.call(this).size > 0 : !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size);
361
+ }
102
362
  tryUpdateAABBBounds() {
103
363
  const full = "imprecise" === this.attribute.boundsMode;
104
364
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
@@ -147,8 +407,8 @@ class Graphic extends node_tree_1.Node {
147
407
  const cacheList = [];
148
408
  path.forEach((item => {
149
409
  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]);
410
+ constants_1.SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach((k => {
411
+ item[k] && (attribute[constants_1.SVG_PARSE_ATTRIBUTE_MAP[k]] = item[k]);
152
412
  })), cacheList.push({
153
413
  path: cache,
154
414
  attribute: attribute
@@ -201,7 +461,7 @@ class Graphic extends node_tree_1.Node {
201
461
  return !0;
202
462
  }
203
463
  tryUpdateLocalTransMatrix(clearTag = !0) {
204
- return this._transMatrix || (this._transMatrix = new vutils_2.Matrix), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(),
464
+ return this._transMatrix || (this._transMatrix = new vutils_1.Matrix), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(),
205
465
  clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
206
466
  }
207
467
  shouldUpdateAABBBounds() {
@@ -230,7 +490,7 @@ class Graphic extends node_tree_1.Node {
230
490
  containsPoint(x, y, mode, picker) {
231
491
  if (!picker) return !1;
232
492
  if (mode === enums_1.IContainPointMode.GLOBAL) {
233
- const point = new vutils_2.Point(x, y);
493
+ const point = new vutils_1.Point(x, y);
234
494
  this.parent && this.parent.globalTransMatrix.transformPoint(point, point), x = point.x,
235
495
  y = point.y;
236
496
  }
@@ -243,34 +503,27 @@ class Graphic extends node_tree_1.Node {
243
503
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
244
504
  }
245
505
  setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
246
- this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
506
+ this.visitTrackedAnimates((animate => {
247
507
  (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach((key => {
248
508
  animate.preventAttr(key);
249
509
  }));
250
- }));
510
+ })), this.applyTransientAttributes(params, forceUpdateTag, context);
251
511
  }
252
512
  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),
513
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
514
+ isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
254
515
  this._setAttributes(params, forceUpdateTag, context));
255
516
  }
256
517
  _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);
518
+ this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context);
264
519
  }
265
520
  setAttribute(key, value, forceUpdateTag, context) {
266
- var _a;
267
521
  const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
268
522
  [key]: value
269
523
  }, 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);
524
+ params ? this._setAttributes(params, forceUpdateTag, context) : (this.applyBaseAttributes({
525
+ [key]: value
526
+ }), this.commitBaseAttributeMutation(!!forceUpdateTag, context)), "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
274
527
  }
275
528
  needUpdateTags(keys, k = exports.GRAPHIC_UPDATE_TAG_KEY) {
276
529
  for (let i = 0; i < k.length; i++) {
@@ -290,7 +543,9 @@ class Graphic extends node_tree_1.Node {
290
543
  type: enums_1.AttributeUpdateType.INIT
291
544
  };
292
545
  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),
546
+ this.baseAttributes = cloneAttributeValue(params), this.attribute || (this.attribute = {}),
547
+ this.resolvedStatePatch = void 0, this._syncAttribute(), params.background && this.loadImage(params.background, !0),
548
+ isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
294
549
  this._updateTag = enums_1.UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
295
550
  }
296
551
  translate(x, y) {
@@ -302,15 +557,14 @@ class Graphic extends node_tree_1.Node {
302
557
  x: x,
303
558
  y: y
304
559
  }, 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,
560
+ params && (x = params.x, y = params.y, delete params.x, delete params.y, this.applyBaseAttributes(params));
561
+ const attribute = this.baseAttributes, postMatrix = attribute.postMatrix;
562
+ 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
563
  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;
564
+ this.commitBaseAttributeMutation(!1, context), this;
311
565
  }
312
566
  translateTo(x, y) {
313
- const attribute = this.attribute;
567
+ const attribute = this.baseAttributes;
314
568
  if (attribute.x === x && attribute.y === y) return this;
315
569
  const context = {
316
570
  type: enums_1.AttributeUpdateType.TRANSLATE_TO
@@ -318,9 +572,9 @@ class Graphic extends node_tree_1.Node {
318
572
  x: x,
319
573
  y: y
320
574
  }, 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);
575
+ return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
576
+ this) : (attribute.x = x, attribute.y = y, this.commitBaseAttributeMutation(!1, context),
577
+ this);
324
578
  }
325
579
  scale(scaleX, scaleY, scaleCenter) {
326
580
  var _a, _b;
@@ -333,19 +587,18 @@ class Graphic extends node_tree_1.Node {
333
587
  scaleCenter: scaleCenter
334
588
  }, this.attribute, tempConstantScaleXYKey, context);
335
589
  params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX,
336
- delete params.scaleY, this._setAttributes(params));
337
- const attribute = this.attribute;
590
+ delete params.scaleY, this.applyBaseAttributes(params));
591
+ const attribute = this.baseAttributes;
338
592
  if (scaleCenter) {
339
593
  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);
594
+ postMatrix || (postMatrix = new vutils_1.Matrix, attribute.postMatrix = postMatrix),
595
+ application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
342
596
  } else attribute.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : config_1.DefaultTransform.scaleX) * scaleX,
343
597
  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;
598
+ return this.commitBaseAttributeMutation(!1, context), this;
346
599
  }
347
600
  scaleTo(scaleX, scaleY) {
348
- const attribute = this.attribute;
601
+ const attribute = this.baseAttributes;
349
602
  if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) return this;
350
603
  const context = {
351
604
  type: enums_1.AttributeUpdateType.SCALE_TO
@@ -353,9 +606,9 @@ class Graphic extends node_tree_1.Node {
353
606
  scaleX: scaleX,
354
607
  scaleY: scaleY
355
608
  }, 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);
609
+ return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
610
+ this) : (attribute.scaleX = scaleX, attribute.scaleY = scaleY, this.commitBaseAttributeMutation(!1, context),
611
+ this);
359
612
  }
360
613
  rotate(angle, rotateCenter) {
361
614
  var _a;
@@ -366,25 +619,24 @@ class Graphic extends node_tree_1.Node {
366
619
  angle: angle,
367
620
  rotateCenter: rotateCenter
368
621
  }, this.attribute, tempConstantAngleKey, context);
369
- params && (delete params.angle, this._setAttributes(params, !1, context));
370
- const attribute = this.attribute;
622
+ params && (delete params.angle, this.applyBaseAttributes(params));
623
+ const attribute = this.baseAttributes;
371
624
  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);
625
+ let {postMatrix: postMatrix} = this.baseAttributes;
626
+ postMatrix || (postMatrix = new vutils_1.Matrix, this.baseAttributes.postMatrix = postMatrix),
627
+ application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);
375
628
  } 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;
629
+ return this.commitBaseAttributeMutation(!1, context), this;
378
630
  }
379
631
  rotateTo(angle) {
380
- const attribute = this.attribute;
632
+ const attribute = this.baseAttributes;
381
633
  if (attribute.angle === angle) return this;
382
634
  const context = {
383
635
  type: enums_1.AttributeUpdateType.ROTATE_TO
384
636
  }, 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);
637
+ return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
638
+ this) : (attribute.angle = angle, this.commitBaseAttributeMutation(!1, context),
639
+ this);
388
640
  }
389
641
  skewTo(b, c) {
390
642
  return this;
@@ -398,99 +650,146 @@ class Graphic extends node_tree_1.Node {
398
650
  this.tryUpdateLocalTransMatrix());
399
651
  }
400
652
  hasState(stateName) {
401
- return !(!this.currentStates || !this.currentStates.length) && (!!(0, vutils_2.isNil)(stateName) || this.currentStates.includes(stateName));
653
+ return !(!this.currentStates || !this.currentStates.length) && (!!(0, vutils_1.isNil)(stateName) || this.currentStates.includes(stateName));
402
654
  }
403
655
  getState(stateName) {
404
656
  var _a;
405
657
  return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
406
658
  }
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
659
+ createStateModel() {
660
+ const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility, stateProxyModeKey: stateProxyModeKey} = this.resolveEffectiveCompiledDefinitions();
661
+ 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({
662
+ compiledDefinitions: compiledDefinitions,
663
+ stateSort: this.stateSort,
664
+ stateProxy: this.stateProxy,
665
+ stateProxyEligibility: stateProxyEligibility,
666
+ states: this.states,
667
+ mergeMode: this.stateMergeMode
668
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy,
669
+ this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode,
670
+ this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0,
671
+ this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0),
672
+ new state_model_1.StateModel({
673
+ states: this.states,
674
+ currentStates: this.currentStates,
675
+ stateSort: this.stateSort,
676
+ stateProxy: this.stateProxy,
677
+ stateEngine: this.stateEngine
678
+ });
679
+ }
680
+ resolveStateAnimateConfig(animateConfig) {
681
+ var _a, _b, _c;
682
+ 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;
683
+ }
684
+ applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig) {
685
+ const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : void 0, transitionOptions = resolvedAnimateConfig ? {
686
+ animateConfig: resolvedAnimateConfig
687
+ } : void 0;
688
+ if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
689
+ const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
690
+ noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
691
+ animateConfig: resolvedAnimateConfig
432
692
  });
693
+ this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
433
694
  }
434
695
  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;
696
+ this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
443
697
  }
444
698
  stopStateAnimates(type = "end") {
445
- this.animates && this.animates.forEach((animate => {
446
- animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
447
- }));
699
+ const stopAnimationState = this.stopAnimationState;
700
+ if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
701
+ const stateAnimates = [];
702
+ this.visitTrackedAnimates((animate => {
703
+ animate.stateNames && stateAnimates.push(animate);
704
+ })), stateAnimates.forEach((animate => animate.stop(type)));
448
705
  }
449
706
  getNormalAttribute(key) {
450
707
  var _a, _b;
451
708
  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];
709
+ 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
710
  }
454
711
  clearStates(hasAnimation) {
455
- this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [],
456
- this.normalAttrs = null;
712
+ var _a, _b, _c;
713
+ const previousStates = this.currentStates ? this.currentStates.slice() : [], transition = this.createStateModel().clearStates();
714
+ if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
715
+ this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
716
+ void this.clearSharedStateActiveRegistrations();
717
+ const resolvedStateAttrs = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {});
718
+ transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
719
+ this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
720
+ this.clearSharedStateActiveRegistrations(), null === (_b = (0, state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _b || _b.incrementCounter("stateCommits"),
721
+ null === (_c = (0, state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _c || _c.recordEvent("state-commit", {
722
+ graphicId: this._uid,
723
+ targetStates: []
724
+ }), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0)) : (this.stopStateAnimates(),
725
+ this._restoreAttributeFromStaticTruth({
726
+ type: enums_1.AttributeUpdateType.STATE
727
+ }), this._emitCustomEvent("afterStateUpdate", {
728
+ type: enums_1.AttributeUpdateType.STATE
729
+ })));
457
730
  }
458
731
  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
- }
732
+ const transition = this.createStateModel().removeState(stateName);
733
+ transition.changed && this.useStates(transition.states, hasAnimation);
463
734
  }
464
735
  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
- }
736
+ const transition = this.createStateModel().toggleState(stateName);
737
+ transition.changed && this.useStates(transition.states, hasAnimation);
471
738
  }
472
739
  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);
740
+ const transition = this.createStateModel().addState(stateName, keepCurrentStates);
741
+ transition.changed && this.useStates(transition.states, hasAnimation);
477
742
  }
478
743
  useStates(states, hasAnimation) {
479
- var _a;
744
+ var _a, _b, _c, _d, _e;
480
745
  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);
746
+ const previousStates = this.currentStates ? this.currentStates.slice() : [], stateResolveBaseAttrs = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute, stateModel = this.createStateModel();
747
+ null === (_b = this.stateEngine) || void 0 === _b || _b.setResolveContext(this, stateResolveBaseAttrs);
748
+ const transition = stateModel.useStates(states);
749
+ if (!transition.changed && this.sameStateNames(previousStates, transition.states)) return;
750
+ 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);
751
+ this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
752
+ this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
753
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = (0,
754
+ state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"),
755
+ null === (_e = (0, state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
756
+ graphicId: this._uid,
757
+ targetStates: [ ...transition.states ]
758
+ }), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation)) : (this.stopStateAnimates(),
759
+ this._restoreAttributeFromStaticTruth({
760
+ type: enums_1.AttributeUpdateType.STATE
761
+ }), this._emitCustomEvent("afterStateUpdate", {
762
+ type: enums_1.AttributeUpdateType.STATE
763
+ })));
764
+ }
765
+ invalidateResolver() {
766
+ var _a, _b;
767
+ if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
768
+ const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute;
769
+ this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch += 1,
770
+ this.stateEngine.invalidateResolverCache();
771
+ const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
772
+ this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
773
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(),
774
+ this._restoreAttributeFromStaticTruth({
775
+ type: enums_1.AttributeUpdateType.STATE
776
+ }), this._emitCustomEvent("afterStateUpdate", {
777
+ type: enums_1.AttributeUpdateType.STATE
778
+ });
779
+ }
780
+ sameStateNames(left, right) {
781
+ const normalizedLeft = null != left ? left : [], normalizedRight = null != right ? right : [];
782
+ if (normalizedLeft.length !== normalizedRight.length) return !1;
783
+ for (let index = 0; index < normalizedLeft.length; index++) if (normalizedLeft[index] !== normalizedRight[index]) return !1;
784
+ return !0;
489
785
  }
490
786
  addUpdateBoundTag() {
491
787
  this._updateTag |= enums_1.UpdateTag.UPDATE_BOUNDS, this.parent && this.parent.addChildUpdateBoundTag(),
492
788
  this.glyphHost && this.glyphHost.addUpdateBoundTag();
493
789
  }
790
+ addUpdatePaintTag() {
791
+ this._updateTag |= enums_1.UpdateTag.UPDATE_PAINT;
792
+ }
494
793
  addUpdateShapeTag() {
495
794
  this._updateTag |= enums_1.UpdateTag.UPDATE_SHAPE;
496
795
  }
@@ -504,6 +803,9 @@ class Graphic extends node_tree_1.Node {
504
803
  clearUpdateBoundTag() {
505
804
  this._updateTag &= enums_1.UpdateTag.CLEAR_BOUNDS;
506
805
  }
806
+ clearUpdatePaintTag() {
807
+ this._updateTag &= enums_1.UpdateTag.CLEAR_PAINT;
808
+ }
507
809
  addUpdatePositionTag() {
508
810
  this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag(), this._updateTag |= enums_1.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;
509
811
  }
@@ -547,10 +849,10 @@ class Graphic extends node_tree_1.Node {
547
849
  let _anchor = [ 0, 0 ];
548
850
  const params = {};
549
851
  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 {
852
+ vutils_1.normalTransform)(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
551
853
  const m = this._transMatrix;
552
854
  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, {
855
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
554
856
  x: _anchor[0],
555
857
  y: _anchor[1]
556
858
  });
@@ -569,23 +871,35 @@ class Graphic extends node_tree_1.Node {
569
871
  }
570
872
  }
571
873
  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));
874
+ var _a, _b, _c, _d, _e, _f, _g, _h;
875
+ 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;
876
+ if (this.stage !== stage || this.layer !== layer) {
877
+ if (this.stage = stage, this.layer = layer, this.syncSharedStateScopeBindingFromTree(!!(null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length)),
878
+ this.setStageToShadowRoot(stage, layer), this.hasAnyTrackedAnimate()) {
879
+ 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 = [];
880
+ this.visitTrackedAnimates((a => {
881
+ (!!previousTimeline && a.timeline === previousTimeline || a.timeline.isGlobal) && (nextTimeline ? a.timeline !== nextTimeline && (previousTimeline && a.timeline === previousTimeline && previousTimeline.removeAnimate(a, !1),
882
+ a.setTimeline(nextTimeline), nextTimeline.addAnimate(a)) : previousTimeline && a.timeline === previousTimeline && (previousTimeline.removeAnimate(a, !1),
883
+ detachedStageAnimates.push(a)));
884
+ })), detachedStageAnimates.length && (detachedStageAnimates.forEach((animate => {
885
+ var _a;
886
+ animate.stop();
887
+ const untrackAnimate = this.untrackAnimate;
888
+ "function" == typeof untrackAnimate ? untrackAnimate.call(this, animate.id) : null === (_a = this.animates) || void 0 === _a || _a.delete(animate.id);
889
+ })), this._restoreAttributeFromStaticTruth({
890
+ type: enums_1.AttributeUpdateType.ANIMATE_END
578
891
  }));
579
892
  }
580
- this._onSetStage && this._onSetStage(this, stage, layer), this.getGraphicService().onSetStage(this, stage);
893
+ 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
894
  }
895
+ this.syncSharedStateScopeBindingFromTree(!!(null === (_h = this.currentStates) || void 0 === _h ? void 0 : _h.length));
582
896
  }
583
897
  setStageToShadowRoot(stage, layer) {
584
898
  this.shadowRoot && this.shadowRoot.setStage(stage, layer);
585
899
  }
586
900
  onAddStep(step) {}
587
901
  onStop(props) {
588
- props && this.setAttributes(props, !1, {
902
+ this._restoreAttributeFromStaticTruth({
589
903
  type: enums_1.AttributeUpdateType.ANIMATE_END
590
904
  });
591
905
  }
@@ -600,7 +914,8 @@ class Graphic extends node_tree_1.Node {
600
914
  this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
601
915
  }
602
916
  attachShadow(shadowRoot) {
603
- return shadowRoot && (shadowRoot.shadowHost = this), this.shadowRoot = null != shadowRoot ? shadowRoot : modules_1.graphicService.creator.shadowRoot(this),
917
+ var _a, _b, _c;
918
+ 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
919
  this.addUpdateBoundTag(), this.shadowRoot.setStage(this.stage, this.layer), this.shadowRoot;
605
920
  }
606
921
  detachShadow() {
@@ -616,11 +931,13 @@ class Graphic extends node_tree_1.Node {
616
931
  };
617
932
  }
618
933
  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,
934
+ return (0, vutils_1.isString)(path, !0) ? this.pathProxy = (new custom_path2d_1.CustomPath2D).fromString(path) : this.pathProxy = new custom_path2d_1.CustomPath2D,
620
935
  this.pathProxy;
621
936
  }
622
937
  loadImage(image, background = !1) {
623
- if (!image || background && backgroundNotImage(image)) return;
938
+ if (background && (null == image ? void 0 : image.background) && (image = image.background),
939
+ background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
940
+ if (!image) return;
624
941
  const url = image;
625
942
  this.resources || (this.resources = new Map);
626
943
  const cache = {
@@ -629,8 +946,8 @@ class Graphic extends node_tree_1.Node {
629
946
  };
630
947
  this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading",
631
948
  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",
949
+ vutils_1.isValidUrl)(image) || image.includes("/") || (0, vutils_1.isBase64)(image)) && (loader_1.ResourceLoader.GetImage(image, this),
950
+ this.backgroundImg = this.backgroundImg || background)) : (0, vutils_1.isObject)(image) ? (cache.state = "success",
634
951
  cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
635
952
  }
636
953
  setShadowGraphic(graphic) {
@@ -649,31 +966,52 @@ class Graphic extends node_tree_1.Node {
649
966
  const res = this.resources.get(url);
650
967
  res && (res.state = "fail", cb && cb());
651
968
  }
652
- _stopAnimates(animates) {
653
- animates && animates.forEach((animate => {
969
+ _stopAnimates() {
970
+ const animates = [];
971
+ this.visitTrackedAnimates((animate => {
972
+ animates.push(animate);
973
+ })), animates.forEach((animate => {
654
974
  animate.stop();
655
975
  }));
656
976
  }
657
977
  stopAnimates(stopChildren = !1) {
658
- this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0),
659
- this.isContainer && stopChildren && this.forEachChildren((c => {
978
+ this._stopAnimates(), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren((c => {
660
979
  c.stopAnimates(stopChildren);
661
980
  }));
662
981
  }
663
982
  release() {
664
- this.releaseStatus = "released", this.stopAnimates(), modules_1.graphicService.onRelease(this);
983
+ var _a, _b, _c;
984
+ this.releaseStatus = "released", this.clearSharedStateActiveRegistrations(), this.stopAnimates();
985
+ const graphicService = null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : application_1.application.graphicService;
986
+ null === (_c = null == graphicService ? void 0 : graphicService.onRelease) || void 0 === _c || _c.call(graphicService, this),
987
+ super.release();
665
988
  }
666
- _emitCustomEvent(type, context) {
989
+ _dispatchCustomEvent(type, context) {
667
990
  var _a, _b;
668
991
  if (this._events && type in this._events) {
669
992
  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);
993
+ changeEvent.bubbles = !1;
994
+ const manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager;
995
+ return manager ? (changeEvent.manager = manager, this.dispatchEvent(changeEvent)) : node_tree_1.Node.prototype.dispatchEvent.call(this, changeEvent);
672
996
  }
997
+ return !0;
998
+ }
999
+ beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
1000
+ return this._dispatchCustomEvent("beforeStateUpdate", {
1001
+ type: enums_1.AttributeUpdateType.STATE,
1002
+ attrs: Object.assign({}, attrs),
1003
+ prevStates: prevStates.slice(),
1004
+ nextStates: nextStates.slice(),
1005
+ hasAnimation: !!hasAnimation,
1006
+ isClear: !!isClear
1007
+ });
1008
+ }
1009
+ _emitCustomEvent(type, context) {
1010
+ this._dispatchCustomEvent(type, context);
673
1011
  }
674
1012
  toCustomPath() {
675
1013
  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);
1014
+ 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
1015
  if (renderer) {
678
1016
  const context = new canvas_1.EmptyContext2d(null, 1);
679
1017
  return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
@@ -683,7 +1021,14 @@ class Graphic extends node_tree_1.Node {
683
1021
  }
684
1022
 
685
1023
  function backgroundNotImage(image) {
686
- return !(!image.fill && !image.stroke);
1024
+ return "string" == typeof image ? !(image.startsWith("<svg") || (0, vutils_1.isValidUrl)(image) || image.includes("/") || (0,
1025
+ vutils_1.isBase64)(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
1026
+ }
1027
+
1028
+ function isExternalTexture(texture) {
1029
+ return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || (0,
1030
+ vutils_1.isValidUrl)(texture) || texture.includes("/") || (0, vutils_1.isBase64)(texture)) : (0,
1031
+ vutils_1.isObject)(texture));
687
1032
  }
688
1033
 
689
1034
  exports.Graphic = Graphic, Graphic.userSymbolMap = {}, Graphic.mixin(event_1.EventTarget);