@ai-matrx/records-ui 0.115.50 → 0.115.52

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.52
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records-ui/v0.115.51..npm/records-ui/v0.115.52 -- apps/shared/records-ui`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.115.51
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/records-ui/v0.115.50..npm/records-ui/v0.115.51 -- apps/shared/records-ui`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.115.50
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -665,8 +665,10 @@ var NEEDS = {
665
665
  organise: "editor",
666
666
  // custom.record_delete
667
667
  remove: "editor",
668
- // custom.share_grant — passing your access on is an administrator's right
669
- share: "admin",
668
+ // custom.share_grant — ONE-LADDER (2026-10-10): Edit may pass View / Comment / Edit on inside the
669
+ // organization (iam.may_grant_as, knobs access.sharing/*). Which levels, and to whom, is the share
670
+ // dialog's own question (iam.my_grantable_levels); the Share button only has to open for Edit.
671
+ share: "editor",
670
672
  // custom.field_declare / field_update / field_retire / table settings
671
673
  structure: "admin"
672
674
  };
@@ -2947,15 +2949,13 @@ function cellSection(payload, ctx) {
2947
2949
  { id: "cell-clear", label: "Clear cell", icon: "eraser", destructive: true, disabledReason: why, onSelect: () => a.clearCells([{ rowId, columnId: columnId2 }]) }
2948
2950
  ];
2949
2951
  const cellField = fieldOf(ctx, columnId2);
2950
- if (a.cleanCell && cellField && ctx.cleanable?.(cellField)) {
2951
- items.push({
2952
- id: "cell-clean",
2953
- label: "Clean cell\u2026",
2954
- icon: "paintbrush",
2955
- disabledReason: why,
2956
- onSelect: () => a.cleanCell?.(rowId, columnId2)
2957
- });
2958
- }
2952
+ items.push({
2953
+ id: "cell-clean",
2954
+ label: "Clean cell\u2026",
2955
+ icon: "paintbrush",
2956
+ disabledReason: why ?? (!a.cleanCell ? NOT_HERE : cellField && !ctx.cleanable?.(cellField) ? "Only a text cell can be cleaned." : void 0),
2957
+ onSelect: () => a.cleanCell?.(rowId, columnId2)
2958
+ });
2959
2959
  if (a.askWhoChanged) {
2960
2960
  items.push({ id: "cell-history", label: "Who changed this?", icon: "history", shortcut: "\u2325\u21E7H", onSelect: () => a.askWhoChanged?.(columnId2, rowId) });
2961
2961
  }
@@ -27252,9 +27252,14 @@ function GridBody({
27252
27252
  const editingBusy = editing.busy;
27253
27253
  const addRecord = editing.addRecord;
27254
27254
  const phoneSheetTools = merged && phone ? controls.sheetTools : null;
27255
+ const narrowSearch = merged && !phone && !embedded && searchBox && toolbarFold2 >= 1;
27255
27256
  const tableToolbar = (0, import_react143.useMemo)(
27256
27257
  () => ({
27257
- search: !embedded,
27258
+ // A NARROW ROW KEEPS ITS SEARCH (member walk 2026-10-10: at 1440 px with the chat panel and the
27259
+ // sidebar open the search field was folded out of sight). Once the row folds anything, the search
27260
+ // becomes the entity-list magnifier that opens into a field, and it rides beside the primary
27261
+ // action — the one place on the row the table never folds away.
27262
+ search: !embedded && !narrowSearch,
27258
27263
  // EMBEDDED: Notion's magnifier — the design system's own search group, a button that
27259
27264
  // opens into a field. It is the same `query.search` the store's read asks.
27260
27265
  ...embedded && searchBox ? {
@@ -27375,18 +27380,29 @@ function GridBody({
27375
27380
  // side chat open it and "From template" both vanished behind the "…"). When the
27376
27381
  // row is short, "From template", undo and the rest ride the "…"; this stays.
27377
27382
  // EMBEDDED: the "+ New page" line under the table is the create action.
27378
- ...!embedded && !readOnly && rights.write ? {
27379
- primary: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
27380
- NewRecordControl,
27381
- {
27382
- tableId,
27383
- noun,
27384
- busy: added.busy,
27385
- onAdd: () => addRowRef.current(),
27386
- onCreated: (id) => formCreatedRef.current(id),
27387
- ask: formAsk
27388
- }
27389
- )
27383
+ ...narrowSearch || !embedded && !readOnly && rights.write ? {
27384
+ primary: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { className: "flex shrink-0 items-center gap-1", "data-records-grid-primary": "", children: [
27385
+ narrowSearch ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { "data-records-grid-narrow-search": "", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
27386
+ import_design_system72.TapTargetSearchGroup,
27387
+ {
27388
+ surface: "solid",
27389
+ placeholder: "Search records",
27390
+ value: query.search,
27391
+ onValueChange: (term) => setQuery((held) => ({ ...held, search: term, page: 1 }))
27392
+ }
27393
+ ) }) : null,
27394
+ !embedded && !readOnly && rights.write ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
27395
+ NewRecordControl,
27396
+ {
27397
+ tableId,
27398
+ noun,
27399
+ busy: added.busy,
27400
+ onAdd: () => addRowRef.current(),
27401
+ onCreated: (id) => formCreatedRef.current(id),
27402
+ ask: formAsk
27403
+ }
27404
+ ) : null
27405
+ ] })
27390
27406
  } : {},
27391
27407
  ...phone ? {
27392
27408
  sheetTop: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-1.5 pb-1", "data-records-grid-sheet-top": "", "data-matrx-table-tools-keep-open": "", children: [
@@ -27488,7 +27504,8 @@ function GridBody({
27488
27504
  formAsk,
27489
27505
  searchOverride,
27490
27506
  onSearchChange,
27491
- searchBox
27507
+ searchBox,
27508
+ narrowSearch
27492
27509
  ]
27493
27510
  );
27494
27511
  const labelOfField = (0, import_react143.useCallback)(
@@ -33288,6 +33305,14 @@ var LOOK_WORDS = {
33288
33305
  folded: "Your look",
33289
33306
  newName: "Name for the new view"
33290
33307
  };
33308
+ var QUESTION_KEYS = ["sorts", "where", "groupField", "swimlaneField"];
33309
+ function lookAfterReset(look) {
33310
+ if (!look) return null;
33311
+ const kept = { ...look };
33312
+ for (const key of QUESTION_KEYS) delete kept[key];
33313
+ for (const key of Object.keys(kept)) if (kept[key] === void 0) delete kept[key];
33314
+ return Object.keys(kept).length > 0 ? kept : null;
33315
+ }
33291
33316
 
33292
33317
  // src/ViewSwitcher.tsx
33293
33318
  var import_react224 = require("react");
@@ -53515,11 +53540,13 @@ function TablePage({
53515
53540
  setLookRefused(null);
53516
53541
  setViewSaveRefused(null);
53517
53542
  const before = looks?.[current.id];
53543
+ const questionAsked = queryShowing || JSON.stringify(lookAfterReset(before)) !== JSON.stringify(before ?? null);
53544
+ const layoutKept = questionAsked ? lookAfterReset(before) : null;
53518
53545
  setLooks((all) => {
53519
53546
  const { [current.id]: _gone, ...rest } = all ?? {};
53520
- return rest;
53547
+ return layoutKept ? { ...rest, [current.id]: layoutKept } : rest;
53521
53548
  });
53522
- const kept = await keepLook(client, tableId, current.id, null);
53549
+ const kept = await keepLook(client, tableId, current.id, layoutKept);
53523
53550
  if (!kept.ok) {
53524
53551
  setLooks((all) => ({ ...all ?? {}, [current.id]: before ?? {} }));
53525
53552
  setLookRefused(kept.error);