@visactor/vrender-core 1.1.0-alpha.0 → 1.1.0-alpha.10
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/canvas-allocate.js +5 -7
- package/cjs/allocator/canvas-allocate.js.map +1 -1
- package/cjs/allocator/graphic-allocate.js +17 -17
- package/cjs/allocator/graphic-allocate.js.map +1 -1
- package/cjs/application.d.ts +19 -18
- package/cjs/application.js +1 -31
- package/cjs/application.js.map +1 -1
- package/cjs/canvas/conical-gradient.js +2 -2
- package/cjs/canvas/conical-gradient.js.map +1 -1
- package/cjs/canvas/constants.js +2 -1
- package/cjs/canvas/contributions/base-canvas.js +2 -2
- package/cjs/canvas/contributions/base-canvas.js.map +1 -1
- package/cjs/canvas/util.d.ts +2 -3
- package/cjs/canvas/util.js +17 -7
- package/cjs/canvas/util.js.map +1 -1
- package/cjs/color-string/index.js +1 -2
- package/cjs/common/contribution-provider.d.ts +27 -0
- package/cjs/common/contribution-provider.js +51 -0
- package/cjs/common/contribution-provider.js.map +1 -0
- package/cjs/common/diff.js +1 -2
- package/cjs/common/enums.d.ts +2 -0
- package/cjs/common/enums.js +3 -1
- package/cjs/common/enums.js.map +1 -1
- package/cjs/common/event-listener-manager.d.ts +18 -1
- package/cjs/common/event-listener-manager.js +40 -10
- package/cjs/common/event-listener-manager.js.map +1 -1
- package/cjs/common/event-transformer.js +41 -5
- package/cjs/common/event-transformer.js.map +1 -1
- package/cjs/common/explicit-binding.d.ts +5 -0
- package/cjs/common/explicit-binding.js +16 -0
- package/cjs/common/explicit-binding.js.map +1 -0
- package/cjs/common/performance-raf.d.ts +1 -0
- package/cjs/common/performance-raf.js +7 -2
- package/cjs/common/performance-raf.js.map +1 -1
- package/cjs/common/seg-context.js +1 -2
- package/cjs/common/sort.js +2 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/contributions/env/modules.d.ts +4 -0
- package/cjs/core/contributions/env/modules.js +14 -0
- package/cjs/core/contributions/env/modules.js.map +1 -0
- package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
- package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
- package/cjs/core/contributions/layerHandler/empty-contribution.js +2 -2
- package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
- package/cjs/core/contributions/layerHandler/modules.d.ts +4 -0
- package/cjs/core/contributions/layerHandler/modules.js +14 -0
- package/cjs/core/contributions/layerHandler/modules.js.map +1 -0
- package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
- package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
- package/cjs/core/contributions/modules.d.ts +2 -1
- package/cjs/core/contributions/modules.js +20 -2
- package/cjs/core/contributions/modules.js.map +1 -1
- package/cjs/core/contributions/textMeasure/modules.d.ts +4 -0
- package/cjs/core/contributions/textMeasure/modules.js +15 -0
- package/cjs/core/contributions/textMeasure/modules.js.map +1 -0
- package/cjs/core/core-modules.d.ts +4 -0
- package/cjs/core/core-modules.js +19 -0
- package/cjs/core/core-modules.js.map +1 -0
- package/cjs/core/global-module.d.ts +1 -0
- package/cjs/core/global-module.js +3 -0
- package/cjs/core/global-module.js.map +1 -0
- package/cjs/core/global.d.ts +4 -2
- package/cjs/core/global.js +8 -5
- package/cjs/core/global.js.map +1 -1
- package/cjs/core/graphic-utils.d.ts +3 -4
- package/cjs/core/graphic-utils.js +4 -5
- package/cjs/core/graphic-utils.js.map +1 -1
- package/cjs/core/layer-service.d.ts +7 -2
- package/cjs/core/layer-service.js +23 -13
- package/cjs/core/layer-service.js.map +1 -1
- package/cjs/core/layer.d.ts +1 -1
- package/cjs/core/layer.js +3 -3
- package/cjs/core/layer.js.map +1 -1
- package/cjs/core/stage.d.ts +17 -3
- package/cjs/core/stage.js +47 -25
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.d.ts +7 -5
- package/cjs/core/window.js +11 -7
- package/cjs/core/window.js.map +1 -1
- package/cjs/create.d.ts +1 -2
- package/cjs/create.js +2 -2
- package/cjs/create.js.map +1 -1
- package/cjs/entries/app-context.d.ts +30 -0
- package/cjs/entries/app-context.js +84 -0
- package/cjs/entries/app-context.js.map +1 -0
- package/cjs/entries/browser.d.ts +25 -0
- package/cjs/entries/browser.js +44 -0
- package/cjs/entries/browser.js.map +1 -0
- package/cjs/entries/index.d.ts +7 -0
- package/cjs/entries/index.js +32 -0
- package/cjs/entries/index.js.map +1 -0
- package/cjs/entries/miniapp.d.ts +6 -0
- package/cjs/entries/miniapp.js +20 -0
- package/cjs/entries/miniapp.js.map +1 -0
- package/cjs/entries/node.d.ts +6 -0
- package/cjs/entries/node.js +20 -0
- package/cjs/entries/node.js.map +1 -0
- package/cjs/entries/runtime-installer.d.ts +11 -0
- package/cjs/entries/runtime-installer.js +111 -0
- package/cjs/entries/runtime-installer.js.map +1 -0
- package/cjs/entries/types.d.ts +29 -0
- package/cjs/entries/types.js.map +1 -0
- package/cjs/env-check.js +3 -3
- package/cjs/env-check.js.map +1 -1
- package/cjs/event/event-manager.js +4 -1
- package/cjs/event/event-manager.js.map +1 -1
- package/cjs/event/util.d.ts +1 -1
- package/cjs/factory/graphic-factory.d.ts +7 -0
- package/cjs/factory/graphic-factory.js +23 -0
- package/cjs/factory/graphic-factory.js.map +1 -0
- package/cjs/factory/index.d.ts +4 -0
- package/cjs/factory/index.js +22 -0
- package/cjs/factory/index.js.map +1 -0
- package/cjs/factory/layer-factory.d.ts +7 -0
- package/cjs/factory/layer-factory.js +19 -0
- package/cjs/factory/layer-factory.js.map +1 -0
- package/cjs/factory/stage-factory.d.ts +8 -0
- package/cjs/factory/stage-factory.js +20 -0
- package/cjs/factory/stage-factory.js.map +1 -0
- package/cjs/factory/types.d.ts +34 -0
- package/cjs/factory/types.js +6 -0
- package/cjs/factory/types.js.map +1 -0
- package/cjs/factory.d.ts +1 -0
- package/cjs/factory.js +16 -1
- package/cjs/factory.js.map +1 -1
- package/cjs/global.d.ts +2 -0
- package/cjs/global.js +11 -0
- package/cjs/global.js.map +1 -0
- package/cjs/graphic/arc.js +3 -3
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/arc3d.js +3 -3
- package/cjs/graphic/arc3d.js.map +1 -1
- package/cjs/graphic/area.js +3 -3
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/bounds.js +3 -3
- package/cjs/graphic/bounds.js.map +1 -1
- package/cjs/graphic/circle.js +3 -3
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +7 -1
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/glyph.js +9 -3
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-creator.d.ts +9 -4
- package/cjs/graphic/graphic-creator.js +35 -7
- package/cjs/graphic/graphic-creator.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-module.d.ts +4 -0
- package/cjs/graphic/graphic-service/graphic-module.js +14 -0
- package/cjs/graphic/graphic-service/graphic-module.js.map +1 -0
- package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -3
- package/cjs/graphic/graphic-service/graphic-service.js +3 -4
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +81 -7
- package/cjs/graphic/graphic.js +517 -146
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +11 -1
- package/cjs/graphic/group.js +49 -13
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.d.ts +1 -0
- package/cjs/graphic/image.js +4 -3
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/index.d.ts +3 -0
- package/cjs/graphic/index.js +34 -15
- package/cjs/graphic/index.js.map +1 -1
- package/cjs/graphic/line.js +3 -3
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/path.js +3 -3
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.js +3 -3
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/pyramid3d.js +3 -2
- package/cjs/graphic/pyramid3d.js.map +1 -1
- package/cjs/graphic/rect.d.ts +2 -0
- package/cjs/graphic/rect.js +47 -3
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +3 -3
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext.js +4 -4
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/star.js +3 -3
- package/cjs/graphic/star.js.map +1 -1
- package/cjs/graphic/state/attribute-update-classifier.d.ts +13 -0
- package/cjs/graphic/state/attribute-update-classifier.js +67 -0
- package/cjs/graphic/state/attribute-update-classifier.js.map +1 -0
- package/cjs/graphic/state/shared-state-refresh.d.ts +6 -0
- package/cjs/graphic/state/shared-state-refresh.js +55 -0
- package/cjs/graphic/state/shared-state-refresh.js.map +1 -0
- package/cjs/graphic/state/shared-state-scope.d.ts +25 -0
- package/cjs/graphic/state/shared-state-scope.js +98 -0
- package/cjs/graphic/state/shared-state-scope.js.map +1 -0
- package/cjs/graphic/state/state-batch-scheduler.d.ts +42 -0
- package/cjs/graphic/state/state-batch-scheduler.js +285 -0
- package/cjs/graphic/state/state-batch-scheduler.js.map +1 -0
- package/cjs/graphic/state/state-definition-compiler.d.ts +6 -0
- package/cjs/graphic/state/state-definition-compiler.js +91 -0
- package/cjs/graphic/state/state-definition-compiler.js.map +1 -0
- package/cjs/graphic/state/state-definition.d.ts +44 -0
- package/cjs/graphic/state/state-definition.js +6 -0
- package/cjs/graphic/state/state-definition.js.map +1 -0
- package/cjs/graphic/state/state-engine.d.ts +38 -0
- package/cjs/graphic/state/state-engine.js +220 -0
- package/cjs/graphic/state/state-engine.js.map +1 -0
- package/cjs/graphic/state/state-model.d.ts +43 -0
- package/cjs/graphic/state/state-model.js +143 -0
- package/cjs/graphic/state/state-model.js.map +1 -0
- package/cjs/graphic/state/state-perf-monitor.d.ts +119 -0
- package/cjs/graphic/state/state-perf-monitor.js +217 -0
- package/cjs/graphic/state/state-perf-monitor.js.map +1 -0
- package/cjs/graphic/state/state-style-resolver.d.ts +22 -0
- package/cjs/graphic/state/state-style-resolver.js +73 -0
- package/cjs/graphic/state/state-style-resolver.js.map +1 -0
- package/cjs/graphic/state/state-transition-orchestrator.d.ts +46 -0
- package/cjs/graphic/state/state-transition-orchestrator.js +86 -0
- package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -0
- package/cjs/graphic/symbol.js +3 -3
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.d.ts +3 -2
- package/cjs/graphic/text.js +29 -20
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.d.ts +5 -0
- package/cjs/graphic/theme.js +7 -0
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/graphic/tools.js +2 -2
- package/cjs/graphic/tools.js.map +1 -1
- package/cjs/graphic/wrap-text.d.ts +1 -1
- package/cjs/graphic/wrap-text.js +18 -15
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/index.d.ts +26 -4
- package/cjs/index.js +83 -45
- package/cjs/index.js.map +1 -1
- package/cjs/interface/canvas.d.ts +1 -1
- package/cjs/interface/canvas.js.map +1 -1
- package/cjs/interface/global.d.ts +2 -0
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/graphic/group.d.ts +6 -0
- package/cjs/interface/graphic/group.js.map +1 -1
- package/cjs/interface/graphic/image.d.ts +7 -1
- package/cjs/interface/graphic/image.js.map +1 -1
- package/cjs/interface/graphic/theme.d.ts +3 -0
- package/cjs/interface/graphic/theme.js.map +1 -1
- package/cjs/interface/graphic.d.ts +34 -5
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/layer.d.ts +3 -2
- package/cjs/interface/layer.js.map +1 -1
- package/cjs/interface/plugin.d.ts +2 -0
- package/cjs/interface/plugin.js.map +1 -1
- package/cjs/interface/render.d.ts +1 -1
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +9 -0
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/interface/theme-service.js.map +1 -1
- package/cjs/legacy/binding-context.d.ts +24 -0
- package/cjs/legacy/binding-context.js +98 -0
- package/cjs/legacy/binding-context.js.map +1 -0
- package/cjs/legacy/bootstrap.d.ts +10 -0
- package/cjs/legacy/bootstrap.js +72 -0
- package/cjs/legacy/bootstrap.js.map +1 -0
- package/cjs/legacy/module-types.d.ts +2 -0
- package/cjs/legacy/module-types.js +6 -0
- package/cjs/legacy/module-types.js.map +1 -0
- package/cjs/modules.d.ts +5 -6
- package/cjs/modules.js +54 -9
- package/cjs/modules.js.map +1 -1
- package/cjs/picker/global-picker-service.js +2 -2
- package/cjs/picker/global-picker-service.js.map +1 -1
- package/cjs/picker/pick-modules.d.ts +5 -0
- package/cjs/picker/pick-modules.js +24 -0
- package/cjs/picker/pick-modules.js.map +1 -0
- package/cjs/picker/picker-service.d.ts +13 -4
- package/cjs/picker/picker-service.js +15 -8
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/base-plugin.d.ts +8 -0
- package/cjs/plugins/base-plugin.js +15 -0
- package/cjs/plugins/base-plugin.js.map +1 -0
- package/cjs/plugins/browser-env-plugin.d.ts +8 -0
- package/cjs/plugins/browser-env-plugin.js +24 -0
- package/cjs/plugins/browser-env-plugin.js.map +1 -0
- package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +6 -5
- package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +25 -4
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/edit-module.js +4 -3
- package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +8 -8
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +2 -2
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +3 -3
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +13 -9
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/cjs/plugins/index.d.ts +5 -0
- package/cjs/plugins/index.js +23 -0
- package/cjs/plugins/index.js.map +1 -0
- package/cjs/plugins/picker-plugin.d.ts +7 -0
- package/cjs/plugins/picker-plugin.js +19 -0
- package/cjs/plugins/picker-plugin.js.map +1 -0
- package/cjs/plugins/plugin-modules.d.ts +4 -0
- package/cjs/plugins/plugin-modules.js +14 -0
- package/cjs/plugins/plugin-modules.js.map +1 -0
- package/cjs/plugins/plugin-service.d.ts +16 -2
- package/cjs/plugins/plugin-service.js +23 -11
- package/cjs/plugins/plugin-service.js.map +1 -1
- package/cjs/plugins/renderer-plugin.d.ts +7 -0
- package/cjs/plugins/renderer-plugin.js +19 -0
- package/cjs/plugins/renderer-plugin.js.map +1 -0
- package/cjs/plugins/types.d.ts +28 -0
- package/cjs/plugins/types.js +6 -0
- package/cjs/plugins/types.js.map +1 -0
- package/cjs/register/register-arc.js +1 -1
- package/cjs/register/register-arc.js.map +1 -1
- package/cjs/register/register-arc3d.js +1 -1
- package/cjs/register/register-arc3d.js.map +1 -1
- package/cjs/register/register-area.js +1 -1
- package/cjs/register/register-area.js.map +1 -1
- package/cjs/register/register-circle.js +1 -1
- package/cjs/register/register-circle.js.map +1 -1
- package/cjs/register/register-glyph.js +1 -1
- package/cjs/register/register-glyph.js.map +1 -1
- package/cjs/register/register-group.js +1 -1
- package/cjs/register/register-group.js.map +1 -1
- package/cjs/register/register-image.js +1 -1
- package/cjs/register/register-image.js.map +1 -1
- package/cjs/register/register-line.js +1 -1
- package/cjs/register/register-line.js.map +1 -1
- package/cjs/register/register-path.js +1 -1
- package/cjs/register/register-path.js.map +1 -1
- package/cjs/register/register-polygon.js +1 -1
- package/cjs/register/register-polygon.js.map +1 -1
- package/cjs/register/register-pyramid3d.js +1 -1
- package/cjs/register/register-pyramid3d.js.map +1 -1
- package/cjs/register/register-rect.js +1 -1
- package/cjs/register/register-rect.js.map +1 -1
- package/cjs/register/register-rect3d.js +1 -1
- package/cjs/register/register-rect3d.js.map +1 -1
- package/cjs/register/register-richtext.js +1 -1
- package/cjs/register/register-richtext.js.map +1 -1
- package/cjs/register/register-shadowRoot.js +1 -1
- package/cjs/register/register-shadowRoot.js.map +1 -1
- package/cjs/register/register-star.js +1 -1
- package/cjs/register/register-star.js.map +1 -1
- package/cjs/register/register-symbol.js +1 -1
- package/cjs/register/register-symbol.js.map +1 -1
- package/cjs/register/register-text.js +1 -1
- package/cjs/register/register-text.js.map +1 -1
- package/cjs/register/register-wraptext.js +1 -1
- package/cjs/register/register-wraptext.js.map +1 -1
- package/cjs/registry/contribution-registry.d.ts +9 -0
- package/cjs/registry/contribution-registry.js +33 -0
- package/cjs/registry/contribution-registry.js.map +1 -0
- package/cjs/registry/index.d.ts +5 -0
- package/cjs/registry/index.js +23 -0
- package/cjs/registry/index.js.map +1 -0
- package/cjs/registry/picker-registry.d.ts +10 -0
- package/cjs/registry/picker-registry.js +29 -0
- package/cjs/registry/picker-registry.js.map +1 -0
- package/cjs/registry/plugin-registry.d.ts +10 -0
- package/cjs/registry/plugin-registry.js +29 -0
- package/cjs/registry/plugin-registry.js.map +1 -0
- package/cjs/registry/renderer-registry.d.ts +11 -0
- package/cjs/registry/renderer-registry.js +37 -0
- package/cjs/registry/renderer-registry.js.map +1 -0
- package/cjs/registry/types.d.ts +34 -0
- package/cjs/registry/types.js +6 -0
- package/cjs/registry/types.js.map +1 -0
- package/cjs/render/contributions/modules.d.ts +2 -0
- package/cjs/render/contributions/modules.js +22 -0
- package/cjs/render/contributions/modules.js.map +1 -0
- package/cjs/render/contributions/render/arc-module.d.ts +4 -0
- package/cjs/render/contributions/render/arc-module.js +19 -0
- package/cjs/render/contributions/render/arc-module.js.map +1 -0
- package/cjs/render/contributions/render/arc-render.d.ts +2 -2
- package/cjs/render/contributions/render/arc-render.js +4 -5
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/arc3d-module.d.ts +4 -0
- package/cjs/render/contributions/render/arc3d-module.js +17 -0
- package/cjs/render/contributions/render/arc3d-module.js.map +1 -0
- package/cjs/render/contributions/render/area-module.d.ts +4 -0
- package/cjs/render/contributions/render/area-module.js +20 -0
- package/cjs/render/contributions/render/area-module.js.map +1 -0
- package/cjs/render/contributions/render/area-render.d.ts +2 -2
- package/cjs/render/contributions/render/area-render.js +4 -5
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-render.js +1 -1
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/circle-module.d.ts +4 -0
- package/cjs/render/contributions/render/circle-module.js +19 -0
- package/cjs/render/contributions/render/circle-module.js.map +1 -0
- package/cjs/render/contributions/render/circle-render.d.ts +2 -2
- package/cjs/render/contributions/render/circle-render.js +4 -5
- package/cjs/render/contributions/render/circle-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +29 -11
- package/cjs/render/contributions/render/contributions/base-contribution-render.js +150 -39
- package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +4 -2
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +84 -31
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/group-contribution-render.js +8 -6
- package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +2 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js +20 -16
- package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.d.ts +13 -4
- package/cjs/render/contributions/render/draw-contribution.js +37 -13
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +2 -3
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/glyph-module.d.ts +4 -0
- package/cjs/render/contributions/render/glyph-module.js +17 -0
- package/cjs/render/contributions/render/glyph-module.js.map +1 -0
- package/cjs/render/contributions/render/group-render.d.ts +2 -2
- package/cjs/render/contributions/render/group-render.js +3 -5
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/image-module.d.ts +4 -0
- package/cjs/render/contributions/render/image-module.js +18 -0
- package/cjs/render/contributions/render/image-module.js.map +1 -0
- package/cjs/render/contributions/render/image-render.d.ts +16 -3
- package/cjs/render/contributions/render/image-render.js +101 -24
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +5 -3
- package/cjs/render/contributions/render/incremental-draw-contribution.js +5 -7
- package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/index.d.ts +4 -12
- package/cjs/render/contributions/render/index.js +7 -11
- package/cjs/render/contributions/render/index.js.map +1 -1
- package/cjs/render/contributions/render/line-module.d.ts +4 -0
- package/cjs/render/contributions/render/line-module.js +19 -0
- package/cjs/render/contributions/render/line-module.js.map +1 -0
- package/cjs/render/contributions/render/module.d.ts +4 -0
- package/cjs/render/contributions/render/module.js +27 -0
- package/cjs/render/contributions/render/module.js.map +1 -0
- package/cjs/render/contributions/render/path-module.d.ts +4 -0
- package/cjs/render/contributions/render/path-module.js +19 -0
- package/cjs/render/contributions/render/path-module.js.map +1 -0
- package/cjs/render/contributions/render/path-render.d.ts +2 -2
- package/cjs/render/contributions/render/path-render.js +4 -5
- package/cjs/render/contributions/render/path-render.js.map +1 -1
- package/cjs/render/contributions/render/polygon-module.d.ts +4 -0
- package/cjs/render/contributions/render/polygon-module.js +18 -0
- package/cjs/render/contributions/render/polygon-module.js.map +1 -0
- package/cjs/render/contributions/render/polygon-render.d.ts +2 -2
- package/cjs/render/contributions/render/polygon-render.js +4 -5
- package/cjs/render/contributions/render/polygon-render.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-module.d.ts +4 -0
- package/cjs/render/contributions/render/pyramid3d-module.js +17 -0
- package/cjs/render/contributions/render/pyramid3d-module.js.map +1 -0
- package/cjs/render/contributions/render/rect-module.d.ts +4 -0
- package/cjs/render/contributions/render/rect-module.js +23 -0
- package/cjs/render/contributions/render/rect-module.js.map +1 -0
- package/cjs/render/contributions/render/rect-render.d.ts +2 -2
- package/cjs/render/contributions/render/rect-render.js +4 -5
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/rect3d-module.d.ts +4 -0
- package/cjs/render/contributions/render/rect3d-module.js +17 -0
- package/cjs/render/contributions/render/rect3d-module.js.map +1 -0
- package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
- package/cjs/render/contributions/render/render-slector.js.map +1 -1
- package/cjs/render/contributions/render/richtext-module.d.ts +4 -0
- package/cjs/render/contributions/render/richtext-module.js +17 -0
- package/cjs/render/contributions/render/richtext-module.js.map +1 -0
- package/cjs/render/contributions/render/star-module.d.ts +4 -0
- package/cjs/render/contributions/render/star-module.js +18 -0
- package/cjs/render/contributions/render/star-module.js.map +1 -0
- package/cjs/render/contributions/render/star-render.d.ts +2 -2
- package/cjs/render/contributions/render/star-render.js +4 -5
- package/cjs/render/contributions/render/star-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-module.d.ts +4 -0
- package/cjs/render/contributions/render/symbol-module.js +19 -0
- package/cjs/render/contributions/render/symbol-module.js.map +1 -0
- package/cjs/render/contributions/render/symbol-render.d.ts +2 -2
- package/cjs/render/contributions/render/symbol-render.js +4 -5
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol.d.ts +0 -2
- package/cjs/render/contributions/render/symbol.js +1 -3
- package/cjs/render/contributions/render/symbol.js.map +1 -1
- package/cjs/render/contributions/render/text-module.d.ts +4 -0
- package/cjs/render/contributions/render/text-module.js +18 -0
- package/cjs/render/contributions/render/text-module.js.map +1 -0
- package/cjs/render/contributions/render/text-render.d.ts +2 -2
- package/cjs/render/contributions/render/text-render.js +4 -5
- package/cjs/render/contributions/render/text-render.js.map +1 -1
- package/cjs/render/render-modules.d.ts +4 -0
- package/cjs/render/render-modules.js +14 -0
- package/cjs/render/render-modules.js.map +1 -0
- package/cjs/render/render-service.d.ts +1 -1
- package/cjs/render/render-service.js +3 -1
- package/cjs/render/render-service.js.map +1 -1
- package/cjs/resource-loader/loader.js +6 -6
- package/cjs/resource-loader/loader.js.map +1 -1
- package/dist/index.es.js +23943 -20059
- package/es/allocator/canvas-allocate.js +6 -8
- package/es/allocator/canvas-allocate.js.map +1 -1
- package/es/allocator/graphic-allocate.js +17 -17
- package/es/allocator/graphic-allocate.js.map +1 -1
- package/es/application.d.ts +19 -18
- package/es/application.js +1 -39
- package/es/application.js.map +1 -1
- package/es/canvas/conical-gradient.js +2 -2
- package/es/canvas/conical-gradient.js.map +1 -1
- package/es/canvas/constants.js +2 -1
- package/es/canvas/contributions/base-canvas.js +2 -2
- package/es/canvas/contributions/base-canvas.js.map +1 -1
- package/es/canvas/util.d.ts +2 -3
- package/es/canvas/util.js +16 -8
- package/es/canvas/util.js.map +1 -1
- package/es/color-string/index.js +1 -2
- package/es/common/contribution-provider.d.ts +27 -0
- package/es/common/contribution-provider.js +43 -0
- package/es/common/contribution-provider.js.map +1 -0
- package/es/common/diff.js +1 -2
- package/es/common/enums.d.ts +2 -0
- package/es/common/enums.js +3 -1
- package/es/common/enums.js.map +1 -1
- package/es/common/event-listener-manager.d.ts +18 -1
- package/es/common/event-listener-manager.js +40 -10
- package/es/common/event-listener-manager.js.map +1 -1
- package/es/common/event-transformer.js +41 -5
- package/es/common/event-transformer.js.map +1 -1
- package/es/common/explicit-binding.d.ts +5 -0
- package/es/common/explicit-binding.js +10 -0
- package/es/common/explicit-binding.js.map +1 -0
- package/es/common/performance-raf.d.ts +1 -0
- package/es/common/performance-raf.js +7 -2
- package/es/common/performance-raf.js.map +1 -1
- package/es/common/seg-context.js +1 -2
- package/es/common/sort.js +2 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/contributions/env/modules.d.ts +4 -0
- package/es/core/contributions/env/modules.js +10 -0
- package/es/core/contributions/env/modules.js.map +1 -0
- package/es/core/contributions/layerHandler/canvas2d-contribution.js +2 -2
- package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
- package/es/core/contributions/layerHandler/empty-contribution.js +2 -2
- package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
- package/es/core/contributions/layerHandler/modules.d.ts +4 -0
- package/es/core/contributions/layerHandler/modules.js +10 -0
- package/es/core/contributions/layerHandler/modules.js.map +1 -0
- package/es/core/contributions/layerHandler/offscreen2d-contribution.js +2 -2
- package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
- package/es/core/contributions/modules.d.ts +2 -1
- package/es/core/contributions/modules.js +15 -1
- package/es/core/contributions/modules.js.map +1 -1
- package/es/core/contributions/textMeasure/modules.d.ts +4 -0
- package/es/core/contributions/textMeasure/modules.js +11 -0
- package/es/core/contributions/textMeasure/modules.js.map +1 -0
- package/es/core/core-modules.d.ts +4 -0
- package/es/core/core-modules.js +24 -0
- package/es/core/core-modules.js.map +1 -0
- package/es/core/global-module.d.ts +1 -0
- package/es/core/global-module.js +3 -0
- package/es/core/global-module.js.map +1 -0
- package/es/core/global.d.ts +4 -2
- package/es/core/global.js +7 -8
- package/es/core/global.js.map +1 -1
- package/es/core/graphic-utils.d.ts +3 -4
- package/es/core/graphic-utils.js +6 -11
- package/es/core/graphic-utils.js.map +1 -1
- package/es/core/layer-service.d.ts +7 -2
- package/es/core/layer-service.js +23 -17
- package/es/core/layer-service.js.map +1 -1
- package/es/core/layer.d.ts +1 -1
- package/es/core/layer.js +3 -3
- package/es/core/layer.js.map +1 -1
- package/es/core/stage.d.ts +17 -3
- package/es/core/stage.js +58 -30
- package/es/core/stage.js.map +1 -1
- package/es/core/window.d.ts +7 -5
- package/es/core/window.js +11 -9
- package/es/core/window.js.map +1 -1
- package/es/create.d.ts +1 -2
- package/es/create.js +4 -2
- package/es/create.js.map +1 -1
- package/es/entries/app-context.d.ts +30 -0
- package/es/entries/app-context.js +86 -0
- package/es/entries/app-context.js.map +1 -0
- package/es/entries/browser.d.ts +25 -0
- package/es/entries/browser.js +36 -0
- package/es/entries/browser.js.map +1 -0
- package/es/entries/index.d.ts +7 -0
- package/es/entries/index.js +14 -0
- package/es/entries/index.js.map +1 -0
- package/es/entries/miniapp.d.ts +6 -0
- package/es/entries/miniapp.js +12 -0
- package/es/entries/miniapp.js.map +1 -0
- package/es/entries/node.d.ts +6 -0
- package/es/entries/node.js +12 -0
- package/es/entries/node.js.map +1 -0
- package/es/entries/runtime-installer.d.ts +11 -0
- package/es/entries/runtime-installer.js +130 -0
- package/es/entries/runtime-installer.js.map +1 -0
- package/es/entries/types.d.ts +29 -0
- package/es/entries/types.js.map +1 -0
- package/es/env-check.js +3 -3
- package/es/env-check.js.map +1 -1
- package/es/event/event-manager.js +4 -1
- package/es/event/event-manager.js.map +1 -1
- package/es/event/util.d.ts +1 -1
- package/es/factory/graphic-factory.d.ts +7 -0
- package/es/factory/graphic-factory.js +15 -0
- package/es/factory/graphic-factory.js.map +1 -0
- package/es/factory/index.d.ts +4 -0
- package/es/factory/index.js +8 -0
- package/es/factory/index.js.map +1 -0
- package/es/factory/layer-factory.d.ts +7 -0
- package/es/factory/layer-factory.js +11 -0
- package/es/factory/layer-factory.js.map +1 -0
- package/es/factory/stage-factory.d.ts +8 -0
- package/es/factory/stage-factory.js +12 -0
- package/es/factory/stage-factory.js.map +1 -0
- package/es/factory/types.d.ts +34 -0
- package/es/factory/types.js +2 -0
- package/es/factory/types.js.map +1 -0
- package/es/factory.d.ts +1 -0
- package/es/factory.js +2 -0
- package/es/factory.js.map +1 -1
- package/es/global.d.ts +2 -0
- package/es/global.js +10 -0
- package/es/global.js.map +1 -0
- package/es/graphic/arc.js +3 -3
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/arc3d.js +4 -3
- package/es/graphic/arc3d.js.map +1 -1
- package/es/graphic/area.js +3 -3
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/bounds.js +3 -3
- package/es/graphic/bounds.js.map +1 -1
- package/es/graphic/circle.js +3 -3
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +7 -1
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/glyph.js +9 -3
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-creator.d.ts +9 -4
- package/es/graphic/graphic-creator.js +32 -5
- package/es/graphic/graphic-creator.js.map +1 -1
- package/es/graphic/graphic-service/graphic-module.d.ts +4 -0
- package/es/graphic/graphic-service/graphic-module.js +12 -0
- package/es/graphic/graphic-service/graphic-module.js.map +1 -0
- package/es/graphic/graphic-service/graphic-service.d.ts +2 -3
- package/es/graphic/graphic-service/graphic-service.js +3 -5
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +81 -7
- package/es/graphic/graphic.js +516 -140
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +11 -1
- package/es/graphic/group.js +49 -13
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.d.ts +1 -0
- package/es/graphic/image.js +5 -4
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/index.d.ts +3 -0
- package/es/graphic/index.js +4 -0
- package/es/graphic/index.js.map +1 -1
- package/es/graphic/line.js +3 -3
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/path.js +3 -3
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.js +3 -3
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/pyramid3d.js +2 -2
- package/es/graphic/pyramid3d.js.map +1 -1
- package/es/graphic/rect.d.ts +2 -0
- package/es/graphic/rect.js +47 -3
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/utils.js +3 -3
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext.js +4 -4
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/star.js +3 -3
- package/es/graphic/star.js.map +1 -1
- package/es/graphic/state/attribute-update-classifier.d.ts +13 -0
- package/es/graphic/state/attribute-update-classifier.js +61 -0
- package/es/graphic/state/attribute-update-classifier.js.map +1 -0
- package/es/graphic/state/shared-state-refresh.d.ts +6 -0
- package/es/graphic/state/shared-state-refresh.js +46 -0
- package/es/graphic/state/shared-state-refresh.js.map +1 -0
- package/es/graphic/state/shared-state-scope.d.ts +25 -0
- package/es/graphic/state/shared-state-scope.js +90 -0
- package/es/graphic/state/shared-state-scope.js.map +1 -0
- package/es/graphic/state/state-batch-scheduler.d.ts +42 -0
- package/es/graphic/state/state-batch-scheduler.js +278 -0
- package/es/graphic/state/state-batch-scheduler.js.map +1 -0
- package/es/graphic/state/state-definition-compiler.d.ts +6 -0
- package/es/graphic/state/state-definition-compiler.js +83 -0
- package/es/graphic/state/state-definition-compiler.js.map +1 -0
- package/es/graphic/state/state-definition.d.ts +44 -0
- package/es/graphic/state/state-definition.js +2 -0
- package/es/graphic/state/state-definition.js.map +1 -0
- package/es/graphic/state/state-engine.d.ts +38 -0
- package/es/graphic/state/state-engine.js +212 -0
- package/es/graphic/state/state-engine.js.map +1 -0
- package/es/graphic/state/state-model.d.ts +43 -0
- package/es/graphic/state/state-model.js +135 -0
- package/es/graphic/state/state-model.js.map +1 -0
- package/es/graphic/state/state-perf-monitor.d.ts +119 -0
- package/es/graphic/state/state-perf-monitor.js +207 -0
- package/es/graphic/state/state-perf-monitor.js.map +1 -0
- package/es/graphic/state/state-style-resolver.d.ts +22 -0
- package/es/graphic/state/state-style-resolver.js +65 -0
- package/es/graphic/state/state-style-resolver.js.map +1 -0
- package/es/graphic/state/state-transition-orchestrator.d.ts +46 -0
- package/es/graphic/state/state-transition-orchestrator.js +80 -0
- package/es/graphic/state/state-transition-orchestrator.js.map +1 -0
- package/es/graphic/symbol.js +3 -3
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.d.ts +3 -2
- package/es/graphic/text.js +28 -19
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.d.ts +5 -0
- package/es/graphic/theme.js +7 -0
- package/es/graphic/theme.js.map +1 -1
- package/es/graphic/tools.js +2 -2
- package/es/graphic/tools.js.map +1 -1
- package/es/graphic/wrap-text.d.ts +1 -1
- package/es/graphic/wrap-text.js +20 -15
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/index.d.ts +26 -4
- package/es/index.js +49 -5
- package/es/index.js.map +1 -1
- package/es/interface/canvas.d.ts +1 -1
- package/es/interface/canvas.js.map +1 -1
- package/es/interface/global.d.ts +2 -0
- package/es/interface/global.js.map +1 -1
- package/es/interface/graphic/group.d.ts +6 -0
- package/es/interface/graphic/group.js.map +1 -1
- package/es/interface/graphic/image.d.ts +7 -1
- package/es/interface/graphic/image.js.map +1 -1
- package/es/interface/graphic/theme.d.ts +3 -0
- package/es/interface/graphic/theme.js.map +1 -1
- package/es/interface/graphic.d.ts +34 -5
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/layer.d.ts +3 -2
- package/es/interface/layer.js.map +1 -1
- package/es/interface/plugin.d.ts +2 -0
- package/es/interface/plugin.js.map +1 -1
- package/es/interface/render.d.ts +1 -1
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +9 -0
- package/es/interface/stage.js.map +1 -1
- package/es/interface/theme-service.js.map +1 -1
- package/es/legacy/binding-context.d.ts +24 -0
- package/es/legacy/binding-context.js +90 -0
- package/es/legacy/binding-context.js.map +1 -0
- package/es/legacy/bootstrap.d.ts +10 -0
- package/es/legacy/bootstrap.js +73 -0
- package/es/legacy/bootstrap.js.map +1 -0
- package/es/legacy/module-types.d.ts +2 -0
- package/es/legacy/module-types.js +2 -0
- package/es/legacy/module-types.js.map +1 -0
- package/es/modules.d.ts +5 -6
- package/es/modules.js +44 -14
- package/es/modules.js.map +1 -1
- package/es/picker/global-picker-service.js +2 -2
- package/es/picker/global-picker-service.js.map +1 -1
- package/es/picker/pick-modules.d.ts +5 -0
- package/es/picker/pick-modules.js +18 -0
- package/es/picker/pick-modules.js.map +1 -0
- package/es/picker/picker-service.d.ts +13 -4
- package/es/picker/picker-service.js +16 -11
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/base-plugin.d.ts +8 -0
- package/es/plugins/base-plugin.js +7 -0
- package/es/plugins/base-plugin.js.map +1 -0
- package/es/plugins/browser-env-plugin.d.ts +8 -0
- package/es/plugins/browser-env-plugin.js +16 -0
- package/es/plugins/browser-env-plugin.js.map +1 -0
- package/es/plugins/builtin-plugin/auto-refresh-plugin.js +6 -6
- package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +26 -3
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/edit-module.js +3 -3
- package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +8 -8
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +2 -2
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.js +3 -3
- package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +9 -7
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/es/plugins/index.d.ts +5 -0
- package/es/plugins/index.js +10 -0
- package/es/plugins/index.js.map +1 -0
- package/es/plugins/picker-plugin.d.ts +7 -0
- package/es/plugins/picker-plugin.js +11 -0
- package/es/plugins/picker-plugin.js.map +1 -0
- package/es/plugins/plugin-modules.d.ts +4 -0
- package/es/plugins/plugin-modules.js +14 -0
- package/es/plugins/plugin-modules.js.map +1 -0
- package/es/plugins/plugin-service.d.ts +16 -2
- package/es/plugins/plugin-service.js +24 -12
- package/es/plugins/plugin-service.js.map +1 -1
- package/es/plugins/renderer-plugin.d.ts +7 -0
- package/es/plugins/renderer-plugin.js +11 -0
- package/es/plugins/renderer-plugin.js.map +1 -0
- package/es/plugins/types.d.ts +28 -0
- package/es/plugins/types.js +2 -0
- package/es/plugins/types.js.map +1 -0
- package/es/register/register-arc.js +2 -2
- package/es/register/register-arc.js.map +1 -1
- package/es/register/register-arc3d.js +2 -2
- package/es/register/register-arc3d.js.map +1 -1
- package/es/register/register-area.js +2 -2
- package/es/register/register-area.js.map +1 -1
- package/es/register/register-circle.js +2 -2
- package/es/register/register-circle.js.map +1 -1
- package/es/register/register-glyph.js +2 -2
- package/es/register/register-glyph.js.map +1 -1
- package/es/register/register-group.js +2 -2
- package/es/register/register-group.js.map +1 -1
- package/es/register/register-image.js +2 -2
- package/es/register/register-image.js.map +1 -1
- package/es/register/register-line.js +2 -2
- package/es/register/register-line.js.map +1 -1
- package/es/register/register-path.js +2 -2
- package/es/register/register-path.js.map +1 -1
- package/es/register/register-polygon.js +2 -2
- package/es/register/register-polygon.js.map +1 -1
- package/es/register/register-pyramid3d.js +2 -2
- package/es/register/register-pyramid3d.js.map +1 -1
- package/es/register/register-rect.js +2 -2
- package/es/register/register-rect.js.map +1 -1
- package/es/register/register-rect3d.js +2 -2
- package/es/register/register-rect3d.js.map +1 -1
- package/es/register/register-richtext.js +2 -2
- package/es/register/register-richtext.js.map +1 -1
- package/es/register/register-shadowRoot.js +2 -2
- package/es/register/register-shadowRoot.js.map +1 -1
- package/es/register/register-star.js +2 -2
- package/es/register/register-star.js.map +1 -1
- package/es/register/register-symbol.js +2 -2
- package/es/register/register-symbol.js.map +1 -1
- package/es/register/register-text.js +2 -2
- package/es/register/register-text.js.map +1 -1
- package/es/register/register-wraptext.js +2 -2
- package/es/register/register-wraptext.js.map +1 -1
- package/es/registry/contribution-registry.d.ts +9 -0
- package/es/registry/contribution-registry.js +25 -0
- package/es/registry/contribution-registry.js.map +1 -0
- package/es/registry/index.d.ts +5 -0
- package/es/registry/index.js +10 -0
- package/es/registry/index.js.map +1 -0
- package/es/registry/picker-registry.d.ts +10 -0
- package/es/registry/picker-registry.js +21 -0
- package/es/registry/picker-registry.js.map +1 -0
- package/es/registry/plugin-registry.d.ts +10 -0
- package/es/registry/plugin-registry.js +21 -0
- package/es/registry/plugin-registry.js.map +1 -0
- package/es/registry/renderer-registry.d.ts +11 -0
- package/es/registry/renderer-registry.js +29 -0
- package/es/registry/renderer-registry.js.map +1 -0
- package/es/registry/types.d.ts +34 -0
- package/es/registry/types.js +2 -0
- package/es/registry/types.js.map +1 -0
- package/es/render/contributions/modules.d.ts +2 -0
- package/es/render/contributions/modules.js +8 -0
- package/es/render/contributions/modules.js.map +1 -0
- package/es/render/contributions/render/arc-module.d.ts +4 -0
- package/es/render/contributions/render/arc-module.js +21 -0
- package/es/render/contributions/render/arc-module.js.map +1 -0
- package/es/render/contributions/render/arc-render.d.ts +2 -2
- package/es/render/contributions/render/arc-render.js +3 -8
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/arc3d-module.d.ts +4 -0
- package/es/render/contributions/render/arc3d-module.js +13 -0
- package/es/render/contributions/render/arc3d-module.js.map +1 -0
- package/es/render/contributions/render/area-module.d.ts +4 -0
- package/es/render/contributions/render/area-module.js +23 -0
- package/es/render/contributions/render/area-module.js.map +1 -0
- package/es/render/contributions/render/area-render.d.ts +2 -2
- package/es/render/contributions/render/area-render.js +3 -8
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-render.js +1 -1
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/circle-module.d.ts +4 -0
- package/es/render/contributions/render/circle-module.js +21 -0
- package/es/render/contributions/render/circle-module.js.map +1 -0
- package/es/render/contributions/render/circle-render.d.ts +2 -2
- package/es/render/contributions/render/circle-render.js +3 -8
- package/es/render/contributions/render/circle-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-contribution-render.d.ts +29 -11
- package/es/render/contributions/render/contributions/base-contribution-render.js +142 -41
- package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +4 -2
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js +85 -30
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/group-contribution-render.js +9 -7
- package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.d.ts +2 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js +20 -16
- package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.d.ts +13 -4
- package/es/render/contributions/render/draw-contribution.js +40 -19
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +2 -3
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/glyph-module.d.ts +4 -0
- package/es/render/contributions/render/glyph-module.js +13 -0
- package/es/render/contributions/render/glyph-module.js.map +1 -0
- package/es/render/contributions/render/group-render.d.ts +2 -2
- package/es/render/contributions/render/group-render.js +3 -9
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/image-module.d.ts +4 -0
- package/es/render/contributions/render/image-module.js +20 -0
- package/es/render/contributions/render/image-module.js.map +1 -0
- package/es/render/contributions/render/image-render.d.ts +16 -3
- package/es/render/contributions/render/image-render.js +95 -25
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/incremental-draw-contribution.d.ts +5 -3
- package/es/render/contributions/render/incremental-draw-contribution.js +4 -12
- package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/es/render/contributions/render/index.d.ts +4 -12
- package/es/render/contributions/render/index.js +8 -24
- package/es/render/contributions/render/index.js.map +1 -1
- package/es/render/contributions/render/line-module.d.ts +4 -0
- package/es/render/contributions/render/line-module.js +16 -0
- package/es/render/contributions/render/line-module.js.map +1 -0
- package/es/render/contributions/render/module.d.ts +4 -0
- package/es/render/contributions/render/module.js +28 -0
- package/es/render/contributions/render/module.js.map +1 -0
- package/es/render/contributions/render/path-module.d.ts +4 -0
- package/es/render/contributions/render/path-module.js +21 -0
- package/es/render/contributions/render/path-module.js.map +1 -0
- package/es/render/contributions/render/path-render.d.ts +2 -2
- package/es/render/contributions/render/path-render.js +3 -8
- package/es/render/contributions/render/path-render.js.map +1 -1
- package/es/render/contributions/render/polygon-module.d.ts +4 -0
- package/es/render/contributions/render/polygon-module.js +20 -0
- package/es/render/contributions/render/polygon-module.js.map +1 -0
- package/es/render/contributions/render/polygon-render.d.ts +2 -2
- package/es/render/contributions/render/polygon-render.js +3 -8
- package/es/render/contributions/render/polygon-render.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-module.d.ts +4 -0
- package/es/render/contributions/render/pyramid3d-module.js +13 -0
- package/es/render/contributions/render/pyramid3d-module.js.map +1 -0
- package/es/render/contributions/render/rect-module.d.ts +4 -0
- package/es/render/contributions/render/rect-module.js +23 -0
- package/es/render/contributions/render/rect-module.js.map +1 -0
- package/es/render/contributions/render/rect-render.d.ts +2 -2
- package/es/render/contributions/render/rect-render.js +3 -8
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/rect3d-module.d.ts +4 -0
- package/es/render/contributions/render/rect3d-module.js +13 -0
- package/es/render/contributions/render/rect3d-module.js.map +1 -0
- package/es/render/contributions/render/rect3d-render.js.map +1 -1
- package/es/render/contributions/render/render-slector.js.map +1 -1
- package/es/render/contributions/render/richtext-module.d.ts +4 -0
- package/es/render/contributions/render/richtext-module.js +13 -0
- package/es/render/contributions/render/richtext-module.js.map +1 -0
- package/es/render/contributions/render/star-module.d.ts +4 -0
- package/es/render/contributions/render/star-module.js +17 -0
- package/es/render/contributions/render/star-module.js.map +1 -0
- package/es/render/contributions/render/star-render.d.ts +2 -2
- package/es/render/contributions/render/star-render.js +3 -8
- package/es/render/contributions/render/star-render.js.map +1 -1
- package/es/render/contributions/render/symbol-module.d.ts +4 -0
- package/es/render/contributions/render/symbol-module.js +21 -0
- package/es/render/contributions/render/symbol-module.js.map +1 -0
- package/es/render/contributions/render/symbol-render.d.ts +2 -2
- package/es/render/contributions/render/symbol-render.js +3 -8
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/symbol.d.ts +0 -2
- package/es/render/contributions/render/symbol.js +0 -4
- package/es/render/contributions/render/symbol.js.map +1 -1
- package/es/render/contributions/render/text-module.d.ts +4 -0
- package/es/render/contributions/render/text-module.js +20 -0
- package/es/render/contributions/render/text-module.js.map +1 -0
- package/es/render/contributions/render/text-render.d.ts +2 -2
- package/es/render/contributions/render/text-render.js +2 -7
- package/es/render/contributions/render/text-render.js.map +1 -1
- package/es/render/render-modules.d.ts +4 -0
- package/es/render/render-modules.js +10 -0
- package/es/render/render-modules.js.map +1 -0
- package/es/render/render-service.d.ts +1 -1
- package/es/render/render-service.js +3 -1
- package/es/render/render-service.js.map +1 -1
- package/es/resource-loader/loader.js +6 -6
- package/es/resource-loader/loader.js.map +1 -1
- package/package.json +8 -7
- package/cjs/common/registry/contribution-registry.d.ts +0 -24
- package/cjs/common/registry/contribution-registry.js +0 -61
- package/cjs/common/registry/contribution-registry.js.map +0 -1
- package/cjs/common/registry/index.d.ts +0 -5
- package/cjs/common/registry/index.js +0 -34
- package/cjs/common/registry/index.js.map +0 -1
- package/cjs/common/registry/service-registry.d.ts +0 -16
- package/cjs/common/registry/service-registry.js +0 -57
- package/cjs/common/registry/service-registry.js.map +0 -1
- package/cjs/common/registry/types.d.ts +0 -1
- package/cjs/common/registry/types.js.map +0 -1
- package/cjs/register-modules.d.ts +0 -9
- package/cjs/register-modules.js +0 -79
- package/cjs/register-modules.js.map +0 -1
- package/es/common/registry/contribution-registry.d.ts +0 -24
- package/es/common/registry/contribution-registry.js +0 -55
- package/es/common/registry/contribution-registry.js.map +0 -1
- package/es/common/registry/index.d.ts +0 -5
- package/es/common/registry/index.js +0 -4
- package/es/common/registry/index.js.map +0 -1
- package/es/common/registry/service-registry.d.ts +0 -16
- package/es/common/registry/service-registry.js +0 -51
- package/es/common/registry/service-registry.js.map +0 -1
- package/es/common/registry/types.d.ts +0 -1
- package/es/common/registry/types.js.map +0 -1
- package/es/register-modules.d.ts +0 -9
- package/es/register-modules.js +0 -117
- package/es/register-modules.js.map +0 -1
- /package/cjs/{common/registry → entries}/types.js +0 -0
- /package/es/{common/registry → entries}/types.js +0 -0
package/es/graphic/graphic.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { isArray, max, OBBBounds } from "@visactor/vutils";
|
|
2
|
-
|
|
3
|
-
import { AABBBounds, Matrix, normalTransform, Point, isNil, isString, isValidUrl, isBase64, isObject } from "@visactor/vutils";
|
|
1
|
+
import { AABBBounds, isArray, isEqual, max, Matrix, OBBBounds, normalTransform, Point, isNil, isString, isValidUrl, isBase64, isObject } from "@visactor/vutils";
|
|
4
2
|
|
|
5
3
|
import { Node } from "./node-tree";
|
|
6
4
|
|
|
@@ -8,11 +6,7 @@ import { EventTarget, CustomEvent } from "../event";
|
|
|
8
6
|
|
|
9
7
|
import { DefaultTransform } from "./config";
|
|
10
8
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { serviceRegistry } from "../common/registry";
|
|
14
|
-
|
|
15
|
-
import { RenderService } from "../render/constants";
|
|
9
|
+
import { application } from "../application";
|
|
16
10
|
|
|
17
11
|
import { CustomPath2D } from "../common/custom-path2d";
|
|
18
12
|
|
|
@@ -36,13 +30,70 @@ import { DefaultStateAnimateConfig } from "../animate/config";
|
|
|
36
30
|
|
|
37
31
|
import { EmptyContext2d } from "../canvas";
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
import { StateDefinitionCompiler } from "./state/state-definition-compiler";
|
|
34
|
+
|
|
35
|
+
import { StateEngine } from "./state/state-engine";
|
|
36
|
+
|
|
37
|
+
import { StateModel } from "./state/state-model";
|
|
38
|
+
|
|
39
|
+
import { UpdateCategory, classifyAttributeDelta } from "./state/attribute-update-classifier";
|
|
40
|
+
|
|
41
|
+
import { StateStyleResolver } from "./state/state-style-resolver";
|
|
42
|
+
|
|
43
|
+
import { StateTransitionOrchestrator } from "./state/state-transition-orchestrator";
|
|
44
|
+
|
|
45
|
+
import { collectSharedStateScopeChain, ensureSharedStateScopeFresh } from "./state/shared-state-scope";
|
|
46
|
+
|
|
47
|
+
import { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from "./state/shared-state-refresh";
|
|
48
|
+
|
|
49
|
+
import { getStageStatePerfMonitor } from "./state/state-perf-monitor";
|
|
50
|
+
|
|
51
|
+
const _tempBounds = new AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new Matrix;
|
|
40
52
|
|
|
41
53
|
export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
|
|
42
54
|
|
|
43
55
|
export const GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
|
|
44
56
|
|
|
45
|
-
const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], point = new Point;
|
|
57
|
+
const tempConstantXYKey = [ "x", "y" ], tempConstantScaleXYKey = [ "scaleX", "scaleY" ], tempConstantAngleKey = [ "angle" ], builtinTextureTypes = new Set([ "circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave" ]), point = new Point;
|
|
58
|
+
|
|
59
|
+
function isPlainObjectValue(value) {
|
|
60
|
+
return "object" == typeof value && null != value && !isArray(value);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function cloneAttributeValue(value) {
|
|
64
|
+
if (!isPlainObjectValue(value)) return value;
|
|
65
|
+
const source = value, clone = {};
|
|
66
|
+
return Object.keys(source).forEach((key => {
|
|
67
|
+
const nextValue = source[key];
|
|
68
|
+
clone[key] = isPlainObjectValue(nextValue) ? cloneAttributeValue(nextValue) : nextValue;
|
|
69
|
+
})), clone;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function cloneSimpleAttributeRecord(value) {
|
|
73
|
+
return isPlainObjectValue(value) ? Object.assign({}, value) : value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function shouldUseSimpleAttributeFastPath(value) {
|
|
77
|
+
return !!isPlainObjectValue(value) && !Object.keys(value).some((key => isPlainObjectValue(value[key])));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function cloneAttributeSurface(value) {
|
|
81
|
+
if (!isPlainObjectValue(value)) return value;
|
|
82
|
+
const source = value, clone = {};
|
|
83
|
+
return Object.keys(source).forEach((key => {
|
|
84
|
+
const nextValue = source[key];
|
|
85
|
+
clone[key] = isPlainObjectValue(nextValue) ? Object.assign({}, nextValue) : nextValue;
|
|
86
|
+
})), clone;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function deepMergeAttributeValue(base, value) {
|
|
90
|
+
var _a;
|
|
91
|
+
const result = null !== (_a = cloneAttributeValue(base)) && void 0 !== _a ? _a : {};
|
|
92
|
+
return Object.keys(value).forEach((key => {
|
|
93
|
+
const nextValue = value[key], previousValue = result[key];
|
|
94
|
+
isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue) ? result[key] = deepMergeAttributeValue(previousValue, nextValue) : result[key] = cloneAttributeValue(nextValue);
|
|
95
|
+
})), result;
|
|
96
|
+
}
|
|
46
97
|
|
|
47
98
|
export const NOWORK_ANIMATE_ATTR = {
|
|
48
99
|
strokeSeg: 1,
|
|
@@ -100,16 +151,238 @@ export class Graphic extends Node {
|
|
|
100
151
|
}
|
|
101
152
|
constructor(params = {}) {
|
|
102
153
|
var _a;
|
|
103
|
-
super(), this._AABBBounds = new AABBBounds, this._updateTag = UpdateTag.INIT
|
|
104
|
-
|
|
154
|
+
super(), this.resolverEpoch = 0, this._AABBBounds = new AABBBounds, this._updateTag = UpdateTag.INIT;
|
|
155
|
+
const useSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath(params), initialBaseAttributes = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params);
|
|
156
|
+
this.baseAttributes = initialBaseAttributes, this.attribute = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(initialBaseAttributes) : cloneAttributeSurface(initialBaseAttributes),
|
|
157
|
+
this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0),
|
|
158
|
+
isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
159
|
+
}
|
|
160
|
+
get normalAttrs() {
|
|
161
|
+
return this.baseAttributes;
|
|
162
|
+
}
|
|
163
|
+
set normalAttrs(value) {
|
|
164
|
+
this._deprecatedNormalAttrsView = null != value ? value : void 0;
|
|
105
165
|
}
|
|
106
166
|
getGraphicService() {
|
|
107
167
|
var _a, _b;
|
|
108
|
-
return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : graphicService;
|
|
168
|
+
return null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : application.graphicService;
|
|
109
169
|
}
|
|
110
170
|
getAttributes() {
|
|
111
171
|
return this.attribute;
|
|
112
172
|
}
|
|
173
|
+
getStateStyleResolver(mergeMode) {
|
|
174
|
+
return "deep" === mergeMode ? (this.deepStateStyleResolver || (this.deepStateStyleResolver = new StateStyleResolver({
|
|
175
|
+
mergeMode: "deep"
|
|
176
|
+
})), this.deepStateStyleResolver) : (this.stateStyleResolver || (this.stateStyleResolver = new StateStyleResolver),
|
|
177
|
+
this.stateStyleResolver);
|
|
178
|
+
}
|
|
179
|
+
getStateTransitionOrchestrator() {
|
|
180
|
+
return this.stateTransitionOrchestrator || (this.stateTransitionOrchestrator = new StateTransitionOrchestrator),
|
|
181
|
+
this.stateTransitionOrchestrator;
|
|
182
|
+
}
|
|
183
|
+
resolveBoundSharedStateScope() {
|
|
184
|
+
var _a;
|
|
185
|
+
let parent = this.parent;
|
|
186
|
+
for (;parent; ) {
|
|
187
|
+
if (parent.sharedStateScope) return parent.sharedStateScope;
|
|
188
|
+
parent = parent.parent;
|
|
189
|
+
}
|
|
190
|
+
return null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope;
|
|
191
|
+
}
|
|
192
|
+
syncSharedStateScopeBindingFromTree(markDirty = !0) {
|
|
193
|
+
var _a;
|
|
194
|
+
const nextScope = this.resolveBoundSharedStateScope();
|
|
195
|
+
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(),
|
|
196
|
+
!1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0,
|
|
197
|
+
this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0,
|
|
198
|
+
this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0,
|
|
199
|
+
this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(),
|
|
200
|
+
markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(),
|
|
201
|
+
!0);
|
|
202
|
+
}
|
|
203
|
+
syncSharedStateActiveRegistrations() {
|
|
204
|
+
var _a, _b;
|
|
205
|
+
const nextScopes = (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.boundSharedStateScope ? new Set(collectSharedStateScopeChain(this.boundSharedStateScope)) : new Set;
|
|
206
|
+
(null !== (_b = this.registeredActiveScopes) && void 0 !== _b ? _b : new Set).forEach((scope => {
|
|
207
|
+
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
208
|
+
})), nextScopes.forEach((scope => {
|
|
209
|
+
scope.subtreeActiveDescendants.add(this);
|
|
210
|
+
})), this.registeredActiveScopes = nextScopes;
|
|
211
|
+
}
|
|
212
|
+
clearSharedStateActiveRegistrations() {
|
|
213
|
+
const previousScopes = this.registeredActiveScopes;
|
|
214
|
+
previousScopes && (previousScopes.forEach((scope => {
|
|
215
|
+
scope.subtreeActiveDescendants.delete(this);
|
|
216
|
+
})), previousScopes.clear()), this.registeredActiveScopes = void 0;
|
|
217
|
+
}
|
|
218
|
+
markSharedStateDirty() {
|
|
219
|
+
this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this),
|
|
220
|
+
scheduleStageSharedStateRefresh(this.stage);
|
|
221
|
+
}
|
|
222
|
+
onParentSharedStateTreeChanged(stage, layer) {
|
|
223
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingFromTree() : this.setStage(stage, layer);
|
|
224
|
+
}
|
|
225
|
+
refreshSharedStateBeforeRender() {
|
|
226
|
+
var _a;
|
|
227
|
+
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? (this.syncSharedStateScopeBindingFromTree(!1),
|
|
228
|
+
this.boundSharedStateScope && ensureSharedStateScopeFresh(this.boundSharedStateScope),
|
|
229
|
+
this.recomputeCurrentStatePatch(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
230
|
+
type: AttributeUpdateType.STATE
|
|
231
|
+
}), this._emitCustomEvent("afterStateUpdate", {
|
|
232
|
+
type: AttributeUpdateType.STATE
|
|
233
|
+
}), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
234
|
+
}
|
|
235
|
+
getLocalStatesVersion() {
|
|
236
|
+
var _a, _b;
|
|
237
|
+
return this.localStateDefinitionsSource !== this.states && (this.localStateDefinitionsSource = this.states,
|
|
238
|
+
this.localFallbackVersion = (null !== (_a = this.localFallbackVersion) && void 0 !== _a ? _a : 0) + 1),
|
|
239
|
+
null !== (_b = this.localFallbackVersion) && void 0 !== _b ? _b : 0;
|
|
240
|
+
}
|
|
241
|
+
resolveEffectiveCompiledDefinitions() {
|
|
242
|
+
this.syncSharedStateScopeBindingFromTree(!1);
|
|
243
|
+
const boundScope = this.boundSharedStateScope;
|
|
244
|
+
boundScope && (ensureSharedStateScopeFresh(boundScope), this.boundSharedStateRevision = boundScope.revision);
|
|
245
|
+
const hasStates = !!this.states && Object.keys(this.states).length > 0;
|
|
246
|
+
if (!boundScope) {
|
|
247
|
+
if (!hasStates) return {
|
|
248
|
+
compiledDefinitions: void 0,
|
|
249
|
+
stateProxyModeKey: "none"
|
|
250
|
+
};
|
|
251
|
+
const cacheKey = `local:${this.getLocalStatesVersion()}`;
|
|
252
|
+
return this.compiledStateDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.compiledStateDefinitions = (new StateDefinitionCompiler).compile(this.states),
|
|
253
|
+
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
254
|
+
compiledDefinitions: this.compiledStateDefinitions,
|
|
255
|
+
stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions, sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none", sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
|
|
259
|
+
if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
|
|
260
|
+
compiledDefinitions: sharedCompiledDefinitions,
|
|
261
|
+
stateProxyModeKey: sharedStateProxyModeKey,
|
|
262
|
+
stateProxyEligibility: sharedStateProxyEligibility
|
|
263
|
+
};
|
|
264
|
+
const localStates = this.states, missingLocalStateDefinitions = {}, missingStateNames = [];
|
|
265
|
+
if (Object.keys(localStates).forEach((stateName => {
|
|
266
|
+
sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName],
|
|
267
|
+
missingStateNames.push(stateName));
|
|
268
|
+
})), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0,
|
|
269
|
+
{
|
|
270
|
+
compiledDefinitions: sharedCompiledDefinitions,
|
|
271
|
+
stateProxyModeKey: sharedStateProxyModeKey,
|
|
272
|
+
stateProxyEligibility: sharedStateProxyEligibility
|
|
273
|
+
};
|
|
274
|
+
const localStatesVersion = this.getLocalStatesVersion(), stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none", cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;
|
|
275
|
+
return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = (new StateDefinitionCompiler).compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)),
|
|
276
|
+
this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
277
|
+
compiledDefinitions: this.localFallbackCompiledDefinitions,
|
|
278
|
+
stateProxyModeKey: stateProxyModeKey,
|
|
279
|
+
stateProxyEligibility: sharedStateProxyEligibility
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
recomputeCurrentStatePatch() {
|
|
283
|
+
var _a, _b, _c, _d;
|
|
284
|
+
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [],
|
|
285
|
+
this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
|
|
286
|
+
const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute, stateModel = this.createStateModel();
|
|
287
|
+
null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs);
|
|
288
|
+
const transition = stateModel.useStates(this.currentStates), effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
289
|
+
this.currentStates = transition.states, this.effectiveStates = [ ...effectiveStates ],
|
|
290
|
+
this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs), this.syncSharedStateActiveRegistrations();
|
|
291
|
+
}
|
|
292
|
+
buildStaticAttributeSnapshot() {
|
|
293
|
+
var _a;
|
|
294
|
+
const snapshot = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {}), resolvedPatch = this.resolvedStatePatch;
|
|
295
|
+
return resolvedPatch ? (Object.keys(resolvedPatch).forEach((key => {
|
|
296
|
+
const nextValue = resolvedPatch[key], previousValue = snapshot[key];
|
|
297
|
+
"deep" === this.stateMergeMode && isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue) ? snapshot[key] = deepMergeAttributeValue(previousValue, nextValue) : snapshot[key] = cloneAttributeValue(nextValue);
|
|
298
|
+
})), snapshot) : snapshot;
|
|
299
|
+
}
|
|
300
|
+
buildRemovedStateAnimationAttrs(targetStateAttrs, previousResolvedStatePatch) {
|
|
301
|
+
const extraAttrs = {};
|
|
302
|
+
if (!previousResolvedStatePatch) return extraAttrs;
|
|
303
|
+
const snapshot = this.buildStaticAttributeSnapshot(), staticTargetAttrs = snapshot;
|
|
304
|
+
return Object.keys(previousResolvedStatePatch).forEach((key => {
|
|
305
|
+
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);
|
|
306
|
+
if (hasTargetAttr && void 0 !== targetStateAttrs[key]) return;
|
|
307
|
+
const assignFallbackAttr = value => {
|
|
308
|
+
void 0 === value && this.shouldSkipStateTransitionDefaultAttribute(key, staticTargetAttrs) || (extraAttrs[key] = void 0 === value ? value : cloneAttributeValue(value));
|
|
309
|
+
};
|
|
310
|
+
if (hasTargetAttr) assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs)); else if (Object.prototype.hasOwnProperty.call(snapshot, key)) {
|
|
311
|
+
const snapshotValue = snapshot[key];
|
|
312
|
+
assignFallbackAttr(void 0 === snapshotValue ? this.getStateTransitionDefaultAttribute(key, staticTargetAttrs) : snapshotValue);
|
|
313
|
+
} else assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));
|
|
314
|
+
})), extraAttrs;
|
|
315
|
+
}
|
|
316
|
+
syncObjectToSnapshot(target, snapshot) {
|
|
317
|
+
const delta = new Map;
|
|
318
|
+
return new Set([ ...Object.keys(target), ...Object.keys(snapshot) ]).forEach((key => {
|
|
319
|
+
const hasNext = Object.prototype.hasOwnProperty.call(snapshot, key), previousValue = target[key];
|
|
320
|
+
if (!hasNext) return void (Object.prototype.hasOwnProperty.call(target, key) && (delta.set(key, {
|
|
321
|
+
prev: previousValue,
|
|
322
|
+
next: void 0
|
|
323
|
+
}), delete target[key]));
|
|
324
|
+
const nextValue = snapshot[key];
|
|
325
|
+
isEqual(previousValue, nextValue) || (delta.set(key, {
|
|
326
|
+
prev: previousValue,
|
|
327
|
+
next: nextValue
|
|
328
|
+
}), target[key] = cloneAttributeValue(nextValue));
|
|
329
|
+
})), delta;
|
|
330
|
+
}
|
|
331
|
+
_syncAttribute() {
|
|
332
|
+
const snapshot = this.buildStaticAttributeSnapshot(), delta = this.syncObjectToSnapshot(this.attribute, snapshot);
|
|
333
|
+
return this.valid = this.isValid(), delta;
|
|
334
|
+
}
|
|
335
|
+
_syncFinalAttributeFromStaticTruth() {
|
|
336
|
+
const target = this.finalAttribute;
|
|
337
|
+
if (!target) return;
|
|
338
|
+
const snapshot = this.buildStaticAttributeSnapshot();
|
|
339
|
+
this.syncObjectToSnapshot(target, snapshot);
|
|
340
|
+
}
|
|
341
|
+
submitUpdateByDelta(delta, forceUpdateTag = !1) {
|
|
342
|
+
var _a;
|
|
343
|
+
if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(),
|
|
344
|
+
void this.addUpdateLayoutTag();
|
|
345
|
+
let category = UpdateCategory.NONE;
|
|
346
|
+
delta.forEach(((entry, key) => {
|
|
347
|
+
let nextCategory = classifyAttributeDelta(key, entry.prev, entry.next);
|
|
348
|
+
nextCategory & UpdateCategory.PICK && (nextCategory |= UpdateCategory.BOUNDS), nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS),
|
|
349
|
+
category |= nextCategory;
|
|
350
|
+
})), category !== UpdateCategory.NONE && (null === (_a = getStageStatePerfMonitor(this.stage)) || void 0 === _a || _a.recordCategory(category)),
|
|
351
|
+
category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(),
|
|
352
|
+
category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(),
|
|
353
|
+
category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag();
|
|
354
|
+
}
|
|
355
|
+
commitBaseAttributeMutation(forceUpdateTag = !1, context) {
|
|
356
|
+
var _a, _b;
|
|
357
|
+
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch += 1,
|
|
358
|
+
null === (_b = this.stateEngine) || void 0 === _b || _b.invalidateResolverCache(),
|
|
359
|
+
this.recomputeCurrentStatePatch());
|
|
360
|
+
const delta = this._syncAttribute();
|
|
361
|
+
this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
362
|
+
}
|
|
363
|
+
applyBaseAttributes(params) {
|
|
364
|
+
const keys = Object.keys(params);
|
|
365
|
+
for (let i = 0; i < keys.length; i++) {
|
|
366
|
+
const key = keys[i];
|
|
367
|
+
this.baseAttributes[key] = cloneAttributeValue(params[key]);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
applyTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
371
|
+
const delta = new Map, keys = Object.keys(params);
|
|
372
|
+
for (let i = 0; i < keys.length; i++) {
|
|
373
|
+
const key = keys[i], previousValue = this.attribute[key], nextValue = params[key];
|
|
374
|
+
isEqual(previousValue, nextValue) || (delta.set(key, {
|
|
375
|
+
prev: previousValue,
|
|
376
|
+
next: nextValue
|
|
377
|
+
}), this.attribute[key] = cloneAttributeValue(nextValue));
|
|
378
|
+
}
|
|
379
|
+
this.valid = this.isValid(), this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
380
|
+
}
|
|
381
|
+
_restoreAttributeFromStaticTruth(context) {
|
|
382
|
+
this._syncFinalAttributeFromStaticTruth();
|
|
383
|
+
const delta = this._syncAttribute();
|
|
384
|
+
this.submitUpdateByDelta(delta), this.onAttributeUpdate(context);
|
|
385
|
+
}
|
|
113
386
|
setMode(mode) {
|
|
114
387
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
115
388
|
}
|
|
@@ -131,6 +404,17 @@ export class Graphic extends Node {
|
|
|
131
404
|
onAnimateBind(animate) {
|
|
132
405
|
this._emitCustomEvent("animate-bind", animate);
|
|
133
406
|
}
|
|
407
|
+
visitTrackedAnimates(cb) {
|
|
408
|
+
const hook = this.forEachTrackedAnimate;
|
|
409
|
+
"function" != typeof hook ? this.animates && this.animates.forEach(cb) : hook.call(this, cb);
|
|
410
|
+
}
|
|
411
|
+
hasAnyTrackedAnimate() {
|
|
412
|
+
var _a;
|
|
413
|
+
const hook = this.hasTrackedAnimate;
|
|
414
|
+
if ("function" == typeof hook) return hook.call(this);
|
|
415
|
+
const getTrackedAnimates = this.getTrackedAnimates;
|
|
416
|
+
return "function" == typeof getTrackedAnimates ? getTrackedAnimates.call(this).size > 0 : !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size);
|
|
417
|
+
}
|
|
134
418
|
tryUpdateAABBBounds() {
|
|
135
419
|
const full = "imprecise" === this.attribute.boundsMode;
|
|
136
420
|
if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
|
|
@@ -271,34 +555,27 @@ export class Graphic extends Node {
|
|
|
271
555
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
272
556
|
}
|
|
273
557
|
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
274
|
-
this.
|
|
558
|
+
this.visitTrackedAnimates((animate => {
|
|
275
559
|
(animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach((key => {
|
|
276
560
|
animate.preventAttr(key);
|
|
277
561
|
}));
|
|
278
|
-
}));
|
|
562
|
+
})), this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
279
563
|
}
|
|
280
564
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
281
|
-
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background
|
|
565
|
+
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0),
|
|
566
|
+
isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
|
|
282
567
|
this._setAttributes(params, forceUpdateTag, context));
|
|
283
568
|
}
|
|
284
569
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
285
|
-
|
|
286
|
-
for (let i = 0; i < keys.length; i++) {
|
|
287
|
-
const key = keys[i];
|
|
288
|
-
this.attribute[key] = params[key];
|
|
289
|
-
}
|
|
290
|
-
this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
|
|
291
|
-
this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context);
|
|
570
|
+
this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context);
|
|
292
571
|
}
|
|
293
572
|
setAttribute(key, value, forceUpdateTag, context) {
|
|
294
|
-
var _a;
|
|
295
573
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
296
574
|
[key]: value
|
|
297
575
|
}, this.attribute, key, context);
|
|
298
|
-
params ? this._setAttributes(params, forceUpdateTag, context) :
|
|
299
|
-
|
|
300
|
-
this.
|
|
301
|
-
"background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
576
|
+
params ? this._setAttributes(params, forceUpdateTag, context) : (this.applyBaseAttributes({
|
|
577
|
+
[key]: value
|
|
578
|
+
}), this.commitBaseAttributeMutation(!!forceUpdateTag, context)), "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
302
579
|
}
|
|
303
580
|
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
304
581
|
for (let i = 0; i < k.length; i++) {
|
|
@@ -318,7 +595,9 @@ export class Graphic extends Node {
|
|
|
318
595
|
type: AttributeUpdateType.INIT
|
|
319
596
|
};
|
|
320
597
|
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params,
|
|
321
|
-
this.
|
|
598
|
+
this.baseAttributes = cloneAttributeValue(params), this.attribute || (this.attribute = {}),
|
|
599
|
+
this.resolvedStatePatch = void 0, this._syncAttribute(), params.background && this.loadImage(params.background, !0),
|
|
600
|
+
isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
|
|
322
601
|
this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
|
|
323
602
|
}
|
|
324
603
|
translate(x, y) {
|
|
@@ -330,15 +609,14 @@ export class Graphic extends Node {
|
|
|
330
609
|
x: x,
|
|
331
610
|
y: y
|
|
332
611
|
}, this.attribute, tempConstantXYKey, context);
|
|
333
|
-
params && (x = params.x, y = params.y, delete params.x, delete params.y, this.
|
|
334
|
-
const attribute = this.
|
|
335
|
-
return postMatrix ? transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y) : (attribute.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x,
|
|
612
|
+
params && (x = params.x, y = params.y, delete params.x, delete params.y, this.applyBaseAttributes(params));
|
|
613
|
+
const attribute = this.baseAttributes, postMatrix = attribute.postMatrix;
|
|
614
|
+
return postMatrix ? application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y) : (attribute.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x,
|
|
336
615
|
attribute.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : DefaultTransform.y) + y),
|
|
337
|
-
this.
|
|
338
|
-
this.onAttributeUpdate(context), this;
|
|
616
|
+
this.commitBaseAttributeMutation(!1, context), this;
|
|
339
617
|
}
|
|
340
618
|
translateTo(x, y) {
|
|
341
|
-
const attribute = this.
|
|
619
|
+
const attribute = this.baseAttributes;
|
|
342
620
|
if (attribute.x === x && attribute.y === y) return this;
|
|
343
621
|
const context = {
|
|
344
622
|
type: AttributeUpdateType.TRANSLATE_TO
|
|
@@ -346,9 +624,9 @@ export class Graphic extends Node {
|
|
|
346
624
|
x: x,
|
|
347
625
|
y: y
|
|
348
626
|
}, this.attribute, tempConstantXYKey, context);
|
|
349
|
-
return params ? (this.
|
|
350
|
-
attribute.
|
|
351
|
-
this
|
|
627
|
+
return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
|
|
628
|
+
this) : (attribute.x = x, attribute.y = y, this.commitBaseAttributeMutation(!1, context),
|
|
629
|
+
this);
|
|
352
630
|
}
|
|
353
631
|
scale(scaleX, scaleY, scaleCenter) {
|
|
354
632
|
var _a, _b;
|
|
@@ -361,18 +639,17 @@ export class Graphic extends Node {
|
|
|
361
639
|
scaleCenter: scaleCenter
|
|
362
640
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
363
641
|
params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX,
|
|
364
|
-
delete params.scaleY, this.
|
|
365
|
-
const attribute = this.
|
|
642
|
+
delete params.scaleY, this.applyBaseAttributes(params));
|
|
643
|
+
const attribute = this.baseAttributes;
|
|
366
644
|
if (scaleCenter) {
|
|
367
645
|
let {postMatrix: postMatrix} = this.attribute;
|
|
368
|
-
postMatrix || (postMatrix = new Matrix, attribute.postMatrix = postMatrix), transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
|
|
646
|
+
postMatrix || (postMatrix = new Matrix, attribute.postMatrix = postMatrix), application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
|
|
369
647
|
} else attribute.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : DefaultTransform.scaleX) * scaleX,
|
|
370
648
|
attribute.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : DefaultTransform.scaleY) * scaleY;
|
|
371
|
-
return this.
|
|
372
|
-
this.onAttributeUpdate(context), this;
|
|
649
|
+
return this.commitBaseAttributeMutation(!1, context), this;
|
|
373
650
|
}
|
|
374
651
|
scaleTo(scaleX, scaleY) {
|
|
375
|
-
const attribute = this.
|
|
652
|
+
const attribute = this.baseAttributes;
|
|
376
653
|
if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) return this;
|
|
377
654
|
const context = {
|
|
378
655
|
type: AttributeUpdateType.SCALE_TO
|
|
@@ -380,9 +657,9 @@ export class Graphic extends Node {
|
|
|
380
657
|
scaleX: scaleX,
|
|
381
658
|
scaleY: scaleY
|
|
382
659
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
383
|
-
return params ? (this.
|
|
384
|
-
attribute.scaleY = scaleY, this.
|
|
385
|
-
this
|
|
660
|
+
return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
|
|
661
|
+
this) : (attribute.scaleX = scaleX, attribute.scaleY = scaleY, this.commitBaseAttributeMutation(!1, context),
|
|
662
|
+
this);
|
|
386
663
|
}
|
|
387
664
|
rotate(angle, rotateCenter) {
|
|
388
665
|
var _a;
|
|
@@ -393,24 +670,24 @@ export class Graphic extends Node {
|
|
|
393
670
|
angle: angle,
|
|
394
671
|
rotateCenter: rotateCenter
|
|
395
672
|
}, this.attribute, tempConstantAngleKey, context);
|
|
396
|
-
params && (delete params.angle, this.
|
|
397
|
-
const attribute = this.
|
|
673
|
+
params && (delete params.angle, this.applyBaseAttributes(params));
|
|
674
|
+
const attribute = this.baseAttributes;
|
|
398
675
|
if (rotateCenter) {
|
|
399
|
-
let {postMatrix: postMatrix} = this.
|
|
400
|
-
postMatrix || (postMatrix = new Matrix,
|
|
676
|
+
let {postMatrix: postMatrix} = this.baseAttributes;
|
|
677
|
+
postMatrix || (postMatrix = new Matrix, this.baseAttributes.postMatrix = postMatrix),
|
|
678
|
+
application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);
|
|
401
679
|
} else attribute.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : DefaultTransform.angle) + angle;
|
|
402
|
-
return this.
|
|
403
|
-
this.onAttributeUpdate(context), this;
|
|
680
|
+
return this.commitBaseAttributeMutation(!1, context), this;
|
|
404
681
|
}
|
|
405
682
|
rotateTo(angle) {
|
|
406
|
-
const attribute = this.
|
|
683
|
+
const attribute = this.baseAttributes;
|
|
407
684
|
if (attribute.angle === angle) return this;
|
|
408
685
|
const context = {
|
|
409
686
|
type: AttributeUpdateType.ROTATE_TO
|
|
410
687
|
}, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
|
|
411
|
-
return params ? (this.
|
|
412
|
-
this.
|
|
413
|
-
this
|
|
688
|
+
return params ? (this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context),
|
|
689
|
+
this) : (attribute.angle = angle, this.commitBaseAttributeMutation(!1, context),
|
|
690
|
+
this);
|
|
414
691
|
}
|
|
415
692
|
skewTo(b, c) {
|
|
416
693
|
return this;
|
|
@@ -430,93 +707,149 @@ export class Graphic extends Node {
|
|
|
430
707
|
var _a;
|
|
431
708
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
432
709
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
this.
|
|
457
|
-
|
|
710
|
+
createStateModel() {
|
|
711
|
+
const {compiledDefinitions: compiledDefinitions, stateProxyEligibility: stateProxyEligibility, stateProxyModeKey: stateProxyModeKey} = this.resolveEffectiveCompiledDefinitions();
|
|
712
|
+
return this.compiledStateDefinitions = compiledDefinitions, compiledDefinitions ? this.stateEngine && this.stateEngineCompiledDefinitions === compiledDefinitions && this.stateEngineStateProxy === this.stateProxy && this.stateEngineStateSort === this.stateSort && this.stateEngineMergeMode === this.stateMergeMode && this.stateEngineStateProxyModeKey === stateProxyModeKey || (this.stateEngine = new StateEngine({
|
|
713
|
+
compiledDefinitions: compiledDefinitions,
|
|
714
|
+
stateSort: this.stateSort,
|
|
715
|
+
stateProxy: this.stateProxy,
|
|
716
|
+
stateProxyEligibility: stateProxyEligibility,
|
|
717
|
+
states: this.states,
|
|
718
|
+
mergeMode: this.stateMergeMode
|
|
719
|
+
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy,
|
|
720
|
+
this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode,
|
|
721
|
+
this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0,
|
|
722
|
+
this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0),
|
|
723
|
+
new StateModel({
|
|
724
|
+
states: this.states,
|
|
725
|
+
currentStates: this.currentStates,
|
|
726
|
+
stateSort: this.stateSort,
|
|
727
|
+
stateProxy: this.stateProxy,
|
|
728
|
+
stateEngine: this.stateEngine
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
resolveStateAnimateConfig(animateConfig) {
|
|
732
|
+
var _a, _b, _c;
|
|
733
|
+
return null !== (_c = null !== (_a = null != animateConfig ? animateConfig : this.stateAnimateConfig) && void 0 !== _a ? _a : null === (_b = this.context) || void 0 === _b ? void 0 : _b.stateAnimateConfig) && void 0 !== _c ? _c : DefaultStateAnimateConfig;
|
|
734
|
+
}
|
|
735
|
+
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig, extraAnimateAttrs) {
|
|
736
|
+
const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : void 0, transitionOptions = resolvedAnimateConfig ? {
|
|
737
|
+
animateConfig: resolvedAnimateConfig,
|
|
738
|
+
extraAnimateAttrs: extraAnimateAttrs,
|
|
739
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
740
|
+
} : void 0;
|
|
741
|
+
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
|
|
742
|
+
const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
|
|
743
|
+
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
744
|
+
animateConfig: resolvedAnimateConfig,
|
|
745
|
+
extraAnimateAttrs: extraAnimateAttrs,
|
|
746
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
458
747
|
});
|
|
748
|
+
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
459
749
|
}
|
|
460
750
|
updateNormalAttrs(stateAttrs) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
})), this.normalAttrs = newNormalAttrs;
|
|
751
|
+
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
752
|
+
}
|
|
753
|
+
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
754
|
+
return this.getDefaultAttribute(key);
|
|
755
|
+
}
|
|
756
|
+
shouldSkipStateTransitionDefaultAttribute(_key, _targetAttrs) {
|
|
757
|
+
return !1;
|
|
469
758
|
}
|
|
470
759
|
stopStateAnimates(type = "end") {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
760
|
+
const stopAnimationState = this.stopAnimationState;
|
|
761
|
+
if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
|
|
762
|
+
const stateAnimates = [];
|
|
763
|
+
this.visitTrackedAnimates((animate => {
|
|
764
|
+
animate.stateNames && stateAnimates.push(animate);
|
|
765
|
+
})), stateAnimates.forEach((animate => animate.stop(type)));
|
|
474
766
|
}
|
|
475
767
|
getNormalAttribute(key) {
|
|
476
768
|
var _a, _b;
|
|
477
769
|
const value = this.attribute[key];
|
|
478
|
-
return this.
|
|
770
|
+
return this.hasAnyTrackedAnimate() ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
479
771
|
}
|
|
480
772
|
clearStates(hasAnimation) {
|
|
481
|
-
|
|
482
|
-
this.
|
|
773
|
+
var _a, _b, _c;
|
|
774
|
+
const previousStates = this.currentStates ? this.currentStates.slice() : [], previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0, transition = this.createStateModel().clearStates();
|
|
775
|
+
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [],
|
|
776
|
+
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
777
|
+
void this.clearSharedStateActiveRegistrations();
|
|
778
|
+
const resolvedStateAttrs = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {});
|
|
779
|
+
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states,
|
|
780
|
+
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
781
|
+
this.clearSharedStateActiveRegistrations(), null === (_b = getStageStatePerfMonitor(this.stage)) || void 0 === _b || _b.incrementCounter("stateCommits"),
|
|
782
|
+
null === (_c = getStageStatePerfMonitor(this.stage)) || void 0 === _c || _c.recordEvent("state-commit", {
|
|
783
|
+
graphicId: this._uid,
|
|
784
|
+
targetStates: []
|
|
785
|
+
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
786
|
+
this._restoreAttributeFromStaticTruth({
|
|
787
|
+
type: AttributeUpdateType.STATE
|
|
788
|
+
}), this._emitCustomEvent("afterStateUpdate", {
|
|
789
|
+
type: AttributeUpdateType.STATE
|
|
790
|
+
})));
|
|
483
791
|
}
|
|
484
792
|
removeState(stateName, hasAnimation) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
newStates.length !== this.currentStates.length && this.useStates(newStates, hasAnimation);
|
|
488
|
-
}
|
|
793
|
+
const transition = this.createStateModel().removeState(stateName);
|
|
794
|
+
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
489
795
|
}
|
|
490
796
|
toggleState(stateName, hasAnimation) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
const nextStates = this.currentStates ? this.currentStates.slice() : [];
|
|
494
|
-
nextStates.push(stateName), this.useStates(nextStates, hasAnimation);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
797
|
+
const transition = this.createStateModel().toggleState(stateName);
|
|
798
|
+
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
497
799
|
}
|
|
498
800
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const newStates = keepCurrentStates && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? this.currentStates.concat([ stateName ]) : [ stateName ];
|
|
502
|
-
this.useStates(newStates, hasAnimation);
|
|
801
|
+
const transition = this.createStateModel().addState(stateName, keepCurrentStates);
|
|
802
|
+
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
503
803
|
}
|
|
504
804
|
useStates(states, hasAnimation) {
|
|
505
|
-
var _a;
|
|
805
|
+
var _a, _b, _c, _d, _e;
|
|
506
806
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
807
|
+
const previousStates = this.currentStates ? this.currentStates.slice() : [], previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0, stateResolveBaseAttrs = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute, stateModel = this.createStateModel();
|
|
808
|
+
null === (_b = this.stateEngine) || void 0 === _b || _b.setResolveContext(this, stateResolveBaseAttrs);
|
|
809
|
+
const transition = stateModel.useStates(states);
|
|
810
|
+
if (!transition.changed && this.sameStateNames(previousStates, transition.states)) return;
|
|
811
|
+
const effectiveStates = null !== (_c = transition.effectiveStates) && void 0 !== _c ? _c : transition.states, resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
812
|
+
this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states,
|
|
813
|
+
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
|
|
814
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = getStageStatePerfMonitor(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"),
|
|
815
|
+
null === (_e = getStageStatePerfMonitor(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
|
|
816
|
+
graphicId: this._uid,
|
|
817
|
+
targetStates: [ ...transition.states ]
|
|
818
|
+
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(),
|
|
819
|
+
this._restoreAttributeFromStaticTruth({
|
|
820
|
+
type: AttributeUpdateType.STATE
|
|
821
|
+
}), this._emitCustomEvent("afterStateUpdate", {
|
|
822
|
+
type: AttributeUpdateType.STATE
|
|
823
|
+
})));
|
|
824
|
+
}
|
|
825
|
+
invalidateResolver() {
|
|
826
|
+
var _a, _b;
|
|
827
|
+
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
828
|
+
const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute;
|
|
829
|
+
this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch += 1,
|
|
830
|
+
this.stateEngine.invalidateResolverCache();
|
|
831
|
+
const transition = this.stateEngine.applyStates(this.currentStates), resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
832
|
+
this.effectiveStates = [ ...transition.effectiveStates ], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs),
|
|
833
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(),
|
|
834
|
+
this._restoreAttributeFromStaticTruth({
|
|
835
|
+
type: AttributeUpdateType.STATE
|
|
836
|
+
}), this._emitCustomEvent("afterStateUpdate", {
|
|
837
|
+
type: AttributeUpdateType.STATE
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
sameStateNames(left, right) {
|
|
841
|
+
const normalizedLeft = null != left ? left : [], normalizedRight = null != right ? right : [];
|
|
842
|
+
if (normalizedLeft.length !== normalizedRight.length) return !1;
|
|
843
|
+
for (let index = 0; index < normalizedLeft.length; index++) if (normalizedLeft[index] !== normalizedRight[index]) return !1;
|
|
844
|
+
return !0;
|
|
515
845
|
}
|
|
516
846
|
addUpdateBoundTag() {
|
|
517
847
|
this._updateTag |= UpdateTag.UPDATE_BOUNDS, this.parent && this.parent.addChildUpdateBoundTag(),
|
|
518
848
|
this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
519
849
|
}
|
|
850
|
+
addUpdatePaintTag() {
|
|
851
|
+
this._updateTag |= UpdateTag.UPDATE_PAINT;
|
|
852
|
+
}
|
|
520
853
|
addUpdateShapeTag() {
|
|
521
854
|
this._updateTag |= UpdateTag.UPDATE_SHAPE;
|
|
522
855
|
}
|
|
@@ -530,6 +863,9 @@ export class Graphic extends Node {
|
|
|
530
863
|
clearUpdateBoundTag() {
|
|
531
864
|
this._updateTag &= UpdateTag.CLEAR_BOUNDS;
|
|
532
865
|
}
|
|
866
|
+
clearUpdatePaintTag() {
|
|
867
|
+
this._updateTag &= UpdateTag.CLEAR_PAINT;
|
|
868
|
+
}
|
|
533
869
|
addUpdatePositionTag() {
|
|
534
870
|
this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag(), this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;
|
|
535
871
|
}
|
|
@@ -575,7 +911,7 @@ export class Graphic extends Node {
|
|
|
575
911
|
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
|
|
576
912
|
const m = this._transMatrix;
|
|
577
913
|
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
|
|
578
|
-
m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
914
|
+
m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
579
915
|
x: _anchor[0],
|
|
580
916
|
y: _anchor[1]
|
|
581
917
|
});
|
|
@@ -594,23 +930,35 @@ export class Graphic extends Node {
|
|
|
594
930
|
}
|
|
595
931
|
}
|
|
596
932
|
setStage(stage, layer) {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
933
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
934
|
+
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService, previousStage = this.stage;
|
|
935
|
+
if (this.stage !== stage || this.layer !== layer) {
|
|
936
|
+
if (this.stage = stage, this.layer = layer, this.syncSharedStateScopeBindingFromTree(!!(null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length)),
|
|
937
|
+
this.setStageToShadowRoot(stage, layer), this.hasAnyTrackedAnimate()) {
|
|
938
|
+
const previousTimeline = null === (_e = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _e ? void 0 : _e.call(previousStage), nextTimeline = null === (_f = null == stage ? void 0 : stage.getTimeline) || void 0 === _f ? void 0 : _f.call(stage), detachedStageAnimates = [];
|
|
939
|
+
this.visitTrackedAnimates((a => {
|
|
940
|
+
(!!previousTimeline && a.timeline === previousTimeline || a.timeline.isGlobal) && (nextTimeline ? a.timeline !== nextTimeline && (previousTimeline && a.timeline === previousTimeline && previousTimeline.removeAnimate(a, !1),
|
|
941
|
+
a.setTimeline(nextTimeline), nextTimeline.addAnimate(a)) : previousTimeline && a.timeline === previousTimeline && (previousTimeline.removeAnimate(a, !1),
|
|
942
|
+
detachedStageAnimates.push(a)));
|
|
943
|
+
})), detachedStageAnimates.length && (detachedStageAnimates.forEach((animate => {
|
|
944
|
+
var _a;
|
|
945
|
+
animate.stop();
|
|
946
|
+
const untrackAnimate = this.untrackAnimate;
|
|
947
|
+
"function" == typeof untrackAnimate ? untrackAnimate.call(this, animate.id) : null === (_a = this.animates) || void 0 === _a || _a.delete(animate.id);
|
|
948
|
+
})), this._restoreAttributeFromStaticTruth({
|
|
949
|
+
type: AttributeUpdateType.ANIMATE_END
|
|
603
950
|
}));
|
|
604
951
|
}
|
|
605
|
-
this._onSetStage && this._onSetStage(this, stage, layer),
|
|
952
|
+
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (_g = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _g || _g.call(graphicService, this, stage));
|
|
606
953
|
}
|
|
954
|
+
this.syncSharedStateScopeBindingFromTree(!!(null === (_h = this.currentStates) || void 0 === _h ? void 0 : _h.length));
|
|
607
955
|
}
|
|
608
956
|
setStageToShadowRoot(stage, layer) {
|
|
609
957
|
this.shadowRoot && this.shadowRoot.setStage(stage, layer);
|
|
610
958
|
}
|
|
611
959
|
onAddStep(step) {}
|
|
612
960
|
onStop(props) {
|
|
613
|
-
|
|
961
|
+
this._restoreAttributeFromStaticTruth({
|
|
614
962
|
type: AttributeUpdateType.ANIMATE_END
|
|
615
963
|
});
|
|
616
964
|
}
|
|
@@ -625,7 +973,8 @@ export class Graphic extends Node {
|
|
|
625
973
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
626
974
|
}
|
|
627
975
|
attachShadow(shadowRoot) {
|
|
628
|
-
|
|
976
|
+
var _a, _b, _c;
|
|
977
|
+
return shadowRoot && (shadowRoot.shadowHost = this), this.shadowRoot = null !== (_c = null != shadowRoot ? shadowRoot : null === (_b = (_a = application.graphicService.creator).shadowRoot) || void 0 === _b ? void 0 : _b.call(_a, this)) && void 0 !== _c ? _c : require("./shadow-root").createShadowRoot(this),
|
|
629
978
|
this.addUpdateBoundTag(), this.shadowRoot.setStage(this.stage, this.layer), this.shadowRoot;
|
|
630
979
|
}
|
|
631
980
|
detachShadow() {
|
|
@@ -645,7 +994,9 @@ export class Graphic extends Node {
|
|
|
645
994
|
this.pathProxy;
|
|
646
995
|
}
|
|
647
996
|
loadImage(image, background = !1) {
|
|
648
|
-
if (
|
|
997
|
+
if (background && (null == image ? void 0 : image.background) && (image = image.background),
|
|
998
|
+
background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
|
|
999
|
+
if (!image) return;
|
|
649
1000
|
const url = image;
|
|
650
1001
|
this.resources || (this.resources = new Map);
|
|
651
1002
|
const cache = {
|
|
@@ -673,31 +1024,52 @@ export class Graphic extends Node {
|
|
|
673
1024
|
const res = this.resources.get(url);
|
|
674
1025
|
res && (res.state = "fail", cb && cb());
|
|
675
1026
|
}
|
|
676
|
-
_stopAnimates(
|
|
677
|
-
|
|
1027
|
+
_stopAnimates() {
|
|
1028
|
+
const animates = [];
|
|
1029
|
+
this.visitTrackedAnimates((animate => {
|
|
1030
|
+
animates.push(animate);
|
|
1031
|
+
})), animates.forEach((animate => {
|
|
678
1032
|
animate.stop();
|
|
679
1033
|
}));
|
|
680
1034
|
}
|
|
681
1035
|
stopAnimates(stopChildren = !1) {
|
|
682
|
-
this._stopAnimates(
|
|
683
|
-
this.isContainer && stopChildren && this.forEachChildren((c => {
|
|
1036
|
+
this._stopAnimates(), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren((c => {
|
|
684
1037
|
c.stopAnimates(stopChildren);
|
|
685
1038
|
}));
|
|
686
1039
|
}
|
|
687
1040
|
release() {
|
|
688
|
-
|
|
1041
|
+
var _a, _b, _c;
|
|
1042
|
+
this.releaseStatus = "released", this.clearSharedStateActiveRegistrations(), this.stopAnimates();
|
|
1043
|
+
const graphicService = null !== (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.graphicService) && void 0 !== _b ? _b : application.graphicService;
|
|
1044
|
+
null === (_c = null == graphicService ? void 0 : graphicService.onRelease) || void 0 === _c || _c.call(graphicService, this),
|
|
1045
|
+
super.release();
|
|
689
1046
|
}
|
|
690
|
-
|
|
1047
|
+
_dispatchCustomEvent(type, context) {
|
|
691
1048
|
var _a, _b;
|
|
692
1049
|
if (this._events && type in this._events) {
|
|
693
1050
|
const changeEvent = new CustomEvent(type, context);
|
|
694
|
-
changeEvent.bubbles = !1
|
|
695
|
-
this.
|
|
1051
|
+
changeEvent.bubbles = !1;
|
|
1052
|
+
const manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager;
|
|
1053
|
+
return manager ? (changeEvent.manager = manager, this.dispatchEvent(changeEvent)) : Node.prototype.dispatchEvent.call(this, changeEvent);
|
|
696
1054
|
}
|
|
1055
|
+
return !0;
|
|
1056
|
+
}
|
|
1057
|
+
beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
|
|
1058
|
+
return this._dispatchCustomEvent("beforeStateUpdate", {
|
|
1059
|
+
type: AttributeUpdateType.STATE,
|
|
1060
|
+
attrs: Object.assign({}, attrs),
|
|
1061
|
+
prevStates: prevStates.slice(),
|
|
1062
|
+
nextStates: nextStates.slice(),
|
|
1063
|
+
hasAnimation: !!hasAnimation,
|
|
1064
|
+
isClear: !!isClear
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
_emitCustomEvent(type, context) {
|
|
1068
|
+
this._dispatchCustomEvent(type, context);
|
|
697
1069
|
}
|
|
698
1070
|
toCustomPath() {
|
|
699
1071
|
var _a, _b, _c;
|
|
700
|
-
const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) ||
|
|
1072
|
+
const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
|
|
701
1073
|
if (renderer) {
|
|
702
1074
|
const context = new EmptyContext2d(null, 1);
|
|
703
1075
|
return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
|
|
@@ -707,7 +1079,11 @@ export class Graphic extends Node {
|
|
|
707
1079
|
}
|
|
708
1080
|
|
|
709
1081
|
function backgroundNotImage(image) {
|
|
710
|
-
return !(!image.fill && !image.stroke);
|
|
1082
|
+
return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl(image) || image.includes("/") || isBase64(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
function isExternalTexture(texture) {
|
|
1086
|
+
return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl(texture) || texture.includes("/") || isBase64(texture)) : isObject(texture));
|
|
711
1087
|
}
|
|
712
1088
|
|
|
713
1089
|
Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
|