@douyinfe/semi-animation-react 2.87.0-alpha.8 → 2.87.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.
@@ -12,7 +12,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
12
12
  /* eslint-disable @typescript-eslint/ban-types */
13
13
 
14
14
  class Animation extends _react.PureComponent {
15
- constructor(props = {}) {
15
+ constructor() {
16
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
17
  super(props);
17
18
  this.initAnimation = props => {
18
19
  props = props == null ? this.props : props;
@@ -121,7 +122,8 @@ class Animation extends _react.PureComponent {
121
122
  this.animation = null;
122
123
  }
123
124
  }
124
- componentDidUpdate(prevProps = {}) {
125
+ componentDidUpdate() {
126
+ let prevProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
125
127
  if (this.props.reset) {
126
128
  if (this.props.from !== prevProps.from || this.props.to !== prevProps.to) {
127
129
  this.destroy();
@@ -9,14 +9,19 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _noop = _interopRequireDefault(require("./utils/noop"));
10
10
  var _Animation = _interopRequireDefault(require("./Animation"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
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; }
13
14
  class KeyFrames extends _react.Component {
14
- constructor(props = {}) {
15
+ constructor() {
16
+ var _this;
17
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15
18
  super(props);
16
- this.onFrame = (props = {}) => {
19
+ _this = this;
20
+ this.onFrame = function () {
21
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17
22
  const currentStyle = Object.assign({}, props);
18
- this.props.onFrame(currentStyle);
19
- this.setState({
23
+ _this.props.onFrame(currentStyle);
24
+ _this.setState({
20
25
  currentStyle
21
26
  });
22
27
  };
@@ -13,17 +13,50 @@ var _invokeFns = _interopRequireDefault(require("./utils/invokeFns"));
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  const types = Object.values(_semiAnimationStyled.types).reduce((arr, cur) => [...arr, ...cur], []);
15
15
  class StyledAnimation extends _react.PureComponent {
16
- constructor(props = {}) {
16
+ constructor() {
17
+ var _this;
18
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17
19
  super(props);
18
- this._generateAnimateEvents = (child, props = {}) => ({
19
- onAnimationIteration: (...args) => (0, _invokeFns.default)([child && child.props && child.props.onAnimationIteration, props.onFrame], args),
20
- onAnimationStart: (...args) => (0, _invokeFns.default)([child && child.props && child.props.onAnimationStart, props.onStart], args),
21
- onAnimationEnd: (...args) => (0, _invokeFns.default)([child && child.props && child.props.onAnimationEnd, props.onRest], args)
22
- });
23
- this._hasSpeedClass = (speed = this.props.speed) => speed != null && _semiAnimationStyled.speeds.includes(speed);
24
- this._hasTypeClass = (type = this.props.type) => type != null && types.includes(type);
25
- this._hasDelayClass = (delay = this.props.delay) => delay != null && _semiAnimationStyled.delays.includes(delay);
26
- this._hasLoopClass = (loop = this.props.loop) => loop != null && _semiAnimationStyled.loops.includes(loop);
20
+ _this = this;
21
+ this._generateAnimateEvents = function (child) {
22
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23
+ return {
24
+ onAnimationIteration: function () {
25
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
+ args[_key] = arguments[_key];
27
+ }
28
+ return (0, _invokeFns.default)([child && child.props && child.props.onAnimationIteration, props.onFrame], args);
29
+ },
30
+ onAnimationStart: function () {
31
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
32
+ args[_key2] = arguments[_key2];
33
+ }
34
+ return (0, _invokeFns.default)([child && child.props && child.props.onAnimationStart, props.onStart], args);
35
+ },
36
+ onAnimationEnd: function () {
37
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
38
+ args[_key3] = arguments[_key3];
39
+ }
40
+ return (0, _invokeFns.default)([child && child.props && child.props.onAnimationEnd, props.onRest], args);
41
+ }
42
+ };
43
+ };
44
+ this._hasSpeedClass = function () {
45
+ let speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.speed;
46
+ return speed != null && _semiAnimationStyled.speeds.includes(speed);
47
+ };
48
+ this._hasTypeClass = function () {
49
+ let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.type;
50
+ return type != null && types.includes(type);
51
+ };
52
+ this._hasDelayClass = function () {
53
+ let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.delay;
54
+ return delay != null && _semiAnimationStyled.delays.includes(delay);
55
+ };
56
+ this._hasLoopClass = function () {
57
+ let loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.loop;
58
+ return loop != null && _semiAnimationStyled.loops.includes(loop);
59
+ };
27
60
  }
28
61
  render() {
29
62
  let {
@@ -9,7 +9,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _StyledAnimation = _interopRequireDefault(require("./StyledAnimation"));
10
10
  var _noop = _interopRequireDefault(require("./utils/noop"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
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; }
13
14
  var __rest = void 0 && (void 0).__rest || function (s, e) {
14
15
  var t = {};
15
16
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -19,7 +20,8 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
19
20
  return t;
20
21
  };
21
22
  class StyledTransition extends _react.Component {
22
- constructor(props = {}) {
23
+ constructor() {
24
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23
25
  super(props);
24
26
  this._isControlled = () => [true, false, 'enter', 'leave'].includes(this.props.state);
25
27
  this.onRest = props => {
@@ -8,7 +8,8 @@ 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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
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; }
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  var __rest = void 0 && (void 0).__rest || function (s, e) {
14
15
  var t = {};
@@ -19,7 +20,8 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
19
20
  return t;
20
21
  };
21
22
  class Transition extends _react.Component {
22
- constructor(props = {}) {
23
+ constructor() {
24
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23
25
  super(props);
24
26
  this._isControlled = () => [true, false, 'enter', 'leave'].includes(this.props.state);
25
27
  this.forwardInstance = instance => {
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = invokeFns;
7
- function invokeFns(fns, args = []) {
7
+ function invokeFns(fns) {
8
+ let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
8
9
  if (Array.isArray(fns) && fns.length) {
9
10
  fns.forEach(fn => {
10
11
  if (typeof fn === 'function') {
@@ -4,7 +4,8 @@ import PropTypes from 'prop-types';
4
4
  import { Animation as SemiAnimation, events } from '@douyinfe/semi-animation';
5
5
  import noop from './utils/noop';
6
6
  export default class Animation extends PureComponent {
7
- constructor(props = {}) {
7
+ constructor() {
8
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8
9
  super(props);
9
10
  this.initAnimation = props => {
10
11
  props = props == null ? this.props : props;
@@ -113,7 +114,8 @@ export default class Animation extends PureComponent {
113
114
  this.animation = null;
114
115
  }
115
116
  }
116
- componentDidUpdate(prevProps = {}) {
117
+ componentDidUpdate() {
118
+ let prevProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
117
119
  if (this.props.reset) {
118
120
  if (this.props.from !== prevProps.from || this.props.to !== prevProps.to) {
119
121
  this.destroy();
@@ -3,12 +3,16 @@ import PropTypes from 'prop-types';
3
3
  import noop from './utils/noop';
4
4
  import Animation from './Animation';
5
5
  export default class KeyFrames extends Component {
6
- constructor(props = {}) {
6
+ constructor() {
7
+ var _this;
8
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
9
  super(props);
8
- this.onFrame = (props = {}) => {
10
+ _this = this;
11
+ this.onFrame = function () {
12
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9
13
  const currentStyle = Object.assign({}, props);
10
- this.props.onFrame(currentStyle);
11
- this.setState({
14
+ _this.props.onFrame(currentStyle);
15
+ _this.setState({
12
16
  currentStyle
13
17
  });
14
18
  };
@@ -6,17 +6,50 @@ import noop from './utils/noop';
6
6
  import invokeFns from './utils/invokeFns';
7
7
  const types = Object.values(styledTypes).reduce((arr, cur) => [...arr, ...cur], []);
8
8
  export default class StyledAnimation extends PureComponent {
9
- constructor(props = {}) {
9
+ constructor() {
10
+ var _this;
11
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
12
  super(props);
11
- this._generateAnimateEvents = (child, props = {}) => ({
12
- onAnimationIteration: (...args) => invokeFns([child && child.props && child.props.onAnimationIteration, props.onFrame], args),
13
- onAnimationStart: (...args) => invokeFns([child && child.props && child.props.onAnimationStart, props.onStart], args),
14
- onAnimationEnd: (...args) => invokeFns([child && child.props && child.props.onAnimationEnd, props.onRest], args)
15
- });
16
- this._hasSpeedClass = (speed = this.props.speed) => speed != null && speeds.includes(speed);
17
- this._hasTypeClass = (type = this.props.type) => type != null && types.includes(type);
18
- this._hasDelayClass = (delay = this.props.delay) => delay != null && delays.includes(delay);
19
- this._hasLoopClass = (loop = this.props.loop) => loop != null && loops.includes(loop);
13
+ _this = this;
14
+ this._generateAnimateEvents = function (child) {
15
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16
+ return {
17
+ onAnimationIteration: function () {
18
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
19
+ args[_key] = arguments[_key];
20
+ }
21
+ return invokeFns([child && child.props && child.props.onAnimationIteration, props.onFrame], args);
22
+ },
23
+ onAnimationStart: function () {
24
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
25
+ args[_key2] = arguments[_key2];
26
+ }
27
+ return invokeFns([child && child.props && child.props.onAnimationStart, props.onStart], args);
28
+ },
29
+ onAnimationEnd: function () {
30
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
31
+ args[_key3] = arguments[_key3];
32
+ }
33
+ return invokeFns([child && child.props && child.props.onAnimationEnd, props.onRest], args);
34
+ }
35
+ };
36
+ };
37
+ this._hasSpeedClass = function () {
38
+ let speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.speed;
39
+ return speed != null && speeds.includes(speed);
40
+ };
41
+ this._hasTypeClass = function () {
42
+ let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.type;
43
+ return type != null && types.includes(type);
44
+ };
45
+ this._hasDelayClass = function () {
46
+ let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.delay;
47
+ return delay != null && delays.includes(delay);
48
+ };
49
+ this._hasLoopClass = function () {
50
+ let loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.loop;
51
+ return loop != null && loops.includes(loop);
52
+ };
20
53
  }
21
54
  render() {
22
55
  let {
@@ -11,7 +11,8 @@ import PropTypes from 'prop-types';
11
11
  import StyledAnimation from './StyledAnimation';
12
12
  import noop from './utils/noop';
13
13
  export default class StyledTransition extends Component {
14
- constructor(props = {}) {
14
+ constructor() {
15
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15
16
  super(props);
16
17
  this._isControlled = () => [true, false, 'enter', 'leave'].includes(this.props.state);
17
18
  this.onRest = props => {
@@ -11,7 +11,8 @@ import PropTypes from 'prop-types';
11
11
  import React, { Component, isValidElement } from 'react';
12
12
  import noop from './utils/noop';
13
13
  export default class Transition extends Component {
14
- constructor(props = {}) {
14
+ constructor() {
15
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15
16
  super(props);
16
17
  this._isControlled = () => [true, false, 'enter', 'leave'].includes(this.props.state);
17
18
  this.forwardInstance = instance => {
@@ -1,4 +1,5 @@
1
- export default function invokeFns(fns, args = []) {
1
+ export default function invokeFns(fns) {
2
+ let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
2
3
  if (Array.isArray(fns) && fns.length) {
3
4
  fns.forEach(fn => {
4
5
  if (typeof fn === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-animation-react",
3
- "version": "2.87.0-alpha.8",
3
+ "version": "2.87.0",
4
4
  "description": "motion library for semi-ui-react",
5
5
  "keywords": [
6
6
  "motion",
@@ -25,8 +25,8 @@
25
25
  "prepublishOnly": "npm run build:lib"
26
26
  },
27
27
  "dependencies": {
28
- "@douyinfe/semi-animation": "2.87.0-alpha.8",
29
- "@douyinfe/semi-animation-styled": "2.87.0-alpha.8",
28
+ "@douyinfe/semi-animation": "2.87.0",
29
+ "@douyinfe/semi-animation-styled": "2.87.0",
30
30
  "classnames": "^2.2.6"
31
31
  },
32
32
  "devDependencies": {
@@ -42,5 +42,5 @@
42
42
  "prop-types": "^15.7.2",
43
43
  "react-storybook-addon-props-combinations": "^1.1.0"
44
44
  },
45
- "gitHead": "9dfcaabfcb1a0653d2f00c5ee7a8ebdfc3d3703d"
45
+ "gitHead": "dd073a7b075e52525e21c4ac40f4de0189b6dbe8"
46
46
  }