@ai-matrx/records-ui 0.116.88 → 0.116.90

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,8 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## 0.116.88
3
+ ## 0.116.90
4
4
 
5
5
  - **The Swipe layout: any table swiped through one record at a time (2026-10-22).** `SwipeLayout` (drawn by `ViewSwitcher` for `layout: "swipe"`): the title is the card, each answer is a record write to the view's Answers-to column — a choice column's options ARE the answers (four on the edges, up to four more as buttons, toned by the option's color) — and an Asked-when column holds each card's condition over earlier cards (`{"item": <record id or title>, "is": <option word>}`, read by the deck's one `readDeckCondition`), so questions open only after the right answer. The Logic button opens the host's new optional `deckLogicEditor` (`DeckLogicEditorProps`; bind rich-content's `SwipeDeckLogicEditor`), whose edits write back only the conditions that changed; unbound it says where to edit the column. A table with nowhere to write answers says so. Skeleton `swipe`. Guard: `src/a-table-can-be-swiped-through.test.tsx`. **Consumer action:** bind `deckLogicEditor` on `<RecordsUiProvider>` to get the graph.
6
+
7
+ ## 0.116.87
8
+
6
9
  - **The enrichment cost sits behind the host's cost door (Arman, 2026-10-22).** `RecordsUiHost.CostDoor` (optional; props `RecordsCostDoorProps`) draws a quiet "Cost" link that reveals points on click. The field settings line no longer prints "N points so far / a row" and the fill confirm's estimate moves into the door; unbound, no cost shows. The confirm and Fill button are unchanged. Consumer action: pass the app's cost door as `CostDoor` where the host is built.
7
10
  - `TablePage` asks `isUuidShape` from `@ai-matrx/kit/uuid` instead of carrying its own anchored UUID regex.
8
11
 
package/dist/index.cjs CHANGED
@@ -48908,7 +48908,7 @@ function deckKeyFromOptions(options) {
48908
48908
  const o = options[i];
48909
48909
  answers2[d] = o ? { id: o.id, label: o.label, tone: o.color && TONE_OF[o.color] || import_swipe_deck.DEFAULT_DECK_KEY[d]?.tone || "neutral" } : null;
48910
48910
  });
48911
- return { answers: answers2, more: options.slice(4, 8).map((o) => ({ id: o.id, label: o.label, tone: o.color && TONE_OF[o.color] || "neutral" })) };
48911
+ return { answers: answers2, more: options.slice(4).map((o) => ({ id: o.id, label: o.label, tone: o.color && TONE_OF[o.color] || "neutral" })) };
48912
48912
  }
48913
48913
  function plain(v, options) {
48914
48914
  if (v === null || v === void 0) return "";
@@ -48930,7 +48930,12 @@ function readJson(v) {
48930
48930
  return void 0;
48931
48931
  }
48932
48932
  }
48933
- function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembered, onChanged, note }) {
48933
+ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembered, onChanged, note, hasMore, onMore }) {
48934
+ const more = (0, import_react295.useRef)(onMore);
48935
+ more.current = onMore;
48936
+ (0, import_react295.useEffect)(() => {
48937
+ if (hasMore) more.current?.();
48938
+ }, [hasMore, rows.length]);
48934
48939
  const host = useRecordsUi();
48935
48940
  const mutation = (0, import_react296.useRecordMutation)();
48936
48941
  const answerChoices = answerFieldChoices(fields);
@@ -49013,7 +49018,8 @@ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembe
49013
49018
  },
49014
49019
  [answer, canWrite, mutation, stored, onChanged]
49015
49020
  );
49016
- const binding = (0, import_react295.useMemo)(() => ({ status: keyReady ? "ready" : "loading", error: null, items, state: state2, apply }), [keyReady, items, state2, apply]);
49021
+ const problems = (0, import_react295.useMemo)(() => (0, import_swipe_deck.conditionProblems)(items, { key: (0, import_swipe_deck.mergeKey)(import_swipe_deck.DEFAULT_DECK_KEY, key?.answers), ...key ? { more: key.more } : {} }), [items, key]);
49022
+ const binding = (0, import_react295.useMemo)(() => ({ status: keyReady && !hasMore ? "ready" : "loading", error: null, items, state: state2, apply }), [keyReady, hasMore, items, state2, apply]);
49017
49023
  const [logicOpen, setLogicOpen] = (0, import_react295.useState)(false);
49018
49024
  const [logicError, setLogicError] = (0, import_react295.useState)(null);
49019
49025
  const saveLogic = (0, import_react295.useCallback)(
@@ -49047,7 +49053,8 @@ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembe
49047
49053
  pick("Asked when", conditionChoices, condition, (k) => onChange({ conditionField: k }), "Every card asked"),
49048
49054
  condition && canWrite ? /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(import_design_system144.Button, { size: "sm", variant: logicOpen ? "secondary" : "ghost", className: "h-7", "aria-pressed": logicOpen, onClick: () => setLogicOpen((o) => !o), children: "Logic" }) : null,
49049
49055
  remembered ? null : /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("span", { className: "text-muted-foreground", children: "Kept for this visit only" }),
49050
- note ? /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("span", { className: "text-muted-foreground", children: note }) : null
49056
+ note ? /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("span", { className: "text-muted-foreground", children: note }) : null,
49057
+ problems.map((p) => /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("span", { className: "text-muted-foreground", "data-records-swipe-problem": "", children: p }, p))
49051
49058
  ] });
49052
49059
  if (!answer) {
49053
49060
  return /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("div", { className: "flex min-h-0 flex-col gap-2", "data-records-swipe-layout": "", "data-records-swipe-state": "needs-field", children: [
@@ -50012,10 +50019,11 @@ function Board({
50012
50019
  records.reload();
50013
50020
  onMoved?.();
50014
50021
  },
50015
- note: records.membership
50022
+ note: records.membership,
50023
+ hasMore: records.total !== null && records.rows.length < records.total,
50024
+ onMore: records.loadMore
50016
50025
  }
50017
- ),
50018
- pager
50026
+ )
50019
50027
  ] });
50020
50028
  }
50021
50029
  if (view.layout === "list") {