Socket
Socket
Sign inDemoInstall

react-photo-gallery

Package Overview
Dependencies
21
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.0 to 6.0.1

.publish/app.js

2

dist/react-photo-gallery.min.js

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Gallery=e()}}(function(){var e;return function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],2:[function(e,t,n){(function(e){"use strict";function n(e,t,n,o,i,a,u,s){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,o,i,a,u,s],l=0;c=new Error(t.replace(/%s/g,function(){return f[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var r=function(e){};"production"!==e.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),t.exports=n}).call(this,e("_process"))},{_process:4}],3:[function(e,t,n){(function(n){"use strict";var r=e("./emptyFunction"),o=r;if("production"!==n.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=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.error(i);try{throw new Error(i)}catch(a){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}t.exports=o}).call(this,e("_process"))},{"./emptyFunction":1,_process:4}],4:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){v&&h&&(v=!1,h.length?y=h.concat(y):b=-1,y.length&&s())}function s(){if(!v){var e=i(u);v=!0;for(var t=y.length;t;){for(h=y,y=[];++b<t;)h&&h[b].run();b=-1,t=y.length}h=null,v=!1,a(e)}}function c(e,t){this.fun=e,this.array=t}function f(){}var l,p,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var h,y=[],v=!1,b=-1;d.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];y.push(new c(e,t)),1!==y.length||v||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.prependListener=f,d.prependOnceListener=f,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],5:[function(e,t,n){(function(n){"use strict";function r(e,t,r,s,c){if("production"!==n.env.NODE_ENV)for(var f in e)if(e.hasOwnProperty(f)){var l;try{o("function"==typeof e[f],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",s||"React class",r,f),l=e[f](t,f,s,r,null,a)}catch(p){l=p}if(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).",s||"React class",r,f,typeof l),l instanceof Error&&!(l.message in u)){u[l.message]=!0;var d=c?c():"";i(!1,"Failed %s type: %s%s",r,l.message,null!=d?d:"")}}}if("production"!==n.env.NODE_ENV)var o=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning"),a=e("./lib/ReactPropTypesSecret"),u={};t.exports=r}).call(this,e("_process"))},{"./lib/ReactPropTypesSecret":9,_process:4,"fbjs/lib/invariant":2,"fbjs/lib/warning":3}],6:[function(e,t,n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),i=e("./lib/ReactPropTypesSecret");t.exports=function(){function e(e,t,n,r,a,u){u!==i&&o(!1,"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")}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,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},{"./lib/ReactPropTypesSecret":9,"fbjs/lib/emptyFunction":1,"fbjs/lib/invariant":2}],7:[function(e,t,n){(function(n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning"),a=e("./lib/ReactPropTypesSecret"),u=e("./checkPropTypes");t.exports=function(e,t){function s(e){var t=e&&(P&&e[P]||e[k]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function f(e){this.message=e,this.stack=""}function l(e){function r(r,c,l,p,d,h,y){if(p=p||A,h=h||l,y!==a)if(t)o(!1,"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");else if("production"!==n.env.NODE_ENV&&"undefined"!=typeof console){var v=p+":"+l;!u[v]&&s<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` 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.",h,p),u[v]=!0,s++)}return null==c[l]?r?new f(null===c[l]?"The "+d+" `"+h+"` is marked as required "+("in `"+p+"`, but its value is `null`."):"The "+d+" `"+h+"` is marked as required in "+("`"+p+"`, but its value is `undefined`.")):null:e(c,l,p,d,h)}if("production"!==n.env.NODE_ENV)var u={},s=0;var c=r.bind(null,!1);return c.isRequired=r.bind(null,!0),c}function p(e){function t(t,n,r,o,i,a){var u=t[n],s=T(u);if(s!==e){var c=R(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return l(t)}function d(){return l(r.thatReturnsNull)}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){var s=T(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var c=0;c<u.length;c++){var l=e(u,c,r,o,i+"["+c+"]",a);if(l instanceof Error)return l}return null}return l(t)}function y(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var u=T(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return l(t)}function v(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||A,u=x(t[n]);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return l(t)}function b(e){function t(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(c(a,e[u]))return null;var s=JSON.stringify(e);return new f("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+s+"."))}return Array.isArray(e)?l(t):("production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],s=T(u);if("object"!==s)return new f("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an object."));for(var c in u)if(u.hasOwnProperty(c)){var l=e(u,c,r,o,i+"."+c,a);if(l instanceof Error)return l}return null}return l(t)}function g(e){function t(t,n,r,o,i){for(var u=0;u<e.length;u++){var s=e[u];if(null==s(t,n,r,o,i,a))return null}return new f("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var u=e[o];if("function"!=typeof u)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",j(u),o),r.thatReturnsNull}return l(t)}function _(){function e(e,t,n,r,o){return O(e[t])?null:new f("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return l(e)}function w(e){function t(t,n,r,o,i){var u=t[n],s=T(u);if("object"!==s)return new f("Invalid "+o+" `"+i+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."));for(var c in e){var l=e[c];if(l){var p=l(u,c,r,o,i+"."+c,a);if(p)return p}}return null}return l(t)}function O(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(O);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(!O(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!O(i[1]))return!1}return!0;default:return!1}}function E(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":E(t,e)?"symbol":t}function R(e){if("undefined"==typeof e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function j(e){var t=R(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function x(e){return e.constructor&&e.constructor.name?e.constructor.name:A}var P="function"==typeof Symbol&&Symbol.iterator,k="@@iterator",A="<<anonymous>>",M={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:d(),arrayOf:h,element:y(),instanceOf:v,node:_(),objectOf:m,oneOf:b,oneOfType:g,shape:w};return f.prototype=Error.prototype,M.checkPropTypes=u,M.PropTypes=M,M}}).call(this,e("_process"))},{"./checkPropTypes":5,"./lib/ReactPropTypesSecret":9,_process:4,"fbjs/lib/emptyFunction":1,"fbjs/lib/invariant":2,"fbjs/lib/warning":3}],8:[function(e,t,n){(function(n){if("production"!==n.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;t.exports=e("./factoryWithTypeCheckers")(o,i)}else t.exports=e("./factoryWithThrowingShims")()}).call(this,e("_process"))},{"./factoryWithThrowingShims":6,"./factoryWithTypeCheckers":7,_process:4}],9:[function(e,t,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},{}],10:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.measure,n=e.measureRef,r=e.contentRect,o=e.children;return o({measure:t,measureRef:n,contentRect:r})}Object.defineProperty(n,"__esModule",{value:!0});var i=e("react"),a=(r(i),e("./with-content-rect")),u=r(a);n["default"]=(0,u["default"])()(o),t.exports=n["default"]},{"./with-content-rect":14,react:void 0}],11:[function(e,t,n){"use strict";function r(e,t){var n={};if(t.indexOf("client")>-1&&(n.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf("offset")>-1&&(n.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf("scroll")>-1&&(n.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf("bounds")>-1){var r=e.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(t.indexOf("margin")>-1){var o=getComputedStyle(e);n.margin={top:parseInt(o.marginTop),right:parseInt(o.marginRight),bottom:parseInt(o.marginBottom),left:parseInt(o.marginLeft)}}return n}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r,t.exports=n["default"]},{}],12:[function(e,t,n){"use strict";function r(e){var t=[];return o.forEach(function(n){e[n]&&t.push(n)}),t}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r;var o=["client","offset","scroll","bounds","margin"];t.exports=n["default"]},{}],13:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0}),n.withContentRect=n["default"]=void 0;var o=e("./Measure"),i=r(o),a=e("./with-content-rect"),u=r(a);n["default"]=i["default"],n.withContentRect=u["default"]},{"./Measure":10,"./with-content-rect":14}],14:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 u(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)}function s(e){return function(t){var n,r;return r=n=function(n){function r(){var t,n,o,u;i(this,r);for(var s=arguments.length,c=Array(s),f=0;f<s;f++)c[f]=arguments[f];return n=o=a(this,(t=r.__proto__||Object.getPrototypeOf(r)).call.apply(t,[this].concat(c))),o.state={contentRect:{entry:{},client:{},offset:{},scroll:{},bounds:{},margin:{}}},o.measure=function(t){var n=(0,g["default"])(o._node,e||(0,b["default"])(o.props));t&&(n.entry=t[0].contentRect),o.setState({contentRect:n}),"function"==typeof o.props.onResize&&o.props.onResize(n)},o._handleRef=function(e){o._resizeObserver&&(e?o._resizeObserver.observe(e):o._resizeObserver.disconnect(o._node)),o._node=e,"function"==typeof o.props.innerRef&&o.props.innerRef(e)},u=n,a(o,u)}return u(r,n),f(r,[{key:"componentWillMount",value:function(){this._resizeObserver=new y["default"](this.measure)}},{key:"render",value:function(){var e=this.props,n=(e.innerRef,e.onResize,o(e,["innerRef","onResize"]));return(0,l.createElement)(t,c({},n,{measureRef:this._handleRef,measure:this.measure,contentRect:this.state.contentRect}))}}]),r}(l.Component),n.propTypes={client:d["default"].bool,offset:d["default"].bool,scroll:d["default"].bool,bounds:d["default"].bool,margin:d["default"].bool,innerRef:d["default"].func,onResize:d["default"].func,children:d["default"].func},r}}Object.defineProperty(n,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=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}}(),l=e("react"),p=(r(l),e("prop-types")),d=r(p),h=e("resize-observer-polyfill"),y=r(h),v=e("./get-types"),b=r(v),m=e("./get-content-rect"),g=r(m);n["default"]=s,t.exports=n["default"]},{"./get-content-rect":11,"./get-types":12,"prop-types":8,react:void 0,"resize-observer-polyfill":15}],15:[function(t,n,r){!function(t,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o():"function"==typeof e&&e.amd?e(o):t.ResizeObserver=o()}(this,function(){"use strict";function e(e){return parseFloat(e)||0}function t(t){var n=Array.prototype.slice.call(arguments,1);return n.reduce(function(n,r){var o=t["border-"+r+"-width"];return n+e(o)},0)}function n(t){for(var n=["top","right","bottom","left"],r={},o=0,i=n;o<i.length;o+=1){var a=i[o],u=t["padding-"+a];r[a]=e(u)}return r}function r(e){var t=e.getBBox();return s(0,0,t.width,t.height)}function o(r){var o=r.clientWidth,a=r.clientHeight;if(!o&&!a)return _;var u=getComputedStyle(r),c=n(u),f=c.left+c.right,l=c.top+c.bottom,p=e(u.width),d=e(u.height);if("border-box"===u.boxSizing&&(Math.round(p+f)!==o&&(p-=t(u,"left","right")+f),Math.round(d+l)!==a&&(d-=t(u,"top","bottom")+l)),!i(r)){var h=Math.round(p+f)-o,y=Math.round(d+l)-a;1!==Math.abs(h)&&(p-=h),1!==Math.abs(y)&&(d-=y)}return s(c.left,c.top,p,d)}function i(e){return e===document.documentElement}function a(e){return f?w(e)?r(e):o(e):_}function u(e){var t=e.x,n=e.y,r=e.width,o=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(i.prototype);return g(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function s(e,t,n,r){return{x:e,y:t,width:n,height:r}}var c=function(){function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return"undefined"!=typeof Map?Map:function(){function t(){this.__entries__=[]}var n={size:{}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype["delete"]=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var o=r[n];e.call(t,o[1],o[0])}},Object.defineProperties(t.prototype,n),t}()}(),f="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,l=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame:function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),p=2,d=function(e,t){function n(){i&&(i=!1,e()),a&&o()}function r(){l(n)}function o(){var e=Date.now();if(i){if(e-u<p)return;a=!0}else i=!0,a=!1,setTimeout(r,t);u=e}var i=!1,a=!1,u=0;return o},h=20,y=["top","right","bottom","left","width","height","size","weight"],v="undefined"!=typeof navigator&&/Trident\/.*rv:11/.test(navigator.userAgent),b="undefined"!=typeof MutationObserver&&!v,m=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=d(this.refresh.bind(this),h)};m.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},m.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},m.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},m.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},m.prototype.connect_=function(){f&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),b?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},m.prototype.disconnect_=function(){f&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},m.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=y.some(function(e){return!!~t.indexOf(e)});n&&this.refresh()},m.getInstance=function(){return this.instance_||(this.instance_=new m),this.instance_},m.instance_=null;var g=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},_=s(0,0,0,0),w=function(){return"undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof SVGGraphicsElement}:function(e){return e instanceof SVGElement&&"function"==typeof e.getBBox}}(),O=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=s(0,0,0,0),this.target=e};O.prototype.isActive=function(){var e=a(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},O.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var E=function(e,t){var n=u(t);g(this,{target:e,contentRect:n})},T=function(e,t,n){if("function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.activeObservations_=[],this.observations_=new c,this.callback_=e,this.controller_=t,this.callbackCtx_=n};T.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new O(e)),this.controller_.addObserver(this),this.controller_.refresh())}},T.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t["delete"](e),t.size||this.controller_.removeObserver(this))}},T.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},T.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},T.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new E(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},T.prototype.clearActive=function(){this.activeObservations_.splice(0)},T.prototype.hasActive=function(){return this.activeObservations_.length>0};var R="undefined"!=typeof WeakMap?new WeakMap:new c,j=function(e){if(!(this instanceof j))throw new TypeError("Cannot call a class as a function");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=m.getInstance(),n=new T(e,t,this);R.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){j.prototype[e]=function(){return(t=R.get(this))[e].apply(t,arguments);var t}});var x=function(){return"undefined"!=typeof ResizeObserver?ResizeObserver:j}();return x})},{}],16:[function(e,t,n){(function(r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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(n,"__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}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return;e=c,t=i,n=a,r=!0,u=c=void 0}},c="undefined"!=typeof window?window.React:"undefined"!=typeof r?r.React:null,f=o(c),l=e("prop-types"),p=o(l),d=(e("react-measure"),e("./Photo")),h=o(d),y=e("./utils"),v=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.state={containerWidth:0},this.handleResize=this.handleResize.bind(this),this.handleClick=this.handleClick.bind(this)}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.setState({containerWidth:Math.floor(this._gallery.clientWidth)}),window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(){this._gallery.clientWidth!==this.state.containerWidth&&this.setState({containerWidth:Math.floor(this._gallery.clientWidth)})}},{key:"shouldComponentUpdate",value:function(){return!0}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize,!1)}},{key:"handleResize",value:function(e){this.setState({containerWidth:Math.floor(this._gallery.clientWidth)})}},{key:"handleClick",value:function(e,t){var n=t.index,r=this.props,o=r.photos,i=r.onClick;i(e,{index:n,photo:o[n],previous:o[n-1]||null,next:o[n+1]||null})}},{key:"render",value:function(){var e=this,t=this.props.ImageComponent,n=void 0===t?h["default"]:t,r=this.state.containerWidth-1,o=this.props,i=o.photos,a=o.columns,u=o.margin,s=o.onClick,c=(0,y.computeSizes)({width:r,columns:a,margin:u,photos:i});return f["default"].createElement("div",{className:"react-photo-gallery--gallery"},f["default"].createElement("div",{ref:function(t){return e._gallery=t}},c.map(function(t,r){t.width,t.height;return f["default"].createElement(n,{key:t.key||t.src,margin:u,index:r,photo:t,onClick:s?e.handleClick:null})})),f["default"].createElement("div",{style:{content:"",display:"table",clear:"both"}}))}}]),t}(c.PureComponent);v.propTypes={photos:p["default"].arrayOf(d.photoPropType).isRequired,onClick:p["default"].func,columns:p["default"].number,margin:p["default"].number,ImageComponent:p["default"].func},v.defaultProps={columns:3,margin:2},n["default"]=v,t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Photo":17,"./utils":18,"prop-types":8,"react-measure":13}],17:[function(e,t,n){(function(t){"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("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(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return;e=c,t=i,n=a,r=!0,u=c=void 0}},c="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,f=r(c),l=e("prop-types"),p=r(l),d={display:"block","float":"left"},h={cursor:"pointer"},y=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.handleClick=this.handleClick.bind(this)}return i(t,e),u(t,[{key:"handleClick",value:function(e){var t=this.props,n=t.onClick,r=t.index,o=t.photo;n(e,{photo:o,index:r})}},{key:"render",value:function(){var e=this.props,t=e.photo,n=e.onClick,r=e.margin;return d.margin=r,f["default"].createElement("img",a({style:n?a({},d,h):d},t,{onClick:n?this.handleClick:null}))}}]),t}(c.PureComponent),v=p["default"].shape({src:p["default"].string.isRequired,width:p["default"].number.isRequired,height:p["default"].number.isRequired,alt:p["default"].string,title:p["default"].string,srcSet:p["default"].array,sizes:p["default"].array});n.photoPropType=v,y.propTypes={index:p["default"].number,onClick:p["default"].func,photo:v},n["default"]=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"prop-types":8}],18:[function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e){var t=e.width,n=e.height;return t/n}function i(e){var t=e.photos,n=e.columns,i=e.width,u=e.margin;if(!i)return[];var s=t.reduce(function(e,t,o){var i=Math.floor(o/n);return e[i]=e[i]?[].concat(r(e[i]),[t]):[t],e},[]),c=s.length-1,f=s.map(function(e,t){var r=e.reduce(function(e,t){return e+o(t)},0),s=i-e.length*(2*u),f=t!==c||e.length>1?s/r:s/n/r;return e.map(function(e){return a({},e,{height:f,width:f*o(e)})})});return f.reduce(function(e,t){return[].concat(r(e),r(t))},[])}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.ratio=o,n.computeSizes=i},{}]},{},[16])(16)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Gallery=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};t[a][0].call(f.exports,function(e){var n=t[a][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],2:[function(e,t,n){(function(e){"use strict";function n(e,t,n,o,i,a,u,c){if(r(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,o,i,a,u,c],s=0;l=new Error(t.replace(/%s/g,function(){return f[s++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var r=function(e){};"production"!==e.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),t.exports=n}).call(this,e("_process"))},{_process:4}],3:[function(e,t,n){(function(n){"use strict";var r=e("./emptyFunction"),o=r;if("production"!==n.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=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.error(i);try{throw new Error(i)}catch(a){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}t.exports=o}).call(this,e("_process"))},{"./emptyFunction":1,_process:4}],4:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(s===setTimeout)return setTimeout(e,0);if((s===r||!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 a(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){v&&y&&(v=!1,y.length?h=y.concat(h):b=-1,h.length&&c())}function c(){if(!v){var e=i(u);v=!0;for(var t=h.length;t;){for(y=h,h=[];++b<t;)y&&y[b].run();b=-1,t=h.length}y=null,v=!1,a(e)}}function l(e,t){this.fun=e,this.array=t}function f(){}var s,p,d=t.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:r}catch(e){s=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var y,h=[],v=!1,b=-1;d.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];h.push(new l(e,t)),1!==h.length||v||i(c)},l.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.prependListener=f,d.prependOnceListener=f,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],5:[function(e,t,n){(function(n){"use strict";function r(e,t,r,c,l){if("production"!==n.env.NODE_ENV)for(var f in e)if(e.hasOwnProperty(f)){var s;try{o("function"==typeof e[f],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,f),s=e[f](t,f,c,r,null,a)}catch(p){s=p}if(i(!s||s 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,f,typeof s),s instanceof Error&&!(s.message in u)){u[s.message]=!0;var d=l?l():"";i(!1,"Failed %s type: %s%s",r,s.message,null!=d?d:"")}}}if("production"!==n.env.NODE_ENV)var o=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning"),a=e("./lib/ReactPropTypesSecret"),u={};t.exports=r}).call(this,e("_process"))},{"./lib/ReactPropTypesSecret":9,_process:4,"fbjs/lib/invariant":2,"fbjs/lib/warning":3}],6:[function(e,t,n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),i=e("./lib/ReactPropTypesSecret");t.exports=function(){function e(e,t,n,r,a,u){u!==i&&o(!1,"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")}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,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},{"./lib/ReactPropTypesSecret":9,"fbjs/lib/emptyFunction":1,"fbjs/lib/invariant":2}],7:[function(e,t,n){(function(n){"use strict";var r=e("fbjs/lib/emptyFunction"),o=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning"),a=e("./lib/ReactPropTypesSecret"),u=e("./checkPropTypes");t.exports=function(e,t){function c(e){var t=e&&(x&&e[x]||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 f(e){this.message=e,this.stack=""}function s(e){function r(r,l,s,p,d,y,h){if(p=p||S,y=y||s,h!==a)if(t)o(!1,"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");else if("production"!==n.env.NODE_ENV&&"undefined"!=typeof console){var v=p+":"+s;!u[v]&&c<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` 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.",y,p),u[v]=!0,c++)}return null==l[s]?r?new f(null===l[s]?"The "+d+" `"+y+"` is marked as required "+("in `"+p+"`, but its value is `null`."):"The "+d+" `"+y+"` is marked as required in "+("`"+p+"`, but its value is `undefined`.")):null:e(l,s,p,d,y)}if("production"!==n.env.NODE_ENV)var u={},c=0;var l=r.bind(null,!1);return l.isRequired=r.bind(null,!0),l}function p(e){function t(t,n,r,o,i,a){var u=t[n],c=P(u);if(c!==e){var l=_(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+l+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return s(t)}function d(){return s(r.thatReturnsNull)}function y(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("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 f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<u.length;l++){var s=e(u,l,r,o,i+"["+l+"]",a);if(s instanceof Error)return s}return null}return s(t)}function h(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var u=P(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return s(t)}function v(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||S,u=k(t[n]);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return s(t)}function b(e){function t(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);return new f("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}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 m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],c=P(u);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an object."));for(var l in u)if(u.hasOwnProperty(l)){var s=e(u,l,r,o,i+"."+l,a);if(s instanceof Error)return s}return null}return s(t)}function g(e){function t(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 f("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var u=e[o];if("function"!=typeof u)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",j(u),o),r.thatReturnsNull}return s(t)}function w(){function e(e,t,n,r,o){return T(e[t])?null:new f("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return s(e)}function O(e){function t(t,n,r,o,i){var u=t[n],c=P(u);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var s=e[l];if(s){var p=s(u,l,r,o,i+"."+l,a);if(p)return p}}return null}return s(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=c(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(e,t){return"symbol"===e||("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":E(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 j(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 k(e){return e.constructor&&e.constructor.name?e.constructor.name:S}var x="function"==typeof Symbol&&Symbol.iterator,R="@@iterator",S="<<anonymous>>",C={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:d(),arrayOf:y,element:h(),instanceOf:v,node:w(),objectOf:m,oneOf:b,oneOfType:g,shape:O};return f.prototype=Error.prototype,C.checkPropTypes=u,C.PropTypes=C,C}}).call(this,e("_process"))},{"./checkPropTypes":5,"./lib/ReactPropTypesSecret":9,_process:4,"fbjs/lib/emptyFunction":1,"fbjs/lib/invariant":2,"fbjs/lib/warning":3}],8:[function(e,t,n){(function(n){if("production"!==n.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;t.exports=e("./factoryWithTypeCheckers")(o,i)}else t.exports=e("./factoryWithThrowingShims")()}).call(this,e("_process"))},{"./factoryWithThrowingShims":6,"./factoryWithTypeCheckers":7,_process:4}],9:[function(e,t,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r},{}],10:[function(e,t,n){(function(r){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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(n,"__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=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var c=u.get;if(void 0===c)return;return c.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return;e=l,t=i,n=a,r=!0,u=l=void 0}},l="undefined"!=typeof window?window.React:"undefined"!=typeof r?r.React:null,f=o(l),s=e("prop-types"),p=o(s),d=e("./Photo"),y=o(d),h=e("./utils"),v=function(e){function t(){i(this,t),c(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.state={containerWidth:0},this.handleResize=this.handleResize.bind(this),this.handleClick=this.handleClick.bind(this)}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.setState({containerWidth:Math.floor(this._gallery.clientWidth)}),window.addEventListener("resize",this.handleResize)}},{key:"componentDidUpdate",value:function(){this._gallery.clientWidth!==this.state.containerWidth&&this.setState({containerWidth:Math.floor(this._gallery.clientWidth)})}},{key:"shouldComponentUpdate",value:function(){return!0}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize,!1)}},{key:"handleResize",value:function(e){this.setState({containerWidth:Math.floor(this._gallery.clientWidth)})}},{key:"handleClick",value:function(e,t){var n=t.index,r=this.props,o=r.photos,i=r.onClick;i(e,{index:n,photo:o[n],previous:o[n-1]||null,next:o[n+1]||null})}},{key:"render",value:function(){var e=this,t=this.props.ImageComponent,n=void 0===t?y["default"]:t,r=this.state.containerWidth-1,o=this.props,i=o.photos,a=o.columns,u=o.margin,c=o.onClick,l=(0,h.computeSizes)({width:r,columns:a,margin:u,photos:i});return f["default"].createElement("div",{className:"react-photo-gallery--gallery"},f["default"].createElement("div",{ref:function(t){return e._gallery=t}},l.map(function(t,r){t.width,t.height;return f["default"].createElement(n,{key:t.key||t.src,margin:u,index:r,photo:t,onClick:c?e.handleClick:null})})),f["default"].createElement("div",{style:{content:"",display:"table",clear:"both"}}))}}]),t}(l.PureComponent);v.propTypes={photos:p["default"].arrayOf(d.photoPropType).isRequired,onClick:p["default"].func,columns:p["default"].number,margin:p["default"].number,ImageComponent:p["default"].func},v.defaultProps={columns:3,margin:2},n["default"]=v,t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Photo":11,"./utils":12,"prop-types":8}],11:[function(e,t,n){(function(t){"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("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(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var c=u.get;if(void 0===c)return;return c.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return;e=l,t=i,n=a,r=!0,u=l=void 0}},l="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,f=r(l),s=e("prop-types"),p=r(s),d={display:"block","float":"left"},y={cursor:"pointer"},h=function(e){function t(){o(this,t),c(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.handleClick=this.handleClick.bind(this)}return i(t,e),u(t,[{key:"handleClick",value:function(e){var t=this.props,n=t.onClick,r=t.index,o=t.photo;n(e,{photo:o,index:r})}},{key:"render",value:function(){var e=this.props,t=e.photo,n=e.onClick,r=e.margin;return d.margin=r,f["default"].createElement("img",a({style:n?a({},d,y):d},t,{onClick:n?this.handleClick:null}))}}]),t}(l.PureComponent),v=p["default"].shape({src:p["default"].string.isRequired,width:p["default"].number.isRequired,height:p["default"].number.isRequired,alt:p["default"].string,title:p["default"].string,srcSet:p["default"].array,sizes:p["default"].array});n.photoPropType=v,h.propTypes={index:p["default"].number,onClick:p["default"].func,photo:v},n["default"]=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"prop-types":8}],12:[function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e){var t=e.width,n=e.height;return t/n}function i(e){var t=e.photos,n=e.columns,i=e.width,u=e.margin;if(!i)return[];var c=t.reduce(function(e,t,o){var i=Math.floor(o/n);return e[i]=e[i]?[].concat(r(e[i]),[t]):[t],e},[]),l=c.length-1,f=c.map(function(e,t){var r=e.reduce(function(e,t){return e+o(t)},0),c=i-e.length*(2*u),f=t!==l||e.length>1?c/r:c/n/r;return e.map(function(e){return a({},e,{height:f,width:f*o(e)})})});return f.reduce(function(e,t){return[].concat(r(e),r(t))},[])}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.ratio=o,n.computeSizes=i},{}]},{},[10])(10)});

@@ -25,3 +25,3 @@ import React from 'react';

format: 'json',
per_page: '17',
per_page: '18',
extras: 'url_m,url_c,url_l,url_h,url_o',

@@ -82,4 +82,4 @@ };

<ExampleBasic columns={columns} photos={this.state.photos.slice(0,6)} />
<ExampleWithLightbox columns={columns} photos={this.state.photos.slice(6,11)} />
<ExampleCustomComponentSelection columns={columns} photos={this.state.photos.slice(11,17)} />
<ExampleWithLightbox columns={columns} photos={this.state.photos.slice(6,12)} />
<ExampleCustomComponentSelection columns={columns} photos={this.state.photos.slice(12,18)} />
</div>

@@ -86,0 +86,0 @@ }

@@ -42,12 +42,12 @@ import React from 'react';

<Gallery photos={this.props.photos} columns={this.props.columns} onClick={this.openLightbox}/>
<Lightbox
theme={{ container: { background: 'rgba(0, 0, 0, 0.85)' } }}
images={this.props.photos.map(x => ({ ...x, srcset: x.srcSet, caption: x.title }))}
backdropClosesModal={true}
onClose={this.closeLightbox}
onClickPrev={this.gotoPrevious}
onClickNext={this.gotoNext}
currentImage={this.state.currentImage}
isOpen={this.state.lightboxIsOpen}
width={1600}
<Lightbox
theme={{ container: { background: 'rgba(0, 0, 0, 0.85)' } }}
images={this.props.photos.map(x => ({ ...x, srcset: x.srcSet, caption: x.title }))}
backdropClosesModal={true}
onClose={this.closeLightbox}
onClickPrev={this.gotoPrevious}
onClickNext={this.gotoNext}
currentImage={this.state.currentImage}
isOpen={this.state.lightboxIsOpen}
width={1600}
/>

@@ -54,0 +54,0 @@ </div>

import React from 'react';
const imgStyle = { display: 'block', transition: 'transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s' };
const selectedImgStyle = { transform: 'translateZ(0px) scale3d(0.9, 0.9, 1)', transition: 'transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s' };
const cont = {backgroundColor: '#eee', cursor: 'pointer', overflow: 'hidden', float: 'left'}
const imgStyle = {
display: 'block',
transition: 'transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s'
};
const selectedImgStyle = {
transform: 'translateZ(0px) scale3d(0.9, 0.9, 1)',
transition: 'transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s'
};
const cont = {
backgroundColor: '#eee',
cursor: 'pointer',
overflow: 'hidden',
float: 'left'
}

@@ -12,4 +23,7 @@ const SelectedImage = ({ index, onClick, photo, margin}) => {

selectedImgStyle.transform = `translateZ(0px) scale3d(${sx}, ${sy}, 1)`;
return (<div style={{margin, width:photo.width, ...cont}}>
return (<div style={{margin, width:photo.width, ...cont}} className={'cont' + (!photo.selected ? ' selected' : '')}>
<img style={photo.selected ? {...imgStyle, ...selectedImgStyle} : {...imgStyle}} {...photo} onClick={(e) => onClick(e, {index, photo})} />
<style>
{`.cont.selected:hover{outline:2px solid #06befa}`}
</style>
</div>

@@ -16,0 +30,0 @@ )

@@ -25,4 +25,2 @@ 'use strict';

var _reactMeasure = require('react-measure');
var _Photo = require('./Photo');

@@ -29,0 +27,0 @@

{
"name": "react-photo-gallery",
"version": "6.0.0",
"version": "6.0.1",
"description": "Responsive React Photo Gallery Component",

@@ -5,0 +5,0 @@ "main": "lib/Gallery.js",

@@ -18,3 +18,3 @@ # React Photo Gallery

## Demo
## Examples

@@ -114,3 +114,3 @@ [http://neptunian.github.io/react-photo-gallery/](http://neptunian.github.io/react-photo-gallery/)

In the demo I chose to have one object of photos that I pass in to both the Gallery component and the Lightbox component to keep the code cleaner and stateless. Stateless because I can keep the Lightbox outside of the Gallery component and the user can decide whether to use any Lightbox of their choosing or none at all. I added all the properties into this object that either component might need or that I wanted to use for customization.
Pass in an array of objects, each representing a photo, with the necessary properties outlined in the table above. Since the [Lightbox](https://github.com/jossmac/react-images) component being used in one of the demos needs a similar array, the same one is passed into it.

@@ -117,0 +117,0 @@ ### Passing in a custom image component

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { withContentRect } from 'react-measure';

@@ -5,0 +4,0 @@ import Photo, { photoPropType } from './Photo';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc