@grafloria/element 0.4.25 → 0.4.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafloria/element",
3
- "version": "0.4.25",
3
+ "version": "0.4.26",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1733,10 +1733,13 @@ export function bindDashboardGrid(api, group, options = {}) {
1733
1733
  // commit and for Escape.
1734
1734
  // NESTED ESCALATION — a section is a board one level down, and a pull
1735
1735
  // inside it can need rows the section does not hold. Two shapes:
1736
- // · a tile spanning the section's FULL HEIGHT (every tile of a one-row
1737
- // KPI strip): the section gains a row and every full-height tile grows
1738
- // with it a row of tiles pulled taller stays a row (s21) — and gives
1739
- // it back when pulled up, never below the design;
1736
+ // · a tile spanning the section's FULL HEIGHT (any tile of a one-row KPI
1737
+ // strip): the section gains a row and THE DRAGGED TILE takes it; its
1738
+ // siblings keep their own cells, and the row goes back when the tile is
1739
+ // pulled up again, never below the design. (Until 0.4.26 every
1740
+ // full-height tile grew together — "a row stays a row" — but that
1741
+ // resized the widget NEXT to the one under the pointer, which is not
1742
+ // what a grid resize means.)
1740
1743
  // · a PARTIAL tile (a one-row control in a 14-row panel): it pushes what
1741
1744
  // is below it; a row the pushed layout needs and the section does not
1742
1745
  // hold is asked of the board, one per pointer step, and rows the
@@ -1801,22 +1804,25 @@ export function bindDashboardGrid(api, group, options = {}) {
1801
1804
  const effWant = fullHeight ? stripRows : wantRows;
1802
1805
  const wantsMore = effWant > pulled.h;
1803
1806
  const wantsLess = effWant < pulled.h;
1804
- const fullOnes = engine.getItems().filter((i) => i.y === 0 && i.h >= inner).map((i) => i.id);
1805
- const resizeAll = (ids, rowsTo) => {
1806
- for (const id of ids) {
1807
- const it = engine.getItem(id);
1808
- if (it)
1809
- engine.resizeCheck(id, it.w, rowsTo);
1810
- }
1811
- };
1812
1807
  let touched = false;
1813
1808
  if (wantsMore) {
1814
- if (fullHeight) {
1809
+ if (fullHeight && !E.s) {
1810
+ // A tile that already starts at row 0 has nothing above it, so a
1811
+ // TOP-edge pull has nowhere to go: refuse it rather than growing
1812
+ // the tile downwards, away from the edge under the pointer. Same
1813
+ // rule the partial path follows (0.4.20).
1814
+ }
1815
+ else if (fullHeight) {
1815
1816
  const res = parent.resizeMemberBy(group.id, +1);
1816
1817
  if (res.changed) {
1817
1818
  record(res, +1);
1818
1819
  setInnerRows(inner + 1);
1819
- resizeAll(fullOnes, inner + 1);
1820
+ // ONLY THE TILE UNDER THE POINTER CHANGES. The section grows to
1821
+ // hold it and its siblings keep their own cells — a grid resize
1822
+ // adjusts what you grabbed, nothing else. (This board used to
1823
+ // grow EVERY full-height tile together, so pulling one KPI of a
1824
+ // strip silently resized its neighbour too.)
1825
+ engine.resizeCheck(g.id, pulled.w, pulled.h + 1);
1820
1826
  touched = true;
1821
1827
  }
1822
1828
  }
@@ -1840,14 +1846,21 @@ export function bindDashboardGrid(api, group, options = {}) {
1840
1846
  else if (wantsLess) {
1841
1847
  if (fullHeight) {
1842
1848
  if (slabRows > designRows && inner > 1) {
1843
- resizeAll(fullOnes, inner - 1);
1844
- const res = parent.resizeMemberBy(group.id, -1);
1845
- if (res.changed) {
1849
+ // Shrink the dragged tile, then hand back only the rows the
1850
+ // section no longer needs — a sibling still using them keeps
1851
+ // them (the extent floor below).
1852
+ engine.resizeCheck(g.id, pulled.w, Math.max(1, effWant));
1853
+ const floor = Math.max(designRows, extentOf(engine.getItems()));
1854
+ let slab = slabRows;
1855
+ let bound = inner;
1856
+ while (slab > floor) {
1857
+ const res = parent.resizeMemberBy(group.id, -1);
1858
+ if (!res.changed)
1859
+ break;
1846
1860
  record(res, -1);
1847
- setInnerRows(inner - 1);
1848
- }
1849
- else {
1850
- resizeAll(fullOnes, inner);
1861
+ slab -= 1;
1862
+ bound -= 1;
1863
+ setInnerRows(bound);
1851
1864
  }
1852
1865
  touched = true;
1853
1866
  }