@grafloria/element 0.4.48 → 0.4.49

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,11 +1,11 @@
1
1
  {
2
2
  "name": "@grafloria/element",
3
- "version": "0.4.48",
3
+ "version": "0.4.49",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "peerDependencies": {
8
- "@grafloria/engine": "^0.3.0",
8
+ "@grafloria/engine": "^0.3.8",
9
9
  "@grafloria/renderer": "^0.4.0"
10
10
  },
11
11
  "dependencies": {
@@ -1304,20 +1304,28 @@ export function bindDashboardGrid(api, group, options = {}) {
1304
1304
  if (!beside)
1305
1305
  return;
1306
1306
  const it = engine.getItem(beside.id);
1307
+ let moved = false;
1307
1308
  if (it && restore && (it.x !== beside.from.x || it.y !== beside.from.y))
1308
- engine.moveCheck(beside.id, beside.from.x, beside.from.y, { gate: false });
1309
+ moved = engine.moveCheck(beside.id, beside.from.x, beside.from.y, { gate: false }).changed || moved;
1309
1310
  if (restore) {
1310
1311
  // The sections the shift pushed come back with it.
1311
1312
  for (const [oid, c] of beside.others) {
1312
1313
  const o = engine.getItem(oid);
1313
1314
  if (o && (o.x !== c.x || o.y !== c.y))
1314
- engine.moveCheck(oid, c.x, c.y, { gate: false });
1315
+ moved = engine.moveCheck(oid, c.x, c.y, { gate: false }).changed || moved;
1315
1316
  }
1316
1317
  }
1317
1318
  if (it)
1318
1319
  it.locked = true;
1319
1320
  relockOthersForSlab();
1320
1321
  beside = null;
1322
+ // The frames the zone test reads are the MODEL's: a restore that moved
1323
+ // the container without projecting left its frame where the push had
1324
+ // put it, so the next test read the pointer as OUTSIDE it (the user's
1325
+ // 3440-px corner on 0.4.48: along the top band the panel was pushed
1326
+ // down, and the corner never turned into "right").
1327
+ if (moved)
1328
+ project();
1321
1329
  };
1322
1330
  const applyBeside = (g, z) => {
1323
1331
  var _a;
@@ -2108,6 +2116,7 @@ export function bindDashboardGrid(api, group, options = {}) {
2108
2116
  syncPlaceholder();
2109
2117
  return;
2110
2118
  }
2119
+ let z2 = null;
2111
2120
  if (beside) {
2112
2121
  // Off the band: the container comes back unless the POINTER is
2113
2122
  // still over the cell it vacated — the widget's own landing, which
@@ -2127,14 +2136,31 @@ export function bindDashboardGrid(api, group, options = {}) {
2127
2136
  // middle of the original frame is a zone change.
2128
2137
  const r = cellToRect({ x: beside.vacated.x, y: beside.vacated.y, w: g.spans.w, h: g.spans.h }, frame(), geom(), rows());
2129
2138
  const inR = (q) => ev.world.x >= q.x - gap && ev.world.x <= q.x + q.width + gap && ev.world.y >= q.y - gap && ev.world.y <= q.y + q.height + gap;
2130
- const over = bandOf(beside.frame0, ev.world.x, ev.world.y, BESIDE_BAND + BESIDE_STAY) === beside.side || inR(r);
2131
- if (!over)
2139
+ // A DIFFERENT band of the original frame wins over the vacated
2140
+ // cell: a widget as wide as the container took the container's
2141
+ // whole frame as its cell on a top-band push, so "over the cell"
2142
+ // held "above" all the way into the right corner (lab L95).
2143
+ const stay = bandOf(beside.frame0, ev.world.x, ev.world.y, BESIDE_BAND + BESIDE_STAY);
2144
+ const other = bandOf(beside.frame0, ev.world.x, ev.world.y);
2145
+ const over = stay === beside.side || (!(other !== null && other !== beside.side) && inR(r));
2146
+ if (!over) {
2132
2147
  endBeside(true);
2148
+ // The container is back where it was: the pointer may be in
2149
+ // ANOTHER of its bands now (the top band's push had carried the
2150
+ // frame away from under a hand heading for the corner) — resolve
2151
+ // again in this same move, or the hand rests on a stale preview.
2152
+ z2 = besideZoneAt(ev.world.x, ev.world.y);
2153
+ }
2133
2154
  else {
2134
2155
  syncPlaceholder();
2135
2156
  return;
2136
2157
  }
2137
2158
  }
2159
+ if (z2) {
2160
+ applyBeside(g, z2);
2161
+ syncPlaceholder();
2162
+ return;
2163
+ }
2138
2164
  }
2139
2165
  // Deepest board under the pointer wins: the nested KPI strip beats the
2140
2166
  // tab that contains it; a foreign board beats "outside". Strict frames