@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/dist/index.d.cts CHANGED
@@ -6420,8 +6420,8 @@ interface ShareControlProps {
6420
6420
  /** What to call it in the dialog's title. */
6421
6421
  name?: string | undefined;
6422
6422
  /**
6423
- * Whether this person may pass this on — `custom.share_grant` asks for Admin
6424
- * ON THE THING. A caller that already holds the answer (a table screen has
6423
+ * Whether this person may pass this on — `custom.share_grant` asks Edit
6424
+ * ON THE THING (the dialog then offers only the levels `iam.may_grant_as` allows). A caller that already holds the answer (a table screen has
6425
6425
  * the table's rights in its hand) passes it; left out, this asks the store
6426
6426
  * itself for the subject named above. Either way it is an ANSWER and never an
6427
6427
  * assumption, which is the whole of this lane.
package/dist/index.d.ts CHANGED
@@ -6420,8 +6420,8 @@ interface ShareControlProps {
6420
6420
  /** What to call it in the dialog's title. */
6421
6421
  name?: string | undefined;
6422
6422
  /**
6423
- * Whether this person may pass this on — `custom.share_grant` asks for Admin
6424
- * ON THE THING. A caller that already holds the answer (a table screen has
6423
+ * Whether this person may pass this on — `custom.share_grant` asks Edit
6424
+ * ON THE THING (the dialog then offers only the levels `iam.may_grant_as` allows). A caller that already holds the answer (a table screen has
6425
6425
  * the table's rights in its hand) passes it; left out, this asks the store
6426
6426
  * itself for the subject named above. Either way it is an ANSWER and never an
6427
6427
  * assumption, which is the whole of this lane.
package/dist/index.js CHANGED
@@ -38,8 +38,10 @@ var NEEDS = {
38
38
  organise: "editor",
39
39
  // custom.record_delete
40
40
  remove: "editor",
41
- // custom.share_grant — passing your access on is an administrator's right
42
- share: "admin",
41
+ // custom.share_grant — ONE-LADDER (2026-10-10): Edit may pass View / Comment / Edit on inside the
42
+ // organization (iam.may_grant_as, knobs access.sharing/*). Which levels, and to whom, is the share
43
+ // dialog's own question (iam.my_grantable_levels); the Share button only has to open for Edit.
44
+ share: "editor",
43
45
  // custom.field_declare / field_update / field_retire / table settings
44
46
  structure: "admin"
45
47
  };
@@ -2330,15 +2332,13 @@ function cellSection(payload, ctx) {
2330
2332
  { id: "cell-clear", label: "Clear cell", icon: "eraser", destructive: true, disabledReason: why, onSelect: () => a.clearCells([{ rowId, columnId: columnId2 }]) }
2331
2333
  ];
2332
2334
  const cellField = fieldOf(ctx, columnId2);
2333
- if (a.cleanCell && cellField && ctx.cleanable?.(cellField)) {
2334
- items.push({
2335
- id: "cell-clean",
2336
- label: "Clean cell\u2026",
2337
- icon: "paintbrush",
2338
- disabledReason: why,
2339
- onSelect: () => a.cleanCell?.(rowId, columnId2)
2340
- });
2341
- }
2335
+ items.push({
2336
+ id: "cell-clean",
2337
+ label: "Clean cell\u2026",
2338
+ icon: "paintbrush",
2339
+ disabledReason: why ?? (!a.cleanCell ? NOT_HERE : cellField && !ctx.cleanable?.(cellField) ? "Only a text cell can be cleaned." : void 0),
2340
+ onSelect: () => a.cleanCell?.(rowId, columnId2)
2341
+ });
2342
2342
  if (a.askWhoChanged) {
2343
2343
  items.push({ id: "cell-history", label: "Who changed this?", icon: "history", shortcut: "\u2325\u21E7H", onSelect: () => a.askWhoChanged?.(columnId2, rowId) });
2344
2344
  }
@@ -27005,9 +27005,14 @@ function GridBody({
27005
27005
  const editingBusy = editing.busy;
27006
27006
  const addRecord = editing.addRecord;
27007
27007
  const phoneSheetTools = merged && phone ? controls.sheetTools : null;
27008
+ const narrowSearch = merged && !phone && !embedded && searchBox && toolbarFold2 >= 1;
27008
27009
  const tableToolbar = useMemo39(
27009
27010
  () => ({
27010
- search: !embedded,
27011
+ // A NARROW ROW KEEPS ITS SEARCH (member walk 2026-10-10: at 1440 px with the chat panel and the
27012
+ // sidebar open the search field was folded out of sight). Once the row folds anything, the search
27013
+ // becomes the entity-list magnifier that opens into a field, and it rides beside the primary
27014
+ // action — the one place on the row the table never folds away.
27015
+ search: !embedded && !narrowSearch,
27011
27016
  // EMBEDDED: Notion's magnifier — the design system's own search group, a button that
27012
27017
  // opens into a field. It is the same `query.search` the store's read asks.
27013
27018
  ...embedded && searchBox ? {
@@ -27128,18 +27133,29 @@ function GridBody({
27128
27133
  // side chat open it and "From template" both vanished behind the "…"). When the
27129
27134
  // row is short, "From template", undo and the rest ride the "…"; this stays.
27130
27135
  // EMBEDDED: the "+ New page" line under the table is the create action.
27131
- ...!embedded && !readOnly && rights.write ? {
27132
- primary: /* @__PURE__ */ jsx87(
27133
- NewRecordControl,
27134
- {
27135
- tableId,
27136
- noun,
27137
- busy: added.busy,
27138
- onAdd: () => addRowRef.current(),
27139
- onCreated: (id) => formCreatedRef.current(id),
27140
- ask: formAsk
27141
- }
27142
- )
27136
+ ...narrowSearch || !embedded && !readOnly && rights.write ? {
27137
+ primary: /* @__PURE__ */ jsxs77("span", { className: "flex shrink-0 items-center gap-1", "data-records-grid-primary": "", children: [
27138
+ narrowSearch ? /* @__PURE__ */ jsx87("span", { "data-records-grid-narrow-search": "", children: /* @__PURE__ */ jsx87(
27139
+ TapTargetSearchGroup,
27140
+ {
27141
+ surface: "solid",
27142
+ placeholder: "Search records",
27143
+ value: query.search,
27144
+ onValueChange: (term) => setQuery((held) => ({ ...held, search: term, page: 1 }))
27145
+ }
27146
+ ) }) : null,
27147
+ !embedded && !readOnly && rights.write ? /* @__PURE__ */ jsx87(
27148
+ NewRecordControl,
27149
+ {
27150
+ tableId,
27151
+ noun,
27152
+ busy: added.busy,
27153
+ onAdd: () => addRowRef.current(),
27154
+ onCreated: (id) => formCreatedRef.current(id),
27155
+ ask: formAsk
27156
+ }
27157
+ ) : null
27158
+ ] })
27143
27159
  } : {},
27144
27160
  ...phone ? {
27145
27161
  sheetTop: /* @__PURE__ */ jsxs77("div", { className: "flex flex-col gap-1.5 pb-1", "data-records-grid-sheet-top": "", "data-matrx-table-tools-keep-open": "", children: [
@@ -27241,7 +27257,8 @@ function GridBody({
27241
27257
  formAsk,
27242
27258
  searchOverride,
27243
27259
  onSearchChange,
27244
- searchBox
27260
+ searchBox,
27261
+ narrowSearch
27245
27262
  ]
27246
27263
  );
27247
27264
  const labelOfField = useCallback28(
@@ -33109,6 +33126,14 @@ var LOOK_WORDS = {
33109
33126
  folded: "Your look",
33110
33127
  newName: "Name for the new view"
33111
33128
  };
33129
+ var QUESTION_KEYS = ["sorts", "where", "groupField", "swimlaneField"];
33130
+ function lookAfterReset(look) {
33131
+ if (!look) return null;
33132
+ const kept = { ...look };
33133
+ for (const key of QUESTION_KEYS) delete kept[key];
33134
+ for (const key of Object.keys(kept)) if (kept[key] === void 0) delete kept[key];
33135
+ return Object.keys(kept).length > 0 ? kept : null;
33136
+ }
33112
33137
 
33113
33138
  // src/ViewSwitcher.tsx
33114
33139
  import { useEffect as useEffect86, useMemo as useMemo62, useState as useState106 } from "react";
@@ -53505,11 +53530,13 @@ function TablePage({
53505
53530
  setLookRefused(null);
53506
53531
  setViewSaveRefused(null);
53507
53532
  const before = looks?.[current.id];
53533
+ const questionAsked = queryShowing || JSON.stringify(lookAfterReset(before)) !== JSON.stringify(before ?? null);
53534
+ const layoutKept = questionAsked ? lookAfterReset(before) : null;
53508
53535
  setLooks((all) => {
53509
53536
  const { [current.id]: _gone, ...rest } = all ?? {};
53510
- return rest;
53537
+ return layoutKept ? { ...rest, [current.id]: layoutKept } : rest;
53511
53538
  });
53512
- const kept = await keepLook(client, tableId, current.id, null);
53539
+ const kept = await keepLook(client, tableId, current.id, layoutKept);
53513
53540
  if (!kept.ok) {
53514
53541
  setLooks((all) => ({ ...all ?? {}, [current.id]: before ?? {} }));
53515
53542
  setLookRefused(kept.error);