@douyinfe/semi-animation 2.61.0 → 2.62.0-beta.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/index.js +3 -3
- package/lib/cjs/src/Animation.js +1 -1
- package/lib/cjs/src/constants.js +1 -2
- package/lib/cjs/src/getEasing.js +2 -6
- package/lib/cjs/src/presets.js +2 -3
- package/lib/cjs/src/shouldStopAnimation.js +1 -1
- package/lib/cjs/src/utils/log.js +1 -2
- package/lib/cjs/src/wrapValue.js +1 -1
- package/lib/es/src/getEasing.js +0 -3
- package/package.json +2 -2
package/lib/cjs/index.js
CHANGED
|
@@ -44,6 +44,6 @@ var _constants = require("./src/constants");
|
|
|
44
44
|
var _Animation = _interopRequireDefault(require("./src/Animation"));
|
|
45
45
|
var _interpolate = _interopRequireDefault(require("./src/interpolate"));
|
|
46
46
|
var _presets = _interopRequireDefault(require("./src/presets"));
|
|
47
|
-
function _interopRequireDefault(
|
|
48
|
-
function _getRequireWildcardCache(
|
|
49
|
-
function _interopRequireWildcard(
|
|
47
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
48
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
49
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
package/lib/cjs/src/Animation.js
CHANGED
|
@@ -11,7 +11,7 @@ var _stripStyle = _interopRequireDefault(require("./stripStyle"));
|
|
|
11
11
|
var _stepper = _interopRequireDefault(require("./stepper"));
|
|
12
12
|
var _mapToZero = _interopRequireDefault(require("./mapToZero"));
|
|
13
13
|
var _wrapValue = _interopRequireDefault(require("./wrapValue"));
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const now = () => Date.now();
|
|
16
16
|
const msPerFrame = 1000 / 60;
|
|
17
17
|
/**
|
package/lib/cjs/src/constants.js
CHANGED
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.events = void 0;
|
|
7
|
-
const events = ['start', 'frame', 'pause', 'resume', 'stop', 'rest'];
|
|
8
|
-
exports.events = events;
|
|
7
|
+
const events = exports.events = ['start', 'frame', 'pause', 'resume', 'stop', 'rest'];
|
package/lib/cjs/src/getEasing.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = getEasing;
|
|
7
7
|
exports.easingMap = void 0;
|
|
8
8
|
var _bezierEasing = _interopRequireDefault(require("bezier-easing"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function minMax(val, min, max) {
|
|
11
11
|
return Math.min(Math.max(val, min), max);
|
|
12
12
|
}
|
|
@@ -23,17 +23,14 @@ function elastic() {
|
|
|
23
23
|
return t => t === 0 || t === 1 ? t : -a * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1 - p / (Math.PI * 2) * Math.asin(1 / a)) * (Math.PI * 2) / p);
|
|
24
24
|
}
|
|
25
25
|
// anime.js/src/index.js
|
|
26
|
-
const easingMap = (() => {
|
|
26
|
+
const easingMap = exports.easingMap = (() => {
|
|
27
27
|
const names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic'];
|
|
28
28
|
// Approximated Penner equations http://matthewlein.com/ceaser/
|
|
29
29
|
const curves = {
|
|
30
30
|
In: [[0.55, 0.085, 0.68, 0.53] /* inQuad */, [0.55, 0.055, 0.675, 0.19] /* inCubic */, [0.895, 0.03, 0.685, 0.22] /* inQuart */, [0.755, 0.05, 0.855, 0.06] /* inQuint */, [0.47, 0.0, 0.745, 0.715] /* inSine */, [0.95, 0.05, 0.795, 0.035] /* inExpo */, [0.6, 0.04, 0.98, 0.335] /* inCirc */, [0.6, -0.28, 0.735, 0.045] /* inBack */, elastic /* inElastic */],
|
|
31
|
-
|
|
32
31
|
Out: [[0.25, 0.46, 0.45, 0.94] /* outQuad */, [0.215, 0.61, 0.355, 1.0] /* outCubic */, [0.165, 0.84, 0.44, 1.0] /* outQuart */, [0.23, 1.0, 0.32, 1.0] /* outQuint */, [0.39, 0.575, 0.565, 1.0] /* outSine */, [0.19, 1.0, 0.22, 1.0] /* outExpo */, [0.075, 0.82, 0.165, 1.0] /* outCirc */, [0.175, 0.885, 0.32, 1.275] /* outBack */, (a, p) => t => 1 - elastic(a, p)(1 - t) /* outElastic */],
|
|
33
|
-
|
|
34
32
|
InOut: [[0.455, 0.03, 0.515, 0.955] /* inOutQuad */, [0.645, 0.045, 0.355, 1.0] /* inOutCubic */, [0.77, 0.0, 0.175, 1.0] /* inOutQuart */, [0.86, 0.0, 0.07, 1.0] /* inOutQuint */, [0.445, 0.05, 0.55, 0.95] /* inOutSine */, [1.0, 0.0, 0.0, 1.0] /* inOutExpo */, [0.785, 0.135, 0.15, 0.86] /* inOutCirc */, [0.68, -0.55, 0.265, 1.55] /* inOutBack */, (a, p) => t => t < 0.5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2 /* inOutElastic */]
|
|
35
33
|
};
|
|
36
|
-
|
|
37
34
|
const eases = {
|
|
38
35
|
linear: [0.25, 0.25, 0.75, 0.75]
|
|
39
36
|
};
|
|
@@ -49,7 +46,6 @@ const easingMap = (() => {
|
|
|
49
46
|
* @param {string|Function} easing
|
|
50
47
|
* @returns {Function}
|
|
51
48
|
*/
|
|
52
|
-
exports.easingMap = easingMap;
|
|
53
49
|
function getEasing(easing) {
|
|
54
50
|
if (typeof easing === 'function') {
|
|
55
51
|
return easing;
|
package/lib/cjs/src/presets.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
* stiffness is like tension
|
|
9
9
|
* damping is like friction
|
|
10
10
|
*/
|
|
11
|
-
var _default = {
|
|
11
|
+
var _default = exports.default = {
|
|
12
12
|
default: {
|
|
13
13
|
tension: 170,
|
|
14
14
|
friction: 26
|
|
@@ -33,5 +33,4 @@ var _default = {
|
|
|
33
33
|
tension: 280,
|
|
34
34
|
friction: 120
|
|
35
35
|
}
|
|
36
|
-
};
|
|
37
|
-
exports.default = _default;
|
|
36
|
+
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = shouldStopAnimation;
|
|
7
7
|
var _shouldUseBezier = _interopRequireDefault(require("./shouldUseBezier"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
/**
|
|
10
10
|
* usage assumption: currentStyle values have already been rendered but it says
|
|
11
11
|
* nothing of whether currentStyle is stale (see unreadPropStyle)
|
package/lib/cjs/src/utils/log.js
CHANGED
package/lib/cjs/src/wrapValue.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = wrapValue;
|
|
|
7
7
|
var _getEasing = _interopRequireDefault(require("./getEasing"));
|
|
8
8
|
var _presets = _interopRequireDefault(require("./presets"));
|
|
9
9
|
var _shouldUseBezier = _interopRequireDefault(require("./shouldUseBezier"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const defaultConfig = Object.assign(Object.assign({}, _presets.default.default), {
|
|
12
12
|
precision: 0.01
|
|
13
13
|
});
|
package/lib/es/src/getEasing.js
CHANGED
|
@@ -20,12 +20,9 @@ export const easingMap = (() => {
|
|
|
20
20
|
// Approximated Penner equations http://matthewlein.com/ceaser/
|
|
21
21
|
const curves = {
|
|
22
22
|
In: [[0.55, 0.085, 0.68, 0.53] /* inQuad */, [0.55, 0.055, 0.675, 0.19] /* inCubic */, [0.895, 0.03, 0.685, 0.22] /* inQuart */, [0.755, 0.05, 0.855, 0.06] /* inQuint */, [0.47, 0.0, 0.745, 0.715] /* inSine */, [0.95, 0.05, 0.795, 0.035] /* inExpo */, [0.6, 0.04, 0.98, 0.335] /* inCirc */, [0.6, -0.28, 0.735, 0.045] /* inBack */, elastic /* inElastic */],
|
|
23
|
-
|
|
24
23
|
Out: [[0.25, 0.46, 0.45, 0.94] /* outQuad */, [0.215, 0.61, 0.355, 1.0] /* outCubic */, [0.165, 0.84, 0.44, 1.0] /* outQuart */, [0.23, 1.0, 0.32, 1.0] /* outQuint */, [0.39, 0.575, 0.565, 1.0] /* outSine */, [0.19, 1.0, 0.22, 1.0] /* outExpo */, [0.075, 0.82, 0.165, 1.0] /* outCirc */, [0.175, 0.885, 0.32, 1.275] /* outBack */, (a, p) => t => 1 - elastic(a, p)(1 - t) /* outElastic */],
|
|
25
|
-
|
|
26
24
|
InOut: [[0.455, 0.03, 0.515, 0.955] /* inOutQuad */, [0.645, 0.045, 0.355, 1.0] /* inOutCubic */, [0.77, 0.0, 0.175, 1.0] /* inOutQuart */, [0.86, 0.0, 0.07, 1.0] /* inOutQuint */, [0.445, 0.05, 0.55, 0.95] /* inOutSine */, [1.0, 0.0, 0.0, 1.0] /* inOutExpo */, [0.785, 0.135, 0.15, 0.86] /* inOutCirc */, [0.68, -0.55, 0.265, 1.55] /* inOutBack */, (a, p) => t => t < 0.5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2 /* inOutElastic */]
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
const eases = {
|
|
30
27
|
linear: [0.25, 0.25, 0.75, 0.75]
|
|
31
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-animation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.62.0-beta.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": "aa6b83e5efc6705625be251749aa45a182c5eac3"
|
|
46
46
|
}
|