Skip to content

Commit fc2ed0c

Browse files
committed
update react 16
1 parent 6037b2f commit fc2ed0c

10 files changed

+49
-34
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ sudo: false
44

55
notifications:
66
email:
7-
- yiminghe@gmail.com
7+
- 155259966@qq.com
88

99
node_js:
10-
- 6.0.0
10+
- 6.9.1
1111

1212
before_install:
1313
- |

index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
// export this package's api
2-
import TweenOne from './src/';
2+
import TweenOne from './src/TweenOne';
3+
import group from './src/TweenOneGroup';
4+
import _easing from './src/easing';
5+
import _plugins from './src/plugins';
6+
import _ticker from './src/ticker';
7+
8+
TweenOne.TweenOneGroup = group;
9+
TweenOne.easing = _easing;
10+
TweenOne.plugins = _plugins;
11+
TweenOne.ticker = _ticker;
12+
313
export default TweenOne;
14+
15+
export const TweenOneGroup = group;
16+
17+
export const easing = _easing;
18+
19+
export const plugins = _plugins;
20+
21+
export const ticker = _ticker;

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-tween-one",
3-
"version": "1.4.5",
3+
"version": "1.5.0",
44
"description": "tween-one anim component for react",
55
"keywords": [
66
"react",
@@ -37,21 +37,23 @@
3737
"build": "rc-tools run build",
3838
"gh-pages": "rc-tools run gh-pages",
3939
"start": "rc-tools run server",
40+
"compile": "rc-tools run compile",
4041
"pub": "rc-tools run pub --babel-runtime",
4142
"lint": "rc-tools run lint",
42-
"karma": "rc-tools run karma",
43-
"saucelabs": "rc-tools run saucelabs",
44-
"test": "rc-tools run test",
45-
"chrome-test": "rc-tools run chrome-test",
46-
"coverage": "rc-tools run coverage"
43+
"karma": "rc-test run karma",
44+
"saucelabs": "rc-test run saucelabs",
45+
"test": "rc-test run test",
46+
"chrome-test": "rc-test run chrome-test",
47+
"coverage": "rc-test run coverage"
4748
},
4849
"devDependencies": {
50+
"core-js": "^2.5.1",
4951
"expect.js": "0.3.x",
5052
"pre-commit": "1.x",
51-
"rc-tools": "5.x",
52-
"react": "^15.5.0",
53-
"react-addons-test-utils": "^15.5.0",
54-
"react-dom": "^15.5.0",
53+
"rc-test": "6.x",
54+
"rc-tools": "6.x",
55+
"react": "^16.0.0",
56+
"react-dom": "^16.0.0",
5557
"rc-queue-anim": "^1.0.0",
5658
"rc-scroll-anim": "0.x"
5759
},

src/TweenOne.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,5 @@ TweenOne.defaultProps = {
292292
onChange: noop,
293293
updateReStart: true,
294294
};
295+
TweenOne.isTweenOne = true;
295296
export default TweenOne;

src/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/plugin/PathPlugin.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import {
44
getTransform,
55
} from 'style-utils';
66

7-
const PathPlugin = function (target, vars) {
7+
function PathPlugin(target, vars) {
88
this.target = target;
99
const path = typeof vars === 'string' ? vars : vars.x || vars.y || vars.rotate;
1010
this.vars = vars;
1111
this.path = parsePath(path);
1212
this.start = {};
1313
this.pathLength = this.path.getTotalLength();
14-
};
14+
}
1515

1616
PathPlugin.prototype = {
1717
name: 'path',

src/plugin/SvgDrawPlugin.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ SvgDrawPlugin.prototype = {
5959
},
6060
getAnimStart(computedStyle) {
6161
switch (this.tagName) {
62-
case 'rect':
63-
this.length = this.target.getAttribute('width') * 2 +
64-
this.target.getAttribute('height') * 2;
65-
break;
6662
case 'circle':
6763
this.length = Math.PI * 2 * this.target.getAttribute('r');
6864
break;
@@ -78,6 +74,7 @@ SvgDrawPlugin.prototype = {
7874
case 'ellipse':
7975
this.length = this.getEllipseLength();
8076
break;
77+
case 'rect':
8178
case 'path':
8279
this.length = this.target.getTotalLength();
8380
break;

tests/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
import 'core-js/es6/map';
2+
import 'core-js/es6/set';
13
const req = require.context('.', false, /\.spec\.jsx?$/);
24
req.keys().forEach(req);

tests/tweenOne.spec.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/* eslint no-console:0 */
22
import React from 'react';
33
import ReactDom from 'react-dom';
4+
import PropTypes from 'prop-types';
45
import expect from 'expect.js';
56
import Tween from '../index';
67
import ticker from '../src/ticker';
7-
import TestUtils from 'react-addons-test-utils';
8+
import TestUtils from 'react-dom/test-utils';
89
import { checkStyleName } from 'style-utils';
910
import BezierPlugin from '../src/plugin/BezierPlugin';
1011
Tween.plugins.push(BezierPlugin);
@@ -33,12 +34,12 @@ describe('rc-tween-one', () => {
3334
</Tween>);
3435
}
3536
}
36-
const objectOrArray = React.PropTypes.oneOfType([React.PropTypes.object,
37-
React.PropTypes.array]);
37+
const objectOrArray = PropTypes.oneOfType([PropTypes.object,
38+
PropTypes.array]);
3839

3940
TweenDemo.propTypes = {
4041
animation: objectOrArray,
41-
style: React.PropTypes.object,
42+
style: PropTypes.object,
4243
};
4344

4445
return ReactDom.render(<TweenDemo {...props} />, div);

tests/tweenOneGroup.spec.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* eslint no-console:0 */
22
import React from 'react';
33
import ReactDom from 'react-dom';
4+
import PropTypes from 'prop-types';
45
import expect from 'expect.js';
56
import { TweenOneGroup } from '../index';
6-
import TestUtils from 'react-addons-test-utils';
7+
import TestUtils from 'react-dom/test-utils';
78

89
describe('rc-tween-one-group', () => {
910
let div;
@@ -42,12 +43,12 @@ describe('rc-tween-one-group', () => {
4243
</TweenOneGroup>);
4344
}
4445
}
45-
const objectOrArray = React.PropTypes.oneOfType([React.PropTypes.object,
46-
React.PropTypes.array]);
46+
const objectOrArray = PropTypes.oneOfType([PropTypes.object,
47+
PropTypes.array]);
4748

4849
TweenGroupDemo.propTypes = {
4950
animation: objectOrArray,
50-
style: React.PropTypes.object,
51+
style: PropTypes.object,
5152
};
5253

5354
return ReactDom.render(<TweenGroupDemo {...props} />, div);

0 commit comments

Comments
 (0)