@visactor/vrender-core 1.1.0-alpha.23 → 1.1.0-alpha.25

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 (402) hide show
  1. package/cjs/allocator/bounds-allocate.js +1 -2
  2. package/cjs/canvas/constants.js +2 -1
  3. package/cjs/common/bezier-utils.js +1 -2
  4. package/cjs/common/event-transformer.js +2 -1
  5. package/cjs/common/module-guard.d.ts +1 -0
  6. package/cjs/common/module-guard.js +11 -0
  7. package/cjs/common/module-guard.js.map +1 -0
  8. package/cjs/common/performance-raf.js +1 -2
  9. package/cjs/common/rect-utils.js +1 -1
  10. package/cjs/common/render-area.js +1 -1
  11. package/cjs/common/render-command-list.js +1 -1
  12. package/cjs/common/render-curve.js +1 -1
  13. package/cjs/common/render-utils.js +1 -1
  14. package/cjs/common/seg-context.js +1 -1
  15. package/cjs/container.d.ts +2 -0
  16. package/cjs/container.js +50 -0
  17. package/cjs/container.js.map +1 -0
  18. package/cjs/core/application.js +1 -1
  19. package/cjs/core/camera.js +1 -1
  20. package/cjs/core/constants.js +1 -1
  21. package/cjs/core/core-modules.js +1 -1
  22. package/cjs/core/global-module.js +2 -0
  23. package/cjs/core/global.js +1 -1
  24. package/cjs/core/graphic-utils.js +1 -1
  25. package/cjs/core/index.js +1 -1
  26. package/cjs/core/layer-service.js +2 -1
  27. package/cjs/core/layer.js +1 -1
  28. package/cjs/core/light.js +1 -1
  29. package/cjs/core/stage.d.ts +0 -9
  30. package/cjs/core/stage.js +12 -30
  31. package/cjs/core/stage.js.map +1 -1
  32. package/cjs/core/window.js +1 -1
  33. package/cjs/entries/miniapp.d.ts +0 -1
  34. package/cjs/entries/miniapp.js +1 -5
  35. package/cjs/entries/miniapp.js.map +1 -1
  36. package/cjs/entries/node.d.ts +0 -1
  37. package/cjs/entries/node.js +1 -5
  38. package/cjs/entries/node.js.map +1 -1
  39. package/cjs/env.d.ts +1 -0
  40. package/cjs/env.js +25 -0
  41. package/cjs/env.js.map +1 -0
  42. package/cjs/event/public-constant.d.ts +7 -0
  43. package/cjs/event/public-constant.js +100 -0
  44. package/cjs/event/public-constant.js.map +1 -0
  45. package/cjs/event/util.d.ts +1 -1
  46. package/cjs/graphic/arc.js +6 -4
  47. package/cjs/graphic/arc.js.map +1 -1
  48. package/cjs/graphic/base.d.ts +2 -0
  49. package/cjs/graphic/base.js +15 -0
  50. package/cjs/graphic/base.js.map +1 -0
  51. package/cjs/graphic/config.js +1 -0
  52. package/cjs/graphic/config.js.map +1 -1
  53. package/cjs/graphic/creator.d.ts +16 -0
  54. package/cjs/graphic/creator.js +160 -0
  55. package/cjs/graphic/creator.js.map +1 -0
  56. package/cjs/graphic/glyph.js +4 -8
  57. package/cjs/graphic/glyph.js.map +1 -1
  58. package/cjs/graphic/graphic.d.ts +19 -28
  59. package/cjs/graphic/graphic.js +122 -193
  60. package/cjs/graphic/graphic.js.map +1 -1
  61. package/cjs/graphic/group.d.ts +1 -3
  62. package/cjs/graphic/group.js +22 -28
  63. package/cjs/graphic/group.js.map +1 -1
  64. package/cjs/graphic/modules.d.ts +16 -0
  65. package/cjs/graphic/modules.js +150 -0
  66. package/cjs/graphic/modules.js.map +1 -0
  67. package/cjs/graphic/node-tree.d.ts +3 -3
  68. package/cjs/graphic/node-tree.js +1 -0
  69. package/cjs/graphic/node-tree.js.map +1 -1
  70. package/cjs/graphic/state/shared-state-refresh.js +11 -32
  71. package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
  72. package/cjs/graphic/state/shared-state-scope.d.ts +2 -5
  73. package/cjs/graphic/state/shared-state-scope.js +8 -27
  74. package/cjs/graphic/state/shared-state-scope.js.map +1 -1
  75. package/cjs/graphic/state/state-definition-compiler.js +4 -5
  76. package/cjs/graphic/state/state-definition-compiler.js.map +1 -1
  77. package/cjs/graphic/state/state-definition.d.ts +2 -5
  78. package/cjs/graphic/state/state-definition.js.map +1 -1
  79. package/cjs/graphic/state/state-engine.d.ts +0 -5
  80. package/cjs/graphic/state/state-engine.js +20 -70
  81. package/cjs/graphic/state/state-engine.js.map +1 -1
  82. package/cjs/graphic/state/state-transition-orchestrator.d.ts +7 -9
  83. package/cjs/graphic/state/state-transition-orchestrator.js +10 -13
  84. package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -1
  85. package/cjs/interface/graphic/arc.d.ts +1 -0
  86. package/cjs/interface/graphic/arc.js.map +1 -1
  87. package/cjs/interface/graphic/group.d.ts +0 -2
  88. package/cjs/interface/graphic/group.js.map +1 -1
  89. package/cjs/interface/graphic.d.ts +1 -5
  90. package/cjs/interface/graphic.js.map +1 -1
  91. package/cjs/interface/index.js.map +1 -1
  92. package/cjs/interface/node-tree.d.ts +3 -0
  93. package/cjs/interface/node-tree.js.map +1 -1
  94. package/cjs/interface/stage.d.ts +0 -7
  95. package/cjs/interface/stage.js.map +1 -1
  96. package/cjs/interpolate.d.ts +2 -0
  97. package/cjs/interpolate.js +34 -0
  98. package/cjs/interpolate.js.map +1 -0
  99. package/cjs/modules.js.map +1 -1
  100. package/cjs/path.d.ts +4 -0
  101. package/cjs/path.js +33 -0
  102. package/cjs/path.js.map +1 -0
  103. package/cjs/plugin/3d.d.ts +3 -0
  104. package/cjs/plugin/3d.js +33 -0
  105. package/cjs/plugin/3d.js.map +1 -0
  106. package/cjs/plugin/attribute.d.ts +2 -0
  107. package/cjs/plugin/attribute.js +24 -0
  108. package/cjs/plugin/attribute.js.map +1 -0
  109. package/cjs/plugin/flex-layout.d.ts +1 -0
  110. package/cjs/plugin/flex-layout.js +15 -0
  111. package/cjs/plugin/flex-layout.js.map +1 -0
  112. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  113. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  114. package/cjs/plugins/index.d.ts +0 -4
  115. package/cjs/plugins/index.js +1 -3
  116. package/cjs/plugins/index.js.map +1 -1
  117. package/cjs/plugins/plugin-service.d.ts +0 -1
  118. package/cjs/plugins/plugin-service.js +2 -3
  119. package/cjs/plugins/plugin-service.js.map +1 -1
  120. package/cjs/plugins/types.d.ts +1 -8
  121. package/cjs/plugins/types.js.map +1 -1
  122. package/cjs/register/graphic.d.ts +19 -0
  123. package/cjs/register/graphic.js +177 -0
  124. package/cjs/register/graphic.js.map +1 -0
  125. package/cjs/registry/contribution-registry.d.ts +0 -1
  126. package/cjs/registry/contribution-registry.js +0 -3
  127. package/cjs/registry/contribution-registry.js.map +1 -1
  128. package/cjs/registry/picker-registry.d.ts +0 -1
  129. package/cjs/registry/picker-registry.js +0 -3
  130. package/cjs/registry/picker-registry.js.map +1 -1
  131. package/cjs/registry/renderer-registry.d.ts +0 -1
  132. package/cjs/registry/renderer-registry.js +0 -3
  133. package/cjs/registry/renderer-registry.js.map +1 -1
  134. package/cjs/registry/types.d.ts +0 -3
  135. package/cjs/registry/types.js.map +1 -1
  136. package/cjs/render/contributions/render/arc-module.js +2 -4
  137. package/cjs/render/contributions/render/arc-module.js.map +1 -1
  138. package/cjs/render/contributions/render/arc3d-module.js +2 -4
  139. package/cjs/render/contributions/render/arc3d-module.js.map +1 -1
  140. package/cjs/render/contributions/render/area-module.js +2 -4
  141. package/cjs/render/contributions/render/area-module.js.map +1 -1
  142. package/cjs/render/contributions/render/circle-module.js +2 -4
  143. package/cjs/render/contributions/render/circle-module.js.map +1 -1
  144. package/cjs/render/contributions/render/glyph-module.js +2 -4
  145. package/cjs/render/contributions/render/glyph-module.js.map +1 -1
  146. package/cjs/render/contributions/render/image-module.js +2 -4
  147. package/cjs/render/contributions/render/image-module.js.map +1 -1
  148. package/cjs/render/contributions/render/line-module.js +2 -4
  149. package/cjs/render/contributions/render/line-module.js.map +1 -1
  150. package/cjs/render/contributions/render/path-module.js +2 -4
  151. package/cjs/render/contributions/render/path-module.js.map +1 -1
  152. package/cjs/render/contributions/render/polygon-module.js +2 -4
  153. package/cjs/render/contributions/render/polygon-module.js.map +1 -1
  154. package/cjs/render/contributions/render/pyramid3d-module.js +2 -4
  155. package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -1
  156. package/cjs/render/contributions/render/rect-module.js +2 -4
  157. package/cjs/render/contributions/render/rect-module.js.map +1 -1
  158. package/cjs/render/contributions/render/rect3d-module.js +2 -4
  159. package/cjs/render/contributions/render/rect3d-module.js.map +1 -1
  160. package/cjs/render/contributions/render/richtext-module.js +2 -4
  161. package/cjs/render/contributions/render/richtext-module.js.map +1 -1
  162. package/cjs/render/contributions/render/star-module.js +2 -4
  163. package/cjs/render/contributions/render/star-module.js.map +1 -1
  164. package/cjs/render/contributions/render/symbol-module.js +2 -4
  165. package/cjs/render/contributions/render/symbol-module.js.map +1 -1
  166. package/cjs/render/contributions/render/text-module.js +2 -4
  167. package/cjs/render/contributions/render/text-module.js.map +1 -1
  168. package/cjs/svg.d.ts +1 -0
  169. package/cjs/svg.js +15 -0
  170. package/cjs/svg.js.map +1 -0
  171. package/cjs/text.d.ts +2 -0
  172. package/cjs/text.js +29 -0
  173. package/cjs/text.js.map +1 -0
  174. package/dist/index.es.js +328 -1630
  175. package/es/allocator/bounds-allocate.js +1 -2
  176. package/es/canvas/constants.js +2 -1
  177. package/es/common/bezier-utils.js +1 -2
  178. package/es/common/event-transformer.js +2 -1
  179. package/es/common/module-guard.d.ts +1 -0
  180. package/es/common/module-guard.js +5 -0
  181. package/es/common/module-guard.js.map +1 -0
  182. package/es/common/performance-raf.js +1 -2
  183. package/es/common/rect-utils.js +1 -1
  184. package/es/common/render-area.js +1 -1
  185. package/es/common/render-command-list.js +1 -1
  186. package/es/common/render-curve.js +1 -1
  187. package/es/common/render-utils.js +1 -1
  188. package/es/common/seg-context.js +1 -1
  189. package/es/container.d.ts +2 -0
  190. package/es/container.js +2 -0
  191. package/es/container.js.map +1 -0
  192. package/es/core/application.js +1 -1
  193. package/es/core/camera.js +1 -1
  194. package/es/core/constants.js +1 -1
  195. package/es/core/core-modules.js +1 -1
  196. package/es/core/global-module.js +2 -0
  197. package/es/core/global.js +1 -1
  198. package/es/core/graphic-utils.js +1 -1
  199. package/es/core/index.js +1 -1
  200. package/es/core/layer-service.js +2 -1
  201. package/es/core/layer.js +1 -1
  202. package/es/core/light.js +1 -1
  203. package/es/core/stage.d.ts +0 -9
  204. package/es/core/stage.js +10 -31
  205. package/es/core/stage.js.map +1 -1
  206. package/es/core/window.js +1 -1
  207. package/es/entries/miniapp.d.ts +0 -1
  208. package/es/entries/miniapp.js +1 -5
  209. package/es/entries/miniapp.js.map +1 -1
  210. package/es/entries/node.d.ts +0 -1
  211. package/es/entries/node.js +1 -5
  212. package/es/entries/node.js.map +1 -1
  213. package/es/env.d.ts +1 -0
  214. package/es/env.js +2 -0
  215. package/es/env.js.map +1 -0
  216. package/es/event/public-constant.d.ts +7 -0
  217. package/es/event/public-constant.js +12 -0
  218. package/es/event/public-constant.js.map +1 -0
  219. package/es/event/util.d.ts +1 -1
  220. package/es/graphic/arc.js +5 -4
  221. package/es/graphic/arc.js.map +1 -1
  222. package/es/graphic/base.d.ts +2 -0
  223. package/es/graphic/base.js +2 -0
  224. package/es/graphic/base.js.map +1 -0
  225. package/es/graphic/config.js +1 -0
  226. package/es/graphic/config.js.map +1 -1
  227. package/es/graphic/creator.d.ts +16 -0
  228. package/es/graphic/creator.js +32 -0
  229. package/es/graphic/creator.js.map +1 -0
  230. package/es/graphic/glyph.js +4 -8
  231. package/es/graphic/glyph.js.map +1 -1
  232. package/es/graphic/graphic.d.ts +19 -28
  233. package/es/graphic/graphic.js +121 -198
  234. package/es/graphic/graphic.js.map +1 -1
  235. package/es/graphic/group.d.ts +1 -3
  236. package/es/graphic/group.js +22 -28
  237. package/es/graphic/group.js.map +1 -1
  238. package/es/graphic/modules.d.ts +16 -0
  239. package/es/graphic/modules.js +32 -0
  240. package/es/graphic/modules.js.map +1 -0
  241. package/es/graphic/node-tree.d.ts +3 -3
  242. package/es/graphic/node-tree.js +1 -0
  243. package/es/graphic/node-tree.js.map +1 -1
  244. package/es/graphic/state/shared-state-refresh.js +8 -28
  245. package/es/graphic/state/shared-state-refresh.js.map +1 -1
  246. package/es/graphic/state/shared-state-scope.d.ts +2 -5
  247. package/es/graphic/state/shared-state-scope.js +7 -28
  248. package/es/graphic/state/shared-state-scope.js.map +1 -1
  249. package/es/graphic/state/state-definition-compiler.js +4 -5
  250. package/es/graphic/state/state-definition-compiler.js.map +1 -1
  251. package/es/graphic/state/state-definition.d.ts +2 -5
  252. package/es/graphic/state/state-definition.js.map +1 -1
  253. package/es/graphic/state/state-engine.d.ts +0 -5
  254. package/es/graphic/state/state-engine.js +17 -67
  255. package/es/graphic/state/state-engine.js.map +1 -1
  256. package/es/graphic/state/state-transition-orchestrator.d.ts +7 -9
  257. package/es/graphic/state/state-transition-orchestrator.js +10 -13
  258. package/es/graphic/state/state-transition-orchestrator.js.map +1 -1
  259. package/es/interface/graphic/arc.d.ts +1 -0
  260. package/es/interface/graphic/arc.js.map +1 -1
  261. package/es/interface/graphic/group.d.ts +0 -2
  262. package/es/interface/graphic/group.js.map +1 -1
  263. package/es/interface/graphic.d.ts +1 -5
  264. package/es/interface/graphic.js.map +1 -1
  265. package/es/interface/index.js.map +1 -1
  266. package/es/interface/node-tree.d.ts +3 -0
  267. package/es/interface/node-tree.js.map +1 -1
  268. package/es/interface/stage.d.ts +0 -7
  269. package/es/interface/stage.js.map +1 -1
  270. package/es/interpolate.d.ts +2 -0
  271. package/es/interpolate.js +4 -0
  272. package/es/interpolate.js.map +1 -0
  273. package/es/modules.js.map +1 -1
  274. package/es/path.d.ts +4 -0
  275. package/es/path.js +6 -0
  276. package/es/path.js.map +1 -0
  277. package/es/plugin/3d.d.ts +3 -0
  278. package/es/plugin/3d.js +6 -0
  279. package/es/plugin/3d.js.map +1 -0
  280. package/es/plugin/attribute.d.ts +2 -0
  281. package/es/plugin/attribute.js +4 -0
  282. package/es/plugin/attribute.js.map +1 -0
  283. package/es/plugin/flex-layout.d.ts +1 -0
  284. package/es/plugin/flex-layout.js +2 -0
  285. package/es/plugin/flex-layout.js.map +1 -0
  286. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  287. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  288. package/es/plugins/index.d.ts +0 -4
  289. package/es/plugins/index.js +0 -8
  290. package/es/plugins/index.js.map +1 -1
  291. package/es/plugins/plugin-service.d.ts +0 -1
  292. package/es/plugins/plugin-service.js +2 -3
  293. package/es/plugins/plugin-service.js.map +1 -1
  294. package/es/plugins/types.d.ts +1 -8
  295. package/es/plugins/types.js.map +1 -1
  296. package/es/register/graphic.d.ts +19 -0
  297. package/es/register/graphic.js +38 -0
  298. package/es/register/graphic.js.map +1 -0
  299. package/es/registry/contribution-registry.d.ts +0 -1
  300. package/es/registry/contribution-registry.js +0 -3
  301. package/es/registry/contribution-registry.js.map +1 -1
  302. package/es/registry/picker-registry.d.ts +0 -1
  303. package/es/registry/picker-registry.js +0 -3
  304. package/es/registry/picker-registry.js.map +1 -1
  305. package/es/registry/renderer-registry.d.ts +0 -1
  306. package/es/registry/renderer-registry.js +0 -3
  307. package/es/registry/renderer-registry.js.map +1 -1
  308. package/es/registry/types.d.ts +0 -3
  309. package/es/registry/types.js.map +1 -1
  310. package/es/render/contributions/render/arc-module.js +4 -2
  311. package/es/render/contributions/render/arc-module.js.map +1 -1
  312. package/es/render/contributions/render/arc3d-module.js +4 -2
  313. package/es/render/contributions/render/arc3d-module.js.map +1 -1
  314. package/es/render/contributions/render/area-module.js +4 -2
  315. package/es/render/contributions/render/area-module.js.map +1 -1
  316. package/es/render/contributions/render/circle-module.js +4 -2
  317. package/es/render/contributions/render/circle-module.js.map +1 -1
  318. package/es/render/contributions/render/glyph-module.js +4 -2
  319. package/es/render/contributions/render/glyph-module.js.map +1 -1
  320. package/es/render/contributions/render/image-module.js +4 -2
  321. package/es/render/contributions/render/image-module.js.map +1 -1
  322. package/es/render/contributions/render/line-module.js +4 -2
  323. package/es/render/contributions/render/line-module.js.map +1 -1
  324. package/es/render/contributions/render/path-module.js +4 -2
  325. package/es/render/contributions/render/path-module.js.map +1 -1
  326. package/es/render/contributions/render/polygon-module.js +4 -2
  327. package/es/render/contributions/render/polygon-module.js.map +1 -1
  328. package/es/render/contributions/render/pyramid3d-module.js +4 -2
  329. package/es/render/contributions/render/pyramid3d-module.js.map +1 -1
  330. package/es/render/contributions/render/rect-module.js +4 -2
  331. package/es/render/contributions/render/rect-module.js.map +1 -1
  332. package/es/render/contributions/render/rect3d-module.js +4 -2
  333. package/es/render/contributions/render/rect3d-module.js.map +1 -1
  334. package/es/render/contributions/render/richtext-module.js +4 -2
  335. package/es/render/contributions/render/richtext-module.js.map +1 -1
  336. package/es/render/contributions/render/star-module.js +4 -2
  337. package/es/render/contributions/render/star-module.js.map +1 -1
  338. package/es/render/contributions/render/symbol-module.js +4 -2
  339. package/es/render/contributions/render/symbol-module.js.map +1 -1
  340. package/es/render/contributions/render/text-module.js +4 -2
  341. package/es/render/contributions/render/text-module.js.map +1 -1
  342. package/es/svg.d.ts +1 -0
  343. package/es/svg.js +2 -0
  344. package/es/svg.js.map +1 -0
  345. package/es/text.d.ts +2 -0
  346. package/es/text.js +4 -0
  347. package/es/text.js.map +1 -0
  348. package/package.json +245 -1
  349. package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
  350. package/cjs/graphic/state/state-batch-scheduler.js +0 -285
  351. package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
  352. package/cjs/graphic/state/state-model.d.ts +0 -43
  353. package/cjs/graphic/state/state-model.js +0 -143
  354. package/cjs/graphic/state/state-model.js.map +0 -1
  355. package/cjs/graphic/state/state-perf-monitor.d.ts +0 -120
  356. package/cjs/graphic/state/state-perf-monitor.js +0 -224
  357. package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
  358. package/cjs/graphic/state/state-style-resolver.d.ts +0 -13
  359. package/cjs/graphic/state/state-style-resolver.js +0 -50
  360. package/cjs/graphic/state/state-style-resolver.js.map +0 -1
  361. package/cjs/interface/animate.d.ts +0 -1
  362. package/cjs/interface/animate.js +0 -3
  363. package/cjs/interface/animate.js.map +0 -1
  364. package/cjs/plugins/base-plugin.d.ts +0 -8
  365. package/cjs/plugins/base-plugin.js +0 -15
  366. package/cjs/plugins/base-plugin.js.map +0 -1
  367. package/cjs/plugins/browser-env-plugin.d.ts +0 -8
  368. package/cjs/plugins/browser-env-plugin.js +0 -24
  369. package/cjs/plugins/browser-env-plugin.js.map +0 -1
  370. package/cjs/plugins/picker-plugin.d.ts +0 -7
  371. package/cjs/plugins/picker-plugin.js +0 -19
  372. package/cjs/plugins/picker-plugin.js.map +0 -1
  373. package/cjs/plugins/renderer-plugin.d.ts +0 -7
  374. package/cjs/plugins/renderer-plugin.js +0 -19
  375. package/cjs/plugins/renderer-plugin.js.map +0 -1
  376. package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
  377. package/es/graphic/state/state-batch-scheduler.js +0 -278
  378. package/es/graphic/state/state-batch-scheduler.js.map +0 -1
  379. package/es/graphic/state/state-model.d.ts +0 -43
  380. package/es/graphic/state/state-model.js +0 -135
  381. package/es/graphic/state/state-model.js.map +0 -1
  382. package/es/graphic/state/state-perf-monitor.d.ts +0 -120
  383. package/es/graphic/state/state-perf-monitor.js +0 -214
  384. package/es/graphic/state/state-perf-monitor.js.map +0 -1
  385. package/es/graphic/state/state-style-resolver.d.ts +0 -13
  386. package/es/graphic/state/state-style-resolver.js +0 -42
  387. package/es/graphic/state/state-style-resolver.js.map +0 -1
  388. package/es/interface/animate.d.ts +0 -1
  389. package/es/interface/animate.js +0 -3
  390. package/es/interface/animate.js.map +0 -1
  391. package/es/plugins/base-plugin.d.ts +0 -8
  392. package/es/plugins/base-plugin.js +0 -7
  393. package/es/plugins/base-plugin.js.map +0 -1
  394. package/es/plugins/browser-env-plugin.d.ts +0 -8
  395. package/es/plugins/browser-env-plugin.js +0 -16
  396. package/es/plugins/browser-env-plugin.js.map +0 -1
  397. package/es/plugins/picker-plugin.d.ts +0 -7
  398. package/es/plugins/picker-plugin.js +0 -11
  399. package/es/plugins/picker-plugin.js.map +0 -1
  400. package/es/plugins/renderer-plugin.d.ts +0 -7
  401. package/es/plugins/renderer-plugin.js +0 -11
  402. package/es/plugins/renderer-plugin.js.map +0 -1
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), state_definition_compiler_1 = require("./state/state-definition-compiler"), state_engine_1 = require("./state/state-engine"), state_model_1 = require("./state/state-model"), attribute_update_classifier_1 = require("./state/attribute-update-classifier"), state_style_resolver_1 = require("./state/state-style-resolver"), state_transition_orchestrator_1 = require("./state/state-transition-orchestrator"), shared_state_scope_1 = require("./state/shared-state-scope"), shared_state_refresh_1 = require("./state/shared-state-refresh"), state_perf_monitor_1 = require("./state/state-perf-monitor"), _tempBounds = new vutils_1.AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new vutils_1.Matrix;
7
+ const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), state_definition_compiler_1 = require("./state/state-definition-compiler"), state_engine_1 = require("./state/state-engine"), attribute_update_classifier_1 = require("./state/attribute-update-classifier"), state_transition_orchestrator_1 = require("./state/state-transition-orchestrator"), shared_state_scope_1 = require("./state/shared-state-scope"), shared_state_refresh_1 = require("./state/shared-state-refresh"), _tempBounds = new vutils_1.AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new vutils_1.Matrix;
8
8
 
