@visactor/vrender-core 1.1.0-alpha.8 → 1.1.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/color-utils.js +1 -2
- package/cjs/common/event-transformer.js +2 -1
- package/cjs/common/module-guard.d.ts +1 -0
- package/cjs/common/module-guard.js +11 -0
- package/cjs/common/module-guard.js.map +1 -0
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -2
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.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 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +2 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.d.ts +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.js +35 -9
- 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 +74 -24
- package/cjs/graphic/graphic.js +474 -212
- 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/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 +1297 -1752
- package/es/allocator/graphic-allocate.js +1 -2
- package/es/canvas/constants.js +2 -1
- package/es/common/color-utils.js +1 -2
- package/es/common/event-transformer.js +2 -1
- package/es/common/module-guard.d.ts +1 -0
- package/es/common/module-guard.js +5 -0
- package/es/common/module-guard.js.map +1 -0
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -2
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.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 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +2 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.d.ts +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.js +36 -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 +74 -24
- package/es/graphic/graphic.js +467 -209
- 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/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 -1
- package/cjs/core/global-module.js.map +0 -1
- package/cjs/export.d.ts +0 -1
- package/cjs/export.js +0 -1
- package/cjs/export.js.map +0 -1
- package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
- package/cjs/graphic/state/state-batch-scheduler.js +0 -285
- package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
- package/cjs/graphic/state/state-model.d.ts +0 -43
- package/cjs/graphic/state/state-model.js +0 -143
- package/cjs/graphic/state/state-model.js.map +0 -1
- package/cjs/graphic/state/state-perf-monitor.d.ts +0 -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 -1
- package/es/core/global-module.js.map +0 -1
- package/es/export.d.ts +0 -1
- package/es/export.js +0 -1
- package/es/export.js.map +0 -1
- package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
- package/es/graphic/state/state-batch-scheduler.js +0 -278
- package/es/graphic/state/state-batch-scheduler.js.map +0 -1
- package/es/graphic/state/state-model.d.ts +0 -43
- package/es/graphic/state/state-model.js +0 -135
- package/es/graphic/state/state-model.js.map +0 -1
- package/es/graphic/state/state-perf-monitor.d.ts +0 -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/cjs/graphic/graphic.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.
|
|
5
|
+
}), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), state_definition_compiler_1 = require("./state/state-definition-compiler"), state_engine_1 = require("./state/state-engine"),
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), state_definition_compiler_1 = require("./state/state-definition-compiler"), state_engine_1 = require("./state/state-engine"), attribute_update_classifier_1 = require("./state/attribute-update-classifier"), state_transition_orchestrator_1 = require("./state/state-transition-orchestrator"), shared_state_scope_1 = require("./state/shared-state-scope"), shared_state_refresh_1 = require("./state/shared-state-refresh"), _tempBounds = new vutils_1.AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new vutils_1.Matrix;
|
|
8
8
|
|
|
9
9
|
exports.PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ],
|
|
10
10
|
exports.GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
|
|
11
11
|
|
|
12
|
-
const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]), point = new vutils_1.Point;
|
|
12
|
+
const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]), point = new vutils_1.Point, EMPTY_STATE_NAMES = [], BROAD_UPDATE_CATEGORY = attribute_update_classifier_1.UpdateCategory.PAINT | attribute_update_classifier_1.UpdateCategory.SHAPE | attribute_update_classifier_1.UpdateCategory.BOUNDS | attribute_update_classifier_1.UpdateCategory.TRANSFORM | attribute_update_classifier_1.UpdateCategory.LAYOUT;
|
|
13
13
|
|
|
14
14
|
function isPlainObjectValue(value) {
|
|
15
|
-
return "object" == typeof value && null != value && !
|
|
15
|
+
return "object" == typeof value && null != value && !Array.isArray(value);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function cloneAttributeValue(value) {
|
|
@@ -24,14 +24,6 @@ function cloneAttributeValue(value) {
|
|
|
24
24
|
})), clone;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function cloneSimpleAttributeRecord(value) {
|
|
28
|
-
return isPlainObjectValue(value) ? Object.assign({}, value) : value;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function shouldUseSimpleAttributeFastPath(value) {
|
|
32
|
-
return !!isPlainObjectValue(value) && !Object.keys(value).some((key => isPlainObjectValue(value[key])));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
27
|
function cloneAttributeSurface(value) {
|
|
36
28
|
if (!isPlainObjectValue(value)) return value;
|
|
37
29
|
const source = value, clone = {};
|
|
@@ -41,6 +33,11 @@ function cloneAttributeSurface(value) {
|
|
|
41
33
|
})), clone;
|
|
42
34
|
}
|
|
43
35
|
|
|
36
|
+
function areAttributeValuesEqual(left, right) {
|
|
37
|
+
return left === right || !!(isPlainObjectValue(left) || isPlainObjectValue(right) || Array.isArray(left) || Array.isArray(right)) && (0,
|
|
38
|
+
vutils_1.isEqual)(left, right);
|
|
39
|
+
}
|
|
40
|
+
|
|
44
41
|
function deepMergeAttributeValue(base, value) {
|
|
45
42
|
var _a;
|
|
46
43
|
const result = null !== (_a = cloneAttributeValue(base)) && void 0 !== _a ? _a : {};
|
|
@@ -50,7 +47,7 @@ function deepMergeAttributeValue(base, value) {
|
|
|
50
47
|
})), result;
|
|
51
48
|
}
|
|
52
49
|
|
|
53
|
-
exports.
|
|
50
|
+
exports.NOWORK_ANIMATE_ATTR = {
|
|
54
51
|
strokeSeg: 1,
|
|
55
52
|
boundsPadding: 2,
|
|
56
53
|
pickMode: 1,
|
|
@@ -104,19 +101,28 @@ class Graphic extends node_tree_1.Node {
|
|
|
104
101
|
get globalTransMatrix() {
|
|
105
102
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
106
103
|
}
|
|
104
|
+
get baseAttributes() {
|
|
105
|
+
var _a;
|
|
106
|
+
return null !== (_a = this._baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
107
|
+
}
|
|
108
|
+
set baseAttributes(value) {
|
|
109
|
+
value !== this.attribute ? this._baseAttributes = value : this._baseAttributes = void 0;
|
|
110
|
+
}
|
|
107
111
|
constructor(params = {}) {
|
|
108
112
|
var _a;
|
|
109
|
-
super(), this.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
super(), this._AABBBounds = new vutils_1.AABBBounds, this._updateTag = enums_1.UpdateTag.INIT,
|
|
114
|
+
this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0,
|
|
115
|
+
params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0),
|
|
116
|
+
params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
117
|
+
params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
114
118
|
}
|
|
115
119
|
get normalAttrs() {
|
|
116
120
|
return this.baseAttributes;
|
|
117
121
|
}
|
|
118
|
-
set normalAttrs(
|
|
119
|
-
|
|
122
|
+
set normalAttrs(_value) {}
|
|
123
|
+
getBaseAttributesStorage() {
|
|
124
|
+
var _a;
|
|
125
|
+
return null !== (_a = this._baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
120
126
|
}
|
|
121
127
|
getGraphicService() {
|
|
122
128
|
var _a, _b;
|
|
@@ -125,12 +131,6 @@ class Graphic extends node_tree_1.Node {
|
|
|
125
131
|
getAttributes() {
|
|
126
132
|
return this.attribute;
|
|
127
133
|
}
|
|
128
|
-
getStateStyleResolver(mergeMode) {
|
|
129
|
-
return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new state_style_resolver_1.StateStyleResolver({
|
|
130
|
-
mergeMode: "deep"
|
|
131
|
-
})), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new state_style_resolver_1.StateStyleResolver),
|
|
132
|
-
this.stateStyleResolver);
|
|
133
|
-
}
|
|
134
134
|
getStateTransitionOrchestrator() {
|
|
135
135
|
return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new state_transition_orchestrator_1.StateTransitionOrchestrator),
|
|
136
136
|
this.stateTransitionOrchestrator;
|
|
@@ -149,17 +149,23 @@ class Graphic extends node_tree_1.Node {
|
|
|
149
149
|
const nextScope = this.resolveBoundSharedStateScope();
|
|
150
150
|
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
|
|
151
151
|
!1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(),
|
|
152
|
+
this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0,
|
|
153
|
+
this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(),
|
|
155
154
|
markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
|
|
156
155
|
!0);
|
|
157
156
|
}
|
|
158
|
-
|
|
157
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
|
|
159
158
|
var _a, _b;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
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);
|
|
160
|
+
}
|
|
161
|
+
syncSharedStateActiveRegistrations() {
|
|
162
|
+
var _a;
|
|
163
|
+
const previousScopes = this.registeredActiveScopes;
|
|
164
|
+
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach((scope => {
|
|
165
|
+
scope.subtreeActiveDescendants.delete(this);
|
|
166
|
+
})), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
167
|
+
const nextScopes = new Set((0, shared_state_scope_1.collectSharedStateScopeChain)(this.boundSharedStateScope));
|
|
168
|
+
null == previousScopes || previousScopes.forEach((scope => {
|
|
163
169
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
164
170
|
})), nextScopes.forEach((scope => {
|
|
165
171
|
scope.subtreeActiveDescendants.add(this);
|
|
@@ -176,7 +182,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
176
182
|
(0, shared_state_refresh_1.scheduleStageSharedStateRefresh)(this.stage);
|
|
177
183
|
}
|
|
178
184
|
onParentSharedStateTreeChanged(stage, layer) {
|
|
179
|
-
this.stage === stage && this.layer === layer ? this.
|
|
185
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
180
186
|
}
|
|
181
187
|
refreshSharedStateBeforeRender() {
|
|
182
188
|
var _a;
|
|
@@ -184,15 +190,13 @@ class Graphic extends node_tree_1.Node {
|
|
|
184
190
|
this.boundSharedStateScope && (0, shared_state_scope_1.ensureSharedStateScopeFresh)(this.boundSharedStateScope),
|
|
185
191
|
this.recomputeCurrentStatePatch(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
186
192
|
type: enums_1.AttributeUpdateType.STATE
|
|
187
|
-
}), this.
|
|
188
|
-
type: enums_1.AttributeUpdateType.STATE
|
|
189
|
-
}), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
193
|
+
}), this.emitStateUpdateEvent(), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
190
194
|
}
|
|
191
195
|
getLocalStatesVersion() {
|
|
192
196
|
var _a, _b;
|
|
193
197
|
return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
|
|
194
|
-
this.
|
|
195
|
-
null !== (_b = this.
|
|
198
|
+
this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1),
|
|
199
|
+
null !== (_b = this.localStateDefinitionsVersion) && void 0 !== _b ? _b : 0;
|
|
196
200
|
}
|
|
197
201
|
resolveEffectiveCompiledDefinitions() {
|
|
198
202
|
this.syncSharedStateScopeBindingFromTree(!1);
|
|
@@ -202,49 +206,25 @@ class Graphic extends node_tree_1.Node {
|
|
|
202
206
|
const hasStates = !!this.states && Object.keys(this.states).length > 0;
|
|
203
207
|
if (!boundScope) {
|
|
204
208
|
if (!hasStates) return {
|
|
205
|
-
compiledDefinitions: void 0
|
|
206
|
-
stateProxyModeKey: "none"
|
|
209
|
+
compiledDefinitions: void 0
|
|
207
210
|
};
|
|
208
211
|
const cacheKey = `local:${this.getLocalStatesVersion()}`;
|
|
209
212
|
return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new state_definition_compiler_1.StateDefinitionCompiler).compile(this.states),
|
|
210
213
|
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
211
|
-
compiledDefinitions: this.compiledStateDefinitions
|
|
212
|
-
stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
|
|
214
|
+
compiledDefinitions: this.compiledStateDefinitions
|
|
213
215
|
};
|
|
214
216
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
218
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
219
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
220
|
-
};
|
|
221
|
-
const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
|
|
222
|
-
if (Object.keys(localStates).forEach((stateName => {
|
|
223
|
-
sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
|
|
224
|
-
missingStateNames.push(stateName));
|
|
225
|
-
})), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
|
|
226
|
-
{
|
|
227
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
228
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
229
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
230
|
-
};
|
|
231
|
-
const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
|
|
232
|
-
return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new state_definition_compiler_1.StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
|
|
233
|
-
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
234
|
-
compiledDefinitions: this.localFallbackCompiledDefinitions,
|
|
235
|
-
stateProxyModeKey: stateProxyModeKey,
|
|
236
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
217
|
+
return {
|
|
218
|
+
compiledDefinitions: boundScope.effectiveCompiledDefinitions
|
|
237
219
|
};
|
|
238
220
|
}
|
|
239
221
|
recomputeCurrentStatePatch() {
|
|
240
|
-
var _a, _b
|
|
222
|
+
var _a, _b;
|
|
241
223
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
|
|
242
224
|
this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
|
|
243
|
-
const stateResolveBaseAttrs = null !== (_b =
|
|
244
|
-
null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs);
|
|
245
|
-
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);
|
|
225
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs), effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
246
226
|
this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
|
|
247
|
-
this.resolvedStatePatch =
|
|
227
|
+
this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
|
|
248
228
|
}
|
|
249
229
|
buildStaticAttributeSnapshot() {
|
|
250
230
|
var _a;
|
|
@@ -279,15 +259,17 @@ class Graphic extends node_tree_1.Node {
|
|
|
279
259
|
next: void 0
|
|
280
260
|
}), delete target[key]));
|
|
281
261
|
const nextValue = snapshot[key];
|
|
282
|
-
(
|
|
262
|
+
areAttributeValuesEqual(previousValue, nextValue) || (delta.set(key, {
|
|
283
263
|
prev: previousValue,
|
|
284
264
|
next: nextValue
|
|
285
265
|
}), target[key] = cloneAttributeValue(nextValue));
|
|
286
266
|
})), delta;
|
|
287
267
|
}
|
|
288
268
|
_syncAttribute() {
|
|
269
|
+
this.attribute === this.baseAttributes && this.resolvedStatePatch && this.detachAttributeFromBaseAttributes();
|
|
289
270
|
const snapshot = this.buildStaticAttributeSnapshot(), delta = this.syncObjectToSnapshot(this.attribute, snapshot);
|
|
290
|
-
return this.valid = this.isValid(),
|
|
271
|
+
return this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1,
|
|
272
|
+
delta;
|
|
291
273
|
}
|
|
292
274
|
_syncFinalAttributeFromStaticTruth() {
|
|
293
275
|
const target = this.finalAttribute;
|
|
@@ -295,54 +277,150 @@ class Graphic extends node_tree_1.Node {
|
|
|
295
277
|
const snapshot = this.buildStaticAttributeSnapshot();
|
|
296
278
|
this.syncObjectToSnapshot(target, snapshot);
|
|
297
279
|
}
|
|
298
|
-
|
|
280
|
+
mergeAttributeDeltaCategory(category, key, prev, next) {
|
|
299
281
|
var _a;
|
|
282
|
+
let nextCategory = "stroke" === key || "shadowBlur" === key ? (0, attribute_update_classifier_1.classifyAttributeDelta)(key, prev, next) : null !== (_a = attribute_update_classifier_1.ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : attribute_update_classifier_1.UpdateCategory.PAINT;
|
|
283
|
+
return nextCategory & attribute_update_classifier_1.UpdateCategory.PICK && (nextCategory |= attribute_update_classifier_1.UpdateCategory.BOUNDS),
|
|
284
|
+
nextCategory === attribute_update_classifier_1.UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = attribute_update_classifier_1.UpdateCategory.SHAPE | attribute_update_classifier_1.UpdateCategory.BOUNDS),
|
|
285
|
+
category | nextCategory;
|
|
286
|
+
}
|
|
287
|
+
submitUpdateByCategory(category, forceUpdateTag = !1) {
|
|
300
288
|
if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
|
|
301
289
|
void this.addUpdateLayoutTag();
|
|
302
|
-
|
|
303
|
-
delta.forEach(((entry, key) => {
|
|
304
|
-
let nextCategory = (0, attribute_update_classifier_1.classifyAttributeDelta)(key, entry.prev, entry.next);
|
|
305
|
-
nextCategory & attribute_update_classifier_1.UpdateCategory.PICK && (nextCategory |= attribute_update_classifier_1.UpdateCategory.BOUNDS),
|
|
306
|
-
nextCategory === attribute_update_classifier_1.UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = attribute_update_classifier_1.UpdateCategory.SHAPE | attribute_update_classifier_1.UpdateCategory.BOUNDS),
|
|
307
|
-
category |= nextCategory;
|
|
308
|
-
})), category !== attribute_update_classifier_1.UpdateCategory.NONE && (null === (_a = (0,
|
|
309
|
-
state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _a || _a.recordCategory(category)),
|
|
310
|
-
category & attribute_update_classifier_1.UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & attribute_update_classifier_1.UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
|
|
290
|
+
(category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & attribute_update_classifier_1.UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & attribute_update_classifier_1.UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
|
|
311
291
|
category & attribute_update_classifier_1.UpdateCategory.PAINT && this.addUpdatePaintTag(),
|
|
312
292
|
category & attribute_update_classifier_1.UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
|
|
313
|
-
category & attribute_update_classifier_1.UpdateCategory.LAYOUT && this.addUpdateLayoutTag();
|
|
293
|
+
category & attribute_update_classifier_1.UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
|
|
294
|
+
}
|
|
295
|
+
submitUpdateByDelta(delta, forceUpdateTag = !1) {
|
|
296
|
+
let category = attribute_update_classifier_1.UpdateCategory.NONE;
|
|
297
|
+
delta.forEach(((entry, key) => {
|
|
298
|
+
category = this.mergeAttributeDeltaCategory(category, key, entry.prev, entry.next);
|
|
299
|
+
})), this.submitUpdateByCategory(category, forceUpdateTag);
|
|
300
|
+
}
|
|
301
|
+
submitTouchedKeyUpdate(keys, forceUpdateTag = !1) {
|
|
302
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTags(keys));
|
|
303
|
+
}
|
|
304
|
+
submitTouchedUpdate(needsShapeAndBounds) {
|
|
305
|
+
!this.updateShapeAndBoundsTagSetted() && needsShapeAndBounds ? this.addUpdateShapeAndBoundsTag() : this.addUpdateBoundTag(),
|
|
306
|
+
this.addUpdatePositionTag(), this.addUpdateLayoutTag();
|
|
314
307
|
}
|
|
315
308
|
commitBaseAttributeMutation(forceUpdateTag = !1, context) {
|
|
316
|
-
var _a, _b;
|
|
317
|
-
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch
|
|
318
|
-
null === (
|
|
309
|
+
var _a, _b, _c;
|
|
310
|
+
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
|
|
311
|
+
null === (_c = this.stateEngine) || void 0 === _c || _c.invalidateResolverCache(),
|
|
319
312
|
this.recomputeCurrentStatePatch());
|
|
320
313
|
const delta = this._syncAttribute();
|
|
321
314
|
this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
322
315
|
}
|
|
316
|
+
canCommitBaseAttributesByTouchedKeys() {
|
|
317
|
+
var _a, _b;
|
|
318
|
+
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());
|
|
319
|
+
}
|
|
320
|
+
detachAttributeFromBaseAttributes() {
|
|
321
|
+
this.attribute === this.baseAttributes && (this._baseAttributes = this.attribute,
|
|
322
|
+
this.attribute = cloneAttributeSurface(this.attribute));
|
|
323
|
+
}
|
|
324
|
+
commitInternalBaseAttributes(params, context) {
|
|
325
|
+
params && Object.keys(params).length && (this.canCommitBaseAttributesByTouchedKeys() ? this.commitBaseAttributesByTouchedKeys(params, !1, context) : (this.detachAttributeFromBaseAttributes(),
|
|
326
|
+
this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context)));
|
|
327
|
+
}
|
|
328
|
+
commitBaseAttributesByTouchedKeys(params, forceUpdateTag = !1, context) {
|
|
329
|
+
const source = params, baseAttributes = this.getBaseAttributesStorage();
|
|
330
|
+
let hasKeys = !1, needsShapeAndBounds = forceUpdateTag;
|
|
331
|
+
for (const key in source) Object.prototype.hasOwnProperty.call(source, key) && (hasKeys = !0,
|
|
332
|
+
baseAttributes[key] = source[key], !needsShapeAndBounds && this.needUpdateTag(key) && (needsShapeAndBounds = !0));
|
|
333
|
+
hasKeys && (this.attribute = baseAttributes, this._baseAttributes = void 0, this.valid = this.isValid(),
|
|
334
|
+
this.attributeMayContainTransientAttrs = !1, this.submitTouchedUpdate(needsShapeAndBounds),
|
|
335
|
+
this.onAttributeUpdate(context));
|
|
336
|
+
}
|
|
337
|
+
commitBaseAttributeBySingleKey(key, value, forceUpdateTag = !1, context) {
|
|
338
|
+
this.getBaseAttributesStorage()[key] = value, this.attribute = this.getBaseAttributesStorage(),
|
|
339
|
+
this._baseAttributes = void 0, this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1,
|
|
340
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTag(key)), this.onAttributeUpdate(context);
|
|
341
|
+
}
|
|
323
342
|
applyBaseAttributes(params) {
|
|
324
343
|
const keys = Object.keys(params);
|
|
325
344
|
for (let i = 0; i < keys.length; i++) {
|
|
326
345
|
const key = keys[i];
|
|
327
|
-
this.
|
|
346
|
+
this.getBaseAttributesStorage()[key] = params[key];
|
|
328
347
|
}
|
|
329
348
|
}
|
|
349
|
+
applyAnimationTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
350
|
+
const source = params;
|
|
351
|
+
let target, needsShapeAndBounds = forceUpdateTag;
|
|
352
|
+
for (const key in source) Object.prototype.hasOwnProperty.call(source, key) && (target || (this.detachAttributeFromBaseAttributes(),
|
|
353
|
+
target = this.attribute), target[key] = source[key], !needsShapeAndBounds && this.needUpdateTag(key) && (needsShapeAndBounds = !0));
|
|
354
|
+
target && (this.attributeMayContainTransientAttrs = !0, this.valid = this.isValid(),
|
|
355
|
+
this.submitTouchedUpdate(needsShapeAndBounds), this.onAttributeUpdate(context));
|
|
356
|
+
}
|
|
330
357
|
applyTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
358
|
+
this.detachAttributeFromBaseAttributes();
|
|
331
359
|
const delta = new Map, keys = Object.keys(params);
|
|
332
360
|
for (let i = 0; i < keys.length; i++) {
|
|
333
361
|
const key = keys[i], previousValue = this.attribute[key], nextValue = params[key];
|
|
334
|
-
(
|
|
362
|
+
areAttributeValuesEqual(previousValue, nextValue) || (delta.set(key, {
|
|
335
363
|
prev: previousValue,
|
|
336
364
|
next: nextValue
|
|
337
|
-
}), this.attribute[key] =
|
|
365
|
+
}), this.attribute[key] = nextValue);
|
|
338
366
|
}
|
|
339
|
-
this.
|
|
367
|
+
delta.size && (this.attributeMayContainTransientAttrs = !0), this.valid = this.isValid(),
|
|
368
|
+
this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
340
369
|
}
|
|
341
370
|
_restoreAttributeFromStaticTruth(context) {
|
|
342
371
|
this._syncFinalAttributeFromStaticTruth();
|
|
343
372
|
const delta = this._syncAttribute();
|
|
344
373
|
this.submitUpdateByDelta(delta), this.onAttributeUpdate(context);
|
|
345
374
|
}
|
|
375
|
+
collectStatePatchDeltaKeys(previousPatch, nextPatch) {
|
|
376
|
+
const keys = previousPatch ? Object.keys(previousPatch) : [];
|
|
377
|
+
if (!nextPatch) return keys;
|
|
378
|
+
for (const key in nextPatch) Object.prototype.hasOwnProperty.call(nextPatch, key) && !Object.prototype.hasOwnProperty.call(null != previousPatch ? previousPatch : {}, key) && keys.push(key);
|
|
379
|
+
return keys;
|
|
380
|
+
}
|
|
381
|
+
getStaticTruthValueForStateKey(key, nextPatch) {
|
|
382
|
+
var _a;
|
|
383
|
+
const baseAttributes = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {}, patch = nextPatch;
|
|
384
|
+
if (patch && Object.prototype.hasOwnProperty.call(patch, key)) {
|
|
385
|
+
const patchValue = patch[key], baseValue = baseAttributes[key];
|
|
386
|
+
return "deep" === this.stateMergeMode && isPlainObjectValue(baseValue) && isPlainObjectValue(patchValue) ? {
|
|
387
|
+
hasValue: !0,
|
|
388
|
+
value: deepMergeAttributeValue(baseValue, patchValue)
|
|
389
|
+
} : {
|
|
390
|
+
hasValue: !0,
|
|
391
|
+
value: patchValue
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
return Object.prototype.hasOwnProperty.call(baseAttributes, key) ? {
|
|
395
|
+
hasValue: !0,
|
|
396
|
+
value: baseAttributes[key]
|
|
397
|
+
} : {
|
|
398
|
+
hasValue: !1,
|
|
399
|
+
value: void 0
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
syncStatePatchDeltaToTarget(target, keys, nextPatch, collectCategory = !1) {
|
|
403
|
+
let category = attribute_update_classifier_1.UpdateCategory.NONE;
|
|
404
|
+
for (let i = 0; i < keys.length; i++) {
|
|
405
|
+
const key = keys[i], previousValue = target[key], next = this.getStaticTruthValueForStateKey(key, nextPatch);
|
|
406
|
+
if (!next.hasValue) {
|
|
407
|
+
Object.prototype.hasOwnProperty.call(target, key) && (delete target[key], collectCategory && (category = this.mergeAttributeDeltaCategory(category, key, previousValue, void 0)));
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
if (areAttributeValuesEqual(previousValue, next.value)) continue;
|
|
411
|
+
const nextValue = cloneAttributeValue(next.value);
|
|
412
|
+
target[key] = nextValue, collectCategory && (category = this.mergeAttributeDeltaCategory(category, key, previousValue, nextValue));
|
|
413
|
+
}
|
|
414
|
+
return category;
|
|
415
|
+
}
|
|
416
|
+
restoreAttributeFromStatePatchDelta(previousPatch, nextPatch, context) {
|
|
417
|
+
this.detachAttributeFromBaseAttributes();
|
|
418
|
+
const keys = this.collectStatePatchDeltaKeys(previousPatch, nextPatch), finalAttribute = this.finalAttribute;
|
|
419
|
+
finalAttribute && this.syncStatePatchDeltaToTarget(finalAttribute, keys, nextPatch, !1);
|
|
420
|
+
const category = this.syncStatePatchDeltaToTarget(this.attribute, keys, nextPatch, !0);
|
|
421
|
+
this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1, this.submitUpdateByCategory(category),
|
|
422
|
+
this.onAttributeUpdate(context);
|
|
423
|
+
}
|
|
346
424
|
setMode(mode) {
|
|
347
425
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
348
426
|
}
|
|
@@ -362,7 +440,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
362
440
|
return point;
|
|
363
441
|
}
|
|
364
442
|
onAnimateBind(animate) {
|
|
365
|
-
this._emitCustomEvent("animate-bind", animate);
|
|
443
|
+
this.detachAttributeFromBaseAttributes(), this._emitCustomEvent("animate-bind", animate);
|
|
366
444
|
}
|
|
367
445
|
visitTrackedAnimates(cb) {
|
|
368
446
|
const hook = this.forEachTrackedAnimate;
|
|
@@ -375,8 +453,22 @@ class Graphic extends node_tree_1.Node {
|
|
|
375
453
|
const getTrackedAnimates = this.getTrackedAnimates;
|
|
376
454
|
return "function" == typeof getTrackedAnimates ? getTrackedAnimates.call(this).size > 0 : !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size);
|
|
377
455
|
}
|
|
456
|
+
mayHaveTrackedAnimates() {
|
|
457
|
+
var _a;
|
|
458
|
+
return !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size) || !!this._animationStateManager;
|
|
459
|
+
}
|
|
378
460
|
tryUpdateAABBBounds() {
|
|
461
|
+
if (!(this.shadowRoot || this._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS)) return this._AABBBounds;
|
|
379
462
|
const full = "imprecise" === this.attribute.boundsMode;
|
|
463
|
+
if (!this.shadowRoot) {
|
|
464
|
+
const graphicService = this.getGraphicService(), graphicTheme = this.getGraphicTheme();
|
|
465
|
+
if (!graphicService.validCheck(this.attribute, graphicTheme, this._AABBBounds, this)) return this._AABBBounds;
|
|
466
|
+
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
467
|
+
graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
468
|
+
const bounds = this.doUpdateAABBBounds(full, graphicTheme);
|
|
469
|
+
return graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
|
|
470
|
+
"empty" === this.attribute.boundsMode && bounds.clear(), bounds;
|
|
471
|
+
}
|
|
380
472
|
if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
|
|
381
473
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
382
474
|
this.getGraphicService().beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
@@ -442,11 +534,11 @@ class Graphic extends node_tree_1.Node {
|
|
|
442
534
|
const _parsedPath = new builtin_symbol_1.CustomSymbolClass(symbolType, cache);
|
|
443
535
|
return Graphic.userSymbolMap[symbolType] = _parsedPath, _parsedPath;
|
|
444
536
|
}
|
|
445
|
-
doUpdateAABBBounds(full) {
|
|
537
|
+
doUpdateAABBBounds(full, graphicTheme) {
|
|
446
538
|
this.updateAABBBoundsStamp++;
|
|
447
|
-
const
|
|
539
|
+
const resolvedGraphicTheme = null != graphicTheme ? graphicTheme : this.getGraphicTheme();
|
|
448
540
|
this._AABBBounds.clear();
|
|
449
|
-
const attribute = this.attribute, bounds = this.updateAABBBounds(attribute,
|
|
541
|
+
const attribute = this.attribute, bounds = this.updateAABBBounds(attribute, resolvedGraphicTheme, this._AABBBounds, full), {boundsPadding: boundsPadding = resolvedGraphicTheme.boundsPadding} = attribute, paddingArray = (0,
|
|
450
542
|
utils_1.parsePadding)(boundsPadding);
|
|
451
543
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(),
|
|
452
544
|
bounds;
|
|
@@ -519,27 +611,72 @@ class Graphic extends node_tree_1.Node {
|
|
|
519
611
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
520
612
|
}
|
|
521
613
|
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
614
|
+
if (!params) return;
|
|
615
|
+
const keys = Object.keys(params);
|
|
616
|
+
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.syncFinalAttributesFromUpdateContext(context),
|
|
522
617
|
this.visitTrackedAnimates((animate => {
|
|
523
|
-
(animate.priority !== 1 / 0 || ignorePriority) &&
|
|
524
|
-
animate.preventAttr(key);
|
|
525
|
-
}));
|
|
618
|
+
(animate.priority !== 1 / 0 || ignorePriority) && animate.preventAttrs(keys);
|
|
526
619
|
})), this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
527
620
|
}
|
|
621
|
+
syncFinalAttributesFromUpdateContext(context) {
|
|
622
|
+
var _a;
|
|
623
|
+
const updateType = null == context ? void 0 : context.type;
|
|
624
|
+
if (updateType === enums_1.AttributeUpdateType.STATE || null != updateType && updateType >= enums_1.AttributeUpdateType.ANIMATE_BIND && updateType <= enums_1.AttributeUpdateType.ANIMATE_END) return;
|
|
625
|
+
const finalAttrs = null === (_a = this.context) || void 0 === _a ? void 0 : _a.finalAttrs, setFinalAttributes = this.setFinalAttributes;
|
|
626
|
+
finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(this, finalAttrs);
|
|
627
|
+
}
|
|
628
|
+
captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
|
|
629
|
+
var _a, _b;
|
|
630
|
+
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;
|
|
631
|
+
if (!keys.length || !diffAttrs || updateType === enums_1.AttributeUpdateType.STATE || null != updateType && updateType >= enums_1.AttributeUpdateType.ANIMATE_BIND && updateType <= enums_1.AttributeUpdateType.ANIMATE_END) return;
|
|
632
|
+
const sameDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs;
|
|
633
|
+
let fromAttrs = sameDiffAttrs && null !== (_b = this.transientFromAttrsBeforePreventAnimate) && void 0 !== _b ? _b : null;
|
|
634
|
+
sameDiffAttrs || (this.transientFromAttrsBeforePreventAnimate = null, this.transientFromAttrsBeforePreventAnimateDiffAttrs = null);
|
|
635
|
+
let captured = !1;
|
|
636
|
+
for (let i = 0; i < keys.length; i++) {
|
|
637
|
+
const key = keys[i];
|
|
638
|
+
if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) continue;
|
|
639
|
+
const previousValue = this.attribute[key], nextValue = params[key];
|
|
640
|
+
(0, vutils_1.isEqual)(previousValue, nextValue) || (null != fromAttrs || (fromAttrs = {}),
|
|
641
|
+
fromAttrs[key] = cloneAttributeValue(previousValue), captured = !0);
|
|
642
|
+
}
|
|
643
|
+
captured && (this.transientFromAttrsBeforePreventAnimate = fromAttrs, this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs);
|
|
644
|
+
}
|
|
645
|
+
consumeTransientFromAttrsBeforePreventAnimate(diffAttrs) {
|
|
646
|
+
const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate, sourceDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs;
|
|
647
|
+
if (!transientFromAttrs || !sourceDiffAttrs) return null;
|
|
648
|
+
for (const key in diffAttrs) if (Object.prototype.hasOwnProperty.call(diffAttrs, key) && (!Object.prototype.hasOwnProperty.call(sourceDiffAttrs, key) || !(0,
|
|
649
|
+
vutils_1.isEqual)(sourceDiffAttrs[key], diffAttrs[key]))) return null;
|
|
650
|
+
let fromAttrs = null, remaining = !1;
|
|
651
|
+
for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && (Object.prototype.hasOwnProperty.call(diffAttrs, key) ? (null != fromAttrs || (fromAttrs = {}),
|
|
652
|
+
fromAttrs[key] = transientFromAttrs[key]) : remaining = !0);
|
|
653
|
+
if (remaining) {
|
|
654
|
+
const nextTransientFromAttrs = {};
|
|
655
|
+
for (const key in transientFromAttrs) Object.prototype.hasOwnProperty.call(transientFromAttrs, key) && !Object.prototype.hasOwnProperty.call(diffAttrs, key) && (nextTransientFromAttrs[key] = transientFromAttrs[key]);
|
|
656
|
+
this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;
|
|
657
|
+
} else this.transientFromAttrsBeforePreventAnimate = null, this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
|
|
658
|
+
return fromAttrs;
|
|
659
|
+
}
|
|
528
660
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
529
661
|
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
|
|
530
|
-
isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
531
|
-
this._setAttributes(params, forceUpdateTag, context));
|
|
662
|
+
params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
663
|
+
params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
|
|
532
664
|
}
|
|
533
665
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
534
|
-
this.
|
|
666
|
+
this.canCommitBaseAttributesByTouchedKeys() ? this.commitBaseAttributesByTouchedKeys(params, forceUpdateTag, context) : (this.detachAttributeFromBaseAttributes(),
|
|
667
|
+
this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context));
|
|
535
668
|
}
|
|
536
669
|
setAttribute(key, value, forceUpdateTag, context) {
|
|
537
670
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
538
671
|
[key]: value
|
|
539
672
|
}, this.attribute, key, context);
|
|
540
|
-
params
|
|
541
|
-
|
|
542
|
-
|
|
673
|
+
if (params) this._setAttributes(params, forceUpdateTag, context); else if (this.canCommitBaseAttributesByTouchedKeys()) this.commitBaseAttributeBySingleKey(key, value, !!forceUpdateTag, context); else {
|
|
674
|
+
const nextAttrs = {
|
|
675
|
+
[key]: value
|
|
676
|
+
};
|
|
677
|
+
this.applyBaseAttributes(nextAttrs), this.commitBaseAttributeMutation(!!forceUpdateTag, context);
|
|
678
|
+
}
|
|
679
|
+
"background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
543
680
|
}
|
|
544
681
|
needUpdateTags(keys, k = exports.GRAPHIC_UPDATE_TAG_KEY) {
|
|
545
682
|
for (let i = 0; i < k.length; i++) {
|
|
@@ -559,10 +696,11 @@ class Graphic extends node_tree_1.Node {
|
|
|
559
696
|
type: enums_1.AttributeUpdateType.INIT
|
|
560
697
|
};
|
|
561
698
|
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params,
|
|
562
|
-
this.
|
|
563
|
-
this.
|
|
564
|
-
isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
565
|
-
|
|
699
|
+
this.attribute = params, this._baseAttributes = void 0, this.resolvedStatePatch = void 0,
|
|
700
|
+
this.attributeMayContainTransientAttrs = !1, this.valid = this.isValid(), params.background && this.loadImage(params.background, !0),
|
|
701
|
+
params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1),
|
|
702
|
+
params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = enums_1.UpdateTag.INIT,
|
|
703
|
+
this.valid = this.isValid(), this.onAttributeUpdate(context);
|
|
566
704
|
}
|
|
567
705
|
translate(x, y) {
|
|
568
706
|
var _a, _b;
|
|
@@ -573,11 +711,15 @@ class Graphic extends node_tree_1.Node {
|
|
|
573
711
|
x: x,
|
|
574
712
|
y: y
|
|
575
713
|
}, this.attribute, tempConstantXYKey, context);
|
|
576
|
-
params && (x = params.x, y = params.y, delete params.x, delete params.y
|
|
577
|
-
const attribute = this.baseAttributes, postMatrix = attribute.postMatrix;
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
714
|
+
params && (x = params.x, y = params.y, delete params.x, delete params.y);
|
|
715
|
+
const attribute = this.baseAttributes, postMatrix = attribute.postMatrix, nextAttrs = params || {};
|
|
716
|
+
if (postMatrix) {
|
|
717
|
+
const nextPostMatrix = postMatrix.clone();
|
|
718
|
+
application_1.application.transformUtil.fromMatrix(nextPostMatrix, nextPostMatrix).translate(x, y),
|
|
719
|
+
nextAttrs.postMatrix = nextPostMatrix;
|
|
720
|
+
} else nextAttrs.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : config_1.DefaultTransform.x) + x,
|
|
721
|
+
nextAttrs.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : config_1.DefaultTransform.y) + y;
|
|
722
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
581
723
|
}
|
|
582
724
|
translateTo(x, y) {
|
|
583
725
|
const attribute = this.baseAttributes;
|
|
@@ -588,9 +730,10 @@ class Graphic extends node_tree_1.Node {
|
|
|
588
730
|
x: x,
|
|
589
731
|
y: y
|
|
590
732
|
}, this.attribute, tempConstantXYKey, context);
|
|
591
|
-
return params ? (this.
|
|
592
|
-
|
|
593
|
-
|
|
733
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
734
|
+
x: x,
|
|
735
|
+
y: y
|
|
736
|
+
}, context), this);
|
|
594
737
|
}
|
|
595
738
|
scale(scaleX, scaleY, scaleCenter) {
|
|
596
739
|
var _a, _b;
|
|
@@ -603,15 +746,15 @@ class Graphic extends node_tree_1.Node {
|
|
|
603
746
|
scaleCenter: scaleCenter
|
|
604
747
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
605
748
|
params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX,
|
|
606
|
-
delete params.scaleY
|
|
607
|
-
const attribute = this.baseAttributes;
|
|
749
|
+
delete params.scaleY);
|
|
750
|
+
const attribute = this.baseAttributes, nextAttrs = params || {};
|
|
608
751
|
if (scaleCenter) {
|
|
609
|
-
let {postMatrix: postMatrix} = this.
|
|
610
|
-
postMatrix
|
|
611
|
-
|
|
612
|
-
} else
|
|
613
|
-
|
|
614
|
-
return this.
|
|
752
|
+
let {postMatrix: postMatrix} = this.baseAttributes;
|
|
753
|
+
postMatrix = postMatrix ? postMatrix.clone() : new vutils_1.Matrix, application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter),
|
|
754
|
+
nextAttrs.postMatrix = postMatrix;
|
|
755
|
+
} else nextAttrs.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : config_1.DefaultTransform.scaleX) * scaleX,
|
|
756
|
+
nextAttrs.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : config_1.DefaultTransform.scaleY) * scaleY;
|
|
757
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
615
758
|
}
|
|
616
759
|
scaleTo(scaleX, scaleY) {
|
|
617
760
|
const attribute = this.baseAttributes;
|
|
@@ -622,9 +765,10 @@ class Graphic extends node_tree_1.Node {
|
|
|
622
765
|
scaleX: scaleX,
|
|
623
766
|
scaleY: scaleY
|
|
624
767
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
625
|
-
return params ? (this.
|
|
626
|
-
|
|
627
|
-
|
|
768
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
769
|
+
scaleX: scaleX,
|
|
770
|
+
scaleY: scaleY
|
|
771
|
+
}, context), this);
|
|
628
772
|
}
|
|
629
773
|
rotate(angle, rotateCenter) {
|
|
630
774
|
var _a;
|
|
@@ -635,24 +779,23 @@ class Graphic extends node_tree_1.Node {
|
|
|
635
779
|
angle: angle,
|
|
636
780
|
rotateCenter: rotateCenter
|
|
637
781
|
}, this.attribute, tempConstantAngleKey, context);
|
|
638
|
-
params &&
|
|
639
|
-
const attribute = this.baseAttributes;
|
|
782
|
+
params && delete params.angle;
|
|
783
|
+
const attribute = this.baseAttributes, nextAttrs = params || {};
|
|
640
784
|
if (rotateCenter) {
|
|
641
785
|
let {postMatrix: postMatrix} = this.baseAttributes;
|
|
642
|
-
postMatrix
|
|
643
|
-
|
|
644
|
-
} else
|
|
645
|
-
return this.
|
|
786
|
+
postMatrix = postMatrix ? postMatrix.clone() : new vutils_1.Matrix, application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter),
|
|
787
|
+
nextAttrs.postMatrix = postMatrix;
|
|
788
|
+
} else nextAttrs.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : config_1.DefaultTransform.angle) + angle;
|
|
789
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
646
790
|
}
|
|
647
791
|
rotateTo(angle) {
|
|
648
|
-
|
|
649
|
-
if (attribute.angle === angle) return this;
|
|
792
|
+
if (this.baseAttributes.angle === angle) return this;
|
|
650
793
|
const context = {
|
|
651
794
|
type: enums_1.AttributeUpdateType.ROTATE_TO
|
|
652
795
|
}, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
|
|
653
|
-
return params ? (this.
|
|
654
|
-
|
|
655
|
-
this);
|
|
796
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
797
|
+
angle: angle
|
|
798
|
+
}, context), this);
|
|
656
799
|
}
|
|
657
800
|
skewTo(b, c) {
|
|
658
801
|
return this;
|
|
@@ -672,26 +815,132 @@ class Graphic extends node_tree_1.Node {
|
|
|
672
815
|
var _a;
|
|
673
816
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
674
817
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
return
|
|
818
|
+
getStateResolveBaseAttrs() {
|
|
819
|
+
var _a;
|
|
820
|
+
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
821
|
+
}
|
|
822
|
+
syncStateResolveContext(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
823
|
+
var _a;
|
|
824
|
+
return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs),
|
|
825
|
+
stateResolveBaseAttrs;
|
|
826
|
+
}
|
|
827
|
+
ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
828
|
+
const {compiledDefinitions: compiledDefinitions} = this.resolveEffectiveCompiledDefinitions();
|
|
829
|
+
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode || (this.stateEngine = new state_engine_1.StateEngine({
|
|
678
830
|
compiledDefinitions: compiledDefinitions,
|
|
679
831
|
stateSort: this.stateSort,
|
|
680
|
-
stateProxy: this.stateProxy,
|
|
681
|
-
stateProxyEligibility: stateProxyEligibility,
|
|
682
|
-
states: this.states,
|
|
683
832
|
mergeMode: this.stateMergeMode
|
|
684
|
-
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.
|
|
685
|
-
this.
|
|
686
|
-
this.
|
|
687
|
-
this.
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
833
|
+
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateSort = this.stateSort,
|
|
834
|
+
this.stateEngineMergeMode = this.stateMergeMode) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0),
|
|
835
|
+
this.syncStateResolveContext(stateResolveBaseAttrs), this.stateEngine && this.currentStates && !this.sameStateNames(this.stateEngine.activeStates, this.currentStates) && this.stateEngine.applyStates(this.currentStates),
|
|
836
|
+
this.stateEngine;
|
|
837
|
+
}
|
|
838
|
+
toGraphicStateTransition(result) {
|
|
839
|
+
return {
|
|
840
|
+
changed: result.changed,
|
|
841
|
+
states: [ ...result.activeStates ],
|
|
842
|
+
effectiveStates: [ ...result.effectiveStates ]
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
sortLocalStates(states) {
|
|
846
|
+
return this.stateSort ? [ ...states ].sort(this.stateSort) : [ ...states ];
|
|
847
|
+
}
|
|
848
|
+
resolveLocalUseStatesTransition(states) {
|
|
849
|
+
var _a;
|
|
850
|
+
if (!states.length) return this.resolveLocalClearStatesTransition();
|
|
851
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, changed = previousStates.length !== states.length || states.some(((stateName, index) => previousStates[index] !== stateName)), nextStates = this.sortLocalStates(states);
|
|
852
|
+
return {
|
|
853
|
+
changed: changed,
|
|
854
|
+
states: changed ? nextStates : [ ...previousStates ]
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
resolveLocalClearStatesTransition() {
|
|
858
|
+
return {
|
|
859
|
+
changed: this.hasState(),
|
|
860
|
+
states: []
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
864
|
+
const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
865
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states);
|
|
866
|
+
}
|
|
867
|
+
resolveClearStatesTransition() {
|
|
868
|
+
const stateEngine = this.ensureStateEngine();
|
|
869
|
+
return stateEngine ? this.toGraphicStateTransition(stateEngine.clearStates()) : this.resolveLocalClearStatesTransition();
|
|
870
|
+
}
|
|
871
|
+
resolveAddStateTransition(stateName, keepCurrentStates) {
|
|
872
|
+
var _a;
|
|
873
|
+
const stateEngine = this.ensureStateEngine();
|
|
874
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
|
|
875
|
+
if (this.currentStates && this.currentStates.includes(stateName) && (keepCurrentStates || 1 === this.currentStates.length)) return {
|
|
876
|
+
changed: !1,
|
|
877
|
+
states: [ ...this.currentStates ]
|
|
878
|
+
};
|
|
879
|
+
const nextStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
|
|
880
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
881
|
+
}
|
|
882
|
+
resolveRemoveStateTransition(stateName) {
|
|
883
|
+
const stateEngine = this.ensureStateEngine();
|
|
884
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.removeState(stateName));
|
|
885
|
+
if (!this.currentStates) return {
|
|
886
|
+
changed: !1,
|
|
887
|
+
states: []
|
|
888
|
+
};
|
|
889
|
+
const filter = Array.isArray(stateName) ? s => !stateName.includes(s) : s => s !== stateName, nextStates = this.currentStates.filter(filter);
|
|
890
|
+
return nextStates.length === this.currentStates.length ? {
|
|
891
|
+
changed: !1,
|
|
892
|
+
states: [ ...this.currentStates ]
|
|
893
|
+
} : this.resolveLocalUseStatesTransition(nextStates);
|
|
894
|
+
}
|
|
895
|
+
resolveToggleStateTransition(stateName) {
|
|
896
|
+
const stateEngine = this.ensureStateEngine();
|
|
897
|
+
if (stateEngine) return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
|
|
898
|
+
if (this.hasState(stateName)) return this.resolveRemoveStateTransition(stateName);
|
|
899
|
+
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
900
|
+
return nextStates.push(stateName), this.resolveLocalUseStatesTransition(nextStates);
|
|
901
|
+
}
|
|
902
|
+
resolveGraphicStateTransition(states, forceResolverRefresh = !1) {
|
|
903
|
+
var _a;
|
|
904
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(), stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
905
|
+
forceResolverRefresh && (null == stateEngine || stateEngine.invalidateResolverCache());
|
|
906
|
+
const transition = stateEngine ? this.toGraphicStateTransition(stateEngine.applyStates(states)) : this.resolveLocalUseStatesTransition(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
907
|
+
return {
|
|
908
|
+
transition: transition,
|
|
909
|
+
effectiveStates: null !== (_a = transition.effectiveStates) && void 0 !== _a ? _a : transition.states,
|
|
910
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
normalizeSetStatesOptions(options) {
|
|
914
|
+
return options && "object" == typeof options ? {
|
|
915
|
+
hasAnimation: options.animate,
|
|
916
|
+
animateSameStatePatchChange: !0 === options.animateSameStatePatchChange,
|
|
917
|
+
shouldRefreshSameStatePatch: !0
|
|
918
|
+
} : {
|
|
919
|
+
hasAnimation: "boolean" == typeof options ? options : void 0,
|
|
920
|
+
animateSameStatePatchChange: !1,
|
|
921
|
+
shouldRefreshSameStatePatch: !1
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
sameStatePatches(left, right) {
|
|
925
|
+
const leftRecord = null != left ? left : {}, rightRecord = null != right ? right : {}, keys = new Set([ ...Object.keys(leftRecord), ...Object.keys(rightRecord) ]);
|
|
926
|
+
for (const key of keys) {
|
|
927
|
+
if (Object.prototype.hasOwnProperty.call(leftRecord, key) !== Object.prototype.hasOwnProperty.call(rightRecord, key)) return !1;
|
|
928
|
+
if (!areAttributeValuesEqual(leftRecord[key], rightRecord[key])) return !1;
|
|
929
|
+
}
|
|
930
|
+
return !0;
|
|
931
|
+
}
|
|
932
|
+
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
|
|
933
|
+
var _a;
|
|
934
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states, !0), patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
935
|
+
patchChanged && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) || (this.currentStates = transition.states,
|
|
936
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
937
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged && (hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(),
|
|
938
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
939
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
940
|
+
type: enums_1.AttributeUpdateType.STATE
|
|
941
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
942
|
+
type: enums_1.AttributeUpdateType.STATE
|
|
943
|
+
}), this.emitStateUpdateEvent())));
|
|
695
944
|
}
|
|
696
945
|
resolveStateAnimateConfig(animateConfig) {
|
|
697
946
|
var _a, _b, _c;
|
|
@@ -703,8 +952,8 @@ class Graphic extends node_tree_1.Node {
|
|
|
703
952
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
704
953
|
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
705
954
|
} : void 0;
|
|
706
|
-
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation,
|
|
707
|
-
const plan = this.getStateTransitionOrchestrator().analyzeTransition(
|
|
955
|
+
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
|
|
956
|
+
const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
|
|
708
957
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
709
958
|
animateConfig: resolvedAnimateConfig,
|
|
710
959
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
@@ -712,9 +961,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
712
961
|
});
|
|
713
962
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
714
963
|
}
|
|
715
|
-
updateNormalAttrs(
|
|
716
|
-
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
717
|
-
}
|
|
964
|
+
updateNormalAttrs(_stateAttrs) {}
|
|
718
965
|
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
719
966
|
return this.getDefaultAttribute(key);
|
|
720
967
|
}
|
|
@@ -724,84 +971,77 @@ class Graphic extends node_tree_1.Node {
|
|
|
724
971
|
stopStateAnimates(type = "end") {
|
|
725
972
|
const stopAnimationState = this.stopAnimationState;
|
|
726
973
|
if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
|
|
974
|
+
if (!this.mayHaveTrackedAnimates()) return;
|
|
727
975
|
const stateAnimates = [];
|
|
728
976
|
this.visitTrackedAnimates((animate => {
|
|
729
977
|
animate.stateNames && stateAnimates.push(animate);
|
|
730
978
|
})), stateAnimates.forEach((animate => animate.stop(type)));
|
|
731
979
|
}
|
|
732
|
-
getNormalAttribute(key) {
|
|
733
|
-
var _a, _b;
|
|
734
|
-
const value = this.attribute[key];
|
|
735
|
-
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];
|
|
736
|
-
}
|
|
737
980
|
clearStates(hasAnimation) {
|
|
738
981
|
var _a, _b, _c;
|
|
739
|
-
const previousStates =
|
|
982
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, transition = this.resolveClearStatesTransition();
|
|
740
983
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
|
|
741
984
|
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
742
985
|
void this.clearSharedStateActiveRegistrations();
|
|
743
|
-
const resolvedStateAttrs = cloneAttributeValue(null !== (
|
|
986
|
+
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
744
987
|
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
|
|
745
988
|
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
746
|
-
this.clearSharedStateActiveRegistrations(),
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
targetStates: []
|
|
750
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
751
|
-
this._restoreAttributeFromStaticTruth({
|
|
989
|
+
this.clearSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
|
|
990
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
991
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
752
992
|
type: enums_1.AttributeUpdateType.STATE
|
|
753
|
-
})
|
|
993
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
754
994
|
type: enums_1.AttributeUpdateType.STATE
|
|
755
|
-
})));
|
|
995
|
+
}), this.emitStateUpdateEvent()));
|
|
756
996
|
}
|
|
757
997
|
removeState(stateName, hasAnimation) {
|
|
758
|
-
const transition = this.
|
|
998
|
+
const transition = this.resolveRemoveStateTransition(stateName);
|
|
759
999
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
760
1000
|
}
|
|
761
1001
|
toggleState(stateName, hasAnimation) {
|
|
762
|
-
const transition = this.
|
|
1002
|
+
const transition = this.resolveToggleStateTransition(stateName);
|
|
763
1003
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
764
1004
|
}
|
|
765
1005
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
766
|
-
const transition = this.
|
|
1006
|
+
const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
|
|
767
1007
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
768
1008
|
}
|
|
1009
|
+
setStates(states, options) {
|
|
1010
|
+
var _a, _b, _c;
|
|
1011
|
+
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));
|
|
1012
|
+
if (nextStates.length) {
|
|
1013
|
+
if (this.sameStateNames(this.currentStates, nextStates)) return shouldRefreshSameStatePatch ? void this.commitSameStatePatchRefresh(nextStates, hasAnimation, animateSameStatePatchChange) : void (this.sharedStateDirty && this.refreshSharedStateBeforeRender());
|
|
1014
|
+
this.useStates(nextStates, hasAnimation);
|
|
1015
|
+
} else {
|
|
1016
|
+
if (!hasCurrentState && !this.sharedStateDirty) return;
|
|
1017
|
+
this.clearStates(hasAnimation);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
769
1020
|
useStates(states, hasAnimation) {
|
|
770
|
-
var _a
|
|
1021
|
+
var _a;
|
|
771
1022
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
772
|
-
const previousStates =
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
this.
|
|
778
|
-
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
|
|
779
|
-
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = (0,
|
|
780
|
-
state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"),
|
|
781
|
-
null === (_e = (0, state_perf_monitor_1.getStageStatePerfMonitor)(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
|
|
782
|
-
graphicId: this._uid,
|
|
783
|
-
targetStates: [ ...transition.states ]
|
|
784
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
785
|
-
this._restoreAttributeFromStaticTruth({
|
|
1023
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states);
|
|
1024
|
+
!transition.changed && this.sameStateNames(previousStates, transition.states) || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
|
|
1025
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
1026
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(),
|
|
1027
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
1028
|
+
this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
786
1029
|
type: enums_1.AttributeUpdateType.STATE
|
|
787
|
-
})
|
|
1030
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
788
1031
|
type: enums_1.AttributeUpdateType.STATE
|
|
789
|
-
})));
|
|
1032
|
+
}), this.emitStateUpdateEvent()));
|
|
790
1033
|
}
|
|
791
1034
|
invalidateResolver() {
|
|
792
1035
|
var _a, _b;
|
|
793
1036
|
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
794
|
-
|
|
795
|
-
this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch += 1,
|
|
1037
|
+
this.syncStateResolveContext(), this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1,
|
|
796
1038
|
this.stateEngine.invalidateResolverCache();
|
|
797
1039
|
const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
798
|
-
this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch =
|
|
1040
|
+
this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
799
1041
|
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(),
|
|
800
1042
|
this._restoreAttributeFromStaticTruth({
|
|
801
1043
|
type: enums_1.AttributeUpdateType.STATE
|
|
802
|
-
}), this.
|
|
803
|
-
type: enums_1.AttributeUpdateType.STATE
|
|
804
|
-
});
|
|
1044
|
+
}), this.emitStateUpdateEvent();
|
|
805
1045
|
}
|
|
806
1046
|
sameStateNames(left, right) {
|
|
807
1047
|
const normalizedLeft = null != left ? left : [], normalizedRight = null != right ? right : [];
|
|
@@ -823,6 +1063,10 @@ class Graphic extends node_tree_1.Node {
|
|
|
823
1063
|
this._updateTag |= enums_1.UpdateTag.UPDATE_SHAPE_AND_BOUNDS, this.parent && this.parent.addChildUpdateBoundTag(),
|
|
824
1064
|
this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
825
1065
|
}
|
|
1066
|
+
addBroadUpdateTag() {
|
|
1067
|
+
this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag(), this._updateTag |= enums_1.UpdateTag.UPDATE_SHAPE_AND_BOUNDS | enums_1.UpdateTag.UPDATE_PAINT | enums_1.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX | enums_1.UpdateTag.UPDATE_LAYOUT,
|
|
1068
|
+
this.parent && this.parent.addChildUpdateBoundTag(), this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
1069
|
+
}
|
|
826
1070
|
updateShapeAndBoundsTagSetted() {
|
|
827
1071
|
return (this._updateTag & enums_1.UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === enums_1.UpdateTag.UPDATE_SHAPE_AND_BOUNDS;
|
|
828
1072
|
}
|
|
@@ -897,12 +1141,12 @@ class Graphic extends node_tree_1.Node {
|
|
|
897
1141
|
}
|
|
898
1142
|
}
|
|
899
1143
|
setStage(stage, layer) {
|
|
900
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1144
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
901
1145
|
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_1.application.graphicService, previousStage = this.stage;
|
|
902
1146
|
if (this.stage !== stage || this.layer !== layer) {
|
|
903
|
-
if (this.stage = stage, this.layer = layer,
|
|
904
|
-
this.setStageToShadowRoot(stage, layer), this.hasAnyTrackedAnimate()) {
|
|
905
|
-
const previousTimeline = null === (
|
|
1147
|
+
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),
|
|
1148
|
+
this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
1149
|
+
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 = [];
|
|
906
1150
|
this.visitTrackedAnimates((a => {
|
|
907
1151
|
(!!previousTimeline && a.timeline === previousTimeline || a.timeline.isGlobal) && (nextTimeline ? a.timeline !== nextTimeline && (previousTimeline && a.timeline === previousTimeline && previousTimeline.removeAnimate(a, !1),
|
|
908
1152
|
a.setTimeline(nextTimeline), nextTimeline.addAnimate(a)) : previousTimeline && a.timeline === previousTimeline && (previousTimeline.removeAnimate(a, !1),
|
|
@@ -916,9 +1160,17 @@ class Graphic extends node_tree_1.Node {
|
|
|
916
1160
|
type: enums_1.AttributeUpdateType.ANIMATE_END
|
|
917
1161
|
}));
|
|
918
1162
|
}
|
|
919
|
-
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (
|
|
1163
|
+
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));
|
|
920
1164
|
}
|
|
921
|
-
|
|
1165
|
+
((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);
|
|
1166
|
+
}
|
|
1167
|
+
detachStageForRelease() {
|
|
1168
|
+
var _a, _b, _c;
|
|
1169
|
+
(null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
|
|
1170
|
+
(this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0,
|
|
1171
|
+
this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0,
|
|
1172
|
+
this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
|
|
1173
|
+
this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
|
|
922
1174
|
}
|
|
923
1175
|
setStageToShadowRoot(stage, layer) {
|
|
924
1176
|
this.shadowRoot && this.shadowRoot.setStage(stage, layer);
|
|
@@ -993,6 +1245,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
993
1245
|
res && (res.state = "fail", cb && cb());
|
|
994
1246
|
}
|
|
995
1247
|
_stopAnimates() {
|
|
1248
|
+
if (!this.mayHaveTrackedAnimates()) return;
|
|
996
1249
|
const animates = [];
|
|
997
1250
|
this.visitTrackedAnimates((animate => {
|
|
998
1251
|
animates.push(animate);
|
|
@@ -1006,15 +1259,19 @@ class Graphic extends node_tree_1.Node {
|
|
|
1006
1259
|
}));
|
|
1007
1260
|
}
|
|
1008
1261
|
release() {
|
|
1009
|
-
var _a, _b, _c;
|
|
1010
|
-
this.releaseStatus = "released", this.
|
|
1011
|
-
|
|
1012
|
-
null
|
|
1262
|
+
var _a, _b, _c, _d;
|
|
1263
|
+
this.releaseStatus = "released", (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(),
|
|
1264
|
+
(this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates();
|
|
1265
|
+
const graphicService = null !== (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application_1.application.graphicService;
|
|
1266
|
+
null === (_d = null == graphicService ? void 0 : graphicService.onRelease) || void 0 === _d || _d.call(graphicService, this),
|
|
1013
1267
|
super.release();
|
|
1014
1268
|
}
|
|
1269
|
+
hasCustomEvent(type) {
|
|
1270
|
+
return !!this._events && type in this._events;
|
|
1271
|
+
}
|
|
1015
1272
|
_dispatchCustomEvent(type, context) {
|
|
1016
1273
|
var _a, _b;
|
|
1017
|
-
if (this.
|
|
1274
|
+
if (this.hasCustomEvent(type)) {
|
|
1018
1275
|
const changeEvent = new event_1.CustomEvent(type, context);
|
|
1019
1276
|
changeEvent.bubbles = !1;
|
|
1020
1277
|
const manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager;
|
|
@@ -1023,7 +1280,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
1023
1280
|
return !0;
|
|
1024
1281
|
}
|
|
1025
1282
|
beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
|
|
1026
|
-
return this._dispatchCustomEvent("beforeStateUpdate", {
|
|
1283
|
+
return !this.hasCustomEvent("beforeStateUpdate") || this._dispatchCustomEvent("beforeStateUpdate", {
|
|
1027
1284
|
type: enums_1.AttributeUpdateType.STATE,
|
|
1028
1285
|
attrs: Object.assign({}, attrs),
|
|
1029
1286
|
prevStates: prevStates.slice(),
|
|
@@ -1032,6 +1289,11 @@ class Graphic extends node_tree_1.Node {
|
|
|
1032
1289
|
isClear: !!isClear
|
|
1033
1290
|
});
|
|
1034
1291
|
}
|
|
1292
|
+
emitStateUpdateEvent() {
|
|
1293
|
+
this.hasCustomEvent("afterStateUpdate") && this._emitCustomEvent("afterStateUpdate", {
|
|
1294
|
+
type: enums_1.AttributeUpdateType.STATE
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1035
1297
|
_emitCustomEvent(type, context) {
|
|
1036
1298
|
this._dispatchCustomEvent(type, context);
|
|
1037
1299
|
}
|