@visactor/vrender-animate 0.22.4 → 0.22.12
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-extension.d.ts +12 -5
- package/cjs/animate-extension.js +23 -12
- package/cjs/animate-extension.js.map +1 -1
- package/cjs/animate.d.ts +2 -5
- package/cjs/animate.js +23 -18
- package/cjs/animate.js.map +1 -1
- package/cjs/component/component-animate-extension.d.ts +1 -0
- package/cjs/component/component-animate-extension.js +1 -0
- package/cjs/component/component-animate-extension.js.map +1 -0
- package/cjs/component/component-animator.d.ts +22 -0
- package/cjs/component/component-animator.js +67 -0
- package/cjs/component/component-animator.js.map +1 -0
- package/cjs/component/index.d.ts +1 -0
- package/cjs/component/index.js +21 -0
- package/cjs/component/index.js.map +1 -0
- package/cjs/config/morphing.d.ts +2 -0
- package/cjs/config/morphing.js +9 -0
- package/cjs/config/morphing.js.map +1 -0
- package/cjs/custom/clip-graphic.d.ts +1 -1
- package/cjs/custom/clip-graphic.js +2 -2
- package/cjs/custom/clip-graphic.js.map +1 -1
- package/cjs/custom/clip.d.ts +2 -1
- package/cjs/custom/clip.js +9 -1
- package/cjs/custom/clip.js.map +1 -1
- package/cjs/custom/common.d.ts +1 -3
- package/cjs/custom/common.js +21 -17
- package/cjs/custom/common.js.map +1 -1
- package/cjs/custom/custom-animate.d.ts +7 -3
- package/cjs/custom/custom-animate.js +13 -2
- package/cjs/custom/custom-animate.js.map +1 -1
- package/cjs/custom/fade.d.ts +1 -1
- package/cjs/custom/fade.js +7 -2
- package/cjs/custom/fade.js.map +1 -1
- package/cjs/custom/fromTo.d.ts +10 -0
- package/cjs/custom/fromTo.js +42 -0
- package/cjs/custom/fromTo.js.map +1 -0
- package/cjs/custom/groupFade.d.ts +10 -0
- package/cjs/custom/groupFade.js +25 -0
- package/cjs/custom/groupFade.js.map +1 -0
- package/cjs/custom/growAngle.d.ts +10 -5
- package/cjs/custom/growAngle.js +38 -17
- package/cjs/custom/growAngle.js.map +1 -1
- package/cjs/custom/growCenter.d.ts +1 -2
- package/cjs/custom/growCenter.js +16 -10
- package/cjs/custom/growCenter.js.map +1 -1
- package/cjs/custom/growHeight.d.ts +1 -3
- package/cjs/custom/growHeight.js +19 -13
- package/cjs/custom/growHeight.js.map +1 -1
- package/cjs/custom/growPoints.d.ts +1 -2
- package/cjs/custom/growPoints.js +41 -36
- package/cjs/custom/growPoints.js.map +1 -1
- package/cjs/custom/growRadius.d.ts +4 -5
- package/cjs/custom/growRadius.js +22 -18
- package/cjs/custom/growRadius.js.map +1 -1
- package/cjs/custom/growWidth.d.ts +1 -3
- package/cjs/custom/growWidth.js +15 -9
- package/cjs/custom/growWidth.js.map +1 -1
- package/cjs/custom/input-text.d.ts +1 -2
- package/cjs/custom/input-text.js.map +1 -1
- package/cjs/custom/label-item-animate.d.ts +7 -0
- package/cjs/custom/label-item-animate.js +221 -0
- package/cjs/custom/label-item-animate.js.map +1 -0
- package/cjs/custom/morphing.d.ts +51 -0
- package/cjs/custom/morphing.js +298 -0
- package/cjs/custom/morphing.js.map +1 -0
- package/cjs/custom/motionPath.d.ts +21 -0
- package/cjs/custom/motionPath.js +31 -0
- package/cjs/custom/motionPath.js.map +1 -0
- package/cjs/custom/move.d.ts +96 -0
- package/cjs/custom/move.js +133 -0
- package/cjs/custom/move.js.map +1 -0
- package/cjs/custom/number.d.ts +1 -2
- package/cjs/custom/number.js.map +1 -1
- package/cjs/custom/poptip-animate.d.ts +7 -0
- package/cjs/custom/poptip-animate.js +109 -0
- package/cjs/custom/poptip-animate.js.map +1 -0
- package/cjs/custom/register.d.ts +27 -0
- package/cjs/custom/register.js +418 -3
- package/cjs/custom/register.js.map +1 -1
- package/cjs/custom/richtext/input-richtext.d.ts +35 -0
- package/cjs/custom/richtext/input-richtext.js +80 -0
- package/cjs/custom/richtext/input-richtext.js.map +1 -0
- package/cjs/custom/richtext/output-richtext.d.ts +37 -0
- package/cjs/custom/richtext/output-richtext.js +94 -0
- package/cjs/custom/richtext/output-richtext.js.map +1 -0
- package/cjs/custom/richtext/slide-out-richtext.d.ts +38 -0
- package/cjs/custom/richtext/slide-out-richtext.js +146 -0
- package/cjs/custom/richtext/slide-out-richtext.js.map +1 -0
- package/cjs/custom/richtext/slide-richtext.d.ts +36 -0
- package/cjs/custom/richtext/slide-richtext.js +144 -0
- package/cjs/custom/richtext/slide-richtext.js.map +1 -0
- package/cjs/custom/rotate.d.ts +33 -0
- package/cjs/custom/rotate.js +79 -0
- package/cjs/custom/rotate.js.map +1 -0
- package/cjs/custom/scale.d.ts +6 -2
- package/cjs/custom/scale.js +32 -17
- package/cjs/custom/scale.js.map +1 -1
- package/cjs/custom/sphere.d.ts +2 -1
- package/cjs/custom/sphere.js +14 -5
- package/cjs/custom/sphere.js.map +1 -1
- package/cjs/custom/state.d.ts +1 -1
- package/cjs/custom/state.js +1 -1
- package/cjs/custom/state.js.map +1 -1
- package/cjs/custom/story.d.ts +196 -0
- package/cjs/custom/story.js +497 -0
- package/cjs/custom/story.js.map +1 -0
- package/cjs/custom/streamLight.d.ts +27 -0
- package/cjs/custom/streamLight.js +161 -0
- package/cjs/custom/streamLight.js.map +1 -0
- package/cjs/custom/tag-points.d.ts +2 -3
- package/cjs/custom/tag-points.js +20 -4
- package/cjs/custom/tag-points.js.map +1 -1
- package/cjs/custom/update.d.ts +2 -2
- package/cjs/custom/update.js +10 -2
- package/cjs/custom/update.js.map +1 -1
- package/cjs/executor/animate-executor.d.ts +7 -6
- package/cjs/executor/animate-executor.js +118 -62
- package/cjs/executor/animate-executor.js.map +1 -1
- package/cjs/executor/executor.d.ts +9 -3
- package/cjs/executor/executor.js.map +1 -1
- package/cjs/index.d.ts +8 -8
- package/cjs/index.js +50 -18
- package/cjs/index.js.map +1 -1
- package/cjs/interpolate/store.d.ts +6 -2
- package/cjs/interpolate/store.js +13 -2
- package/cjs/interpolate/store.js.map +1 -1
- package/cjs/register.js +1 -5
- package/cjs/register.js.map +1 -1
- package/cjs/state/animation-state.d.ts +20 -2
- package/cjs/state/animation-state.js +48 -4
- package/cjs/state/animation-state.js.map +1 -1
- package/cjs/state/animation-states-registry.js +18 -0
- package/cjs/state/animation-states-registry.js.map +1 -1
- package/cjs/state/graphic-extension.d.ts +7 -1
- package/cjs/state/graphic-extension.js +20 -0
- package/cjs/state/graphic-extension.js.map +1 -1
- package/cjs/step.d.ts +7 -4
- package/cjs/step.js +33 -15
- package/cjs/step.js.map +1 -1
- package/cjs/ticker/default-ticker.d.ts +12 -7
- package/cjs/ticker/default-ticker.js +38 -33
- package/cjs/ticker/default-ticker.js.map +1 -1
- package/cjs/ticker/manual-ticker.d.ts +6 -1
- package/cjs/ticker/manual-ticker.js +26 -4
- package/cjs/ticker/manual-ticker.js.map +1 -1
- package/cjs/timeline.d.ts +14 -7
- package/cjs/timeline.js +31 -18
- package/cjs/timeline.js.map +1 -1
- package/cjs/utils/transform.d.ts +2 -0
- package/cjs/utils/transform.js +10 -0
- package/cjs/utils/transform.js.map +1 -0
- package/dist/index.es.js +3765 -527
- package/es/animate-extension.d.ts +12 -5
- package/es/animate-extension.js +24 -11
- package/es/animate-extension.js.map +1 -1
- package/es/animate.d.ts +2 -5
- package/es/animate.js +14 -11
- package/es/animate.js.map +1 -1
- package/es/component/component-animate-extension.d.ts +1 -0
- package/es/component/component-animate-extension.js +1 -0
- package/es/component/component-animate-extension.js.map +1 -0
- package/es/component/component-animator.d.ts +22 -0
- package/es/component/component-animator.js +59 -0
- package/es/component/component-animator.js.map +1 -0
- package/es/component/index.d.ts +1 -0
- package/es/component/index.js +2 -0
- package/es/component/index.js.map +1 -0
- package/es/config/morphing.d.ts +2 -0
- package/es/config/morphing.js +5 -0
- package/es/config/morphing.js.map +1 -0
- package/es/custom/clip-graphic.d.ts +1 -1
- package/es/custom/clip-graphic.js +2 -2
- package/es/custom/clip-graphic.js.map +1 -1
- package/es/custom/clip.d.ts +2 -1
- package/es/custom/clip.js +9 -1
- package/es/custom/clip.js.map +1 -1
- package/es/custom/common.d.ts +1 -3
- package/es/custom/common.js +21 -17
- package/es/custom/common.js.map +1 -1
- package/es/custom/custom-animate.d.ts +7 -3
- package/es/custom/custom-animate.js +10 -1
- package/es/custom/custom-animate.js.map +1 -1
- package/es/custom/fade.d.ts +1 -1
- package/es/custom/fade.js +7 -2
- package/es/custom/fade.js.map +1 -1
- package/es/custom/fromTo.d.ts +10 -0
- package/es/custom/fromTo.js +34 -0
- package/es/custom/fromTo.js.map +1 -0
- package/es/custom/groupFade.d.ts +10 -0
- package/es/custom/groupFade.js +15 -0
- package/es/custom/groupFade.js.map +1 -0
- package/es/custom/growAngle.d.ts +10 -5
- package/es/custom/growAngle.js +39 -15
- package/es/custom/growAngle.js.map +1 -1
- package/es/custom/growCenter.d.ts +1 -2
- package/es/custom/growCenter.js +16 -10
- package/es/custom/growCenter.js.map +1 -1
- package/es/custom/growHeight.d.ts +1 -3
- package/es/custom/growHeight.js +20 -14
- package/es/custom/growHeight.js.map +1 -1
- package/es/custom/growPoints.d.ts +1 -2
- package/es/custom/growPoints.js +40 -36
- package/es/custom/growPoints.js.map +1 -1
- package/es/custom/growRadius.d.ts +4 -5
- package/es/custom/growRadius.js +22 -16
- package/es/custom/growRadius.js.map +1 -1
- package/es/custom/growWidth.d.ts +1 -3
- package/es/custom/growWidth.js +16 -10
- package/es/custom/growWidth.js.map +1 -1
- package/es/custom/input-text.d.ts +1 -2
- package/es/custom/input-text.js.map +1 -1
- package/es/custom/label-item-animate.d.ts +7 -0
- package/es/custom/label-item-animate.js +215 -0
- package/es/custom/label-item-animate.js.map +1 -0
- package/es/custom/morphing.d.ts +51 -0
- package/es/custom/morphing.js +289 -0
- package/es/custom/morphing.js.map +1 -0
- package/es/custom/motionPath.d.ts +21 -0
- package/es/custom/motionPath.js +23 -0
- package/es/custom/motionPath.js.map +1 -0
- package/es/custom/move.d.ts +96 -0
- package/es/custom/move.js +118 -0
- package/es/custom/move.js.map +1 -0
- package/es/custom/number.d.ts +1 -2
- package/es/custom/number.js.map +1 -1
- package/es/custom/poptip-animate.d.ts +7 -0
- package/es/custom/poptip-animate.js +103 -0
- package/es/custom/poptip-animate.js.map +1 -0
- package/es/custom/register.d.ts +27 -0
- package/es/custom/register.js +48 -1
- package/es/custom/register.js.map +1 -1
- package/es/custom/richtext/input-richtext.d.ts +35 -0
- package/es/custom/richtext/input-richtext.js +74 -0
- package/es/custom/richtext/input-richtext.js.map +1 -0
- package/es/custom/richtext/output-richtext.d.ts +37 -0
- package/es/custom/richtext/output-richtext.js +88 -0
- package/es/custom/richtext/output-richtext.js.map +1 -0
- package/es/custom/richtext/slide-out-richtext.d.ts +38 -0
- package/es/custom/richtext/slide-out-richtext.js +140 -0
- package/es/custom/richtext/slide-out-richtext.js.map +1 -0
- package/es/custom/richtext/slide-richtext.d.ts +36 -0
- package/es/custom/richtext/slide-richtext.js +138 -0
- package/es/custom/richtext/slide-richtext.js.map +1 -0
- package/es/custom/rotate.d.ts +33 -0
- package/es/custom/rotate.js +65 -0
- package/es/custom/rotate.js.map +1 -0
- package/es/custom/scale.d.ts +6 -2
- package/es/custom/scale.js +32 -17
- package/es/custom/scale.js.map +1 -1
- package/es/custom/sphere.d.ts +2 -1
- package/es/custom/sphere.js +14 -5
- package/es/custom/sphere.js.map +1 -1
- package/es/custom/state.d.ts +1 -1
- package/es/custom/state.js +1 -1
- package/es/custom/state.js.map +1 -1
- package/es/custom/story.d.ts +196 -0
- package/es/custom/story.js +468 -0
- package/es/custom/story.js.map +1 -0
- package/es/custom/streamLight.d.ts +27 -0
- package/es/custom/streamLight.js +157 -0
- package/es/custom/streamLight.js.map +1 -0
- package/es/custom/tag-points.d.ts +2 -3
- package/es/custom/tag-points.js +21 -5
- package/es/custom/tag-points.js.map +1 -1
- package/es/custom/update.d.ts +2 -2
- package/es/custom/update.js +10 -2
- package/es/custom/update.js.map +1 -1
- package/es/executor/animate-executor.d.ts +7 -6
- package/es/executor/animate-executor.js +116 -61
- package/es/executor/animate-executor.js.map +1 -1
- package/es/executor/executor.d.ts +9 -3
- package/es/executor/executor.js.map +1 -1
- package/es/index.d.ts +8 -8
- package/es/index.js +10 -12
- package/es/index.js.map +1 -1
- package/es/interpolate/store.d.ts +6 -2
- package/es/interpolate/store.js +13 -3
- package/es/interpolate/store.js.map +1 -1
- package/es/register.js +0 -8
- package/es/register.js.map +1 -1
- package/es/state/animation-state.d.ts +20 -2
- package/es/state/animation-state.js +48 -2
- package/es/state/animation-state.js.map +1 -1
- package/es/state/animation-states-registry.js +18 -0
- package/es/state/animation-states-registry.js.map +1 -1
- package/es/state/graphic-extension.d.ts +7 -1
- package/es/state/graphic-extension.js +20 -0
- package/es/state/graphic-extension.js.map +1 -1
- package/es/step.d.ts +7 -4
- package/es/step.js +34 -16
- package/es/step.js.map +1 -1
- package/es/ticker/default-ticker.d.ts +12 -7
- package/es/ticker/default-ticker.js +30 -27
- package/es/ticker/default-ticker.js.map +1 -1
- package/es/ticker/manual-ticker.d.ts +6 -1
- package/es/ticker/manual-ticker.js +27 -3
- package/es/ticker/manual-ticker.js.map +1 -1
- package/es/timeline.d.ts +14 -7
- package/es/timeline.js +33 -18
- package/es/timeline.js.map +1 -1
- package/es/utils/transform.d.ts +2 -0
- package/es/utils/transform.js +4 -0
- package/es/utils/transform.js.map +1 -0
- package/package.json +16 -16
- package/cjs/custom/group-fade.d.ts +0 -16
- package/cjs/custom/group-fade.js +0 -66
- package/cjs/custom/group-fade.js.map +0 -1
- package/cjs/custom/scale-in.d.ts +0 -13
- package/cjs/custom/scale-in.js +0 -57
- package/cjs/custom/scale-in.js.map +0 -1
- package/cjs/interpolate/executor.d.ts +0 -66
- package/cjs/interpolate/executor.js +0 -6
- package/cjs/interpolate/executor.js.map +0 -1
- package/cjs/intreface/animate.d.ts +0 -91
- package/cjs/intreface/animate.js +0 -10
- package/cjs/intreface/animate.js.map +0 -1
- package/cjs/intreface/easing.d.ts +0 -3
- package/cjs/intreface/easing.js +0 -6
- package/cjs/intreface/easing.js.map +0 -1
- package/cjs/intreface/state.d.ts +0 -35
- package/cjs/intreface/state.js +0 -6
- package/cjs/intreface/state.js.map +0 -1
- package/cjs/intreface/ticker.d.ts +0 -37
- package/cjs/intreface/ticker.js +0 -10
- package/cjs/intreface/ticker.js.map +0 -1
- package/cjs/intreface/timeline.d.ts +0 -17
- package/cjs/intreface/timeline.js +0 -6
- package/cjs/intreface/timeline.js.map +0 -1
- package/cjs/intreface/type.d.ts +0 -13
- package/cjs/intreface/type.js +0 -15
- package/cjs/intreface/type.js.map +0 -1
- package/cjs/state/animation-state-machine.d.ts +0 -22
- package/cjs/state/animation-state-machine.js +0 -53
- package/cjs/state/animation-state-machine.js.map +0 -1
- package/cjs/state/animation-state-queue.d.ts +0 -24
- package/cjs/state/animation-state-queue.js +0 -66
- package/cjs/state/animation-state-queue.js.map +0 -1
- package/cjs/state/animation-state-registry.d.ts +0 -14
- package/cjs/state/animation-state-registry.js +0 -53
- package/cjs/state/animation-state-registry.js.map +0 -1
- package/es/custom/group-fade.d.ts +0 -16
- package/es/custom/group-fade.js +0 -56
- package/es/custom/group-fade.js.map +0 -1
- package/es/custom/scale-in.d.ts +0 -13
- package/es/custom/scale-in.js +0 -49
- package/es/custom/scale-in.js.map +0 -1
- package/es/interpolate/executor.d.ts +0 -66
- package/es/interpolate/executor.js +0 -2
- package/es/interpolate/executor.js.map +0 -1
- package/es/intreface/animate.d.ts +0 -91
- package/es/intreface/animate.js +0 -6
- package/es/intreface/animate.js.map +0 -1
- package/es/intreface/easing.d.ts +0 -3
- package/es/intreface/easing.js +0 -2
- package/es/intreface/easing.js.map +0 -1
- package/es/intreface/state.d.ts +0 -35
- package/es/intreface/state.js +0 -2
- package/es/intreface/state.js.map +0 -1
- package/es/intreface/ticker.d.ts +0 -37
- package/es/intreface/ticker.js +0 -6
- package/es/intreface/ticker.js.map +0 -1
- package/es/intreface/timeline.d.ts +0 -17
- package/es/intreface/timeline.js +0 -2
- package/es/intreface/timeline.js.map +0 -1
- package/es/intreface/type.d.ts +0 -13
- package/es/intreface/type.js +0 -14
- package/es/intreface/type.js.map +0 -1
- package/es/state/animation-state-machine.d.ts +0 -22
- package/es/state/animation-state-machine.js +0 -47
- package/es/state/animation-state-machine.js.map +0 -1
- package/es/state/animation-state-queue.d.ts +0 -24
- package/es/state/animation-state-queue.js +0 -58
- package/es/state/animation-state-queue.js.map +0 -1
- package/es/state/animation-state-registry.d.ts +0 -14
- package/es/state/animation-state-registry.js +0 -45
- package/es/state/animation-state-registry.js.map +0 -1
package/es/timeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiC,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAShD,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAgB/C,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QAnBA,SAAI,GAAuB,IAAI,CAAC;QAChC,SAAI,GAAuB,IAAI,CAAC;QAChC,eAAU,GAA+B,IAAI,GAAG,EAAE,CAAC;QACnD,kBAAa,GAAW,CAAC,CAAC;QAI1B,eAAU,GAAW,CAAC,CAAC;QACvB,mBAAc,GAAW,CAAC,CAAC;QAC3B,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,CAAC,CAAC;QAUjC,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,kBAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,SAAS;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;IAChD,CAAC;IAED,oBAAoB,CAAC,EAA8C;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,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE;YAC3B,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,YAAY,CAAC,IAAY;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,cAAc,CAAC,IAAY;QACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AAGD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AACrD,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAC","file":"timeline.js","sourcesContent":["import { Generator, type IAnimate, type ITimeline, AnimateStatus } from '@visactor/vrender-core';\nimport { EventEmitter } from '@visactor/vutils';\n\n// 定义链表节点\ninterface AnimateNode {\n animate: IAnimate;\n next: AnimateNode | null;\n prev: AnimateNode | null;\n}\n\nexport class DefaultTimeline extends EventEmitter implements ITimeline {\n declare id: number;\n protected head: AnimateNode | null = null;\n protected tail: AnimateNode | null = null;\n protected animateMap: Map<IAnimate, AnimateNode> = new Map();\n protected _animateCount: number = 0;\n protected declare paused: boolean;\n\n // 添加必要的属性\n protected _playSpeed: number = 1;\n protected _totalDuration: number = 0;\n protected _startTime: number = 0;\n protected _currentTime: number = 0;\n\n declare isGlobal?: boolean;\n\n get animateCount() {\n return this._animateCount;\n }\n\n constructor() {\n super();\n this.id = Generator.GenAutoIncrementId();\n this.paused = false;\n }\n\n isRunning() {\n return !this.paused && this._animateCount > 0;\n }\n\n forEachAccessAnimate(cb: (animate: IAnimate, index: number) => void) {\n let current = this.head;\n let index = 0;\n\n while (current) {\n // 保存下一个节点的引用,以防在回调中移除当前节点\n const next = current.next;\n cb(current.animate, index);\n index++;\n current = next;\n }\n }\n\n addAnimate(animate: IAnimate) {\n const newNode: AnimateNode = {\n animate,\n next: null,\n prev: null\n };\n\n // 添加到链表尾部\n if (!this.head) {\n this.head = newNode;\n this.tail = newNode;\n } else {\n if (this.tail) {\n this.tail.next = newNode;\n newNode.prev = this.tail;\n this.tail = newNode;\n }\n }\n\n // 在映射中保存节点引用\n this.animateMap.set(animate, newNode);\n this._animateCount++;\n\n // 更新总时长\n this._totalDuration = Math.max(this._totalDuration, animate.getStartTime() + animate.getDuration());\n }\n\n pause() {\n this.paused = true;\n }\n\n resume() {\n this.paused = false;\n }\n\n tick(delta: number) {\n if (this.paused) {\n return;\n }\n\n // 应用播放速度\n const scaledDelta = delta * this._playSpeed;\n\n // 更新当前时间\n this._currentTime += scaledDelta;\n\n this.forEachAccessAnimate((animate, i) => {\n if (animate.status === AnimateStatus.END) {\n this.removeAnimate(animate, true);\n } else if (animate.status === AnimateStatus.RUNNING || animate.status === AnimateStatus.INITIAL) {\n animate.advance(scaledDelta);\n }\n });\n\n if (this._animateCount === 0) {\n this.emit('animationEnd');\n }\n }\n\n clear() {\n this.forEachAccessAnimate(animate => {\n animate.release();\n });\n\n this.head = null;\n this.tail = null;\n this.animateMap.clear();\n this._animateCount = 0;\n this._totalDuration = 0;\n }\n\n removeAnimate(animate: IAnimate, release: boolean = true) {\n const node = this.animateMap.get(animate);\n\n if (!node) {\n return;\n }\n\n if (release) {\n animate._onRemove && animate._onRemove.forEach(cb => cb());\n animate.release();\n }\n\n // 从链表中移除节点\n if (node.prev) {\n node.prev.next = node.next;\n } else {\n // 节点是头节点\n this.head = node.next;\n }\n\n if (node.next) {\n node.next.prev = node.prev;\n } else {\n // 节点是尾节点\n this.tail = node.prev;\n }\n\n // 从映射中移除\n this.animateMap.delete(animate);\n this._animateCount--;\n\n // 如果移除的是最长时间的动画,应该重新计算总时长\n if (animate.getStartTime() + animate.getDuration() >= this._totalDuration) {\n this.recalculateTotalDuration();\n }\n\n return;\n }\n\n // 重新计算总时长\n protected recalculateTotalDuration() {\n this._totalDuration = 0;\n this.forEachAccessAnimate(animate => {\n this._totalDuration = Math.max(this._totalDuration, animate.getStartTime() + animate.getDuration());\n });\n }\n\n getTotalDuration() {\n return this._totalDuration;\n }\n\n getPlaySpeed() {\n return this._playSpeed;\n }\n\n setPlaySpeed(speed: number) {\n this._playSpeed = speed;\n }\n\n // 实现ITimeline接口所需的其他方法\n getPlayState(): 'playing' | 'paused' | 'stopped' {\n if (this.paused) {\n return 'paused';\n }\n if (this.animateCount === 0) {\n return 'stopped';\n }\n return 'playing';\n }\n\n setStartTime(time: number) {\n this._startTime = time;\n }\n\n getStartTime() {\n return this._startTime;\n }\n\n getCurrentTime() {\n return this._currentTime;\n }\n\n setCurrentTime(time: number) {\n this._currentTime = time;\n }\n}\n\n// 不会使用,存粹做临时存储用,请一定要放置到stage中才行\nexport const defaultTimeline = new DefaultTimeline();\ndefaultTimeline.isGlobal = true;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/transform.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,SAAS;CACV,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE;IAC5C,OAAO,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC,CAAC","file":"transform.js","sourcesContent":["export const transformKeys = [\n 'x',\n 'y',\n 'dx',\n 'dy',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'postMatrix',\n 'scrollX',\n 'scrollY'\n];\nexport const isTransformKey = (key: string) => {\n return transformKeys.includes(key);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-animate",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -11,22 +11,11 @@
|
|
|
11
11
|
"es",
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"compile": "tsc --noEmit",
|
|
16
|
-
"eslint": "eslint --debug --fix src/",
|
|
17
|
-
"build": "cross-env DEBUG='Bundler*' bundle",
|
|
18
|
-
"dev": "cross-env DEBUG='Bundler*' bundle --clean -f es -w",
|
|
19
|
-
"start": "vite ./vite",
|
|
20
|
-
"test": ""
|
|
21
|
-
},
|
|
22
14
|
"dependencies": {
|
|
23
|
-
"@visactor/vutils": "
|
|
24
|
-
"@visactor/vrender-core": "
|
|
15
|
+
"@visactor/vutils": "1.0.6",
|
|
16
|
+
"@visactor/vrender-core": "0.22.12"
|
|
25
17
|
},
|
|
26
18
|
"devDependencies": {
|
|
27
|
-
"@internal/bundler": "workspace:*",
|
|
28
|
-
"@internal/eslint-config": "workspace:*",
|
|
29
|
-
"@internal/ts-config": "workspace:*",
|
|
30
19
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
31
20
|
"canvas": "2.11.2",
|
|
32
21
|
"node-fetch": "2.6.6",
|
|
@@ -39,7 +28,10 @@
|
|
|
39
28
|
"eslint": "~8.18.0",
|
|
40
29
|
"vite": "3.2.6",
|
|
41
30
|
"typescript": "4.9.5",
|
|
42
|
-
"cross-env": "^7.0.3"
|
|
31
|
+
"cross-env": "^7.0.3",
|
|
32
|
+
"@internal/bundler": "0.0.1",
|
|
33
|
+
"@internal/eslint-config": "0.0.1",
|
|
34
|
+
"@internal/ts-config": "0.0.1"
|
|
43
35
|
},
|
|
44
36
|
"keywords": [
|
|
45
37
|
"VisActor",
|
|
@@ -68,5 +60,13 @@
|
|
|
68
60
|
"import": "./es/index.js",
|
|
69
61
|
"require": "./cjs/index.js"
|
|
70
62
|
}
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"compile": "tsc --noEmit",
|
|
66
|
+
"eslint": "eslint --debug --fix src/",
|
|
67
|
+
"build": "cross-env DEBUG='Bundler*' bundle",
|
|
68
|
+
"dev": "cross-env DEBUG='Bundler*' bundle --clean -f es -w",
|
|
69
|
+
"start": "vite ./vite",
|
|
70
|
+
"test": ""
|
|
71
71
|
}
|
|
72
|
-
}
|
|
72
|
+
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import { ACustomAnimate } from './custom-animate';
|
|
3
|
-
export declare class GroupFadeIn extends ACustomAnimate<any> {
|
|
4
|
-
target: IGroup;
|
|
5
|
-
getEndProps(): Record<string, any>;
|
|
6
|
-
onBind(): void;
|
|
7
|
-
onEnd(): void;
|
|
8
|
-
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
9
|
-
}
|
|
10
|
-
export declare class GroupFadeOut extends ACustomAnimate<any> {
|
|
11
|
-
target: IGroup;
|
|
12
|
-
getEndProps(): Record<string, any>;
|
|
13
|
-
onBind(): void;
|
|
14
|
-
onEnd(): void;
|
|
15
|
-
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
16
|
-
}
|
package/cjs/custom/group-fade.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.GroupFadeOut = exports.GroupFadeIn = void 0;
|
|
6
|
-
|
|
7
|
-
const custom_animate_1 = require("./custom-animate");
|
|
8
|
-
|
|
9
|
-
class GroupFadeIn extends custom_animate_1.ACustomAnimate {
|
|
10
|
-
getEndProps() {
|
|
11
|
-
return {};
|
|
12
|
-
}
|
|
13
|
-
onBind() {
|
|
14
|
-
this.target.setTheme({
|
|
15
|
-
common: {
|
|
16
|
-
opacity: 0
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
onEnd() {
|
|
21
|
-
this.target.setTheme({
|
|
22
|
-
common: {
|
|
23
|
-
opacity: 1
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
onUpdate(end, ratio, out) {
|
|
28
|
-
this.target.setTheme({
|
|
29
|
-
common: {
|
|
30
|
-
opacity: ratio
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
exports.GroupFadeIn = GroupFadeIn;
|
|
37
|
-
|
|
38
|
-
class GroupFadeOut extends custom_animate_1.ACustomAnimate {
|
|
39
|
-
getEndProps() {
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
onBind() {
|
|
43
|
-
this.target.setTheme({
|
|
44
|
-
common: {
|
|
45
|
-
opacity: 1
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
onEnd() {
|
|
50
|
-
this.target.setTheme({
|
|
51
|
-
common: {
|
|
52
|
-
opacity: 0
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
onUpdate(end, ratio, out) {
|
|
57
|
-
this.target.setTheme({
|
|
58
|
-
common: {
|
|
59
|
-
opacity: 1 - ratio
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
exports.GroupFadeOut = GroupFadeOut;
|
|
66
|
-
//# sourceMappingURL=group-fade.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/group-fade.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAElD,MAAa,WAAY,SAAQ,+BAAmB;IAGlD,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAhCD,kCAgCC;AAED,MAAa,YAAa,SAAQ,+BAAmB;IAGnD,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC,GAAG,KAAK;aACnB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAhCD,oCAgCC","file":"group-fade.js","sourcesContent":["import type { IGroup } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class GroupFadeIn extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: ratio\n }\n });\n }\n}\n\nexport class GroupFadeOut extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: 1 - ratio\n }\n });\n }\n}\n"]}
|
package/cjs/custom/scale-in.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { IAnimate, IStep } from '../intreface/animate';
|
|
2
|
-
import type { EasingType } from '../intreface/easing';
|
|
3
|
-
import { ACustomAnimate } from './custom-animate';
|
|
4
|
-
export interface IScaleAnimationOptions {
|
|
5
|
-
direction?: 'x' | 'y' | 'xy';
|
|
6
|
-
}
|
|
7
|
-
export declare class ScaleIn extends ACustomAnimate<Record<string, number>> {
|
|
8
|
-
valid: boolean;
|
|
9
|
-
constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
|
|
10
|
-
onFirstRun(): void;
|
|
11
|
-
onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
|
|
12
|
-
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
13
|
-
}
|
package/cjs/custom/scale-in.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.ScaleIn = void 0;
|
|
6
|
-
|
|
7
|
-
const custom_animate_1 = require("./custom-animate");
|
|
8
|
-
|
|
9
|
-
class ScaleIn extends custom_animate_1.ACustomAnimate {
|
|
10
|
-
constructor(from, to, duration, easing, params) {
|
|
11
|
-
super(from, to, duration, easing, params);
|
|
12
|
-
}
|
|
13
|
-
onFirstRun() {
|
|
14
|
-
var _a, _b, _c, _d, _e;
|
|
15
|
-
let from, to;
|
|
16
|
-
const attrs = this.target.getAttributes();
|
|
17
|
-
switch (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) {
|
|
18
|
-
case "x":
|
|
19
|
-
from = {
|
|
20
|
-
scaleX: 0
|
|
21
|
-
}, to = {
|
|
22
|
-
scaleX: null !== (_b = null == attrs ? void 0 : attrs.scaleX) && void 0 !== _b ? _b : 1
|
|
23
|
-
};
|
|
24
|
-
break;
|
|
25
|
-
|
|
26
|
-
case "y":
|
|
27
|
-
from = {
|
|
28
|
-
scaleY: 0
|
|
29
|
-
}, to = {
|
|
30
|
-
scaleY: null !== (_c = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _c ? _c : 1
|
|
31
|
-
};
|
|
32
|
-
break;
|
|
33
|
-
|
|
34
|
-
default:
|
|
35
|
-
from = {
|
|
36
|
-
scaleX: 0,
|
|
37
|
-
scaleY: 0
|
|
38
|
-
}, to = {
|
|
39
|
-
scaleX: null !== (_d = null == attrs ? void 0 : attrs.scaleX) && void 0 !== _d ? _d : 1,
|
|
40
|
-
scaleY: null !== (_e = null == attrs ? void 0 : attrs.scaleY) && void 0 !== _e ? _e : 1
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
this.props = to, this.propKeys = Object.keys(to), this.animate.reSyncProps(), this.from = from,
|
|
44
|
-
this.to = to;
|
|
45
|
-
}
|
|
46
|
-
onEnd(cb) {
|
|
47
|
-
super.onEnd(cb);
|
|
48
|
-
}
|
|
49
|
-
onUpdate(end, ratio, out) {
|
|
50
|
-
this.valid && (this.propKeys.forEach((key => {
|
|
51
|
-
out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
52
|
-
})), this.target.setAttributes(out));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
exports.ScaleIn = ScaleIn;
|
|
57
|
-
//# sourceMappingURL=scale-in.js.map
|
|
@@ -1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AI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,KAAK,CAAC,EAA6C;QACjD,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF;AAlDD,0BAkDC","file":"scale-in.js","sourcesContent":["import type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\n/**\n * 文本输入动画,实现类似打字机的字符逐个显示效果\n * 支持通过beforeText和afterText参数添加前缀和后缀\n * 支持通过showCursor参数显示光标,cursorChar自定义光标字符\n */\nexport class ScaleIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n let from: Record<string, number>;\n let to: Record<string, number>;\n // 获取当前的数据\n const attrs = this.target.getAttributes();\n switch (this.params?.direction) {\n case 'x':\n from = { scaleX: 0 };\n to = { scaleX: attrs?.scaleX ?? 1 };\n break;\n case 'y':\n from = { scaleY: 0 };\n to = { scaleY: attrs?.scaleY ?? 1 };\n break;\n case 'xy':\n default:\n from = { scaleX: 0, scaleY: 0 };\n to = {\n scaleX: attrs?.scaleX ?? 1,\n scaleY: attrs?.scaleY ?? 1\n };\n }\n this.props = to;\n this.propKeys = Object.keys(to);\n this.animate.reSyncProps();\n this.from = from;\n this.to = to;\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.valid) {\n return;\n }\n\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n"]}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { IGraphic } from '@visactor/vrender-core';
|
|
2
|
-
import type { EasingType } from '../intreface/easing';
|
|
3
|
-
import type { ACustomAnimate } from '../custom/custom-animate';
|
|
4
|
-
export type MarkFunctionCallback<T> = (datum: any, graphic: IGraphic, parameters: any) => T;
|
|
5
|
-
export type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;
|
|
6
|
-
interface IAnimationParameters {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
export type IAnimationChannelFunction = (datum: any, element: IGraphic, parameters: IAnimationParameters) => any;
|
|
10
|
-
export type IAnimationChannelAttrs = Record<string, {
|
|
11
|
-
from?: any | IAnimationChannelFunction;
|
|
12
|
-
to?: any | IAnimationChannelFunction;
|
|
13
|
-
}>;
|
|
14
|
-
export type IAnimationChannelAttributes = string[];
|
|
15
|
-
export type IAnimationChannelInterpolator = (ratio: number, from: any, to: any, nextAttributes: any, datum: any, element: IGraphic, parameters: IAnimationParameters) => boolean | void;
|
|
16
|
-
export interface IAnimationCustomConstructor {
|
|
17
|
-
new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;
|
|
18
|
-
}
|
|
19
|
-
export interface IAnimationEffect {
|
|
20
|
-
type?: string;
|
|
21
|
-
channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;
|
|
22
|
-
custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;
|
|
23
|
-
customParameters?: MarkFunctionValueType<any>;
|
|
24
|
-
easing?: EasingType;
|
|
25
|
-
options?: MarkFunctionValueType<any>;
|
|
26
|
-
}
|
|
27
|
-
export interface IAnimationTimeSlice {
|
|
28
|
-
effects: IAnimationEffect | IAnimationEffect[];
|
|
29
|
-
duration?: MarkFunctionValueType<number>;
|
|
30
|
-
delay?: MarkFunctionValueType<number>;
|
|
31
|
-
delayAfter?: MarkFunctionValueType<number>;
|
|
32
|
-
}
|
|
33
|
-
export interface IAnimationControlOptions {
|
|
34
|
-
stopWhenStateChange?: boolean;
|
|
35
|
-
immediatelyApply?: boolean;
|
|
36
|
-
ignoreLoopFinalAttributes?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export interface IAnimationTypeConfig {
|
|
39
|
-
type?: string;
|
|
40
|
-
channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;
|
|
41
|
-
custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;
|
|
42
|
-
customParameters?: MarkFunctionValueType<any>;
|
|
43
|
-
easing?: EasingType;
|
|
44
|
-
delay?: MarkFunctionValueType<number>;
|
|
45
|
-
delayAfter?: MarkFunctionValueType<number>;
|
|
46
|
-
duration?: MarkFunctionValueType<number>;
|
|
47
|
-
oneByOne?: MarkFunctionValueType<boolean | number>;
|
|
48
|
-
startTime?: MarkFunctionValueType<number>;
|
|
49
|
-
totalTime?: MarkFunctionValueType<number>;
|
|
50
|
-
loop?: boolean | number;
|
|
51
|
-
options?: MarkFunctionValueType<any>;
|
|
52
|
-
controlOptions?: IAnimationControlOptions;
|
|
53
|
-
}
|
|
54
|
-
export interface IAnimationTimeline {
|
|
55
|
-
id?: string;
|
|
56
|
-
timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];
|
|
57
|
-
startTime?: MarkFunctionValueType<number>;
|
|
58
|
-
totalTime?: MarkFunctionValueType<number>;
|
|
59
|
-
oneByOne?: MarkFunctionValueType<number | boolean>;
|
|
60
|
-
loop?: MarkFunctionValueType<number | boolean>;
|
|
61
|
-
partitioner?: MarkFunctionCallback<boolean>;
|
|
62
|
-
sort?: (datumA: any, datumB: any, elementA: IGraphic, elementB: IGraphic, parameters: any) => number;
|
|
63
|
-
controlOptions?: IAnimationControlOptions;
|
|
64
|
-
}
|
|
65
|
-
export type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;
|
|
66
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interpolate/executor.ts"],"names":[],"mappings":"","file":"executor.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender-core';\nimport type { EasingType } from '../intreface/easing';\nimport type { ACustomAnimate } from '../custom/custom-animate';\n\nexport type MarkFunctionCallback<T> = (datum: any, graphic: IGraphic, parameters: any) => T;\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\ninterface IAnimationParameters {\n [key: string]: any;\n}\n\n/**\n * 动画 channel 配置\n */\nexport type IAnimationChannelFunction = (datum: any, element: IGraphic, parameters: IAnimationParameters) => any;\n\n/**\n * 动画 channel 属性配置\n */\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\n\n/**\n * 动画 channel 插值器\n */\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IGraphic,\n parameters: IAnimationParameters\n) => boolean | void;\n\n/**\n * 动画 custom 构造器\n */\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n /** 动画类型 */\n type?: string;\n /** 动画 channel 配置 */\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n /** 动画 自定义插值 配置 */\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n /** 动画 custom 参数配置 */\n customParameters?: MarkFunctionValueType<any>;\n /** 动画 easing 配置 */\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationTimeSlice {\n /** 动画效果 */\n effects: IAnimationEffect | IAnimationEffect[];\n /** 动画时长 */\n duration?: MarkFunctionValueType<number>;\n /** 延迟delay后执行动画 */\n delay?: MarkFunctionValueType<number>;\n /** effect动画后再延迟delayAfter结束这个周期 */\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n /** 动画类型 */\n type?: string;\n /** 动画 channel 配置 */\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n /** 动画 自定义插值 配置 */\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n /** 动画 custom 参数配置 */\n customParameters?: MarkFunctionValueType<any>;\n /** 动画 easing 配置 */\n easing?: EasingType;\n /** 动画 delay 配置 */\n delay?: MarkFunctionValueType<number>;\n /** 动画 delayAfter 配置 */\n delayAfter?: MarkFunctionValueType<number>;\n /** 动画 duration 配置 */\n duration?: MarkFunctionValueType<number>;\n /** 动画 oneByOne 配置(是否依次执行) */\n oneByOne?: MarkFunctionValueType<boolean | number>;\n /** 动画 startTime 配置 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画 totalTime 配置 */\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IGraphic, elementB: IGraphic, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n"]}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { IGraphic } from '@visactor/vrender-core';
|
|
2
|
-
import type { EasingType, EasingTypeFunc } from './easing';
|
|
3
|
-
import type { AnimateStatus, IAnimateStepType } from './type';
|
|
4
|
-
import type { ITimeline } from './timeline';
|
|
5
|
-
export interface ICustomAnimate extends IStep {
|
|
6
|
-
type: IAnimateStepType;
|
|
7
|
-
}
|
|
8
|
-
export interface IStep {
|
|
9
|
-
type: IAnimateStepType;
|
|
10
|
-
prev?: IStep;
|
|
11
|
-
duration: number;
|
|
12
|
-
next?: IStep;
|
|
13
|
-
props?: Record<string, any>;
|
|
14
|
-
fromParsedProps?: Record<string, any>;
|
|
15
|
-
toParsedProps?: Record<string, any>;
|
|
16
|
-
fromProps?: Record<string, any>;
|
|
17
|
-
propKeys?: string[];
|
|
18
|
-
easing?: EasingTypeFunc;
|
|
19
|
-
append: (step: IStep) => void;
|
|
20
|
-
getLastProps: () => any;
|
|
21
|
-
animate: IAnimate;
|
|
22
|
-
setDuration: (duration: number, updateDownstream?: boolean) => void;
|
|
23
|
-
getDuration: () => number;
|
|
24
|
-
determineInterpolateUpdateFunction: () => void;
|
|
25
|
-
setStartTime: (time: number, updateDownstream?: boolean) => void;
|
|
26
|
-
getStartTime: () => number;
|
|
27
|
-
bind: (target: IGraphic, animate: IAnimate) => void;
|
|
28
|
-
onBind: () => void;
|
|
29
|
-
onFirstRun: () => void;
|
|
30
|
-
onStart: () => void;
|
|
31
|
-
onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;
|
|
32
|
-
update: (end: boolean, ratio: number, out: Record<string, any>) => void;
|
|
33
|
-
onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;
|
|
34
|
-
getEndProps: () => Record<string, any> | void;
|
|
35
|
-
getFromProps: () => Record<string, any> | void;
|
|
36
|
-
getMergedEndProps: () => Record<string, any> | void;
|
|
37
|
-
deleteSelfAttr: (key: string) => void;
|
|
38
|
-
}
|
|
39
|
-
export interface IAnimate {
|
|
40
|
-
readonly id: string | number;
|
|
41
|
-
status: AnimateStatus;
|
|
42
|
-
target: IGraphic;
|
|
43
|
-
priority: number;
|
|
44
|
-
interpolateUpdateFunction: ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void) | null;
|
|
45
|
-
_onStart?: (() => void)[];
|
|
46
|
-
_onFrame?: ((step: IStep, ratio: number) => void)[];
|
|
47
|
-
_onEnd?: (() => void)[];
|
|
48
|
-
_onRemove?: (() => void)[];
|
|
49
|
-
getStartProps: () => Record<string, any>;
|
|
50
|
-
getEndProps: () => Record<string, any>;
|
|
51
|
-
setTimeline: (timeline: ITimeline) => void;
|
|
52
|
-
getTimeline: () => ITimeline;
|
|
53
|
-
readonly timeline: ITimeline;
|
|
54
|
-
bind: (target: IGraphic) => this;
|
|
55
|
-
to: (props: Record<string, any>, duration: number, easing: EasingType) => this;
|
|
56
|
-
from: (props: Record<string, any>, duration: number, easing: EasingType) => this;
|
|
57
|
-
pause: () => void;
|
|
58
|
-
resume: () => void;
|
|
59
|
-
onStart: (cb?: () => void) => void;
|
|
60
|
-
onEnd: (cb?: () => void) => void;
|
|
61
|
-
onFrame: (cb: (step: IStep, ratio: number) => void) => void;
|
|
62
|
-
onRemove: (cb?: () => void) => void;
|
|
63
|
-
preventAttr: (key: string) => void;
|
|
64
|
-
preventAttrs: (key: string[]) => void;
|
|
65
|
-
validAttr: (key: string) => boolean;
|
|
66
|
-
runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;
|
|
67
|
-
customInterpolate: (key: string, ratio: number, from: any, to: any, target: IGraphic, ret: Record<string, any>) => boolean;
|
|
68
|
-
play: (customAnimate: ICustomAnimate) => this;
|
|
69
|
-
getFromValue: () => Record<string, any>;
|
|
70
|
-
getToValue: () => Record<string, any>;
|
|
71
|
-
stop: (type?: 'start' | 'end' | Record<string, any>) => void;
|
|
72
|
-
release: () => void;
|
|
73
|
-
getDuration: () => number;
|
|
74
|
-
getTotalDuration: () => number;
|
|
75
|
-
getStartTime: () => number;
|
|
76
|
-
wait: (delay: number) => this;
|
|
77
|
-
afterAll: (list: IAnimate[]) => this;
|
|
78
|
-
after: (animate: IAnimate) => this;
|
|
79
|
-
parallel: (animate: IAnimate) => this;
|
|
80
|
-
getLoop: () => number;
|
|
81
|
-
loop: (n: number | boolean) => IAnimate;
|
|
82
|
-
bounce: (b: boolean) => IAnimate;
|
|
83
|
-
advance: (delta: number) => void;
|
|
84
|
-
startAt: (t: number) => IAnimate;
|
|
85
|
-
reSyncProps: () => void;
|
|
86
|
-
updateDuration: () => void;
|
|
87
|
-
}
|
|
88
|
-
export declare enum AnimateMode {
|
|
89
|
-
NORMAL = 0,
|
|
90
|
-
SET_ATTR_IMMEDIATELY = 1
|
|
91
|
-
}
|
package/cjs/intreface/animate.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var AnimateMode;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: !0
|
|
7
|
-
}), exports.AnimateMode = void 0, function(AnimateMode) {
|
|
8
|
-
AnimateMode[AnimateMode.NORMAL = 0] = "NORMAL", AnimateMode[AnimateMode.SET_ATTR_IMMEDIATELY = 1] = "SET_ATTR_IMMEDIATELY";
|
|
9
|
-
}(AnimateMode = exports.AnimateMode || (exports.AnimateMode = {}));
|
|
10
|
-
//# sourceMappingURL=animate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/animate.ts"],"names":[],"mappings":";;;AAmKA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender-core';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n"]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type EasingTypeStr = 'linear' | 'quadIn' | 'quadOut' | 'quadInOut' | 'quadInOut' | 'cubicIn' | 'cubicOut' | 'cubicInOut' | 'quartIn' | 'quartOut' | 'quartInOut' | 'quintIn' | 'quintOut' | 'quintInOut' | 'backIn' | 'backOut' | 'backInOut' | 'circIn' | 'circOut' | 'circInOut' | 'bounceOut' | 'bounceIn' | 'bounceInOut' | 'elasticIn' | 'elasticOut' | 'elasticInOut' | 'sineIn' | 'sineOut' | 'sineInOut' | 'expoIn' | 'expoOut' | 'expoInOut' | 'easeInOutQuad' | 'easeOutElastic' | 'easeInOutElastic' | '';
|
|
2
|
-
export type EasingTypeFunc = (t: number) => number;
|
|
3
|
-
export type EasingType = EasingTypeStr | EasingTypeFunc;
|
package/cjs/intreface/easing.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/easing.ts"],"names":[],"mappings":"","file":"easing.js","sourcesContent":["export type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n // @since 0.21.0\n | 'easeInOutQuad'\n | 'easeOutElastic'\n | 'easeInOutElastic'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n"]}
|
package/cjs/intreface/state.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { IAnimationTypeConfig } from '../executor/executor';
|
|
2
|
-
import type { IGraphic, IGroup } from '@visactor/vrender-core';
|
|
3
|
-
export interface IAnimationStateConfig {
|
|
4
|
-
name: string;
|
|
5
|
-
animation: IAnimationTypeConfig;
|
|
6
|
-
priority?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface IAnimationStateRule {
|
|
9
|
-
conflicts?: string[];
|
|
10
|
-
interruptibleBy?: string[];
|
|
11
|
-
queueable?: boolean;
|
|
12
|
-
transitionDelay?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface IAnimationStateMachine {
|
|
15
|
-
applyState: (state: string | string[]) => void;
|
|
16
|
-
registerState: (config: IAnimationStateConfig, rule?: IAnimationStateRule) => void;
|
|
17
|
-
getActiveState: () => string | null;
|
|
18
|
-
reset: () => void;
|
|
19
|
-
on: (event: AnimationStateEventType, callback: (state: string, target: IGraphic | IGroup) => void) => void;
|
|
20
|
-
off: (event: AnimationStateEventType, callback: (state: string, target: IGraphic | IGroup) => void) => void;
|
|
21
|
-
}
|
|
22
|
-
export type AnimationStateEventType = 'stateStart' | 'stateEnd' | 'stateInterrupt' | 'stateReject';
|
|
23
|
-
export interface IAnimationStateRegistry {
|
|
24
|
-
register: (state: IAnimationStateConfig, rule?: IAnimationStateRule) => void;
|
|
25
|
-
getState: (name: string) => IAnimationStateConfig | undefined;
|
|
26
|
-
getRule: (name: string) => IAnimationStateRule | undefined;
|
|
27
|
-
hasConflict: (stateA: string, stateB: string) => boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface IAnimationStateQueue {
|
|
30
|
-
enqueue: (states: string | string[]) => void;
|
|
31
|
-
processNextState: () => void;
|
|
32
|
-
onAnimationComplete: () => void;
|
|
33
|
-
cancel: () => void;
|
|
34
|
-
canApplyState: (state: string) => boolean;
|
|
35
|
-
}
|
package/cjs/intreface/state.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/state.ts"],"names":[],"mappings":"","file":"state.js","sourcesContent":["import type { IAnimationTypeConfig } from '../executor/executor';\nimport type { IAnimate } from './animate';\nimport type { IGraphic, IGroup } from '@visactor/vrender-core';\n\n/**\n * Animation state configuration\n */\nexport interface IAnimationStateConfig {\n /** State name */\n name: string;\n /** Animation configuration for this state */\n animation: IAnimationTypeConfig;\n /** Priority of this state (higher overrides lower when there's a conflict) */\n priority?: number;\n}\n\n/**\n * Rules for animation state behaviors\n */\nexport interface IAnimationStateRule {\n /** States that cannot run simultaneously with this state */\n conflicts?: string[];\n /** States that can interrupt this state */\n interruptibleBy?: string[];\n /** Whether this state can be queued */\n queueable?: boolean;\n /** Duration to wait before executing next state (if queueable) */\n transitionDelay?: number;\n}\n\n/**\n * Animation state machine interface\n */\nexport interface IAnimationStateMachine {\n /** Apply a state or sequence of states */\n applyState: (state: string | string[]) => void;\n\n /** Register new state animations and rules */\n registerState: (config: IAnimationStateConfig, rule?: IAnimationStateRule) => void;\n\n /** Get current active state */\n getActiveState: () => string | null;\n\n /** Cancel all animations and clear queue */\n reset: () => void;\n\n /** Add event listener for state events */\n on: (event: AnimationStateEventType, callback: (state: string, target: IGraphic | IGroup) => void) => void;\n\n /** Remove event listener */\n off: (event: AnimationStateEventType, callback: (state: string, target: IGraphic | IGroup) => void) => void;\n}\n\n/**\n * Animation state event types\n */\nexport type AnimationStateEventType = 'stateStart' | 'stateEnd' | 'stateInterrupt' | 'stateReject';\n\n/**\n * Animation state registry interface\n */\nexport interface IAnimationStateRegistry {\n /** Register a state with its animation config and rules */\n register: (state: IAnimationStateConfig, rule?: IAnimationStateRule) => void;\n\n /** Get state configuration by name */\n getState: (name: string) => IAnimationStateConfig | undefined;\n\n /** Get state rule by name */\n getRule: (name: string) => IAnimationStateRule | undefined;\n\n /** Check if two states conflict with each other */\n hasConflict: (stateA: string, stateB: string) => boolean;\n}\n\n/**\n * Animation state queue interface\n */\nexport interface IAnimationStateQueue {\n /** Add state(s) to queue */\n enqueue: (states: string | string[]) => void;\n\n /** Process the next state in queue */\n processNextState: () => void;\n\n /** Called when current animation completes */\n onAnimationComplete: () => void;\n\n /** Cancel current state and clear queue */\n cancel: () => void;\n\n /** Check if we can apply a specific state now */\n canApplyState: (state: string) => boolean;\n}\n"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { EventEmitter } from '@visactor/vutils';
|
|
2
|
-
import type { ITimeline } from './timeline';
|
|
3
|
-
export type TickerMode = 'raf' | 'timeout' | 'manual';
|
|
4
|
-
export declare enum STATUS {
|
|
5
|
-
INITIAL = 0,
|
|
6
|
-
RUNNING = 1,
|
|
7
|
-
PAUSE = 2
|
|
8
|
-
}
|
|
9
|
-
export interface ITickHandler {
|
|
10
|
-
tick: (interval: number, cb: (handler: ITickHandler) => void) => void;
|
|
11
|
-
tickTo?: (t: number, cb: (handler: ITickHandler, params?: {
|
|
12
|
-
once: boolean;
|
|
13
|
-
}) => void) => void;
|
|
14
|
-
getTime: () => number;
|
|
15
|
-
release: () => void;
|
|
16
|
-
}
|
|
17
|
-
export interface ITickerHandlerStatic {
|
|
18
|
-
new (): ITickHandler;
|
|
19
|
-
}
|
|
20
|
-
export interface ITicker extends EventEmitter {
|
|
21
|
-
setFPS?: (fps: number) => void;
|
|
22
|
-
setInterval?: (interval: number) => void;
|
|
23
|
-
getFPS?: () => number;
|
|
24
|
-
getInterval?: () => number;
|
|
25
|
-
tick: (interval: number) => void;
|
|
26
|
-
tickAt?: (time: number) => void;
|
|
27
|
-
pause: () => boolean;
|
|
28
|
-
resume: () => boolean;
|
|
29
|
-
start: (force?: boolean) => boolean;
|
|
30
|
-
stop: () => void;
|
|
31
|
-
addTimeline: (timeline: ITimeline) => void;
|
|
32
|
-
remTimeline: (timeline: ITimeline) => void;
|
|
33
|
-
trySyncTickStatus: () => void;
|
|
34
|
-
getTimelines: () => ITimeline[];
|
|
35
|
-
release: () => void;
|
|
36
|
-
autoStop: boolean;
|
|
37
|
-
}
|
package/cjs/intreface/ticker.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var STATUS;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: !0
|
|
7
|
-
}), exports.STATUS = void 0, function(STATUS) {
|
|
8
|
-
STATUS[STATUS.INITIAL = 0] = "INITIAL", STATUS[STATUS.RUNNING = 1] = "RUNNING",
|
|
9
|
-
STATUS[STATUS.PAUSE = 2] = "PAUSE";
|
|
10
|
-
}(STATUS = exports.STATUS || (exports.STATUS = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/ticker.ts"],"names":[],"mappings":";;;AASA,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,yCAAW,CAAA;IACX,yCAAW,CAAA;IACX,qCAAS,CAAA;AACX,CAAC,EAJW,MAAM,GAAN,cAAM,KAAN,cAAM,QAIjB","file":"ticker.js","sourcesContent":["/**\n * Ticker Types for Animation Graph\n */\n\nimport type { EventEmitter } from '@visactor/vutils';\nimport type { ITimeline } from './timeline';\n\nexport type TickerMode = 'raf' | 'timeout' | 'manual';\n\nexport enum STATUS {\n INITIAL = 0, // initial represents initial state\n RUNNING = 1, // running represents executing\n PAUSE = 2 // PAUSE represents tick continues but functions are not executed\n}\n\nexport interface ITickHandler {\n /**\n * Start executing tick\n * @param interval Delay in ms\n * @param cb Callback to execute\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void;\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // Get current time\n release: () => void;\n}\n\nexport interface ITickerHandlerStatic {\n new (): ITickHandler;\n}\n\nexport interface ITicker extends EventEmitter {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * Start ticking, if force is true, start regardless;\n * otherwise, don't start if timeline is empty\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n trySyncTickStatus: () => void;\n getTimelines: () => ITimeline[];\n release: () => void;\n\n // Whether to automatically stop, default is true\n autoStop: boolean;\n}\n"]}
|