@invisionag/iris-react-animation
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -1,12 +0,3 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(require("react"), require("lottie-web"), require("@invisionag/iris-react-image-container"), require("styled-components")); | ||
else if(typeof define === 'function' && define.amd) | ||
define(["react", "lottie-web", "@invisionag/iris-react-image-container", "styled-components"], factory); | ||
else { | ||
var a = typeof exports === 'object' ? factory(require("react"), require("lottie-web"), require("@invisionag/iris-react-image-container"), require("styled-components")) : factory(root["react"], root["lottie-web"], root["@invisionag/iris-react-image-container"], root["styled-components"]); | ||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; | ||
} | ||
})(global, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
module.exports = | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
@@ -94,3 +85,3 @@ /******/ var installedModules = {}; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 4); | ||
/******/ return __webpack_require__(__webpack_require__.s = 8); | ||
/******/ }) | ||
@@ -102,3 +93,3 @@ /************************************************************************/ | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__0__; | ||
module.exports = require("react-hot-loader"); | ||
@@ -109,90 +100,69 @@ /***/ }), | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__1__; | ||
module.exports = require("react"); | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__2__; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__3__; | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationDelayContext; }); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); | ||
(function () { | ||
var enterModule = __webpack_require__(0).enterModule; | ||
// EXTERNAL MODULE: external "react" | ||
var external_react_ = __webpack_require__(0); | ||
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_); | ||
enterModule && enterModule(module); | ||
})(); | ||
// EXTERNAL MODULE: external "lottie-web" | ||
var external_lottie_web_ = __webpack_require__(1); | ||
var external_lottie_web_default = /*#__PURE__*/__webpack_require__.n(external_lottie_web_); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
// EXTERNAL MODULE: external "@invisionag/iris-react-image-container" | ||
var iris_react_image_container_ = __webpack_require__(2); | ||
var iris_react_image_container_default = /*#__PURE__*/__webpack_require__.n(iris_react_image_container_); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// EXTERNAL MODULE: external "styled-components" | ||
var external_styled_components_ = __webpack_require__(3); | ||
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_); | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
// CONCATENATED MODULE: ./packages/react-animation/src/styles.js | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
var animationPlayState = function animationPlayState(_ref) { | ||
var paused = _ref.paused; | ||
return paused && 'paused !important'; | ||
}; | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
var AnimationStateChanger = external_styled_components_default.a.div.withConfig({ | ||
displayName: 'styles__AnimationStateChanger', | ||
componentId: 'koddox-0' | ||
})(['animation-play-state:', ';*{animation-play-state:', ';}'], animationPlayState, animationPlayState); | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
/* harmony default export */ var styles = ({}); | ||
// CONCATENATED MODULE: ./packages/react-animation/src/delayer.js | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var AnimationDelayContext = external_react_default.a.createContext({ | ||
var AnimationDelayContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({ | ||
animationDelayed: false | ||
}); | ||
var delayer_AnimationDelayer = function (_React$Component) { | ||
var AnimationDelayer = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(AnimationDelayer, _React$Component); | ||
function AnimationDelayer() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
_classCallCheck(this, AnimationDelayer); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AnimationDelayer.__proto__ || Object.getPrototypeOf(AnimationDelayer)).call.apply(_ref, [this].concat(args))), _this), _this.timeoutId = null, _this.state = { | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AnimationDelayer)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_this.timeoutId = null; | ||
_this.state = { | ||
animationDelayed: true | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}; | ||
return _this; | ||
} | ||
_createClass(AnimationDelayer, [{ | ||
key: 'componentDidMount', | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
@@ -202,6 +172,7 @@ var _this2 = this; | ||
var delay = this.props.delay; | ||
this.timeoutId = setTimeout(function () { | ||
return _this2.setState(function () { | ||
return { animationDelayed: false }; | ||
return { | ||
animationDelayed: false | ||
}; | ||
}); | ||
@@ -211,3 +182,3 @@ }, delay); | ||
}, { | ||
key: 'componentWillUnmount', | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
@@ -217,55 +188,206 @@ if (this.timeoutId) clearTimeout(this.timeoutId); | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var animationDelayed = this.state.animationDelayed; | ||
var children = this.props.children; | ||
return external_react_default.a.createElement( | ||
AnimationDelayContext.Provider, | ||
{ value: this.state }, | ||
external_react_default.a.createElement( | ||
AnimationStateChanger, | ||
{ paused: animationDelayed }, | ||
children | ||
) | ||
); | ||
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(AnimationDelayContext.Provider, { | ||
value: this.state | ||
}, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_styles__WEBPACK_IMPORTED_MODULE_1__[/* AnimationStateChanger */ "a"], { | ||
paused: animationDelayed | ||
}, children)); | ||
} | ||
}, { | ||
key: "__reactstandin__regenerateByEval", | ||
// @ts-ignore | ||
value: function __reactstandin__regenerateByEval(key, code) { | ||
// @ts-ignore | ||
this[key] = eval(code); | ||
} | ||
}]); | ||
return AnimationDelayer; | ||
}(external_react_default.a.Component); | ||
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); | ||
delayer_AnimationDelayer.defaultProps = { | ||
AnimationDelayer.defaultProps = { | ||
delay: 1000 | ||
}; | ||
var _default = AnimationDelayer; | ||
/* harmony default export */ __webpack_exports__["b"] = (_default); | ||
; | ||
(function () { | ||
var reactHotLoader = __webpack_require__(0).default; | ||
/* harmony default export */ var delayer = (delayer_AnimationDelayer); | ||
// CONCATENATED MODULE: ./packages/react-animation/src/index.js | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultLottieOptions", function() { return defaultLottieOptions; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return src_Animation; }); | ||
/* concated harmony reexport AnimationStateChanger */__webpack_require__.d(__webpack_exports__, "AnimationStateChanger", function() { return AnimationStateChanger; }); | ||
/* concated harmony reexport AnimationDelayer */__webpack_require__.d(__webpack_exports__, "AnimationDelayer", function() { return delayer; }); | ||
/* concated harmony reexport AnimationDelayContext */__webpack_require__.d(__webpack_exports__, "AnimationDelayContext", function() { return AnimationDelayContext; }); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var leaveModule = __webpack_require__(0).leaveModule; | ||
var src_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
if (!reactHotLoader) { | ||
return; | ||
} | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
reactHotLoader.register(AnimationDelayContext, "AnimationDelayContext", "/Users/fbecker/repos/iris/packages/react-animation/src/delayer.js"); | ||
reactHotLoader.register(AnimationDelayer, "AnimationDelayer", "/Users/fbecker/repos/iris/packages/react-animation/src/delayer.js"); | ||
reactHotLoader.register(_default, "default", "/Users/fbecker/repos/iris/packages/react-animation/src/delayer.js"); | ||
leaveModule(module); | ||
})(); | ||
function src_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
; | ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)(module))) | ||
function src_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
function src_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
"use strict"; | ||
/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationStateChanger; }); | ||
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7); | ||
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_0__); | ||
(function () { | ||
var enterModule = __webpack_require__(0).enterModule; | ||
enterModule && enterModule(module); | ||
})(); | ||
var animationPlayState = function animationPlayState(_ref) { | ||
var paused = _ref.paused; | ||
return paused && 'paused !important'; | ||
}; | ||
var AnimationStateChanger = styled_components__WEBPACK_IMPORTED_MODULE_0___default.a.div.withConfig({ | ||
displayName: "styles__AnimationStateChanger", | ||
componentId: "koddox-0" | ||
})(["animation-play-state:", ";*{animation-play-state:", ";}"], animationPlayState, animationPlayState); | ||
var _default = {}; | ||
/* unused harmony default export */ var _unused_webpack_default_export = (_default); | ||
; | ||
(function () { | ||
var reactHotLoader = __webpack_require__(0).default; | ||
var leaveModule = __webpack_require__(0).leaveModule; | ||
if (!reactHotLoader) { | ||
return; | ||
} | ||
reactHotLoader.register(animationPlayState, "animationPlayState", "/Users/fbecker/repos/iris/packages/react-animation/src/styles.js"); | ||
reactHotLoader.register(AnimationStateChanger, "AnimationStateChanger", "/Users/fbecker/repos/iris/packages/react-animation/src/styles.js"); | ||
reactHotLoader.register(_default, "default", "/Users/fbecker/repos/iris/packages/react-animation/src/styles.js"); | ||
leaveModule(module); | ||
})(); | ||
; | ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)(module))) | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, exports) { | ||
module.exports = function(originalModule) { | ||
if (!originalModule.webpackPolyfill) { | ||
var module = Object.create(originalModule); | ||
// module.parent = undefined by default | ||
if (!module.children) module.children = []; | ||
Object.defineProperty(module, "loaded", { | ||
enumerable: true, | ||
get: function() { | ||
return module.l; | ||
} | ||
}); | ||
Object.defineProperty(module, "id", { | ||
enumerable: true, | ||
get: function() { | ||
return module.i; | ||
} | ||
}); | ||
Object.defineProperty(module, "exports", { | ||
enumerable: true | ||
}); | ||
module.webpackPolyfill = 1; | ||
} | ||
return module; | ||
}; | ||
/***/ }), | ||
/* 5 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("lottie-web"); | ||
/***/ }), | ||
/* 6 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@invisionag/iris-react-image-container"); | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("styled-components"); | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultLottieOptions", function() { return defaultLottieOptions; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return Animation; }); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var lottie_web__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); | ||
/* harmony import */ var lottie_web__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lottie_web__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var _invisionag_iris_react_image_container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6); | ||
/* harmony import */ var _invisionag_iris_react_image_container__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_invisionag_iris_react_image_container__WEBPACK_IMPORTED_MODULE_2__); | ||
/* harmony import */ var _delayer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationDelayer", function() { return _delayer__WEBPACK_IMPORTED_MODULE_3__["b"]; }); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationDelayContext", function() { return _delayer__WEBPACK_IMPORTED_MODULE_3__["a"]; }); | ||
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationStateChanger", function() { return _styles__WEBPACK_IMPORTED_MODULE_4__["a"]; }); | ||
(function () { | ||
var enterModule = __webpack_require__(0).enterModule; | ||
enterModule && enterModule(module); | ||
})(); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var defaultLottieOptions = { | ||
@@ -275,31 +397,43 @@ renderer: 'svg', | ||
autoplay: false, | ||
rendererSettings: { viewBoxOnly: true } | ||
rendererSettings: { | ||
viewBoxOnly: true | ||
} | ||
}; | ||
var Animation = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(Animation, _React$Component); | ||
var src_Animation = function (_React$Component) { | ||
src_inherits(Animation, _React$Component); | ||
function Animation() { | ||
var _ref; | ||
var _getPrototypeOf2; | ||
var _temp, _this, _ret; | ||
var _this; | ||
src_classCallCheck(this, Animation); | ||
_classCallCheck(this, Animation); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = src_possibleConstructorReturn(this, (_ref = Animation.__proto__ || Object.getPrototypeOf(Animation)).call.apply(_ref, [this].concat(args))), _this), _this.destroyAnimation = function () { | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Animation)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_this.ref = void 0; | ||
_this.animation = void 0; | ||
_this.destroyAnimation = function () { | ||
if (typeof _this.animation === 'undefined') return; | ||
_this.animation.destroy(); | ||
}, _this.handleRef = function (ref) { | ||
}; | ||
_this.handleRef = function (ref) { | ||
_this.ref = ref; | ||
_this.forceUpdate(); | ||
}, _temp), src_possibleConstructorReturn(_this, _ret); | ||
}; | ||
return _this; | ||
} | ||
src_createClass(Animation, [{ | ||
key: 'componentWillUnmount', | ||
_createClass(Animation, [{ | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
@@ -309,56 +443,79 @@ this.destroyAnimation(); | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var _this2 = this; | ||
var _props = this.props, | ||
children = _props.children, | ||
data = _props.data, | ||
lottieOptions = _props.lottieOptions, | ||
props = _objectWithoutProperties(_props, ['children', 'data', 'lottieOptions']); | ||
var _this$props = this.props, | ||
children = _this$props.children, | ||
data = _this$props.data, | ||
lottieOptions = _this$props.lottieOptions, | ||
props = _objectWithoutProperties(_this$props, ["children", "data", "lottieOptions"]); | ||
if (typeof children !== 'function') return null; | ||
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_delayer__WEBPACK_IMPORTED_MODULE_3__[/* AnimationDelayContext */ "a"].Consumer, null, function (_ref) { | ||
var animationDelayed = _ref.animationDelayed; | ||
return external_react_default.a.createElement( | ||
AnimationDelayContext.Consumer, | ||
null, | ||
function (_ref2) { | ||
var animationDelayed = _ref2.animationDelayed; | ||
if (_this2.ref) { | ||
_this2.destroyAnimation(); | ||
if (_this2.ref) { | ||
_this2.destroyAnimation(); | ||
_this2.animation = external_lottie_web_default.a.loadAnimation(_extends({ | ||
container: _this2.ref, | ||
animationData: data | ||
}, defaultLottieOptions, lottieOptions, { | ||
autoplay: !animationDelayed | ||
})); | ||
} | ||
return children(_extends({}, props, { | ||
onRef: _this2.handleRef, | ||
animation: _this2.animation, | ||
_this2.animation = lottie_web__WEBPACK_IMPORTED_MODULE_1___default.a.loadAnimation(_objectSpread({ | ||
container: _this2.ref, | ||
animationData: data | ||
}, defaultLottieOptions, lottieOptions, { | ||
autoplay: !animationDelayed | ||
})); | ||
} | ||
); | ||
return children(_objectSpread({}, props, { | ||
onRef: _this2.handleRef, | ||
animation: _this2.animation, | ||
autoplay: !animationDelayed | ||
})); | ||
}); | ||
} | ||
}, { | ||
key: "__reactstandin__regenerateByEval", | ||
// @ts-ignore | ||
value: function __reactstandin__regenerateByEval(key, code) { | ||
// @ts-ignore | ||
this[key] = eval(code); | ||
} | ||
}]); | ||
return Animation; | ||
}(external_react_default.a.Component); | ||
src_Animation.defaultProps = { | ||
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); | ||
Animation.defaultProps = { | ||
lottieOptions: {}, | ||
children: function children(_ref3) { | ||
var onRef = _ref3.onRef, | ||
rest = _objectWithoutProperties(_ref3, ['onRef']); | ||
children: function children(_ref2) { | ||
var onRef = _ref2.onRef, | ||
rest = _objectWithoutProperties(_ref2, ["onRef"]); | ||
return external_react_default.a.createElement(iris_react_image_container_default.a, _extends({ innerRef: onRef }, rest)); | ||
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_invisionag_iris_react_image_container__WEBPACK_IMPORTED_MODULE_2___default.a, _extends({ | ||
innerRef: onRef | ||
}, rest)); | ||
} | ||
}; | ||
/* harmony default export */ var src = __webpack_exports__["default"] = (src_Animation); | ||
var _default = Animation; | ||
/* harmony default export */ __webpack_exports__["default"] = (_default); | ||
; | ||
(function () { | ||
var reactHotLoader = __webpack_require__(0).default; | ||
var leaveModule = __webpack_require__(0).leaveModule; | ||
if (!reactHotLoader) { | ||
return; | ||
} | ||
reactHotLoader.register(defaultLottieOptions, "defaultLottieOptions", "/Users/fbecker/repos/iris/packages/react-animation/src/index.js"); | ||
reactHotLoader.register(Animation, "Animation", "/Users/fbecker/repos/iris/packages/react-animation/src/index.js"); | ||
reactHotLoader.register(_default, "default", "/Users/fbecker/repos/iris/packages/react-animation/src/index.js"); | ||
leaveModule(module); | ||
})(); | ||
; | ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)(module))) | ||
/***/ }) | ||
/******/ ]); | ||
}); | ||
/******/ ]); |
{ | ||
"name": "@invisionag/iris-react-animation", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"main": "dist/index.js", | ||
@@ -8,5 +8,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"@invisionag/iris-react-image-container": "^1.1.2", | ||
"@invisionag/iris-react-image-container": "^1.1.3", | ||
"@invisionag/iris-settings": "^4.4.2", | ||
"@invisionag/iris-tools": "^3.1.2", | ||
"@invisionag/iris-tools": "^3.1.3", | ||
"classnames": "^2.2.6", | ||
@@ -16,3 +16,3 @@ "lottie-web": "^5.1.18" | ||
"devDependencies": { | ||
"@invisionag/iris-colors": "^3.1.2" | ||
"@invisionag/iris-colors": "^3.1.3" | ||
}, | ||
@@ -22,3 +22,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "eb569530854a97ce6137e67b0192109bf587632d" | ||
"gitHead": "60b39d6f3c5f349afc80c1d15ba7e8a486460744" | ||
} |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
32959
561
2