@ai-matrx/records-ui 0.116.59 → 0.116.61
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 +73 -1
- package/dist/{SaveToTable-2TQKEYJA.js → SaveToTable-VPLDWCSU.js} +4 -4
- package/dist/{chunk-AJVN4BMI.js → chunk-2YK72GHL.js} +305 -248
- package/dist/chunk-2YK72GHL.js.map +1 -0
- package/dist/{chunk-NGOPU3AJ.js → chunk-4KWCNW7V.js} +5 -4
- package/dist/{chunk-NGOPU3AJ.js.map → chunk-4KWCNW7V.js.map} +1 -1
- package/dist/{chunk-MBUW42SM.js → chunk-NBL26U5K.js} +2 -2
- package/dist/{chunk-4ZS4WEEE.js → chunk-TEYXG4XD.js} +73 -4
- package/dist/chunk-TEYXG4XD.js.map +1 -0
- package/dist/{chunk-HAWACXPU.js → chunk-W6FX3XVF.js} +2 -2
- package/dist/{chunk-Y6U5OFJX.js → chunk-WXYI4DKC.js} +3 -3
- package/dist/data-source.cjs +2 -1
- package/dist/data-source.cjs.map +1 -1
- package/dist/data-source.js +2 -1
- package/dist/data-source.js.map +1 -1
- package/dist/helpers.cjs +7 -7
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +8 -8
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +734 -617
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +56 -64
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +106 -96
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +4 -4
- package/dist/skeleton.js +3 -3
- package/package.json +6 -6
- package/dist/chunk-4ZS4WEEE.js.map +0 -1
- package/dist/chunk-AJVN4BMI.js.map +0 -1
- /package/dist/{SaveToTable-2TQKEYJA.js.map → SaveToTable-VPLDWCSU.js.map} +0 -0
- /package/dist/{chunk-MBUW42SM.js.map → chunk-NBL26U5K.js.map} +0 -0
- /package/dist/{chunk-HAWACXPU.js.map → chunk-W6FX3XVF.js.map} +0 -0
- /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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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",
|
|
@@ -2601,7 +2608,7 @@ import {
|
|
|
2601
2608
|
} from "@ai-matrx/records/react";
|
|
2602
2609
|
import { autonumberSearchOf, filterWithAutonumber } from "@ai-matrx/records";
|
|
2603
2610
|
import { asPermissionLevel, relationNameIndexOf, relationNamesIn } from "@ai-matrx/records";
|
|
2604
|
-
import { MatrxDataTable, MatrxTableCardShowMore, tableStyleIsEmpty, useMatrxTableCard } from "@ai-matrx/design-system/data-table";
|
|
2611
|
+
import { MatrxDataTable, MatrxTableCardShowMore, tableStyleIsEmpty, useMatrxDataTableHost, useMatrxTableCard } from "@ai-matrx/design-system/data-table";
|
|
2605
2612
|
import { announceRecordChanged as announceRecordChanged3, predictWriteRefusals as predictWriteRefusals2 } from "@ai-matrx/records/core";
|
|
2606
2613
|
|
|
2607
2614
|
// src/tableDecorations.ts
|
|
@@ -12490,6 +12497,7 @@ function GridBody({
|
|
|
12490
12497
|
);
|
|
12491
12498
|
const merged = host.grid === "merged";
|
|
12492
12499
|
const phone = useIsMobile();
|
|
12500
|
+
const macLook = useMatrxDataTableHost().defaultLook === "mac";
|
|
12493
12501
|
const toolbarFold2 = useTableToolbarFold();
|
|
12494
12502
|
const sheetExtras = useTableToolbarSheetExtras();
|
|
12495
12503
|
const rights = useTableRights(table.data);
|
|
@@ -14522,7 +14530,7 @@ function GridBody({
|
|
|
14522
14530
|
tableClassName: cn14(
|
|
14523
14531
|
!look.wrap && lines === 1 && "[&_tbody_td]:max-w-[28rem] [&_tbody_td]:overflow-hidden [&_tbody_td]:text-ellipsis [&_tbody_td]:whitespace-nowrap! [&_tbody_td_*:not(textarea)]:whitespace-nowrap!",
|
|
14524
14532
|
// (A textarea is only ever an OPEN long-text editor, whose words must wrap — records walk D10.)
|
|
14525
|
-
embedded && EMBEDDED_TABLE_CLASS,
|
|
14533
|
+
embedded && !macLook && EMBEDDED_TABLE_CLASS,
|
|
14526
14534
|
embedded && !calculationChosen && EMBEDDED_PLAIN_FOOTER_CLASS
|
|
14527
14535
|
),
|
|
14528
14536
|
footerRows,
|
|
@@ -15548,6 +15556,7 @@ function AddBody({ tableId }) {
|
|
|
15548
15556
|
|
|
15549
15557
|
// src/Peek.tsx
|
|
15550
15558
|
import { humanizeIdentifier as humanizeIdentifier7 } from "@ai-matrx/kit/text-case";
|
|
15559
|
+
import { momentZoneOptions } from "@ai-matrx/design-system/field-formats";
|
|
15551
15560
|
import { Fragment as Fragment18, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
15552
15561
|
function drawnBelowOnPage(field, bodyKey) {
|
|
15553
15562
|
return field.key === bodyKey || editorKindFor(field) === "relation";
|
|
@@ -15574,7 +15583,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
15574
15583
|
const document2 = record.data?.document;
|
|
15575
15584
|
if (document2 && isLockedStub({ document: document2, level: null })) {
|
|
15576
15585
|
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;
|
|
15586
|
+
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
15587
|
return /* @__PURE__ */ jsxs46("p", { className: cn17("text-sm text-muted-foreground", className), "data-records-locked-record": "", children: [
|
|
15579
15588
|
"You can't open this record",
|
|
15580
15589
|
when ? `. Filed ${when}.` : "."
|
|
@@ -15722,7 +15731,7 @@ function computedInPlainWords(row, field) {
|
|
|
15722
15731
|
const name = field ? fieldName(field) : humanizeIdentifier7(row.field_key);
|
|
15723
15732
|
const shown4 = row.value === null || row.value === void 0 || row.value === "" ? "nothing" : field ? scalarText(field, row.value) : String(row.value);
|
|
15724
15733
|
const when = new Date(row.computed_at);
|
|
15725
|
-
const at = Number.isNaN(when.getTime()) ? "" : ` on ${when.toLocaleDateString()}`;
|
|
15734
|
+
const at = Number.isNaN(when.getTime()) ? "" : ` on ${when.toLocaleDateString(void 0, momentZoneOptions(when))}`;
|
|
15726
15735
|
return `${name}: ${shown4}${at}`;
|
|
15727
15736
|
}
|
|
15728
15737
|
|
|
@@ -16120,6 +16129,7 @@ function MigrationLog({ entries, readError, canUndo, whyNotUndo, onUndone, class
|
|
|
16120
16129
|
}
|
|
16121
16130
|
|
|
16122
16131
|
// src/HistoryPanel.tsx
|
|
16132
|
+
import { momentZoneOptions as momentZoneOptions2 } from "@ai-matrx/design-system/field-formats";
|
|
16123
16133
|
import { Fragment as Fragment20, jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
16124
16134
|
function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
|
|
16125
16135
|
usePeopleTick();
|
|
@@ -16597,9 +16607,9 @@ function whenText(at) {
|
|
|
16597
16607
|
if (Number.isNaN(age)) return "\u2014";
|
|
16598
16608
|
if (age < 864e5) return formatRelativeTime3(then, { style: "intl" });
|
|
16599
16609
|
if (age < 7 * 864e5) {
|
|
16600
|
-
return then.toLocaleString(void 0, { weekday: "short", hour: "numeric", minute: "2-digit" });
|
|
16610
|
+
return then.toLocaleString(void 0, { weekday: "short", hour: "numeric", minute: "2-digit", ...momentZoneOptions2(then) });
|
|
16601
16611
|
}
|
|
16602
|
-
return then.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
|
|
16612
|
+
return then.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric", ...momentZoneOptions2(then) });
|
|
16603
16613
|
}
|
|
16604
16614
|
function say(value, field) {
|
|
16605
16615
|
if (value === null || value === void 0 || value === "") return "nothing";
|
|
@@ -18290,7 +18300,7 @@ import { copyText as copyText4 } from "@ai-matrx/kit/clipboard";
|
|
|
18290
18300
|
import { downloadFile } from "@ai-matrx/kit/download";
|
|
18291
18301
|
import { useEffect as useEffect49, useRef as useRef28, useState as useState57 } from "react";
|
|
18292
18302
|
import { useFields as useFields17, useRecords as useRecords4, useRecordsClient as useRecordsClient49, useTable as useTable18 } from "@ai-matrx/records/react";
|
|
18293
|
-
import {
|
|
18303
|
+
import { withWholeValues } from "@ai-matrx/records/core";
|
|
18294
18304
|
|
|
18295
18305
|
// src/viewExport.ts
|
|
18296
18306
|
import { formatCount as formatCount3 } from "@ai-matrx/kit/format";
|
|
@@ -18347,30 +18357,6 @@ function cutWords(written) {
|
|
|
18347
18357
|
import { AlchemyMenu as AlchemyMenu2 } from "@ai-matrx/alchemy/react";
|
|
18348
18358
|
import { Button as Button49, cn as cn25 } from "@ai-matrx/design-system";
|
|
18349
18359
|
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
18360
|
function fileNameOf(name) {
|
|
18375
18361
|
return name.replace(/[\\/:*?"<>|\u0000-\u001f]+/g, " ").replace(/\s+/g, " ").trim();
|
|
18376
18362
|
}
|
|
@@ -18452,7 +18438,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
18452
18438
|
{
|
|
18453
18439
|
size: "sm",
|
|
18454
18440
|
variant: "outline",
|
|
18455
|
-
onClick: () => void exported().then((rows2) => download(`${name}.csv`, "text/csv;charset=utf-8",
|
|
18441
|
+
onClick: () => void exported().then((rows2) => download(`${name}.csv`, "text/csv;charset=utf-8", fileCsv(columns, rows2))).catch(
|
|
18456
18442
|
(thrown) => setFailure((0, refusals_exports.refusalFromThrown)(thrown, "The CSV could not be written.", "Try again in a moment."))
|
|
18457
18443
|
),
|
|
18458
18444
|
children: "CSV"
|
|
@@ -18473,7 +18459,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
18473
18459
|
);
|
|
18474
18460
|
setFailure(null);
|
|
18475
18461
|
try {
|
|
18476
|
-
exported().then((rows2) =>
|
|
18462
|
+
exported().then((rows2) => fileXlsx(columns, rows2, name)).then(
|
|
18477
18463
|
(bytes) => download(
|
|
18478
18464
|
`${name}.xlsx`,
|
|
18479
18465
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
@@ -18492,7 +18478,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
18492
18478
|
{
|
|
18493
18479
|
size: "sm",
|
|
18494
18480
|
variant: "outline",
|
|
18495
|
-
onClick: () => void exported().then((rows2) => download(`${name}.md`, "text/markdown;charset=utf-8",
|
|
18481
|
+
onClick: () => void exported().then((rows2) => download(`${name}.md`, "text/markdown;charset=utf-8", fileMarkdown(columns, rows2))).catch(
|
|
18496
18482
|
(thrown) => setFailure((0, refusals_exports.refusalFromThrown)(thrown, "The Markdown could not be written.", "The CSV beside this button carries the same rows."))
|
|
18497
18483
|
),
|
|
18498
18484
|
children: "Markdown"
|
|
@@ -18504,7 +18490,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
18504
18490
|
size: "sm",
|
|
18505
18491
|
variant: "outline",
|
|
18506
18492
|
onClick: () => void exported().then(async (rows2) => {
|
|
18507
|
-
if (await copyText4(
|
|
18493
|
+
if (await copyText4(fileMarkdown(columns, rows2))) host.notify?.success("Markdown copied");
|
|
18508
18494
|
else host.notify?.error("Couldn\u2019t copy the Markdown");
|
|
18509
18495
|
}).catch(
|
|
18510
18496
|
(thrown) => setFailure((0, refusals_exports.refusalFromThrown)(thrown, "The Markdown could not be written.", "The CSV beside this button carries the same rows."))
|
|
@@ -18538,7 +18524,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
18538
18524
|
sourceId: `records:${tableId}`,
|
|
18539
18525
|
size: "xs",
|
|
18540
18526
|
json: () => records.map((r) => r.document),
|
|
18541
|
-
human: () =>
|
|
18527
|
+
human: () => fileCsv(columns, toRows(columns, records, labels))
|
|
18542
18528
|
}
|
|
18543
18529
|
),
|
|
18544
18530
|
viewHeld && "rows" in viewHeld && viewHeld.cut ? /* @__PURE__ */ jsx63("span", { className: "text-xs text-muted-foreground", children: cutWords(viewHeld.rows.length) }) : null,
|
|
@@ -21220,7 +21206,8 @@ function instant(value) {
|
|
|
21220
21206
|
const at = value instanceof Date ? value : new Date(value);
|
|
21221
21207
|
return Number.isNaN(at.getTime()) ? null : at;
|
|
21222
21208
|
}
|
|
21223
|
-
function minuteOfDay(
|
|
21209
|
+
function minuteOfDay(instantAt) {
|
|
21210
|
+
const at = personWallNow(instantAt);
|
|
21224
21211
|
return at.getHours() * 60 + at.getMinutes();
|
|
21225
21212
|
}
|
|
21226
21213
|
function timeLabel(minutes) {
|
|
@@ -21236,15 +21223,16 @@ function rescheduledValue(before, toDay, toMinute, moments = false) {
|
|
|
21236
21223
|
if (toMinute !== null) {
|
|
21237
21224
|
const at = dayDate(toDay);
|
|
21238
21225
|
at.setHours(0, toMinute, 0, 0);
|
|
21239
|
-
return at.toISOString();
|
|
21226
|
+
return instantFromPersonWall(at).toISOString();
|
|
21240
21227
|
}
|
|
21241
21228
|
const was = instant(before);
|
|
21242
21229
|
if (was) {
|
|
21243
21230
|
const at = dayDate(toDay);
|
|
21244
|
-
|
|
21245
|
-
|
|
21231
|
+
const wasWall = personWallNow(was);
|
|
21232
|
+
at.setHours(wasWall.getHours(), wasWall.getMinutes(), wasWall.getSeconds(), wasWall.getMilliseconds());
|
|
21233
|
+
return instantFromPersonWall(at).toISOString();
|
|
21246
21234
|
}
|
|
21247
|
-
return moments ? dayDate(toDay).toISOString() : toDay;
|
|
21235
|
+
return moments ? instantFromPersonWall(dayDate(toDay)).toISOString() : toDay;
|
|
21248
21236
|
}
|
|
21249
21237
|
function shiftedEnd(end, startBefore, startAfter) {
|
|
21250
21238
|
if (end === null || end === void 0 || end === "") return null;
|
|
@@ -21624,7 +21612,7 @@ function CalendarView({
|
|
|
21624
21612
|
at.setHours(0, from, 0, 0);
|
|
21625
21613
|
const end = new Date(dayDate(day2).getTime());
|
|
21626
21614
|
end.setHours(0, to, 0, 0);
|
|
21627
|
-
void createAt(at.toISOString(), end.toISOString(), `${calendarDayLabel(day2)}, ${timeLabel(from)}`);
|
|
21615
|
+
void createAt(instantFromPersonWall(at).toISOString(), instantFromPersonWall(end).toISOString(), `${calendarDayLabel(day2)}, ${timeLabel(from)}`);
|
|
21628
21616
|
};
|
|
21629
21617
|
window.addEventListener("pointermove", onMove);
|
|
21630
21618
|
window.addEventListener("pointerup", onUp);
|
|
@@ -28464,6 +28452,7 @@ import { useRecordsClient as useRecordsClient68 } from "@ai-matrx/records/react"
|
|
|
28464
28452
|
import { Badge as Badge13, Button as Button69, Checkbox as Checkbox6, Skeleton as Skeleton21, cn as cn45 } from "@ai-matrx/design-system";
|
|
28465
28453
|
import { toggleSelection as toggleSelection2 } from "@ai-matrx/design-system/data-table";
|
|
28466
28454
|
import { formatAbsoluteDate, formatDurationMs } from "@ai-matrx/kit/format";
|
|
28455
|
+
import { momentZoneOptions as momentZoneOptions3 } from "@ai-matrx/design-system/field-formats";
|
|
28467
28456
|
import { Fragment as Fragment40, jsx as jsx94, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
28468
28457
|
var ACTION_KINDS = ["approval", "assignment", "proposal"];
|
|
28469
28458
|
var KIND_WORD = WORK_INBOX_KIND_LABEL;
|
|
@@ -28507,7 +28496,7 @@ function groupInbox(items, by) {
|
|
|
28507
28496
|
function whenWords2(iso) {
|
|
28508
28497
|
const d = new Date(iso);
|
|
28509
28498
|
if (Number.isNaN(d.getTime())) return iso;
|
|
28510
|
-
return d.toLocaleString(void 0, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" });
|
|
28499
|
+
return d.toLocaleString(void 0, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit", ...momentZoneOptions3(d) });
|
|
28511
28500
|
}
|
|
28512
28501
|
var HOLD_STORE = "records-ui:held-decisions";
|
|
28513
28502
|
function readHolds() {
|
|
@@ -32734,6 +32723,7 @@ import {
|
|
|
32734
32723
|
formLookDocument
|
|
32735
32724
|
} from "@ai-matrx/records/forms";
|
|
32736
32725
|
import { OutboundLink } from "@ai-matrx/kit/outbound-react";
|
|
32726
|
+
import { momentZoneOptions as momentZoneOptions4 } from "@ai-matrx/design-system/field-formats";
|
|
32737
32727
|
import { Fragment as Fragment46, jsx as jsx106, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
32738
32728
|
function freshFormName(base, taken) {
|
|
32739
32729
|
const names = new Set(taken.map((n) => n.trim().toLowerCase()));
|
|
@@ -33102,7 +33092,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
33102
33092
|
/* @__PURE__ */ jsxs99("span", { children: [
|
|
33103
33093
|
"Unsaved changes from",
|
|
33104
33094
|
" ",
|
|
33105
|
-
new Date(restoredAt).toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" }),
|
|
33095
|
+
new Date(restoredAt).toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short", ...momentZoneOptions4(restoredAt) }),
|
|
33106
33096
|
" restored"
|
|
33107
33097
|
] }),
|
|
33108
33098
|
/* @__PURE__ */ jsx106(
|
|
@@ -36507,7 +36497,7 @@ import {
|
|
|
36507
36497
|
useTable as useTable32,
|
|
36508
36498
|
useRowActions as useRowActions2
|
|
36509
36499
|
} from "@ai-matrx/records/react";
|
|
36510
|
-
import {
|
|
36500
|
+
import { onRecordChanged as onRecordChanged2 } from "@ai-matrx/records/core";
|
|
36511
36501
|
import { downloadFile as downloadFile2 } from "@ai-matrx/kit/download";
|
|
36512
36502
|
import { formatCount as formatCount6 } from "@ai-matrx/kit/format";
|
|
36513
36503
|
import { BasicInput as BasicInput22, Button as Button87, Checkbox as Checkbox12, Skeleton as Skeleton36, cn as cn63 } from "@ai-matrx/design-system";
|
|
@@ -36584,7 +36574,7 @@ function useDoorRows(door, elementId, recordId) {
|
|
|
36584
36574
|
);
|
|
36585
36575
|
}
|
|
36586
36576
|
function downloadCsv(name, fields, rows) {
|
|
36587
|
-
downloadFile2(`${fileNameOf(name) || "export"}.csv`,
|
|
36577
|
+
downloadFile2(`${fileNameOf(name) || "export"}.csv`, fileCsv(fields, toRows(fields, rows)), "text/csv");
|
|
36588
36578
|
}
|
|
36589
36579
|
function CsvButton({ name, fields, rows }) {
|
|
36590
36580
|
if (rows.length === 0) return null;
|
|
@@ -38425,6 +38415,7 @@ import {
|
|
|
38425
38415
|
} from "@ai-matrx/records";
|
|
38426
38416
|
import { useRecordsClient as useRecordsClient87 } from "@ai-matrx/records/react";
|
|
38427
38417
|
import { Button as Button91, Input as Input7, Skeleton as Skeleton40, Textarea as Textarea6, cn as cn67 } from "@ai-matrx/design-system";
|
|
38418
|
+
import { momentZoneOptions as momentZoneOptions5 } from "@ai-matrx/design-system/field-formats";
|
|
38428
38419
|
import { jsx as jsx119, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
38429
38420
|
function controlFor(field) {
|
|
38430
38421
|
if (!field) return "text";
|
|
@@ -38628,7 +38619,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
38628
38619
|
counts.refused,
|
|
38629
38620
|
" to fix"
|
|
38630
38621
|
] }) : null,
|
|
38631
|
-
/* @__PURE__ */ jsx119("span", { className: "ml-auto", "data-testid": "capture-last-synced", children: lastSynced ? `Last synced ${new Date(lastSynced).toLocaleTimeString()}` : "Not synced yet" }),
|
|
38622
|
+
/* @__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
38623
|
waiting > 0 || counts.refused > 0 ? /* @__PURE__ */ jsx119(
|
|
38633
38624
|
Button91,
|
|
38634
38625
|
{
|
|
@@ -38643,7 +38634,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
38643
38634
|
) : null
|
|
38644
38635
|
] });
|
|
38645
38636
|
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() }),
|
|
38637
|
+
/* @__PURE__ */ jsx119("span", { className: "tabular-nums text-muted-foreground", children: new Date(i.captured_at).toLocaleTimeString(void 0, momentZoneOptions5(i.captured_at)) }),
|
|
38647
38638
|
i.state === "refused" ? (
|
|
38648
38639
|
// THE STORE REFUSED THIS ONE: a refusal line, heading and remedy
|
|
38649
38640
|
// both — never its raw words in red (lane REFUSAL-SWEEP).
|
|
@@ -38827,6 +38818,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
38827
38818
|
}
|
|
38828
38819
|
|
|
38829
38820
|
// src/CaptureSheet.tsx
|
|
38821
|
+
import { momentZoneOptions as momentZoneOptions6 } from "@ai-matrx/design-system/field-formats";
|
|
38830
38822
|
import { Fragment as Fragment54, jsx as jsx120, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
38831
38823
|
var CAPTURE_MODES = ["reading", "photo", "voice"];
|
|
38832
38824
|
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 +39047,7 @@ function AdHocCaptureSheet({
|
|
|
39055
39047
|
)
|
|
39056
39048
|
] }),
|
|
39057
39049
|
/* @__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(),
|
|
39050
|
+
new Date(item.capturedAt).toLocaleTimeString(void 0, momentZoneOptions6(item.capturedAt)),
|
|
39059
39051
|
" \xB7 ",
|
|
39060
39052
|
item.attempts,
|
|
39061
39053
|
" tried",
|
|
@@ -39533,7 +39525,6 @@ function CalendarSubscribeDialog({
|
|
|
39533
39525
|
import { copyText as copyText11 } from "@ai-matrx/kit/clipboard";
|
|
39534
39526
|
import { openPrintWindow as openPrintWindow2 } from "@ai-matrx/print/core";
|
|
39535
39527
|
import { printMarkdown, renderMarkdownDocument } from "@ai-matrx/print/markdown";
|
|
39536
|
-
import { exportCsv as exportCsv3, exportMarkdown as exportMarkdown2 } from "@ai-matrx/records/core";
|
|
39537
39528
|
var NO_VIEW_REASON = "No saved view yet";
|
|
39538
39529
|
function viewLink(tableId, viewId, origin) {
|
|
39539
39530
|
return `${tableLink(tableId, origin)}?view=${encodeURIComponent(viewId)}`;
|
|
@@ -39569,7 +39560,7 @@ async function downloadViewCsv(args) {
|
|
|
39569
39560
|
const columns = viewColumns(fields, view.presentation);
|
|
39570
39561
|
const rows = await rowsForFile({ client, host, fields: columns, records: read.rows, labels });
|
|
39571
39562
|
const name = fileNameOf(args.tableName) || "records";
|
|
39572
|
-
download(`${name}.csv`, "text/csv;charset=utf-8",
|
|
39563
|
+
download(`${name}.csv`, "text/csv;charset=utf-8", fileCsv(columns, rows));
|
|
39573
39564
|
host.notify?.success(read.cut ? cutWords(read.rows.length) : "CSV downloaded");
|
|
39574
39565
|
}
|
|
39575
39566
|
function downloadMarkdownAction(args) {
|
|
@@ -39598,7 +39589,7 @@ async function readViewMarkdown(args) {
|
|
|
39598
39589
|
if ("error" in read) return null;
|
|
39599
39590
|
const columns = viewColumns(fields, view.presentation);
|
|
39600
39591
|
const rows = await rowsForFile({ client, host, fields: columns, records: read.rows, labels });
|
|
39601
|
-
return { markdown:
|
|
39592
|
+
return { markdown: fileMarkdown(columns, rows), cut: read.cut, count: read.rows.length };
|
|
39602
39593
|
}
|
|
39603
39594
|
async function downloadViewMarkdown(args) {
|
|
39604
39595
|
const table = await readViewMarkdown(args);
|
|
@@ -42389,8 +42380,9 @@ function TablePage2(props) {
|
|
|
42389
42380
|
import { useCallback as useCallback62, useEffect as useEffect108, useState as useState123 } from "react";
|
|
42390
42381
|
import { asRefusal as asRefusal4 } from "@ai-matrx/records/versions";
|
|
42391
42382
|
import { Button as Button102 } from "@ai-matrx/design-system";
|
|
42383
|
+
import { momentZoneOptions as momentZoneOptions7 } from "@ai-matrx/design-system/field-formats";
|
|
42392
42384
|
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;
|
|
42385
|
+
var day = (iso) => iso ? new Date(iso).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric", ...momentZoneOptions7(iso) }) : null;
|
|
42394
42386
|
function CalendarLinks({ port }) {
|
|
42395
42387
|
const [rows, setRows] = useState123(null);
|
|
42396
42388
|
const [error, setError] = useState123(null);
|