@ai-matrx/records-ui 0.115.64 → 0.115.66

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.115.66
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records-ui/v0.115.65..npm/records-ui/v0.115.66 -- apps/shared/records-ui`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.115.65
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/records-ui/v0.115.64..npm/records-ui/v0.115.65 -- apps/shared/records-ui`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.115.64
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -41303,7 +41303,8 @@ function ActionInbox({
41303
41303
  release();
41304
41304
  void commit();
41305
41305
  };
41306
- const entry = { timer: setTimeout(fire, seconds * 1e3), ids, commit: fire };
41306
+ const arm = () => setTimeout(() => Date.now() >= until ? fire() : entry.timer = arm(), Math.min(Math.max(0, until - Date.now()), 2147483647));
41307
+ const entry = { timer: arm(), ids, commit: fire };
41307
41308
  holds2.current.set(hold, entry);
41308
41309
  lastHold.current = hold;
41309
41310
  setHeld((h) => {
@@ -52818,6 +52819,13 @@ function phoneTableActions(actions) {
52818
52819
 
52819
52820
  // src/toolbarFit.ts
52820
52821
  var import_react310 = require("react");
52822
+ function widthAtFold(piece, fold) {
52823
+ for (let f = Math.min(fold, (piece.byFold?.length ?? 0) - 1); f >= 0; f -= 1) {
52824
+ const w = piece.byFold?.[f];
52825
+ if (w != null && w > 0) return w;
52826
+ }
52827
+ return piece.full ?? piece.now;
52828
+ }
52821
52829
  var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120 };
52822
52830
  var SLOT_MIN = 36;
52823
52831
  function toolbarFold(input) {
@@ -52830,7 +52838,7 @@ function toolbarFold(input) {
52830
52838
  const widthAt = ({ piece, stage, guess }, fold) => {
52831
52839
  if (piece.now === 0 && piece.full === null) return 0;
52832
52840
  if (fold >= stage) return piece.folded ?? (folded >= stage ? piece.now : Math.min(guess, piece.full ?? piece.now));
52833
- return piece.full ?? piece.now;
52841
+ return widthAtFold(piece, fold);
52834
52842
  };
52835
52843
  const withGap = (width) => width > 0 ? width + gap : 0;
52836
52844
  const shareNow = input.share ? withGap(input.share.now) : 0;
@@ -52873,18 +52881,40 @@ function rowNeeds(row) {
52873
52881
  }
52874
52882
  return { needs: needs + gap * Math.max(0, pieces.length - 1), gap };
52875
52883
  }
52884
+ var STAGE_OF = { look: 1, chooser: 2, tools: 3, share: 4 };
52885
+ function createFitMemory() {
52886
+ const widths = {
52887
+ look: { full: null, folded: null, byFold: [] },
52888
+ chooser: { full: null, folded: null, byFold: [] },
52889
+ tools: { full: null, folded: null, byFold: [] },
52890
+ share: { full: null, folded: null, byFold: [] }
52891
+ };
52892
+ return {
52893
+ /** Record one piece's measured width (`now`; `present`: the piece is on the row) with the row at `current`. */
52894
+ piece(name, current, now, present) {
52895
+ const w = widths[name];
52896
+ const stage = STAGE_OF[name];
52897
+ if (present && now > 0) {
52898
+ if (current >= stage) w.folded = now;
52899
+ else {
52900
+ if (name === "tools") w.byFold[current] = now;
52901
+ if (name !== "tools" || current === 0 || w.full === null) w.full = now;
52902
+ }
52903
+ }
52904
+ if (!present && current < stage) {
52905
+ w.full = null;
52906
+ w.byFold = [];
52907
+ }
52908
+ return { now, full: w.full, folded: w.folded, byFold: w.byFold };
52909
+ }
52910
+ };
52911
+ }
52876
52912
  var useIsoLayoutEffect = typeof window === "undefined" ? import_react310.useEffect : import_react310.useLayoutEffect;
52877
52913
  function useToolbarFit(row) {
52878
52914
  const [fold, setFold] = (0, import_react310.useState)(0);
52879
52915
  useIsoLayoutEffect(() => {
52880
52916
  if (!row) return;
52881
- const widths = {
52882
- look: { full: null, folded: null },
52883
- chooser: { full: null, folded: null },
52884
- tools: { full: null, folded: null },
52885
- share: { full: null, folded: null }
52886
- };
52887
- const stageOf = { look: 1, chooser: 2, tools: 3, share: 4 };
52917
+ const memory = createFitMemory();
52888
52918
  let current = 0;
52889
52919
  let pending = 0;
52890
52920
  let stopped = false;
@@ -52896,13 +52926,7 @@ function useToolbarFit(row) {
52896
52926
  const read = (name) => {
52897
52927
  const el = name === "tools" ? row.querySelector(":scope > [data-toolbar-fit-slot]") : name === "share" ? row.querySelector('[data-toolbar-fit="share"]') : row.querySelector(`:scope > [data-toolbar-fit="${name}"]`);
52898
52928
  const now = !el ? 0 : name === "tools" ? slotNeeds(el) : naturalWidth(el);
52899
- const w = widths[name];
52900
- if (el && now > 0) {
52901
- if (current >= stageOf[name]) w.folded = now;
52902
- else w.full = now;
52903
- }
52904
- if (!el && current < stageOf[name]) w.full = null;
52905
- return { now, full: w.full, folded: w.folded };
52929
+ return memory.piece(name, current, now, !!el);
52906
52930
  };
52907
52931
  const look = read("look");
52908
52932
  const chooser = read("chooser");