@visactor/vrender-core 1.1.0-alpha.24 → 1.1.0-alpha.26

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 (404) hide show
  1. package/cjs/common/event-listener-manager.js +1 -2
  2. package/cjs/common/event-transformer.js +2 -1
  3. package/cjs/common/performance-raf.js +1 -1
  4. package/cjs/common/xml/is-xml.d.ts +2 -0
  5. package/cjs/common/xml/is-xml.js +14 -0
  6. package/cjs/common/xml/is-xml.js.map +1 -0
  7. package/cjs/common/xml/parser.d.ts +2 -2
  8. package/cjs/common/xml/parser.js +14 -11
  9. package/cjs/common/xml/parser.js.map +1 -1
  10. package/cjs/container.d.ts +2 -0
  11. package/cjs/container.js +50 -0
  12. package/cjs/container.js.map +1 -0
  13. package/cjs/core/graphic-utils.js +1 -2
  14. package/cjs/core/layer-service.js +2 -1
  15. package/cjs/core/stage.d.ts +0 -9
  16. package/cjs/core/stage.js +11 -29
  17. package/cjs/core/stage.js.map +1 -1
  18. package/cjs/entries/miniapp.d.ts +0 -1
  19. package/cjs/entries/miniapp.js +1 -5
  20. package/cjs/entries/miniapp.js.map +1 -1
  21. package/cjs/entries/node.d.ts +0 -1
  22. package/cjs/entries/node.js +1 -5
  23. package/cjs/entries/node.js.map +1 -1
  24. package/cjs/env.d.ts +1 -0
  25. package/cjs/env.js +25 -0
  26. package/cjs/env.js.map +1 -0
  27. package/cjs/event/public-constant.d.ts +7 -0
  28. package/cjs/event/public-constant.js +100 -0
  29. package/cjs/event/public-constant.js.map +1 -0
  30. package/cjs/event/util.d.ts +1 -1
  31. package/cjs/graphic/base.d.ts +2 -0
  32. package/cjs/graphic/base.js +15 -0
  33. package/cjs/graphic/base.js.map +1 -0
  34. package/cjs/graphic/creator.d.ts +16 -0
  35. package/cjs/graphic/creator.js +160 -0
  36. package/cjs/graphic/creator.js.map +1 -0
  37. package/cjs/graphic/glyph.js +4 -8
  38. package/cjs/graphic/glyph.js.map +1 -1
  39. package/cjs/graphic/graphic-service/graphic-service.d.ts +0 -1
  40. package/cjs/graphic/graphic-service/graphic-service.js +1 -8
  41. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  42. package/cjs/graphic/graphic.d.ts +19 -29
  43. package/cjs/graphic/graphic.js +123 -201
  44. package/cjs/graphic/graphic.js.map +1 -1
  45. package/cjs/graphic/group.d.ts +1 -3
  46. package/cjs/graphic/group.js +22 -28
  47. package/cjs/graphic/group.js.map +1 -1
  48. package/cjs/graphic/modules.d.ts +16 -0
  49. package/cjs/graphic/modules.js +150 -0
  50. package/cjs/graphic/modules.js.map +1 -0
  51. package/cjs/graphic/node-tree.d.ts +3 -3
  52. package/cjs/graphic/node-tree.js +1 -0
  53. package/cjs/graphic/node-tree.js.map +1 -1
  54. package/cjs/graphic/state/shared-state-refresh.js +11 -32
  55. package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
  56. package/cjs/graphic/state/shared-state-scope.d.ts +2 -5
  57. package/cjs/graphic/state/shared-state-scope.js +8 -27
  58. package/cjs/graphic/state/shared-state-scope.js.map +1 -1
  59. package/cjs/graphic/state/state-definition-compiler.js +4 -5
  60. package/cjs/graphic/state/state-definition-compiler.js.map +1 -1
  61. package/cjs/graphic/state/state-definition.d.ts +2 -5
  62. package/cjs/graphic/state/state-definition.js.map +1 -1
  63. package/cjs/graphic/state/state-engine.d.ts +0 -5
  64. package/cjs/graphic/state/state-engine.js +20 -70
  65. package/cjs/graphic/state/state-engine.js.map +1 -1
  66. package/cjs/graphic/state/state-transition-orchestrator.d.ts +7 -9
  67. package/cjs/graphic/state/state-transition-orchestrator.js +10 -13
  68. package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -1
  69. package/cjs/graphic/tools.js +3 -3
  70. package/cjs/graphic/tools.js.map +1 -1
  71. package/cjs/index.js.map +1 -1
  72. package/cjs/interface/graphic/group.d.ts +0 -2
  73. package/cjs/interface/graphic/group.js.map +1 -1
  74. package/cjs/interface/graphic.d.ts +1 -5
  75. package/cjs/interface/graphic.js.map +1 -1
  76. package/cjs/interface/index.js.map +1 -1
  77. package/cjs/interface/node-tree.d.ts +3 -0
  78. package/cjs/interface/node-tree.js.map +1 -1
  79. package/cjs/interface/stage.d.ts +0 -7
  80. package/cjs/interface/stage.js.map +1 -1
  81. package/cjs/interpolate.d.ts +2 -0
  82. package/cjs/interpolate.js +34 -0
  83. package/cjs/interpolate.js.map +1 -0
  84. package/cjs/modules.js.map +1 -1
  85. package/cjs/path.d.ts +4 -0
  86. package/cjs/path.js +33 -0
  87. package/cjs/path.js.map +1 -0
  88. package/cjs/plugin/3d.d.ts +3 -0
  89. package/cjs/plugin/3d.js +33 -0
  90. package/cjs/plugin/3d.js.map +1 -0
  91. package/cjs/plugin/attribute.d.ts +2 -0
  92. package/cjs/plugin/attribute.js +24 -0
  93. package/cjs/plugin/attribute.js.map +1 -0
  94. package/cjs/plugin/flex-layout.d.ts +1 -0
  95. package/cjs/plugin/flex-layout.js +15 -0
  96. package/cjs/plugin/flex-layout.js.map +1 -0
  97. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  98. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  99. package/cjs/plugins/index.d.ts +0 -4
  100. package/cjs/plugins/index.js +1 -3
  101. package/cjs/plugins/index.js.map +1 -1
  102. package/cjs/plugins/plugin-service.d.ts +0 -1
  103. package/cjs/plugins/plugin-service.js +2 -3
  104. package/cjs/plugins/plugin-service.js.map +1 -1
  105. package/cjs/plugins/types.d.ts +1 -8
  106. package/cjs/plugins/types.js.map +1 -1
  107. package/cjs/register/graphic.d.ts +19 -0
  108. package/cjs/register/graphic.js +177 -0
  109. package/cjs/register/graphic.js.map +1 -0
  110. package/cjs/registry/contribution-registry.d.ts +0 -1
  111. package/cjs/registry/contribution-registry.js +0 -3
  112. package/cjs/registry/contribution-registry.js.map +1 -1
  113. package/cjs/registry/picker-registry.d.ts +0 -1
  114. package/cjs/registry/picker-registry.js +0 -3
  115. package/cjs/registry/picker-registry.js.map +1 -1
  116. package/cjs/registry/renderer-registry.d.ts +0 -1
  117. package/cjs/registry/renderer-registry.js +0 -3
  118. package/cjs/registry/renderer-registry.js.map +1 -1
  119. package/cjs/registry/types.d.ts +0 -3
  120. package/cjs/registry/types.js.map +1 -1
  121. package/cjs/svg.d.ts +1 -0
  122. package/cjs/svg.js +15 -0
  123. package/cjs/svg.js.map +1 -0
  124. package/cjs/text.d.ts +2 -0
  125. package/cjs/text.js +29 -0
  126. package/cjs/text.js.map +1 -0
  127. package/dist/index.es.js +897 -2213
  128. package/es/common/event-listener-manager.js +1 -2
  129. package/es/common/event-transformer.js +2 -1
  130. package/es/common/performance-raf.js +1 -1
  131. package/es/common/xml/is-xml.d.ts +2 -0
  132. package/es/common/xml/is-xml.js +8 -0
  133. package/es/common/xml/is-xml.js.map +1 -0
  134. package/es/common/xml/parser.d.ts +2 -2
  135. package/es/common/xml/parser.js +3 -7
  136. package/es/common/xml/parser.js.map +1 -1
  137. package/es/container.d.ts +2 -0
  138. package/es/container.js +2 -0
  139. package/es/container.js.map +1 -0
  140. package/es/core/graphic-utils.js +1 -2
  141. package/es/core/layer-service.js +2 -1
  142. package/es/core/stage.d.ts +0 -9
  143. package/es/core/stage.js +9 -30
  144. package/es/core/stage.js.map +1 -1
  145. package/es/entries/miniapp.d.ts +0 -1
  146. package/es/entries/miniapp.js +1 -5
  147. package/es/entries/miniapp.js.map +1 -1
  148. package/es/entries/node.d.ts +0 -1
  149. package/es/entries/node.js +1 -5
  150. package/es/entries/node.js.map +1 -1
  151. package/es/env.d.ts +1 -0
  152. package/es/env.js +2 -0
  153. package/es/env.js.map +1 -0
  154. package/es/event/public-constant.d.ts +7 -0
  155. package/es/event/public-constant.js +12 -0
  156. package/es/event/public-constant.js.map +1 -0
  157. package/es/event/util.d.ts +1 -1
  158. package/es/graphic/base.d.ts +2 -0
  159. package/es/graphic/base.js +2 -0
  160. package/es/graphic/base.js.map +1 -0
  161. package/es/graphic/creator.d.ts +16 -0
  162. package/es/graphic/creator.js +32 -0
  163. package/es/graphic/creator.js.map +1 -0
  164. package/es/graphic/glyph.js +4 -8
  165. package/es/graphic/glyph.js.map +1 -1
  166. package/es/graphic/graphic-service/graphic-service.d.ts +0 -1
  167. package/es/graphic/graphic-service/graphic-service.js +0 -10
  168. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  169. package/es/graphic/graphic.d.ts +19 -29
  170. package/es/graphic/graphic.js +123 -207
  171. package/es/graphic/graphic.js.map +1 -1
  172. package/es/graphic/group.d.ts +1 -3
  173. package/es/graphic/group.js +22 -28
  174. package/es/graphic/group.js.map +1 -1
  175. package/es/graphic/modules.d.ts +16 -0
  176. package/es/graphic/modules.js +32 -0
  177. package/es/graphic/modules.js.map +1 -0
  178. package/es/graphic/node-tree.d.ts +3 -3
  179. package/es/graphic/node-tree.js +1 -0
  180. package/es/graphic/node-tree.js.map +1 -1
  181. package/es/graphic/state/shared-state-refresh.js +8 -28
  182. package/es/graphic/state/shared-state-refresh.js.map +1 -1
  183. package/es/graphic/state/shared-state-scope.d.ts +2 -5
  184. package/es/graphic/state/shared-state-scope.js +7 -28
  185. package/es/graphic/state/shared-state-scope.js.map +1 -1
  186. package/es/graphic/state/state-definition-compiler.js +4 -5
  187. package/es/graphic/state/state-definition-compiler.js.map +1 -1
  188. package/es/graphic/state/state-definition.d.ts +2 -5
  189. package/es/graphic/state/state-definition.js.map +1 -1
  190. package/es/graphic/state/state-engine.d.ts +0 -5
  191. package/es/graphic/state/state-engine.js +17 -67
  192. package/es/graphic/state/state-engine.js.map +1 -1
  193. package/es/graphic/state/state-transition-orchestrator.d.ts +7 -9
  194. package/es/graphic/state/state-transition-orchestrator.js +10 -13
  195. package/es/graphic/state/state-transition-orchestrator.js.map +1 -1
  196. package/es/graphic/tools.js +3 -3
  197. package/es/graphic/tools.js.map +1 -1
  198. package/es/index.js.map +1 -1
  199. package/es/interface/graphic/group.d.ts +0 -2
  200. package/es/interface/graphic/group.js.map +1 -1
  201. package/es/interface/graphic.d.ts +1 -5
  202. package/es/interface/graphic.js.map +1 -1
  203. package/es/interface/index.js.map +1 -1
  204. package/es/interface/node-tree.d.ts +3 -0
  205. package/es/interface/node-tree.js.map +1 -1
  206. package/es/interface/stage.d.ts +0 -7
  207. package/es/interface/stage.js.map +1 -1
  208. package/es/interpolate.d.ts +2 -0
  209. package/es/interpolate.js +4 -0
  210. package/es/interpolate.js.map +1 -0
  211. package/es/modules.js.map +1 -1
  212. package/es/path.d.ts +4 -0
  213. package/es/path.js +6 -0
  214. package/es/path.js.map +1 -0
  215. package/es/plugin/3d.d.ts +3 -0
  216. package/es/plugin/3d.js +6 -0
  217. package/es/plugin/3d.js.map +1 -0
  218. package/es/plugin/attribute.d.ts +2 -0
  219. package/es/plugin/attribute.js +4 -0
  220. package/es/plugin/attribute.js.map +1 -0
  221. package/es/plugin/flex-layout.d.ts +1 -0
  222. package/es/plugin/flex-layout.js +2 -0
  223. package/es/plugin/flex-layout.js.map +1 -0
  224. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  225. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  226. package/es/plugins/index.d.ts +0 -4
  227. package/es/plugins/index.js +0 -8
  228. package/es/plugins/index.js.map +1 -1
  229. package/es/plugins/plugin-service.d.ts +0 -1
  230. package/es/plugins/plugin-service.js +2 -3
  231. package/es/plugins/plugin-service.js.map +1 -1
  232. package/es/plugins/types.d.ts +1 -8
  233. package/es/plugins/types.js.map +1 -1
  234. package/es/register/graphic.d.ts +19 -0
  235. package/es/register/graphic.js +38 -0
  236. package/es/register/graphic.js.map +1 -0
  237. package/es/registry/contribution-registry.d.ts +0 -1
  238. package/es/registry/contribution-registry.js +0 -3
  239. package/es/registry/contribution-registry.js.map +1 -1
  240. package/es/registry/picker-registry.d.ts +0 -1
  241. package/es/registry/picker-registry.js +0 -3
  242. package/es/registry/picker-registry.js.map +1 -1
  243. package/es/registry/renderer-registry.d.ts +0 -1
  244. package/es/registry/renderer-registry.js +0 -3
  245. package/es/registry/renderer-registry.js.map +1 -1
  246. package/es/registry/types.d.ts +0 -3
  247. package/es/registry/types.js.map +1 -1
  248. package/es/svg.d.ts +1 -0
  249. package/es/svg.js +2 -0
  250. package/es/svg.js.map +1 -0
  251. package/es/text.d.ts +2 -0
  252. package/es/text.js +4 -0
  253. package/es/text.js.map +1 -0
  254. package/package.json +245 -1
  255. package/cjs/allocator/constants.d.ts +0 -9
  256. package/cjs/allocator/constants.js +0 -11
  257. package/cjs/allocator/constants.js.map +0 -1
  258. package/cjs/common/Reflect-metadata.d.ts +0 -2
  259. package/cjs/common/Reflect-metadata.js +0 -182
  260. package/cjs/common/Reflect-metadata.js.map +0 -1
  261. package/cjs/common/segment/curve/arc.d.ts +0 -17
  262. package/cjs/common/segment/curve/arc.js +0 -38
  263. package/cjs/common/segment/curve/arc.js.map +0 -1
  264. package/cjs/common/segment/curve/ellipse.d.ts +0 -21
  265. package/cjs/common/segment/curve/ellipse.js +0 -39
  266. package/cjs/common/segment/curve/ellipse.js.map +0 -1
  267. package/cjs/common/segment/curve/move.d.ts +0 -16
  268. package/cjs/common/segment/curve/move.js +0 -37
  269. package/cjs/common/segment/curve/move.js.map +0 -1
  270. package/cjs/common/store.d.ts +0 -2
  271. package/cjs/common/store.js +0 -2
  272. package/cjs/common/store.js.map +0 -1
  273. package/cjs/core/application.d.ts +0 -1
  274. package/cjs/core/application.js +0 -6
  275. package/cjs/core/application.js.map +0 -1
  276. package/cjs/core/global-module.d.ts +0 -1
  277. package/cjs/core/global-module.js +0 -1
  278. package/cjs/core/global-module.js.map +0 -1
  279. package/cjs/export.d.ts +0 -1
  280. package/cjs/export.js +0 -1
  281. package/cjs/export.js.map +0 -1
  282. package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
  283. package/cjs/graphic/state/state-batch-scheduler.js +0 -285
  284. package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
  285. package/cjs/graphic/state/state-model.d.ts +0 -43
  286. package/cjs/graphic/state/state-model.js +0 -143
  287. package/cjs/graphic/state/state-model.js.map +0 -1
  288. package/cjs/graphic/state/state-perf-monitor.d.ts +0 -120
  289. package/cjs/graphic/state/state-perf-monitor.js +0 -224
  290. package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
  291. package/cjs/graphic/state/state-style-resolver.d.ts +0 -13
  292. package/cjs/graphic/state/state-style-resolver.js +0 -50
  293. package/cjs/graphic/state/state-style-resolver.js.map +0 -1
  294. package/cjs/interface/animate.d.ts +0 -1
  295. package/cjs/interface/animate.js +0 -3
  296. package/cjs/interface/animate.js.map +0 -1
  297. package/cjs/interface/creator.d.ts +0 -4
  298. package/cjs/interface/creator.js +0 -6
  299. package/cjs/interface/creator.js.map +0 -1
  300. package/cjs/interface/graphic/dynamic-path.d.ts +0 -1
  301. package/cjs/interface/graphic/dynamic-path.js +0 -3
  302. package/cjs/interface/graphic/dynamic-path.js.map +0 -1
  303. package/cjs/interface/graphic-utils.d.ts +0 -1
  304. package/cjs/interface/graphic-utils.js +0 -3
  305. package/cjs/interface/graphic-utils.js.map +0 -1
  306. package/cjs/interface/theme-service.d.ts +0 -1
  307. package/cjs/interface/theme-service.js +0 -3
  308. package/cjs/interface/theme-service.js.map +0 -1
  309. package/cjs/plugins/base-plugin.d.ts +0 -8
  310. package/cjs/plugins/base-plugin.js +0 -15
  311. package/cjs/plugins/base-plugin.js.map +0 -1
  312. package/cjs/plugins/browser-env-plugin.d.ts +0 -8
  313. package/cjs/plugins/browser-env-plugin.js +0 -24
  314. package/cjs/plugins/browser-env-plugin.js.map +0 -1
  315. package/cjs/plugins/builtin-plugin/poptip-plugin.d.ts +0 -1
  316. package/cjs/plugins/builtin-plugin/poptip-plugin.js +0 -3
  317. package/cjs/plugins/builtin-plugin/poptip-plugin.js.map +0 -1
  318. package/cjs/plugins/picker-plugin.d.ts +0 -7
  319. package/cjs/plugins/picker-plugin.js +0 -19
  320. package/cjs/plugins/picker-plugin.js.map +0 -1
  321. package/cjs/plugins/renderer-plugin.d.ts +0 -7
  322. package/cjs/plugins/renderer-plugin.js +0 -19
  323. package/cjs/plugins/renderer-plugin.js.map +0 -1
  324. package/cjs/render/contributions/render/clear-screen.d.ts +0 -1
  325. package/cjs/render/contributions/render/clear-screen.js +0 -3
  326. package/cjs/render/contributions/render/clear-screen.js.map +0 -1
  327. package/cjs/render/contributions/render/render-slector.d.ts +0 -1
  328. package/cjs/render/contributions/render/render-slector.js +0 -3
  329. package/cjs/render/contributions/render/render-slector.js.map +0 -1
  330. package/es/allocator/constants.d.ts +0 -9
  331. package/es/allocator/constants.js +0 -18
  332. package/es/allocator/constants.js.map +0 -1
  333. package/es/common/Reflect-metadata.d.ts +0 -2
  334. package/es/common/Reflect-metadata.js +0 -178
  335. package/es/common/Reflect-metadata.js.map +0 -1
  336. package/es/common/segment/curve/arc.d.ts +0 -17
  337. package/es/common/segment/curve/arc.js +0 -31
  338. package/es/common/segment/curve/arc.js.map +0 -1
  339. package/es/common/segment/curve/ellipse.d.ts +0 -21
  340. package/es/common/segment/curve/ellipse.js +0 -33
  341. package/es/common/segment/curve/ellipse.js.map +0 -1
  342. package/es/common/segment/curve/move.d.ts +0 -16
  343. package/es/common/segment/curve/move.js +0 -31
  344. package/es/common/segment/curve/move.js.map +0 -1
  345. package/es/common/store.d.ts +0 -2
  346. package/es/common/store.js +0 -2
  347. package/es/common/store.js.map +0 -1
  348. package/es/core/application.d.ts +0 -1
  349. package/es/core/application.js +0 -2
  350. package/es/core/application.js.map +0 -1
  351. package/es/core/global-module.d.ts +0 -1
  352. package/es/core/global-module.js +0 -1
  353. package/es/core/global-module.js.map +0 -1
  354. package/es/export.d.ts +0 -1
  355. package/es/export.js +0 -1
  356. package/es/export.js.map +0 -1
  357. package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
  358. package/es/graphic/state/state-batch-scheduler.js +0 -278
  359. package/es/graphic/state/state-batch-scheduler.js.map +0 -1
  360. package/es/graphic/state/state-model.d.ts +0 -43
  361. package/es/graphic/state/state-model.js +0 -135
  362. package/es/graphic/state/state-model.js.map +0 -1
  363. package/es/graphic/state/state-perf-monitor.d.ts +0 -120
  364. package/es/graphic/state/state-perf-monitor.js +0 -214
  365. package/es/graphic/state/state-perf-monitor.js.map +0 -1
  366. package/es/graphic/state/state-style-resolver.d.ts +0 -13
  367. package/es/graphic/state/state-style-resolver.js +0 -42
  368. package/es/graphic/state/state-style-resolver.js.map +0 -1
  369. package/es/interface/animate.d.ts +0 -1
  370. package/es/interface/animate.js +0 -3
  371. package/es/interface/animate.js.map +0 -1
  372. package/es/interface/creator.d.ts +0 -4
  373. package/es/interface/creator.js +0 -2
  374. package/es/interface/creator.js.map +0 -1
  375. package/es/interface/graphic/dynamic-path.d.ts +0 -1
  376. package/es/interface/graphic/dynamic-path.js +0 -3
  377. package/es/interface/graphic/dynamic-path.js.map +0 -1
  378. package/es/interface/graphic-utils.d.ts +0 -1
  379. package/es/interface/graphic-utils.js +0 -3
  380. package/es/interface/graphic-utils.js.map +0 -1
  381. package/es/interface/theme-service.d.ts +0 -1
  382. package/es/interface/theme-service.js +0 -3
  383. package/es/interface/theme-service.js.map +0 -1
  384. package/es/plugins/base-plugin.d.ts +0 -8
  385. package/es/plugins/base-plugin.js +0 -7
  386. package/es/plugins/base-plugin.js.map +0 -1
  387. package/es/plugins/browser-env-plugin.d.ts +0 -8
  388. package/es/plugins/browser-env-plugin.js +0 -16
  389. package/es/plugins/browser-env-plugin.js.map +0 -1
  390. package/es/plugins/builtin-plugin/poptip-plugin.d.ts +0 -1
  391. package/es/plugins/builtin-plugin/poptip-plugin.js +0 -3
  392. package/es/plugins/builtin-plugin/poptip-plugin.js.map +0 -1
  393. package/es/plugins/picker-plugin.d.ts +0 -7
  394. package/es/plugins/picker-plugin.js +0 -11
  395. package/es/plugins/picker-plugin.js.map +0 -1
  396. package/es/plugins/renderer-plugin.d.ts +0 -7
  397. package/es/plugins/renderer-plugin.js +0 -11
  398. package/es/plugins/renderer-plugin.js.map +0 -1
  399. package/es/render/contributions/render/clear-screen.d.ts +0 -1
  400. package/es/render/contributions/render/clear-screen.js +0 -3
  401. package/es/render/contributions/render/clear-screen.js.map +0 -1
  402. package/es/render/contributions/render/render-slector.d.ts +0 -1
  403. package/es/render/contributions/render/render-slector.js +0 -3
  404. package/es/render/contributions/render/render-slector.js.map +0 -1
@@ -22,7 +22,7 @@ import { parsePadding } from "../common/utils";
22
22
 
23
23
  import { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from "./builtin-symbol";
24
24
 
25
- import { isSvg, XMLParser } from "../common/xml";
25
+ import { isSvg } from "../common/xml/is-xml";
26
26
 
27
27
  import { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from "./constants";
28
28
 
@@ -34,27 +34,21 @@ import { StateDefinitionCompiler } from "./state/state-definition-compiler";
34
34
 
35
35
  import { StateEngine } from "./state/state-engine";
36
36
 
37
- import { StateModel } from "./state/state-model";
38
-
39
37
  import { ATTRIBUTE_CATEGORY, UpdateCategory, classifyAttributeDelta } from "./state/attribute-update-classifier";
40
38
 
41
- import { StateStyleResolver } from "./state/state-style-resolver";
42
-
43
39
  import { StateTransitionOrchestrator } from "./state/state-transition-orchestrator";
44
40
 
45
41
  import { collectSharedStateScopeChain, ensureSharedStateScopeFresh } from "./state/shared-state-scope";
46
42
 
47
43
  import { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from "./state/shared-state-refresh";
48
44
 
49
- import { getActiveStageStatePerfMonitor } from "./state/state-perf-monitor";
50
-
51
- const _tempBounds = new AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new Matrix;
45
+ const _tempBounds = new AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), loadXMLParser = () => require("../common/xml/parser"), tempMatrix = new Matrix;
52
46
 
53
47
  export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
54
48
 
55
49
  export const GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
56
50
 
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" ]), FULL_STATE_DEFINITION_KEYS = new Set([ "name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys" ]), point = new Point, EMPTY_STATE_NAMES = [], deprecatedLocalStateFallbackWarningStateNames = new Set, BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT | UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.TRANSFORM | UpdateCategory.LAYOUT;
51
+ 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, EMPTY_STATE_NAMES = [], BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT | UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.TRANSFORM | UpdateCategory.LAYOUT;
58
52
 
59
53
  function isPlainObjectValue(value) {
60
54
  return "object" == typeof value && null != value && !Array.isArray(value);
@@ -174,12 +168,6 @@ export class Graphic extends Node {
174
168
  getAttributes() {
175
169
  return this.attribute;
176
170
  }
177
- getStateStyleResolver(mergeMode) {
178
- return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
179
- mergeMode: "deep"
180
- })), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver),
181
- this.stateStyleResolver);
182
- }
183
171
  getStateTransitionOrchestrator() {
184
172
  return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator),
185
173
  this.stateTransitionOrchestrator;
@@ -198,9 +186,8 @@ export class Graphic extends Node {
198
186
  const nextScope = this.resolveBoundSharedStateScope();
199
187
  return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
200
188
  !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
201
- this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0,
202
- this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
203
- this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(),
189
+ this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
190
+ this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(),
204
191
  markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
205
192
  !0);
206
193
  }
@@ -245,15 +232,8 @@ export class Graphic extends Node {
245
232
  getLocalStatesVersion() {
246
233
  var _a, _b;
247
234
  return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
248
- this.localFallbackVersion = (null !== (_a = this.localFallbackVersion) && void 0 !== _a ? _a : 0) + 1),
249
- null !== (_b = this.localFallbackVersion) && void 0 !== _b ? _b : 0;
250
- }
251
- warnDeprecatedLocalStatesFallback(stateNames) {
252
- for (let index = 0; index < stateNames.length; index++) {
253
- const stateName = stateNames[index];
254
- deprecatedLocalStateFallbackWarningStateNames.has(stateName) || (deprecatedLocalStateFallbackWarningStateNames.add(stateName),
255
- console.warn(`[VRender] graphic.states fallback for missing shared state definition "${stateName}" is deprecated. Move the state definition to sharedStateDefinitions or use stateProxy for dynamic per-graphic styles.`));
256
- }
235
+ this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1),
236
+ null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
257
237
  }