9
9
  exports.PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ],
10
10
  exports.GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
11
11
 
12
- const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], 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 vutils_1.Point, EMPTY_STATE_NAMES = [], BROAD_UPDATE_CATEGORY = attribute_update_classifier_1.UpdateCategory.PAINT | attribute_update_classifier_1.UpdateCategory.SHAPE | attribute_update_classifier_1.UpdateCategory.BOUNDS | attribute_update_classifier_1.UpdateCategory.TRANSFORM | attribute_update_classifier_1.UpdateCategory.LAYOUT;
12
+ const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]), point = new vutils_1.Point, EMPTY_STATE_NAMES = [], BROAD_UPDATE_CATEGORY = attribute_update_classifier_1.UpdateCategory.PAINT | attribute_update_classifier_1.UpdateCategory.SHAPE | attribute_update_classifier_1.UpdateCategory.BOUNDS | attribute_update_classifier_1.UpdateCategory.TRANSFORM | attribute_update_classifier_1.UpdateCategory.LAYOUT;
13
13
 
14
14
  function isPlainObjectValue(value) {
15
15
  return "object" == typeof value && null != value && !Array.isArray(value);
@@ -131,12 +131,6 @@ class Graphic extends node_tree_1.Node {
131
131
  getAttributes() {
132
132
  return this.attribute;
133
133
  }
134
- getStateStyleResolver(mergeMode) {
135
- return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new state_style_resolver_1.StateStyleResolver({
136
- mergeMode: "deep"
137
- })), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new state_style_resolver_1.StateStyleResolver),
138
- this.stateStyleResolver);
139
- }
140
134
  getStateTransitionOrchestrator() {
141
135
  return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new state_transition_orchestrator_1.StateTransitionOrchestrator),
