@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/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter, Logger, isBoolean, isObject, isFunction, isString, has, isUndefined, tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, PointService, Point, abs, max, min, atan2, epsilon, Matrix, pi2, isArray, cos, sin, pi, pointAt, isNumber as isNumber$1, sqrt, isPointInLine, Color, DEFAULT_COLORS, LRU,
|
|
1
|
+
import { EventEmitter, Logger, isBoolean, isObject, isFunction, isString, has, isUndefined, tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, PointService, Point, abs, max, min, atan2, epsilon, Matrix, pi2, isArray, cos, sin, pi, pointAt, isNumber as isNumber$1, sqrt, isPointInLine, Color, DEFAULT_COLORS, LRU, OBBBounds, isEqual, isNil, normalTransform, isValidUrl, isBase64, lowerCamelCaseToMiddle, isValid, getContextFont, rotatePoint, transformBoundsWithMatrix, clampAngleByRadian, asin, isNumberClose, TextMeasure, Bounds, getRectIntersect, isRectIntersect, arrayEqual, acos, getIntersectPoint, merge, calculateAnchorOfBounds, styleStringToObject } from '@visactor/vutils';
|
|
2
2
|
|
|
3
3
|
/******************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
@@ -698,6 +698,9 @@ class Node extends EventEmitter {
|
|
|
698
698
|
this.parent = null;
|
|
699
699
|
this._count = 1;
|
|
700
700
|
}
|
|
701
|
+
onParentSharedStateTreeChanged(_stage, _layer) {
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
701
704
|
forEachChildren(cb, reverse = false) {
|
|
702
705
|
if (reverse) {
|
|
703
706
|
let child = this._lastChild;
|
|
@@ -4759,7 +4762,7 @@ function addAttributeToPrototype(obj, c, keys) {
|
|
|
4759
4762
|
function rewriteProto(obj, c) {
|
|
4760
4763
|
Object.setPrototypeOf(obj, c);
|
|
4761
4764
|
}
|
|
4762
|
-
const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, innerPadding: 0, outerPadding: 0, cornerRadius: 0, padRadius: 0, padAngle: 0, cap: false, forceShowCap: false });
|
|
4765
|
+
const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, innerPadding: 0, outerPadding: 0, cornerRadius: 0, padRadius: 0, padAngle: 0, clipRange: 1, cap: false, forceShowCap: false });
|
|
4763
4766
|
const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, closePath: false, curveTension: 1 });
|
|
4764
4767
|
const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), { radius: 1, startAngle: 0, endAngle: pi2 });
|
|
4765
4768
|
const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start', baseOpacity: 1, cornerType: 'round' });
|
|
@@ -4826,7 +4829,8 @@ class ResourceLoader {
|
|
|
4826
4829
|
}
|
|
4827
4830
|
else {
|
|
4828
4831
|
data.waitingMark = [mark];
|
|
4829
|
-
data.dataPromise
|
|
4832
|
+
data.dataPromise
|
|
4833
|
+
.then(res => {
|
|
4830
4834
|
var _a;
|
|
4831
4835
|
data.loadState = (res === null || res === void 0 ? void 0 : res.data) ? 'success' : 'fail';
|
|
4832
4836
|
data.data = res === null || res === void 0 ? void 0 : res.data;
|
|
@@ -4842,6 +4846,14 @@ class ResourceLoader {
|
|
|
4842
4846
|
}
|
|
4843
4847
|
});
|
|
4844
4848
|
data.waitingMark && (data.waitingMark = []);
|
|
4849
|
+
})
|
|
4850
|
+
.catch(() => {
|
|
4851
|
+
var _a;
|
|
4852
|
+
data.loadState = 'fail';
|
|
4853
|
+
(_a = data.waitingMark) === null || _a === void 0 ? void 0 : _a.map((mark) => {
|
|
4854
|
+
mark.imageLoadFail(svgStr);
|
|
4855
|
+
});
|
|
4856
|
+
data.waitingMark && (data.waitingMark = []);
|
|
4845
4857
|
});
|
|
4846
4858
|
}
|
|
4847
4859
|
}
|
|
@@ -6258,6 +6270,13 @@ function isLeafTag(obj) {
|
|
|
6258
6270
|
return false;
|
|
6259
6271
|
}
|
|
6260
6272
|
|
|
6273
|
+
function isSvg(str) {
|
|
6274
|
+
return str.startsWith('<svg') || str.startsWith('<?xml');
|
|
6275
|
+
}
|
|
6276
|
+
function isXML(str) {
|
|
6277
|
+
return str.startsWith('<');
|
|
6278
|
+
}
|
|
6279
|
+
|
|
6261
6280
|
class XMLParser {
|
|
6262
6281
|
constructor(options) {
|
|
6263
6282
|
this.options = Object.assign({}, XMLParser.defaultOptions, options);
|
|
@@ -6275,12 +6294,6 @@ class XMLParser {
|
|
|
6275
6294
|
}
|
|
6276
6295
|
}
|
|
6277
6296
|
XMLParser.defaultOptions = {};
|
|
6278
|
-
function isSvg(str) {
|
|
6279
|
-
return str.startsWith('<svg') || str.startsWith('<?xml');
|
|
6280
|
-
}
|
|
6281
|
-
function isXML(str) {
|
|
6282
|
-
return str.startsWith('<');
|
|
6283
|
-
}
|
|
6284
6297
|
|
|
6285
6298
|
function incrementalAddTo(group, graphic) {
|
|
6286
6299
|
group.incrementalAppendChild(graphic);
|
|
@@ -9015,7 +9028,7 @@ function createConicalGradient(context, stops, x, y, deltaAngle, startAngle, end
|
|
|
9015
9028
|
return pattern;
|
|
9016
9029
|
}
|
|
9017
9030
|
|
|
9018
|
-
const FULL_DEFINITION_KEYS
|
|
9031
|
+
const FULL_DEFINITION_KEYS = new Set([
|
|
9019
9032
|
'name',
|
|
9020
9033
|
'patch',
|
|
9021
9034
|
'priority',
|
|
@@ -9024,7 +9037,7 @@ const FULL_DEFINITION_KEYS$1 = new Set([
|
|
|
9024
9037
|
'resolver',
|
|
9025
9038
|
'declaredAffectedKeys'
|
|
9026
9039
|
]);
|
|
9027
|
-
function isPlainObject$
|
|
9040
|
+
function isPlainObject$1(value) {
|
|
9028
9041
|
return value != null && typeof value === 'object' && !Array.isArray(value);
|
|
9029
9042
|
}
|
|
9030
9043
|
function normalizePatch(value) {
|
|
@@ -9086,14 +9099,13 @@ class StateDefinitionCompiler {
|
|
|
9086
9099
|
patch: undefined
|
|
9087
9100
|
};
|
|
9088
9101
|
}
|
|
9089
|
-
const keys = isPlainObject$
|
|
9090
|
-
const hasFullKey = keys.some(key => FULL_DEFINITION_KEYS
|
|
9102
|
+
const keys = isPlainObject$1(value) ? Object.keys(value) : [];
|
|
9103
|
+
const hasFullKey = keys.some(key => FULL_DEFINITION_KEYS.has(key));
|
|
9091
9104
|
if (hasFullKey) {
|
|
9092
9105
|
const definition = value;
|
|
9093
9106
|
return {
|
|
9094
9107
|
name: (_a = definition.name) !== null && _a !== void 0 ? _a : name,
|
|
9095
9108
|
priority: (_b = definition.priority) !== null && _b !== void 0 ? _b : 0,
|
|
9096
|
-
rank: definition.rank,
|
|
9097
9109
|
patch: normalizePatch(definition.patch),
|
|
9098
9110
|
resolver: definition.resolver,
|
|
9099
9111
|
declaredAffectedKeys: definition.declaredAffectedKeys,
|
|
@@ -9114,414 +9126,54 @@ class StateDefinitionCompiler {
|
|
|
9114
9126
|
});
|
|
9115
9127
|
compiled.forEach((definition, origin) => {
|
|
9116
9128
|
const closure = new Set();
|
|
9117
|
-
const walk = (stateName,
|
|
9129
|
+
const walk = (stateName, visiting) => {
|
|
9118
9130
|
const nextStates = rawRelationMap.get(stateName);
|
|
9119
9131
|
if (!nextStates || !nextStates.size) {
|
|
9120
9132
|
return;
|
|
9121
9133
|
}
|
|
9122
9134
|
nextStates.forEach(nextState => {
|
|
9123
|
-
if (nextState === origin) {
|
|
9124
|
-
console.warn(`[StateDefinitionCompiler] circular ${relation} relation detected: ${stack.join(' -> ')} -> ${origin}`);
|
|
9125
|
-
return;
|
|
9126
|
-
}
|
|
9127
|
-
if (stack.includes(nextState)) {
|
|
9128
|
-
console.warn(`[StateDefinitionCompiler] circular ${relation} relation detected: ${stack.join(' -> ')} -> ${nextState}`);
|
|
9129
|
-
return;
|
|
9130
|
-
}
|
|
9131
|
-
if (closure.has(nextState)) {
|
|
9135
|
+
if (nextState === origin || visiting.has(nextState) || closure.has(nextState)) {
|
|
9132
9136
|
return;
|
|
9133
9137
|
}
|
|
9134
9138
|
closure.add(nextState);
|
|
9135
|
-
|
|
9139
|
+
visiting.add(nextState);
|
|
9140
|
+
walk(nextState, visiting);
|
|
9141
|
+
visiting.delete(nextState);
|
|
9136
9142
|
});
|
|
9137
9143
|
};
|
|
9138
|
-
walk(origin, [origin]);
|
|
9144
|
+
walk(origin, new Set([origin]));
|
|
9139
9145
|
definition[relation] = closure;
|
|
9140
9146
|
});
|
|
9141
9147
|
}
|
|
9142
9148
|
}
|
|
9143
9149
|
|
|
9144
|
-
|
|
9145
|
-
(function (UpdateCategory) {
|
|
9146
|
-
UpdateCategory[UpdateCategory["NONE"] = 0] = "NONE";
|
|
9147
|
-
UpdateCategory[UpdateCategory["PAINT"] = 1] = "PAINT";
|
|
9148
|
-
UpdateCategory[UpdateCategory["SHAPE"] = 2] = "SHAPE";
|
|
9149
|
-
UpdateCategory[UpdateCategory["BOUNDS"] = 4] = "BOUNDS";
|
|
9150
|
-
UpdateCategory[UpdateCategory["TRANSFORM"] = 8] = "TRANSFORM";
|
|
9151
|
-
UpdateCategory[UpdateCategory["LAYOUT"] = 16] = "LAYOUT";
|
|
9152
|
-
UpdateCategory[UpdateCategory["PICK"] = 32] = "PICK";
|
|
9153
|
-
})(UpdateCategory || (UpdateCategory = {}));
|
|
9154
|
-
const ATTRIBUTE_CATEGORY = {
|
|
9155
|
-
fill: UpdateCategory.PAINT,
|
|
9156
|
-
opacity: UpdateCategory.PAINT,
|
|
9157
|
-
fillOpacity: UpdateCategory.PAINT,
|
|
9158
|
-
strokeOpacity: UpdateCategory.PAINT,
|
|
9159
|
-
lineDash: UpdateCategory.PAINT,
|
|
9160
|
-
lineDashOffset: UpdateCategory.PAINT,
|
|
9161
|
-
lineCap: UpdateCategory.PAINT,
|
|
9162
|
-
lineJoin: UpdateCategory.PAINT,
|
|
9163
|
-
miterLimit: UpdateCategory.PAINT,
|
|
9164
|
-
shadowColor: UpdateCategory.PAINT,
|
|
9165
|
-
x: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9166
|
-
y: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9167
|
-
scaleX: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9168
|
-
scaleY: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9169
|
-
angle: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9170
|
-
anchor: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9171
|
-
anchor3d: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9172
|
-
postMatrix: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9173
|
-
layout: UpdateCategory.LAYOUT,
|
|
9174
|
-
zIndex: UpdateCategory.PAINT,
|
|
9175
|
-
visible: UpdateCategory.PAINT | UpdateCategory.PICK,
|
|
9176
|
-
lineWidth: UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.PICK,
|
|
9177
|
-
width: UpdateCategory.SHAPE | UpdateCategory.BOUNDS,
|
|
9178
|
-
height: UpdateCategory.SHAPE | UpdateCategory.BOUNDS
|
|
9179
|
-
};
|
|
9180
|
-
const ATTRIBUTE_DELTA_CLASSIFIER = {
|
|
9181
|
-
stroke: (prev, next) => {
|
|
9182
|
-
const prevEnabled = prev != null && prev !== false;
|
|
9183
|
-
const nextEnabled = next != null && next !== false;
|
|
9184
|
-
if (prevEnabled !== nextEnabled) {
|
|
9185
|
-
return UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK;
|
|
9186
|
-
}
|
|
9187
|
-
return UpdateCategory.PAINT;
|
|
9188
|
-
},
|
|
9189
|
-
shadowBlur: (prev, next) => {
|
|
9190
|
-
const prevBlur = Number(prev !== null && prev !== void 0 ? prev : 0);
|
|
9191
|
-
const nextBlur = Number(next !== null && next !== void 0 ? next : 0);
|
|
9192
|
-
if (prevBlur !== nextBlur && (prevBlur > 0 || nextBlur > 0)) {
|
|
9193
|
-
return UpdateCategory.PAINT | UpdateCategory.BOUNDS;
|
|
9194
|
-
}
|
|
9195
|
-
return UpdateCategory.PAINT;
|
|
9196
|
-
}
|
|
9197
|
-
};
|
|
9198
|
-
function classifyAttributeDelta(key, prev, next) {
|
|
9199
|
-
var _a;
|
|
9200
|
-
const dynamicClassifier = ATTRIBUTE_DELTA_CLASSIFIER[key];
|
|
9201
|
-
if (dynamicClassifier) {
|
|
9202
|
-
return dynamicClassifier(prev, next);
|
|
9203
|
-
}
|
|
9204
|
-
return (_a = ATTRIBUTE_CATEGORY[key]) !== null && _a !== void 0 ? _a : UpdateCategory.PAINT;
|
|
9205
|
-
}
|
|
9206
|
-
function classifyAffectedKeyConservatively(key) {
|
|
9207
|
-
var _a;
|
|
9208
|
-
if (key === 'stroke') {
|
|
9209
|
-
return UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK;
|
|
9210
|
-
}
|
|
9211
|
-
if (key === 'shadowBlur') {
|
|
9212
|
-
return UpdateCategory.PAINT | UpdateCategory.BOUNDS;
|
|
9213
|
-
}
|
|
9214
|
-
return (_a = ATTRIBUTE_CATEGORY[key]) !== null && _a !== void 0 ? _a : UpdateCategory.PAINT;
|
|
9215
|
-
}
|
|
9216
|
-
function classifyAffectedKeys(keys) {
|
|
9217
|
-
let category = UpdateCategory.NONE;
|
|
9218
|
-
for (const key of keys) {
|
|
9219
|
-
category |= classifyAffectedKeyConservatively(key);
|
|
9220
|
-
}
|
|
9221
|
-
return category;
|
|
9222
|
-
}
|
|
9223
|
-
|
|
9224
|
-
const DEFAULT_MAX_EVENT_RECORDS = 100;
|
|
9225
|
-
const STAGE_PERF_MONITOR = Symbol('vrender.statePerfMonitor');
|
|
9226
|
-
function createReasonBreakdown() {
|
|
9227
|
-
return {
|
|
9228
|
-
config_disabled: 0,
|
|
9229
|
-
context_disabled: 0,
|
|
9230
|
-
non_batch_operation: 0,
|
|
9231
|
-
mixed_update_category: 0,
|
|
9232
|
-
resolver_unstable_keys: 0,
|
|
9233
|
-
graphic_unavailable: 0
|
|
9234
|
-
};
|
|
9235
|
-
}
|
|
9236
|
-
function createEmptyStatePerfSnapshot() {
|
|
9237
|
-
return {
|
|
9238
|
-
counters: {
|
|
9239
|
-
stateCommits: 0,
|
|
9240
|
-
sharedRefreshCommits: 0,
|
|
9241
|
-
deferredJobsCreated: 0,
|
|
9242
|
-
deferredJobsCompleted: 0,
|
|
9243
|
-
deferredJobsCancelled: 0,
|
|
9244
|
-
deferredJobsCoalesced: 0,
|
|
9245
|
-
deferredGraphicsCommitted: 0,
|
|
9246
|
-
deferredBudgetYields: 0,
|
|
9247
|
-
deferredIneligibleGraphics: 0
|
|
9248
|
-
},
|
|
9249
|
-
deferredIneligibleByReason: createReasonBreakdown(),
|
|
9250
|
-
categoryBreakdown: {
|
|
9251
|
-
paint: 0,
|
|
9252
|
-
transform: 0,
|
|
9253
|
-
shape: 0,
|
|
9254
|
-
bounds: 0,
|
|
9255
|
-
layout: 0,
|
|
9256
|
-
pick: 0
|
|
9257
|
-
},
|
|
9258
|
-
refresh: {
|
|
9259
|
-
queuedGraphics: 0,
|
|
9260
|
-
flushedGraphics: 0,
|
|
9261
|
-
ensureFreshCalls: 0,
|
|
9262
|
-
renderScheduled: 0
|
|
9263
|
-
},
|
|
9264
|
-
resolver: {
|
|
9265
|
-
cacheHits: 0,
|
|
9266
|
-
cacheMisses: 0,
|
|
9267
|
-
invalidations: 0
|
|
9268
|
-
},
|
|
9269
|
-
cost: {
|
|
9270
|
-
resolverTotalMs: 0,
|
|
9271
|
-
resolverMaxMs: 0,
|
|
9272
|
-
patchTotalMs: 0,
|
|
9273
|
-
patchMaxMs: 0,
|
|
9274
|
-
sharedRefreshTotalMs: 0,
|
|
9275
|
-
sharedRefreshMaxMs: 0,
|
|
9276
|
-
batchSliceTotalMs: 0,
|
|
9277
|
-
batchSliceMaxMs: 0
|
|
9278
|
-
},
|
|
9279
|
-
allocationHints: {
|
|
9280
|
-
patchObjectsCreated: 0,
|
|
9281
|
-
batchEntriesCreated: 0,
|
|
9282
|
-
refreshQueuePushes: 0
|
|
9283
|
-
},
|
|
9284
|
-
batch: {
|
|
9285
|
-
pendingJobs: 0,
|
|
9286
|
-
maxPendingJobs: 0,
|
|
9287
|
-
maxGraphicsInJob: 0,
|
|
9288
|
-
maxFrameSliceCost: 0
|
|
9289
|
-
},
|
|
9290
|
-
events: []
|
|
9291
|
-
};
|
|
9292
|
-
}
|
|
9293
|
-
function cloneSnapshot(snapshot) {
|
|
9294
|
-
return {
|
|
9295
|
-
counters: Object.assign({}, snapshot.counters),
|
|
9296
|
-
deferredIneligibleByReason: Object.assign({}, snapshot.deferredIneligibleByReason),
|
|
9297
|
-
categoryBreakdown: Object.assign({}, snapshot.categoryBreakdown),
|
|
9298
|
-
refresh: Object.assign({}, snapshot.refresh),
|
|
9299
|
-
resolver: Object.assign({}, snapshot.resolver),
|
|
9300
|
-
cost: Object.assign({}, snapshot.cost),
|
|
9301
|
-
allocationHints: Object.assign({}, snapshot.allocationHints),
|
|
9302
|
-
batch: Object.assign({}, snapshot.batch),
|
|
9303
|
-
events: snapshot.events ? snapshot.events.slice() : []
|
|
9304
|
-
};
|
|
9305
|
-
}
|
|
9306
|
-
function isDeferredStateContextConfig(value) {
|
|
9307
|
-
return (!!value &&
|
|
9308
|
-
(Object.prototype.hasOwnProperty.call(value, 'deferred') ||
|
|
9309
|
-
Object.prototype.hasOwnProperty.call(value, 'localEnabled')));
|
|
9310
|
-
}
|
|
9311
|
-
function normalizeDeferredStateOwnerConfig(value) {
|
|
9312
|
-
if (!value) {
|
|
9313
|
-
return undefined;
|
|
9314
|
-
}
|
|
9315
|
-
if (isDeferredStateContextConfig(value)) {
|
|
9316
|
-
return value;
|
|
9317
|
-
}
|
|
9318
|
-
return {
|
|
9319
|
-
deferred: value
|
|
9320
|
-
};
|
|
9321
|
-
}
|
|
9322
|
-
function normalizeDeferredStateConfig(config) {
|
|
9323
|
-
var _a, _b, _c;
|
|
9324
|
-
return {
|
|
9325
|
-
enabled: (_a = config === null || config === void 0 ? void 0 : config.enabled) !== null && _a !== void 0 ? _a : false,
|
|
9326
|
-
frameBudget: (_b = config === null || config === void 0 ? void 0 : config.frameBudget) !== null && _b !== void 0 ? _b : 8,
|
|
9327
|
-
maxGraphicsPerFrame: (_c = config === null || config === void 0 ? void 0 : config.maxGraphicsPerFrame) !== null && _c !== void 0 ? _c : 100
|
|
9328
|
-
};
|
|
9329
|
-
}
|
|
9330
|
-
function fingerprintDeferredStateConfig(config) {
|
|
9331
|
-
return `${config.enabled ? 1 : 0}:${config.frameBudget}:${config.maxGraphicsPerFrame}`;
|
|
9332
|
-
}
|
|
9333
|
-
class StatePerfMonitor {
|
|
9334
|
-
constructor(configSource) {
|
|
9335
|
-
this.configSource = configSource;
|
|
9336
|
-
this.snapshot = createEmptyStatePerfSnapshot();
|
|
9337
|
-
}
|
|
9338
|
-
setConfig(config) {
|
|
9339
|
-
this.configSource = config;
|
|
9340
|
-
}
|
|
9341
|
-
getSnapshot() {
|
|
9342
|
-
return cloneSnapshot(this.snapshot);
|
|
9343
|
-
}
|
|
9344
|
-
reset() {
|
|
9345
|
-
const next = createEmptyStatePerfSnapshot();
|
|
9346
|
-
Object.assign(this.snapshot.counters, next.counters);
|
|
9347
|
-
Object.assign(this.snapshot.deferredIneligibleByReason, next.deferredIneligibleByReason);
|
|
9348
|
-
Object.assign(this.snapshot.categoryBreakdown, next.categoryBreakdown);
|
|
9349
|
-
Object.assign(this.snapshot.refresh, next.refresh);
|
|
9350
|
-
Object.assign(this.snapshot.resolver, next.resolver);
|
|
9351
|
-
Object.assign(this.snapshot.cost, next.cost);
|
|
9352
|
-
Object.assign(this.snapshot.allocationHints, next.allocationHints);
|
|
9353
|
-
Object.assign(this.snapshot.batch, next.batch);
|
|
9354
|
-
this.snapshot.events = [];
|
|
9355
|
-
}
|
|
9356
|
-
incrementCounter(key, delta = 1) {
|
|
9357
|
-
if (!this.isEnabled()) {
|
|
9358
|
-
return;
|
|
9359
|
-
}
|
|
9360
|
-
this.snapshot.counters[key] += delta;
|
|
9361
|
-
}
|
|
9362
|
-
recordDeferredIneligible(reason, delta = 1) {
|
|
9363
|
-
if (!this.isEnabled()) {
|
|
9364
|
-
return;
|
|
9365
|
-
}
|
|
9366
|
-
this.snapshot.deferredIneligibleByReason[reason] += delta;
|
|
9367
|
-
this.snapshot.counters.deferredIneligibleGraphics += delta;
|
|
9368
|
-
this.recordEvent('deferred-ineligible', { reason, count: delta });
|
|
9369
|
-
}
|
|
9370
|
-
recordCategory(category) {
|
|
9371
|
-
if (!this.isEnabled()) {
|
|
9372
|
-
return;
|
|
9373
|
-
}
|
|
9374
|
-
if (category & UpdateCategory.PAINT) {
|
|
9375
|
-
this.snapshot.categoryBreakdown.paint += 1;
|
|
9376
|
-
}
|
|
9377
|
-
if (category & UpdateCategory.TRANSFORM) {
|
|
9378
|
-
this.snapshot.categoryBreakdown.transform += 1;
|
|
9379
|
-
}
|
|
9380
|
-
if (category & UpdateCategory.SHAPE) {
|
|
9381
|
-
this.snapshot.categoryBreakdown.shape += 1;
|
|
9382
|
-
}
|
|
9383
|
-
if (category & UpdateCategory.BOUNDS) {
|
|
9384
|
-
this.snapshot.categoryBreakdown.bounds += 1;
|
|
9385
|
-
}
|
|
9386
|
-
if (category & UpdateCategory.LAYOUT) {
|
|
9387
|
-
this.snapshot.categoryBreakdown.layout += 1;
|
|
9388
|
-
}
|
|
9389
|
-
if (category & UpdateCategory.PICK) {
|
|
9390
|
-
this.snapshot.categoryBreakdown.pick += 1;
|
|
9391
|
-
}
|
|
9392
|
-
}
|
|
9393
|
-
recordRefresh(key, delta = 1) {
|
|
9394
|
-
if (!this.isEnabled()) {
|
|
9395
|
-
return;
|
|
9396
|
-
}
|
|
9397
|
-
this.snapshot.refresh[key] += delta;
|
|
9398
|
-
}
|
|
9399
|
-
recordResolver(key, delta = 1) {
|
|
9400
|
-
if (!this.isEnabled()) {
|
|
9401
|
-
return;
|
|
9402
|
-
}
|
|
9403
|
-
this.snapshot.resolver[key] += delta;
|
|
9404
|
-
}
|
|
9405
|
-
recordCost(kind, durationMs) {
|
|
9406
|
-
if (!this.isEnabled()) {
|
|
9407
|
-
return;
|
|
9408
|
-
}
|
|
9409
|
-
if (kind === 'resolver') {
|
|
9410
|
-
this.snapshot.cost.resolverTotalMs += durationMs;
|
|
9411
|
-
this.snapshot.cost.resolverMaxMs = Math.max(this.snapshot.cost.resolverMaxMs, durationMs);
|
|
9412
|
-
return;
|
|
9413
|
-
}
|
|
9414
|
-
if (kind === 'patch') {
|
|
9415
|
-
this.snapshot.cost.patchTotalMs += durationMs;
|
|
9416
|
-
this.snapshot.cost.patchMaxMs = Math.max(this.snapshot.cost.patchMaxMs, durationMs);
|
|
9417
|
-
return;
|
|
9418
|
-
}
|
|
9419
|
-
if (kind === 'sharedRefresh') {
|
|
9420
|
-
this.snapshot.cost.sharedRefreshTotalMs += durationMs;
|
|
9421
|
-
this.snapshot.cost.sharedRefreshMaxMs = Math.max(this.snapshot.cost.sharedRefreshMaxMs, durationMs);
|
|
9422
|
-
return;
|
|
9423
|
-
}
|
|
9424
|
-
this.snapshot.cost.batchSliceTotalMs += durationMs;
|
|
9425
|
-
this.snapshot.cost.batchSliceMaxMs = Math.max(this.snapshot.cost.batchSliceMaxMs, durationMs);
|
|
9426
|
-
this.snapshot.batch.maxFrameSliceCost = Math.max(this.snapshot.batch.maxFrameSliceCost, durationMs);
|
|
9427
|
-
}
|
|
9428
|
-
recordAllocation(key, delta = 1) {
|
|
9429
|
-
if (!this.isEnabled()) {
|
|
9430
|
-
return;
|
|
9431
|
-
}
|
|
9432
|
-
this.snapshot.allocationHints[key] += delta;
|
|
9433
|
-
}
|
|
9434
|
-
updateBatchPending(pendingJobs) {
|
|
9435
|
-
if (!this.isEnabled()) {
|
|
9436
|
-
return;
|
|
9437
|
-
}
|
|
9438
|
-
this.snapshot.batch.pendingJobs = pendingJobs;
|
|
9439
|
-
this.snapshot.batch.maxPendingJobs = Math.max(this.snapshot.batch.maxPendingJobs, pendingJobs);
|
|
9440
|
-
}
|
|
9441
|
-
updateMaxGraphicsInJob(count) {
|
|
9442
|
-
if (!this.isEnabled()) {
|
|
9443
|
-
return;
|
|
9444
|
-
}
|
|
9445
|
-
this.snapshot.batch.maxGraphicsInJob = Math.max(this.snapshot.batch.maxGraphicsInJob, count);
|
|
9446
|
-
}
|
|
9447
|
-
recordEvent(type, detail) {
|
|
9448
|
-
var _a, _b, _c;
|
|
9449
|
-
if (!this.shouldRecordEvents()) {
|
|
9450
|
-
return;
|
|
9451
|
-
}
|
|
9452
|
-
const events = (_a = this.snapshot.events) !== null && _a !== void 0 ? _a : (this.snapshot.events = []);
|
|
9453
|
-
events.push({
|
|
9454
|
-
type,
|
|
9455
|
-
at: Date.now(),
|
|
9456
|
-
detail
|
|
9457
|
-
});
|
|
9458
|
-
const max = (_c = (_b = this.getConfig()) === null || _b === void 0 ? void 0 : _b.maxEventRecords) !== null && _c !== void 0 ? _c : DEFAULT_MAX_EVENT_RECORDS;
|
|
9459
|
-
if (events.length > max) {
|
|
9460
|
-
events.splice(0, events.length - max);
|
|
9461
|
-
}
|
|
9462
|
-
}
|
|
9463
|
-
isEnabled() {
|
|
9464
|
-
var _a;
|
|
9465
|
-
return ((_a = this.getConfig()) === null || _a === void 0 ? void 0 : _a.enabled) === true;
|
|
9466
|
-
}
|
|
9467
|
-
shouldRecordEvents() {
|
|
9468
|
-
const config = this.getConfig();
|
|
9469
|
-
return !!(config === null || config === void 0 ? void 0 : config.enabled) && !!config.recordEvents;
|
|
9470
|
-
}
|
|
9471
|
-
getConfig() {
|
|
9472
|
-
return typeof this.configSource === 'function' ? this.configSource() : this.configSource;
|
|
9473
|
-
}
|
|
9474
|
-
}
|
|
9475
|
-
function ensureStageStatePerfMonitor(stage) {
|
|
9476
|
-
const stageAny = stage;
|
|
9477
|
-
if (!stageAny[STAGE_PERF_MONITOR]) {
|
|
9478
|
-
stageAny[STAGE_PERF_MONITOR] = new StatePerfMonitor(() => stage.statePerfConfig);
|
|
9479
|
-
}
|
|
9480
|
-
return stageAny[STAGE_PERF_MONITOR];
|
|
9481
|
-
}
|
|
9482
|
-
function getStageStatePerfMonitor(stage) {
|
|
9483
|
-
if (!stage) {
|
|
9484
|
-
return undefined;
|
|
9485
|
-
}
|
|
9486
|
-
return stage[STAGE_PERF_MONITOR];
|
|
9487
|
-
}
|
|
9488
|
-
|
|
9489
|
-
function isPlainObject$1(value) {
|
|
9150
|
+
function isPlainObject(value) {
|
|
9490
9151
|
return value != null && typeof value === 'object' && !Array.isArray(value);
|
|
9491
9152
|
}
|
|
9492
|
-
function cloneValue
|
|
9493
|
-
if (!isPlainObject
|
|
9153
|
+
function cloneValue(value) {
|
|
9154
|
+
if (!isPlainObject(value)) {
|
|
9494
9155
|
return value;
|
|
9495
9156
|
}
|
|
9496
9157
|
const clone = {};
|
|
9497
9158
|
Object.keys(value).forEach(key => {
|
|
9498
|
-
clone[key] = cloneValue
|
|
9159
|
+
clone[key] = cloneValue(value[key]);
|
|
9499
9160
|
});
|
|
9500
9161
|
return clone;
|
|
9501
9162
|
}
|
|
9502
|
-
function deepMerge
|
|
9163
|
+
function deepMerge(base, value) {
|
|
9503
9164
|
var _a;
|
|
9504
|
-
const result = (_a = cloneValue
|
|
9165
|
+
const result = (_a = cloneValue(base)) !== null && _a !== void 0 ? _a : {};
|
|
9505
9166
|
Object.keys(value).forEach(key => {
|
|
9506
9167
|
const nextValue = value[key];
|
|
9507
9168
|
const previousValue = result[key];
|
|
9508
|
-
if (isPlainObject
|
|
9509
|
-
result[key] = deepMerge
|
|
9169
|
+
if (isPlainObject(previousValue) && isPlainObject(nextValue)) {
|
|
9170
|
+
result[key] = deepMerge(previousValue, nextValue);
|
|
9510
9171
|
return;
|
|
9511
9172
|
}
|
|
9512
|
-
result[key] = cloneValue
|
|
9173
|
+
result[key] = cloneValue(nextValue);
|
|
9513
9174
|
});
|
|
9514
9175
|
return result;
|
|
9515
9176
|
}
|
|
9516
|
-
const FULL_DEFINITION_KEYS = new Set([
|
|
9517
|
-
'name',
|
|
9518
|
-
'patch',
|
|
9519
|
-
'priority',
|
|
9520
|
-
'exclude',
|
|
9521
|
-
'suppress',
|
|
9522
|
-
'resolver',
|
|
9523
|
-
'declaredAffectedKeys'
|
|
9524
|
-
]);
|
|
9525
9177
|
class StateEngine {
|
|
9526
9178
|
constructor(options) {
|
|
9527
9179
|
var _a;
|
|
@@ -9535,9 +9187,6 @@ class StateEngine {
|
|
|
9535
9187
|
this.baseAttributes = {};
|
|
9536
9188
|
this.compiledDefinitions = options.compiledDefinitions;
|
|
9537
9189
|
this.stateSort = options.stateSort;
|
|
9538
|
-
this.stateProxy = options.stateProxy;
|
|
9539
|
-
this.stateProxyEligibility = options.stateProxyEligibility;
|
|
9540
|
-
this.states = options.states;
|
|
9541
9190
|
this.mergeMode = (_a = options.mergeMode) !== null && _a !== void 0 ? _a : 'shallow';
|
|
9542
9191
|
}
|
|
9543
9192
|
get activeStates() {
|
|
@@ -9553,6 +9202,9 @@ class StateEngine {
|
|
|
9553
9202
|
return this._suppressed;
|
|
9554
9203
|
}
|
|
9555
9204
|
setResolveContext(graphic, baseAttributes) {
|
|
9205
|
+
if (this.graphic !== graphic || this.baseAttributes !== baseAttributes) {
|
|
9206
|
+
this.invalidateResolverCache();
|
|
9207
|
+
}
|
|
9556
9208
|
this.graphic = graphic;
|
|
9557
9209
|
this.baseAttributes = baseAttributes;
|
|
9558
9210
|
}
|
|
@@ -9636,11 +9288,9 @@ class StateEngine {
|
|
|
9636
9288
|
};
|
|
9637
9289
|
}
|
|
9638
9290
|
invalidateResolverCache() {
|
|
9639
|
-
var _a, _b;
|
|
9640
9291
|
this.resolverPatchCache.clear();
|
|
9641
9292
|
this.resolverCacheKey = '';
|
|
9642
9293
|
this.resolverCacheValid = false;
|
|
9643
|
-
(_b = getStageStatePerfMonitor((_a = this.graphic) === null || _a === void 0 ? void 0 : _a.stage)) === null || _b === void 0 ? void 0 : _b.recordResolver('invalidations');
|
|
9644
9294
|
}
|
|
9645
9295
|
hasState(stateName) {
|
|
9646
9296
|
if (!this._activeStates.length) {
|
|
@@ -9651,28 +9301,6 @@ class StateEngine {
|
|
|
9651
9301
|
}
|
|
9652
9302
|
return this._activeStates.includes(stateName);
|
|
9653
9303
|
}
|
|
9654
|
-
getCompatPatch(stateName) {
|
|
9655
|
-
var _a, _b, _c;
|
|
9656
|
-
const targetStates = this._activeStates.length ? this._activeStates : this._effectiveStates;
|
|
9657
|
-
const canUseStateProxy = this.canUseStateProxy(stateName);
|
|
9658
|
-
const proxyPatch = canUseStateProxy ? (_a = this.stateProxy) === null || _a === void 0 ? void 0 : _a.call(this, stateName, targetStates) : undefined;
|
|
9659
|
-
if (this.stateProxy && canUseStateProxy) {
|
|
9660
|
-
return proxyPatch !== null && proxyPatch !== void 0 ? proxyPatch : undefined;
|
|
9661
|
-
}
|
|
9662
|
-
const value = (_b = this.states) === null || _b === void 0 ? void 0 : _b[stateName];
|
|
9663
|
-
if (value == null) {
|
|
9664
|
-
return undefined;
|
|
9665
|
-
}
|
|
9666
|
-
if (!isPlainObject$1(value)) {
|
|
9667
|
-
return value;
|
|
9668
|
-
}
|
|
9669
|
-
const keys = Object.keys(value);
|
|
9670
|
-
const hasFullKey = keys.some(key => FULL_DEFINITION_KEYS.has(key));
|
|
9671
|
-
if (!hasFullKey) {
|
|
9672
|
-
return value;
|
|
9673
|
-
}
|
|
9674
|
-
return cloneValue$1(((_c = value.patch) !== null && _c !== void 0 ? _c : undefined));
|
|
9675
|
-
}
|
|
9676
9304
|
sortStates(states) {
|
|
9677
9305
|
const withDefinition = [];
|
|
9678
9306
|
const withoutDefinition = [];
|
|
@@ -9729,96 +9357,44 @@ class StateEngine {
|
|
|
9729
9357
|
};
|
|
9730
9358
|
}
|
|
9731
9359
|
recomputePatch(effectiveStates) {
|
|
9732
|
-
var _a;
|
|
9733
|
-
const perfMonitor = getStageStatePerfMonitor((_a = this.graphic) === null || _a === void 0 ? void 0 : _a.stage);
|
|
9734
|
-
const patchStart = perfMonitor ? performance.now() : 0;
|
|
9735
|
-
let resolverCost = 0;
|
|
9736
9360
|
const cacheKey = effectiveStates.join(',');
|
|
9737
9361
|
const nextPatch = {};
|
|
9738
|
-
|
|
9739
|
-
if (
|
|
9740
|
-
effectiveStates.forEach(stateName => {
|
|
9741
|
-
var _a;
|
|
9742
|
-
const canUseStateProxy = this.canUseStateProxy(stateName);
|
|
9743
|
-
const proxyPatch = canUseStateProxy ? (_a = this.stateProxy) === null || _a === void 0 ? void 0 : _a.call(this, stateName, effectiveStates) : undefined;
|
|
9744
|
-
if (this.stateProxy && canUseStateProxy) {
|
|
9745
|
-
if (proxyPatch != null) {
|
|
9746
|
-
this.mergeInto(nextPatch, proxyPatch);
|
|
9747
|
-
}
|
|
9748
|
-
return;
|
|
9749
|
-
}
|
|
9750
|
-
const definition = this.compiledDefinitions.get(stateName);
|
|
9751
|
-
if (!definition) {
|
|
9752
|
-
const compatPatch = this.getCompatPatch(stateName);
|
|
9753
|
-
if (compatPatch) {
|
|
9754
|
-
this.mergeInto(nextPatch, compatPatch);
|
|
9755
|
-
}
|
|
9756
|
-
return;
|
|
9757
|
-
}
|
|
9758
|
-
if (definition.patch) {
|
|
9759
|
-
this.mergeInto(nextPatch, definition.patch);
|
|
9760
|
-
}
|
|
9761
|
-
if (definition.hasResolver) {
|
|
9762
|
-
const cachedPatch = this.resolverPatchCache.get(stateName);
|
|
9763
|
-
if (cachedPatch) {
|
|
9764
|
-
perfMonitor === null || perfMonitor === void 0 ? void 0 : perfMonitor.recordResolver('cacheHits');
|
|
9765
|
-
this.mergeInto(nextPatch, cachedPatch);
|
|
9766
|
-
}
|
|
9767
|
-
}
|
|
9768
|
-
});
|
|
9769
|
-
}
|
|
9770
|
-
else {
|
|
9362
|
+
const useResolverCache = this.resolverCacheValid && this.resolverCacheKey === cacheKey;
|
|
9363
|
+
if (!useResolverCache) {
|
|
9771
9364
|
this.resolverPatchCache.clear();
|
|
9772
9365
|
this.resolverCacheKey = cacheKey;
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
this.mergeInto(nextPatch, compatPatch);
|
|
9788
|
-
}
|
|
9789
|
-
return;
|
|
9790
|
-
}
|
|
9791
|
-
if (definition.patch) {
|
|
9792
|
-
this.mergeInto(nextPatch, definition.patch);
|
|
9793
|
-
}
|
|
9794
|
-
if (definition.hasResolver && definition.resolver) {
|
|
9795
|
-
perfMonitor === null || perfMonitor === void 0 ? void 0 : perfMonitor.recordResolver('cacheMisses');
|
|
9796
|
-
const resolverStart = perfMonitor ? performance.now() : 0;
|
|
9797
|
-
const resolverPatch = definition.resolver({
|
|
9366
|
+
}
|
|
9367
|
+
effectiveStates.forEach(stateName => {
|
|
9368
|
+
var _a;
|
|
9369
|
+
const definition = this.compiledDefinitions.get(stateName);
|
|
9370
|
+
if (!definition) {
|
|
9371
|
+
return;
|
|
9372
|
+
}
|
|
9373
|
+
if (definition.patch) {
|
|
9374
|
+
this.mergeInto(nextPatch, definition.patch);
|
|
9375
|
+
}
|
|
9376
|
+
if (definition.hasResolver) {
|
|
9377
|
+
const resolverPatch = useResolverCache
|
|
9378
|
+
? this.resolverPatchCache.get(stateName)
|
|
9379
|
+
: (_a = definition.resolver) === null || _a === void 0 ? void 0 : _a.call(definition, {
|
|
9798
9380
|
graphic: this.graphic,
|
|
9799
9381
|
activeStates: this._activeStates,
|
|
9800
9382
|
effectiveStates: this._effectiveStates,
|
|
9801
9383
|
baseAttributes: this.baseAttributes,
|
|
9802
9384
|
resolvedPatch: nextPatch
|
|
9803
9385
|
});
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
resolverCost += duration;
|
|
9807
|
-
perfMonitor.recordCost('resolver', duration);
|
|
9808
|
-
}
|
|
9809
|
-
if (resolverPatch) {
|
|
9386
|
+
if (resolverPatch) {
|
|
9387
|
+
if (!useResolverCache) {
|
|
9810
9388
|
this.resolverPatchCache.set(stateName, resolverPatch);
|
|
9811
|
-
this.mergeInto(nextPatch, resolverPatch);
|
|
9812
9389
|
}
|
|
9390
|
+
this.mergeInto(nextPatch, resolverPatch);
|
|
9813
9391
|
}
|
|
9814
|
-
}
|
|
9392
|
+
}
|
|
9393
|
+
});
|
|
9394
|
+
if (!useResolverCache) {
|
|
9815
9395
|
this.resolverCacheValid = true;
|
|
9816
9396
|
}
|
|
9817
9397
|
this._resolvedPatch = nextPatch;
|
|
9818
|
-
if (perfMonitor) {
|
|
9819
|
-
const totalCost = performance.now() - patchStart;
|
|
9820
|
-
perfMonitor.recordCost('patch', Math.max(0, totalCost - resolverCost));
|
|
9821
|
-
}
|
|
9822
9398
|
}
|
|
9823
9399
|
mergeInto(target, patch) {
|
|
9824
9400
|
if (this.mergeMode === 'deep') {
|
|
@@ -9827,20 +9403,20 @@ class StateEngine {
|
|
|
9827
9403
|
const nextValue = patch[key];
|
|
9828
9404
|
const previousValue = target[key];
|
|
9829
9405
|
const baseValue = (_a = this.baseAttributes) === null || _a === void 0 ? void 0 : _a[key];
|
|
9830
|
-
if (isPlainObject
|
|
9831
|
-
target[key] = deepMerge
|
|
9406
|
+
if (isPlainObject(previousValue) && isPlainObject(nextValue)) {
|
|
9407
|
+
target[key] = deepMerge(previousValue, nextValue);
|
|
9832
9408
|
return;
|
|
9833
9409
|
}
|
|
9834
|
-
if (!isPlainObject
|
|
9835
|
-
target[key] = deepMerge
|
|
9410
|
+
if (!isPlainObject(previousValue) && isPlainObject(baseValue) && isPlainObject(nextValue)) {
|
|
9411
|
+
target[key] = deepMerge(baseValue, nextValue);
|
|
9836
9412
|
return;
|
|
9837
9413
|
}
|
|
9838
|
-
target[key] = cloneValue
|
|
9414
|
+
target[key] = cloneValue(nextValue);
|
|
9839
9415
|
});
|
|
9840
9416
|
return;
|
|
9841
9417
|
}
|
|
9842
9418
|
Object.keys(patch).forEach(key => {
|
|
9843
|
-
target[key] = cloneValue
|
|
9419
|
+
target[key] = cloneValue(patch[key]);
|
|
9844
9420
|
});
|
|
9845
9421
|
}
|
|
9846
9422
|
sameArray(left, right) {
|
|
@@ -9854,341 +9430,69 @@ class StateEngine {
|
|
|
9854
9430
|
}
|
|
9855
9431
|
return true;
|
|
9856
9432
|
}
|
|
9857
|
-
canUseStateProxy(stateName) {
|
|
9858
|
-
if (!this.stateProxy) {
|
|
9859
|
-
return false;
|
|
9860
|
-
}
|
|
9861
|
-
return this.stateProxyEligibility ? this.stateProxyEligibility(stateName) : true;
|
|
9862
|
-
}
|
|
9863
|
-
}
|
|
9864
|
-
|
|
9865
|
-
class StateModel {
|
|
9866
|
-
constructor(options = {}) {
|
|
9867
|
-
var _a;
|
|
9868
|
-
this.exclusiveGroupMap = new Map();
|
|
9869
|
-
this.exclusiveGroups = new Map();
|
|
9870
|
-
this.states = options.states;
|
|
9871
|
-
this.currentStates = options.currentStates ? [...options.currentStates] : undefined;
|
|
9872
|
-
this.stateSort = options.stateSort;
|
|
9873
|
-
this.stateProxy = options.stateProxy;
|
|
9874
|
-
this.stateEngine = options.stateEngine;
|
|
9875
|
-
if (this.stateEngine &&
|
|
9876
|
-
options.currentStates &&
|
|
9877
|
-
!this.sameStates(this.stateEngine.activeStates, options.currentStates)) {
|
|
9878
|
-
this.stateEngine.applyStates(options.currentStates);
|
|
9879
|
-
}
|
|
9880
|
-
const exclusiveGroups = (_a = options.exclusiveGroups) !== null && _a !== void 0 ? _a : {};
|
|
9881
|
-
for (const groupName in exclusiveGroups) {
|
|
9882
|
-
if (!Object.prototype.hasOwnProperty.call(exclusiveGroups, groupName)) {
|
|
9883
|
-
continue;
|
|
9884
|
-
}
|
|
9885
|
-
this.registerExclusiveGroup(groupName, exclusiveGroups[groupName]);
|
|
9886
|
-
}
|
|
9887
|
-
}
|
|
9888
|
-
getCurrentStates() {
|
|
9889
|
-
return this.currentStates ? [...this.currentStates] : [];
|
|
9890
|
-
}
|
|
9891
|
-
hasState(stateName) {
|
|
9892
|
-
if (this.stateEngine) {
|
|
9893
|
-
return this.stateEngine.hasState(stateName);
|
|
9894
|
-
}
|
|
9895
|
-
if (!this.currentStates || !this.currentStates.length) {
|
|
9896
|
-
return false;
|
|
9897
|
-
}
|
|
9898
|
-
if (stateName == null) {
|
|
9899
|
-
return true;
|
|
9900
|
-
}
|
|
9901
|
-
return this.currentStates.includes(stateName);
|
|
9902
|
-
}
|
|
9903
|
-
getState(stateName) {
|
|
9904
|
-
var _a;
|
|
9905
|
-
return (_a = this.states) === null || _a === void 0 ? void 0 : _a[stateName];
|
|
9906
|
-
}
|
|
9907
|
-
useStates(states) {
|
|
9908
|
-
var _a;
|
|
9909
|
-
if (this.stateEngine) {
|
|
9910
|
-
const result = this.stateEngine.applyStates(states);
|
|
9911
|
-
this.currentStates = [...result.activeStates];
|
|
9912
|
-
return {
|
|
9913
|
-
changed: result.changed,
|
|
9914
|
-
states: [...result.activeStates],
|
|
9915
|
-
effectiveStates: [...result.effectiveStates]
|
|
9916
|
-
};
|
|
9917
|
-
}
|
|
9918
|
-
if (!states.length) {
|
|
9919
|
-
return this.clearStates();
|
|
9920
|
-
}
|
|
9921
|
-
const previousStates = (_a = this.currentStates) !== null && _a !== void 0 ? _a : [];
|
|
9922
|
-
const changed = previousStates.length !== states.length || states.some((stateName, index) => previousStates[index] !== stateName);
|
|
9923
|
-
const nextStates = this.sortStates(states);
|
|
9924
|
-
if (changed) {
|
|
9925
|
-
this.currentStates = nextStates;
|
|
9926
|
-
}
|
|
9927
|
-
return {
|
|
9928
|
-
changed,
|
|
9929
|
-
states: changed ? [...nextStates] : [...previousStates]
|
|
9930
|
-
};
|
|
9931
|
-
}
|
|
9932
|
-
clearStates() {
|
|
9933
|
-
if (this.stateEngine) {
|
|
9934
|
-
const result = this.stateEngine.clearStates();
|
|
9935
|
-
this.currentStates = [];
|
|
9936
|
-
return {
|
|
9937
|
-
changed: result.changed,
|
|
9938
|
-
states: [],
|
|
9939
|
-
effectiveStates: []
|
|
9940
|
-
};
|
|
9941
|
-
}
|
|
9942
|
-
const changed = this.hasState();
|
|
9943
|
-
this.currentStates = [];
|
|
9944
|
-
return {
|
|
9945
|
-
changed,
|
|
9946
|
-
states: []
|
|
9947
|
-
};
|
|
9948
|
-
}
|
|
9949
|
-
addState(stateName, keepCurrentStates) {
|
|
9950
|
-
var _a;
|
|
9951
|
-
if (this.stateEngine) {
|
|
9952
|
-
const result = this.stateEngine.addState(stateName, keepCurrentStates);
|
|
9953
|
-
this.currentStates = [...result.activeStates];
|
|
9954
|
-
return {
|
|
9955
|
-
changed: result.changed,
|
|
9956
|
-
states: [...result.activeStates],
|
|
9957
|
-
effectiveStates: [...result.effectiveStates]
|
|
9958
|
-
};
|
|
9959
|
-
}
|
|
9960
|
-
if (this.currentStates &&
|
|
9961
|
-
this.currentStates.includes(stateName) &&
|
|
9962
|
-
(keepCurrentStates || this.currentStates.length === 1)) {
|
|
9963
|
-
return {
|
|
9964
|
-
changed: false,
|
|
9965
|
-
states: this.getCurrentStates()
|
|
9966
|
-
};
|
|
9967
|
-
}
|
|
9968
|
-
const nextStates = keepCurrentStates && ((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) ? this.currentStates.concat([stateName]) : [stateName];
|
|
9969
|
-
return this.useStates(nextStates);
|
|
9970
|
-
}
|
|
9971
|
-
removeState(stateName) {
|
|
9972
|
-
if (this.stateEngine) {
|
|
9973
|
-
const result = this.stateEngine.removeState(stateName);
|
|
9974
|
-
this.currentStates = [...result.activeStates];
|
|
9975
|
-
return {
|
|
9976
|
-
changed: result.changed,
|
|
9977
|
-
states: [...result.activeStates],
|
|
9978
|
-
effectiveStates: [...result.effectiveStates]
|
|
9979
|
-
};
|
|
9980
|
-
}
|
|
9981
|
-
if (!this.currentStates) {
|
|
9982
|
-
return {
|
|
9983
|
-
changed: false,
|
|
9984
|
-
states: []
|
|
9985
|
-
};
|
|
9986
|
-
}
|
|
9987
|
-
const filter = Array.isArray(stateName) ? (s) => !stateName.includes(s) : (s) => s !== stateName;
|
|
9988
|
-
const nextStates = this.currentStates.filter(filter);
|
|
9989
|
-
if (nextStates.length === this.currentStates.length) {
|
|
9990
|
-
return {
|
|
9991
|
-
changed: false,
|
|
9992
|
-
states: this.getCurrentStates()
|
|
9993
|
-
};
|
|
9994
|
-
}
|
|
9995
|
-
return this.useStates(nextStates);
|
|
9996
|
-
}
|
|
9997
|
-
toggleState(stateName) {
|
|
9998
|
-
if (this.stateEngine) {
|
|
9999
|
-
const result = this.stateEngine.toggleState(stateName);
|
|
10000
|
-
this.currentStates = [...result.activeStates];
|
|
10001
|
-
return {
|
|
10002
|
-
changed: result.changed,
|
|
10003
|
-
states: [...result.activeStates],
|
|
10004
|
-
effectiveStates: [...result.effectiveStates]
|
|
10005
|
-
};
|
|
10006
|
-
}
|
|
10007
|
-
if (this.hasState(stateName)) {
|
|
10008
|
-
return this.removeState(stateName);
|
|
10009
|
-
}
|
|
10010
|
-
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
10011
|
-
if (!nextStates.includes(stateName)) {
|
|
10012
|
-
nextStates.push(stateName);
|
|
10013
|
-
}
|
|
10014
|
-
return this.useStates(nextStates);
|
|
10015
|
-
}
|
|
10016
|
-
sortStates(states) {
|
|
10017
|
-
if (this.stateEngine) {
|
|
10018
|
-
return [...this.stateEngine.activeStates];
|
|
10019
|
-
}
|
|
10020
|
-
if (!this.stateSort) {
|
|
10021
|
-
return [...states];
|
|
10022
|
-
}
|
|
10023
|
-
return [...states].sort(this.stateSort);
|
|
10024
|
-
}
|
|
10025
|
-
registerExclusiveGroup(groupName, states) {
|
|
10026
|
-
const uniqueStates = Array.from(new Set(states));
|
|
10027
|
-
this.exclusiveGroups.set(groupName, uniqueStates);
|
|
10028
|
-
uniqueStates.forEach(stateName => this.exclusiveGroupMap.set(stateName, groupName));
|
|
10029
|
-
}
|
|
10030
|
-
getExclusiveGroup(stateName) {
|
|
10031
|
-
return this.exclusiveGroupMap.get(stateName);
|
|
10032
|
-
}
|
|
10033
|
-
getMutuallyExclusiveStates(stateName) {
|
|
10034
|
-
var _a;
|
|
10035
|
-
const groupName = this.getExclusiveGroup(stateName);
|
|
10036
|
-
if (!groupName) {
|
|
10037
|
-
return [];
|
|
10038
|
-
}
|
|
10039
|
-
return ((_a = this.exclusiveGroups.get(groupName)) !== null && _a !== void 0 ? _a : []).filter(name => name !== stateName);
|
|
10040
|
-
}
|
|
10041
|
-
isMutuallyExclusive(stateA, stateB) {
|
|
10042
|
-
const groupName = this.getExclusiveGroup(stateA);
|
|
10043
|
-
return !!groupName && groupName === this.getExclusiveGroup(stateB) && stateA !== stateB;
|
|
10044
|
-
}
|
|
10045
|
-
get effectiveStates() {
|
|
10046
|
-
var _a, _b, _c;
|
|
10047
|
-
return (_c = (_b = (_a = this.stateEngine) === null || _a === void 0 ? void 0 : _a.effectiveStates) !== null && _b !== void 0 ? _b : this.currentStates) !== null && _c !== void 0 ? _c : [];
|
|
10048
|
-
}
|
|
10049
|
-
get resolvedPatch() {
|
|
10050
|
-
var _a;
|
|
10051
|
-
return (_a = this.stateEngine) === null || _a === void 0 ? void 0 : _a.resolvedPatch;
|
|
10052
|
-
}
|
|
10053
|
-
sameStates(left, right) {
|
|
10054
|
-
if (left.length !== right.length) {
|
|
10055
|
-
return false;
|
|
10056
|
-
}
|
|
10057
|
-
for (let index = 0; index < left.length; index++) {
|
|
10058
|
-
if (left[index] !== right[index]) {
|
|
10059
|
-
return false;
|
|
10060
|
-
}
|
|
10061
|
-
}
|
|
10062
|
-
return true;
|
|
10063
|
-
}
|
|
10064
9433
|
}
|
|
10065
9434
|
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
9435
|
+
var UpdateCategory;
|
|
9436
|
+
(function (UpdateCategory) {
|
|
9437
|
+
UpdateCategory[UpdateCategory["NONE"] = 0] = "NONE";
|
|
9438
|
+
UpdateCategory[UpdateCategory["PAINT"] = 1] = "PAINT";
|
|
9439
|
+
UpdateCategory[UpdateCategory["SHAPE"] = 2] = "SHAPE";
|
|
9440
|
+
UpdateCategory[UpdateCategory["BOUNDS"] = 4] = "BOUNDS";
|
|
9441
|
+
UpdateCategory[UpdateCategory["TRANSFORM"] = 8] = "TRANSFORM";
|
|
9442
|
+
UpdateCategory[UpdateCategory["LAYOUT"] = 16] = "LAYOUT";
|
|
9443
|
+
UpdateCategory[UpdateCategory["PICK"] = 32] = "PICK";
|
|
9444
|
+
})(UpdateCategory || (UpdateCategory = {}));
|
|
9445
|
+
const ATTRIBUTE_CATEGORY = {
|
|
9446
|
+
fill: UpdateCategory.PAINT,
|
|
9447
|
+
opacity: UpdateCategory.PAINT,
|
|
9448
|
+
fillOpacity: UpdateCategory.PAINT,
|
|
9449
|
+
strokeOpacity: UpdateCategory.PAINT,
|
|
9450
|
+
lineDash: UpdateCategory.PAINT,
|
|
9451
|
+
lineDashOffset: UpdateCategory.PAINT,
|
|
9452
|
+
lineCap: UpdateCategory.PAINT,
|
|
9453
|
+
lineJoin: UpdateCategory.PAINT,
|
|
9454
|
+
miterLimit: UpdateCategory.PAINT,
|
|
9455
|
+
shadowColor: UpdateCategory.PAINT,
|
|
9456
|
+
x: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9457
|
+
y: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9458
|
+
scaleX: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9459
|
+
scaleY: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9460
|
+
angle: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9461
|
+
anchor: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9462
|
+
anchor3d: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9463
|
+
postMatrix: UpdateCategory.TRANSFORM | UpdateCategory.BOUNDS,
|
|
9464
|
+
layout: UpdateCategory.LAYOUT,
|
|
9465
|
+
zIndex: UpdateCategory.PAINT,
|
|
9466
|
+
visible: UpdateCategory.PAINT | UpdateCategory.PICK,
|
|
9467
|
+
lineWidth: UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.PICK,
|
|
9468
|
+
width: UpdateCategory.SHAPE | UpdateCategory.BOUNDS,
|
|
9469
|
+
height: UpdateCategory.SHAPE | UpdateCategory.BOUNDS
|
|
9470
|
+
};
|
|
9471
|
+
const ATTRIBUTE_DELTA_CLASSIFIER = {
|
|
9472
|
+
stroke: (prev, next) => {
|
|
9473
|
+
const prevEnabled = prev != null && prev !== false;
|
|
9474
|
+
const nextEnabled = next != null && next !== false;
|
|
9475
|
+
if (prevEnabled !== nextEnabled) {
|
|
9476
|
+
return UpdateCategory.PAINT | UpdateCategory.BOUNDS | UpdateCategory.PICK;
|
|
10092
9477
|
}
|
|
10093
|
-
|
|
10094
|
-
|
|
9478
|
+
return UpdateCategory.PAINT;
|
|
9479
|
+
},
|
|
9480
|
+
shadowBlur: (prev, next) => {
|
|
9481
|
+
const prevBlur = Number(prev !== null && prev !== void 0 ? prev : 0);
|
|
9482
|
+
const nextBlur = Number(next !== null && next !== void 0 ? next : 0);
|
|
9483
|
+
if (prevBlur !== nextBlur && (prevBlur > 0 || nextBlur > 0)) {
|
|
9484
|
+
return UpdateCategory.PAINT | UpdateCategory.BOUNDS;
|
|
10095
9485
|
}
|
|
9486
|
+
return UpdateCategory.PAINT;
|
|
10096
9487
|
}
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
resolve(normalAttrs, states, stateProxy, currentStates, stateSort) {
|
|
10104
|
-
var _a;
|
|
10105
|
-
const mergeMode = (_a = this.options.mergeMode) !== null && _a !== void 0 ? _a : 'shallow';
|
|
10106
|
-
const sortedStates = stateSort ? currentStates.slice().sort(stateSort) : currentStates.slice();
|
|
10107
|
-
const resolvedAttrs = {};
|
|
10108
|
-
sortedStates.forEach(stateName => {
|
|
10109
|
-
const attrs = stateProxy ? stateProxy(stateName, sortedStates) : states === null || states === void 0 ? void 0 : states[stateName];
|
|
10110
|
-
if (attrs == null) {
|
|
10111
|
-
return;
|
|
10112
|
-
}
|
|
10113
|
-
for (const key in attrs) {
|
|
10114
|
-
if (!Object.prototype.hasOwnProperty.call(attrs, key)) {
|
|
10115
|
-
continue;
|
|
10116
|
-
}
|
|
10117
|
-
const nextValue = attrs[key];
|
|
10118
|
-
if (mergeMode === 'deep' &&
|
|
10119
|
-
isPlainObject(nextValue) &&
|
|
10120
|
-
(isPlainObject(resolvedAttrs[key]) ||
|
|
10121
|
-
isPlainObject(normalAttrs[key]))) {
|
|
10122
|
-
const baseValue = isPlainObject(resolvedAttrs[key])
|
|
10123
|
-
? resolvedAttrs[key]
|
|
10124
|
-
: isPlainObject(normalAttrs[key])
|
|
10125
|
-
? normalAttrs[key]
|
|
10126
|
-
: {};
|
|
10127
|
-
resolvedAttrs[key] = deepMerge(baseValue, nextValue);
|
|
10128
|
-
}
|
|
10129
|
-
else {
|
|
10130
|
-
resolvedAttrs[key] = cloneValue(nextValue);
|
|
10131
|
-
}
|
|
10132
|
-
}
|
|
10133
|
-
});
|
|
10134
|
-
return resolvedAttrs;
|
|
10135
|
-
}
|
|
10136
|
-
resolveWithCompiled(normalAttrs, compiledDefinitions, stateProxy, effectiveStates, resolvedPatch) {
|
|
10137
|
-
var _a, _b;
|
|
10138
|
-
const mergeMode = (_a = this.options.mergeMode) !== null && _a !== void 0 ? _a : 'shallow';
|
|
10139
|
-
const resolvedAttrs = (_b = cloneValue(resolvedPatch)) !== null && _b !== void 0 ? _b : {};
|
|
10140
|
-
effectiveStates.forEach(stateName => {
|
|
10141
|
-
const proxyPatch = stateProxy === null || stateProxy === void 0 ? void 0 : stateProxy(stateName, effectiveStates);
|
|
10142
|
-
if (proxyPatch == null) {
|
|
10143
|
-
return;
|
|
10144
|
-
}
|
|
10145
|
-
Object.keys(proxyPatch).forEach(key => {
|
|
10146
|
-
const nextValue = proxyPatch[key];
|
|
10147
|
-
const hasCompiledDefinition = compiledDefinitions.has(stateName);
|
|
10148
|
-
if (mergeMode === 'deep' &&
|
|
10149
|
-
isPlainObject(nextValue) &&
|
|
10150
|
-
(isPlainObject(resolvedAttrs[key]) ||
|
|
10151
|
-
(!hasCompiledDefinition && isPlainObject(normalAttrs[key])))) {
|
|
10152
|
-
const baseValue = isPlainObject(resolvedAttrs[key])
|
|
10153
|
-
? resolvedAttrs[key]
|
|
10154
|
-
: isPlainObject(normalAttrs[key])
|
|
10155
|
-
? normalAttrs[key]
|
|
10156
|
-
: {};
|
|
10157
|
-
resolvedAttrs[key] = deepMerge(baseValue, nextValue);
|
|
10158
|
-
return;
|
|
10159
|
-
}
|
|
10160
|
-
resolvedAttrs[key] = cloneValue(nextValue);
|
|
10161
|
-
});
|
|
10162
|
-
});
|
|
10163
|
-
return resolvedAttrs;
|
|
10164
|
-
}
|
|
10165
|
-
computeNormalAttrsBackup(normalAttrs, targetAttrs, finalAttribute) {
|
|
10166
|
-
const nextNormalAttrs = {};
|
|
10167
|
-
const nextTargetAttrs = Object.assign({}, targetAttrs);
|
|
10168
|
-
for (const key in targetAttrs) {
|
|
10169
|
-
if (!Object.prototype.hasOwnProperty.call(targetAttrs, key)) {
|
|
10170
|
-
continue;
|
|
10171
|
-
}
|
|
10172
|
-
if (normalAttrs && key in normalAttrs) {
|
|
10173
|
-
nextNormalAttrs[key] = cloneValue(normalAttrs[key]);
|
|
10174
|
-
}
|
|
10175
|
-
else {
|
|
10176
|
-
nextNormalAttrs[key] = cloneValue(finalAttribute[key]);
|
|
10177
|
-
}
|
|
10178
|
-
}
|
|
10179
|
-
if (normalAttrs) {
|
|
10180
|
-
for (const key in normalAttrs) {
|
|
10181
|
-
if (!Object.prototype.hasOwnProperty.call(normalAttrs, key) || key in targetAttrs) {
|
|
10182
|
-
continue;
|
|
10183
|
-
}
|
|
10184
|
-
nextTargetAttrs[key] = cloneValue(normalAttrs[key]);
|
|
10185
|
-
}
|
|
10186
|
-
}
|
|
10187
|
-
return {
|
|
10188
|
-
attrs: nextTargetAttrs,
|
|
10189
|
-
normalAttrs: nextNormalAttrs
|
|
10190
|
-
};
|
|
9488
|
+
};
|
|
9489
|
+
function classifyAttributeDelta(key, prev, next) {
|
|
9490
|
+
var _a;
|
|
9491
|
+
const dynamicClassifier = ATTRIBUTE_DELTA_CLASSIFIER[key];
|
|
9492
|
+
if (dynamicClassifier) {
|
|
9493
|
+
return dynamicClassifier(prev, next);
|
|
10191
9494
|
}
|
|
9495
|
+
return (_a = ATTRIBUTE_CATEGORY[key]) !== null && _a !== void 0 ? _a : UpdateCategory.PAINT;
|
|
10192
9496
|
}
|
|
10193
9497
|
|
|
10194
9498
|
function hasOwnKeys(value) {
|
|
@@ -10212,13 +9516,11 @@ function normalizeNoAnimateAttrConfig(config) {
|
|
|
10212
9516
|
}, {});
|
|
10213
9517
|
}
|
|
10214
9518
|
class StateTransitionOrchestrator {
|
|
10215
|
-
analyzeTransition(
|
|
9519
|
+
analyzeTransition(targetAttrs, hasAnimation, options = {}) {
|
|
10216
9520
|
var _a, _b;
|
|
10217
9521
|
const plan = {
|
|
10218
|
-
stateNames,
|
|
10219
9522
|
targetAttrs: Object.assign({}, targetAttrs),
|
|
10220
9523
|
animateAttrs: {},
|
|
10221
|
-
jumpAttrs: {},
|
|
10222
9524
|
noAnimateAttrs: {}
|
|
10223
9525
|
};
|
|
10224
9526
|
if (!hasAnimation) {
|
|
@@ -10227,10 +9529,10 @@ class StateTransitionOrchestrator {
|
|
|
10227
9529
|
const noWorkAnimateAttr = Object.assign(Object.assign({}, ((_a = options.noWorkAnimateAttr) !== null && _a !== void 0 ? _a : {})), normalizeNoAnimateAttrConfig((_b = options.animateConfig) === null || _b === void 0 ? void 0 : _b.noAnimateAttrs));
|
|
10228
9530
|
const isClear = options.isClear === true;
|
|
10229
9531
|
const getDefaultAttribute = options.getDefaultAttribute;
|
|
9532
|
+
const readDefaultAttribute = getDefaultAttribute;
|
|
10230
9533
|
const shouldSkipDefaultAttribute = options.shouldSkipDefaultAttribute;
|
|
10231
9534
|
const assignTransitionAttr = (key, value) => {
|
|
10232
9535
|
if (noWorkAnimateAttr[key]) {
|
|
10233
|
-
plan.jumpAttrs[key] = value;
|
|
10234
9536
|
plan.noAnimateAttrs[key] = value;
|
|
10235
9537
|
return;
|
|
10236
9538
|
}
|
|
@@ -10238,7 +9540,7 @@ class StateTransitionOrchestrator {
|
|
|
10238
9540
|
if (shouldSkipDefaultAttribute === null || shouldSkipDefaultAttribute === void 0 ? void 0 : shouldSkipDefaultAttribute(key, targetAttrs)) {
|
|
10239
9541
|
return;
|
|
10240
9542
|
}
|
|
10241
|
-
plan.animateAttrs[key] =
|
|
9543
|
+
plan.animateAttrs[key] = readDefaultAttribute(key);
|
|
10242
9544
|
return;
|
|
10243
9545
|
}
|
|
10244
9546
|
plan.animateAttrs[key] = value;
|
|
@@ -10292,13 +9594,13 @@ class StateTransitionOrchestrator {
|
|
|
10292
9594
|
graphic._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });
|
|
10293
9595
|
return plan;
|
|
10294
9596
|
}
|
|
10295
|
-
applyClearTransition(graphic, targetAttrs, hasAnimation,
|
|
10296
|
-
var _a
|
|
10297
|
-
const plan = this.analyzeTransition(
|
|
10298
|
-
noWorkAnimateAttr:
|
|
9597
|
+
applyClearTransition(graphic, targetAttrs, hasAnimation, options = {}) {
|
|
9598
|
+
var _a;
|
|
9599
|
+
const plan = this.analyzeTransition(targetAttrs, hasAnimation, {
|
|
9600
|
+
noWorkAnimateAttr: graphic.getNoWorkAnimateAttr(),
|
|
10299
9601
|
isClear: true,
|
|
10300
|
-
getDefaultAttribute:
|
|
10301
|
-
shouldSkipDefaultAttribute: (
|
|
9602
|
+
getDefaultAttribute: graphic.getDefaultAttribute.bind(graphic),
|
|
9603
|
+
shouldSkipDefaultAttribute: (_a = options.shouldSkipDefaultAttribute) !== null && _a !== void 0 ? _a : graphic.shouldSkipStateTransitionDefaultAttribute.bind(graphic),
|
|
10302
9604
|
animateConfig: options.animateConfig,
|
|
10303
9605
|
extraAnimateAttrs: options.extraAnimateAttrs
|
|
10304
9606
|
});
|
|
@@ -10307,33 +9609,11 @@ class StateTransitionOrchestrator {
|
|
|
10307
9609
|
}
|
|
10308
9610
|
|
|
10309
9611
|
const compiler = new StateDefinitionCompiler();
|
|
10310
|
-
function copyDefinitions(definitions) {
|
|
10311
|
-
return definitions ? Object.assign({}, definitions) : {};
|
|
10312
|
-
}
|
|
10313
9612
|
function buildEffectiveSourceDefinitions(parentScope, localStateDefinitions, themeStateDefinitions) {
|
|
10314
|
-
|
|
10315
|
-
? copyDefinitions(parentScope.effectiveSourceDefinitions)
|
|
10316
|
-
: copyDefinitions(themeStateDefinitions);
|
|
10317
|
-
if (localStateDefinitions) {
|
|
10318
|
-
Object.keys(localStateDefinitions).forEach(stateName => {
|
|
10319
|
-
merged[stateName] = localStateDefinitions[stateName];
|
|
10320
|
-
});
|
|
10321
|
-
}
|
|
10322
|
-
return merged;
|
|
10323
|
-
}
|
|
10324
|
-
function initializeScope(scope, revision = 0) {
|
|
10325
|
-
var _a;
|
|
10326
|
-
const effectiveSourceDefinitions = buildEffectiveSourceDefinitions(scope.parentScope, scope.localStateDefinitions, scope.themeStateDefinitions);
|
|
10327
|
-
scope.effectiveSourceDefinitions = effectiveSourceDefinitions;
|
|
10328
|
-
scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions);
|
|
10329
|
-
scope.parentRevisionAtBuild = (_a = scope.parentScope) === null || _a === void 0 ? void 0 : _a.revision;
|
|
10330
|
-
scope.revision = revision;
|
|
10331
|
-
scope.dirty = false;
|
|
10332
|
-
return scope;
|
|
9613
|
+
return Object.assign({}, parentScope ? parentScope.effectiveSourceDefinitions : themeStateDefinitions, localStateDefinitions);
|
|
10333
9614
|
}
|
|
10334
9615
|
function createRootSharedStateScope(stage, themeStateDefinitions) {
|
|
10335
|
-
return
|
|
10336
|
-
ownerKind: 'root',
|
|
9616
|
+
return rebuildSharedStateScope({
|
|
10337
9617
|
ownerStage: stage,
|
|
10338
9618
|
themeStateDefinitions,
|
|
10339
9619
|
effectiveSourceDefinitions: {},
|
|
@@ -10344,9 +9624,7 @@ function createRootSharedStateScope(stage, themeStateDefinitions) {
|
|
|
10344
9624
|
}, 0);
|
|
10345
9625
|
}
|
|
10346
9626
|
function createGroupSharedStateScope(group, parentScope, localStateDefinitions) {
|
|
10347
|
-
return
|
|
10348
|
-
ownerKind: 'group',
|
|
10349
|
-
ownerGroup: group,
|
|
9627
|
+
return rebuildSharedStateScope({
|
|
10350
9628
|
ownerStage: group.stage,
|
|
10351
9629
|
parentScope,
|
|
10352
9630
|
localStateDefinitions,
|
|
@@ -10381,22 +9659,20 @@ function setRootSharedStateScopeThemeDefinitions(scope, themeStateDefinitions) {
|
|
|
10381
9659
|
rebuildSharedStateScope(scope);
|
|
10382
9660
|
return true;
|
|
10383
9661
|
}
|
|
10384
|
-
function rebuildSharedStateScope(scope) {
|
|
9662
|
+
function rebuildSharedStateScope(scope, revision = scope.revision + 1) {
|
|
10385
9663
|
var _a;
|
|
10386
9664
|
const effectiveSourceDefinitions = buildEffectiveSourceDefinitions(scope.parentScope, scope.localStateDefinitions, scope.themeStateDefinitions);
|
|
10387
9665
|
scope.effectiveSourceDefinitions = effectiveSourceDefinitions;
|
|
10388
9666
|
scope.effectiveCompiledDefinitions = compiler.compile(effectiveSourceDefinitions);
|
|
10389
9667
|
scope.parentRevisionAtBuild = (_a = scope.parentScope) === null || _a === void 0 ? void 0 : _a.revision;
|
|
10390
|
-
scope.revision
|
|
9668
|
+
scope.revision = revision;
|
|
10391
9669
|
scope.dirty = false;
|
|
10392
9670
|
return scope;
|
|
10393
9671
|
}
|
|
10394
9672
|
function ensureSharedStateScopeFresh(scope) {
|
|
10395
|
-
var _a;
|
|
10396
9673
|
if (!scope) {
|
|
10397
9674
|
return undefined;
|
|
10398
9675
|
}
|
|
10399
|
-
(_a = getStageStatePerfMonitor(scope.ownerStage)) === null || _a === void 0 ? void 0 : _a.recordRefresh('ensureFreshCalls');
|
|
10400
9676
|
if (scope.parentScope) {
|
|
10401
9677
|
ensureSharedStateScopeFresh(scope.parentScope);
|
|
10402
9678
|
}
|
|
@@ -10416,11 +9692,9 @@ function collectSharedStateScopeChain(scope) {
|
|
|
10416
9692
|
}
|
|
10417
9693
|
|
|
10418
9694
|
function scheduleStageSharedStateRefresh(stage) {
|
|
10419
|
-
var _a;
|
|
10420
9695
|
if (!stage || stage.releaseStatus === 'released') {
|
|
10421
9696
|
return;
|
|
10422
9697
|
}
|
|
10423
|
-
(_a = getStageStatePerfMonitor(stage)) === null || _a === void 0 ? void 0 : _a.recordRefresh('renderScheduled');
|
|
10424
9698
|
stage.renderNextFrame();
|
|
10425
9699
|
}
|
|
10426
9700
|
function enqueueGraphicSharedStateRefresh(stage, graphic) {
|
|
@@ -10429,36 +9703,27 @@ function enqueueGraphicSharedStateRefresh(stage, graphic) {
|
|
|
10429
9703
|
return;
|
|
10430
9704
|
}
|
|
10431
9705
|
const pending = (_a = stage._pendingSharedStateRefreshGraphics) !== null && _a !== void 0 ? _a : (stage._pendingSharedStateRefreshGraphics = new Set());
|
|
10432
|
-
|
|
10433
|
-
pending.add(graphic);
|
|
10434
|
-
const perfMonitor = getStageStatePerfMonitor(stage);
|
|
10435
|
-
perfMonitor === null || perfMonitor === void 0 ? void 0 : perfMonitor.recordRefresh('queuedGraphics');
|
|
10436
|
-
perfMonitor === null || perfMonitor === void 0 ? void 0 : perfMonitor.recordAllocation('refreshQueuePushes');
|
|
10437
|
-
}
|
|
9706
|
+
pending.add(graphic);
|
|
10438
9707
|
}
|
|
10439
9708
|
function markScopeActiveDescendantsDirty(scope, stage) {
|
|
10440
|
-
|
|
9709
|
+
if (!scope.subtreeActiveDescendants.size) {
|
|
9710
|
+
return;
|
|
9711
|
+
}
|
|
10441
9712
|
scope.subtreeActiveDescendants.forEach(graphic => {
|
|
10442
9713
|
var _a;
|
|
10443
9714
|
graphic.sharedStateDirty = true;
|
|
10444
9715
|
const ownerStage = (_a = stage !== null && stage !== void 0 ? stage : graphic.stage) !== null && _a !== void 0 ? _a : scope.ownerStage;
|
|
10445
9716
|
enqueueGraphicSharedStateRefresh(ownerStage, graphic);
|
|
10446
|
-
marked = true;
|
|
10447
9717
|
});
|
|
10448
|
-
|
|
10449
|
-
scheduleStageSharedStateRefresh(stage !== null && stage !== void 0 ? stage : scope.ownerStage);
|
|
10450
|
-
}
|
|
9718
|
+
scheduleStageSharedStateRefresh(stage !== null && stage !== void 0 ? stage : scope.ownerStage);
|
|
10451
9719
|
}
|
|
10452
9720
|
function flushStageSharedStateRefresh(stage) {
|
|
10453
9721
|
const pending = stage._pendingSharedStateRefreshGraphics;
|
|
10454
9722
|
if (!pending || !pending.size) {
|
|
10455
9723
|
return;
|
|
10456
9724
|
}
|
|
10457
|
-
const perfMonitor = getStageStatePerfMonitor(stage);
|
|
10458
|
-
const start = perfMonitor ? performance.now() : 0;
|
|
10459
9725
|
const graphics = Array.from(pending.values());
|
|
10460
9726
|
pending.clear();
|
|
10461
|
-
perfMonitor === null || perfMonitor === void 0 ? void 0 : perfMonitor.recordRefresh('flushedGraphics', graphics.length);
|
|
10462
9727
|
graphics.forEach(graphic => {
|
|
10463
9728
|
if (graphic.releaseStatus === 'released') {
|
|
10464
9729
|
return;
|
|
@@ -10466,19 +9731,11 @@ function flushStageSharedStateRefresh(stage) {
|
|
|
10466
9731
|
if (graphic.stage !== stage) {
|
|
10467
9732
|
return;
|
|
10468
9733
|
}
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
refresh.call(graphic);
|
|
10472
|
-
perfMonitor === null || perfMonitor === void 0 ? void 0 : perfMonitor.incrementCounter('sharedRefreshCommits');
|
|
9734
|
+
if (!graphic.sharedStateDirty) {
|
|
9735
|
+
return;
|
|
10473
9736
|
}
|
|
9737
|
+
graphic.refreshSharedStateBeforeRender();
|
|
10474
9738
|
});
|
|
10475
|
-
if (perfMonitor) {
|
|
10476
|
-
perfMonitor.recordCost('sharedRefresh', performance.now() - start);
|
|
10477
|
-
perfMonitor.recordEvent('shared-refresh-flush', {
|
|
10478
|
-
stageId: stage._uid,
|
|
10479
|
-
flushedGraphics: graphics.length
|
|
10480
|
-
});
|
|
10481
|
-
}
|
|
10482
9739
|
}
|
|
10483
9740
|
|
|
10484
9741
|
const _tempBounds$1 = new AABBBounds();
|
|
@@ -10519,8 +9776,14 @@ const builtinTextureTypes = new Set([
|
|
|
10519
9776
|
'wave'
|
|
10520
9777
|
]);
|
|
10521
9778
|
const point = new Point();
|
|
9779
|
+
const EMPTY_STATE_NAMES = [];
|
|
9780
|
+
const BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT |
|
|
9781
|
+
UpdateCategory.SHAPE |
|
|
9782
|
+
UpdateCategory.BOUNDS |
|
|
9783
|
+
UpdateCategory.TRANSFORM |
|
|
9784
|
+
UpdateCategory.LAYOUT;
|
|
10522
9785
|
function isPlainObjectValue(value) {
|
|
10523
|
-
return typeof value === 'object' && value != null && !isArray(value);
|
|
9786
|
+
return typeof value === 'object' && value != null && !Array.isArray(value);
|
|
10524
9787
|
}
|
|
10525
9788
|
function cloneAttributeValue(value) {
|
|
10526
9789
|
if (!isPlainObjectValue(value)) {
|
|
@@ -10534,18 +9797,6 @@ function cloneAttributeValue(value) {
|
|
|
10534
9797
|
});
|
|
10535
9798
|
return clone;
|
|
10536
9799
|
}
|
|
10537
|
-
function cloneSimpleAttributeRecord(value) {
|
|
10538
|
-
if (!isPlainObjectValue(value)) {
|
|
10539
|
-
return value;
|
|
10540
|
-
}
|
|
10541
|
-
return Object.assign({}, value);
|
|
10542
|
-
}
|
|
10543
|
-
function shouldUseSimpleAttributeFastPath(value) {
|
|
10544
|
-
if (!isPlainObjectValue(value)) {
|
|
10545
|
-
return false;
|
|
10546
|
-
}
|
|
10547
|
-
return !Object.keys(value).some(key => isPlainObjectValue(value[key]));
|
|
10548
|
-
}
|
|
10549
9800
|
function cloneAttributeSurface(value) {
|
|
10550
9801
|
if (!isPlainObjectValue(value)) {
|
|
10551
9802
|
return value;
|
|
@@ -10558,6 +9809,15 @@ function cloneAttributeSurface(value) {
|
|
|
10558
9809
|
});
|
|
10559
9810
|
return clone;
|
|
10560
9811
|
}
|
|
9812
|
+
function areAttributeValuesEqual(left, right) {
|
|
9813
|
+
if (left === right) {
|
|
9814
|
+
return true;
|
|
9815
|
+
}
|
|
9816
|
+
if (!isPlainObjectValue(left) && !isPlainObjectValue(right) && !Array.isArray(left) && !Array.isArray(right)) {
|
|
9817
|
+
return false;
|
|
9818
|
+
}
|
|
9819
|
+
return isEqual(left, right);
|
|
9820
|
+
}
|
|
10561
9821
|
function deepMergeAttributeValue(base, value) {
|
|
10562
9822
|
var _a;
|
|
10563
9823
|
const result = (_a = cloneAttributeValue(base)) !== null && _a !== void 0 ? _a : {};
|
|
@@ -10625,24 +9885,29 @@ class Graphic extends Node {
|
|
|
10625
9885
|
get globalTransMatrix() {
|
|
10626
9886
|
return this.tryUpdateGlobalTransMatrix(true);
|
|
10627
9887
|
}
|
|
9888
|
+
get baseAttributes() {
|
|
9889
|
+
var _a;
|
|
9890
|
+
return (_a = this._baseAttributes) !== null && _a !== void 0 ? _a : this.attribute;
|
|
9891
|
+
}
|
|
9892
|
+
set baseAttributes(value) {
|
|
9893
|
+
if (value === this.attribute) {
|
|
9894
|
+
this._baseAttributes = undefined;
|
|
9895
|
+
return;
|
|
9896
|
+
}
|
|
9897
|
+
this._baseAttributes = value;
|
|
9898
|
+
}
|
|
10628
9899
|
constructor(params = {}) {
|
|
10629
9900
|
var _a;
|
|
10630
9901
|
super();
|
|
10631
|
-
this.resolverEpoch = 0;
|
|
10632
9902
|
this._AABBBounds = new AABBBounds();
|
|
10633
9903
|
this._updateTag = UpdateTag.INIT;
|
|
10634
|
-
|
|
10635
|
-
const initialBaseAttributes = (useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params));
|
|
10636
|
-
this.baseAttributes = initialBaseAttributes;
|
|
10637
|
-
this.attribute = (useSimpleAttributeFastPath
|
|
10638
|
-
? cloneSimpleAttributeRecord(initialBaseAttributes)
|
|
10639
|
-
: cloneAttributeSurface(initialBaseAttributes));
|
|
9904
|
+
this.attribute = params;
|
|
10640
9905
|
this.valid = this.isValid();
|
|
10641
9906
|
this.updateAABBBoundsStamp = 0;
|
|
10642
9907
|
if (params.background) {
|
|
10643
9908
|
this.loadImage((_a = params.background.background) !== null && _a !== void 0 ? _a : params.background, true);
|
|
10644
9909
|
}
|
|
10645
|
-
if (isExternalTexture(params.texture)) {
|
|
9910
|
+
if (params.texture && isExternalTexture(params.texture)) {
|
|
10646
9911
|
this.loadImage(params.texture, false);
|
|
10647
9912
|
}
|
|
10648
9913
|
if (params.shadowGraphic) {
|
|
@@ -10652,8 +9917,11 @@ class Graphic extends Node {
|
|
|
10652
9917
|
get normalAttrs() {
|
|
10653
9918
|
return this.baseAttributes;
|
|
10654
9919
|
}
|
|
10655
|
-
set normalAttrs(
|
|
10656
|
-
|
|
9920
|
+
set normalAttrs(_value) {
|
|
9921
|
+
}
|
|
9922
|
+
getBaseAttributesStorage() {
|
|
9923
|
+
var _a;
|
|
9924
|
+
return (_a = this._baseAttributes) !== null && _a !== void 0 ? _a : this.attribute;
|
|
10657
9925
|
}
|
|
10658
9926
|
getGraphicService() {
|
|
10659
9927
|
var _a, _b;
|
|
@@ -10662,18 +9930,6 @@ class Graphic extends Node {
|
|
|
10662
9930
|
getAttributes() {
|
|
10663
9931
|
return this.attribute;
|
|
10664
9932
|
}
|
|
10665
|
-
getStateStyleResolver(mergeMode) {
|
|
10666
|
-
if (mergeMode === 'deep') {
|
|
10667
|
-
if (!this.deepStateStyleResolver) {
|
|
10668
|
-
this.deepStateStyleResolver = new StateStyleResolver({ mergeMode: 'deep' });
|
|
10669
|
-
}
|
|
10670
|
-
return this.deepStateStyleResolver;
|
|
10671
|
-
}
|
|
10672
|
-
if (!this.stateStyleResolver) {
|
|
10673
|
-
this.stateStyleResolver = new StateStyleResolver();
|
|
10674
|
-
}
|
|
10675
|
-
return this.stateStyleResolver;
|
|
10676
|
-
}
|
|
10677
9933
|
getStateTransitionOrchestrator() {
|
|
10678
9934
|
if (!this.stateTransitionOrchestrator) {
|
|
10679
9935
|
this.stateTransitionOrchestrator = new StateTransitionOrchestrator();
|
|
@@ -10700,25 +9956,41 @@ class Graphic extends Node {
|
|
|
10700
9956
|
}
|
|
10701
9957
|
this.boundSharedStateScope = nextScope;
|
|
10702
9958
|
this.boundSharedStateRevision = undefined;
|
|
10703
|
-
this.localFallbackCompiledDefinitions = undefined;
|
|
10704
9959
|
this.compiledStateDefinitions = undefined;
|
|
10705
9960
|
this.compiledStateDefinitionsCacheKey = undefined;
|
|
10706
9961
|
this.stateEngine = undefined;
|
|
10707
9962
|
this.stateEngineCompiledDefinitions = undefined;
|
|
10708
|
-
this.stateEngineStateProxyModeKey = undefined;
|
|
10709
9963
|
this.syncSharedStateActiveRegistrations();
|
|
10710
9964
|
if (markDirty && ((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
10711
9965
|
this.markSharedStateDirty();
|
|
10712
9966
|
}
|
|
10713
9967
|
return true;
|
|
10714
9968
|
}
|
|
10715
|
-
|
|
9969
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = true) {
|
|
10716
9970
|
var _a, _b;
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
:
|
|
10720
|
-
|
|
10721
|
-
|
|
9971
|
+
if (!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
9972
|
+
!this.boundSharedStateScope &&
|
|
9973
|
+
!((_b = this.registeredActiveScopes) === null || _b === void 0 ? void 0 : _b.size) &&
|
|
9974
|
+
!this.sharedStateDirty) {
|
|
9975
|
+
return false;
|
|
9976
|
+
}
|
|
9977
|
+
return this.syncSharedStateScopeBindingFromTree(markDirty);
|
|
9978
|
+
}
|
|
9979
|
+
syncSharedStateActiveRegistrations() {
|
|
9980
|
+
var _a;
|
|
9981
|
+
const previousScopes = this.registeredActiveScopes;
|
|
9982
|
+
if (!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) || !this.boundSharedStateScope) {
|
|
9983
|
+
if (previousScopes === null || previousScopes === void 0 ? void 0 : previousScopes.size) {
|
|
9984
|
+
previousScopes.forEach(scope => {
|
|
9985
|
+
scope.subtreeActiveDescendants.delete(this);
|
|
9986
|
+
});
|
|
9987
|
+
previousScopes.clear();
|
|
9988
|
+
}
|
|
9989
|
+
this.registeredActiveScopes = undefined;
|
|
9990
|
+
return;
|
|
9991
|
+
}
|
|
9992
|
+
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
9993
|
+
previousScopes === null || previousScopes === void 0 ? void 0 : previousScopes.forEach(scope => {
|
|
10722
9994
|
if (!nextScopes.has(scope)) {
|
|
10723
9995
|
scope.subtreeActiveDescendants.delete(this);
|
|
10724
9996
|
}
|
|
@@ -10748,7 +10020,7 @@ class Graphic extends Node {
|
|
|
10748
10020
|
this.setStage(stage, layer);
|
|
10749
10021
|
return;
|
|
10750
10022
|
}
|
|
10751
|
-
this.
|
|
10023
|
+
this.syncSharedStateScopeBindingOnTreeChange();
|
|
10752
10024
|
}
|
|
10753
10025
|
refreshSharedStateBeforeRender() {
|
|
10754
10026
|
var _a;
|
|
@@ -10763,16 +10035,16 @@ class Graphic extends Node {
|
|
|
10763
10035
|
this.recomputeCurrentStatePatch();
|
|
10764
10036
|
this.stopStateAnimates();
|
|
10765
10037
|
this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });
|
|
10766
|
-
this.
|
|
10038
|
+
this.emitStateUpdateEvent();
|
|
10767
10039
|
this.sharedStateDirty = false;
|
|
10768
10040
|
}
|
|
10769
10041
|
getLocalStatesVersion() {
|
|
10770
10042
|
var _a, _b;
|
|
10771
10043
|
if (this.localStateDefinitionsSource !== this.states) {
|
|
10772
10044
|
this.localStateDefinitionsSource = this.states;
|
|
10773
|
-
this.
|
|
10045
|
+
this.localStateDefinitionsVersion = ((_a = this.localStateDefinitionsVersion) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
10774
10046
|
}
|
|
10775
|
-
return (_b = this.
|
|
10047
|
+
return (_b = this.localStateDefinitionsVersion) !== null && _b !== void 0 ? _b : 0;
|
|
10776
10048
|
}
|
|
10777
10049
|
resolveEffectiveCompiledDefinitions() {
|
|
10778
10050
|
this.syncSharedStateScopeBindingFromTree(false);
|
|
@@ -10785,8 +10057,7 @@ class Graphic extends Node {
|
|
|
10785
10057
|
if (!boundScope) {
|
|
10786
10058
|
if (!hasStates) {
|
|
10787
10059
|
return {
|
|
10788
|
-
compiledDefinitions: undefined
|
|
10789
|
-
stateProxyModeKey: 'none'
|
|
10060
|
+
compiledDefinitions: undefined
|
|
10790
10061
|
};
|
|
10791
10062
|
}
|
|
10792
10063
|
const localStatesVersion = this.getLocalStatesVersion();
|
|
@@ -10796,72 +10067,29 @@ class Graphic extends Node {
|
|
|
10796
10067
|
this.compiledStateDefinitionsCacheKey = cacheKey;
|
|
10797
10068
|
}
|
|
10798
10069
|
return {
|
|
10799
|
-
compiledDefinitions: this.compiledStateDefinitions
|
|
10800
|
-
stateProxyModeKey: this.stateProxy ? 'legacy-all' : 'none'
|
|
10070
|
+
compiledDefinitions: this.compiledStateDefinitions
|
|
10801
10071
|
};
|
|
10802
10072
|
}
|
|
10803
10073
|
const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions;
|
|
10804
|
-
const sharedStateProxyModeKey = this.stateProxy ? 'shared-missing-only' : 'none';
|
|
10805
|
-
const sharedStateProxyEligibility = this.stateProxy
|
|
10806
|
-
? (stateName) => !sharedCompiledDefinitions.has(stateName)
|
|
10807
|
-
: undefined;
|
|
10808
|
-
if (!hasStates) {
|
|
10809
|
-
this.localFallbackCompiledDefinitions = undefined;
|
|
10810
|
-
return {
|
|
10811
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
10812
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
10813
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
10814
|
-
};
|
|
10815
|
-
}
|
|
10816
|
-
const localStates = this.states;
|
|
10817
|
-
const missingLocalStateDefinitions = {};
|
|
10818
|
-
const missingStateNames = [];
|
|
10819
|
-
Object.keys(localStates).forEach(stateName => {
|
|
10820
|
-
if (sharedCompiledDefinitions.has(stateName)) {
|
|
10821
|
-
return;
|
|
10822
|
-
}
|
|
10823
|
-
missingLocalStateDefinitions[stateName] = localStates[stateName];
|
|
10824
|
-
missingStateNames.push(stateName);
|
|
10825
|
-
});
|
|
10826
|
-
if (!missingStateNames.length) {
|
|
10827
|
-
this.localFallbackCompiledDefinitions = undefined;
|
|
10828
|
-
return {
|
|
10829
|
-
compiledDefinitions: sharedCompiledDefinitions,
|
|
10830
|
-
stateProxyModeKey: sharedStateProxyModeKey,
|
|
10831
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
10832
|
-
};
|
|
10833
|
-
}
|
|
10834
|
-
const localStatesVersion = this.getLocalStatesVersion();
|
|
10835
|
-
const stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join('|')}` : 'none';
|
|
10836
|
-
const cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
|
|
10837
|
-
if (!this.localFallbackCompiledDefinitions || this.compiledStateDefinitionsCacheKey !== cacheKey) {
|
|
10838
|
-
this.localFallbackCompiledDefinitions = new StateDefinitionCompiler().compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions));
|
|
10839
|
-
this.compiledStateDefinitionsCacheKey = cacheKey;
|
|
10840
|
-
}
|
|
10841
10074
|
return {
|
|
10842
|
-
compiledDefinitions:
|
|
10843
|
-
stateProxyModeKey,
|
|
10844
|
-
stateProxyEligibility: sharedStateProxyEligibility
|
|
10075
|
+
compiledDefinitions: sharedCompiledDefinitions
|
|
10845
10076
|
};
|
|
10846
10077
|
}
|
|
10847
10078
|
recomputeCurrentStatePatch() {
|
|
10848
|
-
var _a, _b
|
|
10079
|
+
var _a, _b;
|
|
10849
10080
|
if (!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
10850
10081
|
this.effectiveStates = [];
|
|
10851
10082
|
this.resolvedStatePatch = undefined;
|
|
10852
10083
|
this.syncSharedStateActiveRegistrations();
|
|
10853
10084
|
return;
|
|
10854
10085
|
}
|
|
10855
|
-
const stateResolveBaseAttrs =
|
|
10856
|
-
const
|
|
10857
|
-
(
|
|
10858
|
-
const
|
|
10859
|
-
const effectiveStates = (_d = transition.effectiveStates) !== null && _d !== void 0 ? _d : transition.states;
|
|
10860
|
-
const resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions
|
|
10861
|
-
? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
10086
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs();
|
|
10087
|
+
const transition = this.resolveUseStatesTransition(this.currentStates, stateResolveBaseAttrs);
|
|
10088
|
+
const effectiveStates = (_b = transition.effectiveStates) !== null && _b !== void 0 ? _b : transition.states;
|
|
10089
|
+
const resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
10862
10090
|
this.currentStates = transition.states;
|
|
10863
10091
|
this.effectiveStates = [...effectiveStates];
|
|
10864
|
-
this.resolvedStatePatch =
|
|
10092
|
+
this.resolvedStatePatch = resolvedStateAttrs;
|
|
10865
10093
|
this.syncSharedStateActiveRegistrations();
|
|
10866
10094
|
}
|
|
10867
10095
|
buildStaticAttributeSnapshot() {
|
|
@@ -10927,7 +10155,7 @@ class Graphic extends Node {
|
|
|
10927
10155
|
return;
|
|
10928
10156
|
}
|
|
10929
10157
|
const nextValue = snapshot[key];
|
|
10930
|
-
if (
|
|
10158
|
+
if (areAttributeValuesEqual(previousValue, nextValue)) {
|
|
10931
10159
|
return;
|
|
10932
10160
|
}
|
|
10933
10161
|
delta.set(key, { prev: previousValue, next: nextValue });
|
|
@@ -10936,9 +10164,13 @@ class Graphic extends Node {
|
|
|
10936
10164
|
return delta;
|
|
10937
10165
|
}
|
|
10938
10166
|
_syncAttribute() {
|
|
10167
|
+
if (this.attribute === this.baseAttributes && this.resolvedStatePatch) {
|
|
10168
|
+
this.detachAttributeFromBaseAttributes();
|
|
10169
|
+
}
|
|
10939
10170
|
const snapshot = this.buildStaticAttributeSnapshot();
|
|
10940
10171
|
const delta = this.syncObjectToSnapshot(this.attribute, snapshot);
|
|
10941
10172
|
this.valid = this.isValid();
|
|
10173
|
+
this.attributeMayContainTransientAttrs = false;
|
|
10942
10174
|
return delta;
|
|
10943
10175
|
}
|
|
10944
10176
|
_syncFinalAttributeFromStaticTruth() {
|
|
@@ -10949,27 +10181,29 @@ class Graphic extends Node {
|
|
|
10949
10181
|
const snapshot = this.buildStaticAttributeSnapshot();
|
|
10950
10182
|
this.syncObjectToSnapshot(target, snapshot);
|
|
10951
10183
|
}
|
|
10952
|
-
|
|
10184
|
+
mergeAttributeDeltaCategory(category, key, prev, next) {
|
|
10953
10185
|
var _a;
|
|
10186
|
+
let nextCategory = key === 'stroke' || key === 'shadowBlur'
|
|
10187
|
+
? classifyAttributeDelta(key, prev, next)
|
|
10188
|
+
: (_a = ATTRIBUTE_CATEGORY[key]) !== null && _a !== void 0 ? _a : UpdateCategory.PAINT;
|
|
10189
|
+
if (nextCategory & UpdateCategory.PICK) {
|
|
10190
|
+
nextCategory |= UpdateCategory.BOUNDS;
|
|
10191
|
+
}
|
|
10192
|
+
if (nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key)) {
|
|
10193
|
+
nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS;
|
|
10194
|
+
}
|
|
10195
|
+
return category | nextCategory;
|
|
10196
|
+
}
|
|
10197
|
+
submitUpdateByCategory(category, forceUpdateTag = false) {
|
|
10954
10198
|
if (forceUpdateTag) {
|
|
10955
10199
|
this.addUpdateShapeAndBoundsTag();
|
|
10956
10200
|
this.addUpdatePositionTag();
|
|
10957
10201
|
this.addUpdateLayoutTag();
|
|
10958
10202
|
return;
|
|
10959
10203
|
}
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
if (nextCategory & UpdateCategory.PICK) {
|
|
10964
|
-
nextCategory |= UpdateCategory.BOUNDS;
|
|
10965
|
-
}
|
|
10966
|
-
if (nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key)) {
|
|
10967
|
-
nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS;
|
|
10968
|
-
}
|
|
10969
|
-
category |= nextCategory;
|
|
10970
|
-
});
|
|
10971
|
-
if (category !== UpdateCategory.NONE) {
|
|
10972
|
-
(_a = getStageStatePerfMonitor(this.stage)) === null || _a === void 0 ? void 0 : _a.recordCategory(category);
|
|
10204
|
+
if ((category & BROAD_UPDATE_CATEGORY) === BROAD_UPDATE_CATEGORY) {
|
|
10205
|
+
this.addBroadUpdateTag();
|
|
10206
|
+
return;
|
|
10973
10207
|
}
|
|
10974
10208
|
if (category & UpdateCategory.SHAPE) {
|
|
10975
10209
|
this.addUpdateShapeAndBoundsTag();
|
|
@@ -10987,45 +10221,237 @@ class Graphic extends Node {
|
|
|
10987
10221
|
this.addUpdateLayoutTag();
|
|
10988
10222
|
}
|
|
10989
10223
|
}
|
|
10224
|
+
submitUpdateByDelta(delta, forceUpdateTag = false) {
|
|
10225
|
+
let category = UpdateCategory.NONE;
|
|
10226
|
+
delta.forEach((entry, key) => {
|
|
10227
|
+
category = this.mergeAttributeDeltaCategory(category, key, entry.prev, entry.next);
|
|
10228
|
+
});
|
|
10229
|
+
this.submitUpdateByCategory(category, forceUpdateTag);
|
|
10230
|
+
}
|
|
10231
|
+
submitTouchedKeyUpdate(keys, forceUpdateTag = false) {
|
|
10232
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTags(keys));
|
|
10233
|
+
}
|
|
10234
|
+
submitTouchedUpdate(needsShapeAndBounds) {
|
|
10235
|
+
if (!this.updateShapeAndBoundsTagSetted() && needsShapeAndBounds) {
|
|
10236
|
+
this.addUpdateShapeAndBoundsTag();
|
|
10237
|
+
}
|
|
10238
|
+
else {
|
|
10239
|
+
this.addUpdateBoundTag();
|
|
10240
|
+
}
|
|
10241
|
+
this.addUpdatePositionTag();
|
|
10242
|
+
this.addUpdateLayoutTag();
|
|
10243
|
+
}
|
|
10990
10244
|
commitBaseAttributeMutation(forceUpdateTag = false, context) {
|
|
10991
|
-
var _a, _b;
|
|
10245
|
+
var _a, _b, _c;
|
|
10992
10246
|
if ((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) {
|
|
10993
|
-
this.resolverEpoch
|
|
10994
|
-
(
|
|
10247
|
+
this.resolverEpoch = ((_b = this.resolverEpoch) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
10248
|
+
(_c = this.stateEngine) === null || _c === void 0 ? void 0 : _c.invalidateResolverCache();
|
|
10995
10249
|
this.recomputeCurrentStatePatch();
|
|
10996
10250
|
}
|
|
10997
10251
|
const delta = this._syncAttribute();
|
|
10998
10252
|
this.submitUpdateByDelta(delta, forceUpdateTag);
|
|
10999
10253
|
this.onAttributeUpdate(context);
|
|
11000
10254
|
}
|
|
10255
|
+
canCommitBaseAttributesByTouchedKeys() {
|
|
10256
|
+
var _a, _b;
|
|
10257
|
+
if (((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) || this.resolvedStatePatch || this.attributeMayContainTransientAttrs) {
|
|
10258
|
+
return false;
|
|
10259
|
+
}
|
|
10260
|
+
if (!((_b = this.animates) === null || _b === void 0 ? void 0 : _b.size) && !this._animationStateManager) {
|
|
10261
|
+
return true;
|
|
10262
|
+
}
|
|
10263
|
+
return !this.hasAnyTrackedAnimate();
|
|
10264
|
+
}
|
|
10265
|
+
detachAttributeFromBaseAttributes() {
|
|
10266
|
+
if (this.attribute === this.baseAttributes) {
|
|
10267
|
+
this._baseAttributes = this.attribute;
|
|
10268
|
+
this.attribute = cloneAttributeSurface(this.attribute);
|
|
10269
|
+
}
|
|
10270
|
+
}
|
|
10271
|
+
commitInternalBaseAttributes(params, context) {
|
|
10272
|
+
if (!params || !Object.keys(params).length) {
|
|
10273
|
+
return;
|
|
10274
|
+
}
|
|
10275
|
+
if (this.canCommitBaseAttributesByTouchedKeys()) {
|
|
10276
|
+
this.commitBaseAttributesByTouchedKeys(params, false, context);
|
|
10277
|
+
return;
|
|
10278
|
+
}
|
|
10279
|
+
this.detachAttributeFromBaseAttributes();
|
|
10280
|
+
this.applyBaseAttributes(params);
|
|
10281
|
+
this.commitBaseAttributeMutation(false, context);
|
|
10282
|
+
}
|
|
10283
|
+
commitBaseAttributesByTouchedKeys(params, forceUpdateTag = false, context) {
|
|
10284
|
+
const source = params;
|
|
10285
|
+
const baseAttributes = this.getBaseAttributesStorage();
|
|
10286
|
+
let hasKeys = false;
|
|
10287
|
+
let needsShapeAndBounds = forceUpdateTag;
|
|
10288
|
+
for (const key in source) {
|
|
10289
|
+
if (!Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10290
|
+
continue;
|
|
10291
|
+
}
|
|
10292
|
+
hasKeys = true;
|
|
10293
|
+
baseAttributes[key] = source[key];
|
|
10294
|
+
if (!needsShapeAndBounds && this.needUpdateTag(key)) {
|
|
10295
|
+
needsShapeAndBounds = true;
|
|
10296
|
+
}
|
|
10297
|
+
}
|
|
10298
|
+
if (!hasKeys) {
|
|
10299
|
+
return;
|
|
10300
|
+
}
|
|
10301
|
+
this.attribute = baseAttributes;
|
|
10302
|
+
this._baseAttributes = undefined;
|
|
10303
|
+
this.valid = this.isValid();
|
|
10304
|
+
this.attributeMayContainTransientAttrs = false;
|
|
10305
|
+
this.submitTouchedUpdate(needsShapeAndBounds);
|
|
10306
|
+
this.onAttributeUpdate(context);
|
|
10307
|
+
}
|
|
10308
|
+
commitBaseAttributeBySingleKey(key, value, forceUpdateTag = false, context) {
|
|
10309
|
+
this.getBaseAttributesStorage()[key] = value;
|
|
10310
|
+
this.attribute = this.getBaseAttributesStorage();
|
|
10311
|
+
this._baseAttributes = undefined;
|
|
10312
|
+
this.valid = this.isValid();
|
|
10313
|
+
this.attributeMayContainTransientAttrs = false;
|
|
10314
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTag(key));
|
|
10315
|
+
this.onAttributeUpdate(context);
|
|
10316
|
+
}
|
|
11001
10317
|
applyBaseAttributes(params) {
|
|
11002
10318
|
const keys = Object.keys(params);
|
|
11003
10319
|
for (let i = 0; i < keys.length; i++) {
|
|
11004
10320
|
const key = keys[i];
|
|
11005
|
-
this.
|
|
10321
|
+
this.getBaseAttributesStorage()[key] = params[key];
|
|
11006
10322
|
}
|
|
11007
10323
|
}
|
|
10324
|
+
applyAnimationTransientAttributes(params, forceUpdateTag = false, context) {
|
|
10325
|
+
const source = params;
|
|
10326
|
+
let target;
|
|
10327
|
+
let needsShapeAndBounds = forceUpdateTag;
|
|
10328
|
+
for (const key in source) {
|
|
10329
|
+
if (!Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10330
|
+
continue;
|
|
10331
|
+
}
|
|
10332
|
+
if (!target) {
|
|
10333
|
+
this.detachAttributeFromBaseAttributes();
|
|
10334
|
+
target = this.attribute;
|
|
10335
|
+
}
|
|
10336
|
+
target[key] = source[key];
|
|
10337
|
+
if (!needsShapeAndBounds && this.needUpdateTag(key)) {
|
|
10338
|
+
needsShapeAndBounds = true;
|
|
10339
|
+
}
|
|
10340
|
+
}
|
|
10341
|
+
if (!target) {
|
|
10342
|
+
return;
|
|
10343
|
+
}
|
|
10344
|
+
this.attributeMayContainTransientAttrs = true;
|
|
10345
|
+
this.valid = this.isValid();
|
|
10346
|
+
this.submitTouchedUpdate(needsShapeAndBounds);
|
|
10347
|
+
this.onAttributeUpdate(context);
|
|
10348
|
+
}
|
|
11008
10349
|
applyTransientAttributes(params, forceUpdateTag = false, context) {
|
|
10350
|
+
this.detachAttributeFromBaseAttributes();
|
|
11009
10351
|
const delta = new Map();
|
|
11010
10352
|
const keys = Object.keys(params);
|
|
11011
10353
|
for (let i = 0; i < keys.length; i++) {
|
|
11012
10354
|
const key = keys[i];
|
|
11013
10355
|
const previousValue = this.attribute[key];
|
|
11014
10356
|
const nextValue = params[key];
|
|
11015
|
-
if (
|
|
10357
|
+
if (areAttributeValuesEqual(previousValue, nextValue)) {
|
|
10358
|
+
continue;
|
|
10359
|
+
}
|
|
10360
|
+
delta.set(key, { prev: previousValue, next: nextValue });
|
|
10361
|
+
this.attribute[key] = nextValue;
|
|
10362
|
+
}
|
|
10363
|
+
if (delta.size) {
|
|
10364
|
+
this.attributeMayContainTransientAttrs = true;
|
|
10365
|
+
}
|
|
10366
|
+
this.valid = this.isValid();
|
|
10367
|
+
this.submitUpdateByDelta(delta, forceUpdateTag);
|
|
10368
|
+
this.onAttributeUpdate(context);
|
|
10369
|
+
}
|
|
10370
|
+
_restoreAttributeFromStaticTruth(context) {
|
|
10371
|
+
this._syncFinalAttributeFromStaticTruth();
|
|
10372
|
+
const delta = this._syncAttribute();
|
|
10373
|
+
this.submitUpdateByDelta(delta);
|
|
10374
|
+
this.onAttributeUpdate(context);
|
|
10375
|
+
}
|
|
10376
|
+
collectStatePatchDeltaKeys(previousPatch, nextPatch) {
|
|
10377
|
+
const keys = previousPatch ? Object.keys(previousPatch) : [];
|
|
10378
|
+
if (!nextPatch) {
|
|
10379
|
+
return keys;
|
|
10380
|
+
}
|
|
10381
|
+
for (const key in nextPatch) {
|
|
10382
|
+
if (Object.prototype.hasOwnProperty.call(nextPatch, key) &&
|
|
10383
|
+
!Object.prototype.hasOwnProperty.call(previousPatch !== null && previousPatch !== void 0 ? previousPatch : {}, key)) {
|
|
10384
|
+
keys.push(key);
|
|
10385
|
+
}
|
|
10386
|
+
}
|
|
10387
|
+
return keys;
|
|
10388
|
+
}
|
|
10389
|
+
getStaticTruthValueForStateKey(key, nextPatch) {
|
|
10390
|
+
var _a;
|
|
10391
|
+
const baseAttributes = ((_a = this.baseAttributes) !== null && _a !== void 0 ? _a : {});
|
|
10392
|
+
const patch = nextPatch;
|
|
10393
|
+
if (patch && Object.prototype.hasOwnProperty.call(patch, key)) {
|
|
10394
|
+
const patchValue = patch[key];
|
|
10395
|
+
const baseValue = baseAttributes[key];
|
|
10396
|
+
if (this.stateMergeMode === 'deep' && isPlainObjectValue(baseValue) && isPlainObjectValue(patchValue)) {
|
|
10397
|
+
return {
|
|
10398
|
+
hasValue: true,
|
|
10399
|
+
value: deepMergeAttributeValue(baseValue, patchValue)
|
|
10400
|
+
};
|
|
10401
|
+
}
|
|
10402
|
+
return {
|
|
10403
|
+
hasValue: true,
|
|
10404
|
+
value: patchValue
|
|
10405
|
+
};
|
|
10406
|
+
}
|
|
10407
|
+
if (Object.prototype.hasOwnProperty.call(baseAttributes, key)) {
|
|
10408
|
+
return {
|
|
10409
|
+
hasValue: true,
|
|
10410
|
+
value: baseAttributes[key]
|
|
10411
|
+
};
|
|
10412
|
+
}
|
|
10413
|
+
return {
|
|
10414
|
+
hasValue: false,
|
|
10415
|
+
value: undefined
|
|
10416
|
+
};
|
|
10417
|
+
}
|
|
10418
|
+
syncStatePatchDeltaToTarget(target, keys, nextPatch, collectCategory = false) {
|
|
10419
|
+
let category = UpdateCategory.NONE;
|
|
10420
|
+
for (let i = 0; i < keys.length; i++) {
|
|
10421
|
+
const key = keys[i];
|
|
10422
|
+
const previousValue = target[key];
|
|
10423
|
+
const next = this.getStaticTruthValueForStateKey(key, nextPatch);
|
|
10424
|
+
if (!next.hasValue) {
|
|
10425
|
+
if (Object.prototype.hasOwnProperty.call(target, key)) {
|
|
10426
|
+
delete target[key];
|
|
10427
|
+
if (collectCategory) {
|
|
10428
|
+
category = this.mergeAttributeDeltaCategory(category, key, previousValue, undefined);
|
|
10429
|
+
}
|
|
10430
|
+
}
|
|
10431
|
+
continue;
|
|
10432
|
+
}
|
|
10433
|
+
if (areAttributeValuesEqual(previousValue, next.value)) {
|
|
11016
10434
|
continue;
|
|
11017
10435
|
}
|
|
11018
|
-
|
|
11019
|
-
|
|
10436
|
+
const nextValue = cloneAttributeValue(next.value);
|
|
10437
|
+
target[key] = nextValue;
|
|
10438
|
+
if (collectCategory) {
|
|
10439
|
+
category = this.mergeAttributeDeltaCategory(category, key, previousValue, nextValue);
|
|
10440
|
+
}
|
|
11020
10441
|
}
|
|
11021
|
-
|
|
11022
|
-
this.submitUpdateByDelta(delta, forceUpdateTag);
|
|
11023
|
-
this.onAttributeUpdate(context);
|
|
10442
|
+
return category;
|
|
11024
10443
|
}
|
|
11025
|
-
|
|
11026
|
-
this.
|
|
11027
|
-
const
|
|
11028
|
-
this.
|
|
10444
|
+
restoreAttributeFromStatePatchDelta(previousPatch, nextPatch, context) {
|
|
10445
|
+
this.detachAttributeFromBaseAttributes();
|
|
10446
|
+
const keys = this.collectStatePatchDeltaKeys(previousPatch, nextPatch);
|
|
10447
|
+
const finalAttribute = this.finalAttribute;
|
|
10448
|
+
if (finalAttribute) {
|
|
10449
|
+
this.syncStatePatchDeltaToTarget(finalAttribute, keys, nextPatch, false);
|
|
10450
|
+
}
|
|
10451
|
+
const category = this.syncStatePatchDeltaToTarget(this.attribute, keys, nextPatch, true);
|
|
10452
|
+
this.valid = this.isValid();
|
|
10453
|
+
this.attributeMayContainTransientAttrs = false;
|
|
10454
|
+
this.submitUpdateByCategory(category);
|
|
11029
10455
|
this.onAttributeUpdate(context);
|
|
11030
10456
|
}
|
|
11031
10457
|
setMode(mode) {
|
|
@@ -11052,6 +10478,7 @@ class Graphic extends Node {
|
|
|
11052
10478
|
return point;
|
|
11053
10479
|
}
|
|
11054
10480
|
onAnimateBind(animate) {
|
|
10481
|
+
this.detachAttributeFromBaseAttributes();
|
|
11055
10482
|
this._emitCustomEvent('animate-bind', animate);
|
|
11056
10483
|
}
|
|
11057
10484
|
visitTrackedAnimates(cb) {
|
|
@@ -11074,8 +10501,33 @@ class Graphic extends Node {
|
|
|
11074
10501
|
}
|
|
11075
10502
|
return !!((_a = this.animates) === null || _a === void 0 ? void 0 : _a.size);
|
|
11076
10503
|
}
|
|
10504
|
+
mayHaveTrackedAnimates() {
|
|
10505
|
+
var _a;
|
|
10506
|
+
return !!((_a = this.animates) === null || _a === void 0 ? void 0 : _a.size) || !!this._animationStateManager;
|
|
10507
|
+
}
|
|
11077
10508
|
tryUpdateAABBBounds() {
|
|
10509
|
+
if (!this.shadowRoot && !(this._updateTag & UpdateTag.UPDATE_BOUNDS)) {
|
|
10510
|
+
return this._AABBBounds;
|
|
10511
|
+
}
|
|
11078
10512
|
const full = this.attribute.boundsMode === 'imprecise';
|
|
10513
|
+
if (!this.shadowRoot) {
|
|
10514
|
+
const graphicService = this.getGraphicService();
|
|
10515
|
+
const graphicTheme = this.getGraphicTheme();
|
|
10516
|
+
if (!graphicService.validCheck(this.attribute, graphicTheme, this._AABBBounds, this)) {
|
|
10517
|
+
return this._AABBBounds;
|
|
10518
|
+
}
|
|
10519
|
+
if (!this.valid) {
|
|
10520
|
+
this._AABBBounds.clear();
|
|
10521
|
+
return this._AABBBounds;
|
|
10522
|
+
}
|
|
10523
|
+
graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);
|
|
10524
|
+
const bounds = this.doUpdateAABBBounds(full, graphicTheme);
|
|
10525
|
+
graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);
|
|
10526
|
+
if (this.attribute.boundsMode === 'empty') {
|
|
10527
|
+
bounds.clear();
|
|
10528
|
+
}
|
|
10529
|
+
return bounds;
|
|
10530
|
+
}
|
|
11079
10531
|
if (!this.shouldUpdateAABBBounds()) {
|
|
11080
10532
|
return this._AABBBounds;
|
|
11081
10533
|
}
|
|
@@ -11192,13 +10644,13 @@ class Graphic extends Node {
|
|
|
11192
10644
|
Graphic.userSymbolMap[symbolType] = _parsedPath;
|
|
11193
10645
|
return _parsedPath;
|
|
11194
10646
|
}
|
|
11195
|
-
doUpdateAABBBounds(full) {
|
|
10647
|
+
doUpdateAABBBounds(full, graphicTheme) {
|
|
11196
10648
|
this.updateAABBBoundsStamp++;
|
|
11197
|
-
const
|
|
10649
|
+
const resolvedGraphicTheme = graphicTheme !== null && graphicTheme !== void 0 ? graphicTheme : this.getGraphicTheme();
|
|
11198
10650
|
this._AABBBounds.clear();
|
|
11199
10651
|
const attribute = this.attribute;
|
|
11200
|
-
const bounds = this.updateAABBBounds(attribute,
|
|
11201
|
-
const { boundsPadding =
|
|
10652
|
+
const bounds = this.updateAABBBounds(attribute, resolvedGraphicTheme, this._AABBBounds, full);
|
|
10653
|
+
const { boundsPadding = resolvedGraphicTheme.boundsPadding } = attribute;
|
|
11202
10654
|
const paddingArray = parsePadding(boundsPadding);
|
|
11203
10655
|
if (paddingArray) {
|
|
11204
10656
|
bounds.expand(paddingArray);
|
|
@@ -11309,16 +10761,117 @@ class Graphic extends Node {
|
|
|
11309
10761
|
this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
11310
10762
|
}
|
|
11311
10763
|
setAttributesAndPreventAnimate(params, forceUpdateTag = false, context, ignorePriority) {
|
|
10764
|
+
if (!params) {
|
|
10765
|
+
return;
|
|
10766
|
+
}
|
|
10767
|
+
const keys = Object.keys(params);
|
|
10768
|
+
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context);
|
|
10769
|
+
this.syncFinalAttributesFromUpdateContext(context);
|
|
11312
10770
|
this.visitTrackedAnimates(animate => {
|
|
11313
10771
|
if (animate.priority === Infinity && !ignorePriority) {
|
|
11314
10772
|
return;
|
|
11315
10773
|
}
|
|
11316
|
-
|
|
11317
|
-
animate.preventAttr(key);
|
|
11318
|
-
});
|
|
10774
|
+
animate.preventAttrs(keys);
|
|
11319
10775
|
});
|
|
11320
10776
|
this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
11321
10777
|
}
|
|
10778
|
+
syncFinalAttributesFromUpdateContext(context) {
|
|
10779
|
+
var _a;
|
|
10780
|
+
const updateType = context === null || context === void 0 ? void 0 : context.type;
|
|
10781
|
+
if (updateType === AttributeUpdateType.STATE ||
|
|
10782
|
+
(updateType != null &&
|
|
10783
|
+
updateType >= AttributeUpdateType.ANIMATE_BIND &&
|
|
10784
|
+
updateType <= AttributeUpdateType.ANIMATE_END)) {
|
|
10785
|
+
return;
|
|
10786
|
+
}
|
|
10787
|
+
const finalAttrs = (_a = this.context) === null || _a === void 0 ? void 0 : _a.finalAttrs;
|
|
10788
|
+
const setFinalAttributes = this.setFinalAttributes;
|
|
10789
|
+
if (finalAttrs && typeof setFinalAttributes === 'function') {
|
|
10790
|
+
setFinalAttributes.call(this, finalAttrs);
|
|
10791
|
+
}
|
|
10792
|
+
}
|
|
10793
|
+
captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
|
|
10794
|
+
var _a, _b;
|
|
10795
|
+
const graphicContext = this.context;
|
|
10796
|
+
const diffAttrs = (_a = graphicContext === null || graphicContext === void 0 ? void 0 : graphicContext.diffAttrs) !== null && _a !== void 0 ? _a : params;
|
|
10797
|
+
const updateType = context === null || context === void 0 ? void 0 : context.type;
|
|
10798
|
+
if (!keys.length ||
|
|
10799
|
+
!diffAttrs ||
|
|
10800
|
+
updateType === AttributeUpdateType.STATE ||
|
|
10801
|
+
(updateType != null &&
|
|
10802
|
+
updateType >= AttributeUpdateType.ANIMATE_BIND &&
|
|
10803
|
+
updateType <= AttributeUpdateType.ANIMATE_END)) {
|
|
10804
|
+
return;
|
|
10805
|
+
}
|
|
10806
|
+
const sameDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs;
|
|
10807
|
+
let fromAttrs = sameDiffAttrs
|
|
10808
|
+
? (_b = this.transientFromAttrsBeforePreventAnimate) !== null && _b !== void 0 ? _b : null
|
|
10809
|
+
: null;
|
|
10810
|
+
if (!sameDiffAttrs) {
|
|
10811
|
+
this.transientFromAttrsBeforePreventAnimate = null;
|
|
10812
|
+
this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
|
|
10813
|
+
}
|
|
10814
|
+
let captured = false;
|
|
10815
|
+
for (let i = 0; i < keys.length; i++) {
|
|
10816
|
+
const key = keys[i];
|
|
10817
|
+
if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) {
|
|
10818
|
+
continue;
|
|
10819
|
+
}
|
|
10820
|
+
const previousValue = this.attribute[key];
|
|
10821
|
+
const nextValue = params[key];
|
|
10822
|
+
if (isEqual(previousValue, nextValue)) {
|
|
10823
|
+
continue;
|
|
10824
|
+
}
|
|
10825
|
+
fromAttrs !== null && fromAttrs !== void 0 ? fromAttrs : (fromAttrs = {});
|
|
10826
|
+
fromAttrs[key] = cloneAttributeValue(previousValue);
|
|
10827
|
+
captured = true;
|
|
10828
|
+
}
|
|
10829
|
+
if (captured) {
|
|
10830
|
+
this.transientFromAttrsBeforePreventAnimate = fromAttrs;
|
|
10831
|
+
this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs;
|
|
10832
|
+
}
|
|
10833
|
+
}
|
|
10834
|
+
consumeTransientFromAttrsBeforePreventAnimate(diffAttrs) {
|
|
10835
|
+
const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate;
|
|
10836
|
+
const sourceDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs;
|
|
10837
|
+
if (!transientFromAttrs || !sourceDiffAttrs) {
|
|
10838
|
+
return null;
|
|
10839
|
+
}
|
|
10840
|
+
for (const key in diffAttrs) {
|
|
10841
|
+
if (Object.prototype.hasOwnProperty.call(diffAttrs, key) &&
|
|
10842
|
+
(!Object.prototype.hasOwnProperty.call(sourceDiffAttrs, key) || !isEqual(sourceDiffAttrs[key], diffAttrs[key]))) {
|
|
10843
|
+
return null;
|
|
10844
|
+
}
|
|
10845
|
+
}
|
|
10846
|
+
let fromAttrs = null;
|
|
10847
|
+
let remaining = false;
|
|
10848
|
+
for (const key in transientFromAttrs) {
|
|
10849
|
+
if (!Object.prototype.hasOwnProperty.call(transientFromAttrs, key)) {
|
|
10850
|
+
continue;
|
|
10851
|
+
}
|
|
10852
|
+
if (Object.prototype.hasOwnProperty.call(diffAttrs, key)) {
|
|
10853
|
+
fromAttrs !== null && fromAttrs !== void 0 ? fromAttrs : (fromAttrs = {});
|
|
10854
|
+
fromAttrs[key] = transientFromAttrs[key];
|
|
10855
|
+
continue;
|
|
10856
|
+
}
|
|
10857
|
+
remaining = true;
|
|
10858
|
+
}
|
|
10859
|
+
if (remaining) {
|
|
10860
|
+
const nextTransientFromAttrs = {};
|
|
10861
|
+
for (const key in transientFromAttrs) {
|
|
10862
|
+
if (Object.prototype.hasOwnProperty.call(transientFromAttrs, key) &&
|
|
10863
|
+
!Object.prototype.hasOwnProperty.call(diffAttrs, key)) {
|
|
10864
|
+
nextTransientFromAttrs[key] = transientFromAttrs[key];
|
|
10865
|
+
}
|
|
10866
|
+
}
|
|
10867
|
+
this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;
|
|
10868
|
+
}
|
|
10869
|
+
else {
|
|
10870
|
+
this.transientFromAttrsBeforePreventAnimate = null;
|
|
10871
|
+
this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;
|
|
10872
|
+
}
|
|
10873
|
+
return fromAttrs;
|
|
10874
|
+
}
|
|
11322
10875
|
setAttributes(params, forceUpdateTag = false, context) {
|
|
11323
10876
|
if (!params) {
|
|
11324
10877
|
return;
|
|
@@ -11328,7 +10881,7 @@ class Graphic extends Node {
|
|
|
11328
10881
|
if (params.background) {
|
|
11329
10882
|
this.loadImage(params.background, true);
|
|
11330
10883
|
}
|
|
11331
|
-
if (isExternalTexture(params.texture)) {
|
|
10884
|
+
if (params.texture && isExternalTexture(params.texture)) {
|
|
11332
10885
|
this.loadImage(params.texture, false);
|
|
11333
10886
|
}
|
|
11334
10887
|
if (params.shadowGraphic) {
|
|
@@ -11337,14 +10890,25 @@ class Graphic extends Node {
|
|
|
11337
10890
|
this._setAttributes(params, forceUpdateTag, context);
|
|
11338
10891
|
}
|
|
11339
10892
|
_setAttributes(params, forceUpdateTag = false, context) {
|
|
10893
|
+
if (this.canCommitBaseAttributesByTouchedKeys()) {
|
|
10894
|
+
this.commitBaseAttributesByTouchedKeys(params, forceUpdateTag, context);
|
|
10895
|
+
return;
|
|
10896
|
+
}
|
|
10897
|
+
this.detachAttributeFromBaseAttributes();
|
|
11340
10898
|
this.applyBaseAttributes(params);
|
|
11341
10899
|
this.commitBaseAttributeMutation(forceUpdateTag, context);
|
|
11342
10900
|
}
|
|
11343
10901
|
setAttribute(key, value, forceUpdateTag, context) {
|
|
11344
10902
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);
|
|
11345
10903
|
if (!params) {
|
|
11346
|
-
this.
|
|
11347
|
-
|
|
10904
|
+
if (this.canCommitBaseAttributesByTouchedKeys()) {
|
|
10905
|
+
this.commitBaseAttributeBySingleKey(key, value, !!forceUpdateTag, context);
|
|
10906
|
+
}
|
|
10907
|
+
else {
|
|
10908
|
+
const nextAttrs = { [key]: value };
|
|
10909
|
+
this.applyBaseAttributes(nextAttrs);
|
|
10910
|
+
this.commitBaseAttributeMutation(!!forceUpdateTag, context);
|
|
10911
|
+
}
|
|
11348
10912
|
}
|
|
11349
10913
|
else {
|
|
11350
10914
|
this._setAttributes(params, forceUpdateTag, context);
|
|
@@ -11381,16 +10945,15 @@ class Graphic extends Node {
|
|
|
11381
10945
|
const context = { type: AttributeUpdateType.INIT };
|
|
11382
10946
|
params =
|
|
11383
10947
|
(this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;
|
|
11384
|
-
this.
|
|
11385
|
-
|
|
11386
|
-
this.attribute = {};
|
|
11387
|
-
}
|
|
10948
|
+
this.attribute = params;
|
|
10949
|
+
this._baseAttributes = undefined;
|
|
11388
10950
|
this.resolvedStatePatch = undefined;
|
|
11389
|
-
this.
|
|
10951
|
+
this.attributeMayContainTransientAttrs = false;
|
|
10952
|
+
this.valid = this.isValid();
|
|
11390
10953
|
if (params.background) {
|
|
11391
10954
|
this.loadImage(params.background, true);
|
|
11392
10955
|
}
|
|
11393
|
-
if (isExternalTexture(params.texture)) {
|
|
10956
|
+
if (params.texture && isExternalTexture(params.texture)) {
|
|
11394
10957
|
this.loadImage(params.texture, false);
|
|
11395
10958
|
}
|
|
11396
10959
|
if (params.shadowGraphic) {
|
|
@@ -11415,18 +10978,20 @@ class Graphic extends Node {
|
|
|
11415
10978
|
y = params.y;
|
|
11416
10979
|
delete params.x;
|
|
11417
10980
|
delete params.y;
|
|
11418
|
-
this.applyBaseAttributes(params);
|
|
11419
10981
|
}
|
|
11420
10982
|
const attribute = this.baseAttributes;
|
|
11421
10983
|
const postMatrix = attribute.postMatrix;
|
|
10984
|
+
const nextAttrs = (params || {});
|
|
11422
10985
|
if (!postMatrix) {
|
|
11423
|
-
|
|
11424
|
-
|
|
10986
|
+
nextAttrs.x = ((_a = attribute.x) !== null && _a !== void 0 ? _a : DefaultTransform.x) + x;
|
|
10987
|
+
nextAttrs.y = ((_b = attribute.y) !== null && _b !== void 0 ? _b : DefaultTransform.y) + y;
|
|
11425
10988
|
}
|
|
11426
10989
|
else {
|
|
11427
|
-
|
|
10990
|
+
const nextPostMatrix = postMatrix.clone();
|
|
10991
|
+
application.transformUtil.fromMatrix(nextPostMatrix, nextPostMatrix).translate(x, y);
|
|
10992
|
+
nextAttrs.postMatrix = nextPostMatrix;
|
|
11428
10993
|
}
|
|
11429
|
-
this.
|
|
10994
|
+
this.commitInternalBaseAttributes(nextAttrs, context);
|
|
11430
10995
|
return this;
|
|
11431
10996
|
}
|
|
11432
10997
|
translateTo(x, y) {
|
|
@@ -11440,13 +11005,10 @@ class Graphic extends Node {
|
|
|
11440
11005
|
const params = this.onBeforeAttributeUpdate &&
|
|
11441
11006
|
this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);
|
|
11442
11007
|
if (params) {
|
|
11443
|
-
this.
|
|
11444
|
-
this.commitBaseAttributeMutation(false, context);
|
|
11008
|
+
this.commitInternalBaseAttributes(params, context);
|
|
11445
11009
|
return this;
|
|
11446
11010
|
}
|
|
11447
|
-
|
|
11448
|
-
attribute.y = y;
|
|
11449
|
-
this.commitBaseAttributeMutation(false, context);
|
|
11011
|
+
this.commitInternalBaseAttributes({ x, y }, context);
|
|
11450
11012
|
return this;
|
|
11451
11013
|
}
|
|
11452
11014
|
scale(scaleX, scaleY, scaleCenter) {
|
|
@@ -11464,22 +11026,25 @@ class Graphic extends Node {
|
|
|
11464
11026
|
scaleY = params.scaleY;
|
|
11465
11027
|
delete params.scaleX;
|
|
11466
11028
|
delete params.scaleY;
|
|
11467
|
-
this.applyBaseAttributes(params);
|
|
11468
11029
|
}
|
|
11469
11030
|
const attribute = this.baseAttributes;
|
|
11031
|
+
const nextAttrs = (params || {});
|
|
11470
11032
|
if (!scaleCenter) {
|
|
11471
|
-
|
|
11472
|
-
|
|
11033
|
+
nextAttrs.scaleX = ((_a = attribute.scaleX) !== null && _a !== void 0 ? _a : DefaultTransform.scaleX) * scaleX;
|
|
11034
|
+
nextAttrs.scaleY = ((_b = attribute.scaleY) !== null && _b !== void 0 ? _b : DefaultTransform.scaleY) * scaleY;
|
|
11473
11035
|
}
|
|
11474
11036
|
else {
|
|
11475
|
-
let { postMatrix } = this.
|
|
11037
|
+
let { postMatrix } = this.baseAttributes;
|
|
11476
11038
|
if (!postMatrix) {
|
|
11477
11039
|
postMatrix = new Matrix();
|
|
11478
|
-
|
|
11040
|
+
}
|
|
11041
|
+
else {
|
|
11042
|
+
postMatrix = postMatrix.clone();
|
|
11479
11043
|
}
|
|
11480
11044
|
application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
|
|
11045
|
+
nextAttrs.postMatrix = postMatrix;
|
|
11481
11046
|
}
|
|
11482
|
-
this.
|
|
11047
|
+
this.commitInternalBaseAttributes(nextAttrs, context);
|
|
11483
11048
|
return this;
|
|
11484
11049
|
}
|
|
11485
11050
|
scaleTo(scaleX, scaleY) {
|
|
@@ -11493,13 +11058,10 @@ class Graphic extends Node {
|
|
|
11493
11058
|
const params = this.onBeforeAttributeUpdate &&
|
|
11494
11059
|
this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);
|
|
11495
11060
|
if (params) {
|
|
11496
|
-
this.
|
|
11497
|
-
this.commitBaseAttributeMutation(false, context);
|
|
11061
|
+
this.commitInternalBaseAttributes(params, context);
|
|
11498
11062
|
return this;
|
|
11499
11063
|
}
|
|
11500
|
-
|
|
11501
|
-
attribute.scaleY = scaleY;
|
|
11502
|
-
this.commitBaseAttributeMutation(false, context);
|
|
11064
|
+
this.commitInternalBaseAttributes({ scaleX, scaleY }, context);
|
|
11503
11065
|
return this;
|
|
11504
11066
|
}
|
|
11505
11067
|
rotate(angle, rotateCenter) {
|
|
@@ -11512,21 +11074,24 @@ class Graphic extends Node {
|
|
|
11512
11074
|
this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);
|
|
11513
11075
|
if (params) {
|
|
11514
11076
|
delete params.angle;
|
|
11515
|
-
this.applyBaseAttributes(params);
|
|
11516
11077
|
}
|
|
11517
11078
|
const attribute = this.baseAttributes;
|
|
11079
|
+
const nextAttrs = (params || {});
|
|
11518
11080
|
if (!rotateCenter) {
|
|
11519
|
-
|
|
11081
|
+
nextAttrs.angle = ((_a = attribute.angle) !== null && _a !== void 0 ? _a : DefaultTransform.angle) + angle;
|
|
11520
11082
|
}
|
|
11521
11083
|
else {
|
|
11522
11084
|
let { postMatrix } = this.baseAttributes;
|
|
11523
11085
|
if (!postMatrix) {
|
|
11524
11086
|
postMatrix = new Matrix();
|
|
11525
|
-
|
|
11087
|
+
}
|
|
11088
|
+
else {
|
|
11089
|
+
postMatrix = postMatrix.clone();
|
|
11526
11090
|
}
|
|
11527
11091
|
application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);
|
|
11092
|
+
nextAttrs.postMatrix = postMatrix;
|
|
11528
11093
|
}
|
|
11529
|
-
this.
|
|
11094
|
+
this.commitInternalBaseAttributes(nextAttrs, context);
|
|
11530
11095
|
return this;
|
|
11531
11096
|
}
|
|
11532
11097
|
rotateTo(angle) {
|
|
@@ -11540,12 +11105,10 @@ class Graphic extends Node {
|
|
|
11540
11105
|
const params = this.onBeforeAttributeUpdate &&
|
|
11541
11106
|
this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
|
|
11542
11107
|
if (params) {
|
|
11543
|
-
this.
|
|
11544
|
-
this.commitBaseAttributeMutation(false, context);
|
|
11108
|
+
this.commitInternalBaseAttributes(params, context);
|
|
11545
11109
|
return this;
|
|
11546
11110
|
}
|
|
11547
|
-
|
|
11548
|
-
this.commitBaseAttributeMutation(false, context);
|
|
11111
|
+
this.commitInternalBaseAttributes({ angle }, context);
|
|
11549
11112
|
return this;
|
|
11550
11113
|
}
|
|
11551
11114
|
skewTo(b, c) {
|
|
@@ -11581,41 +11144,216 @@ class Graphic extends Node {
|
|
|
11581
11144
|
var _a;
|
|
11582
11145
|
return (_a = this.states) === null || _a === void 0 ? void 0 : _a[stateName];
|
|
11583
11146
|
}
|
|
11584
|
-
|
|
11585
|
-
|
|
11147
|
+
getStateResolveBaseAttrs() {
|
|
11148
|
+
var _a;
|
|
11149
|
+
return ((_a = this.baseAttributes) !== null && _a !== void 0 ? _a : this.attribute);
|
|
11150
|
+
}
|
|
11151
|
+
syncStateResolveContext(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
11152
|
+
var _a;
|
|
11153
|
+
(_a = this.stateEngine) === null || _a === void 0 ? void 0 : _a.setResolveContext(this, stateResolveBaseAttrs);
|
|
11154
|
+
return stateResolveBaseAttrs;
|
|
11155
|
+
}
|
|
11156
|
+
ensureStateEngine(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
11157
|
+
const { compiledDefinitions } = this.resolveEffectiveCompiledDefinitions();
|
|
11586
11158
|
this.compiledStateDefinitions = compiledDefinitions;
|
|
11587
11159
|
if (!compiledDefinitions) {
|
|
11588
11160
|
this.stateEngine = undefined;
|
|
11589
11161
|
this.stateEngineCompiledDefinitions = undefined;
|
|
11590
|
-
this.stateEngineStateProxyModeKey = undefined;
|
|
11591
11162
|
}
|
|
11592
11163
|
else if (!this.stateEngine ||
|
|
11593
11164
|
this.stateEngineCompiledDefinitions !== compiledDefinitions ||
|
|
11594
|
-
this.stateEngineStateProxy !== this.stateProxy ||
|
|
11595
11165
|
this.stateEngineStateSort !== this.stateSort ||
|
|
11596
|
-
this.stateEngineMergeMode !== this.stateMergeMode
|
|
11597
|
-
this.stateEngineStateProxyModeKey !== stateProxyModeKey) {
|
|
11166
|
+
this.stateEngineMergeMode !== this.stateMergeMode) {
|
|
11598
11167
|
this.stateEngine = new StateEngine({
|
|
11599
11168
|
compiledDefinitions,
|
|
11600
11169
|
stateSort: this.stateSort,
|
|
11601
|
-
stateProxy: this.stateProxy,
|
|
11602
|
-
stateProxyEligibility,
|
|
11603
|
-
states: this.states,
|
|
11604
11170
|
mergeMode: this.stateMergeMode
|
|
11605
11171
|
});
|
|
11606
11172
|
this.stateEngineCompiledDefinitions = compiledDefinitions;
|
|
11607
|
-
this.stateEngineStateProxy = this.stateProxy;
|
|
11608
11173
|
this.stateEngineStateSort = this.stateSort;
|
|
11609
11174
|
this.stateEngineMergeMode = this.stateMergeMode;
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11175
|
+
}
|
|
11176
|
+
this.syncStateResolveContext(stateResolveBaseAttrs);
|
|
11177
|
+
if (this.stateEngine &&
|
|
11178
|
+
this.currentStates &&
|
|
11179
|
+
!this.sameStateNames(this.stateEngine.activeStates, this.currentStates)) {
|
|
11180
|
+
this.stateEngine.applyStates(this.currentStates);
|
|
11181
|
+
}
|
|
11182
|
+
return this.stateEngine;
|
|
11183
|
+
}
|
|
11184
|
+
toGraphicStateTransition(result) {
|
|
11185
|
+
return {
|
|
11186
|
+
changed: result.changed,
|
|
11187
|
+
states: [...result.activeStates],
|
|
11188
|
+
effectiveStates: [...result.effectiveStates]
|
|
11189
|
+
};
|
|
11190
|
+
}
|
|
11191
|
+
sortLocalStates(states) {
|
|
11192
|
+
return this.stateSort ? [...states].sort(this.stateSort) : [...states];
|
|
11193
|
+
}
|
|
11194
|
+
resolveLocalUseStatesTransition(states) {
|
|
11195
|
+
var _a;
|
|
11196
|
+
if (!states.length) {
|
|
11197
|
+
return this.resolveLocalClearStatesTransition();
|
|
11198
|
+
}
|
|
11199
|
+
const previousStates = (_a = this.currentStates) !== null && _a !== void 0 ? _a : EMPTY_STATE_NAMES;
|
|
11200
|
+
const changed = previousStates.length !== states.length || states.some((stateName, index) => previousStates[index] !== stateName);
|
|
11201
|
+
const nextStates = this.sortLocalStates(states);
|
|
11202
|
+
return {
|
|
11203
|
+
changed,
|
|
11204
|
+
states: changed ? nextStates : [...previousStates]
|
|
11205
|
+
};
|
|
11206
|
+
}
|
|
11207
|
+
resolveLocalClearStatesTransition() {
|
|
11208
|
+
return {
|
|
11209
|
+
changed: this.hasState(),
|
|
11210
|
+
states: []
|
|
11211
|
+
};
|
|
11212
|
+
}
|
|
11213
|
+
resolveUseStatesTransition(states, stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
11214
|
+
const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
11215
|
+
return stateEngine
|
|
11216
|
+
? this.toGraphicStateTransition(stateEngine.applyStates(states))
|
|
11217
|
+
: this.resolveLocalUseStatesTransition(states);
|
|
11218
|
+
}
|
|
11219
|
+
resolveClearStatesTransition() {
|
|
11220
|
+
const stateEngine = this.ensureStateEngine();
|
|
11221
|
+
return stateEngine
|
|
11222
|
+
? this.toGraphicStateTransition(stateEngine.clearStates())
|
|
11223
|
+
: this.resolveLocalClearStatesTransition();
|
|
11224
|
+
}
|
|
11225
|
+
resolveAddStateTransition(stateName, keepCurrentStates) {
|
|
11226
|
+
var _a;
|
|
11227
|
+
const stateEngine = this.ensureStateEngine();
|
|
11228
|
+
if (stateEngine) {
|
|
11229
|
+
return this.toGraphicStateTransition(stateEngine.addState(stateName, keepCurrentStates));
|
|
11230
|
+
}
|
|
11231
|
+
if (this.currentStates &&
|
|
11232
|
+
this.currentStates.includes(stateName) &&
|
|
11233
|
+
(keepCurrentStates || this.currentStates.length === 1)) {
|
|
11234
|
+
return {
|
|
11235
|
+
changed: false,
|
|
11236
|
+
states: [...this.currentStates]
|
|
11237
|
+
};
|
|
11238
|
+
}
|
|
11239
|
+
const nextStates = keepCurrentStates && ((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) ? this.currentStates.concat([stateName]) : [stateName];
|
|
11240
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
11241
|
+
}
|
|
11242
|
+
resolveRemoveStateTransition(stateName) {
|
|
11243
|
+
const stateEngine = this.ensureStateEngine();
|
|
11244
|
+
if (stateEngine) {
|
|
11245
|
+
return this.toGraphicStateTransition(stateEngine.removeState(stateName));
|
|
11246
|
+
}
|
|
11247
|
+
if (!this.currentStates) {
|
|
11248
|
+
return {
|
|
11249
|
+
changed: false,
|
|
11250
|
+
states: []
|
|
11251
|
+
};
|
|
11252
|
+
}
|
|
11253
|
+
const filter = Array.isArray(stateName) ? (s) => !stateName.includes(s) : (s) => s !== stateName;
|
|
11254
|
+
const nextStates = this.currentStates.filter(filter);
|
|
11255
|
+
if (nextStates.length === this.currentStates.length) {
|
|
11256
|
+
return {
|
|
11257
|
+
changed: false,
|
|
11258
|
+
states: [...this.currentStates]
|
|
11259
|
+
};
|
|
11260
|
+
}
|
|
11261
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
11262
|
+
}
|
|
11263
|
+
resolveToggleStateTransition(stateName) {
|
|
11264
|
+
const stateEngine = this.ensureStateEngine();
|
|
11265
|
+
if (stateEngine) {
|
|
11266
|
+
return this.toGraphicStateTransition(stateEngine.toggleState(stateName));
|
|
11267
|
+
}
|
|
11268
|
+
if (this.hasState(stateName)) {
|
|
11269
|
+
return this.resolveRemoveStateTransition(stateName);
|
|
11270
|
+
}
|
|
11271
|
+
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
11272
|
+
nextStates.push(stateName);
|
|
11273
|
+
return this.resolveLocalUseStatesTransition(nextStates);
|
|
11274
|
+
}
|
|
11275
|
+
resolveGraphicStateTransition(states, forceResolverRefresh = false) {
|
|
11276
|
+
var _a;
|
|
11277
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs();
|
|
11278
|
+
const stateEngine = this.ensureStateEngine(stateResolveBaseAttrs);
|
|
11279
|
+
if (forceResolverRefresh) {
|
|
11280
|
+
stateEngine === null || stateEngine === void 0 ? void 0 : stateEngine.invalidateResolverCache();
|
|
11281
|
+
}
|
|
11282
|
+
const transition = stateEngine
|
|
11283
|
+
? this.toGraphicStateTransition(stateEngine.applyStates(states))
|
|
11284
|
+
: this.resolveLocalUseStatesTransition(states);
|
|
11285
|
+
const resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : {};
|
|
11286
|
+
const effectiveStates = (_a = transition.effectiveStates) !== null && _a !== void 0 ? _a : transition.states;
|
|
11287
|
+
return {
|
|
11288
|
+
transition,
|
|
11289
|
+
effectiveStates: effectiveStates,
|
|
11290
|
+
resolvedStateAttrs
|
|
11291
|
+
};
|
|
11292
|
+
}
|
|
11293
|
+
normalizeSetStatesOptions(options) {
|
|
11294
|
+
if (options && typeof options === 'object') {
|
|
11295
|
+
return {
|
|
11296
|
+
hasAnimation: options.animate,
|
|
11297
|
+
animateSameStatePatchChange: options.animateSameStatePatchChange === true,
|
|
11298
|
+
shouldRefreshSameStatePatch: true
|
|
11299
|
+
};
|
|
11300
|
+
}
|
|
11301
|
+
return {
|
|
11302
|
+
hasAnimation: typeof options === 'boolean' ? options : undefined,
|
|
11303
|
+
animateSameStatePatchChange: false,
|
|
11304
|
+
shouldRefreshSameStatePatch: false
|
|
11305
|
+
};
|
|
11306
|
+
}
|
|
11307
|
+
sameStatePatches(left, right) {
|
|
11308
|
+
const leftRecord = (left !== null && left !== void 0 ? left : {});
|
|
11309
|
+
const rightRecord = (right !== null && right !== void 0 ? right : {});
|
|
11310
|
+
const keys = new Set([...Object.keys(leftRecord), ...Object.keys(rightRecord)]);
|
|
11311
|
+
for (const key of keys) {
|
|
11312
|
+
const hasLeft = Object.prototype.hasOwnProperty.call(leftRecord, key);
|
|
11313
|
+
const hasRight = Object.prototype.hasOwnProperty.call(rightRecord, key);
|
|
11314
|
+
if (hasLeft !== hasRight) {
|
|
11315
|
+
return false;
|
|
11316
|
+
}
|
|
11317
|
+
if (!areAttributeValuesEqual(leftRecord[key], rightRecord[key])) {
|
|
11318
|
+
return false;
|
|
11319
|
+
}
|
|
11320
|
+
}
|
|
11321
|
+
return true;
|
|
11322
|
+
}
|
|
11323
|
+
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = false) {
|
|
11324
|
+
var _a;
|
|
11325
|
+
const previousStates = (_a = this.currentStates) !== null && _a !== void 0 ? _a : EMPTY_STATE_NAMES;
|
|
11326
|
+
const previousResolvedStatePatch = this.resolvedStatePatch;
|
|
11327
|
+
const { transition, effectiveStates, resolvedStateAttrs } = this.resolveGraphicStateTransition(states, true);
|
|
11328
|
+
const patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
11329
|
+
if (patchChanged &&
|
|
11330
|
+
!this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, false)) {
|
|
11331
|
+
return;
|
|
11332
|
+
}
|
|
11333
|
+
this.currentStates = transition.states;
|
|
11334
|
+
this.effectiveStates = [...effectiveStates];
|
|
11335
|
+
this.resolvedStatePatch = resolvedStateAttrs;
|
|
11336
|
+
this.sharedStateDirty = false;
|
|
11337
|
+
this.syncSharedStateActiveRegistrations();
|
|
11338
|
+
if (!patchChanged) {
|
|
11339
|
+
return;
|
|
11340
|
+
}
|
|
11341
|
+
if (hasAnimation && animateSameStatePatchChange) {
|
|
11342
|
+
this._syncFinalAttributeFromStaticTruth();
|
|
11343
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, false, undefined, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch));
|
|
11344
|
+
}
|
|
11345
|
+
else {
|
|
11346
|
+
this.stopStateAnimates();
|
|
11347
|
+
if (this.attributeMayContainTransientAttrs) {
|
|
11348
|
+
this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });
|
|
11349
|
+
}
|
|
11350
|
+
else {
|
|
11351
|
+
this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
11352
|
+
type: AttributeUpdateType.STATE
|
|
11353
|
+
});
|
|
11354
|
+
}
|
|
11355
|
+
this.emitStateUpdateEvent();
|
|
11356
|
+
}
|
|
11619
11357
|
}
|
|
11620
11358
|
resolveStateAnimateConfig(animateConfig) {
|
|
11621
11359
|
var _a, _b, _c;
|
|
@@ -11631,10 +11369,10 @@ class Graphic extends Node {
|
|
|
11631
11369
|
}
|
|
11632
11370
|
: undefined;
|
|
11633
11371
|
if (isClear) {
|
|
11634
|
-
this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation,
|
|
11372
|
+
this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
|
|
11635
11373
|
return;
|
|
11636
11374
|
}
|
|
11637
|
-
const plan = this.getStateTransitionOrchestrator().analyzeTransition(
|
|
11375
|
+
const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
|
|
11638
11376
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
11639
11377
|
animateConfig: resolvedAnimateConfig,
|
|
11640
11378
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
@@ -11642,8 +11380,7 @@ class Graphic extends Node {
|
|
|
11642
11380
|
});
|
|
11643
11381
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
11644
11382
|
}
|
|
11645
|
-
updateNormalAttrs(
|
|
11646
|
-
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
11383
|
+
updateNormalAttrs(_stateAttrs) {
|
|
11647
11384
|
}
|
|
11648
11385
|
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
11649
11386
|
return this.getDefaultAttribute(key);
|
|
@@ -11657,6 +11394,9 @@ class Graphic extends Node {
|
|
|
11657
11394
|
stopAnimationState.call(this, 'state', type);
|
|
11658
11395
|
return;
|
|
11659
11396
|
}
|
|
11397
|
+
if (!this.mayHaveTrackedAnimates()) {
|
|
11398
|
+
return;
|
|
11399
|
+
}
|
|
11660
11400
|
const stateAnimates = [];
|
|
11661
11401
|
this.visitTrackedAnimates(animate => {
|
|
11662
11402
|
if (animate.stateNames) {
|
|
@@ -11665,21 +11405,11 @@ class Graphic extends Node {
|
|
|
11665
11405
|
});
|
|
11666
11406
|
stateAnimates.forEach(animate => animate.stop(type));
|
|
11667
11407
|
}
|
|
11668
|
-
getNormalAttribute(key) {
|
|
11669
|
-
var _a, _b;
|
|
11670
|
-
const value = this.attribute[key];
|
|
11671
|
-
if (this.hasAnyTrackedAnimate()) {
|
|
11672
|
-
return (_a = this.finalAttribute) === null || _a === void 0 ? void 0 : _a[key];
|
|
11673
|
-
}
|
|
11674
|
-
return value !== null && value !== void 0 ? value : (_b = this.finalAttribute) === null || _b === void 0 ? void 0 : _b[key];
|
|
11675
|
-
}
|
|
11676
11408
|
clearStates(hasAnimation) {
|
|
11677
11409
|
var _a, _b, _c;
|
|
11678
|
-
const previousStates =
|
|
11679
|
-
const previousResolvedStatePatch = this.resolvedStatePatch
|
|
11680
|
-
|
|
11681
|
-
: undefined;
|
|
11682
|
-
const transition = this.createStateModel().clearStates();
|
|
11410
|
+
const previousStates = (_a = this.currentStates) !== null && _a !== void 0 ? _a : EMPTY_STATE_NAMES;
|
|
11411
|
+
const previousResolvedStatePatch = this.resolvedStatePatch;
|
|
11412
|
+
const transition = this.resolveClearStatesTransition();
|
|
11683
11413
|
if (!transition.changed && previousStates.length === 0) {
|
|
11684
11414
|
this.currentStates = [];
|
|
11685
11415
|
this.effectiveStates = [];
|
|
@@ -11688,7 +11418,9 @@ class Graphic extends Node {
|
|
|
11688
11418
|
this.clearSharedStateActiveRegistrations();
|
|
11689
11419
|
return;
|
|
11690
11420
|
}
|
|
11691
|
-
const resolvedStateAttrs =
|
|
11421
|
+
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent('beforeStateUpdate')
|
|
11422
|
+
? cloneAttributeValue(((_b = this.baseAttributes) !== null && _b !== void 0 ? _b : {}))
|
|
11423
|
+
: ((_c = this.baseAttributes) !== null && _c !== void 0 ? _c : {});
|
|
11692
11424
|
if (transition.changed &&
|
|
11693
11425
|
!this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, true)) {
|
|
11694
11426
|
return;
|
|
@@ -11698,81 +11430,104 @@ class Graphic extends Node {
|
|
|
11698
11430
|
this.resolvedStatePatch = undefined;
|
|
11699
11431
|
this.sharedStateDirty = false;
|
|
11700
11432
|
this.clearSharedStateActiveRegistrations();
|
|
11701
|
-
(_b = getStageStatePerfMonitor(this.stage)) === null || _b === void 0 ? void 0 : _b.incrementCounter('stateCommits');
|
|
11702
|
-
(_c = getStageStatePerfMonitor(this.stage)) === null || _c === void 0 ? void 0 : _c.recordEvent('state-commit', {
|
|
11703
|
-
graphicId: this._uid,
|
|
11704
|
-
targetStates: []
|
|
11705
|
-
});
|
|
11706
11433
|
if (hasAnimation) {
|
|
11707
11434
|
this._syncFinalAttributeFromStaticTruth();
|
|
11708
11435
|
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, true, undefined, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch));
|
|
11709
11436
|
}
|
|
11710
11437
|
else {
|
|
11711
11438
|
this.stopStateAnimates();
|
|
11712
|
-
this.
|
|
11713
|
-
|
|
11439
|
+
if (this.attributeMayContainTransientAttrs) {
|
|
11440
|
+
this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });
|
|
11441
|
+
}
|
|
11442
|
+
else {
|
|
11443
|
+
this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, undefined, {
|
|
11444
|
+
type: AttributeUpdateType.STATE
|
|
11445
|
+
});
|
|
11446
|
+
}
|
|
11447
|
+
this.emitStateUpdateEvent();
|
|
11714
11448
|
}
|
|
11715
11449
|
}
|
|
11716
11450
|
removeState(stateName, hasAnimation) {
|
|
11717
|
-
const transition = this.
|
|
11451
|
+
const transition = this.resolveRemoveStateTransition(stateName);
|
|
11718
11452
|
if (transition.changed) {
|
|
11719
11453
|
this.useStates(transition.states, hasAnimation);
|
|
11720
11454
|
}
|
|
11721
11455
|
}
|
|
11722
11456
|
toggleState(stateName, hasAnimation) {
|
|
11723
|
-
const transition = this.
|
|
11457
|
+
const transition = this.resolveToggleStateTransition(stateName);
|
|
11724
11458
|
if (transition.changed) {
|
|
11725
11459
|
this.useStates(transition.states, hasAnimation);
|
|
11726
11460
|
}
|
|
11727
11461
|
}
|
|
11728
11462
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
11729
|
-
const transition = this.
|
|
11463
|
+
const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
|
|
11730
11464
|
if (!transition.changed) {
|
|
11731
11465
|
return;
|
|
11732
11466
|
}
|
|
11733
11467
|
this.useStates(transition.states, hasAnimation);
|
|
11734
11468
|
}
|
|
11469
|
+
setStates(states, options) {
|
|
11470
|
+
var _a, _b, _c;
|
|
11471
|
+
const { hasAnimation, animateSameStatePatchChange, shouldRefreshSameStatePatch } = this.normalizeSetStatesOptions(options);
|
|
11472
|
+
const nextStates = (states === null || states === void 0 ? void 0 : states.length) ? states : EMPTY_STATE_NAMES;
|
|
11473
|
+
const hasCurrentState = !!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
11474
|
+
!!((_b = this.effectiveStates) === null || _b === void 0 ? void 0 : _b.length) ||
|
|
11475
|
+
!!this.resolvedStatePatch ||
|
|
11476
|
+
!!((_c = this.registeredActiveScopes) === null || _c === void 0 ? void 0 : _c.size);
|
|
11477
|
+
if (!nextStates.length) {
|
|
11478
|
+
if (!hasCurrentState && !this.sharedStateDirty) {
|
|
11479
|
+
return;
|
|
11480
|
+
}
|
|
11481
|
+
this.clearStates(hasAnimation);
|
|
11482
|
+
return;
|
|
11483
|
+
}
|
|
11484
|
+
if (this.sameStateNames(this.currentStates, nextStates)) {
|
|
11485
|
+
if (shouldRefreshSameStatePatch) {
|
|
11486
|
+
this.commitSameStatePatchRefresh(nextStates, hasAnimation, animateSameStatePatchChange);
|
|
11487
|
+
return;
|
|
11488
|
+
}
|
|
11489
|
+
if (this.sharedStateDirty) {
|
|
11490
|
+
this.refreshSharedStateBeforeRender();
|
|
11491
|
+
}
|
|
11492
|
+
return;
|
|
11493
|
+
}
|
|
11494
|
+
this.useStates(nextStates, hasAnimation);
|
|
11495
|
+
}
|
|
11735
11496
|
useStates(states, hasAnimation) {
|
|
11736
|
-
var _a
|
|
11497
|
+
var _a;
|
|
11737
11498
|
if (!states.length) {
|
|
11738
11499
|
this.clearStates(hasAnimation);
|
|
11739
11500
|
return;
|
|
11740
11501
|
}
|
|
11741
|
-
const previousStates =
|
|
11742
|
-
const previousResolvedStatePatch = this.resolvedStatePatch
|
|
11743
|
-
|
|
11744
|
-
: undefined;
|
|
11745
|
-
const stateResolveBaseAttrs = ((_a = this.baseAttributes) !== null && _a !== void 0 ? _a : this.attribute);
|
|
11746
|
-
const stateModel = this.createStateModel();
|
|
11747
|
-
(_b = this.stateEngine) === null || _b === void 0 ? void 0 : _b.setResolveContext(this, stateResolveBaseAttrs);
|
|
11748
|
-
const transition = stateModel.useStates(states);
|
|
11502
|
+
const previousStates = (_a = this.currentStates) !== null && _a !== void 0 ? _a : EMPTY_STATE_NAMES;
|
|
11503
|
+
const previousResolvedStatePatch = this.resolvedStatePatch;
|
|
11504
|
+
const { transition, effectiveStates, resolvedStateAttrs } = this.resolveGraphicStateTransition(states);
|
|
11749
11505
|
if (!transition.changed && this.sameStateNames(previousStates, transition.states)) {
|
|
11750
11506
|
return;
|
|
11751
11507
|
}
|
|
11752
|
-
const effectiveStates = (_c = transition.effectiveStates) !== null && _c !== void 0 ? _c : transition.states;
|
|
11753
|
-
const resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions
|
|
11754
|
-
? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
11755
11508
|
if (!this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, false)) {
|
|
11756
11509
|
return;
|
|
11757
11510
|
}
|
|
11758
11511
|
this.currentStates = transition.states;
|
|
11759
11512
|
this.effectiveStates = [...effectiveStates];
|
|
11760
|
-
this.resolvedStatePatch =
|
|
11513
|
+
this.resolvedStatePatch = resolvedStateAttrs;
|
|
11761
11514
|
this.sharedStateDirty = false;
|
|
11762
11515
|
this.syncSharedStateActiveRegistrations();
|
|
11763
|
-
(_d = getStageStatePerfMonitor(this.stage)) === null || _d === void 0 ? void 0 : _d.incrementCounter('stateCommits');
|
|
11764
|
-
(_e = getStageStatePerfMonitor(this.stage)) === null || _e === void 0 ? void 0 : _e.recordEvent('state-commit', {
|
|
11765
|
-
graphicId: this._uid,
|
|
11766
|
-
targetStates: [...transition.states]
|
|
11767
|
-
});
|
|
11768
11516
|
if (hasAnimation) {
|
|
11769
11517
|
this._syncFinalAttributeFromStaticTruth();
|
|
11770
11518
|
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, false, undefined, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch));
|
|
11771
11519
|
}
|
|
11772
11520
|
else {
|
|
11773
11521
|
this.stopStateAnimates();
|
|
11774
|
-
this.
|
|
11775
|
-
|
|
11522
|
+
if (this.attributeMayContainTransientAttrs) {
|
|
11523
|
+
this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });
|
|
11524
|
+
}
|
|
11525
|
+
else {
|
|
11526
|
+
this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
11527
|
+
type: AttributeUpdateType.STATE
|
|
11528
|
+
});
|
|
11529
|
+
}
|
|
11530
|
+
this.emitStateUpdateEvent();
|
|
11776
11531
|
}
|
|
11777
11532
|
}
|
|
11778
11533
|
invalidateResolver() {
|
|
@@ -11780,19 +11535,18 @@ class Graphic extends Node {
|
|
|
11780
11535
|
if (!this.stateEngine || !((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) || !this.compiledStateDefinitions) {
|
|
11781
11536
|
return;
|
|
11782
11537
|
}
|
|
11783
|
-
|
|
11784
|
-
this.
|
|
11785
|
-
this.resolverEpoch += 1;
|
|
11538
|
+
this.syncStateResolveContext();
|
|
11539
|
+
this.resolverEpoch = ((_b = this.resolverEpoch) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
11786
11540
|
this.stateEngine.invalidateResolverCache();
|
|
11787
11541
|
const transition = this.stateEngine.applyStates(this.currentStates);
|
|
11788
11542
|
const resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
11789
11543
|
this.effectiveStates = [...transition.effectiveStates];
|
|
11790
|
-
this.resolvedStatePatch =
|
|
11544
|
+
this.resolvedStatePatch = resolvedStateAttrs;
|
|
11791
11545
|
this.sharedStateDirty = false;
|
|
11792
11546
|
this.syncSharedStateActiveRegistrations();
|
|
11793
11547
|
this.stopStateAnimates();
|
|
11794
11548
|
this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });
|
|
11795
|
-
this.
|
|
11549
|
+
this.emitStateUpdateEvent();
|
|
11796
11550
|
}
|
|
11797
11551
|
sameStateNames(left, right) {
|
|
11798
11552
|
const normalizedLeft = left !== null && left !== void 0 ? left : [];
|
|
@@ -11831,6 +11585,20 @@ class Graphic extends Node {
|
|
|
11831
11585
|
this.glyphHost.addUpdateBoundTag();
|
|
11832
11586
|
}
|
|
11833
11587
|
}
|
|
11588
|
+
addBroadUpdateTag() {
|
|
11589
|
+
this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();
|
|
11590
|
+
this._updateTag |=
|
|
11591
|
+
UpdateTag.UPDATE_SHAPE_AND_BOUNDS |
|
|
11592
|
+
UpdateTag.UPDATE_PAINT |
|
|
11593
|
+
UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX |
|
|
11594
|
+
UpdateTag.UPDATE_LAYOUT;
|
|
11595
|
+
if (this.parent) {
|
|
11596
|
+
this.parent.addChildUpdateBoundTag();
|
|
11597
|
+
}
|
|
11598
|
+
if (this.glyphHost) {
|
|
11599
|
+
this.glyphHost.addUpdateBoundTag();
|
|
11600
|
+
}
|
|
11601
|
+
}
|
|
11834
11602
|
updateShapeAndBoundsTagSetted() {
|
|
11835
11603
|
return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;
|
|
11836
11604
|
}
|
|
@@ -11935,17 +11703,22 @@ class Graphic extends Node {
|
|
|
11935
11703
|
}
|
|
11936
11704
|
}
|
|
11937
11705
|
setStage(stage, layer) {
|
|
11938
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11706
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
11939
11707
|
const graphicService = (_c = (_a = stage === null || stage === void 0 ? void 0 : stage.graphicService) !== null && _a !== void 0 ? _a : (_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService) !== null && _c !== void 0 ? _c : application.graphicService;
|
|
11940
11708
|
const previousStage = this.stage;
|
|
11941
11709
|
if (this.stage !== stage || this.layer !== layer) {
|
|
11942
11710
|
this.stage = stage;
|
|
11943
11711
|
this.layer = layer;
|
|
11944
|
-
|
|
11712
|
+
if (((_d = this.currentStates) === null || _d === void 0 ? void 0 : _d.length) ||
|
|
11713
|
+
this.boundSharedStateScope ||
|
|
11714
|
+
((_e = this.registeredActiveScopes) === null || _e === void 0 ? void 0 : _e.size) ||
|
|
11715
|
+
this.sharedStateDirty) {
|
|
11716
|
+
this.syncSharedStateScopeBindingOnTreeChange(true);
|
|
11717
|
+
}
|
|
11945
11718
|
this.setStageToShadowRoot(stage, layer);
|
|
11946
|
-
if (this.hasAnyTrackedAnimate()) {
|
|
11947
|
-
const previousTimeline = (
|
|
11948
|
-
const nextTimeline = (
|
|
11719
|
+
if (this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
11720
|
+
const previousTimeline = (_f = previousStage === null || previousStage === void 0 ? void 0 : previousStage.getTimeline) === null || _f === void 0 ? void 0 : _f.call(previousStage);
|
|
11721
|
+
const nextTimeline = (_g = stage === null || stage === void 0 ? void 0 : stage.getTimeline) === null || _g === void 0 ? void 0 : _g.call(stage);
|
|
11949
11722
|
const detachedStageAnimates = [];
|
|
11950
11723
|
this.visitTrackedAnimates(a => {
|
|
11951
11724
|
const boundToPreviousStage = !!previousTimeline && a.timeline === previousTimeline;
|
|
@@ -11983,10 +11756,36 @@ class Graphic extends Node {
|
|
|
11983
11756
|
}
|
|
11984
11757
|
}
|
|
11985
11758
|
this._onSetStage && this._onSetStage(this, stage, layer);
|
|
11986
|
-
(
|
|
11759
|
+
(_h = graphicService === null || graphicService === void 0 ? void 0 : graphicService.onSetStage) === null || _h === void 0 ? void 0 : _h.call(graphicService, this, stage);
|
|
11987
11760
|
return;
|
|
11988
11761
|
}
|
|
11989
|
-
|
|
11762
|
+
if (((_j = this.currentStates) === null || _j === void 0 ? void 0 : _j.length) ||
|
|
11763
|
+
this.boundSharedStateScope ||
|
|
11764
|
+
((_k = this.registeredActiveScopes) === null || _k === void 0 ? void 0 : _k.size) ||
|
|
11765
|
+
this.sharedStateDirty) {
|
|
11766
|
+
this.syncSharedStateScopeBindingOnTreeChange(true);
|
|
11767
|
+
}
|
|
11768
|
+
}
|
|
11769
|
+
detachStageForRelease() {
|
|
11770
|
+
var _a, _b, _c;
|
|
11771
|
+
if ((_a = this.registeredActiveScopes) === null || _a === void 0 ? void 0 : _a.size) {
|
|
11772
|
+
this.clearSharedStateActiveRegistrations();
|
|
11773
|
+
}
|
|
11774
|
+
if (this.mayHaveTrackedAnimates() || this.shadowRoot) {
|
|
11775
|
+
this.stopAnimates();
|
|
11776
|
+
}
|
|
11777
|
+
this.boundSharedStateScope = undefined;
|
|
11778
|
+
this.boundSharedStateRevision = undefined;
|
|
11779
|
+
this.compiledStateDefinitions = undefined;
|
|
11780
|
+
this.compiledStateDefinitionsCacheKey = undefined;
|
|
11781
|
+
this.stateEngine = undefined;
|
|
11782
|
+
this.stateEngineCompiledDefinitions = undefined;
|
|
11783
|
+
this.sharedStateDirty = false;
|
|
11784
|
+
this.stage = null;
|
|
11785
|
+
this.layer = null;
|
|
11786
|
+
if (this.shadowRoot) {
|
|
11787
|
+
(_c = (_b = this.shadowRoot).detachStageForRelease) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
11788
|
+
}
|
|
11990
11789
|
}
|
|
11991
11790
|
setStageToShadowRoot(stage, layer) {
|
|
11992
11791
|
if (this.shadowRoot) {
|
|
@@ -12122,6 +11921,9 @@ class Graphic extends Node {
|
|
|
12122
11921
|
cb && cb();
|
|
12123
11922
|
}
|
|
12124
11923
|
_stopAnimates() {
|
|
11924
|
+
if (!this.mayHaveTrackedAnimates()) {
|
|
11925
|
+
return;
|
|
11926
|
+
}
|
|
12125
11927
|
const animates = [];
|
|
12126
11928
|
this.visitTrackedAnimates(animate => {
|
|
12127
11929
|
animates.push(animate);
|
|
@@ -12142,17 +11944,24 @@ class Graphic extends Node {
|
|
|
12142
11944
|
}
|
|
12143
11945
|
}
|
|
12144
11946
|
release() {
|
|
12145
|
-
var _a, _b, _c;
|
|
11947
|
+
var _a, _b, _c, _d;
|
|
12146
11948
|
this.releaseStatus = 'released';
|
|
12147
|
-
this.
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
(
|
|
11949
|
+
if ((_a = this.registeredActiveScopes) === null || _a === void 0 ? void 0 : _a.size) {
|
|
11950
|
+
this.clearSharedStateActiveRegistrations();
|
|
11951
|
+
}
|
|
11952
|
+
if (this.mayHaveTrackedAnimates() || this.shadowRoot) {
|
|
11953
|
+
this.stopAnimates();
|
|
11954
|
+
}
|
|
11955
|
+
const graphicService = (_c = (_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService) !== null && _c !== void 0 ? _c : application.graphicService;
|
|
11956
|
+
(_d = graphicService === null || graphicService === void 0 ? void 0 : graphicService.onRelease) === null || _d === void 0 ? void 0 : _d.call(graphicService, this);
|
|
12151
11957
|
super.release();
|
|
12152
11958
|
}
|
|
11959
|
+
hasCustomEvent(type) {
|
|
11960
|
+
return !!this._events && type in this._events;
|
|
11961
|
+
}
|
|
12153
11962
|
_dispatchCustomEvent(type, context) {
|
|
12154
11963
|
var _a, _b;
|
|
12155
|
-
if (this.
|
|
11964
|
+
if (this.hasCustomEvent(type)) {
|
|
12156
11965
|
const changeEvent = new CustomEvent(type, context);
|
|
12157
11966
|
changeEvent.bubbles = false;
|
|
12158
11967
|
const manager = (_b = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem) === null || _b === void 0 ? void 0 : _b.manager;
|
|
@@ -12165,6 +11974,9 @@ class Graphic extends Node {
|
|
|
12165
11974
|
return true;
|
|
12166
11975
|
}
|
|
12167
11976
|
beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
|
|
11977
|
+
if (!this.hasCustomEvent('beforeStateUpdate')) {
|
|
11978
|
+
return true;
|
|
11979
|
+
}
|
|
12168
11980
|
return this._dispatchCustomEvent('beforeStateUpdate', {
|
|
12169
11981
|
type: AttributeUpdateType.STATE,
|
|
12170
11982
|
attrs: Object.assign({}, attrs),
|
|
@@ -12174,6 +11986,11 @@ class Graphic extends Node {
|
|
|
12174
11986
|
isClear: !!isClear
|
|
12175
11987
|
});
|
|
12176
11988
|
}
|
|
11989
|
+
emitStateUpdateEvent() {
|
|
11990
|
+
if (this.hasCustomEvent('afterStateUpdate')) {
|
|
11991
|
+
this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });
|
|
11992
|
+
}
|
|
11993
|
+
}
|
|
12177
11994
|
_emitCustomEvent(type, context) {
|
|
12178
11995
|
this._dispatchCustomEvent(type, context);
|
|
12179
11996
|
}
|
|
@@ -13951,23 +13768,15 @@ class Glyph extends Graphic {
|
|
|
13951
13768
|
states = states.sort(this.stateSort);
|
|
13952
13769
|
}
|
|
13953
13770
|
const stateAttrs = {};
|
|
13954
|
-
const subAttrs = this.subGraphic.map(() => ({}));
|
|
13955
13771
|
states.forEach(stateName => {
|
|
13956
|
-
var _a;
|
|
13957
13772
|
const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];
|
|
13958
13773
|
if (attrs) {
|
|
13959
13774
|
Object.assign(stateAttrs, attrs.attributes);
|
|
13960
|
-
if ((_a = attrs.subAttributes) === null || _a === void 0 ? void 0 : _a.length) {
|
|
13961
|
-
subAttrs.forEach((subAttrs, index) => {
|
|
13962
|
-
Object.assign(subAttrs, attrs.subAttributes[index]);
|
|
13963
|
-
});
|
|
13964
|
-
}
|
|
13965
13775
|
}
|
|
13966
13776
|
});
|
|
13967
13777
|
if (!this.beforeStateUpdate(stateAttrs, previousStates, states, hasAnimation, false)) {
|
|
13968
13778
|
return;
|
|
13969
13779
|
}
|
|
13970
|
-
this.updateNormalAttrs(stateAttrs);
|
|
13971
13780
|
this.currentStates = states;
|
|
13972
13781
|
this.applyStateAttrs(stateAttrs, states, hasAnimation);
|
|
13973
13782
|
}
|
|
@@ -13984,7 +13793,6 @@ class Glyph extends Graphic {
|
|
|
13984
13793
|
else {
|
|
13985
13794
|
this.currentStates = [];
|
|
13986
13795
|
}
|
|
13987
|
-
this.normalAttrs = null;
|
|
13988
13796
|
}
|
|
13989
13797
|
clone() {
|
|
13990
13798
|
const glyph = new Glyph(Object.assign({}, this.attribute));
|
|
@@ -16022,6 +15830,7 @@ const ARC_UPDATE_TAG_KEY = [
|
|
|
16022
15830
|
'cornerRadius',
|
|
16023
15831
|
'padAngle',
|
|
16024
15832
|
'padRadius',
|
|
15833
|
+
'clipRange',
|
|
16025
15834
|
'cap',
|
|
16026
15835
|
...GRAPHIC_UPDATE_TAG_KEY
|
|
16027
15836
|
];
|
|
@@ -16074,12 +15883,13 @@ class Arc extends Graphic {
|
|
|
16074
15883
|
getParsedAngle() {
|
|
16075
15884
|
const arcTheme = this.getGraphicTheme();
|
|
16076
15885
|
let { startAngle = arcTheme.startAngle, endAngle = arcTheme.endAngle } = this.attribute;
|
|
16077
|
-
const { cap = arcTheme.cap } = this.attribute;
|
|
15886
|
+
const { cap = arcTheme.cap, clipRange = arcTheme.clipRange } = this.attribute;
|
|
16078
15887
|
const sign = endAngle - startAngle >= 0 ? 1 : -1;
|
|
16079
|
-
|
|
15888
|
+
let deltaAngle = endAngle - startAngle;
|
|
15889
|
+
deltaAngle *= Math.max(0, Math.min(clipRange, 1));
|
|
16080
15890
|
startAngle = clampAngleByRadian(startAngle);
|
|
16081
15891
|
endAngle = startAngle + deltaAngle;
|
|
16082
|
-
if (cap && abs(deltaAngle) < pi2 - epsilon) {
|
|
15892
|
+
if (cap && abs(deltaAngle) > epsilon && abs(deltaAngle) < pi2 - epsilon) {
|
|
16083
15893
|
let startCap = 1;
|
|
16084
15894
|
let endCap = 1;
|
|
16085
15895
|
if (cap.length) {
|
|
@@ -16434,12 +16244,16 @@ class Group extends Graphic {
|
|
|
16434
16244
|
if (this._sharedStateDefinitions === value) {
|
|
16435
16245
|
return;
|
|
16436
16246
|
}
|
|
16247
|
+
const previousScope = this.sharedStateScope;
|
|
16437
16248
|
this._sharedStateDefinitions = value;
|
|
16438
16249
|
this.ensureSharedStateScopeBound();
|
|
16439
16250
|
if (this.sharedStateScope) {
|
|
16440
16251
|
setSharedStateScopeLocalDefinitions(this.sharedStateScope, value);
|
|
16441
16252
|
markScopeActiveDescendantsDirty(this.sharedStateScope, this.stage);
|
|
16442
16253
|
}
|
|
16254
|
+
if (previousScope !== this.sharedStateScope) {
|
|
16255
|
+
this.notifyChildrenSharedStateTreeChanged();
|
|
16256
|
+
}
|
|
16443
16257
|
}
|
|
16444
16258
|
setMode(mode) {
|
|
16445
16259
|
mode === '3d' ? this.set3dMode() : this.set2dMode();
|
|
@@ -16576,13 +16390,7 @@ class Group extends Graphic {
|
|
|
16576
16390
|
incrementalAppendChild(node) {
|
|
16577
16391
|
const data = super.appendChild(node);
|
|
16578
16392
|
if (data) {
|
|
16579
|
-
|
|
16580
|
-
(data.stage !== this.stage || data.layer !== this.layer)) {
|
|
16581
|
-
data.setStage(this.stage, this.layer);
|
|
16582
|
-
}
|
|
16583
|
-
else if (data.onParentSharedStateTreeChanged) {
|
|
16584
|
-
data.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
16585
|
-
}
|
|
16393
|
+
this.syncChildSharedStateTreeBinding(data);
|
|
16586
16394
|
}
|
|
16587
16395
|
this.addUpdateBoundTag();
|
|
16588
16396
|
this.getGraphicService().onAddIncremental(node, this, this.stage);
|
|
@@ -16596,12 +16404,7 @@ class Group extends Graphic {
|
|
|
16596
16404
|
}
|
|
16597
16405
|
_updateChildToStage(child) {
|
|
16598
16406
|
if (child) {
|
|
16599
|
-
|
|
16600
|
-
child.setStage(this.stage, this.layer);
|
|
16601
|
-
}
|
|
16602
|
-
else if (child.onParentSharedStateTreeChanged) {
|
|
16603
|
-
child.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
16604
|
-
}
|
|
16407
|
+
this.syncChildSharedStateTreeBinding(child);
|
|
16605
16408
|
}
|
|
16606
16409
|
this.addUpdateBoundTag();
|
|
16607
16410
|
return child;
|
|
@@ -16609,13 +16412,8 @@ class Group extends Graphic {
|
|
|
16609
16412
|
appendChild(node, addStage = true) {
|
|
16610
16413
|
const data = super.appendChild(node);
|
|
16611
16414
|
if (data) {
|
|
16612
|
-
if (addStage
|
|
16613
|
-
this.
|
|
16614
|
-
(data.stage !== this.stage || data.layer !== this.layer)) {
|
|
16615
|
-
data.setStage(this.stage, this.layer);
|
|
16616
|
-
}
|
|
16617
|
-
else if (data.onParentSharedStateTreeChanged) {
|
|
16618
|
-
data.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
16415
|
+
if (addStage) {
|
|
16416
|
+
this.syncChildSharedStateTreeBinding(data);
|
|
16619
16417
|
}
|
|
16620
16418
|
}
|
|
16621
16419
|
this.addUpdateBoundTag();
|
|
@@ -16630,8 +16428,15 @@ class Group extends Graphic {
|
|
|
16630
16428
|
insertInto(newNode, idx) {
|
|
16631
16429
|
return this._updateChildToStage(super.insertInto(newNode, idx));
|
|
16632
16430
|
}
|
|
16633
|
-
removeChild(child) {
|
|
16431
|
+
removeChild(child, highPerformance = false) {
|
|
16634
16432
|
const data = super.removeChild(child);
|
|
16433
|
+
if (!data) {
|
|
16434
|
+
return data;
|
|
16435
|
+
}
|
|
16436
|
+
if (highPerformance) {
|
|
16437
|
+
child.detachStageForRelease();
|
|
16438
|
+
return data;
|
|
16439
|
+
}
|
|
16635
16440
|
this.getGraphicService().onRemove(child);
|
|
16636
16441
|
child.setStage(null, null);
|
|
16637
16442
|
this.addUpdateBoundTag();
|
|
@@ -16654,29 +16459,37 @@ class Group extends Graphic {
|
|
|
16654
16459
|
setStage(stage, layer) {
|
|
16655
16460
|
var _a, _b, _c, _d, _e, _f;
|
|
16656
16461
|
const graphicService = (_c = (_a = stage === null || stage === void 0 ? void 0 : stage.graphicService) !== null && _a !== void 0 ? _a : (_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService) !== null && _c !== void 0 ? _c : application.graphicService;
|
|
16462
|
+
const needsSharedStateTreeSync = this.hasSharedStateDefinitions() ||
|
|
16463
|
+
this.sharedStateScope ||
|
|
16464
|
+
((_d = this.currentStates) === null || _d === void 0 ? void 0 : _d.length) ||
|
|
16465
|
+
this.boundSharedStateScope ||
|
|
16466
|
+
((_e = this.registeredActiveScopes) === null || _e === void 0 ? void 0 : _e.size) ||
|
|
16467
|
+
this.sharedStateDirty;
|
|
16657
16468
|
if (this.stage !== stage) {
|
|
16658
16469
|
this.stage = stage;
|
|
16659
16470
|
this.layer = layer;
|
|
16660
|
-
|
|
16661
|
-
|
|
16471
|
+
if (needsSharedStateTreeSync) {
|
|
16472
|
+
this.ensureSharedStateScopeBound();
|
|
16473
|
+
this.syncSharedStateScopeBindingOnTreeChange(true);
|
|
16474
|
+
}
|
|
16662
16475
|
this.setStageToShadowRoot(stage, layer);
|
|
16663
16476
|
this._onSetStage && this._onSetStage(this, stage, layer);
|
|
16664
|
-
(
|
|
16665
|
-
this.
|
|
16666
|
-
item.setStage(stage, this.layer);
|
|
16667
|
-
});
|
|
16477
|
+
(_f = graphicService === null || graphicService === void 0 ? void 0 : graphicService.onSetStage) === null || _f === void 0 ? void 0 : _f.call(graphicService, this, stage);
|
|
16478
|
+
this.notifyChildrenSharedStateTreeChanged();
|
|
16668
16479
|
return;
|
|
16669
16480
|
}
|
|
16670
|
-
|
|
16481
|
+
const layerChanged = this.layer !== layer;
|
|
16482
|
+
if (layerChanged) {
|
|
16671
16483
|
this.layer = layer;
|
|
16672
16484
|
}
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
|
|
16679
|
-
|
|
16485
|
+
if (needsSharedStateTreeSync) {
|
|
16486
|
+
this.ensureSharedStateScopeBound();
|
|
16487
|
+
this.syncSharedStateScopeBindingOnTreeChange(true);
|
|
16488
|
+
this.notifyChildrenSharedStateTreeChanged();
|
|
16489
|
+
}
|
|
16490
|
+
else if (layerChanged) {
|
|
16491
|
+
this.notifyChildrenSharedStateTreeChanged();
|
|
16492
|
+
}
|
|
16680
16493
|
}
|
|
16681
16494
|
addUpdatePositionTag() {
|
|
16682
16495
|
super.addUpdatePositionTag();
|
|
@@ -16743,32 +16556,50 @@ class Group extends Graphic {
|
|
|
16743
16556
|
}
|
|
16744
16557
|
super.release();
|
|
16745
16558
|
}
|
|
16559
|
+
detachStageForRelease() {
|
|
16560
|
+
super.detachStageForRelease();
|
|
16561
|
+
this.sharedStateScope = undefined;
|
|
16562
|
+
this.forEachChildren((item) => {
|
|
16563
|
+
item.detachStageForRelease();
|
|
16564
|
+
});
|
|
16565
|
+
}
|
|
16746
16566
|
ensureSharedStateScopeBound() {
|
|
16747
16567
|
var _a, _b, _c;
|
|
16568
|
+
if (!this.hasSharedStateDefinitions()) {
|
|
16569
|
+
this.sharedStateScope = undefined;
|
|
16570
|
+
return;
|
|
16571
|
+
}
|
|
16748
16572
|
const parentScope = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.sharedStateScope) !== null && _b !== void 0 ? _b : (_c = this.stage) === null || _c === void 0 ? void 0 : _c.rootSharedStateScope;
|
|
16749
16573
|
if (!this.sharedStateScope) {
|
|
16750
16574
|
this.sharedStateScope = createGroupSharedStateScope(this, parentScope, this._sharedStateDefinitions);
|
|
16751
16575
|
return;
|
|
16752
16576
|
}
|
|
16753
|
-
this.sharedStateScope.ownerGroup = this;
|
|
16754
16577
|
this.sharedStateScope.ownerStage = this.stage;
|
|
16755
16578
|
setSharedStateScopeParent(this.sharedStateScope, parentScope);
|
|
16756
16579
|
if (this.sharedStateScope.localStateDefinitions !== this._sharedStateDefinitions) {
|
|
16757
16580
|
setSharedStateScopeLocalDefinitions(this.sharedStateScope, this._sharedStateDefinitions);
|
|
16758
16581
|
}
|
|
16759
16582
|
}
|
|
16583
|
+
hasSharedStateDefinitions() {
|
|
16584
|
+
return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
|
|
16585
|
+
}
|
|
16586
|
+
notifyChildrenSharedStateTreeChanged() {
|
|
16587
|
+
this.forEachChildren(item => {
|
|
16588
|
+
this.syncChildSharedStateTreeBinding(item);
|
|
16589
|
+
});
|
|
16590
|
+
}
|
|
16591
|
+
syncChildSharedStateTreeBinding(child) {
|
|
16592
|
+
child.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
16593
|
+
}
|
|
16760
16594
|
onParentSharedStateTreeChanged(stage, layer) {
|
|
16595
|
+
var _a;
|
|
16761
16596
|
if (this.stage !== stage || this.layer !== layer) {
|
|
16762
16597
|
this.setStage(stage, layer);
|
|
16763
16598
|
return;
|
|
16764
16599
|
}
|
|
16765
16600
|
this.ensureSharedStateScopeBound();
|
|
16766
|
-
this.
|
|
16767
|
-
this.
|
|
16768
|
-
if (item.onParentSharedStateTreeChanged) {
|
|
16769
|
-
item.onParentSharedStateTreeChanged(stage, this.layer);
|
|
16770
|
-
}
|
|
16771
|
-
});
|
|
16601
|
+
this.syncSharedStateScopeBindingOnTreeChange(!!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length));
|
|
16602
|
+
this.notifyChildrenSharedStateTreeChanged();
|
|
16772
16603
|
}
|
|
16773
16604
|
}
|
|
16774
16605
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
@@ -17210,6 +17041,10 @@ class DefaultGraphicService {
|
|
|
17210
17041
|
};
|
|
17211
17042
|
this.tempAABBBounds1 = new AABBBounds();
|
|
17212
17043
|
this.tempAABBBounds2 = new AABBBounds();
|
|
17044
|
+
this.tempAABBBoundsResult = {
|
|
17045
|
+
tb1: this.tempAABBBounds1,
|
|
17046
|
+
tb2: this.tempAABBBounds2
|
|
17047
|
+
};
|
|
17213
17048
|
}
|
|
17214
17049
|
onAttributeUpdate(graphic) {
|
|
17215
17050
|
if (this.hooks.onAttributeUpdate.taps.length) {
|
|
@@ -17256,15 +17091,6 @@ class DefaultGraphicService {
|
|
|
17256
17091
|
this.hooks.clearAABBBounds.call(graphic, stage, b);
|
|
17257
17092
|
}
|
|
17258
17093
|
}
|
|
17259
|
-
updatePathProxyAABBBounds(aabbBounds, graphic) {
|
|
17260
|
-
const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
|
|
17261
|
-
if (!path) {
|
|
17262
|
-
return false;
|
|
17263
|
-
}
|
|
17264
|
-
const boundsContext = new BoundsContext(aabbBounds);
|
|
17265
|
-
renderCommandList(path.commandList, boundsContext, 0, 0);
|
|
17266
|
-
return true;
|
|
17267
|
-
}
|
|
17268
17094
|
updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
|
|
17269
17095
|
const { textAlign, textBaseline } = attribute;
|
|
17270
17096
|
if (attribute.forceBoundsHeight != null) {
|
|
@@ -17340,7 +17166,7 @@ class DefaultGraphicService {
|
|
|
17340
17166
|
const tb2 = this.tempAABBBounds2;
|
|
17341
17167
|
tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
|
|
17342
17168
|
tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
|
|
17343
|
-
return
|
|
17169
|
+
return this.tempAABBBoundsResult;
|
|
17344
17170
|
}
|
|
17345
17171
|
}
|
|
17346
17172
|
|
|
@@ -18856,10 +18682,9 @@ class RendererRegistry {
|
|
|
18856
18682
|
this.entries.set(key, renderer);
|
|
18857
18683
|
this.cache.delete(key);
|
|
18858
18684
|
}
|
|
18859
|
-
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
}
|
|
18685
|
+
unregister(key) {
|
|
18686
|
+
this.entries.delete(key);
|
|
18687
|
+
this.cache.delete(key);
|
|
18863
18688
|
}
|
|
18864
18689
|
get(key) {
|
|
18865
18690
|
if (this.cache.has(key)) {
|
|
@@ -18891,10 +18716,8 @@ class PickerRegistry {
|
|
|
18891
18716
|
register(key, picker) {
|
|
18892
18717
|
this.entries.set(key, picker);
|
|
18893
18718
|
}
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
this.register(key, picker);
|
|
18897
|
-
}
|
|
18719
|
+
unregister(key) {
|
|
18720
|
+
this.entries.delete(key);
|
|
18898
18721
|
}
|
|
18899
18722
|
get(key) {
|
|
18900
18723
|
return this.entries.get(key);
|
|
@@ -18938,9 +18761,21 @@ class ContributionRegistry {
|
|
|
18938
18761
|
current.push(contribution);
|
|
18939
18762
|
this.entries.set(key, current);
|
|
18940
18763
|
}
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
this.
|
|
18764
|
+
unregister(key, contribution) {
|
|
18765
|
+
if (contribution === undefined) {
|
|
18766
|
+
this.entries.delete(key);
|
|
18767
|
+
return;
|
|
18768
|
+
}
|
|
18769
|
+
const current = this.entries.get(key);
|
|
18770
|
+
if (!current) {
|
|
18771
|
+
return;
|
|
18772
|
+
}
|
|
18773
|
+
const next = current.filter(entry => entry !== contribution);
|
|
18774
|
+
if (next.length) {
|
|
18775
|
+
this.entries.set(key, next);
|
|
18776
|
+
}
|
|
18777
|
+
else {
|
|
18778
|
+
this.entries.delete(key);
|
|
18944
18779
|
}
|
|
18945
18780
|
}
|
|
18946
18781
|
get(key) {
|
|
@@ -18967,13 +18802,12 @@ const EMPTY_AUTO_ENABLE_PROVIDER = {
|
|
|
18967
18802
|
};
|
|
18968
18803
|
class DefaultPluginService {
|
|
18969
18804
|
constructor(autoEnablePlugins = EMPTY_AUTO_ENABLE_PROVIDER, deps = {}) {
|
|
18970
|
-
var _a
|
|
18805
|
+
var _a;
|
|
18971
18806
|
this.autoEnablePlugins = autoEnablePlugins;
|
|
18972
18807
|
this.onStartupFinishedPlugin = [];
|
|
18973
18808
|
this.onRegisterPlugin = [];
|
|
18974
18809
|
this.actived = false;
|
|
18975
18810
|
this.pluginRegistry = (_a = deps.pluginRegistry) !== null && _a !== void 0 ? _a : new PluginRegistry();
|
|
18976
|
-
this.autoEnablePlugins = (_c = (_b = deps.autoEnablePlugins) !== null && _b !== void 0 ? _b : this.autoEnablePlugins) !== null && _c !== void 0 ? _c : EMPTY_AUTO_ENABLE_PROVIDER;
|
|
18977
18811
|
}
|
|
18978
18812
|
active(stage, params) {
|
|
18979
18813
|
this.stage = stage;
|
|
@@ -19243,8 +19077,9 @@ class DirtyBoundsPlugin {
|
|
|
19243
19077
|
this.activeEvent = 'onRegister';
|
|
19244
19078
|
this._uid = Generator.GenAutoIncrementId();
|
|
19245
19079
|
this.key = this.name + this._uid;
|
|
19080
|
+
this.dirtyBoundsHooksRegistered = false;
|
|
19246
19081
|
this.handlePaintOnlyUpdate = (graphic) => {
|
|
19247
|
-
var _a
|
|
19082
|
+
var _a;
|
|
19248
19083
|
const stage = this.pluginService.stage;
|
|
19249
19084
|
if (!(stage && stage === graphic.stage && stage.renderCount)) {
|
|
19250
19085
|
return;
|
|
@@ -19257,7 +19092,7 @@ class DirtyBoundsPlugin {
|
|
|
19257
19092
|
if (ownerBounds && !ownerBounds.empty()) {
|
|
19258
19093
|
stage.dirty(ownerBounds);
|
|
19259
19094
|
}
|
|
19260
|
-
|
|
19095
|
+
owner.clearUpdatePaintTag();
|
|
19261
19096
|
const shadowRoot = owner.shadowRoot;
|
|
19262
19097
|
if (!shadowRoot) {
|
|
19263
19098
|
return;
|
|
@@ -19266,34 +19101,30 @@ class DirtyBoundsPlugin {
|
|
|
19266
19101
|
if (shadowBounds && !shadowBounds.empty()) {
|
|
19267
19102
|
stage.dirty(shadowBounds);
|
|
19268
19103
|
}
|
|
19269
|
-
|
|
19104
|
+
shadowRoot.clearUpdatePaintTag();
|
|
19270
19105
|
};
|
|
19271
19106
|
}
|
|
19272
19107
|
ensurePaintDirtyBoundsCache(graphic) {
|
|
19273
|
-
var _a
|
|
19108
|
+
var _a;
|
|
19274
19109
|
const owner = graphic;
|
|
19275
|
-
|
|
19276
|
-
if (!hasLocalBounds && typeof owner.doUpdateAABBBounds === 'function') {
|
|
19110
|
+
if (owner._AABBBounds.empty()) {
|
|
19277
19111
|
owner.doUpdateAABBBounds(((_a = owner.attribute) === null || _a === void 0 ? void 0 : _a.boundsMode) === 'imprecise');
|
|
19278
19112
|
}
|
|
19279
|
-
|
|
19280
|
-
typeof owner._globalAABBBounds.empty === 'function' &&
|
|
19281
|
-
!owner._globalAABBBounds.empty();
|
|
19282
|
-
if (!hasGlobalBounds && typeof owner.tryUpdateGlobalAABBBounds === 'function') {
|
|
19113
|
+
if (!owner._globalAABBBounds || owner._globalAABBBounds.empty()) {
|
|
19283
19114
|
owner.tryUpdateGlobalAABBBounds();
|
|
19284
19115
|
}
|
|
19285
|
-
return
|
|
19116
|
+
return owner._globalAABBBounds;
|
|
19286
19117
|
}
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
if (
|
|
19118
|
+
getRemoveDirtyBounds(graphic) {
|
|
19119
|
+
var _a;
|
|
19120
|
+
const owner = ((_a = graphic.glyphHost) !== null && _a !== void 0 ? _a : graphic);
|
|
19121
|
+
const cachedBounds = owner._globalAABBBounds;
|
|
19122
|
+
if (cachedBounds && !cachedBounds.empty()) {
|
|
19123
|
+
return cachedBounds;
|
|
19124
|
+
}
|
|
19125
|
+
}
|
|
19126
|
+
registerDirtyBoundsHooks(stage) {
|
|
19127
|
+
if (this.dirtyBoundsHooksRegistered) {
|
|
19297
19128
|
return;
|
|
19298
19129
|
}
|
|
19299
19130
|
stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate);
|
|
@@ -19334,10 +19165,29 @@ class DirtyBoundsPlugin {
|
|
|
19334
19165
|
if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {
|
|
19335
19166
|
return;
|
|
19336
19167
|
}
|
|
19337
|
-
|
|
19338
|
-
|
|
19168
|
+
const bounds = this.getRemoveDirtyBounds(graphic);
|
|
19169
|
+
if (bounds && !bounds.empty()) {
|
|
19170
|
+
stage.dirty(bounds);
|
|
19171
|
+
}
|
|
19172
|
+
});
|
|
19173
|
+
this.dirtyBoundsHooksRegistered = true;
|
|
19174
|
+
}
|
|
19175
|
+
activate(context) {
|
|
19176
|
+
this.pluginService = context;
|
|
19177
|
+
context.stage.hooks.afterRender.tap(this.key, stage => {
|
|
19178
|
+
if (!(stage && stage === this.pluginService.stage)) {
|
|
19179
|
+
return;
|
|
19339
19180
|
}
|
|
19181
|
+
stage.dirtyBounds.clear();
|
|
19182
|
+
this.registerDirtyBoundsHooks(stage);
|
|
19340
19183
|
});
|
|
19184
|
+
const stage = this.pluginService.stage;
|
|
19185
|
+
if (!stage) {
|
|
19186
|
+
return;
|
|
19187
|
+
}
|
|
19188
|
+
if (stage.renderCount) {
|
|
19189
|
+
this.registerDirtyBoundsHooks(stage);
|
|
19190
|
+
}
|
|
19341
19191
|
}
|
|
19342
19192
|
deactivate(context) {
|
|
19343
19193
|
const stage = this.pluginService.stage;
|
|
@@ -19347,6 +19197,7 @@ class DirtyBoundsPlugin {
|
|
|
19347
19197
|
stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(item => {
|
|
19348
19198
|
return item.name !== this.key;
|
|
19349
19199
|
});
|
|
19200
|
+
this.dirtyBoundsHooksRegistered = false;
|
|
19350
19201
|
stage.graphicService.hooks.beforeUpdateAABBBounds.taps =
|
|
19351
19202
|
stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {
|
|
19352
19203
|
return item.name !== this.key;
|
|
@@ -19404,387 +19255,6 @@ function getCurrentEnv() {
|
|
|
19404
19255
|
return isBrowserEnv() ? 'browser' : 'node';
|
|
19405
19256
|
}
|
|
19406
19257
|
|
|
19407
|
-
function isRenderableGraphic(graphic) {
|
|
19408
|
-
return !!graphic.stage && graphic.releaseStatus !== 'released';
|
|
19409
|
-
}
|
|
19410
|
-
function createTargetStatesKey(targetStates) {
|
|
19411
|
-
return targetStates.length ? targetStates.join('|') : '__clear__';
|
|
19412
|
-
}
|
|
19413
|
-
function createIntentKey(contextOwnerId, configFingerprint, targetStatesKey) {
|
|
19414
|
-
return `${contextOwnerId}:${configFingerprint}:${targetStatesKey}`;
|
|
19415
|
-
}
|
|
19416
|
-
function hasMeaningfulDeferredConfig(config) {
|
|
19417
|
-
const normalized = normalizeDeferredStateOwnerConfig(config);
|
|
19418
|
-
return !!normalized && (normalized.localEnabled != null || normalized.deferred != null);
|
|
19419
|
-
}
|
|
19420
|
-
function getGraphicCompiledDefinitions(graphic) {
|
|
19421
|
-
const graphicAny = graphic;
|
|
19422
|
-
if (typeof graphicAny.resolveEffectiveCompiledDefinitions === 'function') {
|
|
19423
|
-
const result = graphicAny.resolveEffectiveCompiledDefinitions();
|
|
19424
|
-
return {
|
|
19425
|
-
compiledDefinitions: result.compiledDefinitions,
|
|
19426
|
-
stateProxyEligibility: result.stateProxyEligibility
|
|
19427
|
-
};
|
|
19428
|
-
}
|
|
19429
|
-
return {};
|
|
19430
|
-
}
|
|
19431
|
-
function getCurrentStateNames(graphic) {
|
|
19432
|
-
var _a, _b;
|
|
19433
|
-
return (_b = (_a = graphic.currentStates) === null || _a === void 0 ? void 0 : _a.slice()) !== null && _b !== void 0 ? _b : [];
|
|
19434
|
-
}
|
|
19435
|
-
class StateBatchScheduler {
|
|
19436
|
-
constructor(stage, perfMonitor) {
|
|
19437
|
-
this.stage = stage;
|
|
19438
|
-
this.perfMonitor = perfMonitor;
|
|
19439
|
-
this.jobsByIntentKey = new Map();
|
|
19440
|
-
this.pendingIntentByGraphic = new Map();
|
|
19441
|
-
this.nextJobId = 1;
|
|
19442
|
-
this.runningJobs = new Map();
|
|
19443
|
-
}
|
|
19444
|
-
schedule(graphics, targetStates) {
|
|
19445
|
-
const batchOperation = graphics.length > 1;
|
|
19446
|
-
graphics.forEach(graphic => {
|
|
19447
|
-
const eligibility = this.resolveEligibility(graphic, targetStates, batchOperation, true);
|
|
19448
|
-
if ('reason' in eligibility) {
|
|
19449
|
-
this.removeGraphicFromPending(graphic);
|
|
19450
|
-
if (eligibility.reason !== 'graphic_unavailable') {
|
|
19451
|
-
this.commitSynchronously(graphic, targetStates);
|
|
19452
|
-
}
|
|
19453
|
-
return;
|
|
19454
|
-
}
|
|
19455
|
-
this.enqueueDeferredIntent(graphic, targetStates, eligibility.context, eligibility.targetStatesKey);
|
|
19456
|
-
});
|
|
19457
|
-
}
|
|
19458
|
-
release() {
|
|
19459
|
-
var _a;
|
|
19460
|
-
this.jobsByIntentKey.forEach(job => {
|
|
19461
|
-
job.status = 'cancelled';
|
|
19462
|
-
});
|
|
19463
|
-
this.jobsByIntentKey.clear();
|
|
19464
|
-
this.pendingIntentByGraphic.clear();
|
|
19465
|
-
this.runningJobs.clear();
|
|
19466
|
-
(_a = this.perfMonitor) === null || _a === void 0 ? void 0 : _a.updateBatchPending(0);
|
|
19467
|
-
}
|
|
19468
|
-
resolveEligibility(graphic, targetStates, batchOperation, recordObservability) {
|
|
19469
|
-
var _a, _b, _c, _d, _e, _f;
|
|
19470
|
-
if (!isRenderableGraphic(graphic)) {
|
|
19471
|
-
if (recordObservability) {
|
|
19472
|
-
(_a = this.perfMonitor) === null || _a === void 0 ? void 0 : _a.recordDeferredIneligible('graphic_unavailable');
|
|
19473
|
-
}
|
|
19474
|
-
return { eligible: false, reason: 'graphic_unavailable' };
|
|
19475
|
-
}
|
|
19476
|
-
if (!batchOperation) {
|
|
19477
|
-
if (recordObservability) {
|
|
19478
|
-
(_b = this.perfMonitor) === null || _b === void 0 ? void 0 : _b.recordDeferredIneligible('non_batch_operation');
|
|
19479
|
-
}
|
|
19480
|
-
return { eligible: false, reason: 'non_batch_operation' };
|
|
19481
|
-
}
|
|
19482
|
-
const context = this.resolveDeferredContext(graphic);
|
|
19483
|
-
if (!context) {
|
|
19484
|
-
if (recordObservability) {
|
|
19485
|
-
(_c = this.perfMonitor) === null || _c === void 0 ? void 0 : _c.recordDeferredIneligible('graphic_unavailable');
|
|
19486
|
-
}
|
|
19487
|
-
return { eligible: false, reason: 'graphic_unavailable' };
|
|
19488
|
-
}
|
|
19489
|
-
if (!context.config.enabled) {
|
|
19490
|
-
const normalizedOwnerConfig = normalizeDeferredStateOwnerConfig(context.contextOwner.deferredStateConfig);
|
|
19491
|
-
const reason = (normalizedOwnerConfig === null || normalizedOwnerConfig === void 0 ? void 0 : normalizedOwnerConfig.localEnabled) === false ? 'context_disabled' : 'config_disabled';
|
|
19492
|
-
if (recordObservability) {
|
|
19493
|
-
(_d = this.perfMonitor) === null || _d === void 0 ? void 0 : _d.recordDeferredIneligible(reason);
|
|
19494
|
-
}
|
|
19495
|
-
return { eligible: false, reason };
|
|
19496
|
-
}
|
|
19497
|
-
const classification = this.classifyGraphicTargetStates(graphic, targetStates);
|
|
19498
|
-
if (classification.reason) {
|
|
19499
|
-
if (recordObservability) {
|
|
19500
|
-
(_e = this.perfMonitor) === null || _e === void 0 ? void 0 : _e.recordDeferredIneligible(classification.reason);
|
|
19501
|
-
}
|
|
19502
|
-
return { eligible: false, reason: classification.reason };
|
|
19503
|
-
}
|
|
19504
|
-
if (classification.category !== UpdateCategory.PAINT) {
|
|
19505
|
-
if (recordObservability) {
|
|
19506
|
-
(_f = this.perfMonitor) === null || _f === void 0 ? void 0 : _f.recordDeferredIneligible('mixed_update_category');
|
|
19507
|
-
}
|
|
19508
|
-
return { eligible: false, reason: 'mixed_update_category' };
|
|
19509
|
-
}
|
|
19510
|
-
return {
|
|
19511
|
-
eligible: true,
|
|
19512
|
-
context,
|
|
19513
|
-
targetStatesKey: createTargetStatesKey(targetStates)
|
|
19514
|
-
};
|
|
19515
|
-
}
|
|
19516
|
-
resolveDeferredContext(graphic) {
|
|
19517
|
-
var _a;
|
|
19518
|
-
const stage = graphic.stage;
|
|
19519
|
-
if (!stage) {
|
|
19520
|
-
return undefined;
|
|
19521
|
-
}
|
|
19522
|
-
let owner = stage;
|
|
19523
|
-
let config = normalizeDeferredStateConfig(undefined);
|
|
19524
|
-
const ownerConfigs = [stage];
|
|
19525
|
-
const parents = [];
|
|
19526
|
-
let parent = graphic.parent;
|
|
19527
|
-
while (parent && parent !== stage) {
|
|
19528
|
-
parents.push(parent);
|
|
19529
|
-
parent = parent.parent;
|
|
19530
|
-
}
|
|
19531
|
-
parents.reverse().forEach(current => ownerConfigs.push(current));
|
|
19532
|
-
ownerConfigs.forEach(current => {
|
|
19533
|
-
const deferredStateConfig = normalizeDeferredStateOwnerConfig(current.deferredStateConfig);
|
|
19534
|
-
if (!deferredStateConfig) {
|
|
19535
|
-
return;
|
|
19536
|
-
}
|
|
19537
|
-
if (deferredStateConfig.deferred) {
|
|
19538
|
-
config = Object.assign(Object.assign({}, config), deferredStateConfig.deferred);
|
|
19539
|
-
}
|
|
19540
|
-
if (deferredStateConfig.localEnabled != null) {
|
|
19541
|
-
config.enabled = deferredStateConfig.localEnabled;
|
|
19542
|
-
}
|
|
19543
|
-
if (hasMeaningfulDeferredConfig(current.deferredStateConfig)) {
|
|
19544
|
-
owner = current;
|
|
19545
|
-
}
|
|
19546
|
-
});
|
|
19547
|
-
const normalized = normalizeDeferredStateConfig(config);
|
|
19548
|
-
return {
|
|
19549
|
-
contextOwner: owner,
|
|
19550
|
-
contextOwnerId: (_a = owner._uid) !== null && _a !== void 0 ? _a : 0,
|
|
19551
|
-
config: normalized,
|
|
19552
|
-
configFingerprint: fingerprintDeferredStateConfig(normalized)
|
|
19553
|
-
};
|
|
19554
|
-
}
|
|
19555
|
-
classifyGraphicTargetStates(graphic, targetStates) {
|
|
19556
|
-
const { compiledDefinitions, stateProxyEligibility } = getGraphicCompiledDefinitions(graphic);
|
|
19557
|
-
const candidateStates = Array.from(new Set([...getCurrentStateNames(graphic), ...targetStates]));
|
|
19558
|
-
let category = UpdateCategory.NONE;
|
|
19559
|
-
candidateStates.forEach(stateName => {
|
|
19560
|
-
if (stateProxyEligibility === null || stateProxyEligibility === void 0 ? void 0 : stateProxyEligibility(stateName)) {
|
|
19561
|
-
category = UpdateCategory.NONE;
|
|
19562
|
-
return;
|
|
19563
|
-
}
|
|
19564
|
-
const definition = compiledDefinitions === null || compiledDefinitions === void 0 ? void 0 : compiledDefinitions.get(stateName);
|
|
19565
|
-
if (!definition) {
|
|
19566
|
-
return;
|
|
19567
|
-
}
|
|
19568
|
-
if (definition.hasResolver && definition.affectedKeys.size === 0) {
|
|
19569
|
-
category = UpdateCategory.NONE;
|
|
19570
|
-
return;
|
|
19571
|
-
}
|
|
19572
|
-
category |= classifyAffectedKeys(definition.affectedKeys);
|
|
19573
|
-
});
|
|
19574
|
-
if (candidateStates.some(stateName => stateProxyEligibility === null || stateProxyEligibility === void 0 ? void 0 : stateProxyEligibility(stateName)) ||
|
|
19575
|
-
candidateStates.some(stateName => {
|
|
19576
|
-
const definition = compiledDefinitions === null || compiledDefinitions === void 0 ? void 0 : compiledDefinitions.get(stateName);
|
|
19577
|
-
return !!(definition === null || definition === void 0 ? void 0 : definition.hasResolver) && definition.affectedKeys.size === 0;
|
|
19578
|
-
})) {
|
|
19579
|
-
return {
|
|
19580
|
-
category: UpdateCategory.NONE,
|
|
19581
|
-
reason: 'resolver_unstable_keys'
|
|
19582
|
-
};
|
|
19583
|
-
}
|
|
19584
|
-
return {
|
|
19585
|
-
category: category === UpdateCategory.NONE ? UpdateCategory.PAINT : category
|
|
19586
|
-
};
|
|
19587
|
-
}
|
|
19588
|
-
enqueueDeferredIntent(graphic, targetStates, context, targetStatesKey) {
|
|
19589
|
-
var _a, _b, _c, _d, _e, _f;
|
|
19590
|
-
const nextIntentKey = createIntentKey(context.contextOwnerId, context.configFingerprint, targetStatesKey);
|
|
19591
|
-
const prevIntentKey = this.pendingIntentByGraphic.get(graphic);
|
|
19592
|
-
if (prevIntentKey === nextIntentKey) {
|
|
19593
|
-
(_a = this.perfMonitor) === null || _a === void 0 ? void 0 : _a.incrementCounter('deferredJobsCoalesced');
|
|
19594
|
-
return;
|
|
19595
|
-
}
|
|
19596
|
-
if (prevIntentKey) {
|
|
19597
|
-
this.removeGraphicFromIntentJob(graphic, prevIntentKey);
|
|
19598
|
-
}
|
|
19599
|
-
let job = this.jobsByIntentKey.get(nextIntentKey);
|
|
19600
|
-
if (!job) {
|
|
19601
|
-
job = {
|
|
19602
|
-
id: this.nextJobId++,
|
|
19603
|
-
kind: 'apply_states',
|
|
19604
|
-
intentKey: nextIntentKey,
|
|
19605
|
-
status: 'pending',
|
|
19606
|
-
targetStates: [...targetStates],
|
|
19607
|
-
targetStatesKey,
|
|
19608
|
-
pendingGraphics: new Set(),
|
|
19609
|
-
orderedGraphics: [],
|
|
19610
|
-
config: context.config,
|
|
19611
|
-
contextOwner: context.contextOwner,
|
|
19612
|
-
contextOwnerId: context.contextOwnerId,
|
|
19613
|
-
configFingerprint: context.configFingerprint,
|
|
19614
|
-
createdAt: Date.now(),
|
|
19615
|
-
processedCount: 0
|
|
19616
|
-
};
|
|
19617
|
-
this.jobsByIntentKey.set(nextIntentKey, job);
|
|
19618
|
-
(_b = this.perfMonitor) === null || _b === void 0 ? void 0 : _b.incrementCounter('deferredJobsCreated');
|
|
19619
|
-
(_c = this.perfMonitor) === null || _c === void 0 ? void 0 : _c.updateBatchPending(this.jobsByIntentKey.size);
|
|
19620
|
-
}
|
|
19621
|
-
else {
|
|
19622
|
-
(_d = this.perfMonitor) === null || _d === void 0 ? void 0 : _d.incrementCounter('deferredJobsCoalesced');
|
|
19623
|
-
}
|
|
19624
|
-
if (!job.pendingGraphics.has(graphic)) {
|
|
19625
|
-
job.pendingGraphics.add(graphic);
|
|
19626
|
-
job.orderedGraphics.push(graphic);
|
|
19627
|
-
this.pendingIntentByGraphic.set(graphic, nextIntentKey);
|
|
19628
|
-
(_e = this.perfMonitor) === null || _e === void 0 ? void 0 : _e.recordAllocation('batchEntriesCreated');
|
|
19629
|
-
(_f = this.perfMonitor) === null || _f === void 0 ? void 0 : _f.updateMaxGraphicsInJob(job.pendingGraphics.size);
|
|
19630
|
-
}
|
|
19631
|
-
this.ensureJobRunning(job);
|
|
19632
|
-
}
|
|
19633
|
-
removeGraphicFromPending(graphic) {
|
|
19634
|
-
const prevIntentKey = this.pendingIntentByGraphic.get(graphic);
|
|
19635
|
-
if (!prevIntentKey) {
|
|
19636
|
-
return;
|
|
19637
|
-
}
|
|
19638
|
-
this.removeGraphicFromIntentJob(graphic, prevIntentKey);
|
|
19639
|
-
}
|
|
19640
|
-
removeGraphicFromIntentJob(graphic, intentKey) {
|
|
19641
|
-
var _a, _b, _c;
|
|
19642
|
-
const job = this.jobsByIntentKey.get(intentKey);
|
|
19643
|
-
if (!job) {
|
|
19644
|
-
this.pendingIntentByGraphic.delete(graphic);
|
|
19645
|
-
return;
|
|
19646
|
-
}
|
|
19647
|
-
job.pendingGraphics.delete(graphic);
|
|
19648
|
-
if (this.pendingIntentByGraphic.get(graphic) === intentKey) {
|
|
19649
|
-
this.pendingIntentByGraphic.delete(graphic);
|
|
19650
|
-
}
|
|
19651
|
-
if (job.pendingGraphics.size === 0 && job.status !== 'completed') {
|
|
19652
|
-
job.status = 'cancelled';
|
|
19653
|
-
this.jobsByIntentKey.delete(intentKey);
|
|
19654
|
-
(_a = this.perfMonitor) === null || _a === void 0 ? void 0 : _a.incrementCounter('deferredJobsCancelled');
|
|
19655
|
-
(_b = this.perfMonitor) === null || _b === void 0 ? void 0 : _b.recordEvent('deferred-job-cancel', {
|
|
19656
|
-
intentKey,
|
|
19657
|
-
jobId: job.id
|
|
19658
|
-
});
|
|
19659
|
-
(_c = this.perfMonitor) === null || _c === void 0 ? void 0 : _c.updateBatchPending(this.jobsByIntentKey.size);
|
|
19660
|
-
}
|
|
19661
|
-
}
|
|
19662
|
-
ensureJobRunning(job) {
|
|
19663
|
-
if (this.runningJobs.has(job.intentKey)) {
|
|
19664
|
-
return;
|
|
19665
|
-
}
|
|
19666
|
-
const runner = this.runJob(job).then(() => {
|
|
19667
|
-
this.runningJobs.delete(job.intentKey);
|
|
19668
|
-
}, () => {
|
|
19669
|
-
this.runningJobs.delete(job.intentKey);
|
|
19670
|
-
});
|
|
19671
|
-
this.runningJobs.set(job.intentKey, runner);
|
|
19672
|
-
}
|
|
19673
|
-
runJob(job) {
|
|
19674
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19675
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19676
|
-
if (job.status === 'cancelled') {
|
|
19677
|
-
return;
|
|
19678
|
-
}
|
|
19679
|
-
yield this.waitForNextFrame();
|
|
19680
|
-
if (job.status === 'cancelled') {
|
|
19681
|
-
return;
|
|
19682
|
-
}
|
|
19683
|
-
job.status = 'running';
|
|
19684
|
-
(_a = this.perfMonitor) === null || _a === void 0 ? void 0 : _a.recordEvent('deferred-job-start', {
|
|
19685
|
-
intentKey: job.intentKey,
|
|
19686
|
-
jobId: job.id
|
|
19687
|
-
});
|
|
19688
|
-
let index = 0;
|
|
19689
|
-
let frameStart = performance.now();
|
|
19690
|
-
let processedInFrame = 0;
|
|
19691
|
-
let committedInSlice = 0;
|
|
19692
|
-
while (index < job.orderedGraphics.length) {
|
|
19693
|
-
if (job.status === 'cancelled') {
|
|
19694
|
-
return;
|
|
19695
|
-
}
|
|
19696
|
-
if (processedInFrame > 0 &&
|
|
19697
|
-
(processedInFrame >= job.config.maxGraphicsPerFrame || performance.now() - frameStart >= job.config.frameBudget)) {
|
|
19698
|
-
(_b = this.perfMonitor) === null || _b === void 0 ? void 0 : _b.incrementCounter('deferredBudgetYields');
|
|
19699
|
-
(_c = this.perfMonitor) === null || _c === void 0 ? void 0 : _c.recordCost('batchSlice', performance.now() - frameStart);
|
|
19700
|
-
(_d = this.perfMonitor) === null || _d === void 0 ? void 0 : _d.recordEvent('deferred-job-yield', {
|
|
19701
|
-
intentKey: job.intentKey,
|
|
19702
|
-
jobId: job.id,
|
|
19703
|
-
processedInFrame
|
|
19704
|
-
});
|
|
19705
|
-
if (committedInSlice > 0) {
|
|
19706
|
-
this.stage.renderNextFrame();
|
|
19707
|
-
}
|
|
19708
|
-
yield this.waitForNextFrame();
|
|
19709
|
-
frameStart = performance.now();
|
|
19710
|
-
processedInFrame = 0;
|
|
19711
|
-
committedInSlice = 0;
|
|
19712
|
-
}
|
|
19713
|
-
const graphic = job.orderedGraphics[index++];
|
|
19714
|
-
if (!job.pendingGraphics.has(graphic)) {
|
|
19715
|
-
continue;
|
|
19716
|
-
}
|
|
19717
|
-
if (!isRenderableGraphic(graphic)) {
|
|
19718
|
-
job.pendingGraphics.delete(graphic);
|
|
19719
|
-
if (this.pendingIntentByGraphic.get(graphic) === job.intentKey) {
|
|
19720
|
-
this.pendingIntentByGraphic.delete(graphic);
|
|
19721
|
-
}
|
|
19722
|
-
continue;
|
|
19723
|
-
}
|
|
19724
|
-
if (this.pendingIntentByGraphic.get(graphic) !== job.intentKey) {
|
|
19725
|
-
job.pendingGraphics.delete(graphic);
|
|
19726
|
-
continue;
|
|
19727
|
-
}
|
|
19728
|
-
const nextEligibility = this.resolveEligibility(graphic, job.targetStates, true, false);
|
|
19729
|
-
if (!nextEligibility.eligible) {
|
|
19730
|
-
job.pendingGraphics.delete(graphic);
|
|
19731
|
-
this.pendingIntentByGraphic.delete(graphic);
|
|
19732
|
-
this.commitSynchronously(graphic, job.targetStates);
|
|
19733
|
-
continue;
|
|
19734
|
-
}
|
|
19735
|
-
const nextIntentKey = createIntentKey(nextEligibility.context.contextOwnerId, nextEligibility.context.configFingerprint, nextEligibility.targetStatesKey);
|
|
19736
|
-
if (nextIntentKey !== job.intentKey) {
|
|
19737
|
-
job.pendingGraphics.delete(graphic);
|
|
19738
|
-
this.pendingIntentByGraphic.delete(graphic);
|
|
19739
|
-
this.enqueueDeferredIntent(graphic, job.targetStates, nextEligibility.context, nextEligibility.targetStatesKey);
|
|
19740
|
-
continue;
|
|
19741
|
-
}
|
|
19742
|
-
this.commitSynchronously(graphic, job.targetStates);
|
|
19743
|
-
job.pendingGraphics.delete(graphic);
|
|
19744
|
-
this.pendingIntentByGraphic.delete(graphic);
|
|
19745
|
-
job.processedCount += 1;
|
|
19746
|
-
processedInFrame += 1;
|
|
19747
|
-
committedInSlice += 1;
|
|
19748
|
-
(_e = this.perfMonitor) === null || _e === void 0 ? void 0 : _e.incrementCounter('deferredGraphicsCommitted');
|
|
19749
|
-
}
|
|
19750
|
-
if (processedInFrame > 0) {
|
|
19751
|
-
(_f = this.perfMonitor) === null || _f === void 0 ? void 0 : _f.recordCost('batchSlice', performance.now() - frameStart);
|
|
19752
|
-
this.stage.renderNextFrame();
|
|
19753
|
-
}
|
|
19754
|
-
if (job.pendingGraphics.size === 0 && this.jobsByIntentKey.get(job.intentKey) === job) {
|
|
19755
|
-
job.status = 'completed';
|
|
19756
|
-
this.jobsByIntentKey.delete(job.intentKey);
|
|
19757
|
-
(_g = this.perfMonitor) === null || _g === void 0 ? void 0 : _g.incrementCounter('deferredJobsCompleted');
|
|
19758
|
-
(_h = this.perfMonitor) === null || _h === void 0 ? void 0 : _h.recordEvent('deferred-job-complete', {
|
|
19759
|
-
intentKey: job.intentKey,
|
|
19760
|
-
jobId: job.id,
|
|
19761
|
-
processedCount: job.processedCount
|
|
19762
|
-
});
|
|
19763
|
-
(_j = this.perfMonitor) === null || _j === void 0 ? void 0 : _j.updateBatchPending(this.jobsByIntentKey.size);
|
|
19764
|
-
}
|
|
19765
|
-
});
|
|
19766
|
-
}
|
|
19767
|
-
waitForNextFrame() {
|
|
19768
|
-
const stageGlobal = this.stage.global;
|
|
19769
|
-
if (stageGlobal === null || stageGlobal === void 0 ? void 0 : stageGlobal.getSpecifiedPerformanceRAF) {
|
|
19770
|
-
return stageGlobal.getSpecifiedPerformanceRAF(this.stage.rafId).wait();
|
|
19771
|
-
}
|
|
19772
|
-
return new Promise(resolve => {
|
|
19773
|
-
stageGlobal === null || stageGlobal === void 0 ? void 0 : stageGlobal.getSpecifiedRequestAnimationFrame(this.stage.rafId)(() => resolve());
|
|
19774
|
-
});
|
|
19775
|
-
}
|
|
19776
|
-
commitSynchronously(graphic, targetStates) {
|
|
19777
|
-
if (!isRenderableGraphic(graphic)) {
|
|
19778
|
-
return;
|
|
19779
|
-
}
|
|
19780
|
-
if (!targetStates.length) {
|
|
19781
|
-
graphic.clearStates(false);
|
|
19782
|
-
return;
|
|
19783
|
-
}
|
|
19784
|
-
graphic.useStates(targetStates, false);
|
|
19785
|
-
}
|
|
19786
|
-
}
|
|
19787
|
-
|
|
19788
19258
|
const DefaultConfig = {
|
|
19789
19259
|
WIDTH: 500,
|
|
19790
19260
|
HEIGHT: 500,
|
|
@@ -19871,7 +19341,7 @@ class Stage extends Group {
|
|
|
19871
19341
|
this._ticker.on('tick', this.afterTickCb);
|
|
19872
19342
|
}
|
|
19873
19343
|
constructor(params = {}, deps = {}) {
|
|
19874
|
-
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
19344
|
+
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
19875
19345
|
super({});
|
|
19876
19346
|
this.tickedBeforeRender = true;
|
|
19877
19347
|
this._onVisibleChange = (visible) => {
|
|
@@ -19893,7 +19363,10 @@ class Stage extends Group {
|
|
|
19893
19363
|
}
|
|
19894
19364
|
};
|
|
19895
19365
|
this.beforeRender = (stage) => {
|
|
19896
|
-
|
|
19366
|
+
const pendingSharedRefresh = this._pendingSharedStateRefreshGraphics;
|
|
19367
|
+
if (pendingSharedRefresh === null || pendingSharedRefresh === void 0 ? void 0 : pendingSharedRefresh.size) {
|
|
19368
|
+
flushStageSharedStateRefresh(this);
|
|
19369
|
+
}
|
|
19897
19370
|
this._beforeRenderList.forEach(cb => cb(stage));
|
|
19898
19371
|
};
|
|
19899
19372
|
this.afterClearScreen = (drawParams) => {
|
|
@@ -19959,16 +19432,17 @@ class Stage extends Group {
|
|
|
19959
19432
|
this.appendChild(this.layerService.createLayer(this, { main: true }));
|
|
19960
19433
|
this.nextFrameRenderLayerSet = new Set();
|
|
19961
19434
|
this.willNextFrameRender = false;
|
|
19962
|
-
ensureStageStatePerfMonitor(this);
|
|
19963
|
-
this._stateBatchScheduler = new StateBatchScheduler(this, ensureStageStatePerfMonitor(this));
|
|
19964
|
-
this.rootSharedStateScope = createRootSharedStateScope(this, (_x = this.theme) === null || _x === void 0 ? void 0 : _x.stateDefinitions);
|
|
19965
19435
|
this.theme.onStateDefinitionsChange = () => {
|
|
19966
19436
|
var _a;
|
|
19967
|
-
|
|
19437
|
+
const definitions = (_a = this.theme) === null || _a === void 0 ? void 0 : _a.stateDefinitions;
|
|
19438
|
+
const rootScope = definitions && Object.keys(definitions).length
|
|
19439
|
+
? this.ensureRootSharedStateScope(definitions)
|
|
19440
|
+
: this.rootSharedStateScope;
|
|
19441
|
+
if (!rootScope) {
|
|
19968
19442
|
return;
|
|
19969
19443
|
}
|
|
19970
|
-
setRootSharedStateScopeThemeDefinitions(
|
|
19971
|
-
markScopeActiveDescendantsDirty(
|
|
19444
|
+
setRootSharedStateScopeThemeDefinitions(rootScope, definitions);
|
|
19445
|
+
markScopeActiveDescendantsDirty(rootScope, this);
|
|
19972
19446
|
};
|
|
19973
19447
|
this.renderStyle = params.renderStyle;
|
|
19974
19448
|
if (params.autoRender) {
|
|
@@ -20010,7 +19484,7 @@ class Stage extends Group {
|
|
|
20010
19484
|
this.setAttributes({ background: this._background });
|
|
20011
19485
|
}
|
|
20012
19486
|
this.initAnimate(params);
|
|
20013
|
-
this.rafId = (
|
|
19487
|
+
this.rafId = (_x = params.rafId) !== null && _x !== void 0 ? _x : Math.floor(Math.random() * 6);
|
|
20014
19488
|
}
|
|
20015
19489
|
initAnimate(params) {
|
|
20016
19490
|
var _a;
|
|
@@ -20390,14 +19864,13 @@ class Stage extends Group {
|
|
|
20390
19864
|
});
|
|
20391
19865
|
}
|
|
20392
19866
|
}
|
|
20393
|
-
|
|
20394
|
-
this.
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
ensureStageStatePerfMonitor(this).reset();
|
|
19867
|
+
ensureRootSharedStateScope(themeStateDefinitions) {
|
|
19868
|
+
if (!this.rootSharedStateScope) {
|
|
19869
|
+
this.rootSharedStateScope = createRootSharedStateScope(this, themeStateDefinitions);
|
|
19870
|
+
return this.rootSharedStateScope;
|
|
19871
|
+
}
|
|
19872
|
+
this.rootSharedStateScope.ownerStage = this;
|
|
19873
|
+
return this.rootSharedStateScope;
|
|
20401
19874
|
}
|
|
20402
19875
|
_doRenderInThisFrame() {
|
|
20403
19876
|
if (this.releaseStatus === 'released') {
|
|
@@ -20532,8 +20005,7 @@ class Stage extends Group {
|
|
|
20532
20005
|
throw new Error('暂不支持');
|
|
20533
20006
|
}
|
|
20534
20007
|
release() {
|
|
20535
|
-
var _a, _b, _d
|
|
20536
|
-
(_a = this._stateBatchScheduler) === null || _a === void 0 ? void 0 : _a.release();
|
|
20008
|
+
var _a, _b, _d;
|
|
20537
20009
|
super.release();
|
|
20538
20010
|
this.hooks.beforeRender.unTap('constructor', this.beforeRender);
|
|
20539
20011
|
this.hooks.afterRender.unTap('constructor', this.afterRender);
|
|
@@ -20551,10 +20023,10 @@ class Stage extends Group {
|
|
|
20551
20023
|
this.interactiveLayer.release();
|
|
20552
20024
|
}
|
|
20553
20025
|
this.window.release();
|
|
20554
|
-
(
|
|
20555
|
-
(
|
|
20026
|
+
(_a = this._ticker) === null || _a === void 0 ? void 0 : _a.remTimeline(this === null || this === void 0 ? void 0 : this.timeline);
|
|
20027
|
+
(_b = this._ticker) === null || _b === void 0 ? void 0 : _b.removeListener('tick', this.afterTickCb);
|
|
20556
20028
|
if (!this.params.ticker) {
|
|
20557
|
-
(
|
|
20029
|
+
(_d = this._ticker) === null || _d === void 0 ? void 0 : _d.release();
|
|
20558
20030
|
}
|
|
20559
20031
|
this.renderService.renderTreeRoots = [];
|
|
20560
20032
|
}
|
|
@@ -21748,6 +21220,7 @@ class CanvasLayerHandlerContribution {
|
|
|
21748
21220
|
}
|
|
21749
21221
|
if (!nativeCanvas) {
|
|
21750
21222
|
nativeCanvas = this.global.createCanvas({
|
|
21223
|
+
id: params.canvasId,
|
|
21751
21224
|
width: window.width,
|
|
21752
21225
|
height: window.height
|
|
21753
21226
|
});
|
|
@@ -23981,23 +23454,27 @@ function createStage(params) {
|
|
|
23981
23454
|
const result = { x: 0, y: 0, z: 0, lastModelMatrix: null };
|
|
23982
23455
|
class BaseRender {
|
|
23983
23456
|
init(contributions) {
|
|
23984
|
-
if (contributions) {
|
|
23985
|
-
this._renderContribitions = contributions.getContributions();
|
|
23986
|
-
}
|
|
23987
|
-
if (!this._renderContribitions) {
|
|
23988
|
-
this._renderContribitions = [];
|
|
23989
|
-
}
|
|
23990
23457
|
if (!this.builtinContributions) {
|
|
23991
23458
|
this.builtinContributions = [];
|
|
23992
23459
|
}
|
|
23993
|
-
this.
|
|
23994
|
-
|
|
23995
|
-
|
|
23460
|
+
this._renderContribitions = contributions ? contributions.getContributions().slice() : [];
|
|
23461
|
+
const addContribution = (item) => {
|
|
23462
|
+
if (!this._renderContribitions.includes(item)) {
|
|
23463
|
+
this._renderContribitions.push(item);
|
|
23464
|
+
}
|
|
23465
|
+
};
|
|
23466
|
+
this.builtinContributions.forEach(addContribution);
|
|
23467
|
+
addContribution(defaultBaseClipRenderBeforeContribution);
|
|
23468
|
+
addContribution(defaultBaseClipRenderAfterContribution);
|
|
23996
23469
|
if (this._renderContribitions.length) {
|
|
23997
23470
|
this._renderContribitions.sort((a, b) => b.order - a.order);
|
|
23998
23471
|
this._beforeRenderContribitions = this._renderContribitions.filter(c => c.time === BaseRenderContributionTime.beforeFillStroke);
|
|
23999
23472
|
this._afterRenderContribitions = this._renderContribitions.filter(c => c.time === BaseRenderContributionTime.afterFillStroke);
|
|
24000
23473
|
}
|
|
23474
|
+
else {
|
|
23475
|
+
this._beforeRenderContribitions = [];
|
|
23476
|
+
this._afterRenderContribitions = [];
|
|
23477
|
+
}
|
|
24001
23478
|
}
|
|
24002
23479
|
reInit() {
|
|
24003
23480
|
this.init(this.graphicRenderContributions);
|
|
@@ -26845,18 +26322,12 @@ function createBrowserApp(options = {}) {
|
|
|
26845
26322
|
}
|
|
26846
26323
|
|
|
26847
26324
|
class NodeEntry extends BrowserEntry {
|
|
26848
|
-
constructor(options = {}) {
|
|
26849
|
-
super(options);
|
|
26850
|
-
}
|
|
26851
26325
|
}
|
|
26852
26326
|
function createNodeApp(options = {}) {
|
|
26853
26327
|
return new NodeEntry(options);
|
|
26854
26328
|
}
|
|
26855
26329
|
|
|
26856
26330
|
class MiniappEntry extends BrowserEntry {
|
|
26857
|
-
constructor(options = {}) {
|
|
26858
|
-
super(options);
|
|
26859
|
-
}
|
|
26860
26331
|
}
|
|
26861
26332
|
function createMiniappApp(options = {}) {
|
|
26862
26333
|
return new MiniappEntry(options);
|
|
@@ -26961,6 +26432,10 @@ class DefaultIncrementalCanvasLineRender extends DefaultCanvasLineRender {
|
|
|
26961
26432
|
const runtimeInstallerContext = createLegacyBindingContext();
|
|
26962
26433
|
let runtimeInstallerPreloaded = false;
|
|
26963
26434
|
let runtimeGlobal;
|
|
26435
|
+
const RUNTIME_RENDERER_NAMESPACE = 'vrender:runtime-renderer';
|
|
26436
|
+
const RUNTIME_PICKER_NAMESPACE = 'vrender:runtime-picker';
|
|
26437
|
+
const runtimeEntryKeys = new WeakMap();
|
|
26438
|
+
const runtimeDrawContributions = new WeakMap();
|
|
26964
26439
|
function ensureRuntimeInstallerPreloaded() {
|
|
26965
26440
|
if (runtimeInstallerPreloaded) {
|
|
26966
26441
|
return;
|
|
@@ -26988,6 +26463,26 @@ function registerRuntimeEntries(register, entries, prefix) {
|
|
|
26988
26463
|
register(`${prefix}:${String(name)}:${index}`, entry);
|
|
26989
26464
|
});
|
|
26990
26465
|
}
|
|
26466
|
+
function getTrackedEntryKeys(registry, namespace) {
|
|
26467
|
+
let namespaces = runtimeEntryKeys.get(registry);
|
|
26468
|
+
if (!namespaces) {
|
|
26469
|
+
namespaces = new Map();
|
|
26470
|
+
runtimeEntryKeys.set(registry, namespaces);
|
|
26471
|
+
}
|
|
26472
|
+
let keys = namespaces.get(namespace);
|
|
26473
|
+
if (!keys) {
|
|
26474
|
+
keys = new Set();
|
|
26475
|
+
namespaces.set(namespace, keys);
|
|
26476
|
+
}
|
|
26477
|
+
return keys;
|
|
26478
|
+
}
|
|
26479
|
+
function clearTrackedEntryKeys(registry, namespace, unregister) {
|
|
26480
|
+
const keys = getTrackedEntryKeys(registry, namespace);
|
|
26481
|
+
if (unregister) {
|
|
26482
|
+
keys.forEach(key => unregister(key));
|
|
26483
|
+
}
|
|
26484
|
+
keys.clear();
|
|
26485
|
+
}
|
|
26991
26486
|
function createAppRegistryContributionProvider(app, key) {
|
|
26992
26487
|
return {
|
|
26993
26488
|
getContributions: () => app.context.registry.contribution.get(key)
|
|
@@ -27019,31 +26514,51 @@ function configureRuntimeApplicationForApp(app) {
|
|
|
27019
26514
|
application.incrementalDrawContributionFactory = () => new DefaultIncrementalDrawContribution([], new DefaultIncrementalCanvasLineRender(), new DefaultIncrementalCanvasAreaRender(createContributionProvider(AreaRenderContribution, bindingContext)), createAppRegistryContributionProvider(app, DrawItemInterceptor));
|
|
27020
26515
|
}
|
|
27021
26516
|
function installRuntimeGraphicRenderersToApp(app) {
|
|
26517
|
+
var _a;
|
|
27022
26518
|
const bindingContext = getRuntimeInstallerBindingContext();
|
|
27023
26519
|
refreshRuntimeInstallerContributions();
|
|
27024
26520
|
const renderers = bindingContext.getAll(GraphicRender);
|
|
27025
|
-
app.registry.renderer
|
|
26521
|
+
const registeredKeys = getTrackedEntryKeys(app.registry.renderer, RUNTIME_RENDERER_NAMESPACE);
|
|
26522
|
+
clearTrackedEntryKeys(app.registry.renderer, RUNTIME_RENDERER_NAMESPACE, (_a = app.registry.renderer.unregister) === null || _a === void 0 ? void 0 : _a.bind(app.registry.renderer));
|
|
27026
26523
|
registerRuntimeEntries((key, renderer) => {
|
|
27027
26524
|
var _a;
|
|
27028
26525
|
(_a = renderer === null || renderer === void 0 ? void 0 : renderer.reInit) === null || _a === void 0 ? void 0 : _a.call(renderer);
|
|
27029
26526
|
app.registry.renderer.register(key, renderer);
|
|
27030
|
-
|
|
26527
|
+
registeredKeys.add(key);
|
|
26528
|
+
}, renderers, RUNTIME_RENDERER_NAMESPACE);
|
|
27031
26529
|
}
|
|
27032
26530
|
function installRuntimeDrawContributionsToApp(app) {
|
|
26531
|
+
var _a;
|
|
27033
26532
|
const bindingContext = getRuntimeInstallerBindingContext();
|
|
27034
26533
|
refreshRuntimeInstallerContributions();
|
|
27035
26534
|
const contributions = bindingContext.getAll(DrawItemInterceptor);
|
|
27036
|
-
app.context.registry.contribution
|
|
26535
|
+
const tracked = (_a = runtimeDrawContributions.get(app.context.registry.contribution)) !== null && _a !== void 0 ? _a : new Set();
|
|
26536
|
+
tracked.forEach(contribution => {
|
|
26537
|
+
var _a, _b;
|
|
26538
|
+
(_b = (_a = app.context.registry.contribution).unregister) === null || _b === void 0 ? void 0 : _b.call(_a, DrawItemInterceptor, contribution);
|
|
26539
|
+
});
|
|
26540
|
+
tracked.clear();
|
|
26541
|
+
runtimeDrawContributions.set(app.context.registry.contribution, tracked);
|
|
26542
|
+
const registered = new Set(app.context.registry.contribution.get(DrawItemInterceptor));
|
|
27037
26543
|
contributions.forEach(contribution => {
|
|
27038
|
-
|
|
26544
|
+
if (!registered.has(contribution)) {
|
|
26545
|
+
app.context.registry.contribution.register(DrawItemInterceptor, contribution);
|
|
26546
|
+
registered.add(contribution);
|
|
26547
|
+
}
|
|
26548
|
+
tracked.add(contribution);
|
|
27039
26549
|
});
|
|
27040
26550
|
}
|
|
27041
26551
|
function installRuntimePickersToApp(app, serviceIdentifier) {
|
|
26552
|
+
var _a;
|
|
27042
26553
|
const bindingContext = getRuntimeInstallerBindingContext();
|
|
27043
26554
|
refreshRuntimeInstallerContributions();
|
|
27044
26555
|
const pickers = bindingContext.getAll(serviceIdentifier);
|
|
27045
|
-
app.registry.picker
|
|
27046
|
-
|
|
26556
|
+
const registeredKeys = getTrackedEntryKeys(app.registry.picker, RUNTIME_PICKER_NAMESPACE);
|
|
26557
|
+
clearTrackedEntryKeys(app.registry.picker, RUNTIME_PICKER_NAMESPACE, (_a = app.registry.picker.unregister) === null || _a === void 0 ? void 0 : _a.bind(app.registry.picker));
|
|
26558
|
+
registerRuntimeEntries((key, picker) => {
|
|
26559
|
+
app.registry.picker.register(key, picker);
|
|
26560
|
+
registeredKeys.add(key);
|
|
26561
|
+
}, pickers, RUNTIME_PICKER_NAMESPACE);
|
|
27047
26562
|
}
|
|
27048
26563
|
|
|
27049
26564
|
function simplifyRadialDist(points, sqTolerance) {
|
|
@@ -29400,26 +28915,37 @@ function resolveContainerBinding(container, serviceIdentifier) {
|
|
|
29400
28915
|
return instance;
|
|
29401
28916
|
}
|
|
29402
28917
|
|
|
29403
|
-
|
|
28918
|
+
function isBindingContextLoaded(loadedContexts, context) {
|
|
28919
|
+
const key = (typeof context === 'object' && context !== null) || typeof context === 'function'
|
|
28920
|
+
? context
|
|
28921
|
+
: loadedContexts;
|
|
28922
|
+
if (loadedContexts.has(key)) {
|
|
28923
|
+
return true;
|
|
28924
|
+
}
|
|
28925
|
+
loadedContexts.add(key);
|
|
28926
|
+
return false;
|
|
28927
|
+
}
|
|
28928
|
+
|
|
28929
|
+
const loadedArcModuleContexts = new WeakSet();
|
|
29404
28930
|
function bindArcRenderModule({ bind }) {
|
|
29405
|
-
if (
|
|
28931
|
+
if (isBindingContextLoaded(loadedArcModuleContexts, bind)) {
|
|
29406
28932
|
return;
|
|
29407
28933
|
}
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
|
|
28934
|
+
bind(DefaultCanvasArcRender)
|
|
28935
|
+
.toDynamicValue(({ container }) => new DefaultCanvasArcRender(createContributionProvider(ArcRenderContribution, container)))
|
|
28936
|
+
.inSingletonScope();
|
|
28937
|
+
bind(ArcRender).toService(DefaultCanvasArcRender);
|
|
29411
28938
|
bind(GraphicRender).toService(ArcRender);
|
|
29412
28939
|
bind(ArcRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29413
28940
|
bindContributionProvider(bind, ArcRenderContribution);
|
|
29414
28941
|
}
|
|
29415
28942
|
const arcModule = bindArcRenderModule;
|
|
29416
28943
|
|
|
29417
|
-
|
|
28944
|
+
const loadedRectModuleContexts = new WeakSet();
|
|
29418
28945
|
function bindRectRenderModule({ bind }) {
|
|
29419
|
-
if (
|
|
28946
|
+
if (isBindingContextLoaded(loadedRectModuleContexts, bind)) {
|
|
29420
28947
|
return;
|
|
29421
28948
|
}
|
|
29422
|
-
loadRectModule = true;
|
|
29423
28949
|
bind(DefaultCanvasRectRender)
|
|
29424
28950
|
.toDynamicValue(({ container }) => new DefaultCanvasRectRender(createContributionProvider(RectRenderContribution, container)))
|
|
29425
28951
|
.inSingletonScope();
|
|
@@ -29434,96 +28960,101 @@ function bindRectRenderModule({ bind }) {
|
|
|
29434
28960
|
}
|
|
29435
28961
|
const rectModule = bindRectRenderModule;
|
|
29436
28962
|
|
|
29437
|
-
|
|
28963
|
+
const loadedLineModuleContexts = new WeakSet();
|
|
29438
28964
|
function bindLineRenderModule({ bind }) {
|
|
29439
|
-
if (
|
|
28965
|
+
if (isBindingContextLoaded(loadedLineModuleContexts, bind)) {
|
|
29440
28966
|
return;
|
|
29441
28967
|
}
|
|
29442
|
-
|
|
29443
|
-
|
|
29444
|
-
|
|
29445
|
-
bind(LineRender).
|
|
28968
|
+
bind(DefaultCanvasLineRender)
|
|
28969
|
+
.toDynamicValue(() => new DefaultCanvasLineRender())
|
|
28970
|
+
.inSingletonScope();
|
|
28971
|
+
bind(LineRender).toService(DefaultCanvasLineRender);
|
|
29446
28972
|
bind(GraphicRender).toService(LineRender);
|
|
29447
28973
|
}
|
|
29448
28974
|
const lineModule = bindLineRenderModule;
|
|
29449
28975
|
|
|
29450
|
-
|
|
28976
|
+
const loadedAreaModuleContexts = new WeakSet();
|
|
29451
28977
|
function bindAreaRenderModule({ bind }) {
|
|
29452
|
-
if (
|
|
28978
|
+
if (isBindingContextLoaded(loadedAreaModuleContexts, bind)) {
|
|
29453
28979
|
return;
|
|
29454
28980
|
}
|
|
29455
|
-
|
|
29456
|
-
|
|
29457
|
-
|
|
28981
|
+
bind(DefaultCanvasAreaRender)
|
|
28982
|
+
.toDynamicValue(({ container }) => new DefaultCanvasAreaRender(createContributionProvider(AreaRenderContribution, container)))
|
|
28983
|
+
.inSingletonScope();
|
|
28984
|
+
bind(AreaRender).toService(DefaultCanvasAreaRender);
|
|
29458
28985
|
bind(GraphicRender).toService(AreaRender);
|
|
29459
28986
|
bind(AreaRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29460
28987
|
bindContributionProvider(bind, AreaRenderContribution);
|
|
29461
|
-
bind(DefaultIncrementalCanvasAreaRender).toSelf().inSingletonScope();
|
|
29462
28988
|
}
|
|
29463
28989
|
const areaModule = bindAreaRenderModule;
|
|
29464
28990
|
|
|
29465
|
-
|
|
28991
|
+
const loadedSymbolModuleContexts = new WeakSet();
|
|
29466
28992
|
function bindSymbolRenderModule({ bind }) {
|
|
29467
|
-
if (
|
|
28993
|
+
if (isBindingContextLoaded(loadedSymbolModuleContexts, bind)) {
|
|
29468
28994
|
return;
|
|
29469
28995
|
}
|
|
29470
|
-
|
|
29471
|
-
|
|
29472
|
-
|
|
28996
|
+
bind(DefaultCanvasSymbolRender)
|
|
28997
|
+
.toDynamicValue(({ container }) => new DefaultCanvasSymbolRender(createContributionProvider(SymbolRenderContribution, container)))
|
|
28998
|
+
.inSingletonScope();
|
|
28999
|
+
bind(SymbolRender).toService(DefaultCanvasSymbolRender);
|
|
29473
29000
|
bind(GraphicRender).toService(SymbolRender);
|
|
29474
29001
|
bind(SymbolRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29475
29002
|
bindContributionProvider(bind, SymbolRenderContribution);
|
|
29476
29003
|
}
|
|
29477
29004
|
const symbolModule = bindSymbolRenderModule;
|
|
29478
29005
|
|
|
29479
|
-
|
|
29006
|
+
const loadedCircleModuleContexts = new WeakSet();
|
|
29480
29007
|
function bindCircleRenderModule({ bind }) {
|
|
29481
|
-
if (
|
|
29008
|
+
if (isBindingContextLoaded(loadedCircleModuleContexts, bind)) {
|
|
29482
29009
|
return;
|
|
29483
29010
|
}
|
|
29484
|
-
|
|
29485
|
-
|
|
29486
|
-
|
|
29011
|
+
bind(DefaultCanvasCircleRender)
|
|
29012
|
+
.toDynamicValue(({ container }) => new DefaultCanvasCircleRender(createContributionProvider(CircleRenderContribution, container)))
|
|
29013
|
+
.inSingletonScope();
|
|
29014
|
+
bind(CircleRender).toService(DefaultCanvasCircleRender);
|
|
29487
29015
|
bind(GraphicRender).toService(CircleRender);
|
|
29488
29016
|
bind(CircleRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29489
29017
|
bindContributionProvider(bind, CircleRenderContribution);
|
|
29490
29018
|
}
|
|
29491
29019
|
const circleModule = bindCircleRenderModule;
|
|
29492
29020
|
|
|
29493
|
-
|
|
29021
|
+
const loadedTextModuleContexts = new WeakSet();
|
|
29494
29022
|
function bindTextRenderModule({ bind }) {
|
|
29495
|
-
if (
|
|
29023
|
+
if (isBindingContextLoaded(loadedTextModuleContexts, bind)) {
|
|
29496
29024
|
return;
|
|
29497
29025
|
}
|
|
29498
|
-
|
|
29499
|
-
|
|
29026
|
+
bind(TextRender)
|
|
29027
|
+
.toDynamicValue(({ container }) => new DefaultCanvasTextRender(createContributionProvider(TextRenderContribution, container)))
|
|
29028
|
+
.inSingletonScope();
|
|
29500
29029
|
bind(GraphicRender).toService(TextRender);
|
|
29501
29030
|
bind(TextRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29502
29031
|
bindContributionProvider(bind, TextRenderContribution);
|
|
29503
29032
|
}
|
|
29504
29033
|
const textModule = bindTextRenderModule;
|
|
29505
29034
|
|
|
29506
|
-
|
|
29035
|
+
const loadedPathModuleContexts = new WeakSet();
|
|
29507
29036
|
function bindPathRenderModule({ bind }) {
|
|
29508
|
-
if (
|
|
29037
|
+
if (isBindingContextLoaded(loadedPathModuleContexts, bind)) {
|
|
29509
29038
|
return;
|
|
29510
29039
|
}
|
|
29511
|
-
|
|
29512
|
-
|
|
29513
|
-
|
|
29040
|
+
bind(DefaultCanvasPathRender)
|
|
29041
|
+
.toDynamicValue(({ container }) => new DefaultCanvasPathRender(createContributionProvider(PathRenderContribution, container)))
|
|
29042
|
+
.inSingletonScope();
|
|
29043
|
+
bind(PathRender).toService(DefaultCanvasPathRender);
|
|
29514
29044
|
bind(GraphicRender).toService(PathRender);
|
|
29515
29045
|
bind(PathRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29516
29046
|
bindContributionProvider(bind, PathRenderContribution);
|
|
29517
29047
|
}
|
|
29518
29048
|
const pathModule = bindPathRenderModule;
|
|
29519
29049
|
|
|
29520
|
-
|
|
29050
|
+
const loadedPolygonModuleContexts = new WeakSet();
|
|
29521
29051
|
function bindPolygonRenderModule({ bind }) {
|
|
29522
|
-
if (
|
|
29052
|
+
if (isBindingContextLoaded(loadedPolygonModuleContexts, bind)) {
|
|
29523
29053
|
return;
|
|
29524
29054
|
}
|
|
29525
|
-
|
|
29526
|
-
|
|
29055
|
+
bind(PolygonRender)
|
|
29056
|
+
.toDynamicValue(({ container }) => new DefaultCanvasPolygonRender(createContributionProvider(PolygonRenderContribution, container)))
|
|
29057
|
+
.inSingletonScope();
|
|
29527
29058
|
bind(GraphicRender).toService(PolygonRender);
|
|
29528
29059
|
bind(PolygonRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29529
29060
|
bindContributionProvider(bind, PolygonRenderContribution);
|
|
@@ -29531,12 +29062,12 @@ function bindPolygonRenderModule({ bind }) {
|
|
|
29531
29062
|
const polygonModule = bindPolygonRenderModule;
|
|
29532
29063
|
|
|
29533
29064
|
class DefaultCanvasStarRender extends BaseRender {
|
|
29534
|
-
constructor(
|
|
29065
|
+
constructor(graphicRenderContributions) {
|
|
29535
29066
|
super();
|
|
29536
|
-
this.
|
|
29067
|
+
this.graphicRenderContributions = graphicRenderContributions;
|
|
29537
29068
|
this.numberType = STAR_NUMBER_TYPE;
|
|
29538
29069
|
this.builtinContributions = [defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution];
|
|
29539
|
-
this.init(
|
|
29070
|
+
this.init(graphicRenderContributions);
|
|
29540
29071
|
}
|
|
29541
29072
|
drawShape(star, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
29542
29073
|
const starAttribute = getTheme(star, params === null || params === void 0 ? void 0 : params.theme).star;
|
|
@@ -29599,17 +29130,17 @@ class DefaultCanvasStarRender extends BaseRender {
|
|
|
29599
29130
|
}
|
|
29600
29131
|
}
|
|
29601
29132
|
|
|
29602
|
-
|
|
29133
|
+
const loadedStarModuleContexts = new WeakSet();
|
|
29603
29134
|
function bindStarRenderModule({ bind }) {
|
|
29604
|
-
if (
|
|
29135
|
+
if (isBindingContextLoaded(loadedStarModuleContexts, bind)) {
|
|
29605
29136
|
return;
|
|
29606
29137
|
}
|
|
29607
|
-
loadStarModule = true;
|
|
29608
29138
|
bind(DefaultCanvasStarRender)
|
|
29609
29139
|
.toDynamicValue(({ container }) => new DefaultCanvasStarRender(createContributionProvider(StarRenderContribution, container)))
|
|
29610
29140
|
.inSingletonScope();
|
|
29611
29141
|
bind(StarRender).toService(DefaultCanvasStarRender);
|
|
29612
29142
|
bind(GraphicRender).toService(StarRender);
|
|
29143
|
+
bindContributionProvider(bind, StarRenderContribution);
|
|
29613
29144
|
}
|
|
29614
29145
|
const starModule = bindStarRenderModule;
|
|
29615
29146
|
|
|
@@ -29650,13 +29181,15 @@ class DefaultCanvasGlyphRender {
|
|
|
29650
29181
|
}
|
|
29651
29182
|
}
|
|
29652
29183
|
|
|
29653
|
-
|
|
29184
|
+
const loadedGlyphModuleContexts = new WeakSet();
|
|
29654
29185
|
function bindGlyphRenderModule({ bind }) {
|
|
29655
|
-
if (
|
|
29186
|
+
if (isBindingContextLoaded(loadedGlyphModuleContexts, bind)) {
|
|
29656
29187
|
return;
|
|
29657
29188
|
}
|
|
29658
|
-
|
|
29659
|
-
|
|
29189
|
+
bind(DefaultCanvasGlyphRender)
|
|
29190
|
+
.toDynamicValue(() => new DefaultCanvasGlyphRender())
|
|
29191
|
+
.inSingletonScope();
|
|
29192
|
+
bind(GlyphRender).toService(DefaultCanvasGlyphRender);
|
|
29660
29193
|
bind(GraphicRender).toService(GlyphRender);
|
|
29661
29194
|
}
|
|
29662
29195
|
const glyphModule = bindGlyphRenderModule;
|
|
@@ -29730,24 +29263,27 @@ class DefaultCanvasRichTextRender extends BaseRender {
|
|
|
29730
29263
|
}
|
|
29731
29264
|
}
|
|
29732
29265
|
|
|
29733
|
-
|
|
29266
|
+
const loadedRichtextModuleContexts = new WeakSet();
|
|
29734
29267
|
function bindRichtextRenderModule({ bind }) {
|
|
29735
|
-
if (
|
|
29268
|
+
if (isBindingContextLoaded(loadedRichtextModuleContexts, bind)) {
|
|
29736
29269
|
return;
|
|
29737
29270
|
}
|
|
29738
|
-
|
|
29739
|
-
|
|
29271
|
+
bind(DefaultCanvasRichTextRender)
|
|
29272
|
+
.toDynamicValue(() => new DefaultCanvasRichTextRender())
|
|
29273
|
+
.inSingletonScope();
|
|
29274
|
+
bind(RichTextRender).toService(DefaultCanvasRichTextRender);
|
|
29740
29275
|
bind(GraphicRender).toService(RichTextRender);
|
|
29741
29276
|
}
|
|
29742
29277
|
const richtextModule = bindRichtextRenderModule;
|
|
29743
29278
|
|
|
29744
|
-
|
|
29279
|
+
const loadedImageModuleContexts = new WeakSet();
|
|
29745
29280
|
function bindImageRenderModule({ bind }) {
|
|
29746
|
-
if (
|
|
29281
|
+
if (isBindingContextLoaded(loadedImageModuleContexts, bind)) {
|
|
29747
29282
|
return;
|
|
29748
29283
|
}
|
|
29749
|
-
|
|
29750
|
-
|
|
29284
|
+
bind(ImageRender)
|
|
29285
|
+
.toDynamicValue(({ container }) => new DefaultCanvasImageRender(createContributionProvider(ImageRenderContribution, container)))
|
|
29286
|
+
.inSingletonScope();
|
|
29751
29287
|
bind(GraphicRender).toService(ImageRender);
|
|
29752
29288
|
bind(ImageRenderContribution).toService(DefaultBaseInteractiveRenderContribution);
|
|
29753
29289
|
bindContributionProvider(bind, ImageRenderContribution);
|
|
@@ -29890,13 +29426,15 @@ class DefaultCanvasRect3dRender extends Base3dRender {
|
|
|
29890
29426
|
}
|
|
29891
29427
|
}
|
|
29892
29428
|
|
|
29893
|
-
|
|
29429
|
+
const loadedRect3dModuleContexts = new WeakSet();
|
|
29894
29430
|
function bindRect3dRenderModule({ bind }) {
|
|
29895
|
-
if (
|
|
29431
|
+
if (isBindingContextLoaded(loadedRect3dModuleContexts, bind)) {
|
|
29896
29432
|
return;
|
|
29897
29433
|
}
|
|
29898
|
-
|
|
29899
|
-
|
|
29434
|
+
bind(DefaultCanvasRect3dRender)
|
|
29435
|
+
.toDynamicValue(() => new DefaultCanvasRect3dRender())
|
|
29436
|
+
.inSingletonScope();
|
|
29437
|
+
bind(Rect3DRender).toService(DefaultCanvasRect3dRender);
|
|
29900
29438
|
bind(GraphicRender).toService(Rect3DRender);
|
|
29901
29439
|
}
|
|
29902
29440
|
const rect3dModule = bindRect3dRenderModule;
|
|
@@ -30090,13 +29628,15 @@ class DefaultCanvasArc3DRender extends BaseRender {
|
|
|
30090
29628
|
}
|
|
30091
29629
|
}
|
|
30092
29630
|
|
|
30093
|
-
|
|
29631
|
+
const loadedArc3dModuleContexts = new WeakSet();
|
|
30094
29632
|
function bindArc3dRenderModule({ bind }) {
|
|
30095
|
-
if (
|
|
29633
|
+
if (isBindingContextLoaded(loadedArc3dModuleContexts, bind)) {
|
|
30096
29634
|
return;
|
|
30097
29635
|
}
|
|
30098
|
-
|
|
30099
|
-
|
|
29636
|
+
bind(DefaultCanvasArc3DRender)
|
|
29637
|
+
.toDynamicValue(() => new DefaultCanvasArc3DRender())
|
|
29638
|
+
.inSingletonScope();
|
|
29639
|
+
bind(Arc3dRender).toService(DefaultCanvasArc3DRender);
|
|
30100
29640
|
bind(GraphicRender).toService(Arc3dRender);
|
|
30101
29641
|
}
|
|
30102
29642
|
const arc3dModule = bindArc3dRenderModule;
|
|
@@ -30137,13 +29677,15 @@ class DefaultCanvasPyramid3dRender extends Base3dRender {
|
|
|
30137
29677
|
}
|
|
30138
29678
|
}
|
|
30139
29679
|
|
|
30140
|
-
|
|
29680
|
+
const loadedPyramid3dModuleContexts = new WeakSet();
|
|
30141
29681
|
function bindPyramid3dRenderModule({ bind }) {
|
|
30142
|
-
if (
|
|
29682
|
+
if (isBindingContextLoaded(loadedPyramid3dModuleContexts, bind)) {
|
|
30143
29683
|
return;
|
|
30144
29684
|
}
|
|
30145
|
-
|
|
30146
|
-
|
|
29685
|
+
bind(DefaultCanvasPyramid3dRender)
|
|
29686
|
+
.toDynamicValue(() => new DefaultCanvasPyramid3dRender())
|
|
29687
|
+
.inSingletonScope();
|
|
29688
|
+
bind(Pyramid3dRender).toService(DefaultCanvasPyramid3dRender);
|
|
30147
29689
|
bind(GraphicRender).toService(Pyramid3dRender);
|
|
30148
29690
|
}
|
|
30149
29691
|
const pyramid3dModule = bindPyramid3dRenderModule;
|
|
@@ -31035,7 +30577,10 @@ class FlexLayoutPlugin {
|
|
|
31035
30577
|
this.tryLayout(graphic, false);
|
|
31036
30578
|
}
|
|
31037
30579
|
});
|
|
31038
|
-
stage.graphicService.hooks.onSetStage.tap(this.key, graphic => {
|
|
30580
|
+
stage.graphicService.hooks.onSetStage.tap(this.key, (graphic, nextStage) => {
|
|
30581
|
+
if (!(nextStage && nextStage === this.pluginService.stage)) {
|
|
30582
|
+
return;
|
|
30583
|
+
}
|
|
31039
30584
|
if (graphic.glyphHost) {
|
|
31040
30585
|
graphic = graphic.glyphHost;
|
|
31041
30586
|
}
|
|
@@ -31070,4 +30615,4 @@ const registerFlexLayoutPlugin = () => {
|
|
|
31070
30615
|
Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);
|
|
31071
30616
|
};
|
|
31072
30617
|
|
|
31073
|
-
export { ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, AnimateMode, AnimateStatus, AnimateStepType, AppContext, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEntry, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, Circle, CircleRender, CircleRenderContribution, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Context2dFactory, ContributionProvider, ContributionRegistry, ContributionStore, CubicBezierCurve, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseClipRenderAfterContribution, DefaultBaseClipRenderBeforeContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStarAttribute, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, GradientParser, Graphic, GraphicCreator$1 as GraphicCreator, GraphicFactory, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncrementalDrawContribution, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerFactory, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, Mat4Allocate, MatrixAllocate, MeasureModeEnum, MiniappEntry, MonotoneX, MonotoneY, NOWORK_ANIMATE_ATTR, Node, NodeEntry, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PerformanceRAF, PickItemInterceptor, PickServiceInterceptor, PickerRegistry, PickerService, PluginRegistry, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, RendererRegistry, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, STAR_NUMBER_TYPE, STATUS$1 as STATUS, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StageFactory, Star, StarRender, StarRenderContribution, StateDefinitionCompiler, StateEngine, StaticLayerHandlerContribution, Step, StepClosed, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindArc3dRenderModule, bindArcRenderModule, bindAreaRenderModule, bindCircleRenderModule, bindContributionProvider, bindContributionProviderNoSingletonScope, bindGlyphRenderModule, bindImageRenderModule, bindLineRenderModule, bindPathRenderModule, bindPolygonRenderModule, bindPyramid3dRenderModule, bindRect3dRenderModule, bindRectRenderModule, bindRichtextRenderModule, bindStarRenderModule, bindSymbolRenderModule, bindTextRenderModule, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, colorEqual, colorStringInterpolationToStr, configureRuntimeApplicationForApp, container, cornerTangents, createBrowserApp as createApp, createArc, createArc3d, createArea, createBrowserApp, createCanvasEventTransformer, createCircle, createColor, createConicalGradient, createContributionProvider, createEventTransformer, createGlyph, createGraphic, createGroup, createImage, createLine, createMat4, createMiniappApp, createNodeApp, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createStar, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, diff, divideCubic, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawBackgroundImage, drawImageWithLayout, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepClosedSegments, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getBackgroundImage, getConicGradientAt, getCurrentEnv, getDefaultCharacterConfig, getExtraModelMatrix, getLegacyBindingContext, getModelMatrix, getRichTextBounds, getRuntimeInstallerBindingContext, getRuntimeInstallerGlobal, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, installRuntimeDrawContributionsToApp, installRuntimeGraphicRenderersToApp, installRuntimePickersToApp, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, interpolatePureColorArrayToStr, intersect, isBrowserEnv, isNoRepeatSizingMode, isNodeEnv, isSvg, isXML, layerService, lineModule, lookAt, mapToCanvasPointForCanvas, mat3Tomat4, mat4Allocate, matrixAllocate, multiplyMat4Mat3, multiplyMat4Mat4, newThemeObj, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, refreshRuntimeInstallerContributions, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlobalEventTransformer, registerGlyphGraphic, registerGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerStarGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWindowEventTransformer, registerWrapTextGraphic, renderCommandList, resolveBackgroundDrawMode, resolveBackgroundParamsByImageSizing, resolveBackgroundPosition, resolveBackgroundSizing, resolveContainerBinding, resolveImageMode, resolveImageRepeatMode, resolveRenderableImageSize, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldClipImageByLayout, shouldUseMat4, shouldUseSimpleAttributeFastPath, snapLength, splitArc, splitArea, splitCircle, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, starModule, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformMat4, transformPointForCanvas, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
30618
|
+
export { ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, AnimateMode, AnimateStatus, AnimateStepType, AppContext, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEntry, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, Circle, CircleRender, CircleRenderContribution, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Context2dFactory, ContributionProvider, ContributionRegistry, ContributionStore, CubicBezierCurve, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseClipRenderAfterContribution, DefaultBaseClipRenderBeforeContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStarAttribute, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, GradientParser, Graphic, GraphicCreator$1 as GraphicCreator, GraphicFactory, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncrementalDrawContribution, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerFactory, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, Mat4Allocate, MatrixAllocate, MeasureModeEnum, MiniappEntry, MonotoneX, MonotoneY, NOWORK_ANIMATE_ATTR, Node, NodeEntry, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PerformanceRAF, PickItemInterceptor, PickServiceInterceptor, PickerRegistry, PickerService, PluginRegistry, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, RendererRegistry, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, STAR_NUMBER_TYPE, STATUS$1 as STATUS, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StageFactory, Star, StarRender, StarRenderContribution, StateDefinitionCompiler, StateEngine, StaticLayerHandlerContribution, Step, StepClosed, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindArc3dRenderModule, bindArcRenderModule, bindAreaRenderModule, bindCircleRenderModule, bindContributionProvider, bindContributionProviderNoSingletonScope, bindGlyphRenderModule, bindImageRenderModule, bindLineRenderModule, bindPathRenderModule, bindPolygonRenderModule, bindPyramid3dRenderModule, bindRect3dRenderModule, bindRectRenderModule, bindRichtextRenderModule, bindStarRenderModule, bindSymbolRenderModule, bindTextRenderModule, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, colorEqual, colorStringInterpolationToStr, configureRuntimeApplicationForApp, container, cornerTangents, createBrowserApp as createApp, createArc, createArc3d, createArea, createBrowserApp, createCanvasEventTransformer, createCircle, createColor, createConicalGradient, createContributionProvider, createEventTransformer, createGlyph, createGraphic, createGroup, createImage, createLine, createMat4, createMiniappApp, createNodeApp, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createStar, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, diff, divideCubic, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawBackgroundImage, drawImageWithLayout, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepClosedSegments, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getBackgroundImage, getConicGradientAt, getCurrentEnv, getDefaultCharacterConfig, getExtraModelMatrix, getLegacyBindingContext, getModelMatrix, getRichTextBounds, getRuntimeInstallerBindingContext, getRuntimeInstallerGlobal, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, installRuntimeDrawContributionsToApp, installRuntimeGraphicRenderersToApp, installRuntimePickersToApp, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, interpolatePureColorArrayToStr, intersect, isBrowserEnv, isNoRepeatSizingMode, isNodeEnv, isSvg, isXML, layerService, lineModule, lookAt, mapToCanvasPointForCanvas, mat3Tomat4, mat4Allocate, matrixAllocate, multiplyMat4Mat3, multiplyMat4Mat4, newThemeObj, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, refreshRuntimeInstallerContributions, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlobalEventTransformer, registerGlyphGraphic, registerGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerStarGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWindowEventTransformer, registerWrapTextGraphic, renderCommandList, resolveBackgroundDrawMode, resolveBackgroundParamsByImageSizing, resolveBackgroundPosition, resolveBackgroundSizing, resolveContainerBinding, resolveImageMode, resolveImageRepeatMode, resolveRenderableImageSize, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldClipImageByLayout, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, starModule, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformMat4, transformPointForCanvas, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|