@ai-matrx/records-ui 0.116.90 → 0.116.91

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.js CHANGED
@@ -25400,6 +25400,7 @@ import {
25400
25400
  DEFAULT_DECK_KEY,
25401
25401
  SwipeDeck,
25402
25402
  conditionProblems,
25403
+ dependencyOrder,
25403
25404
  mergeKey,
25404
25405
  readDeckCondition
25405
25406
  } from "@ai-matrx/design-system/swipe-deck";
@@ -25824,7 +25825,7 @@ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembe
25824
25825
  if (typeof v === "number" && Number.isInteger(v) && rows[v - 1]) return rows[v - 1].id;
25825
25826
  return byTitle.get(t.toLowerCase()) ?? t;
25826
25827
  };
25827
- return rows.map((row) => {
25828
+ return dependencyOrder(rows.map((row) => {
25828
25829
  const doc = row.document ?? {};
25829
25830
  const extra = lines.map((f) => ({ label: fieldName(f), value: plain(doc[f.key], options.get(f.key)) })).filter((x) => x.value);
25830
25831
  const raw = condition ? readJson(doc[condition.key]) : void 0;
@@ -25835,7 +25836,7 @@ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembe
25835
25836
  ...extra.length ? { fields: extra } : {},
25836
25837
  ...showIf ? { showIf } : {}
25837
25838
  };
25838
- });
25839
+ }));
25839
25840
  }, [rows, lines, condition, options, titleField?.key, titleKey, answerOf]);
25840
25841
  const state = useMemo51(() => {
25841
25842
  const answers = {};
@@ -25906,7 +25907,10 @@ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembe
25906
25907
  condition && canWrite ? /* @__PURE__ */ jsx94(Button67, { size: "sm", variant: logicOpen ? "secondary" : "ghost", className: "h-7", "aria-pressed": logicOpen, onClick: () => setLogicOpen((o) => !o), children: "Logic" }) : null,
25907
25908
  remembered ? null : /* @__PURE__ */ jsx94("span", { className: "text-muted-foreground", children: "Kept for this visit only" }),
25908
25909
  note ? /* @__PURE__ */ jsx94("span", { className: "text-muted-foreground", children: note }) : null,
25909
- problems.map((p) => /* @__PURE__ */ jsx94("span", { className: "text-muted-foreground", "data-records-swipe-problem": "", children: p }, p))
25910
+ problems.length > 0 && !logicOpen ? (
25911
+ // ONE LINE, never a stack pushing the deck down; the Logic panel lists every one.
25912
+ /* @__PURE__ */ jsx94("span", { className: "min-w-0 basis-full truncate text-muted-foreground sm:basis-auto sm:flex-1", title: problems.join("\n"), "data-records-swipe-problem": "", children: problems.length === 1 ? problems[0] : `${problems[0]} (+${problems.length - 1} more in Logic)` })
25913
+ ) : null
25910
25914
  ] });
25911
25915
  if (!answer) {
25912
25916
  return /* @__PURE__ */ jsxs85("div", { className: "flex min-h-0 flex-col gap-2", "data-records-swipe-layout": "", "data-records-swipe-state": "needs-field", children: [
@@ -25916,7 +25920,7 @@ function SwipeLayout({ view, fields, rows, titleKey, onChange, canWrite, remembe
25916
25920
  }
25917
25921
  return /* @__PURE__ */ jsxs85("div", { className: "flex min-h-0 flex-col gap-2", "data-records-swipe-layout": "", "data-records-swipe-state": "ready", "data-records-swipe-cards": items.length, children: [
25918
25922
  toolbar,
25919
- logicOpen && condition ? /* @__PURE__ */ jsxs85("div", { className: "flex min-h-[28rem] flex-col gap-2 rounded-md border border-border p-2", "data-records-swipe-logic": "", children: [
25923
+ logicOpen && condition ? /* @__PURE__ */ jsxs85("div", { className: "flex h-[36rem] max-h-[80vh] flex-col gap-2 overflow-hidden rounded-md border border-border p-2", "data-records-swipe-logic": "", children: [
25920
25924
  logicError ? /* @__PURE__ */ jsx94(RefusalLine, { error: logicError }) : null,
25921
25925
  Editor ? /* @__PURE__ */ jsx94(Editor, { items, ...key ? { answers: key.answers, more: key.more } : {}, onChange: (next) => void saveLogic(next) }) : /* @__PURE__ */ jsx94("p", { className: "p-2 text-xs text-muted-foreground", children: `The logic graph isn't installed here. Edit ${fieldName(condition)} in the grid.` })
25922
25926
  ] }) : null,