@almadar/ui 4.41.2 → 4.41.3

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.
@@ -52647,15 +52647,21 @@ function layoutOrbitals(count, containerW, containerH) {
52647
52647
  const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
52648
52648
  const rows = Math.ceil(count / cols);
52649
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;
52650
+ const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
52651
+ const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
52652
+ const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
52653
+ const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
52654
+ const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
52655
+ const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
52656
+ const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
52657
+ const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
52658
+ const gridW = (cols - 1) * stepX;
52659
+ const gridH = (rows - 1) * stepY;
52660
+ const originX = (containerW - gridW) / 2;
52661
+ const originY = (containerH - gridH) / 2;
52656
52662
  return Array.from({ length: count }, (_, i) => ({
52657
- cx: minCx + i % cols * stepX,
52658
- cy: minCy + Math.floor(i / cols) * stepY
52663
+ cx: originX + i % cols * stepX,
52664
+ cy: originY + Math.floor(i / cols) * stepY
52659
52665
  }));
52660
52666
  }
52661
52667
  var avlOczWireId = 0;
package/dist/avl/index.js CHANGED
@@ -52601,15 +52601,21 @@ function layoutOrbitals(count, containerW, containerH) {
52601
52601
  const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
52602
52602
  const rows = Math.ceil(count / cols);
52603
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;
52604
+ const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
52605
+ const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
52606
+ const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
52607
+ const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
52608
+ const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
52609
+ const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
52610
+ const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
52611
+ const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
52612
+ const gridW = (cols - 1) * stepX;
52613
+ const gridH = (rows - 1) * stepY;
52614
+ const originX = (containerW - gridW) / 2;
52615
+ const originY = (containerH - gridH) / 2;
52610
52616
  return Array.from({ length: count }, (_, i) => ({
52611
- cx: minCx + i % cols * stepX,
52612
- cy: minCy + Math.floor(i / cols) * stepY
52617
+ cx: originX + i % cols * stepX,
52618
+ cy: originY + Math.floor(i / cols) * stepY
52613
52619
  }));
52614
52620
  }
52615
52621
  var avlOczWireId = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.41.2",
3
+ "version": "4.41.3",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [