@visactor/vrender-core 1.1.0-alpha.9 → 1.1.1-alpha.0
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/graphic-allocate.js +1 -2
- package/cjs/canvas/constants.js +2 -1
- package/cjs/common/contribution-provider.d.ts +2 -2
- package/cjs/common/contribution-provider.js +8 -4
- package/cjs/common/contribution-provider.js.map +1 -1
- package/cjs/common/diff.js +2 -1
- package/cjs/common/event-listener-manager.js +1 -2
- 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 -1
- package/cjs/common/polygon.js +2 -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 +2 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.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/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +1 -0
- package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -2
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.d.ts +2 -8
- package/cjs/core/stage.js +22 -28
- 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/entries/runtime-installer.d.ts +13 -0
- package/cjs/entries/runtime-installer.js +81 -12
- package/cjs/entries/runtime-installer.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-service/graphic-service.d.ts +4 -1
- package/cjs/graphic/graphic-service/graphic-service.js +7 -13
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +80 -28
- package/cjs/graphic/graphic.js +499 -220
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +5 -3
- package/cjs/graphic/group.js +44 -31
- 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 -31
- 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 +21 -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 +2 -2
- package/cjs/graphic/tools.js.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interface/animation/animate.d.ts +1 -0
- package/cjs/interface/animation/animate.js.map +1 -1
- package/cjs/interface/global.d.ts +8 -4
- package/cjs/interface/global.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 +10 -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.d.ts +4 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +27 -17
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +3 -2
- package/cjs/plugins/builtin-plugin/flex-layout-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 +1 -1
- package/cjs/registry/contribution-registry.js +6 -2
- package/cjs/registry/contribution-registry.js.map +1 -1
- package/cjs/registry/picker-registry.d.ts +1 -1
- package/cjs/registry/picker-registry.js +2 -2
- package/cjs/registry/picker-registry.js.map +1 -1
- package/cjs/registry/renderer-registry.d.ts +1 -1
- package/cjs/registry/renderer-registry.js +2 -2
- package/cjs/registry/renderer-registry.js.map +1 -1
- package/cjs/registry/types.d.ts +3 -3
- package/cjs/registry/types.js.map +1 -1
- package/cjs/render/contributions/render/arc-module.js +5 -6
- package/cjs/render/contributions/render/arc-module.js.map +1 -1
- package/cjs/render/contributions/render/arc3d-module.js +3 -5
- package/cjs/render/contributions/render/arc3d-module.js.map +1 -1
- package/cjs/render/contributions/render/area-module.js +6 -8
- package/cjs/render/contributions/render/area-module.js.map +1 -1
- package/cjs/render/contributions/render/base-render.js +8 -7
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/circle-module.js +4 -5
- package/cjs/render/contributions/render/circle-module.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +6 -2
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/glyph-module.js +3 -5
- package/cjs/render/contributions/render/glyph-module.js.map +1 -1
- package/cjs/render/contributions/render/image-module.js +3 -4
- package/cjs/render/contributions/render/image-module.js.map +1 -1
- package/cjs/render/contributions/render/line-module.js +3 -7
- package/cjs/render/contributions/render/line-module.js.map +1 -1
- package/cjs/render/contributions/render/path-module.js +5 -6
- package/cjs/render/contributions/render/path-module.js.map +1 -1
- package/cjs/render/contributions/render/polygon-module.js +3 -4
- package/cjs/render/contributions/render/polygon-module.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-module.js +3 -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 +3 -4
- package/cjs/render/contributions/render/rect3d-module.js.map +1 -1
- package/cjs/render/contributions/render/richtext-module.js +3 -4
- package/cjs/render/contributions/render/richtext-module.js.map +1 -1
- package/cjs/render/contributions/render/star-module.js +4 -5
- package/cjs/render/contributions/render/star-module.js.map +1 -1
- package/cjs/render/contributions/render/star-render.d.ts +2 -2
- package/cjs/render/contributions/render/star-render.js +3 -3
- package/cjs/render/contributions/render/star-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-module.js +4 -5
- package/cjs/render/contributions/render/symbol-module.js.map +1 -1
- package/cjs/render/contributions/render/text-module.js +3 -4
- package/cjs/render/contributions/render/text-module.js.map +1 -1
- package/cjs/resource-loader/loader.js +5 -0
- package/cjs/resource-loader/loader.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 +1440 -1780
- package/es/allocator/graphic-allocate.js +1 -2
- package/es/canvas/constants.js +2 -1
- package/es/common/contribution-provider.d.ts +2 -2
- package/es/common/contribution-provider.js +8 -4
- package/es/common/contribution-provider.js.map +1 -1
- package/es/common/diff.js +2 -1
- package/es/common/event-listener-manager.js +1 -2
- 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 -1
- package/es/common/polygon.js +1 -1
- 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 +2 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.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/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/contributions/layerHandler/canvas2d-contribution.js +1 -0
- package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -2
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.d.ts +2 -8
- package/es/core/stage.js +20 -30
- 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/entries/runtime-installer.d.ts +13 -0
- package/es/entries/runtime-installer.js +80 -9
- package/es/entries/runtime-installer.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-service/graphic-service.d.ts +4 -1
- package/es/graphic/graphic-service/graphic-service.js +6 -15
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +80 -28
- package/es/graphic/graphic.js +492 -217
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +5 -3
- package/es/graphic/group.js +43 -31
- 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 -27
- 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 +18 -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 +1 -3
- package/es/graphic/tools.js.map +1 -1
- package/es/index.js.map +1 -1
- package/es/interface/animation/animate.d.ts +1 -0
- package/es/interface/animation/animate.js.map +1 -1
- package/es/interface/global.d.ts +8 -4
- package/es/interface/global.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 +10 -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.d.ts +4 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +27 -17
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +3 -2
- package/es/plugins/builtin-plugin/flex-layout-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 +1 -1
- package/es/registry/contribution-registry.js +6 -2
- package/es/registry/contribution-registry.js.map +1 -1
- package/es/registry/picker-registry.d.ts +1 -1
- package/es/registry/picker-registry.js +2 -2
- package/es/registry/picker-registry.js.map +1 -1
- package/es/registry/renderer-registry.d.ts +1 -1
- package/es/registry/renderer-registry.js +2 -2
- package/es/registry/renderer-registry.js.map +1 -1
- package/es/registry/types.d.ts +3 -3
- package/es/registry/types.js.map +1 -1
- package/es/render/contributions/render/arc-module.js +6 -4
- package/es/render/contributions/render/arc-module.js.map +1 -1
- package/es/render/contributions/render/arc3d-module.js +5 -3
- package/es/render/contributions/render/arc3d-module.js.map +1 -1
- package/es/render/contributions/render/area-module.js +7 -7
- package/es/render/contributions/render/area-module.js.map +1 -1
- package/es/render/contributions/render/base-render.js +8 -6
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/circle-module.js +6 -4
- package/es/render/contributions/render/circle-module.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +6 -2
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/glyph-module.js +5 -3
- package/es/render/contributions/render/glyph-module.js.map +1 -1
- package/es/render/contributions/render/image-module.js +5 -3
- package/es/render/contributions/render/image-module.js.map +1 -1
- package/es/render/contributions/render/line-module.js +4 -5
- package/es/render/contributions/render/line-module.js.map +1 -1
- package/es/render/contributions/render/path-module.js +6 -4
- package/es/render/contributions/render/path-module.js.map +1 -1
- package/es/render/contributions/render/polygon-module.js +5 -3
- package/es/render/contributions/render/polygon-module.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-module.js +5 -3
- 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 +5 -3
- package/es/render/contributions/render/rect3d-module.js.map +1 -1
- package/es/render/contributions/render/richtext-module.js +5 -3
- package/es/render/contributions/render/richtext-module.js.map +1 -1
- package/es/render/contributions/render/star-module.js +7 -4
- package/es/render/contributions/render/star-module.js.map +1 -1
- package/es/render/contributions/render/star-render.d.ts +2 -2
- package/es/render/contributions/render/star-render.js +3 -3
- package/es/render/contributions/render/star-render.js.map +1 -1
- package/es/render/contributions/render/symbol-module.js +6 -4
- package/es/render/contributions/render/symbol-module.js.map +1 -1
- package/es/render/contributions/render/text-module.js +5 -3
- package/es/render/contributions/render/text-module.js.map +1 -1
- package/es/resource-loader/loader.js +5 -0
- package/es/resource-loader/loader.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 +247 -3
- 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 -3
- 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 -119
- package/cjs/graphic/state/state-perf-monitor.js +0 -217
- package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
- package/cjs/graphic/state/state-style-resolver.d.ts +0 -22
- package/cjs/graphic/state/state-style-resolver.js +0 -73
- 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 -3
- 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 -119
- package/es/graphic/state/state-perf-monitor.js +0 -207
- package/es/graphic/state/state-perf-monitor.js.map +0 -1
- package/es/graphic/state/state-style-resolver.d.ts +0 -22
- package/es/graphic/state/state-style-resolver.js +0 -65
- 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/es/graphic/graphic.js
CHANGED
|
@@ -34,11 +34,7 @@ import { StateDefinitionCompiler } from "./state/state-definition-compiler";
|
|
|
34
34
|
|
|
35
35
|
import { StateEngine } from "./state/state-engine";
|
|
36
36
|
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
import { UpdateCategory, classifyAttributeDelta } from "./state/attribute-update-classifier";
|
|
40
|
-
|
|
41
|
-
import { StateStyleResolver } from "./state/state-style-resolver";
|
|
37
|
+
import { ATTRIBUTE_CATEGORY, UpdateCategory, classifyAttributeDelta } from "./state/attribute-update-classifier";
|
|
42
38
|
|
|
43
39
|
import { StateTransitionOrchestrator } from "./state/state-transition-orchestrator";
|
|
44
40
|
|
|
@@ -46,18 +42,16 @@ import { collectSharedStateScopeChain, ensureSharedStateScopeFresh } from "./sta
|
|
|
46
42
|
|
|
47
43
|
import { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from "./state/shared-state-refresh";
|
|
48
44
|
|
|
49
|
-
import { getStageStatePerfMonitor } 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" ]), point = new Point;
|
|
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
|
-
return "object" == typeof value && null != value && !isArray(value);
|
|
54
|
+
return "object" == typeof value && null != value && !Array.isArray(value);
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
function cloneAttributeValue(value) {
|
|
@@ -69,14 +63,6 @@ function cloneAttributeValue(value) {
|
|
|
69
63
|
})), clone;
|
|
70
64
|
}
|
|
71
65
|
|
|
72
|
-
function cloneSimpleAttributeRecord(value) {
|
|
73
|
-
return isPlainObjectValue(value) ? Object.assign({}, value) : value;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function shouldUseSimpleAttributeFastPath(value) {
|
|
77
|
-
return !!isPlainObjectValue(value) && !Object.keys(value).some((key => isPlainObjectValue(value[key])));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
66
|
function cloneAttributeSurface(value) {
|
|
81
67
|
if (!isPlainObjectValue(value)) return value;
|
|
82
68
|
const source = value, clone = {};
|
|
@@ -86,6 +72,10 @@ function cloneAttributeSurface(value) {
|
|
|
86
72
|
})), clone;
|
|
87
73
|
}
|
|
88
74
|
|
|
75
|
+
function areAttributeValuesEqual(left, right) {
|
|
76
|
+
return left === right || !!(isPlainObjectValue(left) || isPlainObjectValue(right) || Array.isArray(left) || Array.isArray(right)) && isEqual(left, right);
|
|
77
|
+
}
|
|
78
|
+
|
|
89
79
|
function deepMergeAttributeValue(base, value) {
|
|
90
80
|
var _a;
|
|
91
81
|
const result = null !== (_a = cloneAttributeValue(base)) && void 0 !== _a ? _a : {};
|
|
@@ -149,19 +139,27 @@ export class Graphic extends Node {
|
|
|
149
139
|
get globalTransMatrix() {
|
|
150
140
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
151
141
|
}
|
|
142
|
+
get baseAttributes() {
|
|
143
|
+
var _a;
|
|
144
|
+
return null !== (_a = this._baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
145
|
+
}
|
|
146
|
+
set baseAttributes(value) {
|
|
147
|
+
value !== this.attribute ? this._baseAttributes = value : this._baseAttributes = void 0;
|
|
148
|
+
}
|
|
152
149
|
constructor(params = {}) {
|
|
153
150
|
var _a;
|
|
154
|
-
super(), this.
|
|
155
|
-
const useSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath(params), initialBaseAttributes = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params);
|
|
156
|
-
this.baseAttributes = initialBaseAttributes, this.attribute = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(initialBaseAttributes) : cloneAttributeSurface(initialBaseAttributes),
|
|
151
|
+
super(), this._AABBBounds = new AABBBounds, this._updateTag = UpdateTag.INIT, this.attribute = params,
|
|
157
152
|
this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0),
|
|
158
|
-
isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
153
|
+
params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
154
|
+
params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
159
155
|
}
|
|
160
156
|
get normalAttrs() {
|
|
161
157
|
return this.baseAttributes;
|
|
162
158
|
}
|
|
163
|
-
set normalAttrs(
|
|
164
|
-
|
|
159
|
+
set normalAttrs(_value) {}
|
|
160
|
+
getBaseAttributesStorage() {
|
|
161
|
+
var _a;
|
|
162
|
+
return null !== (_a = this._baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
165
163
|
}
|
|
166
164
|
getGraphicService() {
|
|
167
165
|
var _a, _b;
|
|
@@ -170,12 +168,6 @@ export class Graphic extends Node {
|
|
|
170
168
|
getAttributes() {
|
|
171
169
|
return this.attribute;
|
|
172
170
|
}
|
|
173
|
-
getStateStyleResolver(mergeMode) {
|
|
174
|
-
return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
|
|
175
|
-
mergeMode: "deep"
|
|
176
|
-
})), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver),
|
|
177
|
-
this.stateStyleResolver);
|
|
178
|
-
}
|
|
179
171
|
getStateTransitionOrchestrator() {
|
|
180
172
|
return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator),
|
|
181
173
|
this.stateTransitionOrchestrator;
|
|
@@ -194,16 +186,23 @@ export class Graphic extends Node {
|
|
|
194
186
|
const nextScope = this.resolveBoundSharedStateScope();
|
|
195
187
|
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
|
|
196
188
|
!1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
|
|
197
|
-
this.
|
|
198
|
-
this.
|
|
199
|
-
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(),
|
|
200
191
|
markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
|
|
201
192
|
!0);
|
|
202
193
|
}
|
|
203
|
-
|
|
194
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
|
|
204
195
|
var _a, _b;
|
|
205
|
-
|
|
206
|
-
|
|
196
|
+
return !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.boundSharedStateScope || (null === (_b = this.registeredActiveScopes) || void 0 === _b ? void 0 : _b.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingFromTree(markDirty);
|
|
197
|
+
}
|
|
198
|
+
syncSharedStateActiveRegistrations() {
|
|
199
|
+
var _a;
|
|
200
|
+
const previousScopes = this.registeredActiveScopes;
|
|
201
|
+
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach((scope => {
|
|
202
|
+
scope.subtreeActiveDescendants.delete(this);
|
|
203
|
+
})), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
204
|
+
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
205
|
+
null == previousScopes || previousScopes.forEach((scope => {
|
|
207
206
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
208
207
|
})), nextScopes.forEach((scope => {
|
|
209
208
|
scope.subtreeActiveDescendants.add(this);
|
|
@@ -220,7 +219,7 @@ export class Graphic extends Node {
|
|
|
220
219
|
scheduleStageSharedStateRefresh(this.stage);
|
|
221
220
|
}
|
|
222
221
|
onParentSharedStateTreeChanged(stage, layer) {
|
|
223
|
-
this.stage === stage && this.layer === layer ? this.
|
|
222
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
224
223
|
}
|
|
225
224
|
refreshSharedStateBeforeRender() {
|
|
226
225
|
var _a;
|
|
@@ -228,15 +227,13 @@ export class Graphic extends Node {
|
|
|
228
227
|
this.boundSharedStateScope && ensureSharedStateScopeFresh(this.boundSharedStateScope),
|
|
229
228
|
this.recomputeCurrentStatePatch(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
230
229
|
type: AttributeUpdateType.STATE
|
|
231
|
-
}), this.
|
|
232
|
-
type: AttributeUpdateType.STATE
|
|
233
|
-
}), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
230
|
+
}), this.emitStateUpdateEvent(), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
234
231
|
}
|
|
235
232
|
getLocalStatesVersion() {
|
|
236
233
|
var _a, _b;
|
|
237
234
|
return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
|
|
238
|
-
this.
|
|
239
|
-
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;
|
|
240
237
|
}
|
|
241
238
|
resolveEffectiveCompiledDefinitions() {
|
|
242
239
|
this.syncSharedStateScopeBindingFromTree(!1);
|
|
@@ -245,49 +242,25 @@ export class Graphic extends Node {
|
|
|
245
242
|
const hasStates = !!this.states && Object.keys(this.states).length > 0;
|
|
246
243
|
if (!boundScope) {
|
|
247
244
|
if (!hasStates) return {
|
|
248
|
-
compiledDefinitions: void 0
|
|
249
|
-
stateProxyModeKey: "none"
|
|
245
|
+
compiledDefinitions: void 0
|
|
250
246
|
};
|
|
251
247
|
const cacheKey = `local:${this.getLocalStatesVersion()}`;
|
|
252
248
|
return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new StateDefinitionCompiler).compile(this.states),
|
|
253
249
|
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
254
|
-
compiledDefinitions: this.compiledStateDefinitions
|
|
255
|
-
stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
|
|
250
|
+
compiledDefinitions: this.compiledStateDefinitions
|
|
256
251
|
};
|
|
257
252
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
261
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
262
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
263
|
-
};
|
|
264
|
-
const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
|
|
265
|
-
if (Object.keys(localStates).forEach((stateName => {
|
|
266
|
-
sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
|
|
267
|
-
missingStateNames.push(stateName));
|
|
268
|
-
})), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
|
|
269
|
-
{
|
|
270
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
271
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
272
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
273
|
-
};
|
|
274
|
-
const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
|
|
275
|
-
return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
|
|
276
|
-
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
277
|
-
compiledDefinitions: this.localFallbackCompiledDefinitions,
|
|
278
|
-
stateProxyModeKey: stateProxyModeKey,
|
|
279
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
253
|
+
return {
|
|
254
|
+
compiledDefinitions: boundScope.effectiveCompiledDefinitions
|
|
280
255
|
};
|
|
281
256
|
}
|
|
282
257
|
recomputeCurrentStatePatch() {
|
|
283
|
-
var _a, _b
|
|
258
|
+
var _a, _b;
|
|
284
259
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
|
|
285
260
|
this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
|
|
286
|
-
const stateResolveBaseAttrs = null !== (_b =
|
|
287
|
-
null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs);
|
|
288
|
-
const transition = stateModel.useStates(this.currentStates), effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
261
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs), effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
289
262
|
this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
|
|
290
|
-
this.resolvedStatePatch =
|
|
263
|
+
this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
|
|
291
264
|
}
|
|
292
265
|
buildStaticAttributeSnapshot() {
|
|
293
266
|
var _a;
|
|
@@ -313,76 +286,193 @@ export class Graphic extends Node {
|
|
|
313
286
|
} else assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));
|
|
314
287
|
})), extraAttrs;
|
|
315
288
|
}
|
|
316
|
-
syncObjectToSnapshot(target, snapshot) {
|
|
289
|
+
syncObjectToSnapshot(target, snapshot, excludedKeys) {
|
|
317
290
|
const delta = new Map;
|
|
318
291
|
return new Set([ ...Object.keys(target), ...Object.keys(snapshot) ]).forEach((key => {
|
|
292
|
+
if (!0 === (null == excludedKeys ? void 0 : excludedKeys[key])) return;
|
|
319
293
|
const hasNext = Object.prototype.hasOwnProperty.call(snapshot, key), previousValue = target[key];
|
|
320
294
|
if (!hasNext) return void (Object.prototype.hasOwnProperty.call(target, key) && (delta.set(key, {
|
|
321
295
|
prev: previousValue,
|
|
322
296
|
next: void 0
|
|
323
297
|
}), delete target[key]));
|
|
324
298
|
const nextValue = snapshot[key];
|
|
325
|
-
|
|
299
|
+
areAttributeValuesEqual(previousValue, nextValue) || (delta.set(key, {
|
|
326
300
|
prev: previousValue,
|
|
327
301
|
next: nextValue
|
|
328
302
|
}), target[key] = cloneAttributeValue(nextValue));
|
|
329
303
|
})), delta;
|
|
330
304
|
}
|
|
331
|
-
_syncAttribute() {
|
|
332
|
-
|
|
333
|
-
|
|
305
|
+
_syncAttribute(excludedKeys) {
|
|
306
|
+
this.attribute === this.baseAttributes && this.resolvedStatePatch && this.detachAttributeFromBaseAttributes();
|
|
307
|
+
const snapshot = this.buildStaticAttributeSnapshot(), delta = this.syncObjectToSnapshot(this.attribute, snapshot, excludedKeys);
|
|
308
|
+
return this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !!excludedKeys,
|
|
309
|
+
delta;
|
|
334
310
|
}
|
|
335
|
-
_syncFinalAttributeFromStaticTruth() {
|
|
311
|
+
_syncFinalAttributeFromStaticTruth(excludedKeys) {
|
|
336
312
|
const target = this.finalAttribute;
|
|
337
313
|
if (!target) return;
|
|
338
314
|
const snapshot = this.buildStaticAttributeSnapshot();
|
|
339
|
-
this.syncObjectToSnapshot(target, snapshot);
|
|
315
|
+
this.syncObjectToSnapshot(target, snapshot, excludedKeys);
|
|
340
316
|
}
|
|
341
|
-
|
|
317
|
+
mergeAttributeDeltaCategory(category, key, prev, next) {
|
|
342
318
|
var _a;
|
|
319
|
+
let nextCategory = "stroke" === key || "shadowBlur" === key ? classifyAttributeDelta(key, prev, next) : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
|
|
320
|
+
return nextCategory & UpdateCategory.PICK && (nextCategory |= UpdateCategory.BOUNDS),
|
|
321
|
+
nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS),
|
|
322
|
+
category | nextCategory;
|
|
323
|
+
}
|
|
324
|
+
submitUpdateByCategory(category, forceUpdateTag = !1) {
|
|
343
325
|
if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
|
|
344
326
|
void this.addUpdateLayoutTag();
|
|
327
|
+
(category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
|
|
328
|
+
category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
|
|
329
|
+
category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
|
|
330
|
+
}
|
|
331
|
+
submitUpdateByDelta(delta, forceUpdateTag = !1) {
|
|
345
332
|
let category = UpdateCategory.NONE;
|
|
346
333
|
delta.forEach(((entry, key) => {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
334
|
+
category = this.mergeAttributeDeltaCategory(category, key, entry.prev, entry.next);
|
|
335
|
+
})), this.submitUpdateByCategory(category, forceUpdateTag);
|
|
336
|
+
}
|
|
337
|
+
submitTouchedKeyUpdate(keys, forceUpdateTag = !1) {
|
|
338
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTags(keys));
|
|
339
|
+
}
|
|
340
|
+
submitTouchedUpdate(needsShapeAndBounds) {
|
|
341
|
+
!this.updateShapeAndBoundsTagSetted() && needsShapeAndBounds ? this.addUpdateShapeAndBoundsTag() : this.addUpdateBoundTag(),
|
|
342
|
+
this.addUpdatePositionTag(), this.addUpdateLayoutTag();
|
|
354
343
|
}
|
|
355
344
|
commitBaseAttributeMutation(forceUpdateTag = !1, context) {
|
|
356
|
-
var _a, _b;
|
|
357
|
-
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch
|
|
358
|
-
null === (
|
|
345
|
+
var _a, _b, _c;
|
|
346
|
+
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
|
|
347
|
+
null === (_c = this.stateEngine) || void 0 === _c || _c.invalidateResolverCache(),
|
|
359
348
|
this.recomputeCurrentStatePatch());
|
|
360
349
|
const delta = this._syncAttribute();
|
|
361
350
|
this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
362
351
|
}
|
|
352
|
+
canCommitBaseAttributesByTouchedKeys() {
|
|
353
|
+
var _a, _b;
|
|
354
|
+
return !((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.resolvedStatePatch || this.attributeMayContainTransientAttrs) && (!(null === (_b = this.animates) || void 0 === _b ? void 0 : _b.size) && !this._animationStateManager || !this.hasAnyTrackedAnimate());
|
|
355
|
+
}
|
|
356
|
+
detachAttributeFromBaseAttributes() {
|
|
357
|
+
this.attribute === this.baseAttributes && (this._baseAttributes = this.attribute,
|
|
358
|
+
this.attribute = cloneAttributeSurface(this.attribute));
|
|
359
|
+
}
|
|
360
|
+
commitInternalBaseAttributes(params, context) {
|
|
361
|
+
params && Object.keys(params).length && (this.canCommitBaseAttributesByTouchedKeys() ? this.commitBaseAttributesByTouchedKeys(params, !1, context) : (this.detachAttributeFromBaseAttributes(),
|
|
362
|
+
this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context)));
|
|
363
|
+
}
|
|
364
|
+
commitBaseAttributesByTouchedKeys(params, forceUpdateTag = !1, context) {
|
|
365
|
+
const source = params, baseAttributes = this.getBaseAttributesStorage();
|
|
366
|
+
let hasKeys = !1, needsShapeAndBounds = forceUpdateTag;
|
|
367
|
+
for (const key in source) Object.prototype.hasOwnProperty.call(source, key) && (hasKeys = !0,
|
|
368
|
+
baseAttributes[key] = source[key], !needsShapeAndBounds && this.needUpdateTag(key) && (needsShapeAndBounds = !0));
|
|
369
|
+
hasKeys && (this.attribute = baseAttributes, this._baseAttributes = void 0, this.valid = this.isValid(),
|
|
370
|
+
this.attributeMayContainTransientAttrs = !1, this.submitTouchedUpdate(needsShapeAndBounds),
|
|
371
|
+
this.onAttributeUpdate(context));
|
|
372
|
+
}
|
|
373
|
+
commitBaseAttributeBySingleKey(key, value, forceUpdateTag = !1, context) {
|
|
374
|
+
this.getBaseAttributesStorage()[key] = value, this.attribute = this.getBaseAttributesStorage(),
|
|
375
|
+
this._baseAttributes = void 0, this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1,
|
|
376
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTag(key)), this.onAttributeUpdate(context);
|
|
377
|
+
}
|
|
363
378
|
applyBaseAttributes(params) {
|
|
364
379
|
const keys = Object.keys(params);
|
|
365
380
|
for (let i = 0; i < keys.length; i++) {
|
|
366
381
|
const key = keys[i];
|
|
367
|
-
this.
|
|
382
|
+
this.getBaseAttributesStorage()[key] = params[key];
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
_commitAnimationStaticAttributes(params, context) {
|
|
386
|
+
if (!params) return;
|
|
387
|
+
const source = params, baseAttributes = this.getBaseAttributesStorage(), target = this.attribute, delta = new Map;
|
|
388
|
+
let hasKeys = !1;
|
|
389
|
+
for (const key in source) {
|
|
390
|
+
if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
|
|
391
|
+
hasKeys = !0;
|
|
392
|
+
const previousValue = target[key], nextValue = source[key];
|
|
393
|
+
baseAttributes[key] = nextValue, target[key] = nextValue, areAttributeValuesEqual(previousValue, nextValue) || delta.set(key, {
|
|
394
|
+
prev: previousValue,
|
|
395
|
+
next: nextValue
|
|
396
|
+
});
|
|
368
397
|
}
|
|
398
|
+
hasKeys && (this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !0,
|
|
399
|
+
this.submitUpdateByDelta(delta), this.onAttributeUpdate(context));
|
|
400
|
+
}
|
|
401
|
+
applyAnimationTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
402
|
+
const source = params;
|
|
403
|
+
let target, needsShapeAndBounds = forceUpdateTag;
|
|
404
|
+
for (const key in source) Object.prototype.hasOwnProperty.call(source, key) && (target || (this.detachAttributeFromBaseAttributes(),
|
|
405
|
+
target = this.attribute), target[key] = source[key], !needsShapeAndBounds && this.needUpdateTag(key) && (needsShapeAndBounds = !0));
|
|
406
|
+
target && (this.attributeMayContainTransientAttrs = !0, this.valid = this.isValid(),
|
|
407
|
+
this.submitTouchedUpdate(needsShapeAndBounds), this.onAttributeUpdate(context));
|
|
369
408
|
}
|
|
370
409
|
applyTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
410
|
+
this.detachAttributeFromBaseAttributes();
|
|
371
411
|
const delta = new Map, keys = Object.keys(params);
|
|
372
412
|
for (let i = 0; i < keys.length; i++) {
|
|
373
413
|
const key = keys[i], previousValue = this.attribute[key], nextValue = params[key];
|
|
374
|
-
|
|
414
|
+
areAttributeValuesEqual(previousValue, nextValue) || (delta.set(key, {
|
|
375
415
|
prev: previousValue,
|
|
376
416
|
next: nextValue
|
|
377
|
-
}), this.attribute[key] =
|
|
417
|
+
}), this.attribute[key] = nextValue);
|
|
378
418
|
}
|
|
379
|
-
this.
|
|
419
|
+
delta.size && (this.attributeMayContainTransientAttrs = !0), this.valid = this.isValid(),
|
|
420
|
+
this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
380
421
|
}
|
|
381
|
-
_restoreAttributeFromStaticTruth(context) {
|
|
382
|
-
this._syncFinalAttributeFromStaticTruth();
|
|
383
|
-
const delta = this._syncAttribute();
|
|
422
|
+
_restoreAttributeFromStaticTruth(context, excludedKeys) {
|
|
423
|
+
this._syncFinalAttributeFromStaticTruth(excludedKeys);
|
|
424
|
+
const delta = this._syncAttribute(excludedKeys);
|
|
384
425
|
this.submitUpdateByDelta(delta), this.onAttributeUpdate(context);
|
|
385
426
|
}
|
|
427
|
+
collectStatePatchDeltaKeys(previousPatch, nextPatch) {
|
|
428
|
+
const keys = previousPatch ? Object.keys(previousPatch) : [];
|
|
429
|
+
if (!nextPatch) return keys;
|
|
430
|
+
for (const key in nextPatch) Object.prototype.hasOwnProperty.call(nextPatch, key) && !Object.prototype.hasOwnProperty.call(null != previousPatch ? previousPatch : {}, key) && keys.push(key);
|
|
431
|
+
return keys;
|
|
432
|
+
}
|
|
433
|
+
getStaticTruthValueForStateKey(key, nextPatch) {
|
|
434
|
+
var _a;
|
|
435
|
+
const baseAttributes = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {}, patch = nextPatch;
|
|
436
|
+
if (patch && Object.prototype.hasOwnProperty.call(patch, key)) {
|
|
437
|
+
const patchValue = patch[key], baseValue = baseAttributes[key];
|
|
438
|
+
return "deep" === this.stateMergeMode && isPlainObjectValue(baseValue) && isPlainObjectValue(patchValue) ? {
|
|
439
|
+
hasValue: !0,
|
|
440
|
+
value: deepMergeAttributeValue(baseValue, patchValue)
|
|
441
|
+
} : {
|
|
442
|
+
hasValue: !0,
|
|
443
|
+
value: patchValue
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
return Object.prototype.hasOwnProperty.call(baseAttributes, key) ? {
|
|
447
|
+
hasValue: !0,
|
|
448
|
+
value: baseAttributes[key]
|
|
449
|
+
} : {
|
|
450
|
+
hasValue: !1,
|
|
451
|
+
value: void 0
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
syncStatePatchDeltaToTarget(target, keys, nextPatch, collectCategory = !1) {
|
|
455
|
+
let category = UpdateCategory.NONE;
|
|
456
|
+
for (let i = 0; i < keys.length; i++) {
|
|
457
|
+
const key = keys[i], previousValue = target[key], next = this.getStaticTruthValueForStateKey(key, nextPatch);
|
|
458
|
+
if (!next.hasValue) {
|
|
459
|
+
Object.prototype.hasOwnProperty.call(target, key) && (delete target[key], collectCategory && (category = this.mergeAttributeDeltaCategory(category, key, previousValue, void 0)));
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
if (areAttributeValuesEqual(previousValue, next.value)) continue;
|
|
463
|
+
const nextValue = cloneAttributeValue(next.value);
|
|
464
|
+
target[key] = nextValue, collectCategory && (category = this.mergeAttributeDeltaCategory(category, key, previousValue, nextValue));
|
|
465
|
+
}
|
|
466
|
+
return category;
|
|
467
|
+
}
|
|
468
|
+
restoreAttributeFromStatePatchDelta(previousPatch, nextPatch, context) {
|
|
469
|
+
this.detachAttributeFromBaseAttributes();
|
|
470
|
+
const keys = this.collectStatePatchDeltaKeys(previousPatch, nextPatch), finalAttribute = this.finalAttribute;
|
|
471
|
+
finalAttribute && this.syncStatePatchDeltaToTarget(finalAttribute, keys, nextPatch, !1);
|
|
472
|
+
const category = this.syncStatePatchDeltaToTarget(this.attribute, keys, nextPatch, !0);
|
|
473
|
+
this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1, this.submitUpdateByCategory(category),
|
|
474
|
+
this.onAttributeUpdate(context);
|
|
475
|
+
}
|
|
386
476
|
setMode(mode) {
|
|
387
477
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
388
478
|
}
|
|
@@ -402,7 +492,7 @@ export class Graphic extends Node {
|
|
|
402
492
|
return point;
|
|
403
493
|
}
|
|
404
494
|
onAnimateBind(animate) {
|
|
405
|
-
this._emitCustomEvent("animate-bind", animate);
|
|
495
|
+
this.detachAttributeFromBaseAttributes(), this._emitCustomEvent("animate-bind", animate);
|
|
406
496
|
}
|
|
407
497
|
visitTrackedAnimates(cb) {
|
|
408
498
|
const hook = this.forEachTrackedAnimate;
|
|
@@ -415,8 +505,22 @@ export class Graphic extends Node {
|
|
|
415
505
|
const getTrackedAnimates = this.getTrackedAnimates;
|
|
416
506
|
return "function" == typeof getTrackedAnimates ? getTrackedAnimates.call(this).size > 0 : !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size);
|
|
417
507
|
}
|
|
508
|
+
mayHaveTrackedAnimates() {
|
|
509
|
+
var _a;
|
|
510
|
+
return !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size) || !!this._animationStateManager;
|
|
511
|
+
}
|
|
418
512
|
tryUpdateAABBBounds() {
|
|
513
|
+
if (!(this.shadowRoot || this._updateTag & UpdateTag.UPDATE_BOUNDS)) return this._AABBBounds;
|
|
419
514
|
const full = "imprecise" === this.attribute.boundsMode;
|
|
515
|
+
if (!this.shadowRoot) {
|
|
516
|
+
const graphicService = this.getGraphicService(), graphicTheme = this.getGraphicTheme();
|
|
517
|
+
if (!graphicService.validCheck(this.attribute, graphicTheme, this._AABBBounds, this)) return this._AABBBounds;
|
|
518
|
+
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
519
|
+
graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
520
|
+
const bounds = this.doUpdateAABBBounds(full, graphicTheme);
|
|
521
|
+
return graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
|
|
522
|
+
"empty" === this.attribute.boundsMode && bounds.clear(), bounds;
|
|
523
|
+
}
|
|
420
524
|
if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
|
|
421
525
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
422
526
|
this.getGraphicService().beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
@@ -480,11 +584,11 @@ export class Graphic extends Node {
|
|
|
480
584
|
const _parsedPath = new CustomSymbolClass(symbolType, cache);
|
|
481
585
|
return Graphic.userSymbolMap[symbolType] = _parsedPath, _parsedPath;
|
|
482
586
|
}
|
|
483
|
-
doUpdateAABBBounds(full) {
|
|
587
|
+
doUpdateAABBBounds(full, graphicTheme) {
|
|
484
588
|
this.updateAABBBoundsStamp++;
|
|
485
|
-
const
|
|
589
|
+
const resolvedGraphicTheme = null != graphicTheme ? graphicTheme : this.getGraphicTheme();
|
|
486
590
|
this._AABBBounds.clear();
|
|
487
|
-
const attribute = this.attribute, bounds = this.updateAABBBounds(attribute,
|
|
591
|
+
const attribute = this.attribute, bounds = this.updateAABBBounds(attribute, resolvedGraphicTheme, this._AABBBounds, full), {boundsPadding: boundsPadding = resolvedGraphicTheme.boundsPadding} = attribute, paddingArray = parsePadding(boundsPadding);
|
|
488
592
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(),
|
|
489
593
|
bounds;
|
|
490
594
|
}
|
|
@@ -555,27 +659,71 @@ export class Graphic extends Node {
|
|
|
555
659
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
556
660
|
}
|
|
557
661
|
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
662
|
+
if (!params) return;
|
|
663
|
+
const keys = Object.keys(params);
|
|
664
|
+
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.syncFinalAttributesFromUpdateContext(context),
|
|
558
665
|
this.visitTrackedAnimates((animate => {
|
|
559
|
-
(animate.priority !== 1 / 0 || ignorePriority) &&
|
|
560
|
-
animate.preventAttr(key);
|
|
561
|
-
}));
|
|
666
|
+
(animate.priority !== 1 / 0 || ignorePriority) && animate.preventAttrs(keys);
|
|
562
667
|
})), this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
563
668
|
}
|
|
669
|
+
syncFinalAttributesFromUpdateContext(context) {
|
|
670
|
+
var _a;
|
|
671
|
+
const updateType = null == context ? void 0 : context.type;
|
|
672
|
+
if (updateType === AttributeUpdateType.STATE || null != updateType && updateType >= AttributeUpdateType.ANIMATE_BIND && updateType <= AttributeUpdateType.ANIMATE_END) return;
|
|
673
|
+
const finalAttrs = null === (_a = this.context) || void 0 === _a ? void 0 : _a.finalAttrs, setFinalAttributes = this.setFinalAttributes;
|
|
674
|
+
finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(this, finalAttrs);
|
|
675
|
+
}
|
|
676
|
+
captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
|
|
677
|
+
var _a, _b;
|
|
678
|
+
const graphicContext = this.context, diffAttrs = null !== (_a = null == graphicContext ? void 0 : graphicContext.diffAttrs) && void 0 !== _a ? _a : params, updateType = null == context ? void 0 : context.type;
|
|
679
|
+
if (!keys.length || !diffAttrs || updateType === AttributeUpdateType.STATE || null != updateType && updateType >= AttributeUpdateType.ANIMATE_BIND && updateType <= AttributeUpdateType.ANIMATE_END) return;
|
|
680
|
+
const sameDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs;
|
|
681
|
+
let fromAttrs = sameDiffAttrs && null !== (_b = this.transientFromAttrsBeforePreventAnimate) && void 0 !== _b ? _b : null;
|
|
682
|
+
sameDiffAttrs || (this.transientFromAttrsBeforePreventAnimate = null, this.transientFromAttrsBeforePreventAnimateDiffAttrs = null);
|
|
683
|
+
let captured = !1;
|
|
684
|
+
for (let i = 0; i < keys.length; i++) {
|
|
685
|
+
const key = keys[i];
|
|
686
|
+
if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) continue;
|
|
687
|
+
const previousValue = this.attribute[key], nextValue = params[key];
|
|
688
|
+
isEqual(previousValue, nextValue) || (null != fromAttrs || (fromAttrs = {}), fromAttrs[key] = cloneAttributeValue(previousValue),
|
|
689
|
+
captured = !0);
|
|
690
|
+
}
|
|
691
|
+
captured && (this.transientFromAttrsBeforePreventAnimate = fromAttrs, this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs);
|
|
692
|
+
}
|
|
693
|
+
consumeTransientFromAttrsBeforePreventAnimate(diffAttrs) {
|
|
694
|
+
const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate, sourceDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs;
|
|
695
|
+
if (!transientFromAttrs || !sourceDiffAttrs) return null;
|
|
696
|
+
for (const key in diffAttrs) if (Object.prototype.hasOwnProperty.call(diffAttrs, key) && (!Object.prototype.hasOwnProperty.call(sourceDiffAttrs, key) || !isEqual(sourceDiffAttrs[key], diffAttrs[key]))) return null;
|
|
697
|
+
let fromAttrs = null, remaining = !1;
|
|
698
|
+
for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && (Object.prototype.hasOwnProperty.call(diffAttrs, key) ? (null != fromAttrs || (fromAttrs = {}),
|
|
699
|
+
fromAttrs[key] = transientFromAttrs[key]) : remaining = !0);
|
|
700
|
+
if (remaining) {
|
|
701
|
+
const nextTransientFromAttrs = {};
|
|
702
|
+
for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && !Object.prototype.hasOwnProperty.call(diffAttrs, key) && (nextTransientFromAttrs[key] = transientFromAttrs[key]);
|
|
703
|
+
this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;
|
|
704
|
+
} else this.transientFromAttrsBeforePreventAnimate = null, this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
|
|
705
|
+
return fromAttrs;
|
|
706
|
+
}
|
|
564
707
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
565
708
|
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
|
|
566
|
-
isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
567
|
-
this._setAttributes(params, forceUpdateTag, context));
|
|
709
|
+
params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
710
|
+
params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
|
|
568
711
|
}
|
|
569
712
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
570
|
-
this.
|
|
713
|
+
this.canCommitBaseAttributesByTouchedKeys() ? this.commitBaseAttributesByTouchedKeys(params, forceUpdateTag, context) : (this.detachAttributeFromBaseAttributes(),
|
|
714
|
+
this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context));
|
|
571
715
|
}
|
|
572
716
|
setAttribute(key, value, forceUpdateTag, context) {
|
|
573
717
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
574
718
|
[key]: value
|
|
575
719
|
}, this.attribute, key, context);
|
|
576
|
-
params
|
|
577
|
-
|
|
578
|
-
|
|
720
|
+
if (params) this._setAttributes(params, forceUpdateTag, context); else if (this.canCommitBaseAttributesByTouchedKeys()) this.commitBaseAttributeBySingleKey(key, value, !!forceUpdateTag, context); else {
|
|
721
|
+
const nextAttrs = {
|
|
722
|
+
[key]: value
|
|
723
|
+
};
|
|
724
|
+
this.applyBaseAttributes(nextAttrs), this.commitBaseAttributeMutation(!!forceUpdateTag, context);
|
|
725
|
+
}
|
|
726
|
+
"background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
579
727
|
}
|
|
580
728
|
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
581
729
|
for (let i = 0; i < k.length; i++) {
|
|
@@ -595,10 +743,11 @@ export class Graphic extends Node {
|
|
|
595
743
|
type: AttributeUpdateType.INIT
|
|
596
744
|
};
|
|
597
745
|
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params,
|
|
598
|
-
this.
|
|
599
|
-
this.
|
|
600
|
-
isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
601
|
-
|
|
746
|
+
this.attribute = params, this._baseAttributes = void 0, this.resolvedStatePatch = void 0,
|
|
747
|
+
this.attributeMayContainTransientAttrs = !1, this.valid = this.isValid(), params.background && this.loadImage(params.background, !0),
|
|
748
|
+
params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
749
|
+
params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT,
|
|
750
|
+
this.valid = this.isValid(), this.onAttributeUpdate(context);
|
|
602
751
|
}
|
|
603
752
|
translate(x, y) {
|
|
604
753
|
var _a, _b;
|
|
@@ -609,11 +758,15 @@ export class Graphic extends Node {
|
|
|
609
758
|
x: x,
|
|
610
759
|
y: y
|
|
611
760
|
}, this.attribute, tempConstantXYKey, context);
|
|
612
|
-
params && (x = params.x, y = params.y, delete params.x, delete params.y
|
|
613
|
-
const attribute = this.baseAttributes, postMatrix = attribute.postMatrix;
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
761
|
+
params && (x = params.x, y = params.y, delete params.x, delete params.y);
|
|
762
|
+
const attribute = this.baseAttributes, postMatrix = attribute.postMatrix, nextAttrs = params || {};
|
|
763
|
+
if (postMatrix) {
|
|
764
|
+
const nextPostMatrix = postMatrix.clone();
|
|
765
|
+
application.transformUtil.fromMatrix(nextPostMatrix, nextPostMatrix).translate(x, y),
|
|
766
|
+
nextAttrs.postMatrix = nextPostMatrix;
|
|
767
|
+
} else nextAttrs.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x,
|
|
768
|
+
nextAttrs.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : DefaultTransform.y) + y;
|
|
769
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
617
770
|
}
|
|
618
771
|
translateTo(x, y) {
|
|
619
772
|
const attribute = this.baseAttributes;
|
|
@@ -624,9 +777,10 @@ export class Graphic extends Node {
|
|
|
624
777
|
x: x,
|
|
625
778
|
y: y
|
|
626
779
|
}, this.attribute, tempConstantXYKey, context);
|
|
627
|
-
return params ? (this.
|
|
628
|
-
|
|
629
|
-
|
|
780
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
781
|
+
x: x,
|
|
782
|
+
y: y
|
|
783
|
+
}, context), this);
|
|
630
784
|
}
|
|
631
785
|
scale(scaleX, scaleY, scaleCenter) {
|
|
632
786
|
var _a, _b;
|
|
@@ -639,14 +793,15 @@ export class Graphic extends Node {
|
|
|
639
793
|
scaleCenter: scaleCenter
|
|
640
794
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
641
795
|
params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX,
|
|
642
|
-
delete params.scaleY
|
|
643
|
-
const attribute = this.baseAttributes;
|
|
796
|
+
delete params.scaleY);
|
|
797
|
+
const attribute = this.baseAttributes, nextAttrs = params || {};
|
|
644
798
|
if (scaleCenter) {
|
|
645
|
-
let {postMatrix: postMatrix} = this.
|
|
646
|
-
postMatrix
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
799
|
+
let {postMatrix: postMatrix} = this.baseAttributes;
|
|
800
|
+
postMatrix = postMatrix ? postMatrix.clone() : new Matrix, application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter),
|
|
801
|
+
nextAttrs.postMatrix = postMatrix;
|
|
802
|
+
} else nextAttrs.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : DefaultTransform.scaleX) * scaleX,
|
|
803
|
+
nextAttrs.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : DefaultTransform.scaleY) * scaleY;
|
|
804
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
650
805
|
}
|
|
651
806
|
scaleTo(scaleX, scaleY) {
|
|
652
807
|
const attribute = this.baseAttributes;
|
|
@@ -657,9 +812,10 @@ export class Graphic extends Node {
|
|
|
657
812
|
scaleX: scaleX,
|
|
658
813
|
scaleY: scaleY
|
|
659
814
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
660
|
-
return params ? (this.
|
|
661
|
-
|
|
662
|
-
|
|
815
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
816
|
+
scaleX: scaleX,
|
|
817
|
+
scaleY: scaleY
|
|
818
|
+
}, context), this);
|
|
663
819
|
}
|
|
664
820
|
rotate(angle, rotateCenter) {
|
|
665
821
|
var _a;
|
|
@@ -670,24 +826,23 @@ export class Graphic extends Node {
|
|
|
670
826
|
angle: angle,
|
|
671
827
|
rotateCenter: rotateCenter
|
|
672
828
|
}, this.attribute, tempConstantAngleKey, context);
|
|
673
|
-
params &&
|
|
674
|
-
const attribute = this.baseAttributes;
|
|
829
|
+
params && delete params.angle;
|
|
830
|
+
const attribute = this.baseAttributes, nextAttrs = params || {};
|
|
675
831
|
if (rotateCenter) {
|
|
676
832
|
let {postMatrix: postMatrix} = this.baseAttributes;
|
|
677
|
-
postMatrix
|
|
678
|
-
|
|
679
|
-
} else
|
|
680
|
-
return this.
|
|
833
|
+
postMatrix = postMatrix ? postMatrix.clone() : new Matrix, application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter),
|
|
834
|
+
nextAttrs.postMatrix = postMatrix;
|
|
835
|
+
} else nextAttrs.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : DefaultTransform.angle) + angle;
|
|
836
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
681
837
|
}
|
|
682
838
|
rotateTo(angle) {
|
|
683
|
-
|
|
684
|
-
if (attribute.angle === angle) return this;
|
|
839
|
+
if (this.baseAttributes.angle === angle) return this;
|
|
685
840
|
const context = {
|
|
686
841
|
type: AttributeUpdateType.ROTATE_TO
|
|
687
842
|
}, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
|
|
688
|
-
return params ? (this.
|
|
689
|
-
|
|
690
|
-
this);
|
|
843
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
844
|
+
angle: angle
|
|
845
|
+
}, context), this);
|
|
691
846
|
}
|
|
692
847
|
skewTo(b, c) {
|
|
693
848
|
return this;
|
|
@@ -707,26 +862,132 @@ export class Graphic extends Node {
|
|
|
707
862
|
var _a;
|
|
708
863
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
709
864
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
return
|
|
865
|
+
getStateResolveBaseAttrs() {
|
|
866
|
+
var _a;
|
|
867
|
+
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
868
|
+
}
|
|
869
|
+
syncStateResolveContext(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
870
|
+
var _a;
|
|
871
|
+
return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs),
|
|
872
|
+
stateResolveBaseAttrs;
|
|
873
|
+
}
|
|
874
|
+
ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
875
|
+
const {compiledDefinitions: compiledDefinitions} = this.resolveEffectiveCompiledDefinitions();
|
|
876
|
+
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new StateEngine({
|
|
713
877
|
compiledDefinitions: compiledDefinitions,
|
|
714
878
|
stateSort: this.stateSort,
|
|
715
|
-
stateProxy: this.stateProxy,
|
|
716
|
-
stateProxyEligibility: stateProxyEligibility,
|
|
717
|
-
states: this.states,
|
|
718
879
|
mergeMode: this.stateMergeMode
|
|
719
|
-
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.
|
|
720
|
-
this.
|
|
721
|
-
this.
|
|
722
|
-
this.
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}
|
|
880
|
+
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort,
|
|
881
|
+
this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0),
|
|
882
|
+
this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates),
|
|
883
|
+
this.stateEngine;
|
|
884
|
+
}
|
|
885
|
+
toGraphicStateTransition(result) {
|
|
886
|
+
return {
|
|
887
|
+
changed: result.changed,
|
|
888
|
+
states: [ ...result.activeStates ],
|
|
889
|
+
effectiveStates: [ ...result.effectiveStates ]
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
sortLocalStates(states) {
|
|
893
|
+
return this.stateSort ? [ ...states ].sort(this.stateSort) : [ ...states ];
|
|
894
|
+
}
|
|
895
|
+
resolveLocalUseStatesTransition(states) {
|
|
896
|
+
var _a;
|
|
897
|
+
if (!states.length) return this.resolveLocalClearStatesTransition();
|
|
898
|
+
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);
|
|
899
|
+
return {
|
|
900
|
+
changed: changed,
|
|
901
|
+
states: changed ? nextStates : [ ...previousStates ]
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
resolveLocalClearStatesTransition() {
|
|
905
|
+
return {
|
|
906
|
+
changed: this.hasState(),
|
|
907
|
+
states: []
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
911
|
+
const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
912
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
|
|
913
|
+
}
|
|
914
|
+
resolveClearStatesTransition() {
|
|
915
|
+
const stateEngine = this.ensureStateEngine();
|
|
916
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
|
|
917
|
+
}
|
|
918
|
+
resolveAddStateTransition(stateName, keepCurrentStates) {
|
|
919
|
+
var _a;
|
|
920
|
+
const stateEngine = this.ensureStateEngine();
|
|
921
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
|
|
922
|
+
if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
|
|
923
|
+
changed: !1,
|
|
924
|
+
states: [ ...this.currentStates ]
|
|
925
|
+
};
|
|
926
|
+
const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
|
|
927
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
928
|
+
}
|
|
929
|
+
resolveRemoveStateTransition(stateName) {
|
|
930
|
+
const stateEngine = this.ensureStateEngine();
|
|
931
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
|
|
932
|
+
if (!this.currentStates) return {
|
|
933
|
+
changed: !1,
|
|
934
|
+
states: []
|
|
935
|
+
};
|
|
936
|
+
const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName, nextStates = this.currentStates.filter(filter);
|
|
937
|
+
return nextStates.length === this.currentStates.length ? {
|
|
938
|
+
changed: !1,
|
|
939
|
+
states: [ ...this.currentStates ]
|
|
940
|
+
} : this.resolveLocalUseStatesTransition(nextStates);
|
|
941
|
+
}
|
|
942
|
+
resolveToggleStateTransition(stateName) {
|
|
943
|
+
const stateEngine = this.ensureStateEngine();
|
|
944
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
|
|
945
|
+
if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
|
|
946
|
+
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
947
|
+
return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
|
|
948
|
+
}
|
|
949
|
+
resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
|
|
950
|
+
var _a;
|
|
951
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
952
|
+
forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
|
|
953
|
+
const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
954
|
+
return {
|
|
955
|
+
transition: transition,
|
|
956
|
+
effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
|
|
957
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
normalizeSetStatesOptions(options) {
|
|
961
|
+
return options && "object" == typeof options ? {
|
|
962
|
+
hasAnimation: options.animate,
|
|
963
|
+
animateSameStatePatchChange: !0 === options.animateSameStatePatchChange,
|
|
964
|
+
shouldRefreshSameStatePatch: !0
|
|
965
|
+
} : {
|
|
966
|
+
hasAnimation: "boolean" == typeof options ? options : void 0,
|
|
967
|
+
animateSameStatePatchChange: !1,
|
|
968
|
+
shouldRefreshSameStatePatch: !1
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
sameStatePatches(left, right) {
|
|
972
|
+
const leftRecord = null != left ? left : {}, rightRecord = null != right ? right : {}, keys = new Set([ ...Object.keys(leftRecord), ...Object.keys(rightRecord) ]);
|
|
973
|
+
for (const key of keys) {
|
|
974
|
+
if (Object.prototype.hasOwnProperty.call(leftRecord, key) !== Object.prototype.hasOwnProperty.call(rightRecord, key)) return !1;
|
|
975
|
+
if (!areAttributeValuesEqual(leftRecord[key], rightRecord[key])) return !1;
|
|
976
|
+
}
|
|
977
|
+
return !0;
|
|
978
|
+
}
|
|
979
|
+
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
|
|
980
|
+
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} = this.resolveGraphicStateTransition(states, !0), patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
982
|
+
patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states,
|
|
983
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
984
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
|
|
985
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
986
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
987
|
+
type: AttributeUpdateType.STATE
|
|
988
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
989
|
+
type: AttributeUpdateType.STATE
|
|
990
|
+
}), this.emitStateUpdateEvent())));
|
|
730
991
|
}
|
|
731
992
|
resolveStateAnimateConfig(animateConfig) {
|
|
732
993
|
var _a, _b, _c;
|
|
@@ -738,8 +999,8 @@ export class Graphic extends Node {
|
|
|
738
999
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
739
1000
|
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
740
1001
|
} : void 0;
|
|
741
|
-
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation,
|
|
742
|
-
const plan = this.getStateTransitionOrchestrator().analyzeTransition(
|
|
1002
|
+
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
|
|
1003
|
+
const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
|
|
743
1004
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
744
1005
|
animateConfig: resolvedAnimateConfig,
|
|
745
1006
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
@@ -747,9 +1008,7 @@ export class Graphic extends Node {
|
|
|
747
1008
|
});
|
|
748
1009
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
749
1010
|
}
|
|
750
|
-
updateNormalAttrs(
|
|
751
|
-
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
752
|
-
}
|
|
1011
|
+
updateNormalAttrs(_stateAttrs) {}
|
|
753
1012
|
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
754
1013
|
return this.getDefaultAttribute(key);
|
|
755
1014
|
}
|
|
@@ -759,83 +1018,77 @@ export class Graphic extends Node {
|
|
|
759
1018
|
stopStateAnimates(type = "end") {
|
|
760
1019
|
const stopAnimationState = this.stopAnimationState;
|
|
761
1020
|
if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
|
|
1021
|
+
if (!this.mayHaveTrackedAnimates()) return;
|
|
762
1022
|
const stateAnimates = [];
|
|
763
1023
|
this.visitTrackedAnimates((animate => {
|
|
764
1024
|
animate.stateNames && stateAnimates.push(animate);
|
|
765
1025
|
})), stateAnimates.forEach((animate => animate.stop(type)));
|
|
766
1026
|
}
|
|
767
|
-
getNormalAttribute(key) {
|
|
768
|
-
var _a, _b;
|
|
769
|
-
const value = this.attribute[key];
|
|
770
|
-
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];
|
|
771
|
-
}
|
|
772
1027
|
clearStates(hasAnimation) {
|
|
773
1028
|
var _a, _b, _c;
|
|
774
|
-
const previousStates =
|
|
1029
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.resolveClearStatesTransition();
|
|
775
1030
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
|
|
776
1031
|
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
777
1032
|
void this.clearSharedStateActiveRegistrations();
|
|
778
|
-
const resolvedStateAttrs = cloneAttributeValue(null !== (
|
|
1033
|
+
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
779
1034
|
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
|
|
780
1035
|
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
781
|
-
this.clearSharedStateActiveRegistrations(),
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
targetStates: []
|
|
785
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
786
|
-
this._restoreAttributeFromStaticTruth({
|
|
1036
|
+
this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
|
|
1037
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1038
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
787
1039
|
type: AttributeUpdateType.STATE
|
|
788
|
-
})
|
|
1040
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
789
1041
|
type: AttributeUpdateType.STATE
|
|
790
|
-
})));
|
|
1042
|
+
}), this.emitStateUpdateEvent()));
|
|
791
1043
|
}
|
|
792
1044
|
removeState(stateName, hasAnimation) {
|
|
793
|
-
const transition = this.
|
|
1045
|
+
const transition = this.resolveRemoveStateTransition(stateName);
|
|
794
1046
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
795
1047
|
}
|
|
796
1048
|
toggleState(stateName, hasAnimation) {
|
|
797
|
-
const transition = this.
|
|
1049
|
+
const transition = this.resolveToggleStateTransition(stateName);
|
|
798
1050
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
799
1051
|
}
|
|
800
1052
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
801
|
-
const transition = this.
|
|
1053
|
+
const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
|
|
802
1054
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
803
1055
|
}
|
|
1056
|
+
setStates(states, options) {
|
|
1057
|
+
var _a, _b, _c;
|
|
1058
|
+
const {hasAnimation: hasAnimation, animateSameStatePatchChange: animateSameStatePatchChange, shouldRefreshSameStatePatch: shouldRefreshSameStatePatch} = this.normalizeSetStatesOptions(options), nextStates = (null == states ? void 0 : states.length) ? states : EMPTY_STATE_NAMES, hasCurrentState = !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || (null === (_b = this.effectiveStates) || void 0 === _b ? void 0 : _b.length) || this.resolvedStatePatch || (null === (_c = this.registeredActiveScopes) || void 0 === _c ? void 0 : _c.size));
|
|
1059
|
+
if (nextStates.length) {
|
|
1060
|
+
if (this.sameStateNames(this.currentStates, nextStates)) return shouldRefreshSameStatePatch ? void this.commitSameStatePatchRefresh(nextStates, hasAnimation, animateSameStatePatchChange) : void (this.sharedStateDirty && this.refreshSharedStateBeforeRender());
|
|
1061
|
+
this.useStates(nextStates, hasAnimation);
|
|
1062
|
+
} else {
|
|
1063
|
+
if (!hasCurrentState && !this.sharedStateDirty) return;
|
|
1064
|
+
this.clearStates(hasAnimation);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
804
1067
|
useStates(states, hasAnimation) {
|
|
805
|
-
var _a
|
|
1068
|
+
var _a;
|
|
806
1069
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
807
|
-
const previousStates =
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
this.
|
|
813
|
-
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
|
|
814
|
-
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = getStageStatePerfMonitor(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"),
|
|
815
|
-
null === (_e = getStageStatePerfMonitor(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
|
|
816
|
-
graphicId: this._uid,
|
|
817
|
-
targetStates: [ ...transition.states ]
|
|
818
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
819
|
-
this._restoreAttributeFromStaticTruth({
|
|
1070
|
+
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);
|
|
1071
|
+
!transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
|
|
1072
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
1073
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
|
|
1074
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1075
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
820
1076
|
type: AttributeUpdateType.STATE
|
|
821
|
-
})
|
|
1077
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
822
1078
|
type: AttributeUpdateType.STATE
|
|
823
|
-
})));
|
|
1079
|
+
}), this.emitStateUpdateEvent()));
|
|
824
1080
|
}
|
|
825
1081
|
invalidateResolver() {
|
|
826
1082
|
var _a, _b;
|
|
827
1083
|
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
828
|
-
|
|
829
|
-
this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch += 1,
|
|
1084
|
+
this.syncStateResolveContext(), this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
|
|
830
1085
|
this.stateEngine.invalidateResolverCache();
|
|
831
1086
|
const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
832
|
-
this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch =
|
|
1087
|
+
this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
833
1088
|
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(),
|
|
834
1089
|
this._restoreAttributeFromStaticTruth({
|
|
835
1090
|
type: AttributeUpdateType.STATE
|
|
836
|
-
}), this.
|
|
837
|
-
type: AttributeUpdateType.STATE
|
|
838
|
-
});
|
|
1091
|
+
}), this.emitStateUpdateEvent();
|
|
839
1092
|
}
|
|
840
1093
|
sameStateNames(left, right) {
|
|
841
1094
|
const normalizedLeft = null != left ? left : [], normalizedRight = null != right ? right : [];
|
|
@@ -857,6 +1110,10 @@ export class Graphic extends Node {
|
|
|
857
1110
|
this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS, this.parent && this.parent.addChildUpdateBoundTag(),
|
|
858
1111
|
this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
859
1112
|
}
|
|
1113
|
+
addBroadUpdateTag() {
|
|
1114
|
+
this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag(), this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS | UpdateTag.UPDATE_PAINT | UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX | UpdateTag.UPDATE_LAYOUT,
|
|
1115
|
+
this.parent && this.parent.addChildUpdateBoundTag(), this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
1116
|
+
}
|
|
860
1117
|
updateShapeAndBoundsTagSetted() {
|
|
861
1118
|
return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;
|
|
862
1119
|
}
|
|
@@ -930,12 +1187,12 @@ export class Graphic extends Node {
|
|
|
930
1187
|
}
|
|
931
1188
|
}
|
|
932
1189
|
setStage(stage, layer) {
|
|
933
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1190
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
934
1191
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService, previousStage = this.stage;
|
|
935
1192
|
if (this.stage !== stage || this.layer !== layer) {
|
|
936
|
-
if (this.stage = stage, this.layer = layer,
|
|
937
|
-
this.setStageToShadowRoot(stage, layer), this.hasAnyTrackedAnimate()) {
|
|
938
|
-
const previousTimeline = null === (
|
|
1193
|
+
if (this.stage = stage, this.layer = layer, ((null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0),
|
|
1194
|
+
this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
1195
|
+
const previousTimeline = null === (_f = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _f ? void 0 : _f.call(previousStage), nextTimeline = null === (_g = null == stage ? void 0 : stage.getTimeline) || void 0 === _g ? void 0 : _g.call(stage), detachedStageAnimates = [];
|
|
939
1196
|
this.visitTrackedAnimates((a => {
|
|
940
1197
|
(!!previousTimeline && a.timeline === previousTimeline || a.timeline.isGlobal) && (nextTimeline ? a.timeline !== nextTimeline && (previousTimeline && a.timeline === previousTimeline && previousTimeline.removeAnimate(a, !1),
|
|
941
1198
|
a.setTimeline(nextTimeline), nextTimeline.addAnimate(a)) : previousTimeline && a.timeline === previousTimeline && (previousTimeline.removeAnimate(a, !1),
|
|
@@ -949,9 +1206,17 @@ export class Graphic extends Node {
|
|
|
949
1206
|
type: AttributeUpdateType.ANIMATE_END
|
|
950
1207
|
}));
|
|
951
1208
|
}
|
|
952
|
-
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (
|
|
1209
|
+
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (_h = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _h || _h.call(graphicService, this, stage));
|
|
953
1210
|
}
|
|
954
|
-
|
|
1211
|
+
((null === (_j = this.currentStates) || void 0 === _j ? void 0 : _j.length) || this.boundSharedStateScope || (null === (_k = this.registeredActiveScopes) || void 0 === _k ? void 0 : _k.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0);
|
|
1212
|
+
}
|
|
1213
|
+
detachStageForRelease() {
|
|
1214
|
+
var _a, _b, _c;
|
|
1215
|
+
(null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
|
|
1216
|
+
(this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0,
|
|
1217
|
+
this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0,
|
|
1218
|
+
this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
|
|
1219
|
+
this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
|
|
955
1220
|
}
|
|
956
1221
|
setStageToShadowRoot(stage, layer) {
|
|
957
1222
|
this.shadowRoot && this.shadowRoot.setStage(stage, layer);
|
|
@@ -1025,6 +1290,7 @@ export class Graphic extends Node {
|
|
|
1025
1290
|
res && (res.state = "fail", cb && cb());
|
|
1026
1291
|
}
|
|
1027
1292
|
_stopAnimates() {
|
|
1293
|
+
if (!this.mayHaveTrackedAnimates()) return;
|
|
1028
1294
|
const animates = [];
|
|
1029
1295
|
this.visitTrackedAnimates((animate => {
|
|
1030
1296
|
animates.push(animate);
|
|
@@ -1038,15 +1304,19 @@ export class Graphic extends Node {
|
|
|
1038
1304
|
}));
|
|
1039
1305
|
}
|
|
1040
1306
|
release() {
|
|
1041
|
-
var _a, _b, _c;
|
|
1042
|
-
this.releaseStatus = "released", this.
|
|
1043
|
-
|
|
1044
|
-
null
|
|
1307
|
+
var _a, _b, _c, _d;
|
|
1308
|
+
this.releaseStatus = "released", (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
|
|
1309
|
+
(this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates();
|
|
1310
|
+
const graphicService = null !== (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService;
|
|
1311
|
+
null === (_d = null == graphicService ? void 0 : graphicService.onRelease) || void 0 === _d || _d.call(graphicService, this),
|
|
1045
1312
|
super.release();
|
|
1046
1313
|
}
|
|
1314
|
+
hasCustomEvent(type) {
|
|
1315
|
+
return !!this._events && type in this._events;
|
|
1316
|
+
}
|
|
1047
1317
|
_dispatchCustomEvent(type, context) {
|
|
1048
1318
|
var _a, _b;
|
|
1049
|
-
if (this.
|
|
1319
|
+
if (this.hasCustomEvent(type)) {
|
|
1050
1320
|
const changeEvent = new CustomEvent(type, context);
|
|
1051
1321
|
changeEvent.bubbles = !1;
|
|
1052
1322
|
const manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager;
|
|
@@ -1055,7 +1325,7 @@ export class Graphic extends Node {
|
|
|
1055
1325
|
return !0;
|
|
1056
1326
|
}
|
|
1057
1327
|
beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
|
|
1058
|
-
return this._dispatchCustomEvent("beforeStateUpdate", {
|
|
1328
|
+
return !this.hasCustomEvent("beforeStateUpdate") || this._dispatchCustomEvent("beforeStateUpdate", {
|
|
1059
1329
|
type: AttributeUpdateType.STATE,
|
|
1060
1330
|
attrs: Object.assign({}, attrs),
|
|
1061
1331
|
prevStates: prevStates.slice(),
|
|
@@ -1064,6 +1334,11 @@ export class Graphic extends Node {
|
|
|
1064
1334
|
isClear: !!isClear
|
|
1065
1335
|
});
|
|
1066
1336
|
}
|
|
1337
|
+
emitStateUpdateEvent() {
|
|
1338
|
+
this.hasCustomEvent("afterStateUpdate") && this._emitCustomEvent("afterStateUpdate", {
|
|
1339
|
+
type: AttributeUpdateType.STATE
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1067
1342
|
_emitCustomEvent(type, context) {
|
|
1068
1343
|
this._dispatchCustomEvent(type, context);
|
|
1069
1344
|
}
|