Releases: react-component/tween-one
Releases · react-component/tween-one
3.0.0
3.0.0
预览地址: https://tween-one-git-3x.react-component.vercel.app/
- hooks 重构 rc-tween-one;
- 拆离动画库与组件; 动画库 https://www.npmjs.com/package/tween-one
API 变更
- 删除
currentRef, hooks 如果 component 是组件,ref 返回为组件的 ref; - 增加对 hooks 下的 React.fragment 的支持。
- 增加全局动画播放时的
delay; - 删除
reverseDelay; - 增加
repeatDelay; attr改为boolean类型;- 更新
onChange和回调,cb: { moment, targets, index, mode, ratio, vars, index, repeat } - 新增
onChangeTimeline, cb: { mode, targets, vars, moment, totalTime, repeat } - 其它回调如
onStart、onUpdate、onComplete等的 cb 的 target 全部更新为 targets; - 删除
BezierPlugin,合进 PathMotionPlugin;; PathMotionPlugin更改用法,使用PathMotion: { path, center, x, y, rotate }, 详细参考 pathMotion demo;SvgMorph依赖更改为使用flubber;- 滤境使用,改成
import { Plugins } from 'rc-tween-one'; Plugins.push(), 保留TweenOne.plugins.push(); - 删除
TweenOne.easing.path(path)使用,直接用ease: 'M0,0L100,100'; - 增加动画区域播放
regionStartTime,regionEndTime; - 增加对背景渐变的动画支持,
backgroundImage: 'linear-gradient(to left, #000fff 0%, red 20%, #fff000 100%)'
v3.0.0-beta.x
- update prepublishOnly 6f45c84
- lint fix 6140034
- update ChildrenPlugin constructor d288c9a
- fix willUnmount 243ede2
- fix compile 254e340
- fix lint 517eb45
- update hooks d811c2c
- hooks 重构 rc-tween-one;
- 拆离动画库与组件, 动画库 https://docs.antfin-inc.com/tween-one-js-update_1/
API 变更
- 删除
currentRef, hooks 如果 component 是组件,ref 返回为组件的 ref; - 删除
reverseDelay; - 增加
repeatDelay; attr改为boolean类型;- 更新
onChange回调,cb: { moment, targets, index, mode, ratio, vars, index, repeat } - 新增
onChangeTimeline, cb: { mode, targets, vars, moment, totalTime, repeat } - 删除
BezierPlugin,合进 PathMotionPlugin;; PathMotionPlugin更改用法,使用PathMotion: { path, center, x, y, rotate }, 详细参考 pathMotion demo;SvgMorph依赖更改为使用flubber;- 滤境使用,改成
import { Plugins } from 'rc-tween-one'; Plugins.push(), 保留TweenOne.plugins.push(); - 删除
TweenOne.easing.path(path)使用,直接用ease: 'M0,0L100,100';