react-image-zoom
Advanced tools
Comparing version 0.7.0 to 1.1.0
@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
root["ReactImageZoom"] = factory(root["React"], root["ImageZoom"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_10__) { | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_12__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
@@ -56,3 +56,3 @@ /******/ // The module cache | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -62,3 +62,3 @@ 'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -76,3 +76,3 @@ | ||
var _jsImageZoom = __webpack_require__(10); | ||
var _jsImageZoom = __webpack_require__(12); | ||
@@ -90,117 +90,586 @@ var _jsImageZoom2 = _interopRequireDefault(_jsImageZoom); | ||
var ReactImageZoom = function (_React$Component) { | ||
_inherits(ReactImageZoom, _React$Component); | ||
_inherits(ReactImageZoom, _React$Component); | ||
function ReactImageZoom(props) { | ||
_classCallCheck(this, ReactImageZoom); | ||
function ReactImageZoom(props) { | ||
_classCallCheck(this, ReactImageZoom); | ||
var _this = _possibleConstructorReturn(this, (ReactImageZoom.__proto__ || Object.getPrototypeOf(ReactImageZoom)).call(this, props)); | ||
var _this = _possibleConstructorReturn(this, (ReactImageZoom.__proto__ || Object.getPrototypeOf(ReactImageZoom)).call(this, props)); | ||
_this.container = undefined; | ||
_this.getRef = _this.getRef.bind(_this); | ||
return _this; | ||
_this.container = undefined; | ||
_this.getRef = _this.getRef.bind(_this); | ||
return _this; | ||
} | ||
_createClass(ReactImageZoom, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this.rerenderImageZoom(this.props); | ||
} | ||
}, { | ||
key: 'UNSAFE_componentWillUnmount', | ||
value: function UNSAFE_componentWillUnmount() { | ||
this.imageZoom.kill(); | ||
this.imageZoom = void 0; | ||
} | ||
}, { | ||
key: 'UNSAFE_componentWillReceiveProps', | ||
value: function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (this.props !== nextProps) { | ||
this.kill(); | ||
this.rerenderImageZoom(nextProps); | ||
} | ||
} | ||
}, { | ||
key: 'rerenderImageZoom', | ||
value: function rerenderImageZoom(props) { | ||
this.imageZoom = new _jsImageZoom2.default(this.container, JSON.parse(JSON.stringify(props))); | ||
} | ||
}, { | ||
key: 'setup', | ||
value: function setup() { | ||
this.imageZoom.setup(); | ||
} | ||
}, { | ||
key: 'kill', | ||
value: function kill() { | ||
this.imageZoom.kill(); | ||
} | ||
}, { | ||
key: 'getRef', | ||
value: function getRef(ref) { | ||
this.container = ref; | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
return _react2.default.createElement('div', { ref: this.getRef }); | ||
} | ||
}]); | ||
_createClass(ReactImageZoom, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this.imageZoom = new _jsImageZoom2.default(this.container, this.props); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
this.imageZoom.kill(); | ||
this.imageZoom = void 0; | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(nextProps) { | ||
if (this.props !== nextProps) { | ||
this.kill(); | ||
this.imageZoom = new _jsImageZoom2.default(this.container, nextProps); | ||
} | ||
} | ||
}, { | ||
key: 'setup', | ||
value: function setup() { | ||
this.imageZoom.setup(); | ||
} | ||
}, { | ||
key: 'kill', | ||
value: function kill() { | ||
this.imageZoom.kill(); | ||
} | ||
}, { | ||
key: 'getRef', | ||
value: function getRef(ref) { | ||
this.container = ref; | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
return _react2.default.createElement('div', { ref: this.getRef }); | ||
} | ||
}]); | ||
return ReactImageZoom; | ||
return ReactImageZoom; | ||
}(_react2.default.Component); | ||
ReactImageZoom.propTypes = { | ||
width: _propTypes2.default.number.isRequired, | ||
img: _propTypes2.default.string, | ||
height: _propTypes2.default.number, | ||
zoomWidth: _propTypes2.default.number, | ||
scale: _propTypes2.default.number, | ||
offset: _propTypes2.default.object, | ||
zoomStyle: _propTypes2.default.string, | ||
zoomLensStyle: _propTypes2.default.string | ||
width: _propTypes2.default.number.isRequired, | ||
img: _propTypes2.default.string, | ||
height: _propTypes2.default.number, | ||
zoomWidth: _propTypes2.default.number, | ||
scale: _propTypes2.default.number, | ||
offset: _propTypes2.default.object, | ||
zoomStyle: _propTypes2.default.string, | ||
zoomLensStyle: _propTypes2.default.string | ||
}; | ||
exports.default = ReactImageZoom; | ||
module.exports = exports['default']; | ||
/***/ }, | ||
/***/ }), | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
/***/ (function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__; | ||
/***/ }, | ||
/***/ }), | ||
/* 2 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactIs = __webpack_require__(4); | ||
// By explicitly using `prop-types` you are opting into new development behavior. | ||
// http://fb.me/prop-types-in-prod | ||
var throwOnDirectAccess = true; | ||
module.exports = __webpack_require__(7)(ReactIs.isElement, throwOnDirectAccess); | ||
} else { | ||
// By explicitly using `prop-types` you are opting into new production behavior. | ||
// http://fb.me/prop-types-in-prod | ||
module.exports = __webpack_require__(11)(); | ||
} | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
// shim for using process in browser | ||
var process = module.exports = {}; | ||
// cached from whatever global is present so that test runners that stub it | ||
// don't break things. But we need to wrap it in a try catch in case it is | ||
// wrapped in strict mode code which doesn't define any globals. It's inside a | ||
// function because try/catches deoptimize in certain engines. | ||
var cachedSetTimeout; | ||
var cachedClearTimeout; | ||
function defaultSetTimout() { | ||
throw new Error('setTimeout has not been defined'); | ||
} | ||
function defaultClearTimeout () { | ||
throw new Error('clearTimeout has not been defined'); | ||
} | ||
(function () { | ||
try { | ||
if (typeof setTimeout === 'function') { | ||
cachedSetTimeout = setTimeout; | ||
} else { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
} catch (e) { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
try { | ||
if (typeof clearTimeout === 'function') { | ||
cachedClearTimeout = clearTimeout; | ||
} else { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} catch (e) { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} ()) | ||
function runTimeout(fun) { | ||
if (cachedSetTimeout === setTimeout) { | ||
//normal enviroments in sane situations | ||
return setTimeout(fun, 0); | ||
} | ||
// if setTimeout wasn't available but was latter defined | ||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | ||
cachedSetTimeout = setTimeout; | ||
return setTimeout(fun, 0); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedSetTimeout(fun, 0); | ||
} catch(e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedSetTimeout.call(null, fun, 0); | ||
} catch(e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | ||
return cachedSetTimeout.call(this, fun, 0); | ||
} | ||
} | ||
} | ||
function runClearTimeout(marker) { | ||
if (cachedClearTimeout === clearTimeout) { | ||
//normal enviroments in sane situations | ||
return clearTimeout(marker); | ||
} | ||
// if clearTimeout wasn't available but was latter defined | ||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | ||
cachedClearTimeout = clearTimeout; | ||
return clearTimeout(marker); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedClearTimeout(marker); | ||
} catch (e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedClearTimeout.call(null, marker); | ||
} catch (e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | ||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | ||
return cachedClearTimeout.call(this, marker); | ||
} | ||
} | ||
} | ||
var queue = []; | ||
var draining = false; | ||
var currentQueue; | ||
var queueIndex = -1; | ||
function cleanUpNextTick() { | ||
if (!draining || !currentQueue) { | ||
return; | ||
} | ||
draining = false; | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
} else { | ||
queueIndex = -1; | ||
} | ||
if (queue.length) { | ||
drainQueue(); | ||
} | ||
} | ||
function drainQueue() { | ||
if (draining) { | ||
return; | ||
} | ||
var timeout = runTimeout(cleanUpNextTick); | ||
draining = true; | ||
var len = queue.length; | ||
while(len) { | ||
currentQueue = queue; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
if (currentQueue) { | ||
currentQueue[queueIndex].run(); | ||
} | ||
} | ||
queueIndex = -1; | ||
len = queue.length; | ||
} | ||
currentQueue = null; | ||
draining = false; | ||
runClearTimeout(timeout); | ||
} | ||
process.nextTick = function (fun) { | ||
var args = new Array(arguments.length - 1); | ||
if (arguments.length > 1) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
queue.push(new Item(fun, args)); | ||
if (queue.length === 1 && !draining) { | ||
runTimeout(drainQueue); | ||
} | ||
}; | ||
// v8 likes predictible objects | ||
function Item(fun, array) { | ||
this.fun = fun; | ||
this.array = array; | ||
} | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
}; | ||
process.title = 'browser'; | ||
process.browser = true; | ||
process.env = {}; | ||
process.argv = []; | ||
process.version = ''; // empty string to avoid regexp issues | ||
process.versions = {}; | ||
function noop() {} | ||
process.on = noop; | ||
process.addListener = noop; | ||
process.once = noop; | ||
process.off = noop; | ||
process.removeListener = noop; | ||
process.removeAllListeners = noop; | ||
process.emit = noop; | ||
process.prependListener = noop; | ||
process.prependOnceListener = noop; | ||
process.listeners = function (name) { return [] } | ||
process.binding = function (name) { | ||
throw new Error('process.binding is not supported'); | ||
}; | ||
process.cwd = function () { return '/' }; | ||
process.chdir = function (dir) { | ||
throw new Error('process.chdir is not supported'); | ||
}; | ||
process.umask = function() { return 0; }; | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = __webpack_require__(5); | ||
} else { | ||
module.exports = __webpack_require__(6); | ||
} | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) | ||
/***/ }), | ||
/* 5 */ | ||
/***/ (function(module, exports) { | ||
/** @license React v16.12.0 | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); | ||
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"): | ||
60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m} | ||
exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p; | ||
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h}; | ||
exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p}; | ||
/***/ }), | ||
/* 6 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.12.0 | ||
* react-is.development.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
'use strict'; | ||
if (process.env.NODE_ENV !== "production") { | ||
(function() { | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
var hasSymbol = typeof Symbol === 'function' && Symbol.for; | ||
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | ||
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; | ||
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; | ||
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; | ||
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; | ||
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; | ||
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; | ||
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; | ||
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; | ||
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; | ||
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; | ||
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; | ||
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; | ||
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; | ||
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; | ||
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | ||
function isValidElementType(type) { | ||
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE); | ||
} | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Forked from fbjs/warning: | ||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* Only change is we use console.warn instead of console.error, | ||
* and do nothing when 'console' is not supported. | ||
* This really simplifies the code. | ||
* --- | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var lowPriorityWarningWithoutStack = function () {}; | ||
var factory = __webpack_require__(3); | ||
{ | ||
var printWarning = function (format) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && | ||
Symbol.for && | ||
Symbol.for('react.element')) || | ||
0xeac7; | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
function isValidElement(object) { | ||
return typeof object === 'object' && | ||
object !== null && | ||
object.$$typeof === REACT_ELEMENT_TYPE; | ||
if (typeof console !== 'undefined') { | ||
console.warn(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
lowPriorityWarningWithoutStack = function (condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
printWarning.apply(void 0, [format].concat(args)); | ||
} | ||
}; | ||
} | ||
module.exports = factory(isValidElement); | ||
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack; | ||
function typeOf(object) { | ||
if (typeof object === 'object' && object !== null) { | ||
var $$typeof = object.$$typeof; | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
switch ($$typeof) { | ||
case REACT_ELEMENT_TYPE: | ||
var type = object.type; | ||
switch (type) { | ||
case REACT_ASYNC_MODE_TYPE: | ||
case REACT_CONCURRENT_MODE_TYPE: | ||
case REACT_FRAGMENT_TYPE: | ||
case REACT_PROFILER_TYPE: | ||
case REACT_STRICT_MODE_TYPE: | ||
case REACT_SUSPENSE_TYPE: | ||
return type; | ||
default: | ||
var $$typeofType = type && type.$$typeof; | ||
switch ($$typeofType) { | ||
case REACT_CONTEXT_TYPE: | ||
case REACT_FORWARD_REF_TYPE: | ||
case REACT_LAZY_TYPE: | ||
case REACT_MEMO_TYPE: | ||
case REACT_PROVIDER_TYPE: | ||
return $$typeofType; | ||
default: | ||
return $$typeof; | ||
} | ||
} | ||
case REACT_PORTAL_TYPE: | ||
return $$typeof; | ||
} | ||
} | ||
return undefined; | ||
} // AsyncMode is deprecated along with isAsyncMode | ||
var AsyncMode = REACT_ASYNC_MODE_TYPE; | ||
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | ||
var ContextConsumer = REACT_CONTEXT_TYPE; | ||
var ContextProvider = REACT_PROVIDER_TYPE; | ||
var Element = REACT_ELEMENT_TYPE; | ||
var ForwardRef = REACT_FORWARD_REF_TYPE; | ||
var Fragment = REACT_FRAGMENT_TYPE; | ||
var Lazy = REACT_LAZY_TYPE; | ||
var Memo = REACT_MEMO_TYPE; | ||
var Portal = REACT_PORTAL_TYPE; | ||
var Profiler = REACT_PROFILER_TYPE; | ||
var StrictMode = REACT_STRICT_MODE_TYPE; | ||
var Suspense = REACT_SUSPENSE_TYPE; | ||
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated | ||
function isAsyncMode(object) { | ||
{ | ||
if (!hasWarnedAboutDeprecatedIsAsyncMode) { | ||
hasWarnedAboutDeprecatedIsAsyncMode = true; | ||
lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | ||
} | ||
} | ||
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | ||
} | ||
function isConcurrentMode(object) { | ||
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | ||
} | ||
function isContextConsumer(object) { | ||
return typeOf(object) === REACT_CONTEXT_TYPE; | ||
} | ||
function isContextProvider(object) { | ||
return typeOf(object) === REACT_PROVIDER_TYPE; | ||
} | ||
function isElement(object) { | ||
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | ||
} | ||
function isForwardRef(object) { | ||
return typeOf(object) === REACT_FORWARD_REF_TYPE; | ||
} | ||
function isFragment(object) { | ||
return typeOf(object) === REACT_FRAGMENT_TYPE; | ||
} | ||
function isLazy(object) { | ||
return typeOf(object) === REACT_LAZY_TYPE; | ||
} | ||
function isMemo(object) { | ||
return typeOf(object) === REACT_MEMO_TYPE; | ||
} | ||
function isPortal(object) { | ||
return typeOf(object) === REACT_PORTAL_TYPE; | ||
} | ||
function isProfiler(object) { | ||
return typeOf(object) === REACT_PROFILER_TYPE; | ||
} | ||
function isStrictMode(object) { | ||
return typeOf(object) === REACT_STRICT_MODE_TYPE; | ||
} | ||
function isSuspense(object) { | ||
return typeOf(object) === REACT_SUSPENSE_TYPE; | ||
} | ||
exports.typeOf = typeOf; | ||
exports.AsyncMode = AsyncMode; | ||
exports.ConcurrentMode = ConcurrentMode; | ||
exports.ContextConsumer = ContextConsumer; | ||
exports.ContextProvider = ContextProvider; | ||
exports.Element = Element; | ||
exports.ForwardRef = ForwardRef; | ||
exports.Fragment = Fragment; | ||
exports.Lazy = Lazy; | ||
exports.Memo = Memo; | ||
exports.Portal = Portal; | ||
exports.Profiler = Profiler; | ||
exports.StrictMode = StrictMode; | ||
exports.Suspense = Suspense; | ||
exports.isValidElementType = isValidElementType; | ||
exports.isAsyncMode = isAsyncMode; | ||
exports.isConcurrentMode = isConcurrentMode; | ||
exports.isContextConsumer = isContextConsumer; | ||
exports.isContextProvider = isContextProvider; | ||
exports.isElement = isElement; | ||
exports.isForwardRef = isForwardRef; | ||
exports.isFragment = isFragment; | ||
exports.isLazy = isLazy; | ||
exports.isMemo = isMemo; | ||
exports.isPortal = isPortal; | ||
exports.isProfiler = isProfiler; | ||
exports.isStrictMode = isStrictMode; | ||
exports.isSuspense = isSuspense; | ||
})(); | ||
} | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -210,10 +679,31 @@ | ||
var emptyFunction = __webpack_require__(5); | ||
var invariant = __webpack_require__(6); | ||
var warning = __webpack_require__(7); | ||
var ReactIs = __webpack_require__(4); | ||
var assign = __webpack_require__(8); | ||
var ReactPropTypesSecret = __webpack_require__(8); | ||
var checkPropTypes = __webpack_require__(9); | ||
var ReactPropTypesSecret = __webpack_require__(9); | ||
var checkPropTypes = __webpack_require__(10); | ||
module.exports = function (isValidElement) { | ||
var has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
var printWarning = function() {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
printWarning = function(text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
} | ||
function emptyFunctionThatReturnsNull() { | ||
return null; | ||
} | ||
module.exports = function(isValidElement, throwOnDirectAccess) { | ||
/* global Symbol */ | ||
@@ -293,55 +783,26 @@ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | ||
var ReactPropTypes; | ||
// Important! | ||
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | ||
var ReactPropTypes = { | ||
array: createPrimitiveTypeChecker('array'), | ||
bool: createPrimitiveTypeChecker('boolean'), | ||
func: createPrimitiveTypeChecker('function'), | ||
number: createPrimitiveTypeChecker('number'), | ||
object: createPrimitiveTypeChecker('object'), | ||
string: createPrimitiveTypeChecker('string'), | ||
symbol: createPrimitiveTypeChecker('symbol'), | ||
if (process.env.NODE_ENV !== 'production') { | ||
// Keep in sync with production version below | ||
ReactPropTypes = { | ||
array: createPrimitiveTypeChecker('array'), | ||
bool: createPrimitiveTypeChecker('boolean'), | ||
func: createPrimitiveTypeChecker('function'), | ||
number: createPrimitiveTypeChecker('number'), | ||
object: createPrimitiveTypeChecker('object'), | ||
string: createPrimitiveTypeChecker('string'), | ||
symbol: createPrimitiveTypeChecker('symbol'), | ||
any: createAnyTypeChecker(), | ||
arrayOf: createArrayOfTypeChecker, | ||
element: createElementTypeChecker(), | ||
elementType: createElementTypeTypeChecker(), | ||
instanceOf: createInstanceTypeChecker, | ||
node: createNodeChecker(), | ||
objectOf: createObjectOfTypeChecker, | ||
oneOf: createEnumTypeChecker, | ||
oneOfType: createUnionTypeChecker, | ||
shape: createShapeTypeChecker, | ||
exact: createStrictShapeTypeChecker, | ||
}; | ||
any: createAnyTypeChecker(), | ||
arrayOf: createArrayOfTypeChecker, | ||
element: createElementTypeChecker(), | ||
instanceOf: createInstanceTypeChecker, | ||
node: createNodeChecker(), | ||
objectOf: createObjectOfTypeChecker, | ||
oneOf: createEnumTypeChecker, | ||
oneOfType: createUnionTypeChecker, | ||
shape: createShapeTypeChecker | ||
}; | ||
} else { | ||
var productionTypeChecker = function () { | ||
invariant(false, 'React.PropTypes type checking code is stripped in production.'); | ||
}; | ||
productionTypeChecker.isRequired = productionTypeChecker; | ||
var getProductionTypeChecker = function () { | ||
return productionTypeChecker; | ||
}; | ||
// Keep in sync with development version above | ||
ReactPropTypes = { | ||
array: productionTypeChecker, | ||
bool: productionTypeChecker, | ||
func: productionTypeChecker, | ||
number: productionTypeChecker, | ||
object: productionTypeChecker, | ||
string: productionTypeChecker, | ||
symbol: productionTypeChecker, | ||
any: productionTypeChecker, | ||
arrayOf: getProductionTypeChecker, | ||
element: productionTypeChecker, | ||
instanceOf: getProductionTypeChecker, | ||
node: productionTypeChecker, | ||
objectOf: getProductionTypeChecker, | ||
oneOf: getProductionTypeChecker, | ||
oneOfType: getProductionTypeChecker, | ||
shape: getProductionTypeChecker | ||
}; | ||
} | ||
/** | ||
@@ -382,2 +843,3 @@ * inlined Object.is polyfill to avoid requiring consumers ship their own | ||
var manualPropTypeCallCache = {}; | ||
var manualPropTypeWarningCount = 0; | ||
} | ||
@@ -387,8 +849,30 @@ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | ||
propFullName = propFullName || propName; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { | ||
if (secret !== ReactPropTypesSecret) { | ||
if (throwOnDirectAccess) { | ||
// New behavior only for users of `prop-types` package | ||
var err = new Error( | ||
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + | ||
'Use `PropTypes.checkPropTypes()` to call them. ' + | ||
'Read more at http://fb.me/use-check-prop-types' | ||
); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { | ||
// Old behavior for people using React.PropTypes | ||
var cacheKey = componentName + ':' + propName; | ||
if (!manualPropTypeCallCache[cacheKey]) { | ||
process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; | ||
if ( | ||
!manualPropTypeCallCache[cacheKey] && | ||
// Avoid spamming the console because they are often not actionable except for lib authors | ||
manualPropTypeWarningCount < 3 | ||
) { | ||
printWarning( | ||
'You are manually calling a React.PropTypes validation ' + | ||
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + | ||
'and will throw in the standalone `prop-types` package. ' + | ||
'You may be seeing this warning due to a third-party PropTypes ' + | ||
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' | ||
); | ||
manualPropTypeCallCache[cacheKey] = true; | ||
manualPropTypeWarningCount++; | ||
} | ||
@@ -434,3 +918,3 @@ } | ||
function createAnyTypeChecker() { | ||
return createChainableTypeChecker(emptyFunction.thatReturnsNull); | ||
return createChainableTypeChecker(emptyFunctionThatReturnsNull); | ||
} | ||
@@ -471,2 +955,14 @@ | ||
function createElementTypeTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!ReactIs.isValidElementType(propValue)) { | ||
var propType = getPropType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createInstanceTypeChecker(expectedClass) { | ||
@@ -486,4 +982,13 @@ function validate(props, propName, componentName, location, propFullName) { | ||
if (!Array.isArray(expectedValues)) { | ||
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; | ||
return emptyFunction.thatReturnsNull; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (arguments.length > 1) { | ||
printWarning( | ||
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + | ||
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' | ||
); | ||
} else { | ||
printWarning('Invalid argument supplied to oneOf, expected an array.'); | ||
} | ||
} | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
@@ -499,4 +1004,10 @@ | ||
var valuesString = JSON.stringify(expectedValues); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | ||
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | ||
var type = getPreciseType(value); | ||
if (type === 'symbol') { | ||
return String(value); | ||
} | ||
return value; | ||
}); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | ||
} | ||
@@ -517,3 +1028,3 @@ return createChainableTypeChecker(validate); | ||
for (var key in propValue) { | ||
if (propValue.hasOwnProperty(key)) { | ||
if (has(propValue, key)) { | ||
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | ||
@@ -532,6 +1043,17 @@ if (error instanceof Error) { | ||
if (!Array.isArray(arrayOfTypeCheckers)) { | ||
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; | ||
return emptyFunction.thatReturnsNull; | ||
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (typeof checker !== 'function') { | ||
printWarning( | ||
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | ||
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' | ||
); | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
@@ -582,2 +1104,32 @@ for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
function createStrictShapeTypeChecker(shapeTypes) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
var propType = getPropType(propValue); | ||
if (propType !== 'object') { | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | ||
} | ||
// We need to check all keys in case some are required but missing from | ||
// props. | ||
var allKeys = assign({}, props[propName], shapeTypes); | ||
for (var key in allKeys) { | ||
var checker = shapeTypes[key]; | ||
if (!checker) { | ||
return new PropTypeError( | ||
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + | ||
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') + | ||
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') | ||
); | ||
} | ||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | ||
if (error) { | ||
return error; | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function isNode(propValue) { | ||
@@ -636,2 +1188,7 @@ switch (typeof propValue) { | ||
// falsy value can't be a Symbol | ||
if (!propValue) { | ||
return false; | ||
} | ||
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | ||
@@ -671,2 +1228,5 @@ if (propValue['@@toStringTag'] === 'Symbol') { | ||
function getPreciseType(propValue) { | ||
if (typeof propValue === 'undefined' || propValue === null) { | ||
return '' + propValue; | ||
} | ||
var propType = getPropType(propValue); | ||
@@ -683,2 +1243,19 @@ if (propType === 'object') { | ||
// Returns a string that is postfixed to a warning about an invalid type. | ||
// For example, "undefined" or "of type array" | ||
function getPostfixForTypeWarning(value) { | ||
var type = getPreciseType(value); | ||
switch (type) { | ||
case 'array': | ||
case 'object': | ||
return 'an ' + type; | ||
case 'boolean': | ||
case 'date': | ||
case 'regexp': | ||
return 'a ' + type; | ||
default: | ||
return type; | ||
} | ||
} | ||
// Returns class name of the object, if any. | ||
@@ -693,2 +1270,3 @@ function getClassName(propValue) { | ||
ReactPropTypes.checkPropTypes = checkPropTypes; | ||
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | ||
ReactPropTypes.PropTypes = ReactPropTypes; | ||
@@ -699,245 +1277,127 @@ | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, exports) { | ||
// shim for using process in browser | ||
var process = module.exports = {}; | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
// cached from whatever global is present so that test runners that stub it | ||
// don't break things. But we need to wrap it in a try catch in case it is | ||
// wrapped in strict mode code which doesn't define any globals. It's inside a | ||
// function because try/catches deoptimize in certain engines. | ||
'use strict'; | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
var cachedSetTimeout; | ||
var cachedClearTimeout; | ||
function toObject(val) { | ||
if (val === null || val === undefined) { | ||
throw new TypeError('Object.assign cannot be called with null or undefined'); | ||
} | ||
function defaultSetTimout() { | ||
throw new Error('setTimeout has not been defined'); | ||
return Object(val); | ||
} | ||
function defaultClearTimeout () { | ||
throw new Error('clearTimeout has not been defined'); | ||
} | ||
(function () { | ||
try { | ||
if (typeof setTimeout === 'function') { | ||
cachedSetTimeout = setTimeout; | ||
} else { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
} catch (e) { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
try { | ||
if (typeof clearTimeout === 'function') { | ||
cachedClearTimeout = clearTimeout; | ||
} else { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} catch (e) { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} ()) | ||
function runTimeout(fun) { | ||
if (cachedSetTimeout === setTimeout) { | ||
//normal enviroments in sane situations | ||
return setTimeout(fun, 0); | ||
} | ||
// if setTimeout wasn't available but was latter defined | ||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | ||
cachedSetTimeout = setTimeout; | ||
return setTimeout(fun, 0); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedSetTimeout(fun, 0); | ||
} catch(e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedSetTimeout.call(null, fun, 0); | ||
} catch(e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | ||
return cachedSetTimeout.call(this, fun, 0); | ||
} | ||
} | ||
function shouldUseNative() { | ||
try { | ||
if (!Object.assign) { | ||
return false; | ||
} | ||
} | ||
function runClearTimeout(marker) { | ||
if (cachedClearTimeout === clearTimeout) { | ||
//normal enviroments in sane situations | ||
return clearTimeout(marker); | ||
} | ||
// if clearTimeout wasn't available but was latter defined | ||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | ||
cachedClearTimeout = clearTimeout; | ||
return clearTimeout(marker); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedClearTimeout(marker); | ||
} catch (e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedClearTimeout.call(null, marker); | ||
} catch (e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | ||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | ||
return cachedClearTimeout.call(this, marker); | ||
} | ||
} | ||
// Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | ||
test1[5] = 'de'; | ||
if (Object.getOwnPropertyNames(test1)[0] === '5') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test2 = {}; | ||
for (var i = 0; i < 10; i++) { | ||
test2['_' + String.fromCharCode(i)] = i; | ||
} | ||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | ||
return test2[n]; | ||
}); | ||
if (order2.join('') !== '0123456789') { | ||
return false; | ||
} | ||
} | ||
var queue = []; | ||
var draining = false; | ||
var currentQueue; | ||
var queueIndex = -1; | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
test3[letter] = letter; | ||
}); | ||
if (Object.keys(Object.assign({}, test3)).join('') !== | ||
'abcdefghijklmnopqrst') { | ||
return false; | ||
} | ||
function cleanUpNextTick() { | ||
if (!draining || !currentQueue) { | ||
return; | ||
} | ||
draining = false; | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
} else { | ||
queueIndex = -1; | ||
} | ||
if (queue.length) { | ||
drainQueue(); | ||
} | ||
return true; | ||
} catch (err) { | ||
// We don't expect any of the above to throw, but better to be safe. | ||
return false; | ||
} | ||
} | ||
function drainQueue() { | ||
if (draining) { | ||
return; | ||
} | ||
var timeout = runTimeout(cleanUpNextTick); | ||
draining = true; | ||
module.exports = shouldUseNative() ? Object.assign : function (target, source) { | ||
var from; | ||
var to = toObject(target); | ||
var symbols; | ||
var len = queue.length; | ||
while(len) { | ||
currentQueue = queue; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
if (currentQueue) { | ||
currentQueue[queueIndex].run(); | ||
} | ||
} | ||
queueIndex = -1; | ||
len = queue.length; | ||
} | ||
currentQueue = null; | ||
draining = false; | ||
runClearTimeout(timeout); | ||
} | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
process.nextTick = function (fun) { | ||
var args = new Array(arguments.length - 1); | ||
if (arguments.length > 1) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
queue.push(new Item(fun, args)); | ||
if (queue.length === 1 && !draining) { | ||
runTimeout(drainQueue); | ||
} | ||
}; | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
// v8 likes predictible objects | ||
function Item(fun, array) { | ||
this.fun = fun; | ||
this.array = array; | ||
} | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
}; | ||
process.title = 'browser'; | ||
process.browser = true; | ||
process.env = {}; | ||
process.argv = []; | ||
process.version = ''; // empty string to avoid regexp issues | ||
process.versions = {}; | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
if (propIsEnumerable.call(from, symbols[i])) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
} | ||
function noop() {} | ||
process.on = noop; | ||
process.addListener = noop; | ||
process.once = noop; | ||
process.off = noop; | ||
process.removeListener = noop; | ||
process.removeAllListeners = noop; | ||
process.emit = noop; | ||
process.binding = function (name) { | ||
throw new Error('process.binding is not supported'); | ||
return to; | ||
}; | ||
process.cwd = function () { return '/' }; | ||
process.chdir = function (dir) { | ||
throw new Error('process.chdir is not supported'); | ||
}; | ||
process.umask = function() { return 0; }; | ||
/***/ }), | ||
/* 9 */ | ||
/***/ (function(module, exports) { | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports) { | ||
"use strict"; | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
function makeEmptyFunction(arg) { | ||
return function () { | ||
return arg; | ||
}; | ||
} | ||
'use strict'; | ||
/** | ||
* This function accepts and discards inputs; it has no side effects. This is | ||
* primarily useful idiomatically for overridable function endpoints which | ||
* always need to be callable, since JS lacks a null-call idiom ala Cocoa. | ||
*/ | ||
var emptyFunction = function emptyFunction() {}; | ||
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | ||
emptyFunction.thatReturns = makeEmptyFunction; | ||
emptyFunction.thatReturnsFalse = makeEmptyFunction(false); | ||
emptyFunction.thatReturnsTrue = makeEmptyFunction(true); | ||
emptyFunction.thatReturnsNull = makeEmptyFunction(null); | ||
emptyFunction.thatReturnsThis = function () { | ||
return this; | ||
}; | ||
emptyFunction.thatReturnsArgument = function (arg) { | ||
return arg; | ||
}; | ||
module.exports = ReactPropTypesSecret; | ||
module.exports = emptyFunction; | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ }), | ||
/* 10 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
@@ -947,162 +1407,24 @@ | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
var printWarning = function() {}; | ||
var validateFormat = function validateFormat(format) {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactPropTypesSecret = __webpack_require__(9); | ||
var loggedTypeFailures = {}; | ||
var has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
if (process.env.NODE_ENV !== 'production') { | ||
validateFormat = function validateFormat(format) { | ||
if (format === undefined) { | ||
throw new Error('invariant requires an error message argument'); | ||
printWarning = function(text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
} | ||
function invariant(condition, format, a, b, c, d, e, f) { | ||
validateFormat(format); | ||
if (!condition) { | ||
var error; | ||
if (format === undefined) { | ||
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); | ||
} else { | ||
var args = [a, b, c, d, e, f]; | ||
var argIndex = 0; | ||
error = new Error(format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
})); | ||
error.name = 'Invariant Violation'; | ||
} | ||
error.framesToPop = 1; // we don't care about invariant's own frame | ||
throw error; | ||
} | ||
} | ||
module.exports = invariant; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2014-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
'use strict'; | ||
var emptyFunction = __webpack_require__(5); | ||
/** | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var warning = emptyFunction; | ||
if (process.env.NODE_ENV !== 'production') { | ||
(function () { | ||
var printWarning = function printWarning(format) { | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
warning = function warning(condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
if (format.indexOf('Failed Composite propType: ') === 0) { | ||
return; // Ignore CompositeComponent proptype check. | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
printWarning.apply(undefined, [format].concat(args)); | ||
} | ||
}; | ||
})(); | ||
} | ||
module.exports = warning; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) | ||
/***/ }, | ||
/* 8 */ | ||
/***/ function(module, exports) { | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
'use strict'; | ||
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | ||
module.exports = ReactPropTypesSecret; | ||
/***/ }, | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(process) {/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
'use strict'; | ||
var invariant = __webpack_require__(6); | ||
var warning = __webpack_require__(7); | ||
var ReactPropTypesSecret = __webpack_require__(8); | ||
var loggedTypeFailures = {}; | ||
/** | ||
* Assert that the values match with the type specs. | ||
@@ -1121,3 +1443,3 @@ * Error messages are memorized and will only be shown once. | ||
for (var typeSpecName in typeSpecs) { | ||
if (typeSpecs.hasOwnProperty(typeSpecName)) { | ||
if (has(typeSpecs, typeSpecName)) { | ||
var error; | ||
@@ -1130,3 +1452,10 @@ // Prop type validation may throw. In case they do, we don't want to | ||
// behavior as without this statement except with a better message. | ||
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); | ||
if (typeof typeSpecs[typeSpecName] !== 'function') { | ||
var err = Error( | ||
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + | ||
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' | ||
); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} | ||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | ||
@@ -1136,3 +1465,12 @@ } catch (ex) { | ||
} | ||
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error) : void 0; | ||
if (error && !(error instanceof Error)) { | ||
printWarning( | ||
(componentName || 'React class') + ': type specification of ' + | ||
location + ' `' + typeSpecName + '` is invalid; the type checker ' + | ||
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + | ||
'You may have forgotten to pass an argument to the type checker ' + | ||
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + | ||
'shape all require an argument).' | ||
); | ||
} | ||
if (error instanceof Error && !(error.message in loggedTypeFailures)) { | ||
@@ -1145,3 +1483,5 @@ // Only monitor this failure once because there tends to be a lot of the | ||
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '') : void 0; | ||
printWarning( | ||
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') | ||
); | ||
} | ||
@@ -1153,15 +1493,96 @@ } | ||
/** | ||
* Resets warning cache when testing. | ||
* | ||
* @private | ||
*/ | ||
checkPropTypes.resetWarningCache = function() { | ||
if (process.env.NODE_ENV !== 'production') { | ||
loggedTypeFailures = {}; | ||
} | ||
} | ||
module.exports = checkPropTypes; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) | ||
/***/ }, | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
/***/ }), | ||
/* 11 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_10__; | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
/***/ } | ||
'use strict'; | ||
var ReactPropTypesSecret = __webpack_require__(9); | ||
function emptyFunction() {} | ||
function emptyFunctionWithReset() {} | ||
emptyFunctionWithReset.resetWarningCache = emptyFunction; | ||
module.exports = function() { | ||
function shim(props, propName, componentName, location, propFullName, secret) { | ||
if (secret === ReactPropTypesSecret) { | ||
// It is still safe when called from React. | ||
return; | ||
} | ||
var err = new Error( | ||
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + | ||
'Use PropTypes.checkPropTypes() to call them. ' + | ||
'Read more at http://fb.me/use-check-prop-types' | ||
); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
}; | ||
shim.isRequired = shim; | ||
function getShim() { | ||
return shim; | ||
}; | ||
// Important! | ||
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. | ||
var ReactPropTypes = { | ||
array: shim, | ||
bool: shim, | ||
func: shim, | ||
number: shim, | ||
object: shim, | ||
string: shim, | ||
symbol: shim, | ||
any: shim, | ||
arrayOf: getShim, | ||
element: shim, | ||
elementType: shim, | ||
instanceOf: getShim, | ||
node: shim, | ||
objectOf: getShim, | ||
oneOf: getShim, | ||
oneOfType: getShim, | ||
shape: getShim, | ||
exact: getShim, | ||
checkPropTypes: emptyFunctionWithReset, | ||
resetWarningCache: emptyFunction | ||
}; | ||
ReactPropTypes.PropTypes = ReactPropTypes; | ||
return ReactPropTypes; | ||
}; | ||
/***/ }), | ||
/* 12 */ | ||
/***/ (function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_12__; | ||
/***/ }) | ||
/******/ ]) | ||
}); | ||
; |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("js-image-zoom"),require("react")):"function"==typeof define&&define.amd?define("ReactImageZoom",["js-image-zoom","react"],n):"object"==typeof exports?exports.ReactImageZoom=n(require("js-image-zoom"),require("react")):e.ReactImageZoom=n(e.ImageZoom,e.React)}(this,function(e,n){return function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function u(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),c=t(10),f=r(c),s=t(8),l=r(s),p=t(9),d=r(p),y=function(e){function n(e){o(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.container=void 0,t.getRef=t.getRef.bind(t),t}return u(n,e),a(n,[{key:"componentDidMount",value:function(){this.imageZoom=new d.default(this.container,this.props)}},{key:"componentWillUnmount",value:function(){this.imageZoom.kill(),this.imageZoom=void 0}},{key:"componentWillReceiveProps",value:function(e){this.props!==e&&(this.kill(),this.imageZoom=new d.default(this.container,e))}},{key:"setup",value:function(){this.imageZoom.setup()}},{key:"kill",value:function(){this.imageZoom.kill()}},{key:"getRef",value:function(e){this.container=e}},{key:"render",value:function(){return f.default.createElement("div",{ref:this.getRef})}}]),n}(f.default.Component);y.propTypes={width:l.default.number.isRequired,img:l.default.string,height:l.default.number,zoomWidth:l.default.number,scale:l.default.number,offset:l.default.object,zoomStyle:l.default.string,zoomLensStyle:l.default.string},n.default=y,e.exports=n.default},function(e,n){function t(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(s===setTimeout)return setTimeout(e,0);if((s===t||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(n){try{return s.call(null,e,0)}catch(n){return s.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(n){try{return l.call(null,e)}catch(n){return l.call(this,e)}}}function u(){v&&d&&(v=!1,d.length?y=d.concat(y):m=-1,y.length&&a())}function a(){if(!v){var e=o(u);v=!0;for(var n=y.length;n;){for(d=y,y=[];++m<n;)d&&d[m].run();m=-1,n=y.length}d=null,v=!1,i(e)}}function c(e,n){this.fun=e,this.array=n}function f(){}var s,l,p=e.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:t}catch(e){s=t}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var d,y=[],v=!1,m=-1;p.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];y.push(new c(e,n)),1!==y.length||v||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=f,p.addListener=f,p.once=f,p.off=f,p.removeListener=f,p.removeAllListeners=f,p.emit=f,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,n){"use strict";var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=t},function(e,n){"use strict";function t(e){return function(){return e}}var r=function(){};r.thatReturns=t,r.thatReturnsFalse=t(!1),r.thatReturnsTrue=t(!0),r.thatReturnsNull=t(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,n,t){(function(n){"use strict";function t(e,n,t,o,i,u,a,c){if(r(n),!e){var f;if(void 0===n)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[t,o,i,u,a,c],l=0;f=new Error(n.replace(/%s/g,function(){return s[l++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}}var r=function(e){};"production"!==n.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=t}).call(n,t(1))},function(e,n,t){(function(n){"use strict";var r=t(3),o=r;"production"!==n.env.NODE_ENV&&!function(){var e=function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return t[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};o=function(n,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!n){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e.apply(void 0,[t].concat(o))}}}(),e.exports=o}).call(n,t(1))},function(e,n,t){(function(n){"use strict";function r(e,t,r,c,f){if("production"!==n.env.NODE_ENV)for(var s in e)if(e.hasOwnProperty(s)){var l;try{o("function"==typeof e[s],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,s),l=e[s](t,s,c,r,null,u)}catch(e){l=e}if("production"!==n.env.NODE_ENV?i(!l||l instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",r,s,typeof l):void 0,l instanceof Error&&!(l.message in a)){a[l.message]=!0;var p=f?f():"";"production"!==n.env.NODE_ENV?i(!1,"Failed %s type: %s%s",r,l.message,null!=p?p:""):void 0}}}var o=t(4),i=t(5),u=t(2),a={};e.exports=r}).call(n,t(1))},function(e,n,t){(function(n){"use strict";var r=t(3),o=t(4),i=t(5),u=t(2),a=t(6);e.exports=function(e){function t(e){var n=e&&(j&&e[j]||e[N]);if("function"==typeof n)return n}function c(e,n){return e===n?0!==e||1/e===1/n:e!==e&&n!==n}function f(e){this.message=e,this.stack=""}function s(e){function t(t,o,a,c,s,l,p){if(c=c||k,l=l||a,"production"!==n.env.NODE_ENV&&p!==u&&"undefined"!=typeof console){var d=c+":"+a;r[d]||("production"!==n.env.NODE_ENV?i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will not work in production with the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",l,c):void 0,r[d]=!0)}return null==o[a]?t?new f(null===o[a]?"The "+s+" `"+l+"` is marked as required "+("in `"+c+"`, but its value is `null`."):"The "+s+" `"+l+"` is marked as required in "+("`"+c+"`, but its value is `undefined`.")):null:e(o,a,c,s,l)}if("production"!==n.env.NODE_ENV)var r={};var o=t.bind(null,!1);return o.isRequired=t.bind(null,!0),o}function l(e){function n(n,t,r,o,i,u){var a=n[t],c=T(a);if(c!==e){var s=x(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return s(n)}function p(){return s(r.thatReturnsNull)}function d(e){function n(n,t,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=n[t];if(!Array.isArray(a)){var c=T(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var s=0;s<a.length;s++){var l=e(a,s,r,o,i+"["+s+"]",u);if(l instanceof Error)return l}return null}return s(n)}function y(){function n(n,t,r,o,i){var u=n[t];if(!e(u)){var a=T(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+a+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return s(n)}function v(e){function n(n,t,r,o,i){if(!(n[t]instanceof e)){var u=e.name||k,a=R(n[t]);return new f("Invalid "+o+" `"+i+"` of type "+("`"+a+"` supplied to `"+r+"`, expected ")+("instance of `"+u+"`."))}return null}return s(n)}function m(e){function t(n,t,r,o,i){for(var u=n[t],a=0;a<e.length;a++)if(c(u,e[a]))return null;var s=JSON.stringify(e);return new f("Invalid "+o+" `"+i+"` of value `"+u+"` "+("supplied to `"+r+"`, expected one of "+s+"."))}return Array.isArray(e)?s(t):("production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function h(e){function n(n,t,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=n[t],c=T(a);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an object."));for(var s in a)if(a.hasOwnProperty(s)){var l=e(a,s,r,o,i+"."+s,u);if(l instanceof Error)return l}return null}return s(n)}function g(e){function t(n,t,r,o,i){for(var a=0;a<e.length;a++){var c=e[a];if(null==c(n,t,r,o,i,u))return null}return new f("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}return Array.isArray(e)?s(t):("production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull)}function b(){function e(e,n,t,r,o){return E(e[n])?null:new f("Invalid "+r+" `"+o+"` supplied to "+("`"+t+"`, expected a ReactNode."))}return s(e)}function w(e){function n(n,t,r,o,i){var a=n[t],c=T(a);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var s in e){var l=e[s];if(l){var p=l(a,s,r,o,i+"."+s,u);if(p)return p}}return null}return s(n)}function E(n){switch(typeof n){case"number":case"string":case"undefined":return!0;case"boolean":return!n;case"object":if(Array.isArray(n))return n.every(E);if(null===n||e(n))return!0;var r=t(n);if(!r)return!1;var o,i=r.call(n);if(r!==n.entries){for(;!(o=i.next()).done;)if(!E(o.value))return!1}else for(;!(o=i.next()).done;){var u=o.value;if(u&&!E(u[1]))return!1}return!0;default:return!1}}function O(e,n){return"symbol"===e||"Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol}function T(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":O(n,e)?"symbol":n}function x(e){var n=T(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function R(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var _,j="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",k="<<anonymous>>";if("production"!==n.env.NODE_ENV)_={array:l("array"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:p(),arrayOf:d,element:y(),instanceOf:v,node:b(),objectOf:h,oneOf:m,oneOfType:g,shape:w};else{var P=function(){o(!1,"React.PropTypes type checking code is stripped in production.")};P.isRequired=P;var I=function(){return P};_={array:P,bool:P,func:P,number:P,object:P,string:P,symbol:P,any:P,arrayOf:I,element:P,instanceOf:I,node:P,objectOf:I,oneOf:I,oneOfType:I,shape:I}}return f.prototype=Error.prototype,_.checkPropTypes=a,_.PropTypes=_,_}}).call(n,t(1))},function(e,n,t){function r(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var o=t(7),i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=o(r)},function(n,t){n.exports=e},function(e,t){e.exports=n}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("js-image-zoom"),require("react")):"function"==typeof define&&define.amd?define("ReactImageZoom",["js-image-zoom","react"],t):"object"==typeof exports?exports.ReactImageZoom=t(require("js-image-zoom"),require("react")):e.ReactImageZoom=t(e.ImageZoom,e.React)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(12),f=r(c),s=n(8),l=r(s),p=n(11),y=r(p),d=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.container=void 0,n.getRef=n.getRef.bind(n),n}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.rerenderImageZoom(this.props)}},{key:"UNSAFE_componentWillUnmount",value:function(){this.imageZoom.kill(),this.imageZoom=void 0}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props!==e&&(this.kill(),this.rerenderImageZoom(e))}},{key:"rerenderImageZoom",value:function(e){this.imageZoom=new y.default(this.container,JSON.parse(JSON.stringify(e)))}},{key:"setup",value:function(){this.imageZoom.setup()}},{key:"kill",value:function(){this.imageZoom.kill()}},{key:"getRef",value:function(e){this.container=e}},{key:"render",value:function(){return f.default.createElement("div",{ref:this.getRef})}}]),t}(f.default.Component);d.propTypes={width:l.default.number.isRequired,img:l.default.string,height:l.default.number,zoomWidth:l.default.number,scale:l.default.number,offset:l.default.object,zoomStyle:l.default.string,zoomLensStyle:l.default.string},t.default=d,e.exports=t.default},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(s===setTimeout)return setTimeout(e,0);if((s===n||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){m&&y&&(m=!1,y.length?d=y.concat(d):v=-1,d.length&&u())}function u(){if(!m){var e=o(a);m=!0;for(var t=d.length;t;){for(y=d,d=[];++v<t;)y&&y[v].run();v=-1,t=d.length}y=null,m=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var s,l,p=e.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:n}catch(e){s=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var y,d=[],m=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new c(e,t)),1!==d.length||m||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=f,p.addListener=f,p.once=f,p.off=f,p.removeListener=f,p.removeAllListeners=f,p.emit=f,p.prependListener=f,p.prependOnceListener=f,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){"use strict";"production"===t.env.NODE_ENV?e.exports=n(10):e.exports=n(9)}).call(t,n(1))},function(e,t){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,u,c=n(e),f=1;f<arguments.length;f++){r=Object(arguments[f]);for(var s in r)i.call(r,s)&&(c[s]=r[s]);if(o){u=o(r);for(var l=0;l<u.length;l++)a.call(r,u[l])&&(c[u[l]]=r[u[l]])}}return c}},function(e,t,n){(function(t){"use strict";function r(e,n,r,c,f){if("production"!==t.env.NODE_ENV)for(var s in e)if(u(e,s)){var l;try{if("function"!=typeof e[s]){var p=Error((c||"React class")+": "+r+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.");throw p.name="Invariant Violation",p}l=e[s](n,s,c,r,null,i)}catch(e){l=e}if(!l||l instanceof Error||o((c||"React class")+": type specification of "+r+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in a)){a[l.message]=!0;var y=f?f():"";o("Failed "+r+" type: "+l.message+(null!=y?y:""))}}}var o=function(){};if("production"!==t.env.NODE_ENV){var i=n(2),a={},u=Function.call.bind(Object.prototype.hasOwnProperty);o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}r.resetWarningCache=function(){"production"!==t.env.NODE_ENV&&(a={})},e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";function r(){}function o(){}var i=n(2);o.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,o,a){if(a!==i){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},function(e,t,n){(function(t){"use strict";function r(){return null}var o=n(3),i=n(4),a=n(2),u=n(5),c=Function.call.bind(Object.prototype.hasOwnProperty),f=function(){};"production"!==t.env.NODE_ENV&&(f=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),e.exports=function(e,n){function s(e){var t=e&&(N&&e[N]||e[R]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function p(e){this.message=e,this.stack=""}function y(e){function r(r,u,c,s,l,y,d){if(s=s||C,y=y||c,d!==a){if(n){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var v=s+":"+c;!o[v]&&i<3&&(f("You are manually calling a React.PropTypes validation function for the `"+y+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),o[v]=!0,i++)}}return null==u[c]?r?new p(null===u[c]?"The "+l+" `"+y+"` is marked as required "+("in `"+s+"`, but its value is `null`."):"The "+l+" `"+y+"` is marked as required in "+("`"+s+"`, but its value is `undefined`.")):null:e(u,c,s,l,y)}if("production"!==t.env.NODE_ENV)var o={},i=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function d(e){function t(t,n,r,o,i,a){var u=t[n],c=P(u);if(c!==e){var f=$(u);return new p("Invalid "+o+" `"+i+"` of type "+("`"+f+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return y(t)}function m(){return y(r)}function v(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){var c=P(u);return new p("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var f=0;f<u.length;f++){var s=e(u,f,r,o,i+"["+f+"]",a);if(s instanceof Error)return s}return null}return y(t)}function b(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var u=P(a);return new p("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return y(t)}function h(){function e(e,t,n,r,i){var a=e[t];if(!o.isValidElementType(a)){var u=P(a);return new p("Invalid "+r+" `"+i+"` of type "+("`"+u+"` supplied to `"+n+"`, expected a single ReactElement type."))}return null}return y(e)}function g(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||C,u=I(t[n]);return new p("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return y(t)}function w(e){function n(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(l(a,e[u]))return null;var c=JSON.stringify(e,function(e,t){var n=$(t);return"symbol"===n?String(t):t});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}return Array.isArray(e)?y(n):("production"!==t.env.NODE_ENV&&f(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),r)}function O(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],f=P(u);if("object"!==f)return new p("Invalid "+o+" `"+i+"` of type "+("`"+f+"` supplied to `"+r+"`, expected an object."));for(var s in u)if(c(u,s)){var l=e(u,s,r,o,i+"."+s,a);if(l instanceof Error)return l}return null}return y(t)}function S(e){function n(t,n,r,o,i){for(var u=0;u<e.length;u++){var c=e[u];if(null==c(t,n,r,o,i,a))return null}return new p("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV?f("Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r;for(var o=0;o<e.length;o++){var i=e[o];if("function"!=typeof i)return f("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(i)+" at index "+o+"."),r}return y(n)}function E(){function e(e,t,n,r,o){return T(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return y(e)}function x(e){function t(t,n,r,o,i){var u=t[n],c=P(u);if("object"!==c)return new p("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var f in e){var s=e[f];if(s){var l=s(u,f,r,o,i+"."+f,a);if(l)return l}}return null}return y(t)}function j(e){function t(t,n,r,o,u){var c=t[n],f=P(c);if("object"!==f)return new p("Invalid "+o+" `"+u+"` of type `"+f+"` "+("supplied to `"+r+"`, expected `object`."));var s=i({},t[n],e);for(var l in s){var y=e[l];if(!y)return new p("Invalid "+o+" `"+u+"` key `"+l+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=y(c,l,r,o,u+"."+l,a);if(d)return d}return null}return y(t)}function T(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(T);if(null===t||e(t))return!0;var n=s(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!T(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!T(i[1]))return!1}return!0;default:return!1}}function _(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function P(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":_(t,e)?"symbol":t}function $(e){if("undefined"==typeof e||null===e)return""+e;var t=P(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function k(e){var t=$(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function I(e){return e.constructor&&e.constructor.name?e.constructor.name:C}var N="function"==typeof Symbol&&Symbol.iterator,R="@@iterator",C="<<anonymous>>",A={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:m(),arrayOf:v,element:b(),elementType:h(),instanceOf:g,node:E(),objectOf:O,oneOf:w,oneOfType:S,shape:x,exact:j};return p.prototype=Error.prototype,A.checkPropTypes=u,A.resetWarningCache=u.resetWarningCache,A.PropTypes=A,A}}).call(t,n(1))},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r=n(3),o=!0;e.exports=n(7)(r.isElement,o)}else e.exports=n(6)()}).call(t,n(1))},function(e,t,n){(function(e){"use strict";"production"!==e.env.NODE_ENV&&!function(){function e(e){return"string"==typeof e||"function"==typeof e||e===g||e===j||e===O||e===w||e===_||e===P||"object"==typeof e&&null!==e&&(e.$$typeof===k||e.$$typeof===$||e.$$typeof===S||e.$$typeof===E||e.$$typeof===T||e.$$typeof===I||e.$$typeof===N||e.$$typeof===R)}function n(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case b:var n=e.type;switch(n){case x:case j:case g:case O:case w:case _:return n;default:var r=n&&n.$$typeof;switch(r){case E:case T:case k:case $:case S:return r;default:return t}}case h:return t}}}function r(e){return G||(G=!0,M(!1,"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),o(e)||n(e)===x}function o(e){return n(e)===j}function i(e){return n(e)===E}function a(e){return n(e)===S}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===b}function c(e){return n(e)===T}function f(e){return n(e)===g}function s(e){return n(e)===k}function l(e){return n(e)===$}function p(e){return n(e)===h}function y(e){return n(e)===O}function d(e){return n(e)===w}function m(e){return n(e)===_}Object.defineProperty(t,"__esModule",{value:!0});var v="function"==typeof Symbol&&Symbol.for,b=v?Symbol.for("react.element"):60103,h=v?Symbol.for("react.portal"):60106,g=v?Symbol.for("react.fragment"):60107,w=v?Symbol.for("react.strict_mode"):60108,O=v?Symbol.for("react.profiler"):60114,S=v?Symbol.for("react.provider"):60109,E=v?Symbol.for("react.context"):60110,x=v?Symbol.for("react.async_mode"):60111,j=v?Symbol.for("react.concurrent_mode"):60111,T=v?Symbol.for("react.forward_ref"):60112,_=v?Symbol.for("react.suspense"):60113,P=v?Symbol.for("react.suspense_list"):60120,$=v?Symbol.for("react.memo"):60115,k=v?Symbol.for("react.lazy"):60116,I=v?Symbol.for("react.fundamental"):60117,N=v?Symbol.for("react.responder"):60118,R=v?Symbol.for("react.scope"):60119,C=function(){},A=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.warn(i);try{throw new Error(i)}catch(e){}};C=function(e,t){if(void 0===t)throw new Error("`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning message argument");if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];A.apply(void 0,[t].concat(r))}};var M=C,V=x,D=j,z=E,F=S,W=b,q=T,L=g,Z=k,U=$,J=h,Y=O,B=w,H=_,G=!1;t.typeOf=n,t.AsyncMode=V,t.ConcurrentMode=D,t.ContextConsumer=z,t.ContextProvider=F,t.Element=W,t.ForwardRef=q,t.Fragment=L,t.Lazy=Z,t.Memo=U,t.Portal=J,t.Profiler=Y,t.StrictMode=B,t.Suspense=H,t.isValidElementType=e,t.isAsyncMode=r,t.isConcurrentMode=o,t.isContextConsumer=i,t.isContextProvider=a,t.isElement=u,t.isForwardRef=c,t.isFragment=f,t.isLazy=s,t.isMemo=l,t.isPortal=p,t.isProfiler=y,t.isStrictMode=d,t.isSuspense=m}()}).call(t,n(1))},function(e,t){"use strict";function n(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case p:case y:case u:case f:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case h:case b:case s:return e;default:return t}}case a:return t}}}function r(e){return n(e)===y}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,a=o?Symbol.for("react.portal"):60106,u=o?Symbol.for("react.fragment"):60107,c=o?Symbol.for("react.strict_mode"):60108,f=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,l=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.async_mode"):60111,y=o?Symbol.for("react.concurrent_mode"):60111,d=o?Symbol.for("react.forward_ref"):60112,m=o?Symbol.for("react.suspense"):60113,v=o?Symbol.for("react.suspense_list"):60120,b=o?Symbol.for("react.memo"):60115,h=o?Symbol.for("react.lazy"):60116,g=o?Symbol.for("react.fundamental"):60117,w=o?Symbol.for("react.responder"):60118,O=o?Symbol.for("react.scope"):60119;t.typeOf=n,t.AsyncMode=p,t.ConcurrentMode=y,t.ContextConsumer=l,t.ContextProvider=s,t.Element=i,t.ForwardRef=d,t.Fragment=u,t.Lazy=h,t.Memo=b,t.Portal=a,t.Profiler=f,t.StrictMode=c,t.Suspense=m,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===u||e===y||e===f||e===c||e===m||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===b||e.$$typeof===s||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===w||e.$$typeof===O)},t.isAsyncMode=function(e){return r(e)||n(e)===p},t.isConcurrentMode=r,t.isContextConsumer=function(e){return n(e)===l},t.isContextProvider=function(e){return n(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return n(e)===d},t.isFragment=function(e){return n(e)===u},t.isLazy=function(e){return n(e)===h},t.isMemo=function(e){return n(e)===b},t.isPortal=function(e){return n(e)===a},t.isProfiler=function(e){return n(e)===f},t.isStrictMode=function(e){return n(e)===c},t.isSuspense=function(e){return n(e)===m}},function(t,n){t.exports=e},function(e,n){e.exports=t}])}); |
@@ -52,3 +52,3 @@ import React, { Component } from 'react'; | ||
setZoomProps = (props) => () => { | ||
this.setState({zoomProps: props}); | ||
this.setState({zoomProps: JSON.parse(JSON.stringify(props))}); | ||
}; | ||
@@ -55,0 +55,0 @@ |
122
index.js
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -30,69 +30,75 @@ | ||
var ReactImageZoom = function (_React$Component) { | ||
_inherits(ReactImageZoom, _React$Component); | ||
_inherits(ReactImageZoom, _React$Component); | ||
function ReactImageZoom(props) { | ||
_classCallCheck(this, ReactImageZoom); | ||
function ReactImageZoom(props) { | ||
_classCallCheck(this, ReactImageZoom); | ||
var _this = _possibleConstructorReturn(this, (ReactImageZoom.__proto__ || Object.getPrototypeOf(ReactImageZoom)).call(this, props)); | ||
var _this = _possibleConstructorReturn(this, (ReactImageZoom.__proto__ || Object.getPrototypeOf(ReactImageZoom)).call(this, props)); | ||
_this.container = undefined; | ||
_this.getRef = _this.getRef.bind(_this); | ||
return _this; | ||
_this.container = undefined; | ||
_this.getRef = _this.getRef.bind(_this); | ||
return _this; | ||
} | ||
_createClass(ReactImageZoom, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this.rerenderImageZoom(this.props); | ||
} | ||
}, { | ||
key: 'UNSAFE_componentWillUnmount', | ||
value: function UNSAFE_componentWillUnmount() { | ||
this.imageZoom.kill(); | ||
this.imageZoom = void 0; | ||
} | ||
}, { | ||
key: 'UNSAFE_componentWillReceiveProps', | ||
value: function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (this.props !== nextProps) { | ||
this.kill(); | ||
this.rerenderImageZoom(nextProps); | ||
} | ||
} | ||
}, { | ||
key: 'rerenderImageZoom', | ||
value: function rerenderImageZoom(props) { | ||
this.imageZoom = new _jsImageZoom2.default(this.container, JSON.parse(JSON.stringify(props))); | ||
} | ||
}, { | ||
key: 'setup', | ||
value: function setup() { | ||
this.imageZoom.setup(); | ||
} | ||
}, { | ||
key: 'kill', | ||
value: function kill() { | ||
this.imageZoom.kill(); | ||
} | ||
}, { | ||
key: 'getRef', | ||
value: function getRef(ref) { | ||
this.container = ref; | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
return _react2.default.createElement('div', { ref: this.getRef }); | ||
} | ||
}]); | ||
_createClass(ReactImageZoom, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this.imageZoom = new _jsImageZoom2.default(this.container, this.props); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
this.imageZoom.kill(); | ||
this.imageZoom = void 0; | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(nextProps) { | ||
if (this.props !== nextProps) { | ||
this.kill(); | ||
this.imageZoom = new _jsImageZoom2.default(this.container, nextProps); | ||
} | ||
} | ||
}, { | ||
key: 'setup', | ||
value: function setup() { | ||
this.imageZoom.setup(); | ||
} | ||
}, { | ||
key: 'kill', | ||
value: function kill() { | ||
this.imageZoom.kill(); | ||
} | ||
}, { | ||
key: 'getRef', | ||
value: function getRef(ref) { | ||
this.container = ref; | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
return _react2.default.createElement('div', { ref: this.getRef }); | ||
} | ||
}]); | ||
return ReactImageZoom; | ||
return ReactImageZoom; | ||
}(_react2.default.Component); | ||
ReactImageZoom.propTypes = { | ||
width: _propTypes2.default.number.isRequired, | ||
img: _propTypes2.default.string, | ||
height: _propTypes2.default.number, | ||
zoomWidth: _propTypes2.default.number, | ||
scale: _propTypes2.default.number, | ||
offset: _propTypes2.default.object, | ||
zoomStyle: _propTypes2.default.string, | ||
zoomLensStyle: _propTypes2.default.string | ||
width: _propTypes2.default.number.isRequired, | ||
img: _propTypes2.default.string, | ||
height: _propTypes2.default.number, | ||
zoomWidth: _propTypes2.default.number, | ||
scale: _propTypes2.default.number, | ||
offset: _propTypes2.default.object, | ||
zoomStyle: _propTypes2.default.string, | ||
zoomLensStyle: _propTypes2.default.string | ||
}; | ||
exports.default = ReactImageZoom; | ||
module.exports = exports['default']; |
{ | ||
"name": "react-image-zoom", | ||
"version": "0.7.0", | ||
"version": "1.1.0", | ||
"description": "react based image zoomer on mouse hover", | ||
@@ -13,4 +13,4 @@ "homepage": "https://github.com/malaman/react-image-zoom", | ||
"dependencies": { | ||
"js-image-zoom": "^0.5.0", | ||
"prop-types": "^15.5.6" | ||
"js-image-zoom": "^0.7.0", | ||
"prop-types": "^15.7.2" | ||
}, | ||
@@ -20,3 +20,3 @@ "devDependencies": { | ||
"babel-core": "^6.7.4", | ||
"babel-eslint": "^6.0.2", | ||
"babel-eslint": "^7.2.3", | ||
"babel-jest": "^22.1.0", | ||
@@ -32,9 +32,14 @@ "babel-loader": "^6.2.4", | ||
"browserify": "^13.0.0", | ||
"eslint": "^2.6.0", | ||
"eslint-config-airbnb": "^6.2.0", | ||
"eslint-loader": "^1.3.0", | ||
"eslint-plugin-react": "^4.2.3", | ||
"eslint": "^6.7.2", | ||
"eslint-config-airbnb": "^18.0.1", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-loader": "^3.0.3", | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-plugin-node": "^10.0.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-react": "^7.17.0", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"jest-cli": "^22.1.2", | ||
"react": "^16.0.0", | ||
"react-dom": "^16.0.0", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-test-renderer": "^16.0.0", | ||
@@ -61,2 +66,5 @@ "uglify-js": "^2.6.2", | ||
}, | ||
"jest": { | ||
"testURL": "http://localhost" | ||
}, | ||
"keywords": [ | ||
@@ -63,0 +71,0 @@ "react", |
@@ -6,52 +6,56 @@ import React from 'react'; | ||
class ReactImageZoom extends React.Component { | ||
static propTypes = { | ||
width: PropTypes.number.isRequired, | ||
img: PropTypes.string, | ||
height: PropTypes.number, | ||
zoomWidth: PropTypes.number, | ||
scale: PropTypes.number, | ||
offset: PropTypes.object, | ||
zoomStyle: PropTypes.string, | ||
zoomLensStyle: PropTypes.string, | ||
}; | ||
constructor(props) { | ||
super(props); | ||
this.container = undefined; | ||
this.getRef = this.getRef.bind(this); | ||
} | ||
constructor(props) { | ||
super(props); | ||
this.container = undefined; | ||
this.getRef = this.getRef.bind(this); | ||
} | ||
componentDidMount() { | ||
this.rerenderImageZoom(this.props); | ||
} | ||
componentDidMount() { | ||
this.imageZoom = new ImageZoom(this.container, this.props); | ||
} | ||
UNSAFE_componentWillUnmount() { | ||
this.imageZoom.kill(); | ||
this.imageZoom = void 0; | ||
} | ||
componentWillUnmount() { | ||
this.imageZoom.kill(); | ||
this.imageZoom = void 0; | ||
UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (this.props !== nextProps) { | ||
this.kill(); | ||
this.rerenderImageZoom(nextProps); | ||
} | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
if (this.props !== nextProps) { | ||
this.kill(); | ||
this.imageZoom = new ImageZoom(this.container, nextProps); | ||
} | ||
} | ||
rerenderImageZoom(props) { | ||
this.imageZoom = new ImageZoom(this.container, JSON.parse(JSON.stringify(props))); | ||
} | ||
setup() { | ||
this.imageZoom.setup(); | ||
} | ||
setup() { | ||
this.imageZoom.setup(); | ||
} | ||
kill() { | ||
this.imageZoom.kill(); | ||
} | ||
kill() { | ||
this.imageZoom.kill(); | ||
} | ||
getRef(ref) { | ||
this.container = ref; | ||
} | ||
getRef(ref) { | ||
this.container = ref; | ||
} | ||
render() { | ||
return <div ref={this.getRef} />; | ||
} | ||
render() { | ||
return <div ref={this.getRef}/>; | ||
} | ||
} | ||
ReactImageZoom.propTypes = { | ||
width: PropTypes.number.isRequired, | ||
img: PropTypes.string, | ||
height: PropTypes.number, | ||
zoomWidth: PropTypes.number, | ||
scale: PropTypes.number, | ||
offset: PropTypes.object, | ||
zoomStyle: PropTypes.string, | ||
zoomLensStyle: PropTypes.string, | ||
}; | ||
export default ReactImageZoom; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3422
2
844074
29
18
+ Addedjs-image-zoom@0.7.0(transitive)
- Removedjs-image-zoom@0.5.0(transitive)
Updatedjs-image-zoom@^0.7.0
Updatedprop-types@^15.7.2