@douyinfe/semi-animation 2.40.0-alpha.0 → 2.40.0
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/lib/cjs/src/Animation.js +0 -4
- package/lib/cjs/src/getEasing.js +0 -1
- package/lib/cjs/src/interpolate.js +0 -1
- package/lib/cjs/src/shouldStopAnimation.js +1 -1
- package/lib/cjs/src/stepper.js +0 -1
- package/lib/cjs/src/stripStyle.js +0 -1
- package/lib/cjs/src/utils/Event.js +0 -2
- package/lib/cjs/src/utils/noop.js +0 -1
- package/lib/cjs/src/utils/shallowEqual.js +0 -1
- package/lib/es/src/Animation.js +0 -3
- package/lib/es/src/getEasing.js +0 -1
- package/lib/es/src/interpolate.js +0 -1
- package/lib/es/src/shouldStopAnimation.js +0 -1
- package/lib/es/src/stepper.js +0 -1
- package/lib/es/src/stripStyle.js +0 -1
- package/lib/es/src/utils/Event.js +0 -2
- package/lib/es/src/utils/noop.js +0 -1
- package/lib/es/src/utils/shallowEqual.js +0 -1
- package/package.json +2 -2
package/lib/cjs/src/Animation.js
CHANGED
|
@@ -12,10 +12,6 @@ var _stepper = _interopRequireDefault(require("./stepper"));
|
|
|
12
12
|
var _mapToZero = _interopRequireDefault(require("./mapToZero"));
|
|
13
13
|
var _wrapValue = _interopRequireDefault(require("./wrapValue"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
/* eslint-disable max-depth */
|
|
16
|
-
/* eslint-disable eqeqeq */
|
|
17
|
-
/* eslint-disable max-lines-per-function */
|
|
18
|
-
|
|
19
15
|
const now = () => Date.now();
|
|
20
16
|
const msPerFrame = 1000 / 60;
|
|
21
17
|
/**
|
package/lib/cjs/src/getEasing.js
CHANGED
|
@@ -65,7 +65,6 @@ function getEasing(easing) {
|
|
|
65
65
|
if (name === 'cubic-bezier' || name === 'cubicBezier') {
|
|
66
66
|
return (0, _bezierEasing.default)(...(args.length ? args : easingMap.linear));
|
|
67
67
|
} else {
|
|
68
|
-
// eslint-disable-next-line eqeqeq
|
|
69
68
|
if (!name || typeof name !== 'string' || typeof name === 'string' && easingMap[name] == null) {
|
|
70
69
|
name = 'linear';
|
|
71
70
|
}
|
|
@@ -13,7 +13,6 @@ exports.default = interpolate;
|
|
|
13
13
|
* @param {Function} [formatter]
|
|
14
14
|
* @returns {any}
|
|
15
15
|
*/
|
|
16
|
-
// eslint-disable-next-line max-len
|
|
17
16
|
function interpolate(from, to) {
|
|
18
17
|
let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19
18
|
let parser = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
@@ -17,7 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
* @param {number} nowTime
|
|
18
18
|
*
|
|
19
19
|
* @returns {boolean}
|
|
20
|
-
*/
|
|
20
|
+
*/
|
|
21
21
|
function shouldStopAnimation(currentStyle, style, currentVelocity, startTime, nowTime) {
|
|
22
22
|
for (const key of Object.keys(style)) {
|
|
23
23
|
const styleValue = style[key];
|
package/lib/cjs/src/stepper.js
CHANGED
|
@@ -24,7 +24,6 @@ const reusedTuple = [0, 0];
|
|
|
24
24
|
* @param {number} b
|
|
25
25
|
* @param {number} precision
|
|
26
26
|
*/
|
|
27
|
-
// eslint-disable-next-line max-len
|
|
28
27
|
function stepper(secondPerFrame, x, v, destX, k, b, precision) {
|
|
29
28
|
// Spring stiffness, in kg / s^2
|
|
30
29
|
// for animations, destX is really spring length (spring at rest). initial
|
|
@@ -31,12 +31,10 @@ class Event {
|
|
|
31
31
|
const callbacks = this._eventMap.get(event);
|
|
32
32
|
if (Array.isArray(callbacks) && callbacks.length) {
|
|
33
33
|
let index = -1;
|
|
34
|
-
// eslint-disable-next-line max-depth
|
|
35
34
|
while ((index = callbacks.findIndex(cb => cb === callback)) > -1) {
|
|
36
35
|
callbacks.splice(index, 1);
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
// eslint-disable-next-line eqeqeq
|
|
40
38
|
} else if (callback == null) {
|
|
41
39
|
this._eventMap.delete(event);
|
|
42
40
|
}
|
package/lib/es/src/Animation.js
CHANGED
package/lib/es/src/getEasing.js
CHANGED
|
@@ -56,7 +56,6 @@ export default function getEasing(easing) {
|
|
|
56
56
|
if (name === 'cubic-bezier' || name === 'cubicBezier') {
|
|
57
57
|
return bezier(...(args.length ? args : easingMap.linear));
|
|
58
58
|
} else {
|
|
59
|
-
// eslint-disable-next-line eqeqeq
|
|
60
59
|
if (!name || typeof name !== 'string' || typeof name === 'string' && easingMap[name] == null) {
|
|
61
60
|
name = 'linear';
|
|
62
61
|
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* @param {Function} [formatter]
|
|
8
8
|
* @returns {any}
|
|
9
9
|
*/
|
|
10
|
-
// eslint-disable-next-line max-len
|
|
11
10
|
export default function interpolate(from, to) {
|
|
12
11
|
let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
13
12
|
let parser = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
@@ -11,7 +11,6 @@ import shouldUseBezier from './shouldUseBezier';
|
|
|
11
11
|
*
|
|
12
12
|
* @returns {boolean}
|
|
13
13
|
*/
|
|
14
|
-
// eslint-disable-next-line max-len
|
|
15
14
|
export default function shouldStopAnimation(currentStyle, style, currentVelocity, startTime, nowTime) {
|
|
16
15
|
for (const key of Object.keys(style)) {
|
|
17
16
|
const styleValue = style[key];
|
package/lib/es/src/stepper.js
CHANGED
|
@@ -18,7 +18,6 @@ const reusedTuple = [0, 0];
|
|
|
18
18
|
* @param {number} b
|
|
19
19
|
* @param {number} precision
|
|
20
20
|
*/
|
|
21
|
-
// eslint-disable-next-line max-len
|
|
22
21
|
export default function stepper(secondPerFrame, x, v, destX, k, b, precision) {
|
|
23
22
|
// Spring stiffness, in kg / s^2
|
|
24
23
|
// for animations, destX is really spring length (spring at rest). initial
|
package/lib/es/src/stripStyle.js
CHANGED
|
@@ -25,12 +25,10 @@ export default class Event {
|
|
|
25
25
|
const callbacks = this._eventMap.get(event);
|
|
26
26
|
if (Array.isArray(callbacks) && callbacks.length) {
|
|
27
27
|
let index = -1;
|
|
28
|
-
// eslint-disable-next-line max-depth
|
|
29
28
|
while ((index = callbacks.findIndex(cb => cb === callback)) > -1) {
|
|
30
29
|
callbacks.splice(index, 1);
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
// eslint-disable-next-line eqeqeq
|
|
34
32
|
} else if (callback == null) {
|
|
35
33
|
this._eventMap.delete(event);
|
|
36
34
|
}
|
package/lib/es/src/utils/noop.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-animation",
|
|
3
|
-
"version": "2.40.0
|
|
3
|
+
"version": "2.40.0",
|
|
4
4
|
"description": "animation base library for semi-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animation",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"merge2": "^1.4.1",
|
|
43
43
|
"react-storybook-addon-props-combinations": "^1.1.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "d73b400df9309f0c545a82da4534ce5a7a311a92"
|
|
46
46
|
}
|