@almadar/ui 4.41.0 → 4.41.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.
@@ -52646,13 +52646,16 @@ function layoutOrbitals(count, containerW, containerH) {
52646
52646
  if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
52647
52647
  const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
52648
52648
  const rows = Math.ceil(count / cols);
52649
- const cellW = containerW / (cols + 0.3);
52650
- const cellH = containerH / (rows + 0.3);
52651
- const originX = (containerW - cols * cellW) / 2 + cellW / 2;
52652
- const originY = (containerH - rows * cellH) / 2 + cellH / 2;
52649
+ const edgePad = 24;
52650
+ const minCx = UNIT_DISPLAY_W / 2 + edgePad;
52651
+ const minCy = UNIT_DISPLAY_H / 2 + edgePad;
52652
+ const maxCx = Math.max(minCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
52653
+ const maxCy = Math.max(minCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
52654
+ const stepX = cols > 1 ? (maxCx - minCx) / (cols - 1) : 0;
52655
+ const stepY = rows > 1 ? (maxCy - minCy) / (rows - 1) : 0;
52653
52656
  return Array.from({ length: count }, (_, i) => ({
52654
- cx: originX + i % cols * cellW,
52655
- cy: originY + Math.floor(i / cols) * cellH
52657
+ cx: minCx + i % cols * stepX,
52658
+ cy: minCy + Math.floor(i / cols) * stepY
52656
52659
  }));
52657
52660
  }
52658
52661
  var avlOczWireId = 0;
package/dist/avl/index.js CHANGED
@@ -52600,13 +52600,16 @@ function layoutOrbitals(count, containerW, containerH) {
52600
52600
  if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
52601
52601
  const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
52602
52602
  const rows = Math.ceil(count / cols);
52603
- const cellW = containerW / (cols + 0.3);
52604
- const cellH = containerH / (rows + 0.3);
52605
- const originX = (containerW - cols * cellW) / 2 + cellW / 2;
52606
- const originY = (containerH - rows * cellH) / 2 + cellH / 2;
52603
+ const edgePad = 24;
52604
+ const minCx = UNIT_DISPLAY_W / 2 + edgePad;
52605
+ const minCy = UNIT_DISPLAY_H / 2 + edgePad;
52606
+ const maxCx = Math.max(minCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
52607
+ const maxCy = Math.max(minCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
52608
+ const stepX = cols > 1 ? (maxCx - minCx) / (cols - 1) : 0;
52609
+ const stepY = rows > 1 ? (maxCy - minCy) / (rows - 1) : 0;
52607
52610
  return Array.from({ length: count }, (_, i) => ({
52608
- cx: originX + i % cols * cellW,
52609
- cy: originY + Math.floor(i / cols) * cellH
52611
+ cx: minCx + i % cols * stepX,
52612
+ cy: minCy + Math.floor(i / cols) * stepY
52610
52613
  }));
52611
52614
  }
52612
52615
  var avlOczWireId = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.41.0",
3
+ "version": "4.41.1",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [