@visactor/vrender-animate 0.23.0-alpha.3 → 1.0.0-alpha.1
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 +1 -3
- package/cjs/animate-extension.js +0 -7
- package/cjs/animate-extension.js.map +1 -1
- package/cjs/animate.d.ts +1 -5
- package/cjs/animate.js +12 -12
- package/cjs/animate.js.map +1 -1
- package/cjs/component/component-animator.d.ts +3 -2
- package/cjs/component/component-animator.js +18 -32
- package/cjs/component/component-animator.js.map +1 -1
- package/cjs/custom/clip-graphic.d.ts +1 -1
- package/cjs/custom/clip-graphic.js.map +1 -1
- package/cjs/custom/clip.d.ts +1 -1
- package/cjs/custom/clip.js.map +1 -1
- package/cjs/custom/common.d.ts +1 -2
- package/cjs/custom/common.js +12 -10
- package/cjs/custom/common.js.map +1 -1
- package/cjs/custom/custom-animate.d.ts +2 -4
- package/cjs/custom/custom-animate.js +2 -2
- package/cjs/custom/custom-animate.js.map +1 -1
- package/cjs/custom/fade.d.ts +1 -1
- package/cjs/custom/fade.js.map +1 -1
- package/cjs/custom/from-to.d.ts +9 -0
- package/cjs/custom/from-to.js +38 -0
- package/cjs/custom/from-to.js.map +1 -0
- package/cjs/custom/group-fade.d.ts +8 -14
- package/cjs/custom/group-fade.js +9 -50
- package/cjs/custom/group-fade.js.map +1 -1
- package/cjs/custom/growAngle.d.ts +2 -2
- package/cjs/custom/growAngle.js +17 -12
- package/cjs/custom/growAngle.js.map +1 -1
- package/cjs/custom/growCenter.d.ts +1 -2
- package/cjs/custom/growCenter.js +8 -7
- package/cjs/custom/growCenter.js.map +1 -1
- package/cjs/custom/growHeight.d.ts +1 -3
- package/cjs/custom/growHeight.js +7 -7
- package/cjs/custom/growHeight.js.map +1 -1
- package/cjs/custom/growPoints.d.ts +1 -2
- package/cjs/custom/growPoints.js +19 -17
- package/cjs/custom/growPoints.js.map +1 -1
- package/cjs/custom/growRadius.d.ts +4 -5
- package/cjs/custom/growRadius.js +12 -12
- package/cjs/custom/growRadius.js.map +1 -1
- package/cjs/custom/growWidth.d.ts +1 -3
- package/cjs/custom/growWidth.js +7 -6
- 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.js +2 -2
- package/cjs/custom/label-item-animate.js.map +1 -1
- package/cjs/custom/move.d.ts +92 -0
- package/cjs/custom/move.js +131 -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.js +2 -1
- package/cjs/custom/poptip-animate.js.map +1 -1
- package/cjs/custom/register.js +21 -2
- package/cjs/custom/register.js.map +1 -1
- package/cjs/custom/richtext/input-richtext.d.ts +33 -0
- package/cjs/custom/richtext/input-richtext.js +70 -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 +76 -0
- package/cjs/custom/rotate.js.map +1 -0
- package/cjs/custom/scale.d.ts +2 -2
- package/cjs/custom/scale.js +25 -21
- package/cjs/custom/scale.js.map +1 -1
- package/cjs/custom/sphere.js +1 -2
- package/cjs/custom/state.d.ts +1 -1
- package/cjs/custom/state.js.map +1 -1
- package/cjs/custom/story.d.ts +128 -0
- package/cjs/custom/story.js +347 -0
- package/cjs/custom/story.js.map +1 -0
- package/cjs/custom/tag-points.d.ts +2 -3
- package/cjs/custom/tag-points.js +18 -5
- package/cjs/custom/tag-points.js.map +1 -1
- package/cjs/custom/update.d.ts +2 -1
- package/cjs/custom/update.js +10 -2
- package/cjs/custom/update.js.map +1 -1
- package/cjs/executor/animate-executor.d.ts +6 -5
- package/cjs/executor/animate-executor.js +57 -29
- package/cjs/executor/animate-executor.js.map +1 -1
- package/cjs/executor/executor.d.ts +6 -3
- package/cjs/executor/executor.js.map +1 -1
- package/cjs/index.d.ts +3 -6
- package/cjs/index.js +16 -4
- package/cjs/index.js.map +1 -1
- package/cjs/interpolate/store.d.ts +2 -2
- package/cjs/interpolate/store.js +2 -0
- package/cjs/interpolate/store.js.map +1 -1
- package/cjs/state/animation-state.d.ts +2 -2
- package/cjs/state/animation-state.js +3 -3
- package/cjs/state/animation-state.js.map +1 -1
- package/cjs/state/graphic-extension.d.ts +1 -1
- package/cjs/state/graphic-extension.js.map +1 -1
- package/cjs/step.d.ts +2 -4
- package/cjs/step.js +1 -1
- package/cjs/step.js.map +1 -1
- package/cjs/ticker/default-ticker.d.ts +2 -3
- package/cjs/ticker/default-ticker.js +14 -12
- package/cjs/ticker/default-ticker.js.map +1 -1
- package/cjs/ticker/manual-ticker.d.ts +1 -1
- package/cjs/ticker/manual-ticker.js.map +1 -1
- package/cjs/timeline.d.ts +1 -2
- package/cjs/timeline.js.map +1 -1
- package/cjs/utils/easing-func.js +2 -1
- package/dist/index.es.js +1859 -554
- package/es/animate-extension.d.ts +1 -3
- package/es/animate-extension.js +0 -7
- package/es/animate-extension.js.map +1 -1
- package/es/animate.d.ts +1 -5
- package/es/animate.js +1 -3
- package/es/animate.js.map +1 -1
- package/es/component/component-animator.d.ts +3 -2
- package/es/component/component-animator.js +18 -32
- package/es/component/component-animator.js.map +1 -1
- package/es/custom/clip-graphic.d.ts +1 -1
- package/es/custom/clip-graphic.js.map +1 -1
- package/es/custom/clip.d.ts +1 -1
- package/es/custom/clip.js.map +1 -1
- package/es/custom/common.d.ts +1 -2
- package/es/custom/common.js +12 -10
- package/es/custom/common.js.map +1 -1
- package/es/custom/custom-animate.d.ts +2 -4
- package/es/custom/custom-animate.js +2 -2
- package/es/custom/custom-animate.js.map +1 -1
- package/es/custom/fade.d.ts +1 -1
- package/es/custom/fade.js.map +1 -1
- package/es/custom/from-to.d.ts +9 -0
- package/es/custom/from-to.js +30 -0
- package/es/custom/from-to.js.map +1 -0
- package/es/custom/group-fade.d.ts +8 -14
- package/es/custom/group-fade.js +9 -50
- package/es/custom/group-fade.js.map +1 -1
- package/es/custom/growAngle.d.ts +2 -2
- package/es/custom/growAngle.js +20 -12
- package/es/custom/growAngle.js.map +1 -1
- package/es/custom/growCenter.d.ts +1 -2
- package/es/custom/growCenter.js +8 -7
- package/es/custom/growCenter.js.map +1 -1
- package/es/custom/growHeight.d.ts +1 -3
- package/es/custom/growHeight.js +8 -8
- package/es/custom/growHeight.js.map +1 -1
- package/es/custom/growPoints.d.ts +1 -2
- package/es/custom/growPoints.js +19 -17
- package/es/custom/growPoints.js.map +1 -1
- package/es/custom/growRadius.d.ts +4 -5
- package/es/custom/growRadius.js +12 -10
- package/es/custom/growRadius.js.map +1 -1
- package/es/custom/growWidth.d.ts +1 -3
- package/es/custom/growWidth.js +8 -7
- 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.js +2 -2
- package/es/custom/label-item-animate.js.map +1 -1
- package/es/custom/move.d.ts +92 -0
- package/es/custom/move.js +116 -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.js +2 -1
- package/es/custom/poptip-animate.js.map +1 -1
- package/es/custom/register.js +41 -16
- package/es/custom/register.js.map +1 -1
- package/es/custom/richtext/input-richtext.d.ts +33 -0
- package/es/custom/richtext/input-richtext.js +64 -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 +62 -0
- package/es/custom/rotate.js.map +1 -0
- package/es/custom/scale.d.ts +2 -2
- package/es/custom/scale.js +25 -21
- package/es/custom/scale.js.map +1 -1
- package/es/custom/sphere.js +1 -2
- package/es/custom/state.d.ts +1 -1
- package/es/custom/state.js.map +1 -1
- package/es/custom/story.d.ts +128 -0
- package/es/custom/story.js +323 -0
- package/es/custom/story.js.map +1 -0
- package/es/custom/tag-points.d.ts +2 -3
- package/es/custom/tag-points.js +19 -6
- package/es/custom/tag-points.js.map +1 -1
- package/es/custom/update.d.ts +2 -1
- package/es/custom/update.js +10 -2
- package/es/custom/update.js.map +1 -1
- package/es/executor/animate-executor.d.ts +6 -5
- package/es/executor/animate-executor.js +55 -29
- package/es/executor/animate-executor.js.map +1 -1
- package/es/executor/executor.d.ts +6 -3
- package/es/executor/executor.js.map +1 -1
- package/es/index.d.ts +3 -6
- package/es/index.js +4 -10
- package/es/index.js.map +1 -1
- package/es/interpolate/store.d.ts +2 -2
- package/es/interpolate/store.js +2 -0
- package/es/interpolate/store.js.map +1 -1
- package/es/state/animation-state.d.ts +2 -2
- package/es/state/animation-state.js +4 -2
- package/es/state/animation-state.js.map +1 -1
- package/es/state/graphic-extension.d.ts +1 -1
- package/es/state/graphic-extension.js.map +1 -1
- package/es/step.d.ts +2 -4
- package/es/step.js +2 -2
- package/es/step.js.map +1 -1
- package/es/ticker/default-ticker.d.ts +2 -3
- package/es/ticker/default-ticker.js +5 -5
- package/es/ticker/default-ticker.js.map +1 -1
- package/es/ticker/manual-ticker.d.ts +1 -1
- package/es/ticker/manual-ticker.js.map +1 -1
- package/es/timeline.d.ts +1 -2
- package/es/timeline.js +1 -1
- package/es/timeline.js.map +1 -1
- package/es/utils/easing-func.js +2 -1
- package/package.json +5 -5
- package/cjs/custom/label-animate.d.ts +0 -4
- package/cjs/custom/label-animate.js +0 -48
- package/cjs/custom/label-animate.js.map +0 -1
- package/cjs/intreface/animate.d.ts +0 -92
- 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/ticker.d.ts +0 -37
- package/cjs/intreface/ticker.js +0 -11
- 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/es/custom/label-animate.d.ts +0 -4
- package/es/custom/label-animate.js +0 -42
- package/es/custom/label-animate.js.map +0 -1
- package/es/intreface/animate.d.ts +0 -92
- 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/ticker.d.ts +0 -37
- package/es/intreface/ticker.js +0 -7
- 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/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":";;;AAsKA,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 // 停止\n stop: () => 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"]}
|
|
@@ -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,11 +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 = {}));
|
|
11
|
-
//# sourceMappingURL=ticker.js.map
|
|
@@ -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"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IAnimate } from './animate';
|
|
2
|
-
export interface ITimeline {
|
|
3
|
-
id: number;
|
|
4
|
-
isGlobal?: boolean;
|
|
5
|
-
animateCount: number;
|
|
6
|
-
addAnimate: (animate: IAnimate) => void;
|
|
7
|
-
removeAnimate: (animate: IAnimate, release?: boolean) => void;
|
|
8
|
-
tick: (delta: number) => void;
|
|
9
|
-
clear: () => void;
|
|
10
|
-
pause: () => void;
|
|
11
|
-
resume: () => void;
|
|
12
|
-
getTotalDuration: () => number;
|
|
13
|
-
getPlaySpeed: () => number;
|
|
14
|
-
setPlaySpeed: (speed: number) => void;
|
|
15
|
-
getPlayState: () => 'playing' | 'paused' | 'stopped';
|
|
16
|
-
isRunning: () => boolean;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/timeline.ts"],"names":[],"mappings":"","file":"timeline.js","sourcesContent":["import type { IAnimate } from './animate';\n\nexport interface ITimeline {\n id: number;\n isGlobal?: boolean;\n // 包含的动画数量(animate数组的数量),包含所有动画\n animateCount: number;\n // 添加动画\n addAnimate: (animate: IAnimate) => void;\n // 移除动画\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n // 更新动画\n tick: (delta: number) => void;\n // 清除动画\n clear: () => void;\n // 暂停动画\n pause: () => void;\n // 恢复动画\n resume: () => void;\n // 获取动画总时长\n getTotalDuration: () => number;\n // 获取动画的播放速度\n getPlaySpeed: () => number;\n // 设置动画的播放速度\n setPlaySpeed: (speed: number) => void;\n // 获取动画的播放状态\n getPlayState: () => 'playing' | 'paused' | 'stopped';\n // 获取动画是否正在运行\n isRunning: () => boolean;\n}\n"]}
|
package/cjs/intreface/type.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare enum AnimateStepType {
|
|
2
|
-
wait = "wait",
|
|
3
|
-
from = "from",
|
|
4
|
-
to = "to",
|
|
5
|
-
customAnimate = "customAnimate"
|
|
6
|
-
}
|
|
7
|
-
export declare enum AnimateStatus {
|
|
8
|
-
INITIAL = 0,
|
|
9
|
-
RUNNING = 1,
|
|
10
|
-
PAUSED = 2,
|
|
11
|
-
END = 3
|
|
12
|
-
}
|
|
13
|
-
export type IAnimateStepType = keyof typeof AnimateStepType;
|
package/cjs/intreface/type.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var AnimateStepType, AnimateStatus;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: !0
|
|
7
|
-
}), exports.AnimateStatus = exports.AnimateStepType = void 0, function(AnimateStepType) {
|
|
8
|
-
AnimateStepType.wait = "wait", AnimateStepType.from = "from", AnimateStepType.to = "to",
|
|
9
|
-
AnimateStepType.customAnimate = "customAnimate";
|
|
10
|
-
}(AnimateStepType = exports.AnimateStepType || (exports.AnimateStepType = {})),
|
|
11
|
-
function(AnimateStatus) {
|
|
12
|
-
AnimateStatus[AnimateStatus.INITIAL = 0] = "INITIAL", AnimateStatus[AnimateStatus.RUNNING = 1] = "RUNNING",
|
|
13
|
-
AnimateStatus[AnimateStatus.PAUSED = 2] = "PAUSED", AnimateStatus[AnimateStatus.END = 3] = "END";
|
|
14
|
-
}(AnimateStatus = exports.AnimateStatus || (exports.AnimateStatus = {}));
|
|
15
|
-
//# sourceMappingURL=type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/type.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,4BAAS,CAAA;IACT,kDAA+B,CAAA;AACjC,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,uDAAW,CAAA;IACX,qDAAU,CAAA;IACV,+CAAO,CAAA;AACT,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB","file":"type.js","sourcesContent":["export enum AnimateStepType {\n wait = 'wait',\n from = 'from',\n to = 'to',\n customAnimate = 'customAnimate'\n}\n\nexport enum AnimateStatus {\n INITIAL = 0,\n RUNNING = 1,\n PAUSED = 2,\n END = 3\n}\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var __rest = this && this.__rest || function(s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
4
|
-
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
5
|
-
var i = 0;
|
|
6
|
-
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
import { AComponentAnimate } from "./custom-animate";
|
|
12
|
-
|
|
13
|
-
import { createComponentAnimator } from "../component";
|
|
14
|
-
|
|
15
|
-
export class LabelUpdate extends AComponentAnimate {
|
|
16
|
-
onBind() {
|
|
17
|
-
const animator = createComponentAnimator(this.target);
|
|
18
|
-
this._animator = animator;
|
|
19
|
-
const duration = this.duration, easing = this.easing, {prevText: prevText, curText: curText, prevLabelLine: prevLabelLine, curLabelLine: curLabelLine} = this.params, diff = {};
|
|
20
|
-
for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
|
|
21
|
-
const {text: text} = diff, rest = __rest(diff, [ "text" ]);
|
|
22
|
-
animator.animate(prevText, {
|
|
23
|
-
type: "to",
|
|
24
|
-
to: rest,
|
|
25
|
-
duration: duration,
|
|
26
|
-
easing: easing
|
|
27
|
-
}), animator.animate(prevText, {
|
|
28
|
-
type: "increaseCount",
|
|
29
|
-
to: {
|
|
30
|
-
text: curText.attribute.text
|
|
31
|
-
},
|
|
32
|
-
duration: duration,
|
|
33
|
-
easing: easing
|
|
34
|
-
}), prevLabelLine && animator.animate(prevLabelLine, {
|
|
35
|
-
type: "to",
|
|
36
|
-
to: curLabelLine.attribute,
|
|
37
|
-
duration: duration,
|
|
38
|
-
easing: easing
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=label-animate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/label-animate.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAKvD,MAAM,OAAO,WAAY,SAAQ,iBAAsB;IACrD,MAAM;QACJ,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QACvE,MAAM,IAAI,GAAwB,EAAE,CAAC;QAErC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,EAAE;YACnC,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;gBACtD,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;aACpC;SACF;QAED,MAAM,EAAE,IAAI,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAAxB,QAAiB,CAAO,CAAC;QAE/B,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,IAAI,EAAE,IAAI;YACV,EAAE,EAAE,IAAI;YACR,QAAQ;YACR,MAAM;SACP,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE;gBACF,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI;aAC7B;YACD,QAAQ;YACR,MAAM;SACP,CAAC,CAAC;QAEH,IAAI,aAAa,EAAE;YACjB,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE;gBAC9B,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,YAAY,CAAC,SAAS;gBAC1B,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;SACJ;IACH,CAAC;CACF","file":"label-animate.js","sourcesContent":["import { AComponentAnimate } from './custom-animate';\nimport { createComponentAnimator } from '../component';\n\n/**\n * LabelUpdate class handles the update animation for Label components\n */\nexport class LabelUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { prevText, curText, prevLabelLine, curLabelLine } = this.params;\n const diff: Record<string, any> = {};\n\n for (const key in curText.attribute) {\n if (prevText.attribute[key] !== curText.attribute[key]) {\n diff[key] = curText.attribute[key];\n }\n }\n\n const { text, ...rest } = diff;\n\n animator.animate(prevText, {\n type: 'to',\n to: rest,\n duration,\n easing\n });\n\n animator.animate(prevText, {\n type: 'increaseCount',\n to: {\n text: curText.attribute.text\n },\n duration,\n easing\n });\n\n if (prevLabelLine) {\n animator.animate(prevLabelLine, {\n type: 'to',\n to: curLabelLine.attribute,\n duration,\n easing\n });\n }\n }\n}\n"]}
|
|
@@ -1,92 +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
|
-
stop: () => void;
|
|
39
|
-
}
|
|
40
|
-
export interface IAnimate {
|
|
41
|
-
readonly id: string | number;
|
|
42
|
-
status: AnimateStatus;
|
|
43
|
-
target: IGraphic;
|
|
44
|
-
priority: number;
|
|
45
|
-
interpolateUpdateFunction: ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void) | null;
|
|
46
|
-
_onStart?: (() => void)[];
|
|
47
|
-
_onFrame?: ((step: IStep, ratio: number) => void)[];
|
|
48
|
-
_onEnd?: (() => void)[];
|
|
49
|
-
_onRemove?: (() => void)[];
|
|
50
|
-
getStartProps: () => Record<string, any>;
|
|
51
|
-
getEndProps: () => Record<string, any>;
|
|
52
|
-
setTimeline: (timeline: ITimeline) => void;
|
|
53
|
-
getTimeline: () => ITimeline;
|
|
54
|
-
readonly timeline: ITimeline;
|
|
55
|
-
bind: (target: IGraphic) => this;
|
|
56
|
-
to: (props: Record<string, any>, duration: number, easing: EasingType) => this;
|
|
57
|
-
from: (props: Record<string, any>, duration: number, easing: EasingType) => this;
|
|
58
|
-
pause: () => void;
|
|
59
|
-
resume: () => void;
|
|
60
|
-
onStart: (cb?: () => void) => void;
|
|
61
|
-
onEnd: (cb?: () => void) => void;
|
|
62
|
-
onFrame: (cb: (step: IStep, ratio: number) => void) => void;
|
|
63
|
-
onRemove: (cb?: () => void) => void;
|
|
64
|
-
preventAttr: (key: string) => void;
|
|
65
|
-
preventAttrs: (key: string[]) => void;
|
|
66
|
-
validAttr: (key: string) => boolean;
|
|
67
|
-
runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;
|
|
68
|
-
customInterpolate: (key: string, ratio: number, from: any, to: any, target: IGraphic, ret: Record<string, any>) => boolean;
|
|
69
|
-
play: (customAnimate: ICustomAnimate) => this;
|
|
70
|
-
getFromValue: () => Record<string, any>;
|
|
71
|
-
getToValue: () => Record<string, any>;
|
|
72
|
-
stop: (type?: 'start' | 'end' | Record<string, any>) => void;
|
|
73
|
-
release: () => void;
|
|
74
|
-
getDuration: () => number;
|
|
75
|
-
getTotalDuration: () => number;
|
|
76
|
-
getStartTime: () => number;
|
|
77
|
-
wait: (delay: number) => this;
|
|
78
|
-
afterAll: (list: IAnimate[]) => this;
|
|
79
|
-
after: (animate: IAnimate) => this;
|
|
80
|
-
parallel: (animate: IAnimate) => this;
|
|
81
|
-
getLoop: () => number;
|
|
82
|
-
loop: (n: number | boolean) => IAnimate;
|
|
83
|
-
bounce: (b: boolean) => IAnimate;
|
|
84
|
-
advance: (delta: number) => void;
|
|
85
|
-
startAt: (t: number) => IAnimate;
|
|
86
|
-
reSyncProps: () => void;
|
|
87
|
-
updateDuration: () => void;
|
|
88
|
-
}
|
|
89
|
-
export declare enum AnimateMode {
|
|
90
|
-
NORMAL = 0,
|
|
91
|
-
SET_ATTR_IMMEDIATELY = 1
|
|
92
|
-
}
|
package/es/intreface/animate.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/animate.ts"],"names":[],"mappings":"AAsKA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,KAAX,WAAW,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 // 停止\n stop: () => 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"]}
|
package/es/intreface/easing.d.ts
DELETED
|
@@ -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/es/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/es/intreface/ticker.d.ts
DELETED
|
@@ -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/es/intreface/ticker.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/ticker.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,yCAAW,CAAA;IACX,yCAAW,CAAA;IACX,qCAAS,CAAA;AACX,CAAC,EAJW,MAAM,KAAN,MAAM,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"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IAnimate } from './animate';
|
|
2
|
-
export interface ITimeline {
|
|
3
|
-
id: number;
|
|
4
|
-
isGlobal?: boolean;
|
|
5
|
-
animateCount: number;
|
|
6
|
-
addAnimate: (animate: IAnimate) => void;
|
|
7
|
-
removeAnimate: (animate: IAnimate, release?: boolean) => void;
|
|
8
|
-
tick: (delta: number) => void;
|
|
9
|
-
clear: () => void;
|
|
10
|
-
pause: () => void;
|
|
11
|
-
resume: () => void;
|
|
12
|
-
getTotalDuration: () => number;
|
|
13
|
-
getPlaySpeed: () => number;
|
|
14
|
-
setPlaySpeed: (speed: number) => void;
|
|
15
|
-
getPlayState: () => 'playing' | 'paused' | 'stopped';
|
|
16
|
-
isRunning: () => boolean;
|
|
17
|
-
}
|
package/es/intreface/timeline.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/timeline.ts"],"names":[],"mappings":"","file":"timeline.js","sourcesContent":["import type { IAnimate } from './animate';\n\nexport interface ITimeline {\n id: number;\n isGlobal?: boolean;\n // 包含的动画数量(animate数组的数量),包含所有动画\n animateCount: number;\n // 添加动画\n addAnimate: (animate: IAnimate) => void;\n // 移除动画\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n // 更新动画\n tick: (delta: number) => void;\n // 清除动画\n clear: () => void;\n // 暂停动画\n pause: () => void;\n // 恢复动画\n resume: () => void;\n // 获取动画总时长\n getTotalDuration: () => number;\n // 获取动画的播放速度\n getPlaySpeed: () => number;\n // 设置动画的播放速度\n setPlaySpeed: (speed: number) => void;\n // 获取动画的播放状态\n getPlayState: () => 'playing' | 'paused' | 'stopped';\n // 获取动画是否正在运行\n isRunning: () => boolean;\n}\n"]}
|
package/es/intreface/type.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare enum AnimateStepType {
|
|
2
|
-
wait = "wait",
|
|
3
|
-
from = "from",
|
|
4
|
-
to = "to",
|
|
5
|
-
customAnimate = "customAnimate"
|
|
6
|
-
}
|
|
7
|
-
export declare enum AnimateStatus {
|
|
8
|
-
INITIAL = 0,
|
|
9
|
-
RUNNING = 1,
|
|
10
|
-
PAUSED = 2,
|
|
11
|
-
END = 3
|
|
12
|
-
}
|
|
13
|
-
export type IAnimateStepType = keyof typeof AnimateStepType;
|
package/es/intreface/type.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export var AnimateStepType;
|
|
2
|
-
|
|
3
|
-
!function(AnimateStepType) {
|
|
4
|
-
AnimateStepType.wait = "wait", AnimateStepType.from = "from", AnimateStepType.to = "to",
|
|
5
|
-
AnimateStepType.customAnimate = "customAnimate";
|
|
6
|
-
}(AnimateStepType || (AnimateStepType = {}));
|
|
7
|
-
|
|
8
|
-
export var AnimateStatus;
|
|
9
|
-
|
|
10
|
-
!function(AnimateStatus) {
|
|
11
|
-
AnimateStatus[AnimateStatus.INITIAL = 0] = "INITIAL", AnimateStatus[AnimateStatus.RUNNING = 1] = "RUNNING",
|
|
12
|
-
AnimateStatus[AnimateStatus.PAUSED = 2] = "PAUSED", AnimateStatus[AnimateStatus.END = 3] = "END";
|
|
13
|
-
}(AnimateStatus || (AnimateStatus = {}));
|
|
14
|
-
//# sourceMappingURL=type.js.map
|
package/es/intreface/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intreface/type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,4BAAS,CAAA;IACT,kDAA+B,CAAA;AACjC,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,uDAAW,CAAA;IACX,qDAAU,CAAA;IACV,+CAAO,CAAA;AACT,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB","file":"type.js","sourcesContent":["export enum AnimateStepType {\n wait = 'wait',\n from = 'from',\n to = 'to',\n customAnimate = 'customAnimate'\n}\n\nexport enum AnimateStatus {\n INITIAL = 0,\n RUNNING = 1,\n PAUSED = 2,\n END = 3\n}\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n"]}
|