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

react-photo-gallery

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-photo-gallery - npm Package Compare versions

Comparing version 6.1.2 to 6.1.3

4

__test__/utils.test.js

@@ -39,4 +39,4 @@ import { ratio } from '../src/utils';

test('6th image height', () => expect(newPhotos[5].height).toBe(184));
test('7th image width', () => expect(newPhotos[6].width).toBe(378));
test('7th image height', () => expect(newPhotos[6].height).toBe(255.4));
test('7th image width', () => expect(newPhotos[6].width).toBe(314.3));
test('7th image height', () => expect(newPhotos[6].height).toBe(212.4));
});

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

{"/Users/octavia/dev/react-photo-gallery/src/Gallery.js": {"path":"/Users/octavia/dev/react-photo-gallery/src/Gallery.js","statementMap":{"0":{"start":{"line":12,"column":4},"end":{"line":14,"column":7}},"1":{"start":{"line":13,"column":6},"end":{"line":13,"column":79}},"2":{"start":{"line":15,"column":4},"end":{"line":15,"column":41}},"3":{"start":{"line":18,"column":4},"end":{"line":18,"column":31}},"4":{"start":{"line":21,"column":32},"end":{"line":21,"column":42}},"5":{"start":{"line":22,"column":4},"end":{"line":27,"column":7}},"6":{"start":{"line":31,"column":39},"end":{"line":31,"column":49}},"7":{"start":{"line":33,"column":52},"end":{"line":33,"column":62}},"8":{"start":{"line":34,"column":19},"end":{"line":34,"column":36}},"9":{"start":{"line":35,"column":18},"end":{"line":35,"column":47}},"10":{"start":{"line":38,"column":4},"end":{"line":41,"column":5}},"11":{"start":{"line":39,"column":6},"end":{"line":39,"column":81}},"12":{"start":{"line":40,"column":6},"end":{"line":40,"column":64}},"13":{"start":{"line":42,"column":4},"end":{"line":46,"column":5}},"14":{"start":{"line":43,"column":6},"end":{"line":43,"column":46}},"15":{"start":{"line":44,"column":6},"end":{"line":44,"column":71}},"16":{"start":{"line":45,"column":6},"end":{"line":45,"column":70}},"17":{"start":{"line":47,"column":4},"end":{"line":67,"column":6}},"18":{"start":{"line":49,"column":24},"end":{"line":49,"column":41}},"19":{"start":{"line":51,"column":60},"end":{"line":51,"column":65}},"20":{"start":{"line":52,"column":12},"end":{"line":63,"column":14}},"21":{"start":{"line":71,"column":0},"end":{"line":78,"column":2}},"22":{"start":{"line":80,"column":0},"end":{"line":84,"column":2}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":2},"end":{"line":11,"column":3}},"loc":{"start":{"line":11,"column":22},"end":{"line":16,"column":3}},"line":11},"1":{"name":"(anonymous_1)","decl":{"start":{"line":12,"column":39},"end":{"line":12,"column":40}},"loc":{"start":{"line":12,"column":45},"end":{"line":14,"column":5}},"line":12},"2":{"name":"(anonymous_2)","decl":{"start":{"line":17,"column":2},"end":{"line":17,"column":3}},"loc":{"start":{"line":17,"column":25},"end":{"line":19,"column":3}},"line":17},"3":{"name":"(anonymous_3)","decl":{"start":{"line":20,"column":16},"end":{"line":20,"column":17}},"loc":{"start":{"line":20,"column":38},"end":{"line":28,"column":3}},"line":20},"4":{"name":"(anonymous_4)","decl":{"start":{"line":30,"column":2},"end":{"line":30,"column":3}},"loc":{"start":{"line":30,"column":11},"end":{"line":68,"column":3}},"line":30},"5":{"name":"(anonymous_5)","decl":{"start":{"line":49,"column":18},"end":{"line":49,"column":19}},"loc":{"start":{"line":49,"column":24},"end":{"line":49,"column":41}},"line":49},"6":{"name":"(anonymous_6)","decl":{"start":{"line":50,"column":22},"end":{"line":50,"column":23}},"loc":{"start":{"line":50,"column":40},"end":{"line":64,"column":11}},"line":50}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":16},"end":{"line":25,"column":41}},"type":"binary-expr","locations":[{"start":{"line":25,"column":16},"end":{"line":25,"column":33}},{"start":{"line":25,"column":37},"end":{"line":25,"column":41}}],"line":25},"1":{"loc":{"start":{"line":26,"column":12},"end":{"line":26,"column":37}},"type":"binary-expr","locations":[{"start":{"line":26,"column":12},"end":{"line":26,"column":29}},{"start":{"line":26,"column":33},"end":{"line":26,"column":37}}],"line":26},"2":{"loc":{"start":{"line":31,"column":12},"end":{"line":31,"column":34}},"type":"default-arg","locations":[{"start":{"line":31,"column":29},"end":{"line":31,"column":34}}],"line":31},"3":{"loc":{"start":{"line":38,"column":4},"end":{"line":41,"column":5}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":41,"column":5}},{"start":{"line":38,"column":4},"end":{"line":41,"column":5}}],"line":38},"4":{"loc":{"start":{"line":42,"column":4},"end":{"line":46,"column":5}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":46,"column":5}},{"start":{"line":42,"column":4},"end":{"line":46,"column":5}}],"line":42},"5":{"loc":{"start":{"line":54,"column":21},"end":{"line":54,"column":43}},"type":"binary-expr","locations":[{"start":{"line":54,"column":21},"end":{"line":54,"column":30}},{"start":{"line":54,"column":34},"end":{"line":54,"column":43}}],"line":54},"6":{"loc":{"start":{"line":61,"column":25},"end":{"line":61,"column":58}},"type":"cond-expr","locations":[{"start":{"line":61,"column":35},"end":{"line":61,"column":51}},{"start":{"line":61,"column":54},"end":{"line":61,"column":58}}],"line":61}},"s":{"0":4,"1":0,"2":4,"3":1,"4":1,"5":1,"6":7,"7":7,"8":7,"9":7,"10":7,"11":5,"12":5,"13":7,"14":2,"15":2,"16":2,"17":7,"18":11,"19":49,"20":49,"21":1,"22":1},"f":{"0":4,"1":0,"2":1,"3":1,"4":7,"5":11,"6":49},"b":{"0":[1,1],"1":[1,0],"2":[7],"3":[5,2],"4":[2,5],"5":[49,49],"6":[35,14]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"ffb8a1b61d2c33bcc39514551d403f806a8b9e96"}
,"/Users/octavia/dev/react-photo-gallery/src/Photo.js": {"path":"/Users/octavia/dev/react-photo-gallery/src/Photo.js","statementMap":{"0":{"start":{"line":4,"column":21},"end":{"line":4,"column":42}},"1":{"start":{"line":6,"column":14},"end":{"line":25,"column":1}},"2":{"start":{"line":7,"column":19},"end":{"line":7,"column":37}},"3":{"start":{"line":8,"column":2},"end":{"line":12,"column":3}},"4":{"start":{"line":9,"column":4},"end":{"line":9,"column":35}},"5":{"start":{"line":10,"column":4},"end":{"line":10,"column":25}},"6":{"start":{"line":11,"column":4},"end":{"line":11,"column":23}},"7":{"start":{"line":14,"column":22},"end":{"line":16,"column":3}},"8":{"start":{"line":15,"column":4},"end":{"line":15,"column":37}},"9":{"start":{"line":18,"column":2},"end":{"line":24,"column":4}},"10":{"start":{"line":27,"column":29},"end":{"line":35,"column":2}},"11":{"start":{"line":37,"column":0},"end":{"line":53,"column":2}},"12":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"13":{"start":{"line":44,"column":6},"end":{"line":44,"column":85}},"14":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"15":{"start":{"line":49,"column":6},"end":{"line":49,"column":86}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":6,"column":14},"end":{"line":6,"column":15}},"loc":{"start":{"line":6,"column":75},"end":{"line":25,"column":1}},"line":6},"1":{"name":"(anonymous_1)","decl":{"start":{"line":14,"column":22},"end":{"line":14,"column":23}},"loc":{"start":{"line":14,"column":31},"end":{"line":16,"column":3}},"line":14},"2":{"name":"(anonymous_2)","decl":{"start":{"line":42,"column":7},"end":{"line":42,"column":8}},"loc":{"start":{"line":42,"column":16},"end":{"line":46,"column":3}},"line":42},"3":{"name":"(anonymous_3)","decl":{"start":{"line":47,"column":8},"end":{"line":47,"column":9}},"loc":{"start":{"line":47,"column":17},"end":{"line":51,"column":3}},"line":47}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":2},"end":{"line":12,"column":3}},"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":12,"column":3}},{"start":{"line":8,"column":2},"end":{"line":12,"column":3}}],"line":8},"1":{"loc":{"start":{"line":20,"column":13},"end":{"line":20,"column":66}},"type":"cond-expr","locations":[{"start":{"line":20,"column":23},"end":{"line":20,"column":55}},{"start":{"line":20,"column":58},"end":{"line":20,"column":66}}],"line":20},"2":{"loc":{"start":{"line":22,"column":15},"end":{"line":22,"column":43}},"type":"cond-expr","locations":[{"start":{"line":22,"column":25},"end":{"line":22,"column":36}},{"start":{"line":22,"column":39},"end":{"line":22,"column":43}}],"line":22},"3":{"loc":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},{"start":{"line":43,"column":4},"end":{"line":45,"column":5}}],"line":43},"4":{"loc":{"start":{"line":43,"column":8},"end":{"line":43,"column":69}},"type":"binary-expr","locations":[{"start":{"line":43,"column":8},"end":{"line":43,"column":36}},{"start":{"line":43,"column":40},"end":{"line":43,"column":69}}],"line":43},"5":{"loc":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},{"start":{"line":48,"column":4},"end":{"line":50,"column":5}}],"line":48},"6":{"loc":{"start":{"line":48,"column":8},"end":{"line":48,"column":70}},"type":"binary-expr","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":36}},{"start":{"line":48,"column":40},"end":{"line":48,"column":70}}],"line":48}},"s":{"0":2,"1":2,"2":51,"3":51,"4":14,"5":14,"6":14,"7":51,"8":2,"9":51,"10":2,"11":2,"12":51,"13":0,"14":51,"15":0},"f":{"0":51,"1":2,"2":51,"3":51},"b":{"0":[14,37],"1":[36,15],"2":[36,15],"3":[0,51],"4":[51,14],"5":[0,51],"6":[51,14]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"8e97c59ced2924f69110d5ddbe4f02080e891eee"}
,"/Users/octavia/dev/react-photo-gallery/src/utils.js": {"path":"/Users/octavia/dev/react-photo-gallery/src/utils.js","statementMap":{"0":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}},"1":{"start":{"line":2,"column":17},"end":{"line":2,"column":30}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":70}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":34}},"4":{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},"5":{"start":{"line":17,"column":4},"end":{"line":17,"column":14}},"6":{"start":{"line":21,"column":15},"end":{"line":25,"column":8}},"7":{"start":{"line":22,"column":16},"end":{"line":22,"column":41}},"8":{"start":{"line":23,"column":4},"end":{"line":23,"column":55}},"9":{"start":{"line":24,"column":4},"end":{"line":24,"column":15}},"10":{"start":{"line":28,"column":23},"end":{"line":28,"column":38}},"11":{"start":{"line":29,"column":24},"end":{"line":44,"column":4}},"12":{"start":{"line":30,"column":23},"end":{"line":30,"column":78}},"13":{"start":{"line":30,"column":53},"end":{"line":30,"column":74}},"14":{"start":{"line":31,"column":21},"end":{"line":31,"column":54}},"15":{"start":{"line":35,"column":19},"end":{"line":37,"column":41}},"16":{"start":{"line":39,"column":4},"end":{"line":43,"column":8}},"17":{"start":{"line":39,"column":29},"end":{"line":43,"column":5}},"18":{"start":{"line":45,"column":2},"end":{"line":45,"column":66}},"19":{"start":{"line":45,"column":44},"end":{"line":45,"column":60}},"20":{"start":{"line":49,"column":17},"end":{"line":49,"column":57}},"21":{"start":{"line":52,"column":26},"end":{"line":59,"column":4}},"22":{"start":{"line":53,"column":22},"end":{"line":53,"column":59}},"23":{"start":{"line":54,"column":4},"end":{"line":58,"column":6}},"24":{"start":{"line":63,"column":27},"end":{"line":63,"column":29}},"25":{"start":{"line":64,"column":30},"end":{"line":64,"column":32}},"26":{"start":{"line":65,"column":2},"end":{"line":68,"column":3}},"27":{"start":{"line":66,"column":4},"end":{"line":66,"column":64}},"28":{"start":{"line":67,"column":4},"end":{"line":67,"column":31}},"29":{"start":{"line":73,"column":27},"end":{"line":90,"column":4}},"30":{"start":{"line":74,"column":24},"end":{"line":77,"column":9}},"31":{"start":{"line":75,"column":6},"end":{"line":75,"column":54}},"32":{"start":{"line":76,"column":6},"end":{"line":76,"column":17}},"33":{"start":{"line":79,"column":4},"end":{"line":79,"column":49}},"34":{"start":{"line":80,"column":4},"end":{"line":80,"column":47}},"35":{"start":{"line":81,"column":4},"end":{"line":81,"column":100}},"36":{"start":{"line":84,"column":23},"end":{"line":87,"column":9}},"37":{"start":{"line":85,"column":6},"end":{"line":85,"column":54}},"38":{"start":{"line":86,"column":6},"end":{"line":86,"column":17}},"39":{"start":{"line":88,"column":4},"end":{"line":88,"column":60}},"40":{"start":{"line":89,"column":4},"end":{"line":89,"column":17}},"41":{"start":{"line":91,"column":2},"end":{"line":91,"column":26}}},"fnMap":{"0":{"name":"round","decl":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}},"loc":{"start":{"line":1,"column":39},"end":{"line":4,"column":1}},"line":1},"1":{"name":"ratio","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":21}},"loc":{"start":{"line":7,"column":41},"end":{"line":9,"column":1}},"line":7},"2":{"name":"computeSizes","decl":{"start":{"line":15,"column":16},"end":{"line":15,"column":28}},"loc":{"start":{"line":15,"column":65},"end":{"line":46,"column":1}},"line":15},"3":{"name":"(anonymous_3)","decl":{"start":{"line":21,"column":29},"end":{"line":21,"column":30}},"loc":{"start":{"line":21,"column":49},"end":{"line":25,"column":3}},"line":21},"4":{"name":"(anonymous_4)","decl":{"start":{"line":29,"column":33},"end":{"line":29,"column":34}},"loc":{"start":{"line":29,"column":52},"end":{"line":44,"column":3}},"line":29},"5":{"name":"(anonymous_5)","decl":{"start":{"line":30,"column":34},"end":{"line":30,"column":35}},"loc":{"start":{"line":30,"column":53},"end":{"line":30,"column":74}},"line":30},"6":{"name":"(anonymous_6)","decl":{"start":{"line":39,"column":19},"end":{"line":39,"column":20}},"loc":{"start":{"line":39,"column":29},"end":{"line":43,"column":5}},"line":39},"7":{"name":"(anonymous_7)","decl":{"start":{"line":45,"column":30},"end":{"line":45,"column":31}},"loc":{"start":{"line":45,"column":44},"end":{"line":45,"column":60}},"line":45},"8":{"name":"computeSizesColumns","decl":{"start":{"line":47,"column":16},"end":{"line":47,"column":35}},"loc":{"start":{"line":47,"column":72},"end":{"line":92,"column":1}},"line":47},"9":{"name":"(anonymous_9)","decl":{"start":{"line":52,"column":37},"end":{"line":52,"column":38}},"loc":{"start":{"line":52,"column":46},"end":{"line":59,"column":3}},"line":52},"10":{"name":"(anonymous_10)","decl":{"start":{"line":73,"column":47},"end":{"line":73,"column":48}},"loc":{"start":{"line":73,"column":56},"end":{"line":90,"column":3}},"line":73},"11":{"name":"(anonymous_11)","decl":{"start":{"line":74,"column":51},"end":{"line":74,"column":52}},"loc":{"start":{"line":74,"column":69},"end":{"line":77,"column":5}},"line":74},"12":{"name":"(anonymous_12)","decl":{"start":{"line":84,"column":50},"end":{"line":84,"column":51}},"loc":{"start":{"line":84,"column":68},"end":{"line":87,"column":5}},"line":84}},"branchMap":{"0":{"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}},"type":"if","locations":[{"start":{"line":2,"column":2},"end":{"line":2,"column":30}},{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}],"line":2},"1":{"loc":{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},"type":"if","locations":[{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},{"start":{"line":16,"column":2},"end":{"line":18,"column":3}}],"line":16},"2":{"loc":{"start":{"line":23,"column":15},"end":{"line":23,"column":54}},"type":"cond-expr","locations":[{"start":{"line":23,"column":26},"end":{"line":23,"column":45}},{"start":{"line":23,"column":48},"end":{"line":23,"column":54}}],"line":23},"3":{"loc":{"start":{"line":35,"column":19},"end":{"line":37,"column":41}},"type":"cond-expr","locations":[{"start":{"line":36,"column":10},"end":{"line":36,"column":31}},{"start":{"line":37,"column":10},"end":{"line":37,"column":41}}],"line":35},"4":{"loc":{"start":{"line":35,"column":20},"end":{"line":35,"column":63}},"type":"binary-expr","locations":[{"start":{"line":35,"column":20},"end":{"line":35,"column":45}},{"start":{"line":35,"column":49},"end":{"line":35,"column":63}}],"line":35},"5":{"loc":{"start":{"line":75,"column":12},"end":{"line":75,"column":53}},"type":"cond-expr","locations":[{"start":{"line":75,"column":46},"end":{"line":75,"column":47}},{"start":{"line":75,"column":50},"end":{"line":75,"column":53}}],"line":75},"6":{"loc":{"start":{"line":85,"column":12},"end":{"line":85,"column":53}},"type":"cond-expr","locations":[{"start":{"line":85,"column":46},"end":{"line":85,"column":47}},{"start":{"line":85,"column":50},"end":{"line":85,"column":53}}],"line":85}},"s":{"0":208,"1":1,"2":208,"3":87,"4":7,"5":1,"6":6,"7":42,"8":42,"9":42,"10":6,"11":6,"12":18,"13":42,"14":18,"15":18,"16":18,"17":42,"18":6,"19":18,"20":2,"21":2,"22":14,"23":14,"24":2,"25":2,"26":2,"27":6,"28":6,"29":2,"30":14,"31":42,"32":42,"33":14,"34":14,"35":14,"36":14,"37":42,"38":42,"39":14,"40":14,"41":2},"f":{"0":208,"1":87,"2":7,"3":42,"4":18,"5":42,"6":42,"7":18,"8":2,"9":14,"10":14,"11":42,"12":42},"b":{"0":[1,207],"1":[1,6],"2":[24,18],"3":[12,6],"4":[18,6],"5":[8,34],"6":[7,35]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"de2621ef6038cea369979568fabdb3e7723bf2a5"}
{"/Users/octavia/dev/react-photo-gallery/src/Gallery.js": {"path":"/Users/octavia/dev/react-photo-gallery/src/Gallery.js","statementMap":{"0":{"start":{"line":12,"column":4},"end":{"line":14,"column":7}},"1":{"start":{"line":13,"column":6},"end":{"line":13,"column":79}},"2":{"start":{"line":15,"column":4},"end":{"line":15,"column":41}},"3":{"start":{"line":18,"column":4},"end":{"line":18,"column":31}},"4":{"start":{"line":21,"column":32},"end":{"line":21,"column":42}},"5":{"start":{"line":22,"column":4},"end":{"line":27,"column":7}},"6":{"start":{"line":31,"column":39},"end":{"line":31,"column":49}},"7":{"start":{"line":33,"column":52},"end":{"line":33,"column":62}},"8":{"start":{"line":34,"column":19},"end":{"line":34,"column":36}},"9":{"start":{"line":35,"column":18},"end":{"line":35,"column":47}},"10":{"start":{"line":38,"column":4},"end":{"line":41,"column":5}},"11":{"start":{"line":39,"column":6},"end":{"line":39,"column":81}},"12":{"start":{"line":40,"column":6},"end":{"line":40,"column":64}},"13":{"start":{"line":42,"column":4},"end":{"line":46,"column":5}},"14":{"start":{"line":43,"column":6},"end":{"line":43,"column":46}},"15":{"start":{"line":44,"column":6},"end":{"line":44,"column":71}},"16":{"start":{"line":45,"column":6},"end":{"line":45,"column":70}},"17":{"start":{"line":47,"column":4},"end":{"line":67,"column":6}},"18":{"start":{"line":49,"column":24},"end":{"line":49,"column":41}},"19":{"start":{"line":51,"column":60},"end":{"line":51,"column":65}},"20":{"start":{"line":52,"column":12},"end":{"line":63,"column":14}},"21":{"start":{"line":71,"column":0},"end":{"line":82,"column":2}},"22":{"start":{"line":76,"column":4},"end":{"line":78,"column":5}},"23":{"start":{"line":77,"column":6},"end":{"line":77,"column":95}},"24":{"start":{"line":84,"column":0},"end":{"line":88,"column":2}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":2},"end":{"line":11,"column":3}},"loc":{"start":{"line":11,"column":22},"end":{"line":16,"column":3}},"line":11},"1":{"name":"(anonymous_1)","decl":{"start":{"line":12,"column":39},"end":{"line":12,"column":40}},"loc":{"start":{"line":12,"column":45},"end":{"line":14,"column":5}},"line":12},"2":{"name":"(anonymous_2)","decl":{"start":{"line":17,"column":2},"end":{"line":17,"column":3}},"loc":{"start":{"line":17,"column":25},"end":{"line":19,"column":3}},"line":17},"3":{"name":"(anonymous_3)","decl":{"start":{"line":20,"column":16},"end":{"line":20,"column":17}},"loc":{"start":{"line":20,"column":38},"end":{"line":28,"column":3}},"line":20},"4":{"name":"(anonymous_4)","decl":{"start":{"line":30,"column":2},"end":{"line":30,"column":3}},"loc":{"start":{"line":30,"column":11},"end":{"line":68,"column":3}},"line":30},"5":{"name":"(anonymous_5)","decl":{"start":{"line":49,"column":18},"end":{"line":49,"column":19}},"loc":{"start":{"line":49,"column":24},"end":{"line":49,"column":41}},"line":49},"6":{"name":"(anonymous_6)","decl":{"start":{"line":50,"column":22},"end":{"line":50,"column":23}},"loc":{"start":{"line":50,"column":40},"end":{"line":64,"column":11}},"line":50},"7":{"name":"(anonymous_7)","decl":{"start":{"line":75,"column":11},"end":{"line":75,"column":12}},"loc":{"start":{"line":75,"column":20},"end":{"line":79,"column":3}},"line":75}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":16},"end":{"line":25,"column":41}},"type":"binary-expr","locations":[{"start":{"line":25,"column":16},"end":{"line":25,"column":33}},{"start":{"line":25,"column":37},"end":{"line":25,"column":41}}],"line":25},"1":{"loc":{"start":{"line":26,"column":12},"end":{"line":26,"column":37}},"type":"binary-expr","locations":[{"start":{"line":26,"column":12},"end":{"line":26,"column":29}},{"start":{"line":26,"column":33},"end":{"line":26,"column":37}}],"line":26},"2":{"loc":{"start":{"line":31,"column":12},"end":{"line":31,"column":34}},"type":"default-arg","locations":[{"start":{"line":31,"column":29},"end":{"line":31,"column":34}}],"line":31},"3":{"loc":{"start":{"line":38,"column":4},"end":{"line":41,"column":5}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":41,"column":5}},{"start":{"line":38,"column":4},"end":{"line":41,"column":5}}],"line":38},"4":{"loc":{"start":{"line":42,"column":4},"end":{"line":46,"column":5}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":46,"column":5}},{"start":{"line":42,"column":4},"end":{"line":46,"column":5}}],"line":42},"5":{"loc":{"start":{"line":54,"column":21},"end":{"line":54,"column":43}},"type":"binary-expr","locations":[{"start":{"line":54,"column":21},"end":{"line":54,"column":30}},{"start":{"line":54,"column":34},"end":{"line":54,"column":43}}],"line":54},"6":{"loc":{"start":{"line":61,"column":25},"end":{"line":61,"column":58}},"type":"cond-expr","locations":[{"start":{"line":61,"column":35},"end":{"line":61,"column":51}},{"start":{"line":61,"column":54},"end":{"line":61,"column":58}}],"line":61},"7":{"loc":{"start":{"line":76,"column":4},"end":{"line":78,"column":5}},"type":"if","locations":[{"start":{"line":76,"column":4},"end":{"line":78,"column":5}},{"start":{"line":76,"column":4},"end":{"line":78,"column":5}}],"line":76},"8":{"loc":{"start":{"line":76,"column":8},"end":{"line":76,"column":79}},"type":"binary-expr","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":43}},{"start":{"line":76,"column":47},"end":{"line":76,"column":79}}],"line":76}},"s":{"0":4,"1":0,"2":4,"3":1,"4":1,"5":1,"6":7,"7":7,"8":7,"9":7,"10":7,"11":5,"12":5,"13":7,"14":2,"15":2,"16":2,"17":7,"18":11,"19":49,"20":49,"21":1,"22":8,"23":0,"24":1},"f":{"0":4,"1":0,"2":1,"3":1,"4":7,"5":11,"6":49,"7":8},"b":{"0":[1,1],"1":[1,0],"2":[7],"3":[5,2],"4":[2,5],"5":[49,49],"6":[35,14],"7":[0,8],"8":[8,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"b99a5d00f7d19d9fc482c4758727c16501cc368f"}
,"/Users/octavia/dev/react-photo-gallery/src/Photo.js": {"path":"/Users/octavia/dev/react-photo-gallery/src/Photo.js","statementMap":{"0":{"start":{"line":4,"column":21},"end":{"line":4,"column":42}},"1":{"start":{"line":6,"column":14},"end":{"line":25,"column":1}},"2":{"start":{"line":7,"column":19},"end":{"line":7,"column":37}},"3":{"start":{"line":8,"column":2},"end":{"line":12,"column":3}},"4":{"start":{"line":9,"column":4},"end":{"line":9,"column":35}},"5":{"start":{"line":10,"column":4},"end":{"line":10,"column":25}},"6":{"start":{"line":11,"column":4},"end":{"line":11,"column":23}},"7":{"start":{"line":14,"column":22},"end":{"line":16,"column":3}},"8":{"start":{"line":15,"column":4},"end":{"line":15,"column":37}},"9":{"start":{"line":18,"column":2},"end":{"line":24,"column":4}},"10":{"start":{"line":27,"column":29},"end":{"line":35,"column":2}},"11":{"start":{"line":37,"column":0},"end":{"line":53,"column":2}},"12":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"13":{"start":{"line":44,"column":6},"end":{"line":44,"column":85}},"14":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"15":{"start":{"line":49,"column":6},"end":{"line":49,"column":86}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":6,"column":14},"end":{"line":6,"column":15}},"loc":{"start":{"line":6,"column":75},"end":{"line":25,"column":1}},"line":6},"1":{"name":"(anonymous_1)","decl":{"start":{"line":14,"column":22},"end":{"line":14,"column":23}},"loc":{"start":{"line":14,"column":31},"end":{"line":16,"column":3}},"line":14},"2":{"name":"(anonymous_2)","decl":{"start":{"line":42,"column":7},"end":{"line":42,"column":8}},"loc":{"start":{"line":42,"column":16},"end":{"line":46,"column":3}},"line":42},"3":{"name":"(anonymous_3)","decl":{"start":{"line":47,"column":8},"end":{"line":47,"column":9}},"loc":{"start":{"line":47,"column":17},"end":{"line":51,"column":3}},"line":47}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":2},"end":{"line":12,"column":3}},"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":12,"column":3}},{"start":{"line":8,"column":2},"end":{"line":12,"column":3}}],"line":8},"1":{"loc":{"start":{"line":20,"column":13},"end":{"line":20,"column":66}},"type":"cond-expr","locations":[{"start":{"line":20,"column":23},"end":{"line":20,"column":55}},{"start":{"line":20,"column":58},"end":{"line":20,"column":66}}],"line":20},"2":{"loc":{"start":{"line":22,"column":15},"end":{"line":22,"column":43}},"type":"cond-expr","locations":[{"start":{"line":22,"column":25},"end":{"line":22,"column":36}},{"start":{"line":22,"column":39},"end":{"line":22,"column":43}}],"line":22},"3":{"loc":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},{"start":{"line":43,"column":4},"end":{"line":45,"column":5}}],"line":43},"4":{"loc":{"start":{"line":43,"column":8},"end":{"line":43,"column":69}},"type":"binary-expr","locations":[{"start":{"line":43,"column":8},"end":{"line":43,"column":36}},{"start":{"line":43,"column":40},"end":{"line":43,"column":69}}],"line":43},"5":{"loc":{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":50,"column":5}},{"start":{"line":48,"column":4},"end":{"line":50,"column":5}}],"line":48},"6":{"loc":{"start":{"line":48,"column":8},"end":{"line":48,"column":70}},"type":"binary-expr","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":36}},{"start":{"line":48,"column":40},"end":{"line":48,"column":70}}],"line":48}},"s":{"0":1,"1":1,"2":49,"3":49,"4":14,"5":14,"6":14,"7":49,"8":1,"9":49,"10":1,"11":1,"12":49,"13":0,"14":49,"15":0},"f":{"0":49,"1":1,"2":49,"3":49},"b":{"0":[14,35],"1":[35,14],"2":[35,14],"3":[0,49],"4":[49,14],"5":[0,49],"6":[49,14]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"8e97c59ced2924f69110d5ddbe4f02080e891eee"}
,"/Users/octavia/dev/react-photo-gallery/src/utils.js": {"path":"/Users/octavia/dev/react-photo-gallery/src/utils.js","statementMap":{"0":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}},"1":{"start":{"line":2,"column":17},"end":{"line":2,"column":30}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":70}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":34}},"4":{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},"5":{"start":{"line":17,"column":4},"end":{"line":17,"column":14}},"6":{"start":{"line":21,"column":15},"end":{"line":25,"column":8}},"7":{"start":{"line":22,"column":16},"end":{"line":22,"column":41}},"8":{"start":{"line":23,"column":4},"end":{"line":23,"column":55}},"9":{"start":{"line":24,"column":4},"end":{"line":24,"column":15}},"10":{"start":{"line":28,"column":15},"end":{"line":28,"column":17}},"11":{"start":{"line":29,"column":24},"end":{"line":47,"column":4}},"12":{"start":{"line":30,"column":23},"end":{"line":30,"column":78}},"13":{"start":{"line":30,"column":53},"end":{"line":30,"column":74}},"14":{"start":{"line":31,"column":21},"end":{"line":31,"column":54}},"15":{"start":{"line":34,"column":4},"end":{"line":34,"column":62}},"16":{"start":{"line":34,"column":38},"end":{"line":34,"column":62}},"17":{"start":{"line":38,"column":6},"end":{"line":40,"column":86}},"18":{"start":{"line":40,"column":51},"end":{"line":40,"column":61}},"19":{"start":{"line":42,"column":4},"end":{"line":46,"column":8}},"20":{"start":{"line":42,"column":29},"end":{"line":46,"column":5}},"21":{"start":{"line":48,"column":2},"end":{"line":48,"column":66}},"22":{"start":{"line":48,"column":44},"end":{"line":48,"column":60}},"23":{"start":{"line":52,"column":17},"end":{"line":52,"column":57}},"24":{"start":{"line":55,"column":26},"end":{"line":62,"column":4}},"25":{"start":{"line":56,"column":22},"end":{"line":56,"column":59}},"26":{"start":{"line":57,"column":4},"end":{"line":61,"column":6}},"27":{"start":{"line":66,"column":27},"end":{"line":66,"column":29}},"28":{"start":{"line":67,"column":30},"end":{"line":67,"column":32}},"29":{"start":{"line":68,"column":2},"end":{"line":71,"column":3}},"30":{"start":{"line":69,"column":4},"end":{"line":69,"column":64}},"31":{"start":{"line":70,"column":4},"end":{"line":70,"column":31}},"32":{"start":{"line":76,"column":27},"end":{"line":93,"column":4}},"33":{"start":{"line":77,"column":24},"end":{"line":80,"column":9}},"34":{"start":{"line":78,"column":6},"end":{"line":78,"column":54}},"35":{"start":{"line":79,"column":6},"end":{"line":79,"column":17}},"36":{"start":{"line":82,"column":4},"end":{"line":82,"column":49}},"37":{"start":{"line":83,"column":4},"end":{"line":83,"column":47}},"38":{"start":{"line":84,"column":4},"end":{"line":84,"column":100}},"39":{"start":{"line":87,"column":23},"end":{"line":90,"column":9}},"40":{"start":{"line":88,"column":6},"end":{"line":88,"column":54}},"41":{"start":{"line":89,"column":6},"end":{"line":89,"column":17}},"42":{"start":{"line":91,"column":4},"end":{"line":91,"column":60}},"43":{"start":{"line":92,"column":4},"end":{"line":92,"column":17}},"44":{"start":{"line":94,"column":2},"end":{"line":94,"column":26}}},"fnMap":{"0":{"name":"round","decl":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}},"loc":{"start":{"line":1,"column":39},"end":{"line":4,"column":1}},"line":1},"1":{"name":"ratio","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":21}},"loc":{"start":{"line":7,"column":41},"end":{"line":9,"column":1}},"line":7},"2":{"name":"computeSizes","decl":{"start":{"line":15,"column":16},"end":{"line":15,"column":28}},"loc":{"start":{"line":15,"column":65},"end":{"line":49,"column":1}},"line":15},"3":{"name":"(anonymous_3)","decl":{"start":{"line":21,"column":29},"end":{"line":21,"column":30}},"loc":{"start":{"line":21,"column":49},"end":{"line":25,"column":3}},"line":21},"4":{"name":"(anonymous_4)","decl":{"start":{"line":29,"column":33},"end":{"line":29,"column":34}},"loc":{"start":{"line":29,"column":52},"end":{"line":47,"column":3}},"line":29},"5":{"name":"(anonymous_5)","decl":{"start":{"line":30,"column":34},"end":{"line":30,"column":35}},"loc":{"start":{"line":30,"column":53},"end":{"line":30,"column":74}},"line":30},"6":{"name":"(anonymous_6)","decl":{"start":{"line":40,"column":36},"end":{"line":40,"column":37}},"loc":{"start":{"line":40,"column":51},"end":{"line":40,"column":61}},"line":40},"7":{"name":"(anonymous_7)","decl":{"start":{"line":42,"column":19},"end":{"line":42,"column":20}},"loc":{"start":{"line":42,"column":29},"end":{"line":46,"column":5}},"line":42},"8":{"name":"(anonymous_8)","decl":{"start":{"line":48,"column":30},"end":{"line":48,"column":31}},"loc":{"start":{"line":48,"column":44},"end":{"line":48,"column":60}},"line":48},"9":{"name":"computeSizesColumns","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":35}},"loc":{"start":{"line":50,"column":72},"end":{"line":95,"column":1}},"line":50},"10":{"name":"(anonymous_10)","decl":{"start":{"line":55,"column":37},"end":{"line":55,"column":38}},"loc":{"start":{"line":55,"column":46},"end":{"line":62,"column":3}},"line":55},"11":{"name":"(anonymous_11)","decl":{"start":{"line":76,"column":47},"end":{"line":76,"column":48}},"loc":{"start":{"line":76,"column":56},"end":{"line":93,"column":3}},"line":76},"12":{"name":"(anonymous_12)","decl":{"start":{"line":77,"column":51},"end":{"line":77,"column":52}},"loc":{"start":{"line":77,"column":69},"end":{"line":80,"column":5}},"line":77},"13":{"name":"(anonymous_13)","decl":{"start":{"line":87,"column":50},"end":{"line":87,"column":51}},"loc":{"start":{"line":87,"column":68},"end":{"line":90,"column":5}},"line":87}},"branchMap":{"0":{"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}},"type":"if","locations":[{"start":{"line":2,"column":2},"end":{"line":2,"column":30}},{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}],"line":2},"1":{"loc":{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},"type":"if","locations":[{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},{"start":{"line":16,"column":2},"end":{"line":18,"column":3}}],"line":16},"2":{"loc":{"start":{"line":23,"column":15},"end":{"line":23,"column":54}},"type":"cond-expr","locations":[{"start":{"line":23,"column":26},"end":{"line":23,"column":45}},{"start":{"line":23,"column":48},"end":{"line":23,"column":54}}],"line":23},"3":{"loc":{"start":{"line":34,"column":4},"end":{"line":34,"column":62}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":62}},{"start":{"line":34,"column":4},"end":{"line":34,"column":62}}],"line":34},"4":{"loc":{"start":{"line":38,"column":6},"end":{"line":40,"column":86}},"type":"cond-expr","locations":[{"start":{"line":39,"column":10},"end":{"line":39,"column":31}},{"start":{"line":40,"column":10},"end":{"line":40,"column":86}}],"line":38},"5":{"loc":{"start":{"line":38,"column":6},"end":{"line":38,"column":60}},"type":"binary-expr","locations":[{"start":{"line":38,"column":6},"end":{"line":38,"column":34}},{"start":{"line":38,"column":38},"end":{"line":38,"column":60}}],"line":38},"6":{"loc":{"start":{"line":78,"column":12},"end":{"line":78,"column":53}},"type":"cond-expr","locations":[{"start":{"line":78,"column":46},"end":{"line":78,"column":47}},{"start":{"line":78,"column":50},"end":{"line":78,"column":53}}],"line":78},"7":{"loc":{"start":{"line":88,"column":12},"end":{"line":88,"column":53}},"type":"cond-expr","locations":[{"start":{"line":88,"column":46},"end":{"line":88,"column":47}},{"start":{"line":88,"column":50},"end":{"line":88,"column":53}}],"line":88}},"s":{"0":208,"1":1,"2":208,"3":87,"4":7,"5":1,"6":6,"7":42,"8":42,"9":42,"10":6,"11":6,"12":18,"13":42,"14":18,"15":18,"16":12,"17":18,"18":12,"19":18,"20":42,"21":6,"22":18,"23":2,"24":2,"25":14,"26":14,"27":2,"28":2,"29":2,"30":6,"31":6,"32":2,"33":14,"34":42,"35":42,"36":14,"37":14,"38":14,"39":14,"40":42,"41":42,"42":14,"43":14,"44":2},"f":{"0":208,"1":87,"2":7,"3":42,"4":18,"5":42,"6":12,"7":42,"8":18,"9":2,"10":14,"11":14,"12":42,"13":42},"b":{"0":[1,207],"1":[1,6],"2":[24,18],"3":[12,6],"4":[12,6],"5":[18,6],"6":[8,34],"7":[7,35]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"76b14f3a8091988cea3e844268bc7cf3d99332ba"}
}

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

# Basic w/ Columns (Masonry)
# Basic w/ Columns

@@ -3,0 +3,0 @@ Example using the most basic required properties. Pass `column` to Gallery's `direction` prop to achieve the masonry layout.

@@ -15,2 +15,3 @@ ---

* Maintains the original aspect ratio of your photos
* Creates a 'masonry' style layout
* Uses actual image elements, optionally pass in srcSet and sizes attributes

@@ -39,3 +40,3 @@ * Supports row or column (masonry) direction layout

* [Basic Row Layout](https://codesandbox.io/s/9yx911wl9y)
* [Basic Column (Masonry) Layout](https://codesandbox.io/s/r09k1xj614)
* [Basic Column Layout](https://codesandbox.io/s/r09k1xj614)
* [With Lightbox](https://codesandbox.io/s/5vn3lvz2n4)

@@ -42,0 +43,0 @@ * [Dynamic Columns](https://codesandbox.io/s/ll7ym48027)

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

@@ -91,2 +91,3 @@ "main": "lib/Gallery.js",

"react-masonry",
"masonry layout",
"grid",

@@ -93,0 +94,0 @@ "layout"

@@ -11,4 +11,5 @@ # React Photo Gallery

* Maintains the original aspect ratio of your photos
* Creates a 'masonry' style layout
* Uses actual image elements, optionally pass in srcSet and sizes attributes
* Supports row or column (masonry) direction layout
* Supports row or column direction layout
* Supports passing in a custom image component for implementation of things like image selection, favorites, captions, or whatever your little heart desires!

@@ -35,3 +36,3 @@ * SSR app compatible

* [Basic Row Layout](https://codesandbox.io/s/9yx911wl9y)
* [Basic Column (Masonry) Layout](https://codesandbox.io/s/r09k1xj614)
* [Basic Column Layout](https://codesandbox.io/s/r09k1xj614)
* [With Lightbox](https://codesandbox.io/s/5vn3lvz2n4)

@@ -38,0 +39,0 @@ * [Dynamic Columns](https://codesandbox.io/s/ll7ym48027)

@@ -75,3 +75,7 @@ import React from 'react';

onClick: PropTypes.func,
columns: PropTypes.number,
columns: props => {
if (props.photos.length < props.columns && typeof props.column !== 'number') {
return new Error(`columns must be of type 'number' and must be less than photos.length`);
}
},
margin: PropTypes.number,

@@ -78,0 +82,0 @@ ImageComponent: PropTypes.func,

@@ -28,3 +28,3 @@ export function round(value, decimals) {

// accordingly.
const lastRowIndex = rows.length - 1;
let ratios = [];
const rowsWithSizes = rows.map((row, rowIndex) => {

@@ -34,7 +34,10 @@ const totalRatio = row.reduce((result, photo) => result + ratio(photo), 0);

// assign height, but let height of a single photo in the last
// row not expand across columns so divide by columns
const height = (rowIndex !== lastRowIndex || row.length > 1) // eslint-disable-line
// save total ratio of each row
if (rowIndex !== rows.length - 1) ratios.push(totalRatio);
// assign height, if last row use average rows total ratio to keep images from being too large
const height =
rowIndex !== rows.length - 1 || row.length === columns
? rowWidth / totalRatio
: rowWidth / columns / totalRatio;
: rowWidth / (ratios.reduce((acc, item) => acc + item, 0) / (rows.length - 1));

@@ -41,0 +44,0 @@ return row.map(photo => ({

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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