258
238
  resolveEffectiveCompiledDefinitions() {
259
239
  this.syncSharedStateScopeBindingFromTree(!1);
@@ -262,46 +242,23 @@ export class Graphic extends Node {
262
242
  const hasStates = !!this.states && Object.keys(this.states).length > 0;
263
243
  if (!boundScope) {
264
244
  if (!hasStates) return {
265
- compiledDefinitions: void 0,
266
- stateProxyModeKey: "none"
245
+ compiledDefinitions: void 0
267
246
  };
268
247
  const cacheKey = `local:${this.getLocalStatesVersion()}`;
269
248
  return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new StateDefinitionCompiler).compile(this.states),
270
249
  this.compiledStateDefinitionsCacheKey = cacheKey), {
271
- compiledDefinitions: this.compiledStateDefinitions,
272
- stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
250
+ compiledDefinitions: this.compiledStateDefinitions
273
251
  };
274
252
  }
275
- const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions, sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none", sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
276
- if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
277
- compiledDefinitions: sharedCompiledDefinitions,
278
- stateProxyModeKey: sharedStateProxyModeKey,
279
- stateProxyEligibility: sharedStateProxyEligibility
280
- };
281
- const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
282
- if (Object.keys(localStates).forEach((stateName => {
283
- sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
284
- missingStateNames.push(stateName));
285
- })), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
286
- {
287
- compiledDefinitions: sharedCompiledDefinitions,
288
- stateProxyModeKey: sharedStateProxyModeKey,
289
- stateProxyEligibility: sharedStateProxyEligibility
290
- };
291
- this.warnDeprecatedLocalStatesFallback(missingStateNames);
292
- const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
293
- return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
294
- this.compiledStateDefinitionsCacheKey = cacheKey), {
295
- compiledDefinitions: this.localFallbackCompiledDefinitions,
296
- stateProxyModeKey: stateProxyModeKey,
297
- stateProxyEligibility: sharedStateProxyEligibility
253
+ return {
254
+ compiledDefinitions: boundScope.effectiveCompiledDefinitions
298
255
  };
299
256
  }
300
257
  recomputeCurrentStatePatch() {
301
258
  var _a, _b;
302
259
  if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
303
260
  this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
304
- const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), transition = this.createStateModel(stateResolveBaseAttrs).useStates(this.currentStates), effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : 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);
261
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs), effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
305
262
  this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
306
263
  this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
307
264
  }
@@ -364,13 +321,8 @@ export class Graphic extends Node {
364
321
  category | nextCategory;
365
322
  }
366
323
  submitUpdateByCategory(category, forceUpdateTag = !1) {
367
- var _a;
368
324
  if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
369
325
  void this.addUpdateLayoutTag();
370
- if (category !== UpdateCategory.NONE) {
371
- const stage = this.stage;
372
- stage && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordCategory(category));
373
- }
374
326
  (category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
375
327
  category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
376
328
  category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
@@ -591,7 +543,7 @@ export class Graphic extends Node {
591
543
  if (path = Graphic.userSymbolMap[symbolType], path) return path;
592
544
  const _symbolType = builtInSymbolStrMap[symbolType];
593
545
  if (!0 === isSvg(symbolType = _symbolType || symbolType)) {
594
- const parser = new XMLParser, {svg: svg} = parser.parse(symbolType);
546
+ const {XMLParser: XMLParser} = require("../common/xml/parser"), parser = new XMLParser, {svg: svg} = parser.parse(symbolType);
595
547
  if (!svg) return null;
596
548
  const path = isArray(svg.path) ? svg.path : [ svg.path ];
597
549
  _tempBounds.clear();
@@ -902,95 +854,90 @@ export class Graphic extends Node {
902
854
  return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs),
903
855
  stateResolveBaseAttrs;
904
856
  }
905
- createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
906
- const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility, stateProxyModeKey: stateProxyModeKey} = this.resolveEffectiveCompiledDefinitions();
907
- 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({
857
+ ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
858
+ const {compiledDefinitions: compiledDefinitions} = this.resolveEffectiveCompiledDefinitions();
859
+ return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new StateEngine({
908
860
  compiledDefinitions: compiledDefinitions,
909
861
  stateSort: this.stateSort,
910
- stateProxy: this.stateProxy,
911
- stateProxyEligibility: stateProxyEligibility,
912
- states: this.states,
913
862
  mergeMode: this.stateMergeMode
914
- }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy,
915
- this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode,
916
- this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0,
917
- this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0),
918
- this.syncStateResolveContext(stateResolveBaseAttrs), new StateModel({
919
- states: this.states,
920
- currentStates: this.currentStates,
921
- stateSort: this.stateSort,
922
- stateProxy: this.stateProxy,
923
- stateEngine: this.stateEngine
924
- });
863
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort,
864
+ this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0),
865
+ this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates),
866
+ this.stateEngine;
925
867
  }
