@chronocide/hyper 1.2.0 → 1.2.1

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.
Files changed (2) hide show
  1. package/dist/hyper.js +3 -3
  2. package/package.json +1 -1
package/dist/hyper.js CHANGED
@@ -75,13 +75,13 @@ const cells = (cell) => (container) => (data) => fill(data.length)((i, arr) => {
75
75
  let width = container.width;
76
76
  if (typeof cell.width === "number") width = cell.width;
77
77
  if (typeof cell.width === "function") width = cell.width(data[i], i, data) ?? container.width;
78
- let height2 = width;
79
- if (typeof cell.height === "number") height2 = cell.height;
80
- if (typeof cell.height === "function") height2 = cell.height(data[i], i, data) ?? width;
81
78
  if (!cell.gap) {
82
79
  const rows = Math.max(1, Math.floor(container.width / width));
83
80
  width = Math.floor(container.width / rows);
84
81
  }
82
+ let height2 = width;
83
+ if (typeof cell.height === "number") height2 = cell.height;
84
+ if (typeof cell.height === "function") height2 = cell.height(data[i], i, data) ?? width;
85
85
  let x = (prev?.x ?? 0) + (prev?.width ?? 0);
86
86
  let y = prev?.y ?? 0;
87
87
  if (x + width > container.width) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chronocide/hyper",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "types": "dist/hyper.d.ts",
6
6
  "exports": {