@douyinfe/semi-animation-react 2.38.3-alpha.3-patch-fix-2932 → 2.38.4-alpha.1
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 +2 -5
- package/lib/cjs/src/KeyFrames.d.ts +1 -1
- package/lib/cjs/src/KeyFrames.js +3 -5
- package/lib/cjs/src/StyledAnimation.js +2 -8
- package/lib/cjs/src/StyledTransition.d.ts +1 -1
- package/lib/cjs/src/StyledTransition.js +3 -5
- package/lib/cjs/src/Transition.d.ts +1 -1
- package/lib/cjs/src/Transition.js +3 -6
- package/lib/cjs/src/utils/noop.js +0 -1
- package/lib/cjs/src/utils/string.js +0 -3
- package/lib/es/src/Animation.js +1 -4
- package/lib/es/src/KeyFrames.d.ts +1 -1
- package/lib/es/src/KeyFrames.js +0 -1
- package/lib/es/src/StyledAnimation.js +1 -6
- package/lib/es/src/StyledTransition.d.ts +1 -1
- package/lib/es/src/StyledTransition.js +0 -1
- package/lib/es/src/Transition.d.ts +1 -1
- package/lib/es/src/Transition.js +0 -2
- package/lib/es/src/utils/noop.js +0 -1
- package/lib/es/src/utils/string.js +0 -3
- package/package.json +4 -5
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(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/cjs/src/Animation.js
CHANGED
|
@@ -8,18 +8,15 @@ 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(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
13
|
-
/* eslint-disable react/destructuring-assignment */
|
|
14
13
|
|
|
15
14
|
class Animation extends _react.PureComponent {
|
|
16
15
|
constructor() {
|
|
17
16
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
17
|
super(props);
|
|
19
18
|
this.initAnimation = props => {
|
|
20
|
-
// eslint-disable-next-line eqeqeq
|
|
21
19
|
props = props == null ? this.props : props;
|
|
22
|
-
// eslint-disable-next-line prefer-const
|
|
23
20
|
let {
|
|
24
21
|
from,
|
|
25
22
|
to,
|
|
@@ -149,7 +146,7 @@ class Animation extends _react.PureComponent {
|
|
|
149
146
|
} = this.props;
|
|
150
147
|
if (typeof children === 'function') {
|
|
151
148
|
return children(this.animation.getCurrentStates());
|
|
152
|
-
} else if (
|
|
149
|
+
} else if (/*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
153
150
|
return children;
|
|
154
151
|
} else {
|
|
155
152
|
return null;
|
package/lib/cjs/src/KeyFrames.js
CHANGED
|
@@ -8,11 +8,9 @@ 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(
|
|
14
|
-
/* eslint-disable react/destructuring-assignment */
|
|
15
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
16
14
|
class KeyFrames extends _react.Component {
|
|
17
15
|
constructor() {
|
|
18
16
|
var _this;
|
|
@@ -10,13 +10,7 @@ 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(
|
|
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
|
-
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
14
|
const types = Object.values(_semiAnimationStyled.types).reduce((arr, cur) => [...arr, ...cur], []);
|
|
21
15
|
class StyledAnimation extends _react.PureComponent {
|
|
22
16
|
constructor() {
|
|
@@ -97,7 +91,7 @@ class StyledAnimation extends _react.PureComponent {
|
|
|
97
91
|
animationDirection: reverse ? 'alternate' : 'normal',
|
|
98
92
|
animationFillMode: fillMode
|
|
99
93
|
};
|
|
100
|
-
if (
|
|
94
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
101
95
|
children = _react.Children.map(children, child => {
|
|
102
96
|
const animateEvents = this._generateAnimateEvents(child, this.props);
|
|
103
97
|
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(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
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,8 +19,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
/* eslint-disable eqeqeq */
|
|
23
|
-
|
|
24
22
|
class StyledTransition extends _react.Component {
|
|
25
23
|
constructor() {
|
|
26
24
|
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(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
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; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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,8 +19,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
/* eslint-disable eqeqeq */
|
|
23
|
-
|
|
24
22
|
class Transition extends _react.Component {
|
|
25
23
|
constructor() {
|
|
26
24
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -94,7 +92,6 @@ class Transition extends _react.Component {
|
|
|
94
92
|
} = _a,
|
|
95
93
|
restProps = __rest(_a, ["from", "enter", "leave"]);
|
|
96
94
|
let children;
|
|
97
|
-
// eslint-disable-next-line prefer-const
|
|
98
95
|
let {
|
|
99
96
|
currentChildren,
|
|
100
97
|
lastChildren,
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.lowerCase = lowerCase;
|
|
7
7
|
exports.upperCase = upperCase;
|
|
8
|
-
/* eslint-disable eqeqeq */
|
|
9
8
|
function upperCase(str, pos) {
|
|
10
9
|
if (typeof str === 'string') {
|
|
11
10
|
return str
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
11
|
// @ts-ignore
|
|
14
12
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toUpperCase() : total + cur, '');
|
|
15
13
|
}
|
|
@@ -18,7 +16,6 @@ function upperCase(str, pos) {
|
|
|
18
16
|
function lowerCase(str, pos) {
|
|
19
17
|
if (typeof str === 'string') {
|
|
20
18
|
return str
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22
19
|
// @ts-ignore
|
|
23
20
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toLowerCase() : total + cur, '');
|
|
24
21
|
}
|
package/lib/es/src/Animation.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
-
/* eslint-disable react/destructuring-assignment */
|
|
3
2
|
import { PureComponent, isValidElement } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { Animation as SemiAnimation, events } from '@douyinfe/semi-animation';
|
|
@@ -9,9 +8,7 @@ export default class Animation extends PureComponent {
|
|
|
9
8
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
9
|
super(props);
|
|
11
10
|
this.initAnimation = props => {
|
|
12
|
-
// eslint-disable-next-line eqeqeq
|
|
13
11
|
props = props == null ? this.props : props;
|
|
14
|
-
// eslint-disable-next-line prefer-const
|
|
15
12
|
let {
|
|
16
13
|
from,
|
|
17
14
|
to,
|
|
@@ -141,7 +138,7 @@ export default class Animation extends PureComponent {
|
|
|
141
138
|
} = this.props;
|
|
142
139
|
if (typeof children === 'function') {
|
|
143
140
|
return children(this.animation.getCurrentStates());
|
|
144
|
-
} else if (
|
|
141
|
+
} else if (/*#__PURE__*/isValidElement(children)) {
|
|
145
142
|
return children;
|
|
146
143
|
} else {
|
|
147
144
|
return null;
|
package/lib/es/src/KeyFrames.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
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 */
|
|
6
1
|
import { PureComponent, isValidElement, cloneElement, Children } from 'react';
|
|
7
2
|
import PropTypes from 'prop-types';
|
|
8
3
|
import classnames from 'classnames';
|
|
@@ -89,7 +84,7 @@ export default class StyledAnimation extends PureComponent {
|
|
|
89
84
|
animationDirection: reverse ? 'alternate' : 'normal',
|
|
90
85
|
animationFillMode: fillMode
|
|
91
86
|
};
|
|
92
|
-
if (
|
|
87
|
+
if (/*#__PURE__*/isValidElement(children)) {
|
|
93
88
|
children = Children.map(children, child => {
|
|
94
89
|
const animateEvents = this._generateAnimateEvents(child, this.props);
|
|
95
90
|
return /*#__PURE__*/cloneElement(child, Object.assign({
|
package/lib/es/src/Transition.js
CHANGED
|
@@ -6,7 +6,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
6
6
|
}
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
|
-
/* eslint-disable eqeqeq */
|
|
10
9
|
import Animation from './Animation';
|
|
11
10
|
import PropTypes from 'prop-types';
|
|
12
11
|
import React, { Component, isValidElement } from 'react';
|
|
@@ -84,7 +83,6 @@ export default class Transition extends Component {
|
|
|
84
83
|
} = _a,
|
|
85
84
|
restProps = __rest(_a, ["from", "enter", "leave"]);
|
|
86
85
|
let children;
|
|
87
|
-
// eslint-disable-next-line prefer-const
|
|
88
86
|
let {
|
|
89
87
|
currentChildren,
|
|
90
88
|
lastChildren,
|
package/lib/es/src/utils/noop.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/* eslint-disable eqeqeq */
|
|
2
1
|
export function upperCase(str, pos) {
|
|
3
2
|
if (typeof str === 'string') {
|
|
4
3
|
return str
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
4
|
// @ts-ignore
|
|
7
5
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toUpperCase() : total + cur, '');
|
|
8
6
|
}
|
|
@@ -11,7 +9,6 @@ export function upperCase(str, pos) {
|
|
|
11
9
|
export function lowerCase(str, pos) {
|
|
12
10
|
if (typeof str === 'string') {
|
|
13
11
|
return str
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
12
|
// @ts-ignore
|
|
16
13
|
.split().reduce((total, cur, index) => pos == null || pos === index ? total + cur.toLowerCase() : total + cur, '');
|
|
17
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-animation-react",
|
|
3
|
-
"version": "2.38.
|
|
3
|
+
"version": "2.38.4-alpha.1",
|
|
4
4
|
"description": "motion library for semi-ui-react",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"motion",
|
|
@@ -25,14 +25,13 @@
|
|
|
25
25
|
"prepublishOnly": "npm run build:lib"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@douyinfe/semi-animation": "2.38.
|
|
29
|
-
"@douyinfe/semi-animation-styled": "2.38.
|
|
28
|
+
"@douyinfe/semi-animation": "2.38.4-alpha.1",
|
|
29
|
+
"@douyinfe/semi-animation-styled": "2.38.4-alpha.1",
|
|
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",
|
|
36
35
|
"@vx/gradient": "0.0.199",
|
|
37
36
|
"del": "^6.0.0",
|
|
38
37
|
"flubber": "^0.4.2",
|
|
@@ -43,5 +42,5 @@
|
|
|
43
42
|
"prop-types": "^15.7.2",
|
|
44
43
|
"react-storybook-addon-props-combinations": "^1.1.0"
|
|
45
44
|
},
|
|
46
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "a10113a75a207a0a2d4e4d46797a1093260c9dba"
|
|
47
46
|
}
|