926
- resolveSimpleLocalStateTransition(states, previousStates) {
868
+ toGraphicStateTransition(result) {
869
+ return {
870
+ changed: result.changed,
871
+ states: [ ...result.activeStates ],
872
+ effectiveStates: [ ...result.effectiveStates ]
873
+ };
874
+ }
875
+ sortLocalStates(states) {
876
+ return this.stateSort ? [ ...states ].sort(this.stateSort) : [ ...states ];
877
+ }
878
+ resolveLocalUseStatesTransition(states) {
927
879
  var _a;
928
- if (!this.states || this.stateProxy || this.stateSort || "deep" === this.stateMergeMode || this.parent || (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope) || this.boundSharedStateScope) return null;
929
- if (1 === states.length) {
930
- const stateName = states[0], hasDefinition = Object.prototype.hasOwnProperty.call(this.states, stateName), nextStates = [ stateName ], changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
931
- if (hasDefinition) {
932
- const attrs = this.states[stateName];
933
- if (null != attrs) {
934
- if (!isPlainObjectValue(attrs)) return null;
935
- const keys = Object.keys(attrs);
936
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
937
- const key = keys[keyIndex];
938
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
939
- const attrValue = attrs[key];
940
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
941
- }
942
- }
943
- }
944
- return {
945
- changed: changed,
946
- states: nextStates,
947
- effectiveStates: nextStates,
948
- resolvedStateAttrs: resolvedStateAttrs
949
- };
950
- }
951
- const uniqueStates = Array.from(new Set(states)), withDefinition = [], withoutDefinition = [];
952
- for (let i = 0; i < uniqueStates.length; i++) {
953
- const stateName = uniqueStates[i];
954
- Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
955
- }
956
- withDefinition.sort(((left, right) => left.localeCompare(right)));
957
- const nextStates = withDefinition.concat(withoutDefinition), changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
958
- for (let i = 0; i < nextStates.length; i++) {
959
- const stateName = nextStates[i];
960
- if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
961
- const attrs = this.states[stateName];
962
- if (null == attrs) continue;
963
- if (!isPlainObjectValue(attrs)) return null;
964
- const keys = Object.keys(attrs);
965
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
966
- const key = keys[keyIndex];
967
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
968
- const attrValue = attrs[key];
969
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
970
- }
971
- }
880
+ if (!states.length) return this.resolveLocalClearStatesTransition();
881
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, changed = previousStates.length !== states.length || states.some(((stateName, index) => previousStates[index] !== stateName)), nextStates = this.sortLocalStates(states);
972
882
  return {
973
883
  changed: changed,
974
- states: nextStates,
975
- effectiveStates: nextStates,
976
- resolvedStateAttrs: resolvedStateAttrs
884
+ states: changed ? nextStates : [ ...previousStates ]
977
885
  };
