@thi.ng/layout 3.1.10 → 3.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-01-04T21:07:38Z
3
+ - **Last updated**: 2025-01-14T12:23:33Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [3.1.11](https://github.com/thi-ng/umbrella/tree/@thi.ng/layout@3.1.11) (2025-01-14)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - use optional chaining & nullish coalescing ([c5a0a13](https://github.com/thi-ng/umbrella/commit/c5a0a13))
17
+
12
18
  ## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/layout@3.1.0) (2024-08-13)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -74,7 +74,7 @@ For Node.js REPL:
74
74
  const l = await import("@thi.ng/layout");
75
75
  ```
76
76
 
77
- Package sizes (brotli'd, pre-treeshake): ESM: 1.21 KB
77
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.19 KB
78
78
 
79
79
  ## Dependencies
80
80
 
package/grid-layout.js CHANGED
@@ -87,8 +87,7 @@ class GridLayout {
87
87
  propagateSize(rspan) {
88
88
  let rows = this.rows;
89
89
  this.rows = rows = Math.max(rows, this.currRow + rspan);
90
- const parent = this.parent;
91
- parent && parent.propagateSize(rows);
90
+ this.parent?.propagateSize(rows);
92
91
  }
93
92
  }
94
93
  const gridLayout = (x, y, width, cols = 1, rowH = 16, gap = 4) => new GridLayout(null, x, y, width, cols, rowH, gap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/layout",
3
- "version": "3.1.10",
3
+ "version": "3.1.12",
4
4
  "description": "Configurable nested 2D grid layout generators",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@thi.ng/api": "^8.11.16",
44
- "@thi.ng/arrays": "^2.10.9",
45
- "@thi.ng/checks": "^3.6.18"
44
+ "@thi.ng/arrays": "^2.10.11",
45
+ "@thi.ng/checks": "^3.6.19"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@microsoft/api-extractor": "^7.48.1",
@@ -100,5 +100,5 @@
100
100
  ],
101
101
  "year": 2019
102
102
  },
103
- "gitHead": "56c1d57a96565bbcc8c06c73779a619bba0db368\n"
103
+ "gitHead": "d888087b36b086fd8c3e7dc98d35857266f78942\n"
104
104
  }
package/stacked-layout.js CHANGED
@@ -43,7 +43,7 @@ class StackedLayout extends GridLayout {
43
43
  this.currCol = column;
44
44
  offsets.fill(maxY + rspan, column, column + cspan);
45
45
  this.currSpan = cspan;
46
- this.parent && this.parent.propagateSize(Math.max(...this.offsets));
46
+ this.parent?.propagateSize(Math.max(...this.offsets));
47
47
  return cell;
48
48
  }
49
49
  /**
@@ -80,7 +80,7 @@ class StackedLayout extends GridLayout {
80
80
  propagateSize(rspan) {
81
81
  const newY = Math.max(this.currRow + rspan, this.offsets[this.currCol]);
82
82
  this.offsets.fill(newY, this.currCol, this.currCol + this.currSpan);
83
- this.parent && this.parent.propagateSize(newY);
83
+ this.parent?.propagateSize(newY);
84
84
  }
85
85
  /**
86
86
  * Returns true if all column offsets/heights in the layout are equal.