@visactor/vrender-core 1.1.0-alpha.24 → 1.1.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common/event-listener-manager.js +1 -2
- package/cjs/common/event-transformer.js +2 -1
- package/cjs/common/performance-raf.js +1 -1
- package/cjs/common/xml/is-xml.d.ts +2 -0
- package/cjs/common/xml/is-xml.js +14 -0
- package/cjs/common/xml/is-xml.js.map +1 -0
- package/cjs/common/xml/parser.d.ts +2 -2
- package/cjs/common/xml/parser.js +14 -11
- package/cjs/common/xml/parser.js.map +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/graphic-utils.js +1 -2
- package/cjs/core/layer-service.js +2 -1
- package/cjs/core/stage.d.ts +0 -9
- package/cjs/core/stage.js +11 -29
- package/cjs/core/stage.js.map +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/base.d.ts +2 -0
- package/cjs/graphic/base.js +15 -0
- package/cjs/graphic/base.js.map +1 -0
- 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-service/graphic-service.d.ts +0 -1
- package/cjs/graphic/graphic-service/graphic-service.js +1 -8
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +19 -29
- package/cjs/graphic/graphic.js +123 -201
- 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/graphic/tools.js +3 -3
- package/cjs/graphic/tools.js.map +1 -1
- package/cjs/index.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/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 +897 -2213
- package/es/common/event-listener-manager.js +1 -2
- package/es/common/event-transformer.js +2 -1
- package/es/common/performance-raf.js +1 -1
- package/es/common/xml/is-xml.d.ts +2 -0
- package/es/common/xml/is-xml.js +8 -0
- package/es/common/xml/is-xml.js.map +1 -0
- package/es/common/xml/parser.d.ts +2 -2
- package/es/common/xml/parser.js +3 -7
- package/es/common/xml/parser.js.map +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/graphic-utils.js +1 -2
- package/es/core/layer-service.js +2 -1
- package/es/core/stage.d.ts +0 -9
- package/es/core/stage.js +9 -30
- package/es/core/stage.js.map +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/base.d.ts +2 -0
- package/es/graphic/base.js +2 -0
- package/es/graphic/base.js.map +1 -0
- 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-service/graphic-service.d.ts +0 -1
- package/es/graphic/graphic-service/graphic-service.js +0 -10
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +19 -29
- package/es/graphic/graphic.js +123 -207
- 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/graphic/tools.js +3 -3
- package/es/graphic/tools.js.map +1 -1
- package/es/index.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/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/allocator/constants.d.ts +0 -9
- package/cjs/allocator/constants.js +0 -11
- package/cjs/allocator/constants.js.map +0 -1
- package/cjs/common/Reflect-metadata.d.ts +0 -2
- package/cjs/common/Reflect-metadata.js +0 -182
- package/cjs/common/Reflect-metadata.js.map +0 -1
- package/cjs/common/segment/curve/arc.d.ts +0 -17
- package/cjs/common/segment/curve/arc.js +0 -38
- package/cjs/common/segment/curve/arc.js.map +0 -1
- package/cjs/common/segment/curve/ellipse.d.ts +0 -21
- package/cjs/common/segment/curve/ellipse.js +0 -39
- package/cjs/common/segment/curve/ellipse.js.map +0 -1
- package/cjs/common/segment/curve/move.d.ts +0 -16
- package/cjs/common/segment/curve/move.js +0 -37
- package/cjs/common/segment/curve/move.js.map +0 -1
- package/cjs/common/store.d.ts +0 -2
- package/cjs/common/store.js +0 -2
- package/cjs/common/store.js.map +0 -1
- package/cjs/core/application.d.ts +0 -1
- package/cjs/core/application.js +0 -6
- package/cjs/core/application.js.map +0 -1
- package/cjs/core/global-module.d.ts +0 -1
- package/cjs/core/global-module.js +0 -1
- package/cjs/core/global-module.js.map +0 -1
- package/cjs/export.d.ts +0 -1
- package/cjs/export.js +0 -1
- package/cjs/export.js.map +0 -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/interface/creator.d.ts +0 -4
- package/cjs/interface/creator.js +0 -6
- package/cjs/interface/creator.js.map +0 -1
- package/cjs/interface/graphic/dynamic-path.d.ts +0 -1
- package/cjs/interface/graphic/dynamic-path.js +0 -3
- package/cjs/interface/graphic/dynamic-path.js.map +0 -1
- package/cjs/interface/graphic-utils.d.ts +0 -1
- package/cjs/interface/graphic-utils.js +0 -3
- package/cjs/interface/graphic-utils.js.map +0 -1
- package/cjs/interface/theme-service.d.ts +0 -1
- package/cjs/interface/theme-service.js +0 -3
- package/cjs/interface/theme-service.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/builtin-plugin/poptip-plugin.d.ts +0 -1
- package/cjs/plugins/builtin-plugin/poptip-plugin.js +0 -3
- package/cjs/plugins/builtin-plugin/poptip-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/cjs/render/contributions/render/clear-screen.d.ts +0 -1
- package/cjs/render/contributions/render/clear-screen.js +0 -3
- package/cjs/render/contributions/render/clear-screen.js.map +0 -1
- package/cjs/render/contributions/render/render-slector.d.ts +0 -1
- package/cjs/render/contributions/render/render-slector.js +0 -3
- package/cjs/render/contributions/render/render-slector.js.map +0 -1
- package/es/allocator/constants.d.ts +0 -9
- package/es/allocator/constants.js +0 -18
- package/es/allocator/constants.js.map +0 -1
- package/es/common/Reflect-metadata.d.ts +0 -2
- package/es/common/Reflect-metadata.js +0 -178
- package/es/common/Reflect-metadata.js.map +0 -1
- package/es/common/segment/curve/arc.d.ts +0 -17
- package/es/common/segment/curve/arc.js +0 -31
- package/es/common/segment/curve/arc.js.map +0 -1
- package/es/common/segment/curve/ellipse.d.ts +0 -21
- package/es/common/segment/curve/ellipse.js +0 -33
- package/es/common/segment/curve/ellipse.js.map +0 -1
- package/es/common/segment/curve/move.d.ts +0 -16
- package/es/common/segment/curve/move.js +0 -31
- package/es/common/segment/curve/move.js.map +0 -1
- package/es/common/store.d.ts +0 -2
- package/es/common/store.js +0 -2
- package/es/common/store.js.map +0 -1
- package/es/core/application.d.ts +0 -1
- package/es/core/application.js +0 -2
- package/es/core/application.js.map +0 -1
- package/es/core/global-module.d.ts +0 -1
- package/es/core/global-module.js +0 -1
- package/es/core/global-module.js.map +0 -1
- package/es/export.d.ts +0 -1
- package/es/export.js +0 -1
- package/es/export.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/interface/creator.d.ts +0 -4
- package/es/interface/creator.js +0 -2
- package/es/interface/creator.js.map +0 -1
- package/es/interface/graphic/dynamic-path.d.ts +0 -1
- package/es/interface/graphic/dynamic-path.js +0 -3
- package/es/interface/graphic/dynamic-path.js.map +0 -1
- package/es/interface/graphic-utils.d.ts +0 -1
- package/es/interface/graphic-utils.js +0 -3
- package/es/interface/graphic-utils.js.map +0 -1
- package/es/interface/theme-service.d.ts +0 -1
- package/es/interface/theme-service.js +0 -3
- package/es/interface/theme-service.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/builtin-plugin/poptip-plugin.d.ts +0 -1
- package/es/plugins/builtin-plugin/poptip-plugin.js +0 -3
- package/es/plugins/builtin-plugin/poptip-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/render/contributions/render/clear-screen.d.ts +0 -1
- package/es/render/contributions/render/clear-screen.js +0 -3
- package/es/render/contributions/render/clear-screen.js.map +0 -1
- package/es/render/contributions/render/render-slector.d.ts +0 -1
- package/es/render/contributions/render/render-slector.js +0 -3
- package/es/render/contributions/render/render-slector.js.map +0 -1
package/cjs/graphic/graphic.js
CHANGED
|
@@ -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"),
|
|
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"), is_xml_1 = require("../common/xml/is-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"), loadXMLParser = () => require("../common/xml/parser"), 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" ]),
|
|
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.
|
|
159
|
-
this.
|
|
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.
|
|
206
|
-
null !== (_b = this.
|
|
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
|
-
|
|
234
|
-
|
|
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.
|
|
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(),
|
|
@@ -549,8 +507,8 @@ class Graphic extends node_tree_1.Node {
|
|
|
549
507
|
if (path) return path;
|
|
550
508
|
if (path = Graphic.userSymbolMap[symbolType], path) return path;
|
|
551
509
|
symbolType = builtin_symbol_1.builtInSymbolStrMap[symbolType] || symbolType;
|
|
552
|
-
if (!0 === (0,
|
|
553
|
-
const parser = new
|
|
510
|
+
if (!0 === (0, is_xml_1.isSvg)(symbolType)) {
|
|
511
|
+
const {XMLParser: XMLParser} = require("../common/xml/parser"), parser = new XMLParser, {svg: svg} = parser.parse(symbolType);
|
|
554
512
|
if (!svg) return null;
|
|
555
513
|
const path = (0, vutils_1.isArray)(svg.path) ? svg.path : [ svg.path ];
|
|
556
514
|
_tempBounds.clear();
|
|
@@ -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
|
-
|
|
870
|
-
const {compiledDefinitions: compiledDefinitions
|
|
871
|
-
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.
|
|
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.
|
|
879
|
-
this.
|
|
880
|
-
this.
|
|
881
|
-
this.
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
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
|
-
|
|
848
|
+
resolveLocalUseStatesTransition(states) {
|
|
891
849
|
var _a;
|
|
892
|
-
if (!
|
|
893
|
-
|
|
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
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
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 !== (
|
|
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
|
|
982
|
-
|
|
983
|
-
this.effectiveStates =
|
|
984
|
-
this.
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
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,
|
|
1013
|
-
const plan = this.getStateTransitionOrchestrator().analyzeTransition(
|
|
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.
|
|
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
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
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.
|
|
1249
|
-
this.
|
|
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) {
|