@visactor/vrender-core 1.1.0-alpha.24 → 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 (322) 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/performance-raf.js +1 -2
  6. package/cjs/common/polygon.js +2 -2
  7. package/cjs/common/rect-utils.js +1 -1
  8. package/cjs/common/render-area.js +1 -1
  9. package/cjs/common/render-command-list.js +1 -1
  10. package/cjs/common/render-curve.js +1 -1
  11. package/cjs/common/render-utils.js +1 -1
  12. package/cjs/common/seg-context.js +1 -1
  13. package/cjs/container.d.ts +2 -0
  14. package/cjs/container.js +50 -0
  15. package/cjs/container.js.map +1 -0
  16. package/cjs/core/application.js +1 -1
  17. package/cjs/core/camera.js +1 -1
  18. package/cjs/core/constants.js +1 -1
  19. package/cjs/core/core-modules.js +1 -1
  20. package/cjs/core/global-module.js +2 -0
  21. package/cjs/core/global.js +1 -1
  22. package/cjs/core/graphic-utils.js +1 -1
  23. package/cjs/core/index.js +1 -1
  24. package/cjs/core/layer-service.js +2 -1
  25. package/cjs/core/layer.js +1 -1
  26. package/cjs/core/light.js +1 -1
  27. package/cjs/core/stage.d.ts +0 -9
  28. package/cjs/core/stage.js +12 -30
  29. package/cjs/core/stage.js.map +1 -1
  30. package/cjs/core/window.js +1 -1
  31. package/cjs/entries/miniapp.d.ts +0 -1
  32. package/cjs/entries/miniapp.js +1 -5
  33. package/cjs/entries/miniapp.js.map +1 -1
  34. package/cjs/entries/node.d.ts +0 -1
  35. package/cjs/entries/node.js +1 -5
  36. package/cjs/entries/node.js.map +1 -1
  37. package/cjs/env.d.ts +1 -0
  38. package/cjs/env.js +25 -0
  39. package/cjs/env.js.map +1 -0
  40. package/cjs/event/public-constant.d.ts +7 -0
  41. package/cjs/event/public-constant.js +100 -0
  42. package/cjs/event/public-constant.js.map +1 -0
  43. package/cjs/event/util.d.ts +1 -1
  44. package/cjs/graphic/base.d.ts +2 -0
  45. package/cjs/graphic/base.js +15 -0
  46. package/cjs/graphic/base.js.map +1 -0
  47. package/cjs/graphic/creator.d.ts +16 -0
  48. package/cjs/graphic/creator.js +160 -0
  49. package/cjs/graphic/creator.js.map +1 -0
  50. package/cjs/graphic/glyph.js +4 -8
  51. package/cjs/graphic/glyph.js.map +1 -1
  52. package/cjs/graphic/graphic.d.ts +19 -29
  53. package/cjs/graphic/graphic.js +121 -199
  54. package/cjs/graphic/graphic.js.map +1 -1
  55. package/cjs/graphic/group.d.ts +1 -3
  56. package/cjs/graphic/group.js +22 -28
  57. package/cjs/graphic/group.js.map +1 -1
  58. package/cjs/graphic/modules.d.ts +16 -0
  59. package/cjs/graphic/modules.js +150 -0
  60. package/cjs/graphic/modules.js.map +1 -0
  61. package/cjs/graphic/node-tree.d.ts +3 -3
  62. package/cjs/graphic/node-tree.js +1 -0
  63. package/cjs/graphic/node-tree.js.map +1 -1
  64. package/cjs/graphic/state/shared-state-refresh.js +11 -32
  65. package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
  66. package/cjs/graphic/state/shared-state-scope.d.ts +2 -5
  67. package/cjs/graphic/state/shared-state-scope.js +8 -27
  68. package/cjs/graphic/state/shared-state-scope.js.map +1 -1
  69. package/cjs/graphic/state/state-definition-compiler.js +4 -5
  70. package/cjs/graphic/state/state-definition-compiler.js.map +1 -1
  71. package/cjs/graphic/state/state-definition.d.ts +2 -5
  72. package/cjs/graphic/state/state-definition.js.map +1 -1
  73. package/cjs/graphic/state/state-engine.d.ts +0 -5
  74. package/cjs/graphic/state/state-engine.js +20 -70
  75. package/cjs/graphic/state/state-engine.js.map +1 -1
  76. package/cjs/graphic/state/state-transition-orchestrator.d.ts +7 -9
  77. package/cjs/graphic/state/state-transition-orchestrator.js +10 -13
  78. package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -1
  79. package/cjs/interface/graphic/group.d.ts +0 -2
  80. package/cjs/interface/graphic/group.js.map +1 -1
  81. package/cjs/interface/graphic.d.ts +1 -5
  82. package/cjs/interface/graphic.js.map +1 -1
  83. package/cjs/interface/index.js.map +1 -1
  84. package/cjs/interface/node-tree.d.ts +3 -0
  85. package/cjs/interface/node-tree.js.map +1 -1
  86. package/cjs/interface/stage.d.ts +0 -7
  87. package/cjs/interface/stage.js.map +1 -1
  88. package/cjs/interpolate.d.ts +2 -0
  89. package/cjs/interpolate.js +34 -0
  90. package/cjs/interpolate.js.map +1 -0
  91. package/cjs/modules.js.map +1 -1
  92. package/cjs/path.d.ts +4 -0
  93. package/cjs/path.js +33 -0
  94. package/cjs/path.js.map +1 -0
  95. package/cjs/plugin/3d.d.ts +3 -0
  96. package/cjs/plugin/3d.js +33 -0
  97. package/cjs/plugin/3d.js.map +1 -0
  98. package/cjs/plugin/attribute.d.ts +2 -0
  99. package/cjs/plugin/attribute.js +24 -0
  100. package/cjs/plugin/attribute.js.map +1 -0
  101. package/cjs/plugin/flex-layout.d.ts +1 -0
  102. package/cjs/plugin/flex-layout.js +15 -0
  103. package/cjs/plugin/flex-layout.js.map +1 -0
  104. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  105. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  106. package/cjs/plugins/index.d.ts +0 -4
  107. package/cjs/plugins/index.js +1 -3
  108. package/cjs/plugins/index.js.map +1 -1
  109. package/cjs/plugins/plugin-service.d.ts +0 -1
  110. package/cjs/plugins/plugin-service.js +2 -3
  111. package/cjs/plugins/plugin-service.js.map +1 -1
  112. package/cjs/plugins/types.d.ts +1 -8
  113. package/cjs/plugins/types.js.map +1 -1
  114. package/cjs/register/graphic.d.ts +19 -0
  115. package/cjs/register/graphic.js +177 -0
  116. package/cjs/register/graphic.js.map +1 -0
  117. package/cjs/registry/contribution-registry.d.ts +0 -1
  118. package/cjs/registry/contribution-registry.js +0 -3
  119. package/cjs/registry/contribution-registry.js.map +1 -1
  120. package/cjs/registry/picker-registry.d.ts +0 -1
  121. package/cjs/registry/picker-registry.js +0 -3
  122. package/cjs/registry/picker-registry.js.map +1 -1
  123. package/cjs/registry/renderer-registry.d.ts +0 -1
  124. package/cjs/registry/renderer-registry.js +0 -3
  125. package/cjs/registry/renderer-registry.js.map +1 -1
  126. package/cjs/registry/types.d.ts +0 -3
  127. package/cjs/registry/types.js.map +1 -1
  128. package/cjs/svg.d.ts +1 -0
  129. package/cjs/svg.js +15 -0
  130. package/cjs/svg.js.map +1 -0
  131. package/cjs/text.d.ts +2 -0
  132. package/cjs/text.js +29 -0
  133. package/cjs/text.js.map +1 -0
  134. package/dist/index.es.js +279 -1591
  135. package/es/allocator/bounds-allocate.js +1 -2
  136. package/es/canvas/constants.js +2 -1
  137. package/es/common/bezier-utils.js +1 -2
  138. package/es/common/event-transformer.js +2 -1
  139. package/es/common/performance-raf.js +1 -2
  140. package/es/common/polygon.js +1 -1
  141. package/es/common/rect-utils.js +1 -1
  142. package/es/common/render-area.js +1 -1
  143. package/es/common/render-command-list.js +1 -1
  144. package/es/common/render-curve.js +1 -1
  145. package/es/common/render-utils.js +1 -1
  146. package/es/common/seg-context.js +1 -1
  147. package/es/container.d.ts +2 -0
  148. package/es/container.js +2 -0
  149. package/es/container.js.map +1 -0
  150. package/es/core/application.js +1 -1
  151. package/es/core/camera.js +1 -1
  152. package/es/core/constants.js +1 -1
  153. package/es/core/core-modules.js +1 -1
  154. package/es/core/global-module.js +2 -0
  155. package/es/core/global.js +1 -1
  156. package/es/core/graphic-utils.js +1 -1
  157. package/es/core/index.js +1 -1
  158. package/es/core/layer-service.js +2 -1
  159. package/es/core/layer.js +1 -1
  160. package/es/core/light.js +1 -1
  161. package/es/core/stage.d.ts +0 -9
  162. package/es/core/stage.js +10 -31
  163. package/es/core/stage.js.map +1 -1
  164. package/es/core/window.js +1 -1
  165. package/es/entries/miniapp.d.ts +0 -1
  166. package/es/entries/miniapp.js +1 -5
  167. package/es/entries/miniapp.js.map +1 -1
  168. package/es/entries/node.d.ts +0 -1
  169. package/es/entries/node.js +1 -5
  170. package/es/entries/node.js.map +1 -1
  171. package/es/env.d.ts +1 -0
  172. package/es/env.js +2 -0
  173. package/es/env.js.map +1 -0
  174. package/es/event/public-constant.d.ts +7 -0
  175. package/es/event/public-constant.js +12 -0
  176. package/es/event/public-constant.js.map +1 -0
  177. package/es/event/util.d.ts +1 -1
  178. package/es/graphic/base.d.ts +2 -0
  179. package/es/graphic/base.js +2 -0
  180. package/es/graphic/base.js.map +1 -0
  181. package/es/graphic/creator.d.ts +16 -0
  182. package/es/graphic/creator.js +32 -0
  183. package/es/graphic/creator.js.map +1 -0
  184. package/es/graphic/glyph.js +4 -8
  185. package/es/graphic/glyph.js.map +1 -1
  186. package/es/graphic/graphic.d.ts +19 -29
  187. package/es/graphic/graphic.js +120 -204
  188. package/es/graphic/graphic.js.map +1 -1
  189. package/es/graphic/group.d.ts +1 -3
  190. package/es/graphic/group.js +22 -28
  191. package/es/graphic/group.js.map +1 -1
  192. package/es/graphic/modules.d.ts +16 -0
  193. package/es/graphic/modules.js +32 -0
  194. package/es/graphic/modules.js.map +1 -0
  195. package/es/graphic/node-tree.d.ts +3 -3
  196. package/es/graphic/node-tree.js +1 -0
  197. package/es/graphic/node-tree.js.map +1 -1
  198. package/es/graphic/state/shared-state-refresh.js +8 -28
  199. package/es/graphic/state/shared-state-refresh.js.map +1 -1
  200. package/es/graphic/state/shared-state-scope.d.ts +2 -5
  201. package/es/graphic/state/shared-state-scope.js +7 -28
  202. package/es/graphic/state/shared-state-scope.js.map +1 -1
  203. package/es/graphic/state/state-definition-compiler.js +4 -5
  204. package/es/graphic/state/state-definition-compiler.js.map +1 -1
  205. package/es/graphic/state/state-definition.d.ts +2 -5
  206. package/es/graphic/state/state-definition.js.map +1 -1
  207. package/es/graphic/state/state-engine.d.ts +0 -5
  208. package/es/graphic/state/state-engine.js +17 -67
  209. package/es/graphic/state/state-engine.js.map +1 -1
  210. package/es/graphic/state/state-transition-orchestrator.d.ts +7 -9
  211. package/es/graphic/state/state-transition-orchestrator.js +10 -13
  212. package/es/graphic/state/state-transition-orchestrator.js.map +1 -1
  213. package/es/interface/graphic/group.d.ts +0 -2
  214. package/es/interface/graphic/group.js.map +1 -1
  215. package/es/interface/graphic.d.ts +1 -5
  216. package/es/interface/graphic.js.map +1 -1
  217. package/es/interface/index.js.map +1 -1
  218. package/es/interface/node-tree.d.ts +3 -0
  219. package/es/interface/node-tree.js.map +1 -1
  220. package/es/interface/stage.d.ts +0 -7
  221. package/es/interface/stage.js.map +1 -1
  222. package/es/interpolate.d.ts +2 -0
  223. package/es/interpolate.js +4 -0
  224. package/es/interpolate.js.map +1 -0
  225. package/es/modules.js.map +1 -1
  226. package/es/path.d.ts +4 -0
  227. package/es/path.js +6 -0
  228. package/es/path.js.map +1 -0
  229. package/es/plugin/3d.d.ts +3 -0
  230. package/es/plugin/3d.js +6 -0
  231. package/es/plugin/3d.js.map +1 -0
  232. package/es/plugin/attribute.d.ts +2 -0
  233. package/es/plugin/attribute.js +4 -0
  234. package/es/plugin/attribute.js.map +1 -0
  235. package/es/plugin/flex-layout.d.ts +1 -0
  236. package/es/plugin/flex-layout.js +2 -0
  237. package/es/plugin/flex-layout.js.map +1 -0
  238. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  239. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  240. package/es/plugins/index.d.ts +0 -4
  241. package/es/plugins/index.js +0 -8
  242. package/es/plugins/index.js.map +1 -1
  243. package/es/plugins/plugin-service.d.ts +0 -1
  244. package/es/plugins/plugin-service.js +2 -3
  245. package/es/plugins/plugin-service.js.map +1 -1
  246. package/es/plugins/types.d.ts +1 -8
  247. package/es/plugins/types.js.map +1 -1
  248. package/es/register/graphic.d.ts +19 -0
  249. package/es/register/graphic.js +38 -0
  250. package/es/register/graphic.js.map +1 -0
  251. package/es/registry/contribution-registry.d.ts +0 -1
  252. package/es/registry/contribution-registry.js +0 -3
  253. package/es/registry/contribution-registry.js.map +1 -1
  254. package/es/registry/picker-registry.d.ts +0 -1
  255. package/es/registry/picker-registry.js +0 -3
  256. package/es/registry/picker-registry.js.map +1 -1
  257. package/es/registry/renderer-registry.d.ts +0 -1
  258. package/es/registry/renderer-registry.js +0 -3
  259. package/es/registry/renderer-registry.js.map +1 -1
  260. package/es/registry/types.d.ts +0 -3
  261. package/es/registry/types.js.map +1 -1
  262. package/es/svg.d.ts +1 -0
  263. package/es/svg.js +2 -0
  264. package/es/svg.js.map +1 -0
  265. package/es/text.d.ts +2 -0
  266. package/es/text.js +4 -0
  267. package/es/text.js.map +1 -0
  268. package/package.json +247 -3
  269. package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
  270. package/cjs/graphic/state/state-batch-scheduler.js +0 -285
  271. package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
  272. package/cjs/graphic/state/state-model.d.ts +0 -43
  273. package/cjs/graphic/state/state-model.js +0 -143
  274. package/cjs/graphic/state/state-model.js.map +0 -1
  275. package/cjs/graphic/state/state-perf-monitor.d.ts +0 -120
  276. package/cjs/graphic/state/state-perf-monitor.js +0 -224
  277. package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
  278. package/cjs/graphic/state/state-style-resolver.d.ts +0 -13
  279. package/cjs/graphic/state/state-style-resolver.js +0 -50
  280. package/cjs/graphic/state/state-style-resolver.js.map +0 -1
  281. package/cjs/interface/animate.d.ts +0 -1
  282. package/cjs/interface/animate.js +0 -3
  283. package/cjs/interface/animate.js.map +0 -1
  284. package/cjs/plugins/base-plugin.d.ts +0 -8
  285. package/cjs/plugins/base-plugin.js +0 -15
  286. package/cjs/plugins/base-plugin.js.map +0 -1
  287. package/cjs/plugins/browser-env-plugin.d.ts +0 -8
  288. package/cjs/plugins/browser-env-plugin.js +0 -24
  289. package/cjs/plugins/browser-env-plugin.js.map +0 -1
  290. package/cjs/plugins/picker-plugin.d.ts +0 -7
  291. package/cjs/plugins/picker-plugin.js +0 -19
  292. package/cjs/plugins/picker-plugin.js.map +0 -1
  293. package/cjs/plugins/renderer-plugin.d.ts +0 -7
  294. package/cjs/plugins/renderer-plugin.js +0 -19
  295. package/cjs/plugins/renderer-plugin.js.map +0 -1
  296. package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
  297. package/es/graphic/state/state-batch-scheduler.js +0 -278
  298. package/es/graphic/state/state-batch-scheduler.js.map +0 -1
  299. package/es/graphic/state/state-model.d.ts +0 -43
  300. package/es/graphic/state/state-model.js +0 -135
  301. package/es/graphic/state/state-model.js.map +0 -1
  302. package/es/graphic/state/state-perf-monitor.d.ts +0 -120
  303. package/es/graphic/state/state-perf-monitor.js +0 -214
  304. package/es/graphic/state/state-perf-monitor.js.map +0 -1
  305. package/es/graphic/state/state-style-resolver.d.ts +0 -13
  306. package/es/graphic/state/state-style-resolver.js +0 -42
  307. package/es/graphic/state/state-style-resolver.js.map +0 -1
  308. package/es/interface/animate.d.ts +0 -1
  309. package/es/interface/animate.js +0 -3
  310. package/es/interface/animate.js.map +0 -1
  311. package/es/plugins/base-plugin.d.ts +0 -8
  312. package/es/plugins/base-plugin.js +0 -7
  313. package/es/plugins/base-plugin.js.map +0 -1
  314. package/es/plugins/browser-env-plugin.d.ts +0 -8
  315. package/es/plugins/browser-env-plugin.js +0 -16
  316. package/es/plugins/browser-env-plugin.js.map +0 -1
  317. package/es/plugins/picker-plugin.d.ts +0 -7
  318. package/es/plugins/picker-plugin.js +0 -11
  319. package/es/plugins/picker-plugin.js.map +0 -1
  320. package/es/plugins/renderer-plugin.d.ts +0 -7
  321. package/es/plugins/renderer-plugin.js +0 -11
  322. 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 = [], deprecatedLocalStateFallbackWarningStateNames = new Set, 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,15 +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;
207
- }
208
- warnDeprecatedLocalStatesFallback(stateNames) {
209
- for (let index = 0; index < stateNames.length; index++) {
210
- const stateName = stateNames[index];
211
- deprecatedLocalStateFallbackWarningStateNames.has(stateName) || (deprecatedLocalStateFallbackWarningStateNames.add(stateName),
212
- 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.`));
213
- }
198
+ this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1),
199
+ null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
214
200
  }
215
201
  resolveEffectiveCompiledDefinitions() {
216
202
  this.syncSharedStateScopeBindingFromTree(!1);
@@ -220,46 +206,23 @@ class Graphic extends node_tree_1.Node {
220
206
  const hasStates = !!this.states && Object.keys(this.states).length > 0;
221
207
  if (!boundScope) {
222
208
  if (!hasStates) return {
223
- compiledDefinitions: void 0,
224
- stateProxyModeKey: "none"
209
+ compiledDefinitions: void 0
225
210
  };
226
211
  const cacheKey = `local:${this.getLocalStatesVersion()}`;
227
212
  return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new state_definition_compiler_1.StateDefinitionCompiler).compile(this.states),
228
213
  this.compiledStateDefinitionsCacheKey = cacheKey), {
229
- compiledDefinitions: this.compiledStateDefinitions,
230
- stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
214
+ compiledDefinitions: this.compiledStateDefinitions
231
215
  };
232
216
  }
233
- const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions, sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none", sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
234
- if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
235
- compiledDefinitions: sharedCompiledDefinitions,
236
- stateProxyModeKey: sharedStateProxyModeKey,
237
- stateProxyEligibility: sharedStateProxyEligibility
238
- };
239
- const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
240
- if (Object.keys(localStates).forEach((stateName => {
241
- sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
242
- missingStateNames.push(stateName));
243
- })), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
244
- {
245
- compiledDefinitions: sharedCompiledDefinitions,
246
- stateProxyModeKey: sharedStateProxyModeKey,
247
- stateProxyEligibility: sharedStateProxyEligibility
248
- };
249
- this.warnDeprecatedLocalStatesFallback(missingStateNames);
250
- const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
251
- return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new state_definition_compiler_1.StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
252
- this.compiledStateDefinitionsCacheKey = cacheKey), {
253
- compiledDefinitions: this.localFallbackCompiledDefinitions,
254
- stateProxyModeKey: stateProxyModeKey,
255
- stateProxyEligibility: sharedStateProxyEligibility
217
+ return {
218
+ compiledDefinitions: boundScope.effectiveCompiledDefinitions
256
219
  };
257
220
  }
258
221
  recomputeCurrentStatePatch() {
259
222
  var _a, _b;
260
223
  if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
261
224
  this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
262
- 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) : {};
263
226
  this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
264
227
  this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
265
228
  }
@@ -322,13 +285,8 @@ class Graphic extends node_tree_1.Node {
322
285
  category | nextCategory;
323
286
  }
324
287
  submitUpdateByCategory(category, forceUpdateTag = !1) {
325
- var _a;
326
288
  if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
327
289
  void this.addUpdateLayoutTag();
328
- if (category !== attribute_update_classifier_1.UpdateCategory.NONE) {
329
- const stage = this.stage;
330
- stage && (null === (_a = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(stage)) || void 0 === _a || _a.recordCategory(category));
331
- }
332
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(),
333
291
  category & attribute_update_classifier_1.UpdateCategory.PAINT && this.addUpdatePaintTag(),
334
292
  category & attribute_update_classifier_1.UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
@@ -866,95 +824,90 @@ class Graphic extends node_tree_1.Node {
866
824
  return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs),
867
825
  stateResolveBaseAttrs;
868
826
  }
869
- createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
870
- const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility, stateProxyModeKey: stateProxyModeKey} = this.resolveEffectiveCompiledDefinitions();
871
- 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({
872
830
  compiledDefinitions: compiledDefinitions,
873
831
  stateSort: this.stateSort,
874
- stateProxy: this.stateProxy,
875
- stateProxyEligibility: stateProxyEligibility,
876
- states: this.states,
877
832
  mergeMode: this.stateMergeMode
878
- }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy,
879
- this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode,
880
- this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0,
881
- this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0),
882
- this.syncStateResolveContext(stateResolveBaseAttrs), new state_model_1.StateModel({
883
- states: this.states,
884
- currentStates: this.currentStates,
885
- stateSort: this.stateSort,
886
- stateProxy: this.stateProxy,
887
- stateEngine: this.stateEngine
888
- });
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
+ };
844
+ }
845
+ sortLocalStates(states) {
846
+ return this.stateSort ? [ ...states ].sort(this.stateSort) : [ ...states ];
889
847
  }
890
- resolveSimpleLocalStateTransition(states, previousStates) {
848
+ resolveLocalUseStatesTransition(states) {
891
849
  var _a;
892
- 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;
893
- if (1 === states.length) {
894
- const stateName = states[0], hasDefinition = Object.prototype.hasOwnProperty.call(this.states, stateName), nextStates = [ stateName ], changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
895
- if (hasDefinition) {
896
- const attrs = this.states[stateName];
897
- if (null != attrs) {
898
- if (!isPlainObjectValue(attrs)) return null;
899
- const keys = Object.keys(attrs);
900
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
901
- const key = keys[keyIndex];
902
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
903
- const attrValue = attrs[key];
904
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
905
- }
906
- }
907
- }
908
- return {
909
- changed: changed,
910
- states: nextStates,
911
- effectiveStates: nextStates,
912
- resolvedStateAttrs: resolvedStateAttrs
913
- };
914
- }
915
- const uniqueStates = Array.from(new Set(states)), withDefinition = [], withoutDefinition = [];
916
- for (let i = 0; i < uniqueStates.length; i++) {
917
- const stateName = uniqueStates[i];
918
- Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
919
- }
920
- withDefinition.sort(((left, right) => left.localeCompare(right)));
921
- const nextStates = withDefinition.concat(withoutDefinition), changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
922
- for (let i = 0; i < nextStates.length; i++) {
923
- const stateName = nextStates[i];
924
- if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
925
- const attrs = this.states[stateName];
926
- if (null == attrs) continue;
927
- if (!isPlainObjectValue(attrs)) return null;
928
- const keys = Object.keys(attrs);
929
- for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
930
- const key = keys[keyIndex];
931
- if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
932
- const attrValue = attrs[key];
933
- resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
934
- }
935
- }
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);
936
852
  return {
937
853
  changed: changed,
938
- states: nextStates,
939
- effectiveStates: nextStates,
940
- resolvedStateAttrs: resolvedStateAttrs
854
+ states: changed ? nextStates : [ ...previousStates ]
941
855
  };
942
856
  }
943
- resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
944
- var _a, _b;
945
- let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
946
- const isSimpleLocalTransition = !!transition;
947
- let resolvedStateAttrs;
948
- if (transition) resolvedStateAttrs = transition.resolvedStateAttrs; else {
949
- const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateModel = this.createStateModel(stateResolveBaseAttrs);
950
- forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.invalidateResolverCache()),
951
- 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);
952
- }
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) : {};
953
907
  return {
954
908
  transition: transition,
955
- effectiveStates: null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
956
- resolvedStateAttrs: resolvedStateAttrs,
957
- isSimpleLocalTransition: isSimpleLocalTransition
909
+ effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
910
+ resolvedStateAttrs: resolvedStateAttrs
958
911
  };
959
912
  }
960
913
  normalizeSetStatesOptions(options) {
@@ -978,26 +931,16 @@ class Graphic extends node_tree_1.Node {
978
931
  }
979
932
  commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
980
933
  var _a;
981
- 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);
982
- if ((!patchChanged || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) && (this.currentStates = transition.states,
983
- this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [ ...effectiveStates ],
984
- this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(),
985
- patchChanged)) {
986
- if (this.stage) {
987
- const perfMonitor = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(this.stage);
988
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
989
- graphicId: this._uid,
990
- targetStates: [ ...transition.states ]
991
- });
992
- }
993
- hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
994
- this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
995
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
996
- type: enums_1.AttributeUpdateType.STATE
997
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
998
- type: enums_1.AttributeUpdateType.STATE
999
- }), this.emitStateUpdateEvent());
1000
- }
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())));
1001
944
  }
1002
945
  resolveStateAnimateConfig(animateConfig) {
1003
946
  var _a, _b, _c;
@@ -1009,8 +952,8 @@ class Graphic extends node_tree_1.Node {
1009
952
  extraAnimateAttrs: extraAnimateAttrs,
1010
953
  shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
1011
954
  } : void 0;
1012
- if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
1013
- 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, {
1014
957
  noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
1015
958
  animateConfig: resolvedAnimateConfig,
1016
959
  extraAnimateAttrs: extraAnimateAttrs,
@@ -1034,45 +977,33 @@ class Graphic extends node_tree_1.Node {
1034
977
  animate.stateNames && stateAnimates.push(animate);
1035
978
  })), stateAnimates.forEach((animate => animate.stop(type)));
1036
979
  }
1037
- getNormalAttribute(key) {
1038
- var _a, _b;
1039
- const value = this.attribute[key];
1040
- 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];
1041
- }
1042
980
  clearStates(hasAnimation) {
1043
981
  var _a, _b, _c;
1044
- 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();
1045
983
  if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
1046
984
  this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
1047
985
  void this.clearSharedStateActiveRegistrations();
1048
986
  const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
1049
- if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) {
1050
- if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0,
1051
- this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), this.stage) {
1052
- const perfMonitor = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(this.stage);
1053
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1054
- graphicId: this._uid,
1055
- targetStates: []
1056
- });
1057
- }
1058
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1059
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1060
- type: enums_1.AttributeUpdateType.STATE
1061
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
1062
- type: enums_1.AttributeUpdateType.STATE
1063
- }), this.emitStateUpdateEvent());
1064
- }
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()));
1065
996
  }
1066
997
  removeState(stateName, hasAnimation) {
1067
- const transition = this.createStateModel().removeState(stateName);
998
+ const transition = this.resolveRemoveStateTransition(stateName);
1068
999
  transition.changed && this.useStates(transition.states, hasAnimation);
1069
1000
  }
1070
1001
  toggleState(stateName, hasAnimation) {
1071
- const transition = this.createStateModel().toggleState(stateName);
1002
+ const transition = this.resolveToggleStateTransition(stateName);
1072
1003
  transition.changed && this.useStates(transition.states, hasAnimation);
1073
1004
  }
1074
1005
  addState(stateName, keepCurrentStates, hasAnimation) {
1075
- const transition = this.createStateModel().addState(stateName, keepCurrentStates);
1006
+ const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
1076
1007
  transition.changed && this.useStates(transition.states, hasAnimation);
1077
1008
  }
1078
1009
  setStates(states, options) {
@@ -1089,24 +1020,16 @@ class Graphic extends node_tree_1.Node {
1089
1020
  useStates(states, hasAnimation) {
1090
1021
  var _a;
1091
1022
  if (!states.length) return void this.clearStates(hasAnimation);
1092
- 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);
1093
- if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
1094
- if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [ ...effectiveStates ],
1095
- this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(),
1096
- this.stage) {
1097
- const perfMonitor = (0, state_perf_monitor_1.getActiveStageStatePerfMonitor)(this.stage);
1098
- null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
1099
- graphicId: this._uid,
1100
- targetStates: [ ...transition.states ]
1101
- });
1102
- }
1103
- hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
1104
- this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
1105
- type: enums_1.AttributeUpdateType.STATE
1106
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
1107
- type: enums_1.AttributeUpdateType.STATE
1108
- }), this.emitStateUpdateEvent());
1109
- }
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()));
1110
1033
  }
1111
1034
  invalidateResolver() {
1112
1035
  var _a, _b;
@@ -1245,9 +1168,8 @@ class Graphic extends node_tree_1.Node {
1245
1168
  var _a, _b, _c;
1246
1169
  (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
1247
1170
  (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0,
1248
- this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0,
1249
- this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
1250
- 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,
1251
1173
  this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
1252
1174
  }
1253
1175
  setStageToShadowRoot(stage, layer) {