978
886
  }
979
- resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
980
- var _a, _b;
981
- let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
982
- const isSimpleLocalTransition = !!transition;
983
- let resolvedStateAttrs;
984
- if (transition) resolvedStateAttrs = transition.resolvedStateAttrs; else {
985
- const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateModel = this.createStateModel(stateResolveBaseAttrs);
986
- forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.invalidateResolverCache()),
987
- transition = stateModel.useStates(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);
988
- }
887
+ resolveLocalClearStatesTransition() {
888
+ return {
889
+ changed: this.hasState(),
890
+ states: []
891
+ };
892
+ }
893
+ resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
894
+ const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
895
+ return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
896
+ }
897
+ resolveClearStatesTransition() {
898
+ const stateEngine = this.ensureStateEngine();
899
+ return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
900
+ }
901
+ resolveAddStateTransition(stateName, keepCurrentStates) {
902
+ var _a;
903
+ const stateEngine = this.ensureStateEngine();
904
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
905
+ if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
906
+ changed: !1,
907
+ states: [ ...this.currentStates ]
908
+ };
909
+ const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
910
+ return this.resolveLocalUseStatesTransition(nextStates);
911
+ }
912
+ resolveRemoveStateTransition(stateName) {
913
+ const stateEngine = this.ensureStateEngine();
914
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
915
+ if (!this.currentStates) return {
916
+ changed: !1,
917
+ states: []
918
+ };
919
+ const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName, nextStates = this.currentStates.filter(filter);
920
+ return nextStates.length === this.currentStates.length ? {
921
+ changed: !1,
922
+ states: [ ...this.currentStates ]
923
+ } : this.resolveLocalUseStatesTransition(nextStates);
924
+ }
925
+ resolveToggleStateTransition(stateName) {
926
+ const stateEngine = this.ensureStateEngine();
927
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
928
+ if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
929
+ const nextStates = this.currentStates ? this.currentStates.slice() : [];
930
+ return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
931
+ }
932
+ resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
933
+ var _a;
934
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
935
+ forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
936
+ const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
989
937
  return {
990
938
  transition: transition,
991
- effectiveStates: null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
992
- resolvedStateAttrs: resolvedStateAttrs,
993
- isSimpleLocalTransition: isSimpleLocalTransition
939
+ effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
940
+ resolvedStateAttrs: resolvedStateAttrs
994
941
  };
995
942
  }
996
943
  normalizeSetStatesOptions(options) {
@@ -1014,26 +961,16 @@ export class Graphic extends Node {
1014
961
  }
1015
962
  commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
1016
963
  var _a;
1017
- const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs, isSimpleLocalTransition: isSimpleLocalTransition} = this.resolveGraphicStateTransition(states, previousStates, !0), patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
1018
- if ((!patchChanged || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) && (this.currentStates = transition.states,
1019
- this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [ ...effectiveStates ],
1020
- this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(),
1021
- patchChanged)) {
1022
- if (this.stage) {
1023
- const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
1024
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1025
- graphicId: this._uid,
1026
- targetStates: [ ...transition.states ]
1027
- });
1028
- }
1029
- hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
1030
- this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1031
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1032
- type: AttributeUpdateType.STATE
1033
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
1034
- type: AttributeUpdateType.STATE
1035
- }), this.emitStateUpdateEvent());
1036
- }
964
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states, !0), patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
965
+ patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states,
966
+ this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
967
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
968
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
969
+ this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
970
+ type: AttributeUpdateType.STATE
971
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
972
+ type: AttributeUpdateType.STATE
973
+ }), this.emitStateUpdateEvent())));
1037
974
  }
1038
975
  resolveStateAnimateConfig(animateConfig) {
1039
976
  var _a, _b, _c;
@@ -1045,8 +982,8 @@ export class Graphic extends Node {
1045
982
  extraAnimateAttrs: extraAnimateAttrs,
1046
983
  shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
1047
984
  } : void 0;
1048
- if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
1049
- const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
985
+ if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
986
+ const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
1050
987
  noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
1051
988
  animateConfig: resolvedAnimateConfig,
1052
989
  extraAnimateAttrs: extraAnimateAttrs,
@@ -1070,45 +1007,33 @@ export class Graphic extends Node {
1070
1007
  animate.stateNames && stateAnimates.push(animate);
1071
1008
  })), stateAnimates.forEach((animate => animate.stop(type)));
1072
1009
  }
1073
- getNormalAttribute(key) {
1074
- var _a, _b;
1075
- const value = this.attribute[key];
1076
- 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];
1077
- }
1078
1010
  clearStates(hasAnimation) {
1079
1011
  var _a, _b, _c;
1080
- const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.createStateModel().clearStates();
1012
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.resolveClearStatesTransition();
1081
1013
  if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
1082
1014
  this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
1083
1015
  void this.clearSharedStateActiveRegistrations();
1084
1016
  const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
1085
- if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) {
1086
- if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0,
1087
- this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), this.stage) {
1088
- const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
1089
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1090
- graphicId: this._uid,
1091
- targetStates: []
1092
- });
1093
- }
1094
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1095
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1096
- type: AttributeUpdateType.STATE
1097
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
1098
- type: AttributeUpdateType.STATE
1099
- }), this.emitStateUpdateEvent());
1100
- }
1017
+ transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
1018
+ this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
1019
+ this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
1020
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1021
+ this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1022
+ type: AttributeUpdateType.STATE
1023
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
1024
+ type: AttributeUpdateType.STATE
1025
+ }), this.emitStateUpdateEvent()));
1101
1026
  }
1102
1027
  removeState(stateName, hasAnimation) {
1103
- const transition = this.createStateModel().removeState(stateName);
1028
+ const transition = this.resolveRemoveStateTransition(stateName);
1104
1029
  transition.changed && this.useStates(transition.states, hasAnimation);
1105
1030
  }
1106
1031
  toggleState(stateName, hasAnimation) {
1107
- const transition = this.createStateModel().toggleState(stateName);
1032
+ const transition = this.resolveToggleStateTransition(stateName);
1108
1033
  transition.changed && this.useStates(transition.states, hasAnimation);
1109
1034
  }
1110
1035
  addState(stateName, keepCurrentStates, hasAnimation) {
1111
- const transition = this.createStateModel().addState(stateName, keepCurrentStates);
1036
+ const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
1112
1037
  transition.changed && this.useStates(transition.states, hasAnimation);
1113
1038
  }
1114
1039
  setStates(states, options) {
@@ -1125,24 +1050,16 @@ export class Graphic extends Node {
1125
1050
  useStates(states, hasAnimation) {
1126
1051
  var _a;
1127
1052
  if (!states.length) return void this.clearStates(hasAnimation);
1128
- const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs, isSimpleLocalTransition: isSimpleLocalTransition} = this.resolveGraphicStateTransition(states, previousStates);
1129
- if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
1130
- if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [ ...effectiveStates ],
1131
- this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(),
1132
- this.stage) {
1133
- const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
1134
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1135
- graphicId: this._uid,
1136
- targetStates: [ ...transition.states ]
1137
- });
1138
- }
1139
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1140
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1141
- type: AttributeUpdateType.STATE
1142
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
1143
- type: AttributeUpdateType.STATE
1144
- }), this.emitStateUpdateEvent());
1145
- }
1053
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states);
1054
+ !transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
1055
+ this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
1056
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
1057
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1058
+ this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1059
+ type: AttributeUpdateType.STATE
1060
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
1061
+ type: AttributeUpdateType.STATE
1062
+ }), this.emitStateUpdateEvent()));
1146
1063
  }
1147
1064
  invalidateResolver() {
1148
1065
  var _a, _b;
@@ -1280,9 +1197,8 @@ export class Graphic extends Node {
1280
1197
  var _a, _b, _c;
1281
1198
  (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
1282
1199
  (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0,
1283
- this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0,
1284
- this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
1285
- this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0,
1200
+ this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0,
1201
+ this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
1286
1202
  this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
1287
1203
  }
1288
1204
  setStageToShadowRoot(stage, layer) {