@douyinfe/semi-animation-react 2.38.4-alpha.1 → 2.38.4-alpha.2-3117-3120
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 +1 -1
- package/lib/cjs/src/Animation.js +5 -2
- package/lib/cjs/src/KeyFrames.d.ts +1 -1
- package/lib/cjs/src/KeyFrames.js +5 -3
- package/lib/cjs/src/StyledAnimation.js +8 -2
- package/lib/cjs/src/StyledTransition.d.ts +1 -1
- package/lib/cjs/src/StyledTransition.js +5 -3
- package/lib/cjs/src/Transition.d.ts +1 -1
- package/lib/cjs/src/Transition.js +6 -3
- package/lib/cjs/src/utils/noop.js +1 -0
- package/lib/cjs/src/utils/string.js +3 -0
- package/lib/es/src/Animation.js +4 -1
- package/lib/es/src/KeyFrames.d.ts +1 -1
- package/lib/es/src/KeyFrames.js +1 -0
- package/lib/es/src/StyledAnimation.js +6 -1
- package/lib/es/src/StyledTransition.d.ts +1 -1
- package/lib/es/src/StyledTransition.js +1 -0
- package/lib/es/src/Transition.d.ts +1 -1
- package/lib/es/src/Transition.js +2 -0
- package/lib/es/src/utils/noop.js +1 -0
- package/lib/es/src/utils/string.js +3 -0
- package/package.json +5 -4
package/lib/cjs/index.js
CHANGED
|
@@ -51,4 +51,4 @@ var _Animation = _interopRequireDefault(require("./src/Animation"));
|
|
|
51
51
|
var _KeyFrames = _interopRequireDefault(require("./src/KeyFrames"));
|
|
52
52
|
var _Transition = _interopRequireDefault(require("./src/Transition"));
|
|
53
53
|
var _semiAnimation = require("@douyinfe/semi-animation");
|
|
54
|
-
function _interopRequireDefault(
|
|
54
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/cjs/src/Animation.js
CHANGED
|
@@ -8,15 +8,18 @@ var _react = require("react");
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _semiAnimation = require("@douyinfe/semi-animation");
|
|
10
10
|
var _noop = _interopRequireDefault(require("./utils/noop"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
13
|
+
/* eslint-disable react/destructuring-assignment */
|
|
13
14
|
|
|
14
15
|
class Animation extends _react.PureComponent {
|
|
15
16
|
constructor() {
|
|
16
17
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
18
|
super(props);
|
|
18
19
|
this.initAnimation = props => {
|
|
20
|
+
// eslint-disable-next-line eqeqeq
|
|
19
21
|
props = props == null ? this.props : props;
|
|
22
|
+
// eslint-disable-next-line prefer-const
|
|
20
23
|
let {
|
|
21
24
|
from,
|
|
22
25
|
to,
|
|
@@ -146,7 +149,7 @@ class Animation extends _react.PureComponent {
|
|
|
146
149
|
} = this.props;
|
|
147
150
|
if (typeof children === 'function') {
|
|
148
151
|
return children(this.animation.getCurrentStates());
|
|
149
|
-
} else if (/*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
152
|
+
} else if ( /*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
150
153
|
return children;
|
|
151
154
|
} else {
|
|
152
155
|
return null;
|
package/lib/cjs/src/KeyFrames.js
CHANGED
|
@@ -8,9 +8,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _noop = _interopRequireDefault(require("./utils/noop"));
|
|
10
10
|
var _Animation = _interopRequireDefault(require("./Animation"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
/* eslint-disable react/destructuring-assignment */
|
|
15
|
+
|
|
14
16
|
class KeyFrames extends _react.Component {
|
|
15
17
|
constructor() {
|
|
16
18
|
var _this;
|
|
@@ -10,7 +10,13 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _semiAnimationStyled = require("@douyinfe/semi-animation-styled");
|
|
11
11
|
var _noop = _interopRequireDefault(require("./utils/noop"));
|
|
12
12
|
var _invokeFns = _interopRequireDefault(require("./utils/invokeFns"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
/* eslint-disable react/destructuring-assignment */
|
|
15
|
+
/* eslint-disable prefer-const */
|
|
16
|
+
/* eslint-disable eqeqeq */
|
|
17
|
+
/* eslint-disable import/no-duplicates */
|
|
18
|
+
/* eslint-disable no-duplicate-imports */
|
|
19
|
+
|
|
14
20
|
const types = Object.values(_semiAnimationStyled.types).reduce((arr, cur) => [...arr, ...cur], []);
|
|
15
21
|
class StyledAnimation extends _react.PureComponent {
|
|
16
22
|
constructor() {
|
|
@@ -91,7 +97,7 @@ class StyledAnimation extends _react.PureComponent {
|
|
|
91
97
|
animationDirection: reverse ? 'alternate' : 'normal',
|
|
92
98
|
animationFillMode: fillMode
|
|
93
99
|
};
|
|
94
|
-
if (/*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
100
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
95
101
|
children = _react.Children.map(children, child => {
|
|
96
102
|
const animateEvents = this._generateAnimateEvents(child, this.props);
|
|
97
103
|
return /*#__PURE__*/(0, _react.cloneElement)(child, Object.assign({
|
|
@@ -8,9 +8,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _StyledAnimation = _interopRequireDefault(require("./StyledAnimation"));
|
|
10
10
|
var _noop = _interopRequireDefault(require("./utils/noop"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
14
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
15
15
|
var t = {};
|
|
16
16
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -19,6 +19,8 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
+
/* eslint-disable eqeqeq */
|
|
23
|
+
|
|
22
24
|
class StyledTransition extends _react.Component {
|
|
23
25
|
constructor() {
|
|
24
26
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -8,9 +8,9 @@ var _Animation = _interopRequireDefault(require("./Animation"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _noop = _interopRequireDefault(require("./utils/noop"));
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
function _interopRequireDefault(
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
15
15
|
var t = {};
|
|
16
16
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -19,6 +19,8 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
+
/* eslint-disable eqeqeq */
|
|
23
|
+
|
|
22
24
|
class Transition extends _react.Component {
|
|
23
25
|
constructor() {
|
|
24
26
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -92,6 +94,7 @@ class Transition extends _react.Component {
|
|
|
92
94
|
} = _a,
|
|
93
95
|
restProps = __rest(_a, ["from", "enter", "leave"]);
|
|
94
96
|
let children;
|
|
97
|
+
// eslint-disable-next-line prefer-const
|
|
95
98
|
let {
|
|
96
99
|
currentChildren,
|
|
97
100
|
lastChildren,
|
|
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.lowerCase = lowerCase;
|
|
7
7
|
exports.upperCase = upperCase;
|
|
8
|
+
/* eslint-disable eqeqeq */
|
|
8
9
|
function upperCase(str, pos) {
|
|
9
10
|
if (typeof str === 'string') {
|
|
10
11
|
return str
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
11
13
|
// @ts-ignore
|
|
12
14
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toUpperCase() : total + cur, '');
|
|
13
15
|
}
|
|
@@ -16,6 +18,7 @@ function upperCase(str, pos) {
|
|
|
16
18
|
function lowerCase(str, pos) {
|
|
17
19
|
if (typeof str === 'string') {
|
|
18
20
|
return str
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
22
|
// @ts-ignore
|
|
20
23
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toLowerCase() : total + cur, '');
|
|
21
24
|
}
|
package/lib/es/src/Animation.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
+
/* eslint-disable react/destructuring-assignment */
|
|
2
3
|
import { PureComponent, isValidElement } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { Animation as SemiAnimation, events } from '@douyinfe/semi-animation';
|
|
@@ -8,7 +9,9 @@ export default class Animation extends PureComponent {
|
|
|
8
9
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
10
|
super(props);
|
|
10
11
|
this.initAnimation = props => {
|
|
12
|
+
// eslint-disable-next-line eqeqeq
|
|
11
13
|
props = props == null ? this.props : props;
|
|
14
|
+
// eslint-disable-next-line prefer-const
|
|
12
15
|
let {
|
|
13
16
|
from,
|
|
14
17
|
to,
|
|
@@ -138,7 +141,7 @@ export default class Animation extends PureComponent {
|
|
|
138
141
|
} = this.props;
|
|
139
142
|
if (typeof children === 'function') {
|
|
140
143
|
return children(this.animation.getCurrentStates());
|
|
141
|
-
} else if (/*#__PURE__*/isValidElement(children)) {
|
|
144
|
+
} else if ( /*#__PURE__*/isValidElement(children)) {
|
|
142
145
|
return children;
|
|
143
146
|
} else {
|
|
144
147
|
return null;
|
package/lib/es/src/KeyFrames.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/* eslint-disable react/destructuring-assignment */
|
|
2
|
+
/* eslint-disable prefer-const */
|
|
3
|
+
/* eslint-disable eqeqeq */
|
|
4
|
+
/* eslint-disable import/no-duplicates */
|
|
5
|
+
/* eslint-disable no-duplicate-imports */
|
|
1
6
|
import { PureComponent, isValidElement, cloneElement, Children } from 'react';
|
|
2
7
|
import PropTypes from 'prop-types';
|
|
3
8
|
import classnames from 'classnames';
|
|
@@ -84,7 +89,7 @@ export default class StyledAnimation extends PureComponent {
|
|
|
84
89
|
animationDirection: reverse ? 'alternate' : 'normal',
|
|
85
90
|
animationFillMode: fillMode
|
|
86
91
|
};
|
|
87
|
-
if (/*#__PURE__*/isValidElement(children)) {
|
|
92
|
+
if ( /*#__PURE__*/isValidElement(children)) {
|
|
88
93
|
children = Children.map(children, child => {
|
|
89
94
|
const animateEvents = this._generateAnimateEvents(child, this.props);
|
|
90
95
|
return /*#__PURE__*/cloneElement(child, Object.assign({
|
package/lib/es/src/Transition.js
CHANGED
|
@@ -6,6 +6,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
6
6
|
}
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
|
+
/* eslint-disable eqeqeq */
|
|
9
10
|
import Animation from './Animation';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import React, { Component, isValidElement } from 'react';
|
|
@@ -83,6 +84,7 @@ export default class Transition extends Component {
|
|
|
83
84
|
} = _a,
|
|
84
85
|
restProps = __rest(_a, ["from", "enter", "leave"]);
|
|
85
86
|
let children;
|
|
87
|
+
// eslint-disable-next-line prefer-const
|
|
86
88
|
let {
|
|
87
89
|
currentChildren,
|
|
88
90
|
lastChildren,
|
package/lib/es/src/utils/noop.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/* eslint-disable eqeqeq */
|
|
1
2
|
export function upperCase(str, pos) {
|
|
2
3
|
if (typeof str === 'string') {
|
|
3
4
|
return str
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
6
|
// @ts-ignore
|
|
5
7
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toUpperCase() : total + cur, '');
|
|
6
8
|
}
|
|
@@ -9,6 +11,7 @@ export function upperCase(str, pos) {
|
|
|
9
11
|
export function lowerCase(str, pos) {
|
|
10
12
|
if (typeof str === 'string') {
|
|
11
13
|
return str
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
12
15
|
// @ts-ignore
|
|
13
16
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toLowerCase() : total + cur, '');
|
|
14
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-animation-react",
|
|
3
|
-
"version": "2.38.4-alpha.
|
|
3
|
+
"version": "2.38.4-alpha.2-3117-3120",
|
|
4
4
|
"description": "motion library for semi-ui-react",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"motion",
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
"prepublishOnly": "npm run build:lib"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@douyinfe/semi-animation": "2.38.4-alpha.
|
|
29
|
-
"@douyinfe/semi-animation-styled": "2.38.4-alpha.
|
|
28
|
+
"@douyinfe/semi-animation": "2.38.4-alpha.2-3117-3120",
|
|
29
|
+
"@douyinfe/semi-animation-styled": "2.38.4-alpha.2-3117-3120",
|
|
30
30
|
"classnames": "^2.2.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/preset-env": "^7.15.8",
|
|
34
34
|
"@babel/preset-react": "^7.14.5",
|
|
35
|
+
"@storybook/addon-knobs": "^6.3.1",
|
|
35
36
|
"@vx/gradient": "0.0.199",
|
|
36
37
|
"del": "^6.0.0",
|
|
37
38
|
"flubber": "^0.4.2",
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"prop-types": "^15.7.2",
|
|
43
44
|
"react-storybook-addon-props-combinations": "^1.1.0"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "03169476856f6bcec10f193fe109231d186afcaa"
|
|
46
47
|
}
|