@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.
- package/cjs/allocator/bounds-allocate.js +1 -2
- package/cjs/canvas/constants.js +2 -1
- package/cjs/common/bezier-utils.js +1 -2
- package/cjs/common/event-transformer.js +2 -1
- package/cjs/common/module-guard.d.ts +1 -0
- package/cjs/common/module-guard.js +11 -0
- package/cjs/common/module-guard.js.map +1 -0
- package/cjs/common/performance-raf.js +1 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/container.d.ts +2 -0
- package/cjs/container.js +50 -0
- package/cjs/container.js.map +1 -0
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +2 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.d.ts +0 -9
- package/cjs/core/stage.js +12 -30
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/entries/miniapp.d.ts +0 -1
- package/cjs/entries/miniapp.js +1 -5
- package/cjs/entries/miniapp.js.map +1 -1
- package/cjs/entries/node.d.ts +0 -1
- package/cjs/entries/node.js +1 -5
- package/cjs/entries/node.js.map +1 -1
- package/cjs/env.d.ts +1 -0
- package/cjs/env.js +25 -0
- package/cjs/env.js.map +1 -0
- package/cjs/event/public-constant.d.ts +7 -0
- package/cjs/event/public-constant.js +100 -0
- package/cjs/event/public-constant.js.map +1 -0
- package/cjs/event/util.d.ts +1 -1
- package/cjs/graphic/arc.js +6 -4
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/base.d.ts +2 -0
- package/cjs/graphic/base.js +15 -0
- package/cjs/graphic/base.js.map +1 -0
- package/cjs/graphic/config.js +1 -0
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/creator.d.ts +16 -0
- package/cjs/graphic/creator.js +160 -0
- package/cjs/graphic/creator.js.map +1 -0
- package/cjs/graphic/glyph.js +4 -8
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +19 -28
- package/cjs/graphic/graphic.js +122 -193
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -3
- package/cjs/graphic/group.js +22 -28
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/modules.d.ts +16 -0
- package/cjs/graphic/modules.js +150 -0
- package/cjs/graphic/modules.js.map +1 -0
- package/cjs/graphic/node-tree.d.ts +3 -3
- package/cjs/graphic/node-tree.js +1 -0
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/state/shared-state-refresh.js +11 -32
- package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
- package/cjs/graphic/state/shared-state-scope.d.ts +2 -5
- package/cjs/graphic/state/shared-state-scope.js +8 -27
- package/cjs/graphic/state/shared-state-scope.js.map +1 -1
- package/cjs/graphic/state/state-definition-compiler.js +4 -5
- package/cjs/graphic/state/state-definition-compiler.js.map +1 -1
- package/cjs/graphic/state/state-definition.d.ts +2 -5
- package/cjs/graphic/state/state-definition.js.map +1 -1
- package/cjs/graphic/state/state-engine.d.ts +0 -5
- package/cjs/graphic/state/state-engine.js +20 -70
- package/cjs/graphic/state/state-engine.js.map +1 -1
- package/cjs/graphic/state/state-transition-orchestrator.d.ts +7 -9
- package/cjs/graphic/state/state-transition-orchestrator.js +10 -13
- package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -1
- package/cjs/interface/graphic/arc.d.ts +1 -0
- package/cjs/interface/graphic/arc.js.map +1 -1
- package/cjs/interface/graphic/group.d.ts +0 -2
- package/cjs/interface/graphic/group.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -5
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/index.js.map +1 -1
- package/cjs/interface/node-tree.d.ts +3 -0
- package/cjs/interface/node-tree.js.map +1 -1
- package/cjs/interface/stage.d.ts +0 -7
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/interpolate.d.ts +2 -0
- package/cjs/interpolate.js +34 -0
- package/cjs/interpolate.js.map +1 -0
- package/cjs/modules.js.map +1 -1
- package/cjs/path.d.ts +4 -0
- package/cjs/path.js +33 -0
- package/cjs/path.js.map +1 -0
- package/cjs/plugin/3d.d.ts +3 -0
- package/cjs/plugin/3d.js +33 -0
- package/cjs/plugin/3d.js.map +1 -0
- package/cjs/plugin/attribute.d.ts +2 -0
- package/cjs/plugin/attribute.js +24 -0
- package/cjs/plugin/attribute.js.map +1 -0
- package/cjs/plugin/flex-layout.d.ts +1 -0
- package/cjs/plugin/flex-layout.js +15 -0
- package/cjs/plugin/flex-layout.js.map +1 -0
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/index.d.ts +0 -4
- package/cjs/plugins/index.js +1 -3
- package/cjs/plugins/index.js.map +1 -1
- package/cjs/plugins/plugin-service.d.ts +0 -1
- package/cjs/plugins/plugin-service.js +2 -3
- package/cjs/plugins/plugin-service.js.map +1 -1
- package/cjs/plugins/types.d.ts +1 -8
- package/cjs/plugins/types.js.map +1 -1
- package/cjs/register/graphic.d.ts +19 -0
- package/cjs/register/graphic.js +177 -0
- package/cjs/register/graphic.js.map +1 -0
- package/cjs/registry/contribution-registry.d.ts +0 -1
- package/cjs/registry/contribution-registry.js +0 -3
- package/cjs/registry/contribution-registry.js.map +1 -1
- package/cjs/registry/picker-registry.d.ts +0 -1
- package/cjs/registry/picker-registry.js +0 -3
- package/cjs/registry/picker-registry.js.map +1 -1
- package/cjs/registry/renderer-registry.d.ts +0 -1
- package/cjs/registry/renderer-registry.js +0 -3
- package/cjs/registry/renderer-registry.js.map +1 -1
- package/cjs/registry/types.d.ts +0 -3
- package/cjs/registry/types.js.map +1 -1
- package/cjs/render/contributions/render/arc-module.js +2 -4
- package/cjs/render/contributions/render/arc-module.js.map +1 -1
- package/cjs/render/contributions/render/arc3d-module.js +2 -4
- package/cjs/render/contributions/render/arc3d-module.js.map +1 -1
- package/cjs/render/contributions/render/area-module.js +2 -4
- package/cjs/render/contributions/render/area-module.js.map +1 -1
- package/cjs/render/contributions/render/circle-module.js +2 -4
- package/cjs/render/contributions/render/circle-module.js.map +1 -1
- package/cjs/render/contributions/render/glyph-module.js +2 -4
- package/cjs/render/contributions/render/glyph-module.js.map +1 -1
- package/cjs/render/contributions/render/image-module.js +2 -4
- package/cjs/render/contributions/render/image-module.js.map +1 -1
- package/cjs/render/contributions/render/line-module.js +2 -4
- package/cjs/render/contributions/render/line-module.js.map +1 -1
- package/cjs/render/contributions/render/path-module.js +2 -4
- package/cjs/render/contributions/render/path-module.js.map +1 -1
- package/cjs/render/contributions/render/polygon-module.js +2 -4
- package/cjs/render/contributions/render/polygon-module.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-module.js +2 -4
- package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -1
- package/cjs/render/contributions/render/rect-module.js +2 -4
- package/cjs/render/contributions/render/rect-module.js.map +1 -1
- package/cjs/render/contributions/render/rect3d-module.js +2 -4
- package/cjs/render/contributions/render/rect3d-module.js.map +1 -1
- package/cjs/render/contributions/render/richtext-module.js +2 -4
- package/cjs/render/contributions/render/richtext-module.js.map +1 -1
- package/cjs/render/contributions/render/star-module.js +2 -4
- package/cjs/render/contributions/render/star-module.js.map +1 -1
- package/cjs/render/contributions/render/symbol-module.js +2 -4
- package/cjs/render/contributions/render/symbol-module.js.map +1 -1
- package/cjs/render/contributions/render/text-module.js +2 -4
- package/cjs/render/contributions/render/text-module.js.map +1 -1
- package/cjs/svg.d.ts +1 -0
- package/cjs/svg.js +15 -0
- package/cjs/svg.js.map +1 -0
- package/cjs/text.d.ts +2 -0
- package/cjs/text.js +29 -0
- package/cjs/text.js.map +1 -0
- package/dist/index.es.js +328 -1630
- package/es/allocator/bounds-allocate.js +1 -2
- package/es/canvas/constants.js +2 -1
- package/es/common/bezier-utils.js +1 -2
- package/es/common/event-transformer.js +2 -1
- package/es/common/module-guard.d.ts +1 -0
- package/es/common/module-guard.js +5 -0
- package/es/common/module-guard.js.map +1 -0
- package/es/common/performance-raf.js +1 -2
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/container.d.ts +2 -0
- package/es/container.js +2 -0
- package/es/container.js.map +1 -0
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +2 -0
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +2 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.d.ts +0 -9
- package/es/core/stage.js +10 -31
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/entries/miniapp.d.ts +0 -1
- package/es/entries/miniapp.js +1 -5
- package/es/entries/miniapp.js.map +1 -1
- package/es/entries/node.d.ts +0 -1
- package/es/entries/node.js +1 -5
- package/es/entries/node.js.map +1 -1
- package/es/env.d.ts +1 -0
- package/es/env.js +2 -0
- package/es/env.js.map +1 -0
- package/es/event/public-constant.d.ts +7 -0
- package/es/event/public-constant.js +12 -0
- package/es/event/public-constant.js.map +1 -0
- package/es/event/util.d.ts +1 -1
- package/es/graphic/arc.js +5 -4
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/base.d.ts +2 -0
- package/es/graphic/base.js +2 -0
- package/es/graphic/base.js.map +1 -0
- package/es/graphic/config.js +1 -0
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/creator.d.ts +16 -0
- package/es/graphic/creator.js +32 -0
- package/es/graphic/creator.js.map +1 -0
- package/es/graphic/glyph.js +4 -8
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic.d.ts +19 -28
- package/es/graphic/graphic.js +121 -198
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -3
- package/es/graphic/group.js +22 -28
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/modules.d.ts +16 -0
- package/es/graphic/modules.js +32 -0
- package/es/graphic/modules.js.map +1 -0
- package/es/graphic/node-tree.d.ts +3 -3
- package/es/graphic/node-tree.js +1 -0
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/state/shared-state-refresh.js +8 -28
- package/es/graphic/state/shared-state-refresh.js.map +1 -1
- package/es/graphic/state/shared-state-scope.d.ts +2 -5
- package/es/graphic/state/shared-state-scope.js +7 -28
- package/es/graphic/state/shared-state-scope.js.map +1 -1
- package/es/graphic/state/state-definition-compiler.js +4 -5
- package/es/graphic/state/state-definition-compiler.js.map +1 -1
- package/es/graphic/state/state-definition.d.ts +2 -5
- package/es/graphic/state/state-definition.js.map +1 -1
- package/es/graphic/state/state-engine.d.ts +0 -5
- package/es/graphic/state/state-engine.js +17 -67
- package/es/graphic/state/state-engine.js.map +1 -1
- package/es/graphic/state/state-transition-orchestrator.d.ts +7 -9
- package/es/graphic/state/state-transition-orchestrator.js +10 -13
- package/es/graphic/state/state-transition-orchestrator.js.map +1 -1
- package/es/interface/graphic/arc.d.ts +1 -0
- package/es/interface/graphic/arc.js.map +1 -1
- package/es/interface/graphic/group.d.ts +0 -2
- package/es/interface/graphic/group.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -5
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/index.js.map +1 -1
- package/es/interface/node-tree.d.ts +3 -0
- package/es/interface/node-tree.js.map +1 -1
- package/es/interface/stage.d.ts +0 -7
- package/es/interface/stage.js.map +1 -1
- package/es/interpolate.d.ts +2 -0
- package/es/interpolate.js +4 -0
- package/es/interpolate.js.map +1 -0
- package/es/modules.js.map +1 -1
- package/es/path.d.ts +4 -0
- package/es/path.js +6 -0
- package/es/path.js.map +1 -0
- package/es/plugin/3d.d.ts +3 -0
- package/es/plugin/3d.js +6 -0
- package/es/plugin/3d.js.map +1 -0
- package/es/plugin/attribute.d.ts +2 -0
- package/es/plugin/attribute.js +4 -0
- package/es/plugin/attribute.js.map +1 -0
- package/es/plugin/flex-layout.d.ts +1 -0
- package/es/plugin/flex-layout.js +2 -0
- package/es/plugin/flex-layout.js.map +1 -0
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/index.d.ts +0 -4
- package/es/plugins/index.js +0 -8
- package/es/plugins/index.js.map +1 -1
- package/es/plugins/plugin-service.d.ts +0 -1
- package/es/plugins/plugin-service.js +2 -3
- package/es/plugins/plugin-service.js.map +1 -1
- package/es/plugins/types.d.ts +1 -8
- package/es/plugins/types.js.map +1 -1
- package/es/register/graphic.d.ts +19 -0
- package/es/register/graphic.js +38 -0
- package/es/register/graphic.js.map +1 -0
- package/es/registry/contribution-registry.d.ts +0 -1
- package/es/registry/contribution-registry.js +0 -3
- package/es/registry/contribution-registry.js.map +1 -1
- package/es/registry/picker-registry.d.ts +0 -1
- package/es/registry/picker-registry.js +0 -3
- package/es/registry/picker-registry.js.map +1 -1
- package/es/registry/renderer-registry.d.ts +0 -1
- package/es/registry/renderer-registry.js +0 -3
- package/es/registry/renderer-registry.js.map +1 -1
- package/es/registry/types.d.ts +0 -3
- package/es/registry/types.js.map +1 -1
- package/es/render/contributions/render/arc-module.js +4 -2
- package/es/render/contributions/render/arc-module.js.map +1 -1
- package/es/render/contributions/render/arc3d-module.js +4 -2
- package/es/render/contributions/render/arc3d-module.js.map +1 -1
- package/es/render/contributions/render/area-module.js +4 -2
- package/es/render/contributions/render/area-module.js.map +1 -1
- package/es/render/contributions/render/circle-module.js +4 -2
- package/es/render/contributions/render/circle-module.js.map +1 -1
- package/es/render/contributions/render/glyph-module.js +4 -2
- package/es/render/contributions/render/glyph-module.js.map +1 -1
- package/es/render/contributions/render/image-module.js +4 -2
- package/es/render/contributions/render/image-module.js.map +1 -1
- package/es/render/contributions/render/line-module.js +4 -2
- package/es/render/contributions/render/line-module.js.map +1 -1
- package/es/render/contributions/render/path-module.js +4 -2
- package/es/render/contributions/render/path-module.js.map +1 -1
- package/es/render/contributions/render/polygon-module.js +4 -2
- package/es/render/contributions/render/polygon-module.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-module.js +4 -2
- package/es/render/contributions/render/pyramid3d-module.js.map +1 -1
- package/es/render/contributions/render/rect-module.js +4 -2
- package/es/render/contributions/render/rect-module.js.map +1 -1
- package/es/render/contributions/render/rect3d-module.js +4 -2
- package/es/render/contributions/render/rect3d-module.js.map +1 -1
- package/es/render/contributions/render/richtext-module.js +4 -2
- package/es/render/contributions/render/richtext-module.js.map +1 -1
- package/es/render/contributions/render/star-module.js +4 -2
- package/es/render/contributions/render/star-module.js.map +1 -1
- package/es/render/contributions/render/symbol-module.js +4 -2
- package/es/render/contributions/render/symbol-module.js.map +1 -1
- package/es/render/contributions/render/text-module.js +4 -2
- package/es/render/contributions/render/text-module.js.map +1 -1
- package/es/svg.d.ts +1 -0
- package/es/svg.js +2 -0
- package/es/svg.js.map +1 -0
- package/es/text.d.ts +2 -0
- package/es/text.js +4 -0
- package/es/text.js.map +1 -0
- package/package.json +245 -1
- package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
- package/cjs/graphic/state/state-batch-scheduler.js +0 -285
- package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
- package/cjs/graphic/state/state-model.d.ts +0 -43
- package/cjs/graphic/state/state-model.js +0 -143
- package/cjs/graphic/state/state-model.js.map +0 -1
- package/cjs/graphic/state/state-perf-monitor.d.ts +0 -120
- package/cjs/graphic/state/state-perf-monitor.js +0 -224
- package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
- package/cjs/graphic/state/state-style-resolver.d.ts +0 -13
- package/cjs/graphic/state/state-style-resolver.js +0 -50
- package/cjs/graphic/state/state-style-resolver.js.map +0 -1
- package/cjs/interface/animate.d.ts +0 -1
- package/cjs/interface/animate.js +0 -3
- package/cjs/interface/animate.js.map +0 -1
- package/cjs/plugins/base-plugin.d.ts +0 -8
- package/cjs/plugins/base-plugin.js +0 -15
- package/cjs/plugins/base-plugin.js.map +0 -1
- package/cjs/plugins/browser-env-plugin.d.ts +0 -8
- package/cjs/plugins/browser-env-plugin.js +0 -24
- package/cjs/plugins/browser-env-plugin.js.map +0 -1
- package/cjs/plugins/picker-plugin.d.ts +0 -7
- package/cjs/plugins/picker-plugin.js +0 -19
- package/cjs/plugins/picker-plugin.js.map +0 -1
- package/cjs/plugins/renderer-plugin.d.ts +0 -7
- package/cjs/plugins/renderer-plugin.js +0 -19
- package/cjs/plugins/renderer-plugin.js.map +0 -1
- package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
- package/es/graphic/state/state-batch-scheduler.js +0 -278
- package/es/graphic/state/state-batch-scheduler.js.map +0 -1
- package/es/graphic/state/state-model.d.ts +0 -43
- package/es/graphic/state/state-model.js +0 -135
- package/es/graphic/state/state-model.js.map +0 -1
- package/es/graphic/state/state-perf-monitor.d.ts +0 -120
- package/es/graphic/state/state-perf-monitor.js +0 -214
- package/es/graphic/state/state-perf-monitor.js.map +0 -1
- package/es/graphic/state/state-style-resolver.d.ts +0 -13
- package/es/graphic/state/state-style-resolver.js +0 -42
- package/es/graphic/state/state-style-resolver.js.map +0 -1
- package/es/interface/animate.d.ts +0 -1
- package/es/interface/animate.js +0 -3
- package/es/interface/animate.js.map +0 -1
- package/es/plugins/base-plugin.d.ts +0 -8
- package/es/plugins/base-plugin.js +0 -7
- package/es/plugins/base-plugin.js.map +0 -1
- package/es/plugins/browser-env-plugin.d.ts +0 -8
- package/es/plugins/browser-env-plugin.js +0 -16
- package/es/plugins/browser-env-plugin.js.map +0 -1
- package/es/plugins/picker-plugin.d.ts +0 -7
- package/es/plugins/picker-plugin.js +0 -11
- package/es/plugins/picker-plugin.js.map +0 -1
- package/es/plugins/renderer-plugin.d.ts +0 -7
- package/es/plugins/renderer-plugin.js +0 -11
- package/es/plugins/renderer-plugin.js.map +0 -1
package/es/graphic/graphic.js
CHANGED
|
@@ -34,27 +34,21 @@ import { StateDefinitionCompiler } from "./state/state-definition-compiler";
|
|
|
34
34
|
|
|
35
35
|
import { StateEngine } from "./state/state-engine";
|
|
36
36
|
|
|
37
|
-
import { StateModel } from "./state/state-model";
|
|
38
|
-
|
|
39
37
|
import { ATTRIBUTE_CATEGORY, UpdateCategory, classifyAttributeDelta } from "./state/attribute-update-classifier";
|
|
40
38
|
|
|
41
|
-
import { StateStyleResolver } from "./state/state-style-resolver";
|
|
42
|
-
|
|
43
39
|
import { StateTransitionOrchestrator } from "./state/state-transition-orchestrator";
|
|
44
40
|
|
|
45
41
|
import { collectSharedStateScopeChain, ensureSharedStateScopeFresh } from "./state/shared-state-scope";
|
|
46
42
|
|
|
47
43
|
import { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from "./state/shared-state-refresh";
|
|
48
44
|
|
|
49
|
-
import { getActiveStageStatePerfMonitor } from "./state/state-perf-monitor";
|
|
50
|
-
|
|
51
45
|
const _tempBounds = new AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new Matrix;
|
|
52
46
|
|
|
53
47
|
export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
|
|
54
48
|
|
|
55
49
|
export const GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
|
|
56
50
|
|
|
57
|
-
const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]),
|
|
51
|
+
const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]), point = new Point, EMPTY_STATE_NAMES = [], BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT | UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.TRANSFORM | UpdateCategory.LAYOUT;
|
|
58
52
|
|
|
59
53
|
function isPlainObjectValue(value) {
|
|
60
54
|
return "object" == typeof value && null != value && !Array.isArray(value);
|
|
@@ -174,12 +168,6 @@ export class Graphic extends Node {
|
|
|
174
168
|
getAttributes() {
|
|
175
169
|
return this.attribute;
|
|
176
170
|
}
|
|
177
|
-
getStateStyleResolver(mergeMode) {
|
|
178
|
-
return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
|
|
179
|
-
mergeMode: "deep"
|
|
180
|
-
})), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver),
|
|
181
|
-
this.stateStyleResolver);
|
|
182
|
-
}
|
|
183
171
|
getStateTransitionOrchestrator() {
|
|
184
172
|
return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator),
|
|
185
173
|
this.stateTransitionOrchestrator;
|
|
@@ -198,9 +186,8 @@ export class Graphic extends Node {
|
|
|
198
186
|
const nextScope = this.resolveBoundSharedStateScope();
|
|
199
187
|
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
|
|
200
188
|
!1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
|
|
201
|
-
this.
|
|
202
|
-
this.
|
|
203
|
-
this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(),
|
|
189
|
+
this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
|
|
190
|
+
this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(),
|
|
204
191
|
markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
|
|
205
192
|
!0);
|
|
206
193
|
}
|
|
@@ -245,8 +232,8 @@ export class Graphic extends Node {
|
|
|
245
232
|
getLocalStatesVersion() {
|
|
246
233
|
var _a, _b;
|
|
247
234
|
return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
|
|
248
|
-
this.
|
|
249
|
-
null !== (_b = this.
|
|
235
|
+
this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1),
|
|
236
|
+
null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
|
|
250
237
|
}
|
|
251
238
|
resolveEffectiveCompiledDefinitions() {
|
|
252
239
|
this.syncSharedStateScopeBindingFromTree(!1);
|
|
@@ -255,45 +242,23 @@ export class Graphic extends Node {
|
|
|
255
242
|
const hasStates = !!this.states && Object.keys(this.states).length > 0;
|
|
256
243
|
if (!boundScope) {
|
|
257
244
|
if (!hasStates) return {
|
|
258
|
-
compiledDefinitions: void 0
|
|
259
|
-
stateProxyModeKey: "none"
|
|
245
|
+
compiledDefinitions: void 0
|
|
260
246
|
};
|
|
261
247
|
const cacheKey = `local:${this.getLocalStatesVersion()}`;
|
|
262
248
|
return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new StateDefinitionCompiler).compile(this.states),
|
|
263
249
|
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
264
|
-
compiledDefinitions: this.compiledStateDefinitions
|
|
265
|
-
stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
|
|
250
|
+
compiledDefinitions: this.compiledStateDefinitions
|
|
266
251
|
};
|
|
267
252
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
271
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
272
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
273
|
-
};
|
|
274
|
-
const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
|
|
275
|
-
if (Object.keys(localStates).forEach((stateName => {
|
|
276
|
-
sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
|
|
277
|
-
missingStateNames.push(stateName));
|
|
278
|
-
})), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
|
|
279
|
-
{
|
|
280
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
281
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
282
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
283
|
-
};
|
|
284
|
-
const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
|
|
285
|
-
return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
|
|
286
|
-
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
287
|
-
compiledDefinitions: this.localFallbackCompiledDefinitions,
|
|
288
|
-
stateProxyModeKey: stateProxyModeKey,
|
|
289
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
253
|
+
return {
|
|
254
|
+
compiledDefinitions: boundScope.effectiveCompiledDefinitions
|
|
290
255
|
};
|
|
291
256
|
}
|
|
292
257
|
recomputeCurrentStatePatch() {
|
|
293
258
|
var _a, _b;
|
|
294
259
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
|
|
295
260
|
this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
|
|
296
|
-
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), transition = this.
|
|
261
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs), effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
297
262
|
this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
|
|
298
263
|
this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
|
|
299
264
|
}
|
|
@@ -356,13 +321,8 @@ export class Graphic extends Node {
|
|
|
356
321
|
category | nextCategory;
|
|
357
322
|
}
|
|
358
323
|
submitUpdateByCategory(category, forceUpdateTag = !1) {
|
|
359
|
-
var _a;
|
|
360
324
|
if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
|
|
361
325
|
void this.addUpdateLayoutTag();
|
|
362
|
-
if (category !== UpdateCategory.NONE) {
|
|
363
|
-
const stage = this.stage;
|
|
364
|
-
stage && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordCategory(category));
|
|
365
|
-
}
|
|
366
326
|
(category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
|
|
367
327
|
category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
|
|
368
328
|
category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
|
|
@@ -894,95 +854,90 @@ export class Graphic extends Node {
|
|
|
894
854
|
return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs),
|
|
895
855
|
stateResolveBaseAttrs;
|
|
896
856
|
}
|
|
897
|
-
|
|
898
|
-
const {compiledDefinitions: compiledDefinitions
|
|
899
|
-
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.
|
|
857
|
+
ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
858
|
+
const {compiledDefinitions: compiledDefinitions} = this.resolveEffectiveCompiledDefinitions();
|
|
859
|
+
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new StateEngine({
|
|
900
860
|
compiledDefinitions: compiledDefinitions,
|
|
901
861
|
stateSort: this.stateSort,
|
|
902
|
-
stateProxy: this.stateProxy,
|
|
903
|
-
stateProxyEligibility: stateProxyEligibility,
|
|
904
|
-
states: this.states,
|
|
905
862
|
mergeMode: this.stateMergeMode
|
|
906
|
-
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.
|
|
907
|
-
this.
|
|
908
|
-
this.
|
|
909
|
-
this.
|
|
910
|
-
this.syncStateResolveContext(stateResolveBaseAttrs), new StateModel({
|
|
911
|
-
states: this.states,
|
|
912
|
-
currentStates: this.currentStates,
|
|
913
|
-
stateSort: this.stateSort,
|
|
914
|
-
stateProxy: this.stateProxy,
|
|
915
|
-
stateEngine: this.stateEngine
|
|
916
|
-
});
|
|
863
|
+
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort,
|
|
864
|
+
this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0),
|
|
865
|
+
this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates),
|
|
866
|
+
this.stateEngine;
|
|
917
867
|
}
|
|
918
|
-
|
|
868
|
+
toGraphicStateTransition(result) {
|
|
869
|
+
return {
|
|
870
|
+
changed: result.changed,
|
|
871
|
+
states: [ ...result.activeStates ],
|
|
872
|
+
effectiveStates: [ ...result.effectiveStates ]
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
sortLocalStates(states) {
|
|
876
|
+
return this.stateSort ? [ ...states ].sort(this.stateSort) : [ ...states ];
|
|
877
|
+
}
|
|
878
|
+
resolveLocalUseStatesTransition(states) {
|
|
919
879
|
var _a;
|
|
920
|
-
if (!
|
|
921
|
-
|
|
922
|
-
const stateName = states[0], hasDefinition = Object.prototype.hasOwnProperty.call(this.states, stateName), nextStates = [ stateName ], changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
|
|
923
|
-
if (hasDefinition) {
|
|
924
|
-
const attrs = this.states[stateName];
|
|
925
|
-
if (null != attrs) {
|
|
926
|
-
if (!isPlainObjectValue(attrs)) return null;
|
|
927
|
-
const keys = Object.keys(attrs);
|
|
928
|
-
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
|
|
929
|
-
const key = keys[keyIndex];
|
|
930
|
-
if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
|
|
931
|
-
const attrValue = attrs[key];
|
|
932
|
-
resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
return {
|
|
937
|
-
changed: changed,
|
|
938
|
-
states: nextStates,
|
|
939
|
-
effectiveStates: nextStates,
|
|
940
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
const uniqueStates = Array.from(new Set(states)), withDefinition = [], withoutDefinition = [];
|
|
944
|
-
for (let i = 0; i < uniqueStates.length; i++) {
|
|
945
|
-
const stateName = uniqueStates[i];
|
|
946
|
-
Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
|
|
947
|
-
}
|
|
948
|
-
withDefinition.sort(((left, right) => left.localeCompare(right)));
|
|
949
|
-
const nextStates = withDefinition.concat(withoutDefinition), changed = !this.sameStateNames(previousStates, nextStates), resolvedStateAttrs = {};
|
|
950
|
-
for (let i = 0; i < nextStates.length; i++) {
|
|
951
|
-
const stateName = nextStates[i];
|
|
952
|
-
if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
|
|
953
|
-
const attrs = this.states[stateName];
|
|
954
|
-
if (null == attrs) continue;
|
|
955
|
-
if (!isPlainObjectValue(attrs)) return null;
|
|
956
|
-
const keys = Object.keys(attrs);
|
|
957
|
-
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
|
|
958
|
-
const key = keys[keyIndex];
|
|
959
|
-
if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
|
|
960
|
-
const attrValue = attrs[key];
|
|
961
|
-
resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
|
|
962
|
-
}
|
|
963
|
-
}
|
|
880
|
+
if (!states.length) return this.resolveLocalClearStatesTransition();
|
|
881
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, changed = previousStates.length !== states.length || states.some(((stateName, index) => previousStates[index] !== stateName)), nextStates = this.sortLocalStates(states);
|
|
964
882
|
return {
|
|
965
883
|
changed: changed,
|
|
966
|
-
states: nextStates
|
|
967
|
-
effectiveStates: nextStates,
|
|
968
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
884
|
+
states: changed ? nextStates : [ ...previousStates ]
|
|
969
885
|
};
|
|
970
886
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
887
|
+
resolveLocalClearStatesTransition() {
|
|
888
|
+
return {
|
|
889
|
+
changed: this.hasState(),
|
|
890
|
+
states: []
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
894
|
+
const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
895
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
|
|
896
|
+
}
|
|
897
|
+
resolveClearStatesTransition() {
|
|
898
|
+
const stateEngine = this.ensureStateEngine();
|
|
899
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
|
|
900
|
+
}
|
|
901
|
+
resolveAddStateTransition(stateName, keepCurrentStates) {
|
|
902
|
+
var _a;
|
|
903
|
+
const stateEngine = this.ensureStateEngine();
|
|
904
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
|
|
905
|
+
if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
|
|
906
|
+
changed: !1,
|
|
907
|
+
states: [ ...this.currentStates ]
|
|
908
|
+
};
|
|
909
|
+
const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
|
|
910
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
911
|
+
}
|
|
912
|
+
resolveRemoveStateTransition(stateName) {
|
|
913
|
+
const stateEngine = this.ensureStateEngine();
|
|
914
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
|
|
915
|
+
if (!this.currentStates) return {
|
|
916
|
+
changed: !1,
|
|
917
|
+
states: []
|
|
918
|
+
};
|
|
919
|
+
const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName, nextStates = this.currentStates.filter(filter);
|
|
920
|
+
return nextStates.length === this.currentStates.length ? {
|
|
921
|
+
changed: !1,
|
|
922
|
+
states: [ ...this.currentStates ]
|
|
923
|
+
} : this.resolveLocalUseStatesTransition(nextStates);
|
|
924
|
+
}
|
|
925
|
+
resolveToggleStateTransition(stateName) {
|
|
926
|
+
const stateEngine = this.ensureStateEngine();
|
|
927
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
|
|
928
|
+
if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
|
|
929
|
+
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
930
|
+
return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
|
|
931
|
+
}
|
|
932
|
+
resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
|
|
933
|
+
var _a;
|
|
934
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
935
|
+
forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
|
|
936
|
+
const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
981
937
|
return {
|
|
982
938
|
transition: transition,
|
|
983
|
-
effectiveStates: null !== (
|
|
984
|
-
resolvedStateAttrs: resolvedStateAttrs
|
|
985
|
-
isSimpleLocalTransition: isSimpleLocalTransition
|
|
939
|
+
effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
|
|
940
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
986
941
|
};
|
|
987
942
|
}
|
|
988
943
|
normalizeSetStatesOptions(options) {
|
|
@@ -1006,26 +961,16 @@ export class Graphic extends Node {
|
|
|
1006
961
|
}
|
|
1007
962
|
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
|
|
1008
963
|
var _a;
|
|
1009
|
-
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs
|
|
1010
|
-
|
|
1011
|
-
this.effectiveStates =
|
|
1012
|
-
this.
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
|
|
1022
|
-
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1023
|
-
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
1024
|
-
type: AttributeUpdateType.STATE
|
|
1025
|
-
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
1026
|
-
type: AttributeUpdateType.STATE
|
|
1027
|
-
}), this.emitStateUpdateEvent());
|
|
1028
|
-
}
|
|
964
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states, !0), patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
965
|
+
patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states,
|
|
966
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
967
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
|
|
968
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
969
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
970
|
+
type: AttributeUpdateType.STATE
|
|
971
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
972
|
+
type: AttributeUpdateType.STATE
|
|
973
|
+
}), this.emitStateUpdateEvent())));
|
|
1029
974
|
}
|
|
1030
975
|
resolveStateAnimateConfig(animateConfig) {
|
|
1031
976
|
var _a, _b, _c;
|
|
@@ -1037,8 +982,8 @@ export class Graphic extends Node {
|
|
|
1037
982
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
1038
983
|
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
1039
984
|
} : void 0;
|
|
1040
|
-
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation,
|
|
1041
|
-
const plan = this.getStateTransitionOrchestrator().analyzeTransition(
|
|
985
|
+
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
|
|
986
|
+
const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
|
|
1042
987
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
1043
988
|
animateConfig: resolvedAnimateConfig,
|
|
1044
989
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
@@ -1062,45 +1007,33 @@ export class Graphic extends Node {
|
|
|
1062
1007
|
animate.stateNames && stateAnimates.push(animate);
|
|
1063
1008
|
})), stateAnimates.forEach((animate => animate.stop(type)));
|
|
1064
1009
|
}
|
|
1065
|
-
getNormalAttribute(key) {
|
|
1066
|
-
var _a, _b;
|
|
1067
|
-
const value = this.attribute[key];
|
|
1068
|
-
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];
|
|
1069
|
-
}
|
|
1070
1010
|
clearStates(hasAnimation) {
|
|
1071
1011
|
var _a, _b, _c;
|
|
1072
|
-
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.
|
|
1012
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.resolveClearStatesTransition();
|
|
1073
1013
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
|
|
1074
1014
|
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
1075
1015
|
void this.clearSharedStateActiveRegistrations();
|
|
1076
1016
|
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1087
|
-
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
1088
|
-
type: AttributeUpdateType.STATE
|
|
1089
|
-
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
1090
|
-
type: AttributeUpdateType.STATE
|
|
1091
|
-
}), this.emitStateUpdateEvent());
|
|
1092
|
-
}
|
|
1017
|
+
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
|
|
1018
|
+
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
1019
|
+
this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
|
|
1020
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1021
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
1022
|
+
type: AttributeUpdateType.STATE
|
|
1023
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
1024
|
+
type: AttributeUpdateType.STATE
|
|
1025
|
+
}), this.emitStateUpdateEvent()));
|
|
1093
1026
|
}
|
|
1094
1027
|
removeState(stateName, hasAnimation) {
|
|
1095
|
-
const transition = this.
|
|
1028
|
+
const transition = this.resolveRemoveStateTransition(stateName);
|
|
1096
1029
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
1097
1030
|
}
|
|
1098
1031
|
toggleState(stateName, hasAnimation) {
|
|
1099
|
-
const transition = this.
|
|
1032
|
+
const transition = this.resolveToggleStateTransition(stateName);
|
|
1100
1033
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
1101
1034
|
}
|
|
1102
1035
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
1103
|
-
const transition = this.
|
|
1036
|
+
const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
|
|
1104
1037
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
1105
1038
|
}
|
|
1106
1039
|
setStates(states, options) {
|
|
@@ -1117,30 +1050,21 @@ export class Graphic extends Node {
|
|
|
1117
1050
|
useStates(states, hasAnimation) {
|
|
1118
1051
|
var _a;
|
|
1119
1052
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
1120
|
-
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
}
|
|
1131
|
-
hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1132
|
-
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
1133
|
-
type: AttributeUpdateType.STATE
|
|
1134
|
-
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
1135
|
-
type: AttributeUpdateType.STATE
|
|
1136
|
-
}), this.emitStateUpdateEvent());
|
|
1137
|
-
}
|
|
1053
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states);
|
|
1054
|
+
!transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
|
|
1055
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
1056
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
|
|
1057
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1058
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
1059
|
+
type: AttributeUpdateType.STATE
|
|
1060
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
1061
|
+
type: AttributeUpdateType.STATE
|
|
1062
|
+
}), this.emitStateUpdateEvent()));
|
|
1138
1063
|
}
|
|
1139
1064
|
invalidateResolver() {
|
|
1140
1065
|
var _a, _b;
|
|
1141
1066
|
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
1142
|
-
this.syncStateResolveContext()
|
|
1143
|
-
this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
|
|
1067
|
+
this.syncStateResolveContext(), this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
|
|
1144
1068
|
this.stateEngine.invalidateResolverCache();
|
|
1145
1069
|
const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
1146
1070
|
this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
@@ -1273,9 +1197,8 @@ export class Graphic extends Node {
|
|
|
1273
1197
|
var _a, _b, _c;
|
|
1274
1198
|
(null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
|
|
1275
1199
|
(this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0,
|
|
1276
|
-
this.boundSharedStateRevision = void 0, this.
|
|
1277
|
-
this.
|
|
1278
|
-
this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0,
|
|
1200
|
+
this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0,
|
|
1201
|
+
this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
|
|
1279
1202
|
this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
|
|
1280
1203
|
}
|
|
1281
1204
|
setStageToShadowRoot(stage, layer) {
|