@douyinfe/semi-animation 2.1.0-alpha.1 → 2.1.0-alpha.2
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/es/src/Animation.js +1 -3
- package/lib/es/src/getEasing.js +1 -3
- package/lib/es/src/interpolate.js +1 -5
- package/lib/es/src/utils/Event.js +4 -11
- package/lib/es/src/utils/debounce.js +2 -7
- package/lib/es/src/utils/log.js +1 -5
- package/lib/es/src/wrapValue.js +1 -3
- package/package.json +3 -3
- package/lib/cjs/index.d.ts +0 -6
- package/lib/cjs/index.js +0 -69
- package/lib/cjs/src/Animation.d.ts +0 -55
- package/lib/cjs/src/Animation.js +0 -323
- package/lib/cjs/src/constants.d.ts +0 -1
- package/lib/cjs/src/constants.js +0 -11
- package/lib/cjs/src/getEasing.d.ts +0 -10
- package/lib/cjs/src/getEasing.js +0 -165
- package/lib/cjs/src/interpolate.d.ts +0 -13
- package/lib/cjs/src/interpolate.js +0 -62
- package/lib/cjs/src/mapToZero.d.ts +0 -1
- package/lib/cjs/src/mapToZero.js +0 -25
- package/lib/cjs/src/presets.d.ts +0 -18
- package/lib/cjs/src/presets.js +0 -41
- package/lib/cjs/src/shouldStopAnimation.d.ts +0 -13
- package/lib/cjs/src/shouldStopAnimation.js +0 -55
- package/lib/cjs/src/shouldUseBezier.d.ts +0 -1
- package/lib/cjs/src/shouldUseBezier.js +0 -13
- package/lib/cjs/src/stepper.d.ts +0 -16
- package/lib/cjs/src/stepper.js +0 -56
- package/lib/cjs/src/stripStyle.d.ts +0 -1
- package/lib/cjs/src/stripStyle.js +0 -24
- package/lib/cjs/src/utils/Event.d.ts +0 -7
- package/lib/cjs/src/utils/Event.js +0 -90
- package/lib/cjs/src/utils/debounce.d.ts +0 -6
- package/lib/cjs/src/utils/debounce.js +0 -33
- package/lib/cjs/src/utils/log.d.ts +0 -2
- package/lib/cjs/src/utils/log.js +0 -22
- package/lib/cjs/src/utils/noop.d.ts +0 -1
- package/lib/cjs/src/utils/noop.js +0 -12
- package/lib/cjs/src/utils/shallowEqual.d.ts +0 -1
- package/lib/cjs/src/utils/shallowEqual.js +0 -36
- package/lib/cjs/src/wrapValue.d.ts +0 -18
- package/lib/cjs/src/wrapValue.js +0 -61
package/lib/cjs/src/utils/log.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
exports.default = void 0;
|
|
10
|
-
|
|
11
|
-
const log = function (text) {
|
|
12
|
-
if (process.env.NODE_ENV === 'development') {
|
|
13
|
-
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
14
|
-
rest[_key - 1] = arguments[_key];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
console.log(text, ...rest);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
var _default = log;
|
|
22
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function noop(): void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
exports.default = noop;
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
12
|
-
function noop() {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function shallowEqual(a: any, b: any): boolean;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
exports.default = shallowEqual;
|
|
10
|
-
|
|
11
|
-
/* eslint-disable no-restricted-syntax */
|
|
12
|
-
function shallowEqual(a, b) {
|
|
13
|
-
if (typeof a !== typeof b) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (typeof a === 'string' || typeof a === 'number') {
|
|
18
|
-
return a === b;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let i;
|
|
22
|
-
|
|
23
|
-
for (i in a) {
|
|
24
|
-
if (!(i in b)) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
for (i in b) {
|
|
30
|
-
if (a[i] !== b[i]) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return i === void 0 ? a === b : true;
|
|
36
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PresetsItem } from './presets';
|
|
2
|
-
export interface Value {
|
|
3
|
-
easing: string;
|
|
4
|
-
duration: number | string;
|
|
5
|
-
}
|
|
6
|
-
export interface DefaultConfig extends PresetsItem {
|
|
7
|
-
precision: number;
|
|
8
|
-
}
|
|
9
|
-
export interface Config {
|
|
10
|
-
easing?: string;
|
|
11
|
-
duration?: number | string;
|
|
12
|
-
delay?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface Wrapped extends DefaultConfig, Config {
|
|
15
|
-
done: boolean;
|
|
16
|
-
val?: Value;
|
|
17
|
-
}
|
|
18
|
-
export default function wrapValue(val: Value, config?: Config): Wrapped;
|
package/lib/cjs/src/wrapValue.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports.default = wrapValue;
|
|
12
|
-
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
|
|
16
|
-
|
|
17
|
-
var _getEasing = _interopRequireDefault(require("./getEasing"));
|
|
18
|
-
|
|
19
|
-
var _presets = _interopRequireDefault(require("./presets"));
|
|
20
|
-
|
|
21
|
-
var _shouldUseBezier = _interopRequireDefault(require("./shouldUseBezier"));
|
|
22
|
-
|
|
23
|
-
const defaultConfig = (0, _assign.default)((0, _assign.default)({}, _presets.default.default), {
|
|
24
|
-
precision: 0.01
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
function wrapValue(val) {
|
|
28
|
-
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
|
-
|
|
30
|
-
if ((0, _shouldUseBezier.default)(config)) {
|
|
31
|
-
const easing = (0, _getEasing.default)(config.easing);
|
|
32
|
-
const duration = typeof config.duration === 'number' && config.duration > 0 ? config.duration : 1000;
|
|
33
|
-
config = (0, _assign.default)((0, _assign.default)({}, config), {
|
|
34
|
-
easing,
|
|
35
|
-
duration
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let wrapped = (0, _assign.default)((0, _assign.default)((0, _assign.default)({}, defaultConfig), config), {
|
|
40
|
-
done: false
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
if (val && typeof val === 'object' && 'val' in val) {
|
|
44
|
-
if ((0, _shouldUseBezier.default)(val)) {
|
|
45
|
-
const easing = (0, _getEasing.default)(val.easing);
|
|
46
|
-
const duration = typeof val.duration === 'number' && val.duration > 0 ? val.duration : (0, _parseInt2.default)(config.duration) || 1000;
|
|
47
|
-
val = (0, _assign.default)((0, _assign.default)({}, val), {
|
|
48
|
-
easing,
|
|
49
|
-
duration
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
wrapped = (0, _assign.default)((0, _assign.default)({}, wrapped), val);
|
|
54
|
-
} else {
|
|
55
|
-
wrapped = (0, _assign.default)((0, _assign.default)({}, wrapped), {
|
|
56
|
-
val
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return wrapped;
|
|
61
|
-
}
|