@ai-matrx/records-ui 0.116.59 → 0.116.60

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/dist/{SaveToTable-2TQKEYJA.js → SaveToTable-VPLDWCSU.js} +4 -4
  3. package/dist/{chunk-AJVN4BMI.js → chunk-2YK72GHL.js} +305 -248
  4. package/dist/chunk-2YK72GHL.js.map +1 -0
  5. package/dist/{chunk-NGOPU3AJ.js → chunk-4KWCNW7V.js} +5 -4
  6. package/dist/{chunk-NGOPU3AJ.js.map → chunk-4KWCNW7V.js.map} +1 -1
  7. package/dist/{chunk-MBUW42SM.js → chunk-NBL26U5K.js} +2 -2
  8. package/dist/{chunk-4ZS4WEEE.js → chunk-TEYXG4XD.js} +73 -4
  9. package/dist/chunk-TEYXG4XD.js.map +1 -0
  10. package/dist/{chunk-HAWACXPU.js → chunk-W6FX3XVF.js} +2 -2
  11. package/dist/{chunk-Y6U5OFJX.js → chunk-WXYI4DKC.js} +3 -3
  12. package/dist/data-source.cjs +2 -1
  13. package/dist/data-source.cjs.map +1 -1
  14. package/dist/data-source.js +2 -1
  15. package/dist/data-source.js.map +1 -1
  16. package/dist/helpers.cjs +7 -7
  17. package/dist/helpers.cjs.map +1 -1
  18. package/dist/helpers.js +8 -8
  19. package/dist/helpers.js.map +1 -1
  20. package/dist/index.cjs +732 -616
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +17 -16
  23. package/dist/index.d.ts +17 -16
  24. package/dist/index.js +53 -62
  25. package/dist/index.js.map +1 -1
  26. package/dist/pickers.cjs +106 -96
  27. package/dist/pickers.cjs.map +1 -1
  28. package/dist/pickers.js +4 -4
  29. package/dist/skeleton.js +3 -3
  30. package/package.json +4 -4
  31. package/dist/chunk-4ZS4WEEE.js.map +0 -1
  32. package/dist/chunk-AJVN4BMI.js.map +0 -1
  33. /package/dist/{SaveToTable-2TQKEYJA.js.map → SaveToTable-VPLDWCSU.js.map} +0 -0
  34. /package/dist/{chunk-MBUW42SM.js.map → chunk-NBL26U5K.js.map} +0 -0
  35. /package/dist/{chunk-HAWACXPU.js.map → chunk-W6FX3XVF.js.map} +0 -0
  36. /package/dist/{chunk-Y6U5OFJX.js.map → chunk-WXYI4DKC.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -2502,22 +2502,6 @@ interface RecordsTableCardProps {
2502
2502
  }
2503
2503
  declare function RecordsTableCard(props: RecordsTableCardProps): react.JSX.Element;
2504
2504
 
2505
- /** What a view asks of the store, and how it draws columns. */
2506
- interface ViewReading {
2507
- filter?: StoreFilter$1 | null | undefined;
2508
- sorts?: readonly ViewSort[] | undefined;
2509
- presentation?: GridPresentation | undefined;
2510
- /** A hand-ordered view with no sort is read by its own id (the store places its rows). */
2511
- viewId?: string | null | undefined;
2512
- /**
2513
- * What the person has done in THE GRID on top of the view: the column filters she set in the header
2514
- * menus and the words in the search box. The grid asks the store with them, so the file does too
2515
- * (AT-FIX-I: a file listed rows the grid had filtered out).
2516
- */
2517
- columnFilters?: Record<string, unknown> | undefined;
2518
- search?: string | undefined;
2519
- }
2520
-
2521
2505
  /**
2522
2506
  * Answers "what is the record with this id called", for one Field's values. The resolver the mount
2523
2507
  * provides also answers `archived` — whether a referenced record sits in Archived items (an archive
@@ -2559,6 +2543,22 @@ declare function useRecordLabels(fields: readonly Field$1[] | undefined): LabelL
2559
2543
  */
2560
2544
  declare function useLabelWait(field: Field$1 | undefined): string | null;
2561
2545
 
2546
+ /** What a view asks of the store, and how it draws columns. */
2547
+ interface ViewReading {
2548
+ filter?: StoreFilter$1 | null | undefined;
2549
+ sorts?: readonly ViewSort[] | undefined;
2550
+ presentation?: GridPresentation | undefined;
2551
+ /** A hand-ordered view with no sort is read by its own id (the store places its rows). */
2552
+ viewId?: string | null | undefined;
2553
+ /**
2554
+ * What the person has done in THE GRID on top of the view: the column filters she set in the header
2555
+ * menus and the words in the search box. The grid asks the store with them, so the file does too
2556
+ * (AT-FIX-I: a file listed rows the grid had filtered out).
2557
+ */
2558
+ columnFilters?: Record<string, unknown> | undefined;
2559
+ search?: string | undefined;
2560
+ }
2561
+
2562
2562
  interface ExportMenuProps {
2563
2563
  tableId: Uuid$1;
2564
2564
  /** The rows on screen. Absent means "this table's first page", read the same way. */
@@ -2573,6 +2573,7 @@ interface ExportMenuProps {
2573
2573
  */
2574
2574
  view?: ViewReading | undefined;
2575
2575
  }
2576
+
2576
2577
  declare function ExportMenu({ tableId, rows, label, className, view }: ExportMenuProps): react.JSX.Element;
2577
2578
 
2578
2579
  interface FilePickerProps {
package/dist/index.d.ts CHANGED
@@ -2502,22 +2502,6 @@ interface RecordsTableCardProps {
2502
2502
  }
2503
2503
  declare function RecordsTableCard(props: RecordsTableCardProps): react.JSX.Element;
2504
2504
 
2505
- /** What a view asks of the store, and how it draws columns. */
2506
- interface ViewReading {
2507
- filter?: StoreFilter$1 | null | undefined;
2508
- sorts?: readonly ViewSort[] | undefined;
2509
- presentation?: GridPresentation | undefined;
2510
- /** A hand-ordered view with no sort is read by its own id (the store places its rows). */
2511
- viewId?: string | null | undefined;
2512
- /**
2513
- * What the person has done in THE GRID on top of the view: the column filters she set in the header
2514
- * menus and the words in the search box. The grid asks the store with them, so the file does too
2515
- * (AT-FIX-I: a file listed rows the grid had filtered out).
2516
- */
2517
- columnFilters?: Record<string, unknown> | undefined;
2518
- search?: string | undefined;
2519
- }
2520
-
2521
2505
  /**
2522
2506
  * Answers "what is the record with this id called", for one Field's values. The resolver the mount
2523
2507
  * provides also answers `archived` — whether a referenced record sits in Archived items (an archive
@@ -2559,6 +2543,22 @@ declare function useRecordLabels(fields: readonly Field$1[] | undefined): LabelL
2559
2543
  */
2560
2544
  declare function useLabelWait(field: Field$1 | undefined): string | null;
2561
2545
 
2546
+ /** What a view asks of the store, and how it draws columns. */
2547
+ interface ViewReading {
2548
+ filter?: StoreFilter$1 | null | undefined;
2549
+ sorts?: readonly ViewSort[] | undefined;
2550
+ presentation?: GridPresentation | undefined;
2551
+ /** A hand-ordered view with no sort is read by its own id (the store places its rows). */
2552
+ viewId?: string | null | undefined;
2553
+ /**
2554
+ * What the person has done in THE GRID on top of the view: the column filters she set in the header
2555
+ * menus and the words in the search box. The grid asks the store with them, so the file does too
2556
+ * (AT-FIX-I: a file listed rows the grid had filtered out).
2557
+ */
2558
+ columnFilters?: Record<string, unknown> | undefined;
2559
+ search?: string | undefined;
2560
+ }
2561
+
2562
2562
  interface ExportMenuProps {
2563
2563
  tableId: Uuid$1;
2564
2564
  /** The rows on screen. Absent means "this table's first page", read the same way. */
@@ -2573,6 +2573,7 @@ interface ExportMenuProps {
2573
2573
  */
2574
2574
  view?: ViewReading | undefined;
2575
2575
  }
2576
+
2576
2577
  declare function ExportMenu({ tableId, rows, label, className, view }: ExportMenuProps): react.JSX.Element;
2577
2578
 
2578
2579
  interface FilePickerProps {
package/dist/index.js CHANGED
@@ -102,9 +102,11 @@ import {
102
102
  exportJson,
103
103
  fieldLookFor,
104
104
  fieldLookIds,
105
+ fileCsv,
106
+ fileMarkdown,
107
+ fileXlsx,
105
108
  filterRefusal,
106
109
  formulaTextNow,
107
- getPersonTimeZone,
108
110
  gridCopyConfig,
109
111
  gridMenuSections,
110
112
  headerMenuItems,
@@ -130,7 +132,6 @@ import {
130
132
  notAChoiceSentence,
131
133
  personActor,
132
134
  personRecordForMember,
133
- personWallNow,
134
135
  placeColumn,
135
136
  pointsAtRecords,
136
137
  previewWords,
@@ -146,7 +147,6 @@ import {
146
147
  rowLabelRefusal,
147
148
  rowLines,
148
149
  scalarText,
149
- setPersonTimeZone,
150
150
  settingsOfTable,
151
151
  shownValue,
152
152
  signatureFileIn,
@@ -159,8 +159,8 @@ import {
159
159
  storeQuestion,
160
160
  structuredSummary,
161
161
  structuredValueOf,
162
- subscribePersonTimeZone,
163
162
  tableArchiveSentence,
163
+ toRows,
164
164
  tokenName,
165
165
  tokensFromRows,
166
166
  typingOpens,
@@ -182,7 +182,7 @@ import {
182
182
  withoutAddition,
183
183
  withoutLeadingBlank,
184
184
  workedOutErrorFor
185
- } from "./chunk-AJVN4BMI.js";
185
+ } from "./chunk-2YK72GHL.js";
186
186
  import {
187
187
  CHART_PLOT_PX,
188
188
  EMBEDDED_ROW_PX,
@@ -198,7 +198,7 @@ import {
198
198
  skeletonLayoutFor,
199
199
  useExpectedRows,
200
200
  useRememberedLayout
201
- } from "./chunk-MBUW42SM.js";
201
+ } from "./chunk-NBL26U5K.js";
202
202
  import {
203
203
  DEFAULT_FOOTER,
204
204
  EMBEDDED_LOOK,
@@ -226,7 +226,7 @@ import {
226
226
  viewSettings,
227
227
  viewSettingsFor,
228
228
  viewSettingsPatch
229
- } from "./chunk-HAWACXPU.js";
229
+ } from "./chunk-W6FX3XVF.js";
230
230
  import {
231
231
  HTML_SAMPLE_CSP,
232
232
  HTML_SAMPLE_SANDBOX,
@@ -293,7 +293,7 @@ import {
293
293
  visibilityLaneFor,
294
294
  whyNotAskable,
295
295
  writeOnTheWinningVersion_exports
296
- } from "./chunk-Y6U5OFJX.js";
296
+ } from "./chunk-WXYI4DKC.js";
297
297
  import {
298
298
  ACTION_CHECKING_ACCESS_REASON,
299
299
  ACTION_NOT_HERE_REASON,
@@ -406,7 +406,7 @@ import {
406
406
  useRowRights,
407
407
  useTableRights,
408
408
  withoutInternalCodes
409
- } from "./chunk-NGOPU3AJ.js";
409
+ } from "./chunk-4KWCNW7V.js";
410
410
  import {
411
411
  FEWEST_KEY_VALUE_PAIRS,
412
412
  FEWEST_LIST_ITEMS,
@@ -449,14 +449,19 @@ import {
449
449
  editorKindFor,
450
450
  fieldToken,
451
451
  fieldTypeLabel,
452
+ getPersonTimeZone,
452
453
  hasTimePart,
454
+ instantFromPersonWall,
453
455
  isDateField,
454
456
  isSignatureField,
457
+ personWallNow,
455
458
  pickableTypeOf,
459
+ setPersonTimeZone,
456
460
  storedChoiceColor,
457
461
  storedChoiceColorLookup,
462
+ subscribePersonTimeZone,
458
463
  timeOfDayWords
459
- } from "./chunk-4ZS4WEEE.js";
464
+ } from "./chunk-TEYXG4XD.js";
460
465
  import {
461
466
  ADD_FIELD_OPEN_LABEL,
462
467
  FIELD_TYPE_CATALOGUE,
@@ -1112,7 +1117,9 @@ import { useRecordsClient as useRecordsClient3 } from "@ai-matrx/records/react";
1112
1117
 
1113
1118
  // src/whoChanged.ts
1114
1119
  import { formatRelativeTime } from "@ai-matrx/kit/format";
1120
+ import { globalSlot } from "@ai-matrx/kit/global-slot";
1115
1121
  import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
1122
+ var displayZone = globalSlot("ai-matrx.design-system.display-time-zone", () => ({ zone: null }));
1116
1123
  var SOMEBODY = "somebody in this organization";
1117
1124
  var THE_SYSTEM = "Matrx";
1118
1125
  function actorWords(actor, resolve) {
@@ -1131,7 +1138,7 @@ function whenWords(at, now = /* @__PURE__ */ new Date()) {
1131
1138
  const age = now.getTime() - then.getTime();
1132
1139
  if (!Number.isFinite(age)) return "at an unknown time";
1133
1140
  if (age < 30 * 864e5) return formatRelativeTime(then, { style: "intl", now: now.getTime() });
1134
- return then.toLocaleDateString();
1141
+ return then.toLocaleDateString(void 0, displayZone.zone ? { timeZone: displayZone.zone } : void 0);
1135
1142
  }
1136
1143
  var OPERATION_WORDS = {
1137
1144
  created: "Created",
@@ -15548,6 +15555,7 @@ function AddBody({ tableId }) {
15548
15555
 
15549
15556
  // src/Peek.tsx
15550
15557
  import { humanizeIdentifier as humanizeIdentifier7 } from "@ai-matrx/kit/text-case";
15558
+ import { momentZoneOptions } from "@ai-matrx/design-system/field-formats";
15551
15559
  import { Fragment as Fragment18, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
15552
15560
  function drawnBelowOnPage(field, bodyKey) {
15553
15561
  return field.key === bodyKey || editorKindFor(field) === "relation";
@@ -15574,7 +15582,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
15574
15582
  const document2 = record.data?.document;
15575
15583
  if (document2 && isLockedStub({ document: document2, level: null })) {
15576
15584
  const filed = document2["submitted_at"];
15577
- const when = typeof filed === "string" && !Number.isNaN(Date.parse(filed)) ? new Date(filed).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" }) : null;
15585
+ const when = typeof filed === "string" && !Number.isNaN(Date.parse(filed)) ? new Date(filed).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", ...momentZoneOptions(filed) }) : null;
15578
15586
  return /* @__PURE__ */ jsxs46("p", { className: cn17("text-sm text-muted-foreground", className), "data-records-locked-record": "", children: [
15579
15587
  "You can't open this record",
15580
15588
  when ? `. Filed ${when}.` : "."
@@ -15722,7 +15730,7 @@ function computedInPlainWords(row, field) {
15722
15730
  const name = field ? fieldName(field) : humanizeIdentifier7(row.field_key);
15723
15731
  const shown4 = row.value === null || row.value === void 0 || row.value === "" ? "nothing" : field ? scalarText(field, row.value) : String(row.value);
15724
15732
  const when = new Date(row.computed_at);
15725
- const at = Number.isNaN(when.getTime()) ? "" : ` on ${when.toLocaleDateString()}`;
15733
+ const at = Number.isNaN(when.getTime()) ? "" : ` on ${when.toLocaleDateString(void 0, momentZoneOptions(when))}`;
15726
15734
  return `${name}: ${shown4}${at}`;
15727
15735
  }
15728
15736
 
@@ -16120,6 +16128,7 @@ function MigrationLog({ entries, readError, canUndo, whyNotUndo, onUndone, class
16120
16128
  }
16121
16129
 
16122
16130
  // src/HistoryPanel.tsx
16131
+ import { momentZoneOptions as momentZoneOptions2 } from "@ai-matrx/design-system/field-formats";
16123
16132
  import { Fragment as Fragment20, jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
16124
16133
  function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
16125
16134
  usePeopleTick();
@@ -16597,9 +16606,9 @@ function whenText(at) {
16597
16606
  if (Number.isNaN(age)) return "\u2014";
16598
16607
  if (age < 864e5) return formatRelativeTime3(then, { style: "intl" });
16599
16608
  if (age < 7 * 864e5) {
16600
- return then.toLocaleString(void 0, { weekday: "short", hour: "numeric", minute: "2-digit" });
16609
+ return then.toLocaleString(void 0, { weekday: "short", hour: "numeric", minute: "2-digit", ...momentZoneOptions2(then) });
16601
16610
  }
16602
- return then.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
16611
+ return then.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric", ...momentZoneOptions2(then) });
16603
16612
  }
16604
16613
  function say(value, field) {
16605
16614
  if (value === null || value === void 0 || value === "") return "nothing";
@@ -18290,7 +18299,7 @@ import { copyText as copyText4 } from "@ai-matrx/kit/clipboard";
18290
18299
  import { downloadFile } from "@ai-matrx/kit/download";
18291
18300
  import { useEffect as useEffect49, useRef as useRef28, useState as useState57 } from "react";
18292
18301
  import { useFields as useFields17, useRecords as useRecords4, useRecordsClient as useRecordsClient49, useTable as useTable18 } from "@ai-matrx/records/react";
18293
- import { exportCsv, exportMarkdown, exportXlsx, wholeValueOf as wholeValueOf4, withWholeValues } from "@ai-matrx/records/core";
18302
+ import { withWholeValues } from "@ai-matrx/records/core";
18294
18303
 
18295
18304
  // src/viewExport.ts
18296
18305
  import { formatCount as formatCount3 } from "@ai-matrx/kit/format";
@@ -18347,30 +18356,6 @@ function cutWords(written) {
18347
18356
  import { AlchemyMenu as AlchemyMenu2 } from "@ai-matrx/alchemy/react";
18348
18357
  import { Button as Button49, cn as cn25 } from "@ai-matrx/design-system";
18349
18358
  import { jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
18350
- function toRows(fields, records, labels) {
18351
- return records.map((record) => {
18352
- const document2 = record.document ?? {};
18353
- const envelopes = document2["_values"] ?? {};
18354
- const row = {};
18355
- for (const field of fields) {
18356
- const envelope = envelopes[field.key];
18357
- const withheld = withheldNoticeOf(record.hidden, field.key);
18358
- const held = withheld && (document2[field.key] ?? null) === null;
18359
- row[field.key] = {
18360
- field_key: field.key,
18361
- value: held ? `${WITHHELD_WORD}: ${withheldSentence(field, withheld)}` : (
18362
- // A drawn signature reads "Signed" here through the same resolver copy uses (`shownValue`).
18363
- shownValue(field, document2[field.key] ?? null, labels)
18364
- ),
18365
- absent_reason: envelope?.absent ?? null,
18366
- // A VALUE KEPT AS A FILE carries its pointer, so the export writes the whole text
18367
- // (`withWholeValues`), never the first words passed off as the value.
18368
- source: wholeValueOf4(document2, field.key)
18369
- };
18370
- }
18371
- return row;
18372
- });
18373
- }
18374
18359
  function fileNameOf(name) {
18375
18360
  return name.replace(/[\\/:*?"<>|\u0000-\u001f]+/g, " ").replace(/\s+/g, " ").trim();
18376
18361
  }
@@ -18452,7 +18437,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
18452
18437
  {
18453
18438
  size: "sm",
18454
18439
  variant: "outline",
18455
- onClick: () => void exported().then((rows2) => download(`${name}.csv`, "text/csv;charset=utf-8", exportCsv(columns, rows2))).catch(
18440
+ onClick: () => void exported().then((rows2) => download(`${name}.csv`, "text/csv;charset=utf-8", fileCsv(columns, rows2))).catch(
18456
18441
  (thrown) => setFailure((0, refusals_exports.refusalFromThrown)(thrown, "The CSV could not be written.", "Try again in a moment."))
18457
18442
  ),
18458
18443
  children: "CSV"
@@ -18473,7 +18458,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
18473
18458
  );
18474
18459
  setFailure(null);
18475
18460
  try {
18476
- exported().then((rows2) => exportXlsx(columns, rows2, name)).then(
18461
+ exported().then((rows2) => fileXlsx(columns, rows2, name)).then(
18477
18462
  (bytes) => download(
18478
18463
  `${name}.xlsx`,
18479
18464
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -18492,7 +18477,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
18492
18477
  {
18493
18478
  size: "sm",
18494
18479
  variant: "outline",
18495
- onClick: () => void exported().then((rows2) => download(`${name}.md`, "text/markdown;charset=utf-8", exportMarkdown(columns, rows2))).catch(
18480
+ onClick: () => void exported().then((rows2) => download(`${name}.md`, "text/markdown;charset=utf-8", fileMarkdown(columns, rows2))).catch(
18496
18481
  (thrown) => setFailure((0, refusals_exports.refusalFromThrown)(thrown, "The Markdown could not be written.", "The CSV beside this button carries the same rows."))
18497
18482
  ),
18498
18483
  children: "Markdown"
@@ -18504,7 +18489,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
18504
18489
  size: "sm",
18505
18490
  variant: "outline",
18506
18491
  onClick: () => void exported().then(async (rows2) => {
18507
- if (await copyText4(exportMarkdown(columns, rows2))) host.notify?.success("Markdown copied");
18492
+ if (await copyText4(fileMarkdown(columns, rows2))) host.notify?.success("Markdown copied");
18508
18493
  else host.notify?.error("Couldn\u2019t copy the Markdown");
18509
18494
  }).catch(
18510
18495
  (thrown) => setFailure((0, refusals_exports.refusalFromThrown)(thrown, "The Markdown could not be written.", "The CSV beside this button carries the same rows."))
@@ -18538,7 +18523,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
18538
18523
  sourceId: `records:${tableId}`,
18539
18524
  size: "xs",
18540
18525
  json: () => records.map((r) => r.document),
18541
- human: () => exportCsv(columns, toRows(columns, records, labels))
18526
+ human: () => fileCsv(columns, toRows(columns, records, labels))
18542
18527
  }
18543
18528
  ),
18544
18529
  viewHeld && "rows" in viewHeld && viewHeld.cut ? /* @__PURE__ */ jsx63("span", { className: "text-xs text-muted-foreground", children: cutWords(viewHeld.rows.length) }) : null,
@@ -21220,7 +21205,8 @@ function instant(value) {
21220
21205
  const at = value instanceof Date ? value : new Date(value);
21221
21206
  return Number.isNaN(at.getTime()) ? null : at;
21222
21207
  }
21223
- function minuteOfDay(at) {
21208
+ function minuteOfDay(instantAt) {
21209
+ const at = personWallNow(instantAt);
21224
21210
  return at.getHours() * 60 + at.getMinutes();
21225
21211
  }
21226
21212
  function timeLabel(minutes) {
@@ -21236,15 +21222,16 @@ function rescheduledValue(before, toDay, toMinute, moments = false) {
21236
21222
  if (toMinute !== null) {
21237
21223
  const at = dayDate(toDay);
21238
21224
  at.setHours(0, toMinute, 0, 0);
21239
- return at.toISOString();
21225
+ return instantFromPersonWall(at).toISOString();
21240
21226
  }
21241
21227
  const was = instant(before);
21242
21228
  if (was) {
21243
21229
  const at = dayDate(toDay);
21244
- at.setHours(was.getHours(), was.getMinutes(), was.getSeconds(), was.getMilliseconds());
21245
- return at.toISOString();
21230
+ const wasWall = personWallNow(was);
21231
+ at.setHours(wasWall.getHours(), wasWall.getMinutes(), wasWall.getSeconds(), wasWall.getMilliseconds());
21232
+ return instantFromPersonWall(at).toISOString();
21246
21233
  }
21247
- return moments ? dayDate(toDay).toISOString() : toDay;
21234
+ return moments ? instantFromPersonWall(dayDate(toDay)).toISOString() : toDay;
21248
21235
  }
21249
21236
  function shiftedEnd(end, startBefore, startAfter) {
21250
21237
  if (end === null || end === void 0 || end === "") return null;
@@ -21624,7 +21611,7 @@ function CalendarView({
21624
21611
  at.setHours(0, from, 0, 0);
21625
21612
  const end = new Date(dayDate(day2).getTime());
21626
21613
  end.setHours(0, to, 0, 0);
21627
- void createAt(at.toISOString(), end.toISOString(), `${calendarDayLabel(day2)}, ${timeLabel(from)}`);
21614
+ void createAt(instantFromPersonWall(at).toISOString(), instantFromPersonWall(end).toISOString(), `${calendarDayLabel(day2)}, ${timeLabel(from)}`);
21628
21615
  };
21629
21616
  window.addEventListener("pointermove", onMove);
21630
21617
  window.addEventListener("pointerup", onUp);
@@ -28464,6 +28451,7 @@ import { useRecordsClient as useRecordsClient68 } from "@ai-matrx/records/react"
28464
28451
  import { Badge as Badge13, Button as Button69, Checkbox as Checkbox6, Skeleton as Skeleton21, cn as cn45 } from "@ai-matrx/design-system";
28465
28452
  import { toggleSelection as toggleSelection2 } from "@ai-matrx/design-system/data-table";
28466
28453
  import { formatAbsoluteDate, formatDurationMs } from "@ai-matrx/kit/format";
28454
+ import { momentZoneOptions as momentZoneOptions3 } from "@ai-matrx/design-system/field-formats";
28467
28455
  import { Fragment as Fragment40, jsx as jsx94, jsxs as jsxs87 } from "react/jsx-runtime";
28468
28456
  var ACTION_KINDS = ["approval", "assignment", "proposal"];
28469
28457
  var KIND_WORD = WORK_INBOX_KIND_LABEL;
@@ -28507,7 +28495,7 @@ function groupInbox(items, by) {
28507
28495
  function whenWords2(iso) {
28508
28496
  const d = new Date(iso);
28509
28497
  if (Number.isNaN(d.getTime())) return iso;
28510
- return d.toLocaleString(void 0, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" });
28498
+ return d.toLocaleString(void 0, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit", ...momentZoneOptions3(d) });
28511
28499
  }
28512
28500
  var HOLD_STORE = "records-ui:held-decisions";
28513
28501
  function readHolds() {
@@ -32734,6 +32722,7 @@ import {
32734
32722
  formLookDocument
32735
32723
  } from "@ai-matrx/records/forms";
32736
32724
  import { OutboundLink } from "@ai-matrx/kit/outbound-react";
32725
+ import { momentZoneOptions as momentZoneOptions4 } from "@ai-matrx/design-system/field-formats";
32737
32726
  import { Fragment as Fragment46, jsx as jsx106, jsxs as jsxs99 } from "react/jsx-runtime";
32738
32727
  function freshFormName(base, taken) {
32739
32728
  const names = new Set(taken.map((n) => n.trim().toLowerCase()));
@@ -33102,7 +33091,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
33102
33091
  /* @__PURE__ */ jsxs99("span", { children: [
33103
33092
  "Unsaved changes from",
33104
33093
  " ",
33105
- new Date(restoredAt).toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" }),
33094
+ new Date(restoredAt).toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short", ...momentZoneOptions4(restoredAt) }),
33106
33095
  " restored"
33107
33096
  ] }),
33108
33097
  /* @__PURE__ */ jsx106(
@@ -36507,7 +36496,7 @@ import {
36507
36496
  useTable as useTable32,
36508
36497
  useRowActions as useRowActions2
36509
36498
  } from "@ai-matrx/records/react";
36510
- import { exportCsv as exportCsv2, onRecordChanged as onRecordChanged2 } from "@ai-matrx/records/core";
36499
+ import { onRecordChanged as onRecordChanged2 } from "@ai-matrx/records/core";
36511
36500
  import { downloadFile as downloadFile2 } from "@ai-matrx/kit/download";
36512
36501
  import { formatCount as formatCount6 } from "@ai-matrx/kit/format";
36513
36502
  import { BasicInput as BasicInput22, Button as Button87, Checkbox as Checkbox12, Skeleton as Skeleton36, cn as cn63 } from "@ai-matrx/design-system";
@@ -36584,7 +36573,7 @@ function useDoorRows(door, elementId, recordId) {
36584
36573
  );
36585
36574
  }
36586
36575
  function downloadCsv(name, fields, rows) {
36587
- downloadFile2(`${fileNameOf(name) || "export"}.csv`, exportCsv2(fields, toRows(fields, rows)), "text/csv");
36576
+ downloadFile2(`${fileNameOf(name) || "export"}.csv`, fileCsv(fields, toRows(fields, rows)), "text/csv");
36588
36577
  }
36589
36578
  function CsvButton({ name, fields, rows }) {
36590
36579
  if (rows.length === 0) return null;
@@ -38425,6 +38414,7 @@ import {
38425
38414
  } from "@ai-matrx/records";
38426
38415
  import { useRecordsClient as useRecordsClient87 } from "@ai-matrx/records/react";
38427
38416
  import { Button as Button91, Input as Input7, Skeleton as Skeleton40, Textarea as Textarea6, cn as cn67 } from "@ai-matrx/design-system";
38417
+ import { momentZoneOptions as momentZoneOptions5 } from "@ai-matrx/design-system/field-formats";
38428
38418
  import { jsx as jsx119, jsxs as jsxs112 } from "react/jsx-runtime";
38429
38419
  function controlFor(field) {
38430
38420
  if (!field) return "text";
@@ -38628,7 +38618,7 @@ function CaptureRun({ sheetId, face: given, className }) {
38628
38618
  counts.refused,
38629
38619
  " to fix"
38630
38620
  ] }) : null,
38631
- /* @__PURE__ */ jsx119("span", { className: "ml-auto", "data-testid": "capture-last-synced", children: lastSynced ? `Last synced ${new Date(lastSynced).toLocaleTimeString()}` : "Not synced yet" }),
38621
+ /* @__PURE__ */ jsx119("span", { className: "ml-auto", "data-testid": "capture-last-synced", children: lastSynced ? `Last synced ${new Date(lastSynced).toLocaleTimeString(void 0, momentZoneOptions5(lastSynced))}` : "Not synced yet" }),
38632
38622
  waiting > 0 || counts.refused > 0 ? /* @__PURE__ */ jsx119(
38633
38623
  Button91,
38634
38624
  {
@@ -38643,7 +38633,7 @@ function CaptureRun({ sheetId, face: given, className }) {
38643
38633
  ) : null
38644
38634
  ] });
38645
38635
  const queuePanel = items.filter((i) => i.state !== "landed").length > 0 ? /* @__PURE__ */ jsx119("ul", { className: "flex flex-col gap-1 rounded border p-2", "data-testid": "capture-queue", children: items.filter((i) => i.state !== "landed").map((i) => /* @__PURE__ */ jsxs112("li", { className: "flex items-start gap-2 text-[11px]", children: [
38646
- /* @__PURE__ */ jsx119("span", { className: "tabular-nums text-muted-foreground", children: new Date(i.captured_at).toLocaleTimeString() }),
38636
+ /* @__PURE__ */ jsx119("span", { className: "tabular-nums text-muted-foreground", children: new Date(i.captured_at).toLocaleTimeString(void 0, momentZoneOptions5(i.captured_at)) }),
38647
38637
  i.state === "refused" ? (
38648
38638
  // THE STORE REFUSED THIS ONE: a refusal line, heading and remedy
38649
38639
  // both — never its raw words in red (lane REFUSAL-SWEEP).
@@ -38827,6 +38817,7 @@ function CaptureRun({ sheetId, face: given, className }) {
38827
38817
  }
38828
38818
 
38829
38819
  // src/CaptureSheet.tsx
38820
+ import { momentZoneOptions as momentZoneOptions6 } from "@ai-matrx/design-system/field-formats";
38830
38821
  import { Fragment as Fragment54, jsx as jsx120, jsxs as jsxs113 } from "react/jsx-runtime";
38831
38822
  var CAPTURE_MODES = ["reading", "photo", "voice"];
38832
38823
  var IN_MEMORY_QUEUE_REASON = "Anything you capture while offline is held only in this page until it can be sent, and it is lost if you close the tab. Keep this page open until you are back on a connection. It is said here rather than discovered later.";
@@ -39055,7 +39046,7 @@ function AdHocCaptureSheet({
39055
39046
  )
39056
39047
  ] }),
39057
39048
  /* @__PURE__ */ jsx120("ul", { className: "flex flex-col gap-0.5", children: pending.map((item) => /* @__PURE__ */ jsxs113("li", { className: "text-[11px] text-muted-foreground", children: [
39058
- new Date(item.capturedAt).toLocaleTimeString(),
39049
+ new Date(item.capturedAt).toLocaleTimeString(void 0, momentZoneOptions6(item.capturedAt)),
39059
39050
  " \xB7 ",
39060
39051
  item.attempts,
39061
39052
  " tried",
@@ -39533,7 +39524,6 @@ function CalendarSubscribeDialog({
39533
39524
  import { copyText as copyText11 } from "@ai-matrx/kit/clipboard";
39534
39525
  import { openPrintWindow as openPrintWindow2 } from "@ai-matrx/print/core";
39535
39526
  import { printMarkdown, renderMarkdownDocument } from "@ai-matrx/print/markdown";
39536
- import { exportCsv as exportCsv3, exportMarkdown as exportMarkdown2 } from "@ai-matrx/records/core";
39537
39527
  var NO_VIEW_REASON = "No saved view yet";
39538
39528
  function viewLink(tableId, viewId, origin) {
39539
39529
  return `${tableLink(tableId, origin)}?view=${encodeURIComponent(viewId)}`;
@@ -39569,7 +39559,7 @@ async function downloadViewCsv(args) {
39569
39559
  const columns = viewColumns(fields, view.presentation);
39570
39560
  const rows = await rowsForFile({ client, host, fields: columns, records: read.rows, labels });
39571
39561
  const name = fileNameOf(args.tableName) || "records";
39572
- download(`${name}.csv`, "text/csv;charset=utf-8", exportCsv3(columns, rows));
39562
+ download(`${name}.csv`, "text/csv;charset=utf-8", fileCsv(columns, rows));
39573
39563
  host.notify?.success(read.cut ? cutWords(read.rows.length) : "CSV downloaded");
39574
39564
  }
39575
39565
  function downloadMarkdownAction(args) {
@@ -39598,7 +39588,7 @@ async function readViewMarkdown(args) {
39598
39588
  if ("error" in read) return null;
39599
39589
  const columns = viewColumns(fields, view.presentation);
39600
39590
  const rows = await rowsForFile({ client, host, fields: columns, records: read.rows, labels });
39601
- return { markdown: exportMarkdown2(columns, rows), cut: read.cut, count: read.rows.length };
39591
+ return { markdown: fileMarkdown(columns, rows), cut: read.cut, count: read.rows.length };
39602
39592
  }
39603
39593
  async function downloadViewMarkdown(args) {
39604
39594
  const table = await readViewMarkdown(args);
@@ -42389,8 +42379,9 @@ function TablePage2(props) {
42389
42379
  import { useCallback as useCallback62, useEffect as useEffect108, useState as useState123 } from "react";
42390
42380
  import { asRefusal as asRefusal4 } from "@ai-matrx/records/versions";
42391
42381
  import { Button as Button102 } from "@ai-matrx/design-system";
42382
+ import { momentZoneOptions as momentZoneOptions7 } from "@ai-matrx/design-system/field-formats";
42392
42383
  import { jsx as jsx135, jsxs as jsxs127 } from "react/jsx-runtime";
42393
- var day = (iso) => iso ? new Date(iso).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }) : null;
42384
+ var day = (iso) => iso ? new Date(iso).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric", ...momentZoneOptions7(iso) }) : null;
42394
42385
  function CalendarLinks({ port }) {
42395
42386
  const [rows, setRows] = useState123(null);
42396
42387
  const [error, setError] = useState123(null);