142
136
  this.stateTransitionOrchestrator;
@@ -155,9 +149,8 @@ class Graphic extends node_tree_1.Node {
155
149
  const nextScope = this.resolveBoundSharedStateScope();
156
150
  return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
157
151
  !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
158
- this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0,
159
- this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
160
- this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(),
152
+ this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
153
+ this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(),
161
154
  markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
162
155
  !0);
163
156
  }
@@ -202,8 +195,8 @@ class Graphic extends node_tree_1.Node {
202
195
  getLocalStatesVersion() {
203
196
  var _a, _b;
204
197
  return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
205
- this.localFallbackVersion = (null !== (_a = this.localFallbackVersion) && void 0 !== _a ? _a : 0) + 1),
206
- null !== (_b = this.localFallbackVersion) && void 0 !== _b ? _b : 0;
198
+ this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1),
199
+ null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
207
200
  }
208
201
  resolveEffectiveCompiledDefinitions() {
209
202
  this.syncSharedStateScopeBindingFromTree(!1);
@@ -213,45 +206,23 @@ class Graphic extends node_tree_1.Node {
213
206
  const hasStates = !!this.states && Object.keys(this.states).length > 0;
214
207
  if (!boundScope) {
215
208
  if (!hasStates) return {
216
- compiledDefinitions: void 0,
217
- stateProxyModeKey: "none"
209
+ compiledDefinitions: void 0
218
210
  };
219
211
  const cacheKey = `local:${this.getLocalStatesVersion()}`;
220
212
  return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new state_definition_compiler_1.StateDefinitionCompiler).compile(this.states),
221
213
  this.compiledStateDefinitionsCacheKey = cacheKey), {
222
- compiledDefinitions: this.compiledStateDefinitions,
223
- stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
214
+ compiledDefinitions: this.compiledStateDefinitions
224
215
  };
225
216
  }
226
- const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions, sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none", sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
227
- if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
228
- compiledDefinitions: sharedCompiledDefinitions,
229
- stateProxyModeKey: sharedStateProxyModeKey,
230
- stateProxyEligibility: sharedStateProxyEligibility
231
- };
232
- const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
233
- if (Object.keys(localStates).forEach((stateName => {
234
- sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
235
- missingStateNames.push(stateName));
236
- })), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
237
- {
238
- compiledDefinitions: sharedCompiledDefinitions,
239
- stateProxyModeKey: sharedStateProxyModeKey,
240
- stateProxyEligibility: sharedStateProxyEligibility
241
- };
242
- const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
243
- return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new state_definition_compiler_1.StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
244
- this.compiledStateDefinitionsCacheKey = cacheKey), {
245
- compiledDefinitions: this.localFallbackCompiledDefinitions,
246
- stateProxyModeKey: stateProxyModeKey,
247
- stateProxyEligibility: sharedStateProxyEligibility
217
+ return {
218
+ compiledDefinitions: boundScope.effectiveCompiledDefinitions
248
219
  };
249
220
  }
250
221
  recomputeCurrentStatePatch() {
251
222
  var _a, _b;
252
223
  if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
253
224
  this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
254
- 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);
225
+ 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) : {};
255
226
  this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
256
227
  this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
257
228
  }
@@ -314,13 +285,8 @@ class Graphic extends node_tree_1.Node {
314
285
  category | nextCategory;
315
286
  }
316
287
  submitUpdateByCategory(category, forceUpdateTag = !1) {
317
- var _a;
318
288
  if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
319
289
  void this.addUpdateLayoutTag();
320
- if (category !== attribute_update_classifier_1.UpdateCategory.NONE) {
321
- const stage = this.stage;
322
- stage && (null === (_a = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(stage)) || void 0 === _a || _a.recordCategory(category));
323
- }
324
290
  (category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & attribute_update_classifier_1.UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & attribute_update_classifier_1.UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
325
291
  category & attribute_update_classifier_1.UpdateCategory.PAINT && this.addUpdatePaintTag(),
326
292
  category & attribute_update_classifier_1.UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
@@ -858,95 +824,90 @@ class Graphic extends node_tree_1.Node {
858
824
  return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs),
859
825
  stateResolveBaseAttrs;
860
826
  }
861
- createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
862
- const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility, stateProxyModeKey: stateProxyModeKey} = this.resolveEffectiveCompiledDefinitions();
863
- return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateProxy === this.stateProxy && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode && this.stateEngineStateProxyModeKey === stateProxyModeKey || (this.stateEngine = new state_engine_1.StateEngine({
827
+ ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
828
+ const {compiledDefinitions: compiledDefinitions} = this.resolveEffectiveCompiledDefinitions();
829
+ return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new state_engine_1.StateEngine({
864
830
  compiledDefinitions: compiledDefinitions,
865
831
  stateSort: this.stateSort,
866
- stateProxy: this.stateProxy,
867
- stateProxyEligibility: stateProxyEligibility,
868
- states: this.states,
869
832
  mergeMode: this.stateMergeMode
870
- }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy,
871
- this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode,
872
- this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0,
873
- this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0),
874
- this.syncStateResolveContext(stateResolveBaseAttrs), new state_model_1.StateModel({
875
- states: this.states,
876
- currentStates: this.currentStates,
877
- stateSort: this.stateSort,
878
- stateProxy: this.stateProxy,
879
- stateEngine: this.stateEngine
880
- });
833
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort,
834
+ this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0),
835
+ this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates),
836
+ this.stateEngine;
837
+ }
838
+ toGraphicStateTransition(result) {
839
+ return {
840
+ changed: result.changed,
841
+ states: [ ...result.activeStates ],
842
+ effectiveStates: [ ...result.effectiveStates ]
843
+ };
881
844
  }
