Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-responsive-masonry

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-responsive-masonry - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

10

es/Masonry/index.js

@@ -40,3 +40,5 @@ "use strict";

_react["default"].Children.forEach(children, function (child, index) {
columns[index % columnsCount].push(child);
if (child && _react["default"].isValidElement(child)) {
columns[index % columnsCount].push(child);
}
});

@@ -60,3 +62,3 @@

fileName: _jsxFileName,
lineNumber: 19,
lineNumber: 21,
columnNumber: 7

@@ -87,3 +89,3 @@ }

fileName: _jsxFileName,
lineNumber: 28,
lineNumber: 30,
columnNumber: 7

@@ -112,3 +114,3 @@ }

fileName: _jsxFileName,
lineNumber: 48,
lineNumber: 50,
columnNumber: 7

@@ -115,0 +117,0 @@ }

@@ -38,3 +38,5 @@ "use strict";

_react["default"].Children.forEach(children, function (child, index) {
columns[index % columnsCount].push(child);
if (child && _react["default"].isValidElement(child)) {
columns[index % columnsCount].push(child);
}
});

@@ -58,3 +60,3 @@

fileName: _jsxFileName,
lineNumber: 19,
lineNumber: 21,
columnNumber: 7

@@ -85,3 +87,3 @@ }

fileName: _jsxFileName,
lineNumber: 28,
lineNumber: 30,
columnNumber: 7

@@ -110,3 +112,3 @@ }

fileName: _jsxFileName,
lineNumber: 48,
lineNumber: 50,
columnNumber: 7

@@ -113,0 +115,0 @@ }

2

package.json
{
"name": "react-responsive-masonry",
"version": "2.1.2",
"version": "2.1.3",
"author": {

@@ -5,0 +5,0 @@ "name": "Cédric Delpoux",

/*!
* react-responsive-masonry v2.1.1 - https://github.com/cedricdelpoux/react-responsive-masonry#readme
* react-responsive-masonry v2.1.2 - https://github.com/cedricdelpoux/react-responsive-masonry#readme
* MIT Licensed

@@ -166,3 +166,5 @@ */

external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.forEach(children, function (child, index) {
columns[index % columnsCount].push(child);
if (child && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(child)) {
columns[index % columnsCount].push(child);
}
});

@@ -169,0 +171,0 @@ return columns;

/*!
* react-responsive-masonry v2.1.1 - https://github.com/cedricdelpoux/react-responsive-masonry#readme
* react-responsive-masonry v2.1.2 - https://github.com/cedricdelpoux/react-responsive-masonry#readme
* MIT Licensed
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactResponsiveMasonry=t(require("react")):e.ReactResponsiveMasonry=t(e.React)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";n.r(t),n.d(t,"ResponsiveMasonry",(function(){return l}));var r=n(0),o=n.n(r);function u(){return(u=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}).apply(this,arguments)}var i=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.getColumns=function(){var e=this.props,t=e.children,n=e.columnsCount,r=Array.from({length:n},(function(){return[]}));return o.a.Children.forEach(t,(function(e,t){r[t%n].push(e)})),r},i.renderColumn=function(e){var t=this.props.gutter;return e.map((function(e,n){return o.a.createElement("div",{key:n,style:{marginTop:n>0?t:void 0}},e)}))},i.renderColumns=function(){var e=this,t=this.props.gutter;return this.getColumns().map((function(n,r){return o.a.createElement("div",{key:r,style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignContent:"stretch",flex:1,width:0,marginLeft:r>0?t:void 0}},e.renderColumn(n))}))},i.render=function(){var e=this.props,t=e.className,n=e.style;return o.a.createElement("div",{style:u({display:"flex",flexDirection:"row",justifyContent:"center",alignContent:"stretch",boxSizing:"border-box",width:"100%"},n),className:t},this.renderColumns())},r}(o.a.Component);i.defaultProps={columnsCount:3,gutter:"0",className:null,style:{}};var c=i,a=function(){return"undefined"==typeof window?null:window.innerWidth},s=function(e){var t,n,u,i,c,s=e.columnsCountBreakPoints,l=e.children,f=e.className,p=e.style,d=(t=Object(r.useState)(a()),n=t[0],u=t[1],i="undefined"!=typeof window,c=Object(r.useCallback)((function(){u(a())}),[]),Object(r.useEffect)((function(){if(i)return window.addEventListener("resize",c),function(){return window.removeEventListener("resize",c)}}),[i,c]),n),y=Object(r.useMemo)((function(){var e=Object.keys(s).sort((function(e,t){return e-t})),t=e.length>0?s[e[0]]:1;return e.forEach((function(e){e<d&&(t=s[e])})),t}),[d,s]);return o.a.createElement("div",{className:f,style:p},o.a.Children.map(l,(function(e,t){return o.a.cloneElement(e,{key:t,columnsCount:y})})))};s.defaultProps={columnsCountBreakPoints:{350:1,750:2,900:3},className:null,style:null};var l=s;t.default=c}]).default}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactResponsiveMasonry=t(require("react")):e.ReactResponsiveMasonry=t(e.React)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";n.r(t),n.d(t,"ResponsiveMasonry",(function(){return l}));var r=n(0),o=n.n(r);function u(){return(u=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}).apply(this,arguments)}var i=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.getColumns=function(){var e=this.props,t=e.children,n=e.columnsCount,r=Array.from({length:n},(function(){return[]}));return o.a.Children.forEach(t,(function(e,t){e&&o.a.isValidElement(e)&&r[t%n].push(e)})),r},i.renderColumn=function(e){var t=this.props.gutter;return e.map((function(e,n){return o.a.createElement("div",{key:n,style:{marginTop:n>0?t:void 0}},e)}))},i.renderColumns=function(){var e=this,t=this.props.gutter;return this.getColumns().map((function(n,r){return o.a.createElement("div",{key:r,style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignContent:"stretch",flex:1,width:0,marginLeft:r>0?t:void 0}},e.renderColumn(n))}))},i.render=function(){var e=this.props,t=e.className,n=e.style;return o.a.createElement("div",{style:u({display:"flex",flexDirection:"row",justifyContent:"center",alignContent:"stretch",boxSizing:"border-box",width:"100%"},n),className:t},this.renderColumns())},r}(o.a.Component);i.defaultProps={columnsCount:3,gutter:"0",className:null,style:{}};var a=i,c=function(){return"undefined"==typeof window?null:window.innerWidth},s=function(e){var t,n,u,i,a,s=e.columnsCountBreakPoints,l=e.children,f=e.className,p=e.style,d=(t=Object(r.useState)(c()),n=t[0],u=t[1],i="undefined"!=typeof window,a=Object(r.useCallback)((function(){u(c())}),[]),Object(r.useEffect)((function(){if(i)return window.addEventListener("resize",a),function(){return window.removeEventListener("resize",a)}}),[i,a]),n),y=Object(r.useMemo)((function(){var e=Object.keys(s).sort((function(e,t){return e-t})),t=e.length>0?s[e[0]]:1;return e.forEach((function(e){e<d&&(t=s[e])})),t}),[d,s]);return o.a.createElement("div",{className:f,style:p},o.a.Children.map(l,(function(e,t){return o.a.cloneElement(e,{key:t,columnsCount:y})})))};s.defaultProps={columnsCountBreakPoints:{350:1,750:2,900:3},className:null,style:null};var l=s;t.default=a}]).default}));
//# sourceMappingURL=react-responsive-masonry.min.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc