@grafloria/element 0.4.37 → 0.4.38

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.37",
3
+ "version": "0.4.38",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1486,8 +1486,13 @@ export function createDashboardHandle(ctx) {
1486
1486
  },
1487
1487
  setSizing(mode) {
1488
1488
  var _a;
1489
- for (const b of binders.values())
1490
- b.setSizing(mode);
1489
+ // THE VIEWS ONLY. A nested board (a page, a section) is bound fit with no
1490
+ // design height — its height is its container's business — and switched
1491
+ // to grow it painted its rows at the base height, 700 px past a torn-out
1492
+ // group or a split pane (0.4.38).
1493
+ for (const [id, b] of binders)
1494
+ if (groups.has(id))
1495
+ b.setSizing(mode);
1491
1496
  clampCamera();
1492
1497
  (_a = ctx.apiRef) === null || _a === void 0 ? void 0 : _a.renderNow();
1493
1498
  },
@@ -790,10 +790,12 @@ export function bindDashboardSplit(api, group, options = {}) {
790
790
  // nothing. One history step, like every other drop.
791
791
  let tearing = false;
792
792
  const EDGE_GRACE = 60;
793
+ /** The last batch the tear-out ran — the command manager may land it after this tick, so the board re-projects when it settles. */
794
+ let pendingBatch = undefined;
793
795
  const execute = (name, commands) => {
794
796
  if (commands.length === 0)
795
797
  return false;
796
- void execCommand(new BatchCommand(name, commands));
798
+ pendingBatch = execCommand(new BatchCommand(name, commands));
797
799
  return true;
798
800
  };
799
801
  const beginTearOut = (pageId, fromGroupId, ev, plan) => {
@@ -897,8 +899,22 @@ export function bindDashboardSplit(api, group, options = {}) {
897
899
  };
898
900
  const done = (changed, kind) => {
899
901
  tearing = false;
900
- project(readTree());
901
- api.renderNow();
902
+ // PAINT FROM THE TREE THAT WAS SET. The batch adds the group before it
903
+ // swaps the tree, and the board's member:added reconciles the interim
904
+ // tree by halving the LARGEST leaf; when the manager lands the batch
905
+ // after this tick, that interim projection is what stayed on the canvas
906
+ // (a pane 445 px off). Project now, and again once the batch settles.
907
+ const paint = () => {
908
+ if (disposed)
909
+ return;
910
+ project(readTree());
911
+ api.renderNow();
912
+ };
913
+ paint();
914
+ const p = pendingBatch;
915
+ pendingBatch = undefined;
916
+ if (p && typeof p.then === 'function')
917
+ void p.then(paint, () => undefined);
902
918
  fire({ type: kind, kind: 'move', nodeId: pageId, changed });
903
919
  };
904
920
  const finish = (commit) => {