882
- resolveSimpleLocalStateTransition(states, previousStates) {
845
+ sortLocalStates(states) {
846
+ return this.stateSort ? [ ...states ].sort(this.stateSort) : [ ...states ];
847
+ }
848
+ resolveLocalUseStatesTransition(states) {
883
849
  var _a;
884
- 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;
885
- if (1 === states.length) {
886
- const stateName = states[0], hasDefinition = Object.prototype.hasOwnProperty.call(this.states, stateName), nextStates = [ stateName ], changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
887
- if (hasDefinition) {
888
- const attrs = this.states[stateName];
889
- if (null != attrs) {
890
- if (!isPlainObjectValue(attrs)) return null;
891
- const keys = Object.keys(attrs);
892
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
893
- const key = keys[keyIndex];
894
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
895
- const attrValue = attrs[key];
896
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
897
- }
898
- }
899
- }
900
- return {
901
- changed: changed,
902
- states: nextStates,
903
- effectiveStates: nextStates,
904
- resolvedStateAttrs: resolvedStateAttrs
905
- };
906
- }
907
- const uniqueStates = Array.from(new Set(states)), withDefinition = [], withoutDefinition = [];
908
- for (let i = 0; i < uniqueStates.length; i++) {
909
- const stateName = uniqueStates[i];
910
- Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
911
- }
912
- withDefinition.sort(((left, right) => left.localeCompare(right)));
913
- const nextStates = withDefinition.concat(withoutDefinition), changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
914
- for (let i = 0; i < nextStates.length; i++) {
915
- const stateName = nextStates[i];
916
- if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
917
- const attrs = this.states[stateName];
918
- if (null == attrs) continue;
919
- if (!isPlainObjectValue(attrs)) return null;
920
- const keys = Object.keys(attrs);
921
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
922
- const key = keys[keyIndex];
923
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
924
- const attrValue = attrs[key];
925
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
926
- }
927
- }
850
+ if (!states.length) return this.resolveLocalClearStatesTransition();
851
+ 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);
928
852
  return {
929
853
  changed: changed,
930
- states: nextStates,
931
- effectiveStates: nextStates,
932
- resolvedStateAttrs: resolvedStateAttrs
854
+ states: changed ? nextStates : [ ...previousStates ]
933
855
  };
934
856
  }
935
- resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
936
- var _a, _b;
937
- let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
938
- const isSimpleLocalTransition = !!transition;
939
- let resolvedStateAttrs;
940
- if (transition) resolvedStateAttrs = transition.resolvedStateAttrs; else {
941
- const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateModel = this.createStateModel(stateResolveBaseAttrs);
942
- forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.invalidateResolverCache()),
943
- 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);
944
- }
857
+ resolveLocalClearStatesTransition() {
858
+ return {
859
+ changed: this.hasState(),
860
+ states: []
861
+ };
862
+ }
863
+ resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
864
+ const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
865
+ return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
866
+ }
867
+ resolveClearStatesTransition() {
868
+ const stateEngine = this.ensureStateEngine();
869
+ return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
870
+ }
871
+ resolveAddStateTransition(stateName, keepCurrentStates) {
872
+ var _a;
873
+ const stateEngine = this.ensureStateEngine();
874
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
875
+ if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
876
+ changed: !1,
877
+ states: [ ...this.currentStates ]
878
+ };
879
+ const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
880
+ return this.resolveLocalUseStatesTransition(nextStates);
881
+ }
882
+ resolveRemoveStateTransition(stateName) {
883
+ const stateEngine = this.ensureStateEngine();
884
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
885
+ if (!this.currentStates) return {
886
+ changed: !1,
887
+ states: []
888
+ };
889
+ const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName, nextStates = this.currentStates.filter(filter);
890
+ return nextStates.length === this.currentStates.length ? {
891
+ changed: !1,
892
+ states: [ ...this.currentStates ]
893
+ } : this.resolveLocalUseStatesTransition(nextStates);
894
+ }
895
+ resolveToggleStateTransition(stateName) {
896
+ const stateEngine = this.ensureStateEngine();
897
+ if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
898
+ if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
899
+ const nextStates = this.currentStates ? this.currentStates.slice() : [];
900
+ return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
901
+ }
902
+ resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
903
+ var _a;
904
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
905
+ forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
906
+ const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
945
907
  return {
946
908
  transition: transition,
947
- effectiveStates: null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
948
- resolvedStateAttrs: resolvedStateAttrs,
949
- isSimpleLocalTransition: isSimpleLocalTransition
909
+ effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
910
+ resolvedStateAttrs: resolvedStateAttrs
950
911
  };
951
912
  }
952
913
  normalizeSetStatesOptions(options) {
@@ -970,26 +931,16 @@ class Graphic extends node_tree_1.Node {
970
931
  }
971
932
  commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
972
933
  var _a;
973
- 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);
974
- if ((!patchChanged || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) && (this.currentStates = transition.states,
975
- this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [ ...effectiveStates ],
976
- this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(),
977
- patchChanged)) {
978
- if (this.stage) {
979
- const perfMonitor = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(this.stage);
980
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
981
- graphicId: this._uid,
982
- targetStates: [ ...transition.states ]
983
- });
984
- }
985
- hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
986
- this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
987
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
988
- type: enums_1.AttributeUpdateType.STATE
989
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
990
- type: enums_1.AttributeUpdateType.STATE
991
- }), this.emitStateUpdateEvent());
992
- }
934
+ 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);
935
+ patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states,
936
+ this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
937
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
938
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
939
+ this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
940
+ type: enums_1.AttributeUpdateType.STATE
941
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
942
+ type: enums_1.AttributeUpdateType.STATE
943
+ }), this.emitStateUpdateEvent())));
993
944
  }
994
945
  resolveStateAnimateConfig(animateConfig) {
995
946
  var _a, _b, _c;
@@ -1001,8 +952,8 @@ class Graphic extends node_tree_1.Node {
1001
952
  extraAnimateAttrs: extraAnimateAttrs,
1002
953
  shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
1003
954
  } : void 0;
1004
- if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
1005
- const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
955
+ if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
956
+ const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
1006
957
  noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
1007
958
  animateConfig: resolvedAnimateConfig,
1008
959
  extraAnimateAttrs: extraAnimateAttrs,
@@ -1026,45 +977,33 @@ class Graphic extends node_tree_1.Node {
1026
977
  animate.stateNames && stateAnimates.push(animate);
1027
978
  })), stateAnimates.forEach((animate => animate.stop(type)));
1028
979
  }
1029
- getNormalAttribute(key) {
1030
- var _a, _b;
1031
- const value = this.attribute[key];
1032
- 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];
1033
- }
1034
980
  clearStates(hasAnimation) {
1035
981
  var _a, _b, _c;
1036
- const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.createStateModel().clearStates();
982
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.resolveClearStatesTransition();
1037
983
  if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
1038
984
  this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
1039
985
  void this.clearSharedStateActiveRegistrations();
1040
986
  const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
1041
- if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) {
1042
- if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0,
1043
- this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), this.stage) {
1044
- const perfMonitor = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(this.stage);
1045
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1046
- graphicId: this._uid,
1047
- targetStates: []
1048
- });
1049
- }
1050
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1051
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1052
- type: enums_1.AttributeUpdateType.STATE
1053
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
1054
- type: enums_1.AttributeUpdateType.STATE
1055
- }), this.emitStateUpdateEvent());
1056
- }
987
+ transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
988
+ this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
989
+ this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
990
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
991
+ this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
992
+ type: enums_1.AttributeUpdateType.STATE
993
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
994
+ type: enums_1.AttributeUpdateType.STATE
995
+ }), this.emitStateUpdateEvent()));
1057
996
  }
1058
997
  removeState(stateName, hasAnimation) {
1059
- const transition = this.createStateModel().removeState(stateName);
998
+ const transition = this.resolveRemoveStateTransition(stateName);
1060
999
  transition.changed && this.useStates(transition.states, hasAnimation);
1061
1000
  }
1062
1001
  toggleState(stateName, hasAnimation) {
1063
- const transition = this.createStateModel().toggleState(stateName);
1002
+ const transition = this.resolveToggleStateTransition(stateName);
1064
1003
  transition.changed && this.useStates(transition.states, hasAnimation);
1065
1004
  }
1066
1005
  addState(stateName, keepCurrentStates, hasAnimation) {
1067
- const transition = this.createStateModel().addState(stateName, keepCurrentStates);
1006
+ const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
1068
1007
  transition.changed && this.useStates(transition.states, hasAnimation);
1069
1008
  }
1070
1009
  setStates(states, options) {
@@ -1081,30 +1020,21 @@ class Graphic extends node_tree_1.Node {
1081
1020
  useStates(states, hasAnimation) {
1082
1021
  var _a;
1083
1022
  if (!states.length) return void this.clearStates(hasAnimation);
1084
- 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);
1085
- if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
1086
- if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [ ...effectiveStates ],
1087
- this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(),
1088
- this.stage) {
1089
- const perfMonitor = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(this.stage);
1090
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1091
- graphicId: this._uid,
1092
- targetStates: [ ...transition.states ]
1093
- });
1094
- }
1095
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1096
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1097
- type: enums_1.AttributeUpdateType.STATE
1098
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
1099
- type: enums_1.AttributeUpdateType.STATE
1100
- }), this.emitStateUpdateEvent());
1101
- }
1023
+ 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);
1024
+ !transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
1025
+ this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
1026
+ this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
1027
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1028
+ this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1029
+ type: enums_1.AttributeUpdateType.STATE
1030
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
1031
+ type: enums_1.AttributeUpdateType.STATE
1032
+ }), this.emitStateUpdateEvent()));
1102
1033
  }
1103
1034
  invalidateResolver() {
1104
1035
  var _a, _b;
1105
1036
  if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
1106
- this.syncStateResolveContext();
1107
- this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
1037
+ this.syncStateResolveContext(), this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
1108
1038
  this.stateEngine.invalidateResolverCache();
1109
1039
  const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
1110
1040
  this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
@@ -1238,9 +1168,8 @@ class Graphic extends node_tree_1.Node {
1238
1168
  var _a, _b, _c;
1239
1169
  (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
1240
1170
  (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0,
1241
- this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0,
1242
- this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
1243
- this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0,
1171
+ this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0,
1172
+ this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
1244
1173
  this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
1245
1174
  }
1246
1175
  setStageToShadowRoot(stage, layer) {