@ai-matrx/records-ui 0.93.85 → 0.93.87
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 +10 -0
- package/dist/index.cjs +14 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.93.87
|
|
4
|
+
### Unreleased
|
|
5
|
+
|
|
6
|
+
- **Fold 4 is asked at every fold, and the look's reserved place asks for no width** (merged-grid leftovers, 2026-09-30): dragged straight from wide to its smallest size, a table window sat at fold 2 (the layout's toolbar had already folded itself, so fold 3 saved nothing) and the table menu's button was cut again; and the invisible "Your look" place was counted at its full 85 px although it shrinks first. `toolbarFold` now asks the fixed-pieces question whatever fold the row is at, and a piece marked `data-toolbar-fit-gives` counts only its gap. Proof: `toolbarFit.test.tsx` ("the layout's toolbar folded itself before the row reached fold 3"), red on 0.93.86. Consumer action: none.
|
|
7
|
+
|
|
8
|
+
## 0.93.86
|
|
9
|
+
### Unreleased
|
|
10
|
+
|
|
11
|
+
- **Share folds into the table's menu only when the row's own buttons do not fit** (merged-grid leftovers, 2026-09-30): fold 4 (0.93.85) also fired whenever the layout's slot held more than it could show, so a 736 px chat artifact lost Share from its row for nothing — the slot scrolls and keeps its pinned controls whole. Fold 4 now asks only about the fixed pieces (everything outside the slot, plus the slot at its least). Proof: `toolbarFit.test.tsx` ("a slot that holds more than fits is not a reason to move Share"), red on 0.93.85. Consumer action: none.
|
|
12
|
+
|
|
3
13
|
## 0.93.85
|
|
4
14
|
### Unreleased
|
|
5
15
|
|
package/dist/index.cjs
CHANGED
|
@@ -31579,14 +31579,14 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
31579
31579
|
|
|
31580
31580
|
// src/toolbarFit.ts
|
|
31581
31581
|
var import_react188 = require("react");
|
|
31582
|
-
var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120
|
|
31582
|
+
var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120 };
|
|
31583
|
+
var SLOT_MIN = 36;
|
|
31583
31584
|
function toolbarFold(input) {
|
|
31584
31585
|
const { available, needsNow, gap, folded } = input;
|
|
31585
31586
|
const pieces = [
|
|
31586
31587
|
{ piece: input.look, stage: 1, guess: FOLDED_GUESS.look },
|
|
31587
31588
|
{ piece: input.chooser, stage: 2, guess: FOLDED_GUESS.chooser },
|
|
31588
|
-
...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : []
|
|
31589
|
-
...input.tools && input.share ? [{ piece: input.share, stage: 4, guess: FOLDED_GUESS.share }] : []
|
|
31589
|
+
...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : []
|
|
31590
31590
|
];
|
|
31591
31591
|
const widthAt = ({ piece, stage, guess }, fold) => {
|
|
31592
31592
|
if (piece.now === 0 && piece.full === null) return 0;
|
|
@@ -31594,13 +31594,18 @@ function toolbarFold(input) {
|
|
|
31594
31594
|
return piece.full ?? piece.now;
|
|
31595
31595
|
};
|
|
31596
31596
|
const withGap = (width) => width > 0 ? width + gap : 0;
|
|
31597
|
-
const
|
|
31598
|
-
const
|
|
31599
|
-
const
|
|
31597
|
+
const shareNow = input.share ? withGap(input.share.now) : 0;
|
|
31598
|
+
const base = pieces.reduce((rest, p) => rest - withGap(p.piece.now), needsNow - shareNow);
|
|
31599
|
+
const stages = input.tools ? [0, 1, 2, 3] : [0, 1, 2];
|
|
31600
|
+
const shareOn = input.share ? withGap(input.share.full ?? input.share.now) : 0;
|
|
31601
|
+
const needs = stages.map((fold) => pieces.reduce((sum, p) => sum + withGap(widthAt(p, fold)), base + shareOn));
|
|
31600
31602
|
const fits = needs.findIndex((need) => need <= available + 0.5);
|
|
31601
31603
|
if (fits >= 0) return stages[fits];
|
|
31602
31604
|
const least = Math.min(...needs);
|
|
31603
|
-
|
|
31605
|
+
const most = stages[needs.findIndex((need) => need <= least + 0.5)];
|
|
31606
|
+
if (!input.tools || !input.share) return most;
|
|
31607
|
+
const fixed = pieces.reduce((sum, p) => sum + withGap(p.stage === 3 ? SLOT_MIN : widthAt(p, 3)), base + shareOn);
|
|
31608
|
+
return fixed > available + 0.5 ? 4 : most;
|
|
31604
31609
|
}
|
|
31605
31610
|
function naturalWidth(el) {
|
|
31606
31611
|
const html = el;
|
|
@@ -31623,7 +31628,7 @@ function rowNeeds(row) {
|
|
|
31623
31628
|
const innerStyle = typeof getComputedStyle === "undefined" ? null : getComputedStyle(piece);
|
|
31624
31629
|
const innerGap = innerStyle ? parseFloat(innerStyle.columnGap || "0") || 0 : 0;
|
|
31625
31630
|
needs += inner.reduce((sum, c) => sum + naturalWidth(c), 0) + innerGap * Math.max(0, inner.length - 1);
|
|
31626
|
-
} else {
|
|
31631
|
+
} else if (!piece.hasAttribute("data-toolbar-fit-gives")) {
|
|
31627
31632
|
needs += naturalWidth(piece);
|
|
31628
31633
|
}
|
|
31629
31634
|
}
|
|
@@ -32495,7 +32500,7 @@ function TablePage({
|
|
|
32495
32500
|
] }) }) : !lookShowing && main === "records" && view && !phone && !controlsInSheet ? (
|
|
32496
32501
|
/* The reserved place gives way first when the row is narrow (a chat artifact, the
|
|
32497
32502
|
smallest window): it holds nothing, so it shrinks before a real control is cut. */
|
|
32498
|
-
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { "aria-hidden": "true", className: "invisible flex min-w-0 shrink items-center overflow-hidden", "data-view-look-place": "", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_design_system96.Button, { size: "sm", variant: "outline", className: "h-8 gap-1.5 px-2 text-xs", tabIndex: -1, children: [
|
|
32503
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { "aria-hidden": "true", className: "invisible flex min-w-0 shrink items-center overflow-hidden", "data-view-look-place": "", "data-toolbar-fit-gives": "", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_design_system96.Button, { size: "sm", variant: "outline", className: "h-8 gap-1.5 px-2 text-xs", tabIndex: -1, children: [
|
|
32499
32504
|
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full" }),
|
|
32500
32505
|
LOOK_WORDS.folded
|
|
32501
32506
|
] }) })
|