@ai-matrx/records-ui 0.116.54 → 0.116.56

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
@@ -38,11 +38,20 @@
38
38
  - Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
39
39
  - **New subpath `@ai-matrx/records-ui/data-source`:** `recordsDataSource`, `personActor` and the who-changed words (`whenWords`, `actorWords`, `actorBadge`, `lastChangeSentence`, `SOMEBODY`, `THE_SYSTEM`) alone. `/helpers` also carries the field-type words, the colour resolver and the table builders, which read `@ai-matrx/records/core`; this entry reaches `@ai-matrx/kit` only, and shares the one data-source cache with `/helpers` and the root. Additive. Consumer action: a shell-reachable service that only binds its supabase client or says when imports from `/data-source`.
40
40
 
41
- ## 0.116.54
41
+ ## 0.116.56
42
42
 
43
43
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
44
44
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
45
45
 
46
+ ## 0.116.53
47
+
48
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
49
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
50
+ Diff: `git diff e85f4b0faf 339d1dfc94 -- apps/shared/records-ui/src`
51
+
52
+ Changed shipped source files (1):
53
+ - `apps/shared/records-ui/src/ChartLayout.tsx`
54
+
46
55
  ## 0.116.52
47
56
 
48
57
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
package/dist/index.cjs CHANGED
@@ -38912,14 +38912,16 @@ function viewPageSorts(fields, sorts) {
38912
38912
  }
38913
38913
  async function readViewRows(client, tableId, fields, view, ceiling = VIEW_EXPORT_CEILING) {
38914
38914
  const sort = viewPageSorts(fields, view.sorts);
38915
+ const asked4 = storeQuestion(fields, view.filter ?? void 0, view.columnFilters ?? {}).filter;
38916
+ const search = view.search?.trim() ? view.search.trim() : null;
38915
38917
  const rows = [];
38916
38918
  let physicalOffset = 0;
38917
38919
  for (; ; ) {
38918
38920
  const limit = VIEW_EXPORT_PAGE;
38919
38921
  const answered = await client.listPage({
38920
38922
  table_id: tableId,
38921
- ...view.filter ? { filter: view.filter } : {},
38922
- search: null,
38923
+ ...asked4 ? { filter: asked4 } : {},
38924
+ search,
38923
38925
  sort,
38924
38926
  view_id: sort.length === 0 && view.viewId ? view.viewId : null,
38925
38927
  limit,
@@ -39003,7 +39005,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
39003
39005
  const host = useRecordsUi();
39004
39006
  const fields = (0, import_react220.useFields)(tableId);
39005
39007
  const page = (0, import_react220.useRecords)(view ? null : tableId, { pageSize: 500 });
39006
- const viewKey = view ? JSON.stringify([view.filter ?? null, view.sorts ?? [], view.viewId ?? null]) : "";
39008
+ const viewKey = view ? JSON.stringify([view.filter ?? null, view.sorts ?? [], view.viewId ?? null, view.columnFilters ?? null, view.search ?? null]) : "";
39007
39009
  const [viewRead, setViewRead] = (0, import_react219.useState)(null);
39008
39010
  (0, import_react219.useEffect)(() => {
39009
39011
  if (!view || !fields.data) return;
@@ -39473,7 +39475,7 @@ function StageRulesSection({ tableId, stage, className }) {
39473
39475
  {
39474
39476
  lead: "it cannot get here unless",
39475
39477
  emptyLabel: "\u2014 pick a column \u2014",
39476
- expr: draft.demands ?? null,
39478
+ expr: draft.demands && Object.keys(draft.demands).length > 0 ? draft.demands : null,
39477
39479
  fields: conditionFields,
39478
39480
  onChange: (next) => setDraft({ ...draft, demands: next ?? {} })
39479
39481
  }
@@ -59056,8 +59058,16 @@ function controlFor(field2) {
59056
59058
  if (field2.type === "range" || field2.parity_type === "currency" || field2.parity_type === "percent") {
59057
59059
  return "number";
59058
59060
  }
59061
+ const config = field2.config;
59062
+ if (field2.type === "long_text" || field2.format === "long" || config?.multiline === true) return "paragraph";
59059
59063
  return "text";
59060
59064
  }
59065
+ function askFor(question, field2) {
59066
+ const own3 = question.ask?.trim();
59067
+ if (own3) return own3;
59068
+ const label = field2?.label?.trim();
59069
+ return label ? label : question.field;
59070
+ }
59061
59071
  function deviceName() {
59062
59072
  const nav = globalThis.navigator;
59063
59073
  if (!nav?.userAgent) return "unknown device";
@@ -59149,10 +59159,13 @@ function CaptureRun({ sheetId, face: given, className }) {
59149
59159
  }, [client, given, sheetId]);
59150
59160
  const questions = (0, import_react327.useMemo)(() => {
59151
59161
  const asked4 = face?.presentation?.questions ?? [];
59152
- if (asked4.length > 0) return asked4;
59153
- return (face?.fields ?? []).map((f) => ({
59162
+ const fields = face?.fields ?? [];
59163
+ if (asked4.length > 0) {
59164
+ return asked4.map((x) => ({ ...x, ask: askFor(x, fields.find((f) => f.key === x.field)) }));
59165
+ }
59166
+ return fields.map((f) => ({
59154
59167
  field: f.key,
59155
- ask: f.label ?? f.key,
59168
+ ask: askFor({ field: f.key }, f),
59156
59169
  help: null,
59157
59170
  required: f.required
59158
59171
  }));
@@ -59373,13 +59386,26 @@ function CaptureRun({ sheetId, face: given, className }) {
59373
59386
  setMissing(null);
59374
59387
  }
59375
59388
  }
59389
+ ) : control === "text" ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
59390
+ import_design_system164.Input,
59391
+ {
59392
+ id: `capture-${q.field}`,
59393
+ "data-testid": `capture-input-${q.field}`,
59394
+ "aria-label": q.ask ?? q.field,
59395
+ className: "h-14 text-lg",
59396
+ value: String(answers2[q.field] ?? ""),
59397
+ onChange: (e) => {
59398
+ setAnswers((held) => ({ ...held, [q.field]: e.target.value }));
59399
+ setMissing(null);
59400
+ }
59401
+ }
59376
59402
  ) : /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
59377
59403
  import_design_system164.Textarea,
59378
59404
  {
59379
59405
  id: `capture-${q.field}`,
59380
59406
  "data-testid": `capture-input-${q.field}`,
59381
59407
  "aria-label": q.ask ?? q.field,
59382
- rows: 2,
59408
+ rows: 3,
59383
59409
  className: "min-h-12 text-lg",
59384
59410
  value: String(answers2[q.field] ?? ""),
59385
59411
  onChange: (e) => {
@@ -61886,11 +61912,16 @@ function TablePage({
61886
61912
  };
61887
61913
  const actionOrigin = actionHost?.origin ?? (typeof window !== "undefined" ? window.location.origin : void 0);
61888
61914
  const makeDefaultReason = !view ? "No saved view yet" : layoutShowing !== null && layoutShowing === opensAs ? "Already the default" : "This layout can't be the default";
61915
+ const tableSort = (0, import_first_page3.defaultSortOf)(table.data, allFields.data ?? []);
61916
+ const shownSorts = gridQuery?.sort ? [{ field: gridQuery.sort.field, direction: gridQuery.sort.direction }] : shown5?.sorts && shown5.sorts.length > 0 ? shown5.sorts : shown5?.order !== "manual" && tableSort ? [{ field: tableSort.id, direction: tableSort.direction }] : shown5?.sorts;
61889
61917
  const viewReading = {
61890
61918
  filter: shownFilter,
61891
- sorts: shown5?.sorts,
61919
+ sorts: shownSorts,
61892
61920
  presentation: shown5?.presentation,
61893
- viewId: shown5?.order === "manual" ? shown5?.id ?? null : null
61921
+ viewId: shown5?.order === "manual" ? shown5?.id ?? null : null,
61922
+ // What she did in the grid over the view: header-menu column filters and the search box.
61923
+ columnFilters: gridQuery?.filters,
61924
+ search: gridQuery?.search
61894
61925
  };
61895
61926
  const subItemsLink = subItemsField(allFields.data, tableId);
61896
61927
  const subItemsOn = subItemsLink !== null;