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

@appnest/masonry-layout

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appnest/masonry-layout - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

5

masonry-layout.d.ts

@@ -18,3 +18,3 @@ import { MasonryCols } from "./masonry-helpers";

private cancelNextResizeEvent;
private itemCache;
private layoutCache;
/**

@@ -61,3 +61,4 @@ * The maximum width of each column if cols are set to auto.

/**
* All of the elements in the slot that are not text nodes.
* All of the elements in the slot that are an Node.ELEMENT_NODE.
* https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
*/

@@ -64,0 +65,0 @@ private readonly $items;

11

masonry-layout.js

@@ -46,3 +46,3 @@ import { createEmptyColHeightMap, debounce, DEFAULT_COLS, DEFAULT_DEBOUNCE_MS, DEFAULT_MAX_COL_WIDTH, DEFAULT_SPACING, DISTRIBUTED_ATTR, getBooleanAttribute, getColCount, getColWidth, getNumberAttribute, getShortestCol, itemPosition, setBooleanAttribute, tallestColHeight } from "./masonry-helpers";

this.cancelNextResizeEvent = false;
this.itemCache = new WeakMap();
this.layoutCache = new WeakMap();
// Bind the relevant functions to the element

@@ -137,7 +137,8 @@ this.scheduleLayout = this.scheduleLayout.bind(this);

/**
* All of the elements in the slot that are not text nodes.
* All of the elements in the slot that are an Node.ELEMENT_NODE.
* https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
*/
get $items() {
return this.$slot.assignedNodes().filter(node => {
return node.nodeName !== "#text";
return node.nodeType === 1;
});

@@ -229,3 +230,3 @@ }

// Find the shortest col (we need to prioritize filling that one) or used the existing (locked) one
const currentLayout = this.itemCache.get($item);
const currentLayout = this.layoutCache.get($item);
const col = colLock && !reorderCols && currentLayout != null ? currentLayout.col : getShortestCol(colHeightMap);

@@ -237,3 +238,3 @@ // Compute the position for the item

(currentLayout.colWidth !== colWidth || currentLayout.left !== left || currentLayout.top !== top || currentLayout.col !== col)) {
this.itemCache.set($item, { left, top, col, colWidth });
this.layoutCache.set($item, { left, top, col, colWidth });
// WRITE: Assign the new position.

@@ -240,0 +241,0 @@ Object.assign($item.style, {

{
"name": "@appnest/masonry-layout",
"version": "0.0.16",
"version": "0.0.17",
"license": "MIT",

@@ -44,5 +44,5 @@ "module": "index.js",

"postversion": "npm run readme && npm run b:lib",
"publish:patch": "np patch --contents=dist",
"publish:minor": "np minor --contents=dist",
"publish:major": "np major --contents=dist"
"publish:patch": "np patch --contents=dist --no-cleanup",
"publish:minor": "np minor --contents=dist --no-cleanup",
"publish:major": "np major --contents=dist --no-cleanup"
},

@@ -49,0 +49,0 @@ "devDependencies": {

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