@visactor/vrender-core 0.22.12 → 0.22.13
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/animate/Ticker/default-ticker.d.ts +40 -0
- package/cjs/animate/Ticker/default-ticker.js +140 -0
- package/cjs/animate/Ticker/default-ticker.js.map +1 -0
- package/cjs/animate/Ticker/index.d.ts +5 -0
- package/cjs/{interface/animation → animate/Ticker}/index.js +3 -3
- package/cjs/animate/Ticker/index.js.map +1 -0
- package/cjs/animate/Ticker/manual-ticker-handler.d.ts +15 -0
- package/cjs/animate/Ticker/manual-ticker-handler.js +36 -0
- package/cjs/animate/Ticker/manual-ticker-handler.js.map +1 -0
- package/cjs/animate/Ticker/manual-ticker.d.ts +19 -0
- package/cjs/animate/Ticker/manual-ticker.js +37 -0
- package/cjs/animate/Ticker/manual-ticker.js.map +1 -0
- package/cjs/animate/Ticker/raf-tick-handler.d.ts +9 -0
- package/cjs/animate/Ticker/raf-tick-handler.js +30 -0
- package/cjs/animate/Ticker/raf-tick-handler.js.map +1 -0
- package/cjs/animate/Ticker/timeout-tick-handler.d.ts +9 -0
- package/cjs/animate/Ticker/timeout-tick-handler.js +28 -0
- package/cjs/animate/Ticker/timeout-tick-handler.js.map +1 -0
- package/cjs/animate/Ticker/type.d.ts +6 -0
- package/cjs/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
- package/cjs/animate/Ticker/type.js.map +1 -0
- package/cjs/animate/animate.d.ts +147 -0
- package/cjs/animate/animate.js +403 -0
- package/cjs/animate/animate.js.map +1 -0
- package/cjs/animate/config.d.ts +2 -1
- package/cjs/animate/config.js +5 -1
- package/cjs/animate/config.js.map +1 -1
- package/cjs/animate/custom-animate.d.ts +236 -0
- package/cjs/animate/custom-animate.js +726 -0
- package/cjs/animate/custom-animate.js.map +1 -0
- package/cjs/animate/default-ticker.d.ts +2 -0
- package/cjs/animate/default-ticker.js +14 -0
- package/cjs/animate/default-ticker.js.map +1 -0
- package/cjs/animate/easing-func.d.ts +1 -0
- package/cjs/animate/easing-func.js +16 -0
- package/cjs/animate/easing-func.js.map +1 -0
- package/cjs/animate/easing.d.ts +49 -0
- package/cjs/animate/easing.js +141 -0
- package/cjs/animate/easing.js.map +1 -0
- package/cjs/animate/group-fade.d.ts +16 -0
- package/cjs/animate/group-fade.js +66 -0
- package/cjs/animate/group-fade.js.map +1 -0
- package/cjs/animate/index.d.ts +8 -0
- package/cjs/animate/index.js +24 -0
- package/cjs/animate/index.js.map +1 -0
- package/cjs/animate/morphing.d.ts +52 -0
- package/cjs/animate/morphing.js +292 -0
- package/cjs/animate/morphing.js.map +1 -0
- package/cjs/animate/timeline.d.ts +17 -0
- package/cjs/animate/timeline.js +46 -0
- package/cjs/animate/timeline.js.map +1 -0
- package/cjs/application.d.ts +1 -2
- package/cjs/application.js.map +1 -1
- package/cjs/canvas/constants.js +2 -1
- package/cjs/canvas/empty-context.d.ts +0 -1
- package/cjs/canvas/empty-context.js +0 -4
- package/cjs/canvas/empty-context.js.map +1 -1
- package/cjs/color-string/interpolate.d.ts +0 -1
- package/cjs/color-string/interpolate.js +4 -12
- package/cjs/color-string/interpolate.js.map +1 -1
- package/cjs/color-string/store.js +1 -2
- package/cjs/common/custom-path2d.js +2 -2
- package/cjs/common/custom-path2d.js.map +1 -1
- package/cjs/common/enums.d.ts +16 -0
- package/cjs/common/enums.js +11 -2
- package/cjs/common/enums.js.map +1 -1
- package/cjs/common/morphing-utils.js +124 -32
- package/cjs/common/morphing-utils.js.map +1 -1
- package/cjs/common/polygon.js +2 -5
- package/cjs/common/polygon.js.map +1 -1
- package/cjs/common/segment/curve/cubic-bezier.d.ts +2 -1
- package/cjs/common/segment/curve/cubic-bezier.js +8 -3
- package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
- package/cjs/common/segment/curve/quadratic-bezier.d.ts +0 -1
- package/cjs/common/segment/curve/quadratic-bezier.js +3 -10
- package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
- package/cjs/common/segment/index.d.ts +0 -1
- package/cjs/common/segment/index.js +1 -1
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/shape/arc.d.ts +1 -1
- package/cjs/common/shape/arc.js +3 -7
- package/cjs/common/shape/arc.js.map +1 -1
- package/cjs/common/simplify.js +2 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +2 -2
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.d.ts +2 -0
- package/cjs/common/utils.js +9 -5
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/global.d.ts +0 -3
- package/cjs/core/global.js +3 -14
- package/cjs/core/global.js.map +1 -1
- package/cjs/core/stage.d.ts +3 -8
- package/cjs/core/stage.js +20 -34
- package/cjs/core/stage.js.map +1 -1
- package/cjs/graphic/arc.d.ts +2 -1
- package/cjs/graphic/arc.js +2 -3
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/area.d.ts +2 -1
- package/cjs/graphic/area.js +1 -4
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/circle.d.ts +2 -1
- package/cjs/graphic/circle.js +2 -5
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +1 -2
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-module.js +2 -1
- package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.js +3 -2
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +12 -9
- package/cjs/graphic/graphic.js +105 -48
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +8 -8
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/line.d.ts +2 -1
- package/cjs/graphic/line.js +1 -5
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/rect.js +2 -5
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/icon.d.ts +1 -1
- package/cjs/graphic/richtext/icon.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +2 -2
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/star.d.ts +2 -1
- package/cjs/graphic/star.js +2 -4
- package/cjs/graphic/star.js.map +1 -1
- package/cjs/index.d.ts +3 -2
- package/cjs/index.js +16 -14
- package/cjs/index.js.map +1 -1
- package/cjs/interface/animate.d.ts +160 -1
- package/cjs/interface/animate.js +4 -1
- package/cjs/interface/animate.js.map +1 -1
- package/cjs/interface/context.d.ts +0 -1
- package/cjs/interface/context.js.map +1 -1
- package/cjs/interface/global.d.ts +0 -2
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/graphic.d.ts +3 -11
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/index.d.ts +1 -1
- package/cjs/interface/index.js +9 -9
- package/cjs/interface/index.js.map +1 -1
- package/cjs/interface/render.d.ts +0 -7
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +1 -4
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/modules.d.ts +1 -2
- package/cjs/modules.js +3 -4
- package/cjs/modules.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +8 -9
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +11 -14
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +10 -13
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +5 -6
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.d.ts +2 -4
- package/cjs/render/contributions/render/arc-render.js +17 -19
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +2 -2
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-render.d.ts +2 -2
- package/cjs/render/contributions/render/base-render.js +2 -2
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.d.ts +0 -1
- package/cjs/render/contributions/render/draw-contribution.js +19 -23
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +1 -2
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/group-render.d.ts +2 -2
- package/cjs/render/contributions/render/group-render.js +11 -15
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +1 -1
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/rect-render.d.ts +1 -3
- package/cjs/render/contributions/render/rect-render.js +15 -17
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.d.ts +2 -4
- package/cjs/render/contributions/render/symbol-render.js +11 -16
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/render-service.d.ts +1 -1
- package/cjs/render/render-service.js.map +1 -1
- package/dist/index.es.js +8867 -6020
- package/es/animate/Ticker/default-ticker.d.ts +40 -0
- package/es/animate/Ticker/default-ticker.js +138 -0
- package/es/animate/Ticker/default-ticker.js.map +1 -0
- package/es/animate/Ticker/index.d.ts +5 -0
- package/es/animate/Ticker/index.js +10 -0
- package/es/animate/Ticker/index.js.map +1 -0
- package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
- package/es/animate/Ticker/manual-ticker-handler.js +28 -0
- package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
- package/es/animate/Ticker/manual-ticker.d.ts +19 -0
- package/es/animate/Ticker/manual-ticker.js +31 -0
- package/es/animate/Ticker/manual-ticker.js.map +1 -0
- package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
- package/es/animate/Ticker/raf-tick-handler.js +22 -0
- package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
- package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
- package/es/animate/Ticker/timeout-tick-handler.js +20 -0
- package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
- package/es/animate/Ticker/type.d.ts +6 -0
- package/es/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
- package/es/animate/Ticker/type.js.map +1 -0
- package/es/animate/animate.d.ts +147 -0
- package/es/animate/animate.js +398 -0
- package/es/animate/animate.js.map +1 -0
- package/es/animate/config.d.ts +2 -1
- package/es/animate/config.js +5 -0
- package/es/animate/config.js.map +1 -1
- package/es/animate/custom-animate.d.ts +236 -0
- package/es/animate/custom-animate.js +703 -0
- package/es/animate/custom-animate.js.map +1 -0
- package/es/animate/default-ticker.d.ts +2 -0
- package/es/animate/default-ticker.js +12 -0
- package/es/animate/default-ticker.js.map +1 -0
- package/es/animate/easing-func.d.ts +1 -0
- package/es/animate/easing-func.js +10 -0
- package/es/animate/easing-func.js.map +1 -0
- package/es/animate/easing.d.ts +49 -0
- package/es/animate/easing.js +134 -0
- package/es/animate/easing.js.map +1 -0
- package/es/animate/group-fade.d.ts +16 -0
- package/es/animate/group-fade.js +56 -0
- package/es/animate/group-fade.js.map +1 -0
- package/es/animate/index.d.ts +8 -0
- package/es/animate/index.js +16 -0
- package/es/animate/index.js.map +1 -0
- package/es/animate/morphing.d.ts +52 -0
- package/es/animate/morphing.js +295 -0
- package/es/animate/morphing.js.map +1 -0
- package/es/animate/timeline.d.ts +17 -0
- package/es/animate/timeline.js +42 -0
- package/es/animate/timeline.js.map +1 -0
- package/es/application.d.ts +1 -2
- package/es/application.js.map +1 -1
- package/es/canvas/constants.js +2 -1
- package/es/canvas/empty-context.d.ts +0 -1
- package/es/canvas/empty-context.js +0 -4
- package/es/canvas/empty-context.js.map +1 -1
- package/es/color-string/interpolate.d.ts +0 -1
- package/es/color-string/interpolate.js +1 -8
- package/es/color-string/interpolate.js.map +1 -1
- package/es/color-string/store.js +1 -2
- package/es/common/custom-path2d.js +2 -2
- package/es/common/custom-path2d.js.map +1 -1
- package/es/common/enums.d.ts +16 -0
- package/es/common/enums.js +20 -0
- package/es/common/enums.js.map +1 -1
- package/es/common/morphing-utils.js +124 -29
- package/es/common/morphing-utils.js.map +1 -1
- package/es/common/polygon.js +3 -6
- package/es/common/polygon.js.map +1 -1
- package/es/common/segment/curve/cubic-bezier.d.ts +2 -1
- package/es/common/segment/curve/cubic-bezier.js +8 -1
- package/es/common/segment/curve/cubic-bezier.js.map +1 -1
- package/es/common/segment/curve/quadratic-bezier.d.ts +0 -1
- package/es/common/segment/curve/quadratic-bezier.js +2 -5
- package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
- package/es/common/segment/index.d.ts +0 -1
- package/es/common/segment/index.js +0 -2
- package/es/common/segment/index.js.map +1 -1
- package/es/common/shape/arc.d.ts +1 -1
- package/es/common/shape/arc.js +3 -7
- package/es/common/shape/arc.js.map +1 -1
- package/es/common/simplify.js +2 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +2 -2
- package/es/common/split-path.js.map +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.d.ts +2 -0
- package/es/common/utils.js +5 -1
- package/es/common/utils.js.map +1 -1
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/global.d.ts +0 -3
- package/es/core/global.js +2 -15
- package/es/core/global.js.map +1 -1
- package/es/core/stage.d.ts +3 -8
- package/es/core/stage.js +22 -35
- package/es/core/stage.js.map +1 -1
- package/es/graphic/arc.d.ts +2 -1
- package/es/graphic/arc.js +2 -3
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/area.d.ts +2 -1
- package/es/graphic/area.js +1 -4
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/circle.d.ts +2 -1
- package/es/graphic/circle.js +2 -4
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +1 -2
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic-service/graphic-module.js +1 -1
- package/es/graphic/graphic-service/graphic-module.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.js +4 -1
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +12 -9
- package/es/graphic/graphic.js +109 -52
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +7 -7
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/line.d.ts +2 -1
- package/es/graphic/line.js +1 -5
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/rect.js +2 -5
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/icon.d.ts +1 -1
- package/es/graphic/richtext/icon.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +2 -2
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/star.d.ts +2 -1
- package/es/graphic/star.js +2 -4
- package/es/graphic/star.js.map +1 -1
- package/es/index.d.ts +3 -2
- package/es/index.js +6 -4
- package/es/index.js.map +1 -1
- package/es/interface/animate.d.ts +160 -1
- package/es/interface/animate.js +1 -2
- package/es/interface/animate.js.map +1 -1
- package/es/interface/context.d.ts +0 -1
- package/es/interface/context.js.map +1 -1
- package/es/interface/global.d.ts +0 -2
- package/es/interface/global.js.map +1 -1
- package/es/interface/graphic.d.ts +3 -11
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/index.d.ts +1 -1
- package/es/interface/index.js +2 -2
- package/es/interface/index.js.map +1 -1
- package/es/interface/render.d.ts +0 -7
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +1 -4
- package/es/interface/stage.js.map +1 -1
- package/es/modules.d.ts +1 -2
- package/es/modules.js +0 -6
- package/es/modules.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +12 -13
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -12
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +5 -4
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/es/render/contributions/render/arc-render.d.ts +2 -4
- package/es/render/contributions/render/arc-render.js +17 -19
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +2 -2
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-render.d.ts +2 -2
- package/es/render/contributions/render/base-render.js +2 -2
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.d.ts +0 -1
- package/es/render/contributions/render/draw-contribution.js +19 -23
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +1 -2
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/group-render.d.ts +2 -2
- package/es/render/contributions/render/group-render.js +11 -15
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/line-render.js +1 -1
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/rect-render.d.ts +1 -3
- package/es/render/contributions/render/rect-render.js +14 -17
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.d.ts +2 -4
- package/es/render/contributions/render/symbol-render.js +11 -16
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/render-service.d.ts +1 -1
- package/es/render/render-service.js.map +1 -1
- package/package.json +2 -2
- package/cjs/common/diff.d.ts +0 -1
- package/cjs/common/diff.js +0 -19
- package/cjs/common/diff.js.map +0 -1
- package/cjs/common/performance-raf.d.ts +0 -8
- package/cjs/common/performance-raf.js +0 -32
- package/cjs/common/performance-raf.js.map +0 -1
- package/cjs/interface/animation/animate.d.ts +0 -117
- package/cjs/interface/animation/animate.js +0 -10
- package/cjs/interface/animation/animate.js.map +0 -1
- package/cjs/interface/animation/easing.d.ts +0 -3
- package/cjs/interface/animation/easing.js +0 -6
- package/cjs/interface/animation/easing.js.map +0 -1
- package/cjs/interface/animation/index.d.ts +0 -5
- package/cjs/interface/animation/index.js.map +0 -1
- package/cjs/interface/animation/ticker.d.ts +0 -39
- package/cjs/interface/animation/ticker.js.map +0 -1
- package/cjs/interface/animation/timeline.d.ts +0 -17
- package/cjs/interface/animation/timeline.js +0 -6
- package/cjs/interface/animation/timeline.js.map +0 -1
- package/cjs/interface/animation/type.d.ts +0 -13
- package/cjs/interface/animation/type.js +0 -15
- package/cjs/interface/animation/type.js.map +0 -1
- package/es/common/diff.d.ts +0 -1
- package/es/common/diff.js +0 -11
- package/es/common/diff.js.map +0 -1
- package/es/common/performance-raf.d.ts +0 -8
- package/es/common/performance-raf.js +0 -24
- package/es/common/performance-raf.js.map +0 -1
- package/es/interface/animation/animate.d.ts +0 -117
- package/es/interface/animation/animate.js +0 -6
- package/es/interface/animation/animate.js.map +0 -1
- package/es/interface/animation/easing.d.ts +0 -3
- package/es/interface/animation/easing.js +0 -2
- package/es/interface/animation/easing.js.map +0 -1
- package/es/interface/animation/index.d.ts +0 -5
- package/es/interface/animation/index.js +0 -10
- package/es/interface/animation/index.js.map +0 -1
- package/es/interface/animation/ticker.d.ts +0 -39
- package/es/interface/animation/ticker.js.map +0 -1
- package/es/interface/animation/timeline.d.ts +0 -17
- package/es/interface/animation/timeline.js +0 -2
- package/es/interface/animation/timeline.js.map +0 -1
- package/es/interface/animation/type.d.ts +0 -13
- package/es/interface/animation/type.js +0 -14
- package/es/interface/animation/type.js.map +0 -1
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.SubAnimate = exports.Animate = exports.CbAnimate = exports.ACustomAnimate = void 0;
|
|
6
|
+
|
|
7
|
+
const enums_1 = require("../common/enums"), easing_1 = require("./easing"), vutils_1 = require("@visactor/vutils"), timeline_1 = require("./timeline"), generator_1 = require("../common/generator");
|
|
8
|
+
|
|
9
|
+
class ACustomAnimate {
|
|
10
|
+
constructor(from, to, duration, easing, params) {
|
|
11
|
+
this.from = from, this.to = to, this.duration = duration, this.easing = easing,
|
|
12
|
+
this.params = params, this.updateCount = 0;
|
|
13
|
+
}
|
|
14
|
+
bind(target, subAni) {
|
|
15
|
+
this.target = target, this.subAnimate = subAni, this.onBind();
|
|
16
|
+
}
|
|
17
|
+
onBind() {}
|
|
18
|
+
onFirstRun() {}
|
|
19
|
+
onStart() {}
|
|
20
|
+
onEnd() {}
|
|
21
|
+
getEndProps() {
|
|
22
|
+
return this.to;
|
|
23
|
+
}
|
|
24
|
+
getFromProps() {
|
|
25
|
+
return this.from;
|
|
26
|
+
}
|
|
27
|
+
getMergedEndProps() {
|
|
28
|
+
var _a;
|
|
29
|
+
const thisEndProps = this.getEndProps();
|
|
30
|
+
return thisEndProps ? this._endProps === thisEndProps ? this._mergedEndProps : (this._endProps = thisEndProps,
|
|
31
|
+
void (this._mergedEndProps = Object.assign({}, null !== (_a = this.step.prev.getLastProps()) && void 0 !== _a ? _a : {}, thisEndProps))) : this.step.prev ? this.step.prev.getLastProps() : thisEndProps;
|
|
32
|
+
}
|
|
33
|
+
update(end, ratio, out) {
|
|
34
|
+
if (0 === this.updateCount) {
|
|
35
|
+
this.onFirstRun();
|
|
36
|
+
const props = this.step.getLastProps();
|
|
37
|
+
Object.keys(props).forEach((k => {
|
|
38
|
+
this.subAnimate.animate.validAttr(k) && (out[k] = props[k]);
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
this.updateCount += 1, this.onUpdate(end, ratio, out), end && this.onEnd();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.ACustomAnimate = ACustomAnimate;
|
|
46
|
+
|
|
47
|
+
class CbAnimate extends ACustomAnimate {
|
|
48
|
+
constructor(cb) {
|
|
49
|
+
super(null, null, 0, "linear"), this.cb = cb;
|
|
50
|
+
}
|
|
51
|
+
onUpdate(end, ratio, out) {}
|
|
52
|
+
onStart() {
|
|
53
|
+
this.cb();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exports.CbAnimate = CbAnimate;
|
|
58
|
+
|
|
59
|
+
class Animate {
|
|
60
|
+
constructor(id = generator_1.Generator.GenAutoIncrementId(), timeline = timeline_1.defaultTimeline, slience) {
|
|
61
|
+
this.id = id, this.timeline = timeline || timeline_1.defaultTimeline, this.status = enums_1.AnimateStatus.INITIAL,
|
|
62
|
+
this.tailAnimate = new SubAnimate(this), this.subAnimates = [ this.tailAnimate ],
|
|
63
|
+
this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0,
|
|
64
|
+
this.timeline.addAnimate(this), this.slience = slience;
|
|
65
|
+
}
|
|
66
|
+
setTimeline(timeline) {
|
|
67
|
+
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|
|
68
|
+
}
|
|
69
|
+
getStartTime() {
|
|
70
|
+
return this._startTime;
|
|
71
|
+
}
|
|
72
|
+
getDuration() {
|
|
73
|
+
return this.subAnimates.reduce(((t, subAnimate) => t + subAnimate.totalDuration), 0);
|
|
74
|
+
}
|
|
75
|
+
after(animate) {
|
|
76
|
+
const t = animate.getDuration();
|
|
77
|
+
return this._startTime = t, this;
|
|
78
|
+
}
|
|
79
|
+
afterAll(list) {
|
|
80
|
+
let maxT = -1 / 0;
|
|
81
|
+
return list.forEach((a => {
|
|
82
|
+
maxT = (0, vutils_1.max)(a.getDuration(), maxT);
|
|
83
|
+
})), this._startTime = maxT, this;
|
|
84
|
+
}
|
|
85
|
+
parallel(animate) {
|
|
86
|
+
return this._startTime = animate.getStartTime(), this;
|
|
87
|
+
}
|
|
88
|
+
static AddInterpolate(name, cb) {
|
|
89
|
+
Animate.interpolateMap.set(name, cb);
|
|
90
|
+
}
|
|
91
|
+
play(customAnimate) {
|
|
92
|
+
if (this.tailAnimate.play(customAnimate), this.target) {
|
|
93
|
+
const stage = this.target.stage;
|
|
94
|
+
stage && stage.renderNextFrame();
|
|
95
|
+
}
|
|
96
|
+
return 1 === this.subAnimates.length && this.tailAnimate.totalDuration === customAnimate.duration && this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode),
|
|
97
|
+
this;
|
|
98
|
+
}
|
|
99
|
+
trySetAttribute(attr, mode = Animate.mode) {
|
|
100
|
+
attr && mode & enums_1.AnimateMode.SET_ATTR_IMMEDIATELY && this.target.setAttributes && this.target.setAttributes(attr, !1, {
|
|
101
|
+
type: enums_1.AttributeUpdateType.ANIMATE_PLAY
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
runCb(cb) {
|
|
105
|
+
const customAnimate = new CbAnimate((() => {
|
|
106
|
+
cb(this, customAnimate.step.prev);
|
|
107
|
+
}));
|
|
108
|
+
return this.tailAnimate.play(customAnimate), this;
|
|
109
|
+
}
|
|
110
|
+
customInterpolate(key, ratio, from, to, target, ret) {
|
|
111
|
+
const func = Animate.interpolateMap.get(key) || Animate.interpolateMap.get("");
|
|
112
|
+
return !!func && func(key, ratio, from, to, target, ret);
|
|
113
|
+
}
|
|
114
|
+
pause() {
|
|
115
|
+
this.status === enums_1.AnimateStatus.RUNNING && (this.status = enums_1.AnimateStatus.PAUSED);
|
|
116
|
+
}
|
|
117
|
+
resume() {
|
|
118
|
+
this.status === enums_1.AnimateStatus.PAUSED && (this.status = enums_1.AnimateStatus.RUNNING);
|
|
119
|
+
}
|
|
120
|
+
to(props, duration, easing, params) {
|
|
121
|
+
if (this.tailAnimate.to(props, duration, easing, params), this.target) {
|
|
122
|
+
const stage = this.target.stage;
|
|
123
|
+
stage && stage.renderNextFrame();
|
|
124
|
+
}
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
from(props, duration, easing, params) {
|
|
128
|
+
if (this.tailAnimate.from(props, duration, easing, params), this.target) {
|
|
129
|
+
const stage = this.target.stage;
|
|
130
|
+
stage && stage.renderNextFrame();
|
|
131
|
+
}
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
wait(duration) {
|
|
135
|
+
if (this.tailAnimate.wait(duration), this.target) {
|
|
136
|
+
const stage = this.target.stage;
|
|
137
|
+
stage && stage.renderNextFrame();
|
|
138
|
+
}
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
startAt(t) {
|
|
142
|
+
if (this.tailAnimate.startAt(t), this.target) {
|
|
143
|
+
const stage = this.target.stage;
|
|
144
|
+
stage && stage.renderNextFrame();
|
|
145
|
+
}
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
loop(l) {
|
|
149
|
+
if (this.tailAnimate.loop = l, this.target) {
|
|
150
|
+
const stage = this.target.stage;
|
|
151
|
+
stage && stage.renderNextFrame();
|
|
152
|
+
}
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
reversed(r) {
|
|
156
|
+
if (this.tailAnimate.reversed = r, this.target) {
|
|
157
|
+
const stage = this.target.stage;
|
|
158
|
+
stage && stage.renderNextFrame();
|
|
159
|
+
}
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
bounce(b) {
|
|
163
|
+
if (this.tailAnimate.bounce = b, this.target) {
|
|
164
|
+
const stage = this.target.stage;
|
|
165
|
+
stage && stage.renderNextFrame();
|
|
166
|
+
}
|
|
167
|
+
return this;
|
|
168
|
+
}
|
|
169
|
+
subAnimate() {
|
|
170
|
+
const sa = new SubAnimate(this, this.tailAnimate);
|
|
171
|
+
return this.tailAnimate = sa, this.subAnimates.push(sa), sa.bind(this.target), this;
|
|
172
|
+
}
|
|
173
|
+
getStartProps() {
|
|
174
|
+
return this.subAnimates[0].getStartProps();
|
|
175
|
+
}
|
|
176
|
+
getEndProps() {
|
|
177
|
+
return this.tailAnimate.getEndProps();
|
|
178
|
+
}
|
|
179
|
+
depreventAttr(key) {
|
|
180
|
+
this._preventAttrs && this._preventAttrs.delete(key);
|
|
181
|
+
}
|
|
182
|
+
preventAttr(key) {
|
|
183
|
+
this._preventAttrs || (this._preventAttrs = new Set), this._preventAttrs.add(key);
|
|
184
|
+
}
|
|
185
|
+
preventAttrs(keys) {
|
|
186
|
+
keys.forEach((key => this.preventAttr(key)));
|
|
187
|
+
}
|
|
188
|
+
validAttr(key) {
|
|
189
|
+
return !this._preventAttrs || !this._preventAttrs.has(key);
|
|
190
|
+
}
|
|
191
|
+
bind(target) {
|
|
192
|
+
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this),
|
|
193
|
+
this.subAnimates.forEach((sa => {
|
|
194
|
+
sa.bind(target);
|
|
195
|
+
})), this;
|
|
196
|
+
}
|
|
197
|
+
advance(delta) {
|
|
198
|
+
if (this._duringTime < this._startTime) {
|
|
199
|
+
if (this._duringTime + delta * this.timeScale < this._startTime) return void (this._duringTime += delta * this.timeScale);
|
|
200
|
+
delta = this._duringTime + delta * this.timeScale - this._startTime, this._duringTime = this._startTime;
|
|
201
|
+
}
|
|
202
|
+
this.status === enums_1.AnimateStatus.INITIAL && (this.status = enums_1.AnimateStatus.RUNNING,
|
|
203
|
+
this._onStart && this._onStart.forEach((cb => cb())));
|
|
204
|
+
this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale) && this.status === enums_1.AnimateStatus.RUNNING && (this.status = enums_1.AnimateStatus.END,
|
|
205
|
+
this._onEnd && this._onEnd.forEach((cb => cb())));
|
|
206
|
+
}
|
|
207
|
+
setPosition(rawPosition) {
|
|
208
|
+
let sa, d = 0;
|
|
209
|
+
const prevRawPos = this.rawPosition, maxRawPos = this.subAnimates.reduce(((a, b) => a + b.totalDuration), 0);
|
|
210
|
+
rawPosition < 0 && (rawPosition = 0);
|
|
211
|
+
const end = rawPosition >= maxRawPos;
|
|
212
|
+
if (end && (rawPosition = maxRawPos), rawPosition === prevRawPos) return end;
|
|
213
|
+
for (let i = 0; i < this.subAnimates.length && (sa = this.subAnimates[i], !(d + sa.totalDuration >= rawPosition)); i++) d += sa.totalDuration,
|
|
214
|
+
sa = void 0;
|
|
215
|
+
return this.rawPosition = rawPosition, sa.setPosition(rawPosition - d), end;
|
|
216
|
+
}
|
|
217
|
+
onStart(cb) {
|
|
218
|
+
this._onStart || (this._onStart = []), this._onStart.push(cb);
|
|
219
|
+
}
|
|
220
|
+
onEnd(cb) {
|
|
221
|
+
this._onEnd || (this._onEnd = []), this._onEnd.push(cb);
|
|
222
|
+
}
|
|
223
|
+
onRemove(cb) {
|
|
224
|
+
this._onRemove || (this._onRemove = []), this._onRemove.push(cb);
|
|
225
|
+
}
|
|
226
|
+
onFrame(cb) {
|
|
227
|
+
this._onFrame || (this._onFrame = []), this._onFrame.push(cb);
|
|
228
|
+
}
|
|
229
|
+
release() {
|
|
230
|
+
this.status = enums_1.AnimateStatus.END;
|
|
231
|
+
}
|
|
232
|
+
stop(nextVal) {
|
|
233
|
+
nextVal || this.target.onStop(), "start" === nextVal ? this.target.onStop(this.getStartProps()) : "end" === nextVal ? this.target.onStop(this.getEndProps()) : this.target.onStop(nextVal),
|
|
234
|
+
this.release();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
exports.Animate = Animate, Animate.mode = enums_1.AnimateMode.NORMAL, Animate.interpolateMap = new Map;
|
|
239
|
+
|
|
240
|
+
class SubAnimate {
|
|
241
|
+
get totalDuration() {
|
|
242
|
+
return this.calcAttr(), this._totalDuration + this._startAt;
|
|
243
|
+
}
|
|
244
|
+
constructor(animate, lastSubAnimate) {
|
|
245
|
+
this.rawPosition = -1, this.position = 0, this.loop = 0, this.duration = 0, this.animate = animate,
|
|
246
|
+
this.stepHead = new Step(0, 0, lastSubAnimate ? Object.assign({}, lastSubAnimate.stepTail.props) : {}),
|
|
247
|
+
this.stepTail = this.stepHead, this.dirty = !0, this._startAt = 0;
|
|
248
|
+
}
|
|
249
|
+
calcAttr() {
|
|
250
|
+
this.dirty && (this._totalDuration = this.duration * (this.loop + 1));
|
|
251
|
+
}
|
|
252
|
+
bind(target) {
|
|
253
|
+
return this.target = target, this;
|
|
254
|
+
}
|
|
255
|
+
play(customAnimate) {
|
|
256
|
+
let duration = customAnimate.duration;
|
|
257
|
+
(null == duration || duration < 0) && (duration = 0);
|
|
258
|
+
const easing = customAnimate.easing, easingFunc = "string" == typeof easing ? easing_1.Easing[easing] : easing, step = this._addStep(duration, null, easingFunc);
|
|
259
|
+
return step.type = enums_1.AnimateStepType.customAnimate, this._appendProps(customAnimate.getEndProps(), step, !1),
|
|
260
|
+
this._appendCustomAnimate(customAnimate, step), this;
|
|
261
|
+
}
|
|
262
|
+
to(props, duration, easing, params) {
|
|
263
|
+
(null == duration || duration < 0) && (duration = 0);
|
|
264
|
+
const easingFunc = "string" == typeof easing ? easing_1.Easing[easing] : easing, step = this._addStep(duration, null, easingFunc);
|
|
265
|
+
return step.type = enums_1.AnimateStepType.to, this._appendProps(props, step, !!params && params.tempProps),
|
|
266
|
+
step.propKeys || (step.propKeys = Object.keys(step.props)), params && params.noPreventAttrs || this.target.animates && this.target.animates.forEach((a => {
|
|
267
|
+
a.id !== this.animate.id && a.preventAttrs(step.propKeys);
|
|
268
|
+
})), this;
|
|
269
|
+
}
|
|
270
|
+
from(props, duration, easing, params) {
|
|
271
|
+
this.to(props, 0, easing, params);
|
|
272
|
+
const toProps = {};
|
|
273
|
+
this.stepTail.propKeys || (this.stepTail.propKeys = Object.keys(this.stepTail.props)),
|
|
274
|
+
this.stepTail.propKeys.forEach((k => {
|
|
275
|
+
toProps[k] = this.getLastPropByName(k, this.stepTail);
|
|
276
|
+
})), this.to(toProps, duration, easing, params), this.stepTail.type = enums_1.AnimateStepType.from;
|
|
277
|
+
}
|
|
278
|
+
startAt(t) {
|
|
279
|
+
return t < 0 && (t = 0), this._startAt = t, this;
|
|
280
|
+
}
|
|
281
|
+
getStartProps() {
|
|
282
|
+
var _a;
|
|
283
|
+
return null === (_a = this.stepHead) || void 0 === _a ? void 0 : _a.props;
|
|
284
|
+
}
|
|
285
|
+
getEndProps() {
|
|
286
|
+
return this.stepTail.props;
|
|
287
|
+
}
|
|
288
|
+
getLastStep() {
|
|
289
|
+
return this._lastStep;
|
|
290
|
+
}
|
|
291
|
+
wait(duration) {
|
|
292
|
+
if (duration > 0) {
|
|
293
|
+
const step = this._addStep(+duration, null);
|
|
294
|
+
step.type = enums_1.AnimateStepType.wait, step.prev.customAnimate ? step.props = step.prev.customAnimate.getEndProps() : step.props = step.prev.props,
|
|
295
|
+
this.target.onAddStep && this.target.onAddStep(step);
|
|
296
|
+
}
|
|
297
|
+
return this;
|
|
298
|
+
}
|
|
299
|
+
_addStep(duration, props, easingFunc) {
|
|
300
|
+
const step = new Step(this.duration, duration, props, easingFunc);
|
|
301
|
+
return this.duration += duration, this.stepTail.append(step), this.stepTail = step,
|
|
302
|
+
step;
|
|
303
|
+
}
|
|
304
|
+
_appendProps(props, step, tempProps) {
|
|
305
|
+
step.props = tempProps ? props : Object.assign({}, props);
|
|
306
|
+
let lastStep = step.prev;
|
|
307
|
+
const _props = step.props;
|
|
308
|
+
for (step.propKeys || (step.propKeys = Object.keys(step.props)), step.propKeys.forEach((k => {
|
|
309
|
+
void 0 === step.props[k] && (step.props[k] = this.target.getDefaultAttribute(k));
|
|
310
|
+
})); lastStep.prev; ) lastStep.props && (lastStep.propKeys || (lastStep.propKeys = Object.keys(lastStep.props)),
|
|
311
|
+
lastStep.propKeys.forEach((key => {
|
|
312
|
+
void 0 === _props[key] && (_props[key] = lastStep.props[key]);
|
|
313
|
+
}))), step.propKeys = Object.keys(step.props), lastStep = lastStep.prev;
|
|
314
|
+
const initProps = this.stepHead.props;
|
|
315
|
+
step.propKeys || (step.propKeys = Object.keys(_props)), step.propKeys.forEach((key => {
|
|
316
|
+
if (void 0 === initProps[key]) {
|
|
317
|
+
const parentAnimateInitProps = this.animate.getStartProps();
|
|
318
|
+
initProps[key] = parentAnimateInitProps[key] = this.target.getComputedAttribute(key);
|
|
319
|
+
}
|
|
320
|
+
})), this.target.onAddStep && this.target.onAddStep(step);
|
|
321
|
+
}
|
|
322
|
+
_appendCustomAnimate(customAnimate, step) {
|
|
323
|
+
step.customAnimate = customAnimate, customAnimate.step = step, customAnimate.bind(this.target, this);
|
|
324
|
+
}
|
|
325
|
+
setPosition(rawPosition) {
|
|
326
|
+
var _a;
|
|
327
|
+
const d = this.duration, loopCount = this.loop, prevRawPos = this.rawPosition;
|
|
328
|
+
let loop, position, end = !1;
|
|
329
|
+
const startAt = null !== (_a = this._startAt) && void 0 !== _a ? _a : 0;
|
|
330
|
+
if (rawPosition < 0 && (rawPosition = 0), rawPosition < startAt) return this.rawPosition = rawPosition,
|
|
331
|
+
!1;
|
|
332
|
+
if (rawPosition -= startAt, d <= 0 && (end = !0, d < 0)) return end;
|
|
333
|
+
if (loop = Math.floor(rawPosition / d), position = rawPosition - loop * d, end = rawPosition >= loopCount * d + d,
|
|
334
|
+
end && (position = d, loop = loopCount, rawPosition = position * loop + d), rawPosition === prevRawPos) return end;
|
|
335
|
+
const rev = !this.reversed != !(this.bounce && loop % 2);
|
|
336
|
+
return rev && (position = d - position), this._deltaPosition = position - this.position,
|
|
337
|
+
this.position = position, this.rawPosition = rawPosition + startAt, this.updatePosition(end, rev),
|
|
338
|
+
end;
|
|
339
|
+
}
|
|
340
|
+
updatePosition(end, rev) {
|
|
341
|
+
if (!this.stepHead) return;
|
|
342
|
+
let step = this.stepHead.next;
|
|
343
|
+
const position = this.position, duration = this.duration;
|
|
344
|
+
if (this.target && step) {
|
|
345
|
+
let stepNext = step.next;
|
|
346
|
+
for (;stepNext && stepNext.position <= position; ) step = stepNext, stepNext = step.next;
|
|
347
|
+
let ratio = end ? 0 === duration ? 1 : position / duration : (position - step.position) / step.duration;
|
|
348
|
+
step.easing && (ratio = step.easing(ratio)), this.tryCallCustomAnimateLifeCycle(step, this._lastStep || (rev ? this.stepTail : this.stepHead), rev),
|
|
349
|
+
this.updateTarget(step, ratio, end), this._lastStep = step, this.animate._onFrame && this.animate._onFrame.forEach((cb => cb(step, ratio)));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
tryCallCustomAnimateLifeCycle(step, lastStep, rev) {
|
|
353
|
+
if (step !== lastStep) if (rev) {
|
|
354
|
+
let _step = lastStep.prev;
|
|
355
|
+
for (;_step && _step !== step; ) _step.customAnimate && (_step.customAnimate.onStart && _step.customAnimate.onStart(),
|
|
356
|
+
_step.customAnimate.onEnd && _step.customAnimate.onEnd()), _step = step.prev;
|
|
357
|
+
lastStep && lastStep.customAnimate && lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd(),
|
|
358
|
+
step && step.customAnimate && step.customAnimate.onStart && step.customAnimate.onStart();
|
|
359
|
+
} else {
|
|
360
|
+
let _step = lastStep.next;
|
|
361
|
+
for (;_step && _step !== step; ) _step.customAnimate && (_step.customAnimate.onStart && _step.customAnimate.onStart(),
|
|
362
|
+
_step.customAnimate.onEnd && _step.customAnimate.onEnd()), _step = _step.next;
|
|
363
|
+
lastStep && lastStep.customAnimate && lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd(),
|
|
364
|
+
step && step.customAnimate && step.customAnimate.onStart && step.customAnimate.onStart();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
getLastPropByName(name, step) {
|
|
368
|
+
let lastStep = step.prev;
|
|
369
|
+
for (;lastStep; ) {
|
|
370
|
+
if (lastStep.props && void 0 !== lastStep.props[name]) return lastStep.props[name];
|
|
371
|
+
if (lastStep.customAnimate) {
|
|
372
|
+
const val = lastStep.customAnimate.getEndProps()[name];
|
|
373
|
+
if (void 0 !== val) return val;
|
|
374
|
+
}
|
|
375
|
+
lastStep = lastStep.prev;
|
|
376
|
+
}
|
|
377
|
+
return vutils_1.Logger.getInstance().warn("未知错误,step中找不到属性"), step.props[name];
|
|
378
|
+
}
|
|
379
|
+
updateTarget(step, ratio, end) {
|
|
380
|
+
null == step.props && null == step.customAnimate || this.target.onStep(this, this.animate, step, ratio, end);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
exports.SubAnimate = SubAnimate;
|
|
385
|
+
|
|
386
|
+
class Step {
|
|
387
|
+
constructor(position, duration, props, easing) {
|
|
388
|
+
this.duration = duration, this.position = position, this.props = props, this.easing = easing;
|
|
389
|
+
}
|
|
390
|
+
append(step) {
|
|
391
|
+
step.prev = this, step.next = this.next, this.next = step;
|
|
392
|
+
}
|
|
393
|
+
getLastProps() {
|
|
394
|
+
let step = this.prev;
|
|
395
|
+
for (;step; ) {
|
|
396
|
+
if (step.props) return step.props;
|
|
397
|
+
if (step.customAnimate) return step.customAnimate.getMergedEndProps();
|
|
398
|
+
step = step.prev;
|
|
399
|
+
}
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
//# sourceMappingURL=animate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animate/animate.ts"],"names":[],"mappings":";;;AAaA,2CAAmG;AACnG,qCAAkC;AAClC,6CAA+C;AAC/C,yCAA6C;AAC7C,mDAAgD;AA2BhD,MAAsB,cAAc;IAgBlC,YAAY,IAAO,EAAE,EAAK,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,MAAsB,EAAE,MAAmB;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAGD,MAAM;QACJ,OAAO;IACT,CAAC;IAGD,UAAU;QACR,OAAO;IACT,CAAC;IAGD,OAAO;QACL,OAAO;IACT,CAAC;IAGD,KAAK;QACH,OAAO;IACT,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,iBAAiB;;QACf,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,IAAI,YAAY,EAAE;YAChB,IAAI,IAAI,CAAC,SAAS,KAAK,YAAY,EAAE;gBAC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AAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,IAAU;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,YAAY;QACV,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,OAAO,IAAI,EAAE;YACX,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;iBAAM,IAAI,IAAI,CAAC,aAAa,EAAE;gBAC7B,OAAO,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;aAC/C;YACD,IAAI,GAAG,IAAI,CAAC,IAAW,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"animate.js","sourcesContent":["import type {\n EasingType,\n EasingTypeFunc,\n IAnimate,\n IAnimateStepType,\n IAnimateTarget,\n ICustomAnimate,\n IGraphic,\n IStep,\n IStepConfig,\n ISubAnimate,\n ITimeline\n} from '../interface';\nimport { AnimateMode, AnimateStatus, AnimateStepType, AttributeUpdateType } from '../common/enums';\nimport { Easing } from './easing';\nimport { Logger, max } from '@visactor/vutils';\nimport { defaultTimeline } from './timeline';\nimport { Generator } from '../common/generator';\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\n/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\nexport abstract class ACustomAnimate<T> implements ICustomAnimate {\n declare from: T;\n declare to: T;\n declare duration: number;\n declare easing: EasingType;\n declare params: any;\n declare target: IAnimateTarget;\n declare updateCount: number;\n declare subAnimate: ISubAnimate;\n declare step?: IStep;\n declare mode?: AnimateMode;\n\n // 用于判断是否一致\n declare _endProps?: any;\n declare _mergedEndProps?: any;\n\n constructor(from: T, to: T, duration: number, easing: EasingType, params?: any) {\n this.from = from;\n this.to = to;\n this.duration = duration;\n this.easing = easing;\n this.params = params;\n this.updateCount = 0;\n }\n\n bind(target: IAnimateTarget, subAni: ISubAnimate) {\n this.target = target;\n this.subAnimate = subAni;\n this.onBind();\n }\n\n // 在第一次调用的时候触发\n onBind() {\n return;\n }\n\n // 第一次执行的时候调用\n onFirstRun() {\n return;\n }\n\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart() {\n return;\n }\n\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd() {\n return;\n }\n\n getEndProps(): Record<string, any> | void {\n return this.to;\n }\n\n getFromProps(): Record<string, any> | void {\n return this.from;\n }\n\n getMergedEndProps(): Record<string, any> | void {\n const thisEndProps = this.getEndProps();\n if (thisEndProps) {\n if (this._endProps === thisEndProps) {\n return this._mergedEndProps;\n }\n this._endProps = thisEndProps;\n this._mergedEndProps = Object.assign({}, this.step.prev.getLastProps() ?? {}, thisEndProps);\n return;\n }\n return this.step.prev ? this.step.prev.getLastProps() : thisEndProps;\n }\n\n // abstract getFromValue(key: string): any;\n // abstract getToValue(key: string): any;\n\n abstract onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updateCount === 0) {\n this.onFirstRun();\n // out添加之前的props\n const props = this.step.getLastProps();\n Object.keys(props).forEach(k => {\n if (this.subAnimate.animate.validAttr(k)) {\n out[k] = props[k];\n }\n });\n }\n this.updateCount += 1;\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n}\n\nexport class CbAnimate extends ACustomAnimate<null> {\n cb: () => void;\n\n constructor(cb: () => void) {\n super(null, null, 0, 'linear');\n this.cb = cb;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n return;\n }\n\n onStart(): void {\n this.cb();\n }\n}\n\ntype InterpolateFunc = (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n out: Record<string, any>\n) => boolean;\n\nexport class Animate implements IAnimate {\n static mode: AnimateMode = AnimateMode.NORMAL;\n declare target: IAnimateTarget;\n declare timeline: ITimeline;\n declare nextAnimate?: IAnimate;\n declare prevAnimate?: IAnimate;\n // 当前Animate的状态,正常,暂停,结束\n declare status: AnimateStatus;\n declare readonly id: string | number;\n // 开始时间\n protected declare _startTime: number;\n protected declare _duringTime: number;\n declare subAnimates: SubAnimate[];\n declare tailAnimate: SubAnimate;\n\n // 绝对的位置\n declare rawPosition: number;\n // 时间倍速缩放\n declare timeScale: number;\n\n declare interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n declare _onStart?: (() => void)[];\n declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n declare _onEnd?: (() => void)[];\n declare _onRemove?: (() => void)[];\n declare _preventAttrs?: Set<string>;\n static interpolateMap: Map<string, InterpolateFunc> = new Map();\n slience?: boolean;\n\n constructor(\n id: string | number = Generator.GenAutoIncrementId(),\n timeline: ITimeline = defaultTimeline,\n slience?: boolean\n ) {\n this.id = id;\n this.timeline = timeline || defaultTimeline;\n this.status = AnimateStatus.INITIAL;\n this.tailAnimate = new SubAnimate(this);\n this.subAnimates = [this.tailAnimate];\n this.timeScale = 1;\n this.rawPosition = -1;\n this._startTime = 0;\n this._duringTime = 0;\n this.timeline.addAnimate(this);\n this.slience = slience;\n }\n\n setTimeline(timeline: ITimeline) {\n if (timeline === this.timeline) {\n return;\n }\n this.timeline.removeAnimate(this, false);\n timeline.addAnimate(this);\n }\n\n getStartTime(): number {\n return this._startTime;\n }\n\n getDuration(): number {\n return this.subAnimates.reduce((t, subAnimate) => t + subAnimate.totalDuration, 0);\n }\n\n after(animate: IAnimate) {\n const t = animate.getDuration();\n this._startTime = t;\n return this;\n }\n\n afterAll(list: IAnimate[]) {\n let maxT = -Infinity;\n list.forEach(a => {\n maxT = max(a.getDuration(), maxT);\n });\n this._startTime = maxT;\n return this;\n }\n\n parallel(animate: IAnimate) {\n this._startTime = animate.getStartTime();\n return this;\n }\n\n static AddInterpolate(name: string, cb: InterpolateFunc) {\n Animate.interpolateMap.set(name, cb);\n }\n\n play(customAnimate: ICustomAnimate) {\n this.tailAnimate.play(customAnimate);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n if (this.subAnimates.length === 1 && this.tailAnimate.totalDuration === customAnimate.duration) {\n this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode);\n }\n return this;\n }\n\n trySetAttribute(attr: Record<string, any> | void, mode: AnimateMode = Animate.mode) {\n if (attr && mode & AnimateMode.SET_ATTR_IMMEDIATELY) {\n (this.target as any).setAttributes &&\n (this.target as any).setAttributes(attr, false, { type: AttributeUpdateType.ANIMATE_PLAY });\n }\n }\n\n runCb(cb: (a: IAnimate, step: IStep) => void) {\n // this.tailAnimate.runCb(cb);\n const customAnimate = new CbAnimate(() => {\n cb(this, customAnimate.step.prev);\n });\n this.tailAnimate.play(customAnimate);\n return this;\n }\n\n /**\n * 自定义插值,返回false表示没有匹配上\n * @param key\n * @param from\n * @param to\n */\n customInterpolate(\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ): boolean {\n const func = Animate.interpolateMap.get(key) || Animate.interpolateMap.get('');\n if (!func) {\n return false;\n }\n return func(key, ratio, from, to, target, ret);\n }\n\n pause() {\n if (this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.PAUSED;\n }\n }\n\n resume() {\n if (this.status === AnimateStatus.PAUSED) {\n this.status = AnimateStatus.RUNNING;\n }\n }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.to(props, duration, easing, params);\n // 默认开始动画\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n // if (this.subAnimates.length === 1 && this.tailAnimate.duration === duration) {\n // this.trySetAttribute(props);\n // }\n return this;\n }\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.from(props, duration, easing, params);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n wait(duration: number) {\n this.tailAnimate.wait(duration);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n startAt(t: number) {\n this.tailAnimate.startAt(t);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n loop(l: number) {\n this.tailAnimate.loop = l;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n reversed(r: boolean) {\n this.tailAnimate.reversed = r;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n bounce(b: boolean) {\n this.tailAnimate.bounce = b;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n subAnimate() {\n const sa = new SubAnimate(this, this.tailAnimate);\n this.tailAnimate = sa;\n this.subAnimates.push(sa);\n sa.bind(this.target);\n return this;\n }\n\n getStartProps(): Record<string, any> {\n return this.subAnimates[0].getStartProps();\n }\n\n getEndProps(): Record<string, any> {\n return this.tailAnimate.getEndProps();\n }\n\n depreventAttr(key: string) {\n if (!this._preventAttrs) {\n return;\n }\n this._preventAttrs.delete(key);\n }\n preventAttr(key: string) {\n if (!this._preventAttrs) {\n this._preventAttrs = new Set();\n }\n this._preventAttrs.add(key);\n }\n preventAttrs(keys: string[]) {\n keys.forEach(key => this.preventAttr(key));\n }\n validAttr(key: string): boolean {\n if (!this._preventAttrs) {\n return true;\n }\n return !this._preventAttrs.has(key);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n\n if (this.target.onAnimateBind && !this.slience) {\n this.target.onAnimateBind(this);\n }\n\n this.subAnimates.forEach(sa => {\n sa.bind(target);\n });\n return this;\n }\n\n advance(delta: number) {\n // startTime之前的时间不计入耗时\n if (this._duringTime < this._startTime) {\n if (this._duringTime + delta * this.timeScale < this._startTime) {\n this._duringTime += delta * this.timeScale;\n return;\n }\n delta = this._duringTime + delta * this.timeScale - this._startTime;\n this._duringTime = this._startTime;\n }\n // 执行advance\n if (this.status === AnimateStatus.INITIAL) {\n this.status = AnimateStatus.RUNNING;\n this._onStart && this._onStart.forEach(cb => cb());\n }\n const end = this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale);\n if (end && this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.END;\n this._onEnd && this._onEnd.forEach(cb => cb());\n }\n }\n\n setPosition(rawPosition: number): boolean {\n let d = 0;\n let sa: SubAnimate | undefined;\n const prevRawPos = this.rawPosition;\n const maxRawPos = this.subAnimates.reduce((a, b) => a + b.totalDuration, 0);\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n\n const end = rawPosition >= maxRawPos;\n\n if (end) {\n rawPosition = maxRawPos;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // 查找对应的subAnimate\n for (let i = 0; i < this.subAnimates.length; i++) {\n sa = this.subAnimates[i];\n if (d + sa.totalDuration >= rawPosition) {\n break;\n } else {\n d += sa.totalDuration;\n sa = undefined;\n }\n }\n this.rawPosition = rawPosition;\n sa.setPosition(rawPosition - d);\n\n return end;\n }\n\n onStart(cb: () => void) {\n if (!this._onStart) {\n this._onStart = [];\n }\n this._onStart.push(cb);\n }\n onEnd(cb: () => void) {\n if (!this._onEnd) {\n this._onEnd = [];\n }\n this._onEnd.push(cb);\n }\n onRemove(cb: () => void) {\n if (!this._onRemove) {\n this._onRemove = [];\n }\n this._onRemove.push(cb);\n }\n onFrame(cb: (step: IStep, ratio: number) => void) {\n if (!this._onFrame) {\n this._onFrame = [];\n }\n this._onFrame.push(cb);\n }\n release() {\n this.status = AnimateStatus.END;\n return;\n }\n\n stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n if (!nextVal) {\n this.target.onStop();\n }\n if (nextVal === 'start') {\n this.target.onStop(this.getStartProps());\n } else if (nextVal === 'end') {\n this.target.onStop(this.getEndProps());\n } else {\n this.target.onStop(nextVal);\n }\n this.release();\n }\n}\n\n// Animate.mode |= AnimateMode.SET_ATTR_IMMEDIATELY;\n\nexport class SubAnimate implements ISubAnimate {\n declare target: IAnimateTarget;\n declare animate: IAnimate;\n // 默认的初始step,一定存在,且stepHead的props一定保存整个subAnimate阶段所有属性的最初\n protected declare stepHead: Step;\n protected declare stepTail: Step;\n // 结束时反转动画\n declare bounce: boolean;\n // 是否reverse\n declare reversed: boolean;\n // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n declare loop: number;\n // 持续时间,不包括循环\n declare duration: number;\n // 位置,在[0, duration]之间\n declare position: number;\n // 绝对的位置,在[0, loops * duration]之间\n declare rawPosition: number;\n declare dirty: boolean;\n\n declare _totalDuration: number;\n declare _startAt: number;\n declare _lastStep: IStep;\n declare _deltaPosition: number;\n\n get totalDuration(): number {\n this.calcAttr();\n return this._totalDuration + this._startAt;\n }\n\n constructor(animate: IAnimate, lastSubAnimate?: SubAnimate) {\n this.rawPosition = -1;\n this.position = 0;\n this.loop = 0;\n this.duration = 0;\n this.animate = animate;\n if (lastSubAnimate) {\n this.stepHead = new Step(0, 0, Object.assign({}, lastSubAnimate.stepTail.props));\n } else {\n this.stepHead = new Step(0, 0, {});\n }\n this.stepTail = this.stepHead;\n this.dirty = true;\n this._startAt = 0;\n }\n\n // 计算按需计算的属性\n protected calcAttr() {\n if (!this.dirty) {\n return;\n }\n\n this._totalDuration = this.duration * (this.loop + 1);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n return this;\n }\n\n play(customAnimate: ICustomAnimate) {\n let duration = customAnimate.duration;\n if (duration == null || duration < 0) {\n duration = 0;\n }\n const easing = customAnimate.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.customAnimate;\n this._appendProps(customAnimate.getEndProps(), step, false);\n this._appendCustomAnimate(customAnimate, step);\n return this;\n }\n\n // _appendPlayProps(step: IStep) {\n\n // return;\n // }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n if (duration == null || duration < 0) {\n duration = 0;\n }\n\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.to;\n this._appendProps(props, step, params ? params.tempProps : false);\n // this._appendPlayProps(step);\n\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n if (!(params && params.noPreventAttrs)) {\n this.target.animates &&\n this.target.animates.forEach(a => {\n if (a.id !== this.animate.id) {\n a.preventAttrs(step.propKeys);\n }\n });\n }\n return this;\n }\n\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.to(props, 0, easing, params);\n const toProps = {};\n if (!this.stepTail.propKeys) {\n this.stepTail.propKeys = Object.keys(this.stepTail.props);\n }\n this.stepTail.propKeys.forEach(k => {\n toProps[k] = this.getLastPropByName(k, this.stepTail);\n });\n this.to(toProps, duration, easing, params);\n this.stepTail.type = AnimateStepType.from;\n }\n\n startAt(t: number) {\n if (t < 0) {\n t = 0;\n }\n this._startAt = t;\n return this;\n }\n\n getStartProps() {\n return this.stepHead?.props;\n }\n\n getEndProps() {\n return this.stepTail.props;\n }\n\n getLastStep() {\n return this._lastStep;\n }\n\n wait(duration: number) {\n if (duration > 0) {\n const step = this._addStep(+duration, null);\n\n step.type = AnimateStepType.wait;\n // TODO 这里如果跳帧的话会存在bug\n if (step.prev.customAnimate) {\n step.props = step.prev.customAnimate.getEndProps();\n } else {\n step.props = step.prev.props;\n }\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n // this._appendPlayProps(step);\n }\n return this;\n }\n\n protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n const step = new Step(this.duration, duration, props, easingFunc);\n this.duration += duration;\n this.stepTail.append(step);\n this.stepTail = step;\n return step;\n }\n\n protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n if (tempProps) {\n step.props = props;\n } else {\n // todo: 是否需要深拷贝props\n step.props = Object.assign({}, props);\n }\n let lastStep = step.prev;\n const _props = step.props;\n // 将undefined的属性设置到默认值\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n step.propKeys.forEach(k => {\n if (step.props[k] === undefined) {\n step.props[k] = this.target.getDefaultAttribute(k);\n }\n });\n // 拷贝之前的step阶段属性\n while (lastStep.prev) {\n if (lastStep.props) {\n if (!lastStep.propKeys) {\n lastStep.propKeys = Object.keys(lastStep.props);\n }\n lastStep.propKeys.forEach(key => {\n if (_props[key] === undefined) {\n _props[key] = lastStep.props[key];\n }\n });\n }\n // 重置propKeys\n step.propKeys = Object.keys(step.props);\n lastStep = lastStep.prev;\n }\n\n // 设置最初的props属性\n const initProps = this.stepHead.props;\n if (!step.propKeys) {\n step.propKeys = Object.keys(_props);\n }\n step.propKeys.forEach(key => {\n if (initProps[key] === undefined) {\n const parentAnimateInitProps = this.animate.getStartProps();\n initProps[key] = parentAnimateInitProps[key] = this.target.getComputedAttribute(key);\n }\n });\n\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n }\n\n protected _appendCustomAnimate(customAnimate: ICustomAnimate, step: Step) {\n step.customAnimate = customAnimate;\n customAnimate.step = step;\n customAnimate.bind(this.target, this);\n }\n\n setPosition(rawPosition: number) {\n const d = this.duration;\n const loopCount = this.loop;\n const prevRawPos = this.rawPosition;\n let end = false;\n let loop: number; // 当前是第几次循环\n let position: number; // 当前周期的时间\n const startAt = this._startAt ?? 0;\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n if (rawPosition < startAt) {\n this.rawPosition = rawPosition;\n return false;\n }\n rawPosition = rawPosition - startAt;\n if (d <= 0) {\n // 如果不用执行,跳过\n end = true;\n // 小于0的话,直接return,如果等于0,那还是得走动画逻辑,将end属性设置上去\n if (d < 0) {\n return end;\n }\n }\n loop = Math.floor(rawPosition / d);\n position = rawPosition - loop * d;\n\n // 计算rawPosition\n end = rawPosition >= loopCount * d + d;\n // 如果结束,跳过\n if (end) {\n position = d;\n loop = loopCount;\n rawPosition = position * loop + d;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // reverse动画\n const rev = !this.reversed !== !(this.bounce && loop % 2);\n if (rev) {\n position = d - position;\n }\n\n this._deltaPosition = position - this.position;\n this.position = position;\n this.rawPosition = rawPosition + startAt;\n\n this.updatePosition(end, rev);\n\n return end;\n }\n\n protected updatePosition(end: boolean, rev: boolean) {\n if (!this.stepHead) {\n return;\n }\n let step = this.stepHead.next;\n const position = this.position;\n const duration = this.duration;\n if (this.target && step) {\n let stepNext = step.next;\n while (stepNext && stepNext.position <= position) {\n step = stepNext;\n stepNext = step.next;\n }\n let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n if (step.easing) {\n ratio = step.easing(ratio);\n }\n // 判断这次和上次过程中是否经历了自定义step,如果跳过了自定义step那么执行自定义step的onEnd\n this.tryCallCustomAnimateLifeCycle(step, this._lastStep || (rev ? this.stepTail : this.stepHead), rev);\n // if (step !== this._lastStep) {\n // if (this._deltaPosition > 0) {\n // let _step = step.prev;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.prev;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // } else if (this._deltaPosition < 0) {\n // let _step = step.next;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.next;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // }\n // }\n this.updateTarget(step, ratio, end);\n this._lastStep = step;\n\n this.animate._onFrame && this.animate._onFrame.forEach(cb => cb(step, ratio));\n }\n }\n\n // 如果动画卡顿跳过了自定义动画,那么尝试执行自定义动画的生命周期\n tryCallCustomAnimateLifeCycle(step: IStep, lastStep: IStep, rev: boolean) {\n if (step === lastStep) {\n return;\n }\n if (rev) {\n let _step = lastStep.prev;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = step.prev;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n } else {\n let _step = lastStep.next;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = _step.next;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n }\n }\n\n /**\n * 获取这个属性的上一个值\n * @param name\n * @param step\n * @returns\n */\n getLastPropByName(name: string, step: Step): any {\n let lastStep = step.prev;\n while (lastStep) {\n if (lastStep.props && lastStep.props[name] !== undefined) {\n return lastStep.props[name];\n } else if (lastStep.customAnimate) {\n const val = lastStep.customAnimate.getEndProps()[name];\n if (val !== undefined) {\n return val;\n }\n }\n lastStep = lastStep.prev;\n }\n\n Logger.getInstance().warn('未知错误,step中找不到属性');\n return step.props[name];\n }\n\n protected updateTarget(step: Step, ratio: number, end: boolean) {\n if (step.props == null && step.customAnimate == null) {\n return;\n }\n this.target.onStep(this, this.animate, step, ratio, end);\n }\n}\n\n// export class Animate implements IAnimate {\n// declare target: IAnimateTarget;\n// declare timeline: ITimeline;\n// protected declare stepHead: Step;\n// protected declare stepTail: Step;\n// declare nextAnimate?: Animate;\n// declare prevAnimate?: Animate;\n// // 结束时反转动画\n// declare bounce: boolean;\n// // 是否reverse\n// declare reversed: boolean;\n// // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n// declare loop: number;\n// // 持续时间,不包括循环\n// declare duration: number;\n// // 当前Animate的状态,正常,暂停,结束\n// declare status: AnimateStatus;\n// // 位置,在[0, duration]之间\n// declare position: number;\n// // 绝对的位置,在[0, loops * duration]之间\n// declare rawPosition: number;\n// // 开始时间\n// protected declare _startAt: number;\n// // 时间的缩放,例如2表示2倍速\n// declare timeScale: number;\n// declare props: Record<string, any>;\n// declare readonly id: string | number;\n\n// protected declare _onStart?: (() => void)[];\n// protected declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n// protected declare _onEnd?: (() => void)[];\n// declare _onRemove?: (() => void)[];\n// declare _preventAttrs?: Set<string>;\n\n// constructor(id: string | number = Generator.GenAutoIncrementId(), timeline: ITimeline = defaultTimeline) {\n// this.timeline = timeline;\n// this.status = AnimateStatus.INITIAL;\n// this.rawPosition = -1;\n// this.position = 0;\n// this.loop = 0;\n// this.timeline.addAnimate(this);\n// this.timeScale = 1;\n// this.id = id;\n// this.props = {};\n// this.stepHead = new Step(0, 0, {});\n// this.stepTail = this.stepHead;\n// }\n\n// preventAttr(key: string) {\n// if (!this._preventAttrs) {\n// this._preventAttrs = new Set();\n// }\n// this._preventAttrs.add(key);\n// }\n// preventAttrs(keys: string[]) {\n// keys.forEach(key => this.preventAttr(key));\n// }\n// validAttr(key: string): boolean {\n// if (!this._preventAttrs) {\n// return true;\n// }\n// return !this._preventAttrs.has(key);\n// }\n\n// getLastPropByName(name: string, step: Step): any {\n// let lastStep = step.prev;\n// while (lastStep) {\n// if (lastStep.props && lastStep.props[name] !== undefined) {\n// return lastStep.props[name];\n// }\n// lastStep = lastStep.prev;\n// }\n// let val = this.props[name];\n// if (!val) {\n// console.warn('未知错误,step中找不到属性');\n// val = this.target.getComputedAttribute(name);\n// this.props[name] = val;\n// }\n\n// return val;\n// }\n\n// bind(target: IAnimateTarget) {\n// this.target = target;\n// this.duration = 0;\n// return this;\n// }\n\n// startAt(t: number) {\n// if (t < 0) {\n// return this;\n// }\n// this._startAt = t;\n// return this;\n// }\n\n// to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n// if (duration == null || duration < 0) {\n// duration = 0;\n// }\n\n// const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n// const step = this._addStep(duration, null, easingFunc);\n// this._appendProps(props, step, params ? params.tempProps : false);\n// return this;\n// }\n\n// wait(duration: number) {\n// if (duration > 0) {\n// const step = this._addStep(+duration, null);\n// if (step.prev) {\n// step.props = step.prev.props;\n// }\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n// return this;\n// }\n\n// protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n// const step = new Step(this.duration, duration, props, easingFunc);\n// this.duration += duration;\n// this.stepTail.append(step);\n// this.stepTail = step;\n// return step;\n// }\n\n// protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n// if (tempProps) {\n// step.props = props;\n// } else {\n// // todo: 是否需要深拷贝props\n// step.props = Object.assign({}, props);\n// }\n// let lastStep = step.prev;\n// const _props = step.props;\n// // 拷贝之前的step阶段属性\n// while (lastStep.prev) {\n// if (lastStep.props) {\n// if (!lastStep.propKeys) {\n// lastStep.propKeys = Object.keys(lastStep.props);\n// }\n// lastStep.propKeys.forEach(key => {\n// if (_props[key] === undefined) {\n// _props[key] = lastStep.props[key];\n// }\n// });\n// }\n// lastStep = lastStep.prev;\n// }\n\n// // 设置最初的props属性\n// const initProps = this.stepHead.props;\n// if (!step.propKeys) {\n// step.propKeys = Object.keys(_props);\n// step.propKeys.forEach(key => {\n// initProps[key] = this.target.getComputedAttribute(key);\n// });\n// }\n\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n\n// advance(delta: number) {\n// if (this.status === AnimateStatus.INITIAL) {\n// this.status = AnimateStatus.RUNNING;\n// this._onStart && this._onStart.forEach(cb => cb());\n// }\n// const end = this.setPosition(this.rawPosition + delta * this.timeScale);\n// if (end && this.status === AnimateStatus.RUNNING) {\n// this.status = AnimateStatus.END;\n// this._onEnd && this._onEnd.forEach(cb => cb());\n// }\n// }\n\n// setPosition(rawPosition: number) {\n// const d = this.duration;\n// const loopCount = this.loop;\n// const prevRawPos = this.rawPosition;\n// let end = false;\n// let loop: number; // 当前是第几次循环\n// let position: number; // 当前周期的时间\n// const startAt = this._startAt ?? 0;\n\n// if (rawPosition < 0) {\n// rawPosition = 0;\n// }\n// if (rawPosition < startAt) {\n// this.rawPosition = rawPosition;\n// return false;\n// }\n// rawPosition = rawPosition - startAt;\n// if (d <= 0) {\n// // 如果不用执行,跳过\n// end = true;\n// return end;\n// }\n// loop = Math.floor(rawPosition / d);\n// position = rawPosition - loop * d;\n\n// // 计算rawPosition\n// end = rawPosition >= loopCount * d + d;\n// // 如果结束,跳过\n// if (end) {\n// position = d;\n// loop = loopCount;\n// rawPosition = position * loop + d;\n// }\n\n// if (rawPosition === prevRawPos) {\n// return end;\n// }\n\n// // reverse动画\n// const rev = !this.reversed !== !(this.bounce && loop % 2);\n// if (rev) {\n// position = d - position;\n// }\n\n// this.position = position;\n// this.rawPosition = rawPosition + startAt;\n\n// this.updatePosition(end);\n\n// return end;\n// }\n\n// protected updatePosition(end: boolean) {\n// if (!this.stepHead) {\n// return;\n// }\n// let step = this.stepHead;\n// const position = this.position;\n// const duration = this.duration;\n// if (this.target && step) {\n// let stepNext = step.next;\n// while (stepNext && stepNext.position <= position) {\n// step = step.next;\n// stepNext = step.next;\n// }\n// let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n// if (step.easing) {\n// ratio = step.easing(ratio);\n// }\n// this.updateTarget(step, ratio, end);\n// this._onFrame && this._onFrame.forEach(cb => cb(step, ratio));\n// }\n// }\n\n// protected updateTarget(step: Step, ratio: number, end: boolean) {\n// if (step.props == null) {\n// return;\n// }\n// this.target.onStep(this, step, ratio, end);\n// }\n\n// onStart(cb: () => void) {\n// if (!this._onStart) {\n// this._onStart = [];\n// }\n// this._onStart.push(cb);\n// }\n// onEnd(cb: () => void) {\n// if (!this._onEnd) {\n// this._onEnd = [];\n// }\n// this._onEnd.push(cb);\n// }\n// onRemove(cb: () => void) {\n// if (!this._onRemove) {\n// this._onRemove = [];\n// }\n// this._onRemove.push(cb);\n// }\n// onFrame(cb: (step: IStep, ratio: number) => void) {\n// if (!this._onFrame) {\n// this._onFrame = [];\n// }\n// this._onFrame.push(cb);\n// }\n\n// getStartProps() {\n// return this.stepHead?.props;\n// }\n\n// getEndProps(target: Record<string, any> = {}) {\n// let step = this.stepHead;\n// while (step) {\n// if (step.props) {\n// Object.assign(target, step.props);\n// }\n// step = step.next;\n// }\n\n// return target;\n// }\n\n// stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n// this.status = AnimateStatus.END;\n// if (!nextVal) {\n// this.target.onStop();\n// }\n// if (nextVal === 'start') {\n// this.target.onStop(this.getStartProps());\n// } else if (nextVal === 'end') {\n// this.target.onStop(this.getEndProps());\n// } else {\n// this.target.onStop(nextVal);\n// }\n// }\n\n// release() {\n// this.status = AnimateStatus.END;\n// return;\n// }\n// }\n\nclass Step implements IStep {\n declare prev?: Step;\n // 持续时间\n declare duration: number;\n // 在animate中的位置\n declare position: number;\n declare next?: Step;\n declare props: any;\n // 保存解析后的props,用于性能优化\n declare parsedProps?: any;\n declare propKeys?: string[];\n declare easing?: EasingTypeFunc;\n declare customAnimate?: ICustomAnimate;\n // passive: boolean;\n // index: number;\n type: IAnimateStepType;\n\n constructor(position: number, duration: number, props?: any, easing?: EasingTypeFunc) {\n this.duration = duration;\n this.position = position;\n this.props = props;\n this.easing = easing;\n }\n\n append(step: Step) {\n step.prev = this;\n step.next = this.next;\n this.next = step;\n }\n\n getLastProps() {\n let step = this.prev;\n while (step) {\n if (step.props) {\n return step.props;\n } else if (step.customAnimate) {\n return step.customAnimate.getMergedEndProps();\n }\n step = step.prev as any;\n }\n return null;\n }\n}\n"]}
|
package/cjs/animate/config.d.ts
CHANGED
package/cjs/animate/config.js
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.DefaultStateAnimateConfig = void 0,
|
|
5
|
+
}), exports.DefaultMorphingAnimateConfig = exports.DefaultStateAnimateConfig = void 0,
|
|
6
|
+
exports.DefaultStateAnimateConfig = {
|
|
6
7
|
duration: 200,
|
|
7
8
|
easing: "cubicOut"
|
|
9
|
+
}, exports.DefaultMorphingAnimateConfig = {
|
|
10
|
+
duration: 1e3,
|
|
11
|
+
easing: "quadInOut"
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/animate/config.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAmB;IACvD,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,UAAU;CACnB,CAAC","file":"config.js","sourcesContent":["import type { IAnimateConfig } from '
|
|
1
|
+
{"version":3,"sources":["../src/animate/config.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAmB;IACvD,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,UAAU;CACnB,CAAC;AAEW,QAAA,4BAA4B,GAAmB;IAC1D,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,WAAW;CACpB,CAAC","file":"config.js","sourcesContent":["import type { IAnimateConfig } from './../interface/graphic';\n\nexport const DefaultStateAnimateConfig: IAnimateConfig = {\n duration: 200,\n easing: 'cubicOut'\n};\n\nexport const DefaultMorphingAnimateConfig: IAnimateConfig = {\n duration: 1000,\n easing: 'quadInOut'\n};\n"]}
|