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