@ai-matrx/records-ui 0.110.11 → 0.111.0
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 +12 -0
- package/dist/index.cjs +199 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +143 -48
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -11097,7 +11097,7 @@ function useWholeTableCount(args) {
|
|
|
11097
11097
|
// src/Grid.tsx
|
|
11098
11098
|
var import_react123 = require("react");
|
|
11099
11099
|
var import_react124 = require("@ai-matrx/records/react");
|
|
11100
|
-
var
|
|
11100
|
+
var import_records38 = require("@ai-matrx/records");
|
|
11101
11101
|
var import_data_table13 = require("@ai-matrx/design-system/data-table");
|
|
11102
11102
|
var import_core20 = require("@ai-matrx/records/core");
|
|
11103
11103
|
|
|
@@ -12862,8 +12862,9 @@ function FieldEditor(props) {
|
|
|
12862
12862
|
const sensitivities = onEntity ? SENSITIVITIES.filter((row) => row.value === "public" || row.value === "internal") : SENSITIVITIES;
|
|
12863
12863
|
const copyOf = field2 ? void 0 : props.copyOf;
|
|
12864
12864
|
const start = field2 ?? copyOf;
|
|
12865
|
-
const
|
|
12866
|
-
const [
|
|
12865
|
+
const startAs = start ? void 0 : props.startAs;
|
|
12866
|
+
const [label, setLabel] = (0, import_react65.useState)(field2?.label ?? (copyOf ? `${copyOf.label} (1)` : startAs?.label ?? ""));
|
|
12867
|
+
const [type, setType] = (0, import_react65.useState)(() => startAs ? startAs.type : startingType(start));
|
|
12867
12868
|
const [required, setRequired] = (0, import_react65.useState)(start?.required ?? false);
|
|
12868
12869
|
const [multi, setMulti] = (0, import_react65.useState)(start?.multi ?? false);
|
|
12869
12870
|
const [dated, setDated] = (0, import_react65.useState)(start?.dated ?? false);
|
|
@@ -12930,6 +12931,9 @@ function FieldEditor(props) {
|
|
|
12930
12931
|
);
|
|
12931
12932
|
const rollupFilterChanged = JSON.stringify(rollupFilter) !== JSON.stringify(savedRollupFilter);
|
|
12932
12933
|
const [relationTarget, setRelationTarget] = (0, import_react65.useState)(String(start?.relation_target ?? ""));
|
|
12934
|
+
const [showOnOther, setShowOnOther] = (0, import_react65.useState)(true);
|
|
12935
|
+
const [reverseRefused, setReverseRefused] = (0, import_react65.useState)(null);
|
|
12936
|
+
const otherTable = (0, import_react66.useTable)(!field2 && type === "relation" && relationTarget !== "" ? relationTarget : null);
|
|
12933
12937
|
const [display, setDisplay] = (0, import_react65.useState)(start?.display ?? null);
|
|
12934
12938
|
const [formulaOp, setFormulaOp] = (0, import_react65.useState)(() => formulaOpOf(start));
|
|
12935
12939
|
const [formulaFields, setFormulaFields] = (0, import_react65.useState)(() => formulaFieldIdsOf(start));
|
|
@@ -13141,6 +13145,15 @@ function FieldEditor(props) {
|
|
|
13141
13145
|
}
|
|
13142
13146
|
}
|
|
13143
13147
|
setBackfillError(null);
|
|
13148
|
+
if (type === "relation" && showOnOther && otherTable.data && otherTable.data.id !== tableId) {
|
|
13149
|
+
const made = await client.relationReverseField({ field_id: written });
|
|
13150
|
+
if (!made.ok) {
|
|
13151
|
+
setReverseRefused(made.error);
|
|
13152
|
+
return;
|
|
13153
|
+
}
|
|
13154
|
+
(0, import_react66.tableShapeChanged)(relationTarget);
|
|
13155
|
+
}
|
|
13156
|
+
setReverseRefused(null);
|
|
13144
13157
|
onSaved?.();
|
|
13145
13158
|
};
|
|
13146
13159
|
const remove = async () => {
|
|
@@ -13332,6 +13345,19 @@ function FieldEditor(props) {
|
|
|
13332
13345
|
),
|
|
13333
13346
|
"Each value has its own date"
|
|
13334
13347
|
] }),
|
|
13348
|
+
!field2 && type === "relation" && otherTable.data && otherTable.data.id !== tableId ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
13349
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
13350
|
+
import_design_system35.Checkbox,
|
|
13351
|
+
{
|
|
13352
|
+
checked: showOnOther,
|
|
13353
|
+
"aria-label": `Show on ${otherTable.data.name ?? "the other table"}`,
|
|
13354
|
+
onCheckedChange: (v) => setShowOnOther(v === true),
|
|
13355
|
+
"data-records-show-on-other": ""
|
|
13356
|
+
}
|
|
13357
|
+
),
|
|
13358
|
+
"Show on ",
|
|
13359
|
+
otherTable.data.name ?? "the other table"
|
|
13360
|
+
] }) : null,
|
|
13335
13361
|
CHOICE_EDITOR_ADDS_WHAT_IS_TYPED && (type === "select" || type === "multi_select") ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
13336
13362
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
13337
13363
|
import_design_system35.Checkbox,
|
|
@@ -13499,6 +13525,10 @@ function FieldEditor(props) {
|
|
|
13499
13525
|
) : null,
|
|
13500
13526
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system35.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", onClick: () => onSaved?.(), children: "Done" })
|
|
13501
13527
|
] }) : null,
|
|
13528
|
+
reverseRefused ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-records-reverse-field-refused": "", className: "flex flex-col gap-1", children: [
|
|
13529
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-[11px]", children: "The link is made. Its column on the other table was not:" }),
|
|
13530
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RefusalNotice, { error: reverseRefused })
|
|
13531
|
+
] }) : null,
|
|
13502
13532
|
backfillError ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-records-autonumber-backfill-refused": "", className: "flex flex-col gap-1", children: [
|
|
13503
13533
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-[11px]", children: "The column is made. The records already in the table were not numbered:" }),
|
|
13504
13534
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RefusalNotice, { error: backfillError })
|
|
@@ -19576,6 +19606,7 @@ function withTypeMark(field2, header) {
|
|
|
19576
19606
|
|
|
19577
19607
|
// src/ReverseColumns.tsx
|
|
19578
19608
|
var import_react102 = require("react");
|
|
19609
|
+
var import_records32 = require("@ai-matrx/records");
|
|
19579
19610
|
var import_react103 = require("@ai-matrx/records/react");
|
|
19580
19611
|
var import_design_system54 = require("@ai-matrx/design-system");
|
|
19581
19612
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
@@ -19700,7 +19731,71 @@ function ReverseCell({ held, column, rowId, tableId }) {
|
|
|
19700
19731
|
const readReading = () => held.reading;
|
|
19701
19732
|
const answer = (0, import_react102.useSyncExternalStore)(subscribe, readAnswer, readAnswer);
|
|
19702
19733
|
const reading = (0, import_react102.useSyncExternalStore)(subscribe, readReading, readReading);
|
|
19703
|
-
|
|
19734
|
+
const chips = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReverseLinkChips, { column, answer, loading: reading, clamp: { tableId, recordId: rowId } });
|
|
19735
|
+
if (column.read_only) return chips;
|
|
19736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex min-w-0 items-start gap-1", children: [
|
|
19737
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "min-w-0 flex-1", children: chips }),
|
|
19738
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReverseLinksEditPopover, { tableId, recordId: rowId, column })
|
|
19739
|
+
] });
|
|
19740
|
+
}
|
|
19741
|
+
function useReverseField(tableId, column) {
|
|
19742
|
+
const client = (0, import_react103.useOptionalRecordsClient)();
|
|
19743
|
+
const [field2, setField] = (0, import_react102.useState)(null);
|
|
19744
|
+
(0, import_react102.useEffect)(() => {
|
|
19745
|
+
if (column.read_only || !client) return;
|
|
19746
|
+
let live = true;
|
|
19747
|
+
void client.fields({ table_id: tableId, withReverse: true }).then((read) => {
|
|
19748
|
+
if (live && read.ok) setField(read.data.find((f) => f.key === column.key && (0, import_records32.isReverseField)(f)) ?? null);
|
|
19749
|
+
});
|
|
19750
|
+
return () => {
|
|
19751
|
+
live = false;
|
|
19752
|
+
};
|
|
19753
|
+
}, [client, tableId, column.key, column.read_only]);
|
|
19754
|
+
return field2;
|
|
19755
|
+
}
|
|
19756
|
+
function ReverseLinksEditor({ tableId, recordId, column, autoOpen, onClose }) {
|
|
19757
|
+
const client = (0, import_react103.useOptionalRecordsClient)();
|
|
19758
|
+
const field2 = useReverseField(tableId, column);
|
|
19759
|
+
const ids = (0, import_react102.useMemo)(() => [recordId], [recordId]);
|
|
19760
|
+
const one = (0, import_react102.useMemo)(() => [column], [column]);
|
|
19761
|
+
const read = (0, import_react103.useReverseLinks)(tableId, one, ids, REVERSE_LINKS_EDIT_MAX);
|
|
19762
|
+
const answer = read.data?.[column.key]?.[recordId];
|
|
19763
|
+
const [refused, setRefused] = (0, import_react102.useState)(null);
|
|
19764
|
+
if (read.error) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RefusalNotice, { error: read.error });
|
|
19765
|
+
if (!field2 || !answer || !client) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system54.Skeleton, { className: "h-7 w-40", "data-records-reverse-editor-loading": "" });
|
|
19766
|
+
const current = answer.links.map((l) => l.id);
|
|
19767
|
+
const write = async (next) => {
|
|
19768
|
+
const want = (Array.isArray(next) ? next : next ? [next] : []).map(String);
|
|
19769
|
+
const add = want.filter((id) => !current.includes(id));
|
|
19770
|
+
const remove = current.filter((id) => !want.includes(id));
|
|
19771
|
+
if (add.length === 0 && remove.length === 0) return;
|
|
19772
|
+
const done = await client.relationReverseSet({ record_id: recordId, field_id: field2.id, add, remove });
|
|
19773
|
+
setRefused(done.ok ? null : done.error);
|
|
19774
|
+
if (done.ok) read.reload();
|
|
19775
|
+
};
|
|
19776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex min-w-0 flex-col gap-1", "data-records-reverse-editor": column.key, children: [
|
|
19777
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RelationPicker, { field: field2, value: current, onChange: (next) => void write(next), autoOpen, onClose }),
|
|
19778
|
+
refused ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RefusalNotice, { error: refused }) : null
|
|
19779
|
+
] });
|
|
19780
|
+
}
|
|
19781
|
+
var REVERSE_LINKS_EDIT_MAX = 50;
|
|
19782
|
+
function ReverseLinksEditPopover({ tableId, recordId, column }) {
|
|
19783
|
+
const [open, setOpen] = (0, import_react102.useState)(false);
|
|
19784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_design_system54.Popover, { open, onOpenChange: setOpen, children: [
|
|
19785
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system54.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
19786
|
+
import_design_system54.Button,
|
|
19787
|
+
{
|
|
19788
|
+
size: "sm",
|
|
19789
|
+
variant: "ghost",
|
|
19790
|
+
className: "h-5 w-5 shrink-0 p-0 text-muted-foreground",
|
|
19791
|
+
"aria-label": `Link ${column.source_table_name}`,
|
|
19792
|
+
title: `Link ${column.source_table_name}`,
|
|
19793
|
+
"data-records-reverse-edit": column.key,
|
|
19794
|
+
children: "+"
|
|
19795
|
+
}
|
|
19796
|
+
) }),
|
|
19797
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system54.PopoverContent, { sizing: "content", align: "start", className: "w-80 p-2", children: open ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReverseLinksEditor, { tableId, recordId, column }) : null })
|
|
19798
|
+
] });
|
|
19704
19799
|
}
|
|
19705
19800
|
var EMPTY_COLUMNS = [];
|
|
19706
19801
|
function ReverseLinksSections({ tableId, recordId }) {
|
|
@@ -19726,7 +19821,7 @@ function ReverseLinksSection({ tableId, recordId, column }) {
|
|
|
19726
19821
|
answer && answer.total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-[11px] text-muted-foreground", children: answer.total }) : null,
|
|
19727
19822
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AddLinkedButton, { column, onAdd: () => setAdding(true) })
|
|
19728
19823
|
] }),
|
|
19729
|
-
first.error ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RefusalNotice, { error: first.error }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReverseLinkChips, { column, answer, loading: first.loading }),
|
|
19824
|
+
first.error ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RefusalNotice, { error: first.error }) : column.read_only ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReverseLinkChips, { column, answer, loading: first.loading }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReverseLinksEditor, { tableId, recordId, column }),
|
|
19730
19825
|
answer && answer.total > answer.links.length && answer.links.length < 50 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_design_system54.Button, { size: "sm", variant: "ghost", className: "self-start px-1 text-[11px]", onClick: () => setShown((n) => n + REVERSE_PANEL_PAGE), children: [
|
|
19731
19826
|
"Show ",
|
|
19732
19827
|
Math.min(REVERSE_PANEL_PAGE, answer.total - answer.links.length),
|
|
@@ -20072,7 +20167,7 @@ var import_react105 = require("react");
|
|
|
20072
20167
|
var import_react106 = require("@ai-matrx/records/react");
|
|
20073
20168
|
var import_core16 = require("@ai-matrx/records/core");
|
|
20074
20169
|
var import_design_system56 = require("@ai-matrx/design-system");
|
|
20075
|
-
var
|
|
20170
|
+
var import_records35 = require("@ai-matrx/records");
|
|
20076
20171
|
|
|
20077
20172
|
// src/importRuleCheck.ts
|
|
20078
20173
|
var import_core15 = require("@ai-matrx/records/core");
|
|
@@ -20123,7 +20218,7 @@ function checkImportRules(fields, rows, mapping, choiceOptions, relationNames) {
|
|
|
20123
20218
|
var import_text_case8 = require("@ai-matrx/kit/text-case");
|
|
20124
20219
|
|
|
20125
20220
|
// src/importKinds.ts
|
|
20126
|
-
var
|
|
20221
|
+
var import_records33 = require("@ai-matrx/records");
|
|
20127
20222
|
var IMPORT_KINDS = [
|
|
20128
20223
|
{ kind: "text", label: "Text" },
|
|
20129
20224
|
{ kind: "date", label: "Date" },
|
|
@@ -20151,7 +20246,7 @@ function datesOfColumn(rows, header, opts = {}) {
|
|
|
20151
20246
|
const raw = String(r[header] ?? "").trim();
|
|
20152
20247
|
if (raw === "") return;
|
|
20153
20248
|
filled += 1;
|
|
20154
|
-
const got = (0,
|
|
20249
|
+
const got = (0, import_records33.readTypedDate)(raw, { ...opts.withTime ? { withTime: true } : {}, ...opts.locale ? { locale: opts.locale } : {} });
|
|
20155
20250
|
if (got.ok) read.set(i, opts.withTime && got.instant ? got.instant : got.day);
|
|
20156
20251
|
else unreadable.push({ row: i, raw });
|
|
20157
20252
|
});
|
|
@@ -20176,12 +20271,12 @@ function exactDuplicateRows(rows, headers) {
|
|
|
20176
20271
|
}
|
|
20177
20272
|
|
|
20178
20273
|
// src/importCombine.ts
|
|
20179
|
-
var
|
|
20274
|
+
var import_records34 = require("@ai-matrx/records");
|
|
20180
20275
|
function titleRepeats(rows, header) {
|
|
20181
20276
|
const seen = /* @__PURE__ */ new Set();
|
|
20182
20277
|
let filled = 0;
|
|
20183
20278
|
for (const r of rows) {
|
|
20184
|
-
const key = (0,
|
|
20279
|
+
const key = (0, import_records34.relationNameKey)(String(r[header] ?? ""));
|
|
20185
20280
|
if (key === "") continue;
|
|
20186
20281
|
filled += 1;
|
|
20187
20282
|
seen.add(key);
|
|
@@ -20191,7 +20286,7 @@ function titleRepeats(rows, header) {
|
|
|
20191
20286
|
function sameRecordLikely(rows, header) {
|
|
20192
20287
|
const groups = /* @__PURE__ */ new Map();
|
|
20193
20288
|
for (const r of rows) {
|
|
20194
|
-
const key = (0,
|
|
20289
|
+
const key = (0, import_records34.relationNameKey)(String(r[header] ?? ""));
|
|
20195
20290
|
if (key === "") continue;
|
|
20196
20291
|
const held = groups.get(key);
|
|
20197
20292
|
if (held) held.push(r);
|
|
@@ -20224,7 +20319,7 @@ function combineRows(rows, header) {
|
|
|
20224
20319
|
const out = [];
|
|
20225
20320
|
const outLines = [];
|
|
20226
20321
|
rows.forEach((r, i) => {
|
|
20227
|
-
const key = (0,
|
|
20322
|
+
const key = (0, import_records34.relationNameKey)(String(r[header] ?? ""));
|
|
20228
20323
|
if (key === "") {
|
|
20229
20324
|
out.push({ ...r });
|
|
20230
20325
|
outLines.push([i + 1]);
|
|
@@ -20716,13 +20811,13 @@ function ImportWizard({ tableId, source, onDone, onWrote, className }) {
|
|
|
20716
20811
|
async (wanted) => {
|
|
20717
20812
|
const next = /* @__PURE__ */ new Map();
|
|
20718
20813
|
for (const { header, field: field2 } of wanted) {
|
|
20719
|
-
const names = effectiveRows.flatMap((r) => (0,
|
|
20814
|
+
const names = effectiveRows.flatMap((r) => (0, import_records35.relationNamesIn)(field2, String(r[header] ?? "")));
|
|
20720
20815
|
const got = await client.relationNamesMatch({ table_id: field2.relation_target, names });
|
|
20721
20816
|
if (!got.ok) {
|
|
20722
20817
|
setRelationProblem(got.error);
|
|
20723
20818
|
return null;
|
|
20724
20819
|
}
|
|
20725
|
-
next.set(field2.key, (0,
|
|
20820
|
+
next.set(field2.key, (0, import_records35.relationNameIndexOf)(got.data));
|
|
20726
20821
|
}
|
|
20727
20822
|
setRelationProblem(null);
|
|
20728
20823
|
setRelationIndex(next);
|
|
@@ -20746,12 +20841,12 @@ function ImportWizard({ tableId, source, onDone, onWrote, className }) {
|
|
|
20746
20841
|
let linked = 0;
|
|
20747
20842
|
let named = 0;
|
|
20748
20843
|
effectiveRows.forEach((row, i) => {
|
|
20749
|
-
const names = (0,
|
|
20844
|
+
const names = (0, import_records35.relationNamesIn)(field2, String(row[header] ?? ""));
|
|
20750
20845
|
if (String(row[header] ?? "").trim() === "") return;
|
|
20751
20846
|
named += 1;
|
|
20752
20847
|
let ok = true;
|
|
20753
20848
|
for (const name of names) {
|
|
20754
|
-
const hits = index.byName.get((0,
|
|
20849
|
+
const hits = index.byName.get((0, import_records35.relationNameKey)(name)) ?? [];
|
|
20755
20850
|
if (hits.length === 1) continue;
|
|
20756
20851
|
ok = false;
|
|
20757
20852
|
if (hits.length === 0) unmatched.set(name, [...unmatched.get(name) ?? [], i + 1]);
|
|
@@ -20809,11 +20904,11 @@ function ImportWizard({ tableId, source, onDone, onWrote, className }) {
|
|
|
20809
20904
|
const named = index.get(field2.key);
|
|
20810
20905
|
const text2 = String(row[header] ?? "").trim();
|
|
20811
20906
|
if (!named || text2 === "") continue;
|
|
20812
|
-
const parts = field2.multi ? (0,
|
|
20907
|
+
const parts = field2.multi ? (0, import_records35.splitListCell)(text2) : [text2];
|
|
20813
20908
|
const ids = [];
|
|
20814
20909
|
let skip = false;
|
|
20815
20910
|
for (const part of parts) {
|
|
20816
|
-
const hits = (0,
|
|
20911
|
+
const hits = (0, import_records35.relationNamesIn)(field2, part).length === 0 ? null : named.byName.get((0, import_records35.relationNameKey)(part)) ?? [];
|
|
20817
20912
|
if (hits === null) ids.push(part);
|
|
20818
20913
|
else if (hits.length === 1) ids.push(hits[0].id);
|
|
20819
20914
|
else if ((hits.length === 0 ? choiceFor(field2.key).unmatched : choiceFor(field2.key).ambiguous) !== "empty") skip = true;
|
|
@@ -20853,7 +20948,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, className }) {
|
|
|
20853
20948
|
setPhase("linking");
|
|
20854
20949
|
for (const ask of toMerge) {
|
|
20855
20950
|
for (const [name] of ask.ambiguous) {
|
|
20856
|
-
const hits = ask.index.byName.get((0,
|
|
20951
|
+
const hits = ask.index.byName.get((0, import_records35.relationNameKey)(name)) ?? [];
|
|
20857
20952
|
const winner = hits[0];
|
|
20858
20953
|
if (!winner) continue;
|
|
20859
20954
|
for (const loser of hits.slice(1)) {
|
|
@@ -22519,7 +22614,7 @@ function useStoreValueFacets(enabled, inputs) {
|
|
|
22519
22614
|
// src/gridGrouping.tsx
|
|
22520
22615
|
var import_react111 = require("react");
|
|
22521
22616
|
var import_react112 = require("@ai-matrx/records/react");
|
|
22522
|
-
var
|
|
22617
|
+
var import_records36 = require("@ai-matrx/records");
|
|
22523
22618
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
22524
22619
|
function groupValueKey(value) {
|
|
22525
22620
|
if (value === null || value === void 0 || value === "") return "";
|
|
@@ -22556,8 +22651,8 @@ function useGroupFacts(args) {
|
|
|
22556
22651
|
const withheld = {};
|
|
22557
22652
|
for (const [fieldKey, op2] of entries) {
|
|
22558
22653
|
const m = op2 === "count" ? { op: "count" } : { op: op2, key: fieldKey };
|
|
22559
|
-
values[fieldKey] = row.measures?.[(0,
|
|
22560
|
-
const notice = row.withheld?.[(0,
|
|
22654
|
+
values[fieldKey] = row.measures?.[(0, import_records36.measureKey)(m)] ?? null;
|
|
22655
|
+
const notice = row.withheld?.[(0, import_records36.measureKey)(m)];
|
|
22561
22656
|
if (notice) withheld[fieldKey] = notice;
|
|
22562
22657
|
}
|
|
22563
22658
|
out.set(key, { count: typeof row.measures?.["count"] === "number" ? row.measures["count"] : row.row_count ?? null, measures: values, withheld });
|
|
@@ -23607,7 +23702,7 @@ function BulkActions({
|
|
|
23607
23702
|
// src/handOrder.tsx
|
|
23608
23703
|
var import_react120 = require("react");
|
|
23609
23704
|
var import_react121 = require("@ai-matrx/records/react");
|
|
23610
|
-
var
|
|
23705
|
+
var import_records37 = require("@ai-matrx/records");
|
|
23611
23706
|
var import_design_system60 = require("@ai-matrx/design-system");
|
|
23612
23707
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
23613
23708
|
function sortArrow(direction) {
|
|
@@ -23724,7 +23819,7 @@ function useHandOrderRows(args) {
|
|
|
23724
23819
|
const client = (0, import_react121.useRecordsClient)();
|
|
23725
23820
|
const { viewId, active, page, pageSize } = args;
|
|
23726
23821
|
const filter = args.filter && Object.keys(args.filter).length > 0 ? args.filter : null;
|
|
23727
|
-
const filterKey = filter ? (0,
|
|
23822
|
+
const filterKey = filter ? (0, import_records37.stableFilterKey)(filter) : "";
|
|
23728
23823
|
const filterNow = (0, import_react120.useRef)(filter);
|
|
23729
23824
|
filterNow.current = filter;
|
|
23730
23825
|
const [answer, setAnswer] = (0, import_react120.useState)(null);
|
|
@@ -24421,7 +24516,7 @@ function GridBody({
|
|
|
24421
24516
|
const names = wanted.get(field2.key) ?? [];
|
|
24422
24517
|
if (names.length === 0) return;
|
|
24423
24518
|
const got = await client.relationNamesMatch({ table_id: field2.relation_target, names });
|
|
24424
|
-
if (got.ok) relationNames.current.set(field2.key, (0,
|
|
24519
|
+
if (got.ok) relationNames.current.set(field2.key, (0, import_records38.relationNameIndexOf)(got.data));
|
|
24425
24520
|
})
|
|
24426
24521
|
);
|
|
24427
24522
|
},
|
|
@@ -24500,7 +24595,7 @@ function GridBody({
|
|
|
24500
24595
|
field2.key,
|
|
24501
24596
|
lines.flatMap((line) => {
|
|
24502
24597
|
const cell2 = line[at];
|
|
24503
|
-
return typeof cell2 === "string" ? (0,
|
|
24598
|
+
return typeof cell2 === "string" ? (0, import_records38.relationNamesIn)(field2, cell2) : [];
|
|
24504
24599
|
})
|
|
24505
24600
|
);
|
|
24506
24601
|
}
|
|
@@ -24787,7 +24882,7 @@ function GridBody({
|
|
|
24787
24882
|
tableName: table.data ? tableName(table.data) : "",
|
|
24788
24883
|
fields: fields.data ?? [],
|
|
24789
24884
|
document: row.document ?? {},
|
|
24790
|
-
level: (0,
|
|
24885
|
+
level: (0, import_records38.asPermissionLevel)(row.level)
|
|
24791
24886
|
}),
|
|
24792
24887
|
[host, tableId, table.data, fields.data]
|
|
24793
24888
|
);
|
|
@@ -26724,7 +26819,7 @@ var import_design_system74 = require("@ai-matrx/design-system");
|
|
|
26724
26819
|
var import_react146 = require("react");
|
|
26725
26820
|
var import_react147 = require("@ai-matrx/records/react");
|
|
26726
26821
|
var import_core22 = require("@ai-matrx/records/core");
|
|
26727
|
-
var
|
|
26822
|
+
var import_records43 = require("@ai-matrx/records");
|
|
26728
26823
|
var import_design_system73 = require("@ai-matrx/design-system");
|
|
26729
26824
|
|
|
26730
26825
|
// src/newTableColumns.ts
|
|
@@ -26908,7 +27003,7 @@ function fieldsForNewColumns(columns) {
|
|
|
26908
27003
|
var import_clipboard4 = require("@ai-matrx/kit/clipboard");
|
|
26909
27004
|
var import_react142 = require("react");
|
|
26910
27005
|
var import_react143 = require("@ai-matrx/records/react");
|
|
26911
|
-
var
|
|
27006
|
+
var import_records41 = require("@ai-matrx/records");
|
|
26912
27007
|
var import_design_system71 = require("@ai-matrx/design-system");
|
|
26913
27008
|
|
|
26914
27009
|
// src/BookingBuilder.tsx
|
|
@@ -26917,7 +27012,7 @@ var import_design_system66 = require("@ai-matrx/design-system");
|
|
|
26917
27012
|
var import_react138 = require("react");
|
|
26918
27013
|
var import_react139 = require("@ai-matrx/records/react");
|
|
26919
27014
|
var import_format6 = require("@ai-matrx/kit/format");
|
|
26920
|
-
var
|
|
27015
|
+
var import_records39 = require("@ai-matrx/records");
|
|
26921
27016
|
var import_design_system67 = require("@ai-matrx/design-system");
|
|
26922
27017
|
|
|
26923
27018
|
// src/publicQuestions.ts
|
|
@@ -27198,7 +27293,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
27198
27293
|
if (!rights.structure) {
|
|
27199
27294
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { className: (0, import_design_system67.cn)("text-xs text-muted-foreground", className), children: rights.why("structure") ?? "Making a booking page needs the admin level on this table, because it lets people with no account take time in your calendar." });
|
|
27200
27295
|
}
|
|
27201
|
-
const url = formId ? `${publicOrigin}${(0,
|
|
27296
|
+
const url = formId ? `${publicOrigin}${(0, import_records39.bookingPath)(formId)}` : null;
|
|
27202
27297
|
const shown4 = offer ?? null;
|
|
27203
27298
|
return (
|
|
27204
27299
|
// THE RAIL IS 384px WIDE AND THE VIEWPORT IS NOT (walk 1, 2026-09-21):
|
|
@@ -27458,7 +27553,7 @@ function BuildOrAsk({
|
|
|
27458
27553
|
|
|
27459
27554
|
// src/BuiltOnArchive.tsx
|
|
27460
27555
|
var import_react140 = require("react");
|
|
27461
|
-
var
|
|
27556
|
+
var import_records40 = require("@ai-matrx/records");
|
|
27462
27557
|
var import_react141 = require("@ai-matrx/records/react");
|
|
27463
27558
|
var import_design_system70 = require("@ai-matrx/design-system");
|
|
27464
27559
|
|
|
@@ -27899,9 +27994,9 @@ function ArchivedBuiltOn({ tableId, onRestored }) {
|
|
|
27899
27994
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
27900
27995
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "truncate text-sm", children: thing.title }),
|
|
27901
27996
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
27902
|
-
|
|
27997
|
+
import_records40.BUILT_KIND_WORD[thing.kind],
|
|
27903
27998
|
" \xB7 archived ",
|
|
27904
|
-
(0,
|
|
27999
|
+
(0, import_records40.archivedWhen)(thing.archivedAt)
|
|
27905
28000
|
] }),
|
|
27906
28001
|
refusal4 && refusal4.id === thing.id ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(RefusalNotice, { error: refusal4.error, className: "mt-2" }) : null
|
|
27907
28002
|
] }),
|
|
@@ -28052,7 +28147,7 @@ function BookingSlots({ tableId, activeBookingId, className }) {
|
|
|
28052
28147
|
" Open the table the appointments should land in to make one."
|
|
28053
28148
|
] }) : null,
|
|
28054
28149
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("ul", { className: "flex flex-col gap-2", children: pages.map((page) => {
|
|
28055
|
-
const url = `${origin}${(0,
|
|
28150
|
+
const url = `${origin}${(0, import_records41.bookingPath)(page.form_id)}`;
|
|
28056
28151
|
const mayOpen = levels.data?.[page.table_id] === "admin";
|
|
28057
28152
|
const open = page.published_at !== null && page.closed_at === null;
|
|
28058
28153
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
@@ -28172,7 +28267,7 @@ function nextInWords(page) {
|
|
|
28172
28267
|
|
|
28173
28268
|
// src/WhereItLives.tsx
|
|
28174
28269
|
var import_react144 = require("react");
|
|
28175
|
-
var
|
|
28270
|
+
var import_records42 = require("@ai-matrx/records");
|
|
28176
28271
|
var import_react145 = require("@ai-matrx/records/react");
|
|
28177
28272
|
var import_design_system72 = require("@ai-matrx/design-system");
|
|
28178
28273
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
@@ -28301,7 +28396,7 @@ function WhereItLives({ tableId, knownOrganizationName, onMoved, variant = "head
|
|
|
28301
28396
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(SharedNameAddress, { to: choosing, all: answer.home.destinations }),
|
|
28302
28397
|
"?"
|
|
28303
28398
|
] }),
|
|
28304
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "text-muted-foreground", children: (0,
|
|
28399
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "text-muted-foreground", children: (0, import_records42.moveConsequence)(answer.home, choosing) }),
|
|
28305
28400
|
said2?.tone === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
28306
28401
|
import_design_system72.ErrorBox,
|
|
28307
28402
|
{
|
|
@@ -28458,7 +28553,7 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
|
|
|
28458
28553
|
alive = false;
|
|
28459
28554
|
};
|
|
28460
28555
|
}, [client]);
|
|
28461
|
-
const listed = facts.phase === "read" ? (0,
|
|
28556
|
+
const listed = facts.phase === "read" ? (0, import_records43.withTablePlacement)(
|
|
28462
28557
|
(0, import_core22.withTableFacts)(tables.data ?? [], facts.rows, me),
|
|
28463
28558
|
facts.rows
|
|
28464
28559
|
) : tables.data ?? [];
|
|
@@ -29745,7 +29840,7 @@ function TableFoundationSwitch({ tableId, table }) {
|
|
|
29745
29840
|
|
|
29746
29841
|
// src/RowControls.tsx
|
|
29747
29842
|
var import_react158 = require("react");
|
|
29748
|
-
var
|
|
29843
|
+
var import_records44 = require("@ai-matrx/records");
|
|
29749
29844
|
var import_react159 = require("@ai-matrx/records/react");
|
|
29750
29845
|
var import_design_system79 = require("@ai-matrx/design-system");
|
|
29751
29846
|
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
@@ -29773,9 +29868,9 @@ function ShownToSelect({
|
|
|
29773
29868
|
onChange,
|
|
29774
29869
|
testId
|
|
29775
29870
|
}) {
|
|
29776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_design_system79.Select, { value, onValueChange: (next) => (0,
|
|
29871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_design_system79.Select, { value, onValueChange: (next) => (0, import_records44.isShownTo)(next) ? onChange(next) : void 0, children: [
|
|
29777
29872
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system79.SelectTrigger, { size: "sm", "aria-label": label, className: "h-7 min-w-[8rem] text-xs", "data-testid": testId, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system79.SelectValue, {}) }),
|
|
29778
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system79.SelectContent, { children: allowed.map((word) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system79.SelectItem, { value: word, children:
|
|
29873
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system79.SelectContent, { children: allowed.map((word) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system79.SelectItem, { value: word, children: import_records44.SHOWN_TO_LABEL[word] }, word)) })
|
|
29779
29874
|
] });
|
|
29780
29875
|
}
|
|
29781
29876
|
function NewRowsDefaults({ tableId }) {
|
|
@@ -29814,7 +29909,7 @@ function NewRowsDefaults({ tableId }) {
|
|
|
29814
29909
|
};
|
|
29815
29910
|
if (!d) return error ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(RefusalNotice, { error }) : null;
|
|
29816
29911
|
const shown4 = d.shown_to ?? d.effective.shown_to;
|
|
29817
|
-
const allowed = d.allowed_shown_to.filter(
|
|
29912
|
+
const allowed = d.allowed_shown_to.filter(import_records44.isShownTo);
|
|
29818
29913
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("section", { className: "flex flex-col gap-1.5", "data-testid": "new-rows-defaults", children: [
|
|
29819
29914
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "font-medium", children: ROW_CONTROL_WORDS.block }),
|
|
29820
29915
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
@@ -29828,7 +29923,7 @@ function NewRowsDefaults({ tableId }) {
|
|
|
29828
29923
|
testId: "new-rows-shown-to",
|
|
29829
29924
|
onChange: (next) => void set({ shown_to: next })
|
|
29830
29925
|
}
|
|
29831
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { "data-testid": "new-rows-shown-to-text", children:
|
|
29926
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { "data-testid": "new-rows-shown-to-text", children: import_records44.SHOWN_TO_LABEL[shown4] })
|
|
29832
29927
|
] }),
|
|
29833
29928
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-2", "data-testid": "new-rows-published", children: [
|
|
29834
29929
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "min-w-fit flex-1 whitespace-nowrap", children: ROW_CONTROL_WORDS.publishedToWeb }),
|
|
@@ -29877,9 +29972,9 @@ function RowShownTo({ recordId }) {
|
|
|
29877
29972
|
void read();
|
|
29878
29973
|
}, [read]);
|
|
29879
29974
|
if (error && !c) return null;
|
|
29880
|
-
if (!c || c.shown_to.is_child || !(0,
|
|
29975
|
+
if (!c || c.shown_to.is_child || !(0, import_records44.isShownTo)(c.shown_to.effective)) return null;
|
|
29881
29976
|
const effective = c.shown_to.effective;
|
|
29882
|
-
const allowed = c.shown_to.allowed.filter(
|
|
29977
|
+
const allowed = c.shown_to.allowed.filter(import_records44.isShownTo);
|
|
29883
29978
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("span", { className: "flex items-center gap-1.5", "data-testid": "row-shown-to", children: [
|
|
29884
29979
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-muted-foreground", children: ROW_CONTROL_WORDS.shownTo }),
|
|
29885
29980
|
c.shown_to.can_change ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
@@ -29898,7 +29993,7 @@ function RowShownTo({ recordId }) {
|
|
|
29898
29993
|
}
|
|
29899
29994
|
}
|
|
29900
29995
|
) : /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
29901
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { "data-testid": "row-shown-to-text", children:
|
|
29996
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { "data-testid": "row-shown-to-text", children: import_records44.SHOWN_TO_LABEL[effective] }),
|
|
29902
29997
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "max-w-[18rem] text-[11px] text-muted-foreground", "data-testid": "row-shown-to-who", children: ROW_CONTROL_WORDS.whoMayChangeRow })
|
|
29903
29998
|
] }),
|
|
29904
29999
|
error ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(RefusalNotice, { error }) : null
|
|
@@ -30633,12 +30728,12 @@ function ShareForSomebodyElse({
|
|
|
30633
30728
|
// src/RecordBody.tsx
|
|
30634
30729
|
var import_react169 = require("react");
|
|
30635
30730
|
var import_design_system84 = require("@ai-matrx/design-system");
|
|
30636
|
-
var
|
|
30731
|
+
var import_records45 = require("@ai-matrx/records");
|
|
30637
30732
|
var import_react170 = require("@ai-matrx/records/react");
|
|
30638
30733
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
30639
30734
|
var BODY_NAMES = /^(notes?|page|body|content|page content|details|description)$/i;
|
|
30640
30735
|
function bodyFieldOf(fields) {
|
|
30641
|
-
const rich2 = fields.filter((field2) => (0,
|
|
30736
|
+
const rich2 = fields.filter((field2) => (0, import_records45.newerKindOf)(field2) === "rich_text");
|
|
30642
30737
|
return rich2.find((field2) => BODY_NAMES.test((field2.label ?? field2.key).trim()) || BODY_NAMES.test(field2.key.replace(/_/g, " "))) ?? rich2[0];
|
|
30643
30738
|
}
|
|
30644
30739
|
var BODY_COLUMN_NAME = "Notes";
|
|
@@ -31037,7 +31132,7 @@ function useSystemTable(spec) {
|
|
|
31037
31132
|
// src/ViewSwitcher.tsx
|
|
31038
31133
|
var import_react192 = require("react");
|
|
31039
31134
|
var import_react193 = require("@ai-matrx/records/react");
|
|
31040
|
-
var
|
|
31135
|
+
var import_records47 = require("@ai-matrx/records");
|
|
31041
31136
|
var import_design_system93 = require("@ai-matrx/design-system");
|
|
31042
31137
|
var import_data_table21 = require("@ai-matrx/design-system/data-table");
|
|
31043
31138
|
var import_format7 = require("@ai-matrx/kit/format");
|
|
@@ -31192,7 +31287,7 @@ function MoveRefusedBadge({ refused }) {
|
|
|
31192
31287
|
// src/Pipeline.tsx
|
|
31193
31288
|
var import_react180 = require("react");
|
|
31194
31289
|
var import_react181 = require("@ai-matrx/records/react");
|
|
31195
|
-
var
|
|
31290
|
+
var import_records46 = require("@ai-matrx/records");
|
|
31196
31291
|
var import_design_system88 = require("@ai-matrx/design-system");
|
|
31197
31292
|
var import_data_table16 = require("@ai-matrx/design-system/data-table");
|
|
31198
31293
|
|
|
@@ -31525,7 +31620,7 @@ function PipelineBoard({
|
|
|
31525
31620
|
alive.current = false;
|
|
31526
31621
|
};
|
|
31527
31622
|
}, []);
|
|
31528
|
-
const filterKey = (0,
|
|
31623
|
+
const filterKey = (0, import_records46.stableFilterKey)(filter);
|
|
31529
31624
|
const reload = (0, import_react180.useCallback)(async () => {
|
|
31530
31625
|
setLoading(true);
|
|
31531
31626
|
const [read, board, held] = await Promise.all([
|
|
@@ -34255,7 +34350,7 @@ var NO_FIELDS2 = [];
|
|
|
34255
34350
|
function useViewRecords(view, pageSize = 200, filter, viewId) {
|
|
34256
34351
|
const client = (0, import_react193.useRecordsClient)();
|
|
34257
34352
|
const [limit, setLimit] = (0, import_react192.useState)(pageSize);
|
|
34258
|
-
const questionKey = `${view.subject}|${(0,
|
|
34353
|
+
const questionKey = `${view.subject}|${(0, import_records47.stableFilterKey)(filter ?? null)}|${JSON.stringify(view.sorts ?? [])}`;
|
|
34259
34354
|
(0, import_react192.useEffect)(() => {
|
|
34260
34355
|
setLimit(pageSize);
|
|
34261
34356
|
}, [questionKey, pageSize]);
|
|
@@ -34288,8 +34383,8 @@ function useViewRecords(view, pageSize = 200, filter, viewId) {
|
|
|
34288
34383
|
cancelled = true;
|
|
34289
34384
|
};
|
|
34290
34385
|
}, [client, ruleId, pageSize]);
|
|
34291
|
-
const asked3 = (0,
|
|
34292
|
-
const fromView = asked3 !== "{}" && (asked3 === (0,
|
|
34386
|
+
const asked3 = (0, import_records47.stableFilterKey)(filter ?? null);
|
|
34387
|
+
const fromView = asked3 !== "{}" && (asked3 === (0, import_records47.stableFilterKey)(view.where ?? null) || asked3 === (0, import_records47.stableFilterKey)(view.filters ?? null));
|
|
34293
34388
|
const tableRows = (0, import_react192.useMemo)(() => table.data?.rows ?? [], [table.data]);
|
|
34294
34389
|
const manual = view.order === "manual" && Boolean(viewId) && !ruleId;
|
|
34295
34390
|
const hand = useHandOrderRows({
|
|
@@ -35320,12 +35415,12 @@ function cardHiddenOf(presentation) {
|
|
|
35320
35415
|
}
|
|
35321
35416
|
var STATUS_WORDS = /^(status|stage|state|progress|phase)$/i;
|
|
35322
35417
|
function boardDefaultGroupField(eligible) {
|
|
35323
|
-
return eligible.find((f) => (0,
|
|
35418
|
+
return eligible.find((f) => (0, import_records47.newerKindOf)(f) === "status") ?? eligible.find((f) => STATUS_WORDS.test(fieldName(f).trim()) || STATUS_WORDS.test(f.key)) ?? eligible[0] ?? null;
|
|
35324
35419
|
}
|
|
35325
35420
|
|
|
35326
35421
|
// src/ArchivedView.tsx
|
|
35327
35422
|
var import_react194 = require("react");
|
|
35328
|
-
var
|
|
35423
|
+
var import_records48 = require("@ai-matrx/records");
|
|
35329
35424
|
var import_react195 = require("@ai-matrx/records/react");
|
|
35330
35425
|
var import_design_system94 = require("@ai-matrx/design-system");
|
|
35331
35426
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
@@ -35335,7 +35430,7 @@ function mayNotRestoreLine(why) {
|
|
|
35335
35430
|
return said2 === "" ? "Bringing a record back needs permission to edit this table. Ask somebody who has it." : said2;
|
|
35336
35431
|
}
|
|
35337
35432
|
function archivedRowLine(row, titleKey) {
|
|
35338
|
-
return `${recordName(row.document, titleKey)} \u2014 ${(0,
|
|
35433
|
+
return `${recordName(row.document, titleKey)} \u2014 ${(0, import_records48.archivedByLine)(row)}`;
|
|
35339
35434
|
}
|
|
35340
35435
|
function ArchivedView({
|
|
35341
35436
|
tableId,
|
|
@@ -35349,7 +35444,7 @@ function ArchivedView({
|
|
|
35349
35444
|
const table = (0, import_react195.useTable)(tableId);
|
|
35350
35445
|
const rights = useTableRights(table.data);
|
|
35351
35446
|
const fields = (0, import_react195.useFields)(tableId);
|
|
35352
|
-
const [lane, setLane] = (0, import_react194.useState)(laneFromHost ??
|
|
35447
|
+
const [lane, setLane] = (0, import_react194.useState)(laneFromHost ?? import_records48.DEFAULT_ARCHIVE_LANE);
|
|
35353
35448
|
const [rows, setRows] = (0, import_react194.useState)([]);
|
|
35354
35449
|
const [loading, setLoading] = (0, import_react194.useState)(true);
|
|
35355
35450
|
const [error, setError] = (0, import_react194.useState)(null);
|
|
@@ -35396,15 +35491,15 @@ function ArchivedView({
|
|
|
35396
35491
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: (0, import_design_system94.cn)("flex min-h-0 flex-col gap-2", className), "data-testid": "archived-view", children: [
|
|
35397
35492
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
35398
35493
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "text-sm font-medium", children: "Archived" }),
|
|
35399
|
-
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Archived by", children:
|
|
35494
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Archived by", children: import_records48.ARCHIVE_LANES.map((option) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
35400
35495
|
import_design_system94.Button,
|
|
35401
35496
|
{
|
|
35402
35497
|
size: "sm",
|
|
35403
35498
|
variant: option === lane ? "secondary" : "ghost",
|
|
35404
35499
|
"aria-pressed": option === lane,
|
|
35405
|
-
title:
|
|
35500
|
+
title: import_records48.ARCHIVE_LANE_MEANS[option],
|
|
35406
35501
|
onClick: () => pick(option),
|
|
35407
|
-
children:
|
|
35502
|
+
children: import_records48.ARCHIVE_LANE_LABEL[option]
|
|
35408
35503
|
},
|
|
35409
35504
|
option
|
|
35410
35505
|
)) })
|
|
@@ -35420,7 +35515,7 @@ function ArchivedView({
|
|
|
35420
35515
|
),
|
|
35421
35516
|
error ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(RefusalNotice, { error }) : null,
|
|
35422
35517
|
loading && !error ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_design_system94.Skeleton, { className: "h-24 w-full" }) : null,
|
|
35423
|
-
!loading && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { "data-testid": "archived-empty", className: "rounded-md border border-dashed px-3 py-6 text-xs text-muted-foreground", children: (0,
|
|
35518
|
+
!loading && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { "data-testid": "archived-empty", className: "rounded-md border border-dashed px-3 py-6 text-xs text-muted-foreground", children: (0, import_records48.emptyArchiveLine)(lane) }) : null,
|
|
35424
35519
|
!loading && !error && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("ul", { className: "flex flex-col gap-1", "data-testid": "archived-rows", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
35425
35520
|
"li",
|
|
35426
35521
|
{
|
|
@@ -35430,7 +35525,7 @@ function ArchivedView({
|
|
|
35430
35525
|
children: [
|
|
35431
35526
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
35432
35527
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "truncate text-sm", children: recordName(row.document, titleKey) }),
|
|
35433
|
-
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "truncate text-xs text-muted-foreground", "data-testid": "archived-who", children: (0,
|
|
35528
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "truncate text-xs text-muted-foreground", "data-testid": "archived-who", children: (0, import_records48.archivedByLine)(row) }),
|
|
35434
35529
|
refusal4 && refusal4.recordId === row.id ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(RefusalNotice, { error: refusal4.error, className: "mt-2" }) : null
|
|
35435
35530
|
] }),
|
|
35436
35531
|
mayRestore ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
@@ -35453,7 +35548,7 @@ function ArchivedView({
|
|
|
35453
35548
|
] });
|
|
35454
35549
|
}
|
|
35455
35550
|
function retiredColumnLine(row) {
|
|
35456
|
-
return (0,
|
|
35551
|
+
return (0, import_records48.archivedByLine)(row);
|
|
35457
35552
|
}
|
|
35458
35553
|
function RetiredColumns({ tableId, mayRestore, whyNot }) {
|
|
35459
35554
|
const client = (0, import_react195.useRecordsClient)();
|
|
@@ -35517,7 +35612,7 @@ function RetiredColumns({ tableId, mayRestore, whyNot }) {
|
|
|
35517
35612
|
|
|
35518
35613
|
// src/ArchivedDisclosure.tsx
|
|
35519
35614
|
var import_react196 = require("react");
|
|
35520
|
-
var
|
|
35615
|
+
var import_records49 = require("@ai-matrx/records");
|
|
35521
35616
|
var import_react197 = require("@ai-matrx/records/react");
|
|
35522
35617
|
var import_design_system95 = require("@ai-matrx/design-system");
|
|
35523
35618
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
@@ -35617,10 +35712,10 @@ function ArchivedPortals({
|
|
|
35617
35712
|
error ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(RefusalNotice, { error }) : null,
|
|
35618
35713
|
rows === null && !error ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_design_system95.Skeleton, { className: "h-16 w-full" }) : null,
|
|
35619
35714
|
said2 ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("p", { className: "rounded-md border border-border px-3 py-2 text-xs", "data-testid": "archived-portal-said", children: said2 }) : null,
|
|
35620
|
-
rows !== null && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("p", { "data-testid": "archived-portals-empty", className: "text-xs text-muted-foreground", children: (0,
|
|
35715
|
+
rows !== null && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("p", { "data-testid": "archived-portals-empty", className: "text-xs text-muted-foreground", children: (0, import_records49.emptyPortalArchiveLine)() }) : null,
|
|
35621
35716
|
rows !== null && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("ul", { className: "flex flex-col gap-1.5", "data-testid": "archived-portals", children: rows.map((portal) => {
|
|
35622
35717
|
const asking = confirming === portal.portal_id;
|
|
35623
|
-
const matches2 = (0,
|
|
35718
|
+
const matches2 = (0, import_records49.portalTitleTypedBack)(typed2, portal.title);
|
|
35624
35719
|
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
35625
35720
|
"li",
|
|
35626
35721
|
{
|
|
@@ -35659,7 +35754,7 @@ function ArchivedPortals({
|
|
|
35659
35754
|
] }),
|
|
35660
35755
|
asking ? /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
35661
35756
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
35662
|
-
(0,
|
|
35757
|
+
(0, import_records49.portalConfirmLine)(portal.title),
|
|
35663
35758
|
" Restoring it puts it back exactly as it was: everyone who was invited can sign in again, and it shows the same Tables."
|
|
35664
35759
|
] }),
|
|
35665
35760
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
@@ -38479,7 +38574,7 @@ function FieldHistoryPanel({
|
|
|
38479
38574
|
}
|
|
38480
38575
|
|
|
38481
38576
|
// src/forms.ts
|
|
38482
|
-
var
|
|
38577
|
+
var import_records50 = require("@ai-matrx/records");
|
|
38483
38578
|
var FORM_STATE_WORDS = {
|
|
38484
38579
|
draft: "Not published \u2014 the link does not answer yet.",
|
|
38485
38580
|
open: "Open \u2014 anyone with the link can answer it.",
|
|
@@ -38662,7 +38757,7 @@ function formLookFromDocument(raw) {
|
|
|
38662
38757
|
const doc = raw;
|
|
38663
38758
|
const id = (v) => typeof v === "string" && v.trim() !== "" ? v : null;
|
|
38664
38759
|
const look = {
|
|
38665
|
-
accent: (0,
|
|
38760
|
+
accent: (0, import_records50.isPortalAccent)(doc["accent"]) ? doc["accent"] : null,
|
|
38666
38761
|
logoFileId: id(doc["logo_file_id"]),
|
|
38667
38762
|
coverFileId: id(doc["cover_file_id"])
|
|
38668
38763
|
};
|
|
@@ -38772,7 +38867,7 @@ var import_design_system105 = require("@ai-matrx/design-system");
|
|
|
38772
38867
|
// src/ChartBlock.tsx
|
|
38773
38868
|
var import_react219 = require("react");
|
|
38774
38869
|
var import_recharts = require("recharts");
|
|
38775
|
-
var
|
|
38870
|
+
var import_records51 = require("@ai-matrx/records");
|
|
38776
38871
|
var import_core23 = require("@ai-matrx/records/core");
|
|
38777
38872
|
var import_design_system104 = require("@ai-matrx/design-system");
|
|
38778
38873
|
var import_format10 = require("@ai-matrx/kit/format");
|
|
@@ -39250,7 +39345,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
39250
39345
|
const kind = block.kind;
|
|
39251
39346
|
const tableId = block.table_id ?? subject;
|
|
39252
39347
|
const measures = block.measures && block.measures.length > 0 ? block.measures : [{ op: "count" }];
|
|
39253
|
-
const primary = (0,
|
|
39348
|
+
const primary = (0, import_records51.measureKey)(measures[0]);
|
|
39254
39349
|
const windows = kind === "stuck" ? null : block.compare ?? null;
|
|
39255
39350
|
const compared = !!windows;
|
|
39256
39351
|
const grain = block.bucket?.by ?? null;
|
|
@@ -40202,7 +40297,7 @@ function clientNoun(table) {
|
|
|
40202
40297
|
var import_clipboard7 = require("@ai-matrx/kit/clipboard");
|
|
40203
40298
|
var import_react226 = require("react");
|
|
40204
40299
|
var import_react227 = require("@ai-matrx/records/react");
|
|
40205
|
-
var
|
|
40300
|
+
var import_records53 = require("@ai-matrx/records");
|
|
40206
40301
|
var import_design_system110 = require("@ai-matrx/design-system");
|
|
40207
40302
|
|
|
40208
40303
|
// src/PortalLookEditor.tsx
|
|
@@ -40211,11 +40306,11 @@ var import_react225 = require("@ai-matrx/records/react");
|
|
|
40211
40306
|
var import_design_system109 = require("@ai-matrx/design-system");
|
|
40212
40307
|
|
|
40213
40308
|
// src/AccentSwatches.tsx
|
|
40214
|
-
var
|
|
40309
|
+
var import_records52 = require("@ai-matrx/records");
|
|
40215
40310
|
var import_design_system107 = require("@ai-matrx/design-system");
|
|
40216
40311
|
var import_data_table23 = require("@ai-matrx/design-system/data-table");
|
|
40217
40312
|
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
40218
|
-
function AccentSwatches({ value, onChange, options =
|
|
40313
|
+
function AccentSwatches({ value, onChange, options = import_records52.PORTAL_ACCENTS, noneLabel = "App colour" }) {
|
|
40219
40314
|
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", "aria-label": "Colour", children: [
|
|
40220
40315
|
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
40221
40316
|
"button",
|
|
@@ -40682,7 +40777,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
|
|
|
40682
40777
|
] }) : null,
|
|
40683
40778
|
activePortalId && !shown4.some((p) => p.portal_id === activePortalId) ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: PORTAL_NOT_HERE_LINE }) : null,
|
|
40684
40779
|
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("ul", { className: "flex flex-col gap-2", children: shown4.map((portal) => {
|
|
40685
|
-
const url = `${origin}${(0,
|
|
40780
|
+
const url = `${origin}${(0, import_records53.portalPath)(portal.slug)}`;
|
|
40686
40781
|
const open = openId === portal.portal_id;
|
|
40687
40782
|
const linked = portal.portal_id === activePortalId;
|
|
40688
40783
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
@@ -40797,8 +40892,8 @@ function ArchivePortalControl({
|
|
|
40797
40892
|
}
|
|
40798
40893
|
),
|
|
40799
40894
|
asking ? /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "mt-1.5 flex w-full flex-col gap-1.5 rounded-md border border-dashed border-border p-2.5", children: [
|
|
40800
|
-
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "text-xs text-muted-foreground", "data-testid": "portal-archive-consequence", children: (0,
|
|
40801
|
-
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "text-xs text-muted-foreground", children: (0,
|
|
40895
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "text-xs text-muted-foreground", "data-testid": "portal-archive-consequence", children: (0, import_records53.portalArchiveConsequence)(portal.title, portal.signed_in, portal.invited) }),
|
|
40896
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "text-xs text-muted-foreground", children: (0, import_records53.portalConfirmLine)(portal.title) }),
|
|
40802
40897
|
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
40803
40898
|
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
40804
40899
|
import_design_system110.BasicInput,
|
|
@@ -40816,7 +40911,7 @@ function ArchivePortalControl({
|
|
|
40816
40911
|
size: "sm",
|
|
40817
40912
|
variant: "destructive",
|
|
40818
40913
|
"data-testid": "portal-archive-do",
|
|
40819
|
-
disabled: busy || !(0,
|
|
40914
|
+
disabled: busy || !(0, import_records53.portalTitleTypedBack)(typed2, portal.title),
|
|
40820
40915
|
onClick: () => void go(),
|
|
40821
40916
|
children: busy ? "Archiving\u2026" : "Archive it"
|
|
40822
40917
|
}
|
|
@@ -41341,7 +41436,7 @@ function FormLookFrame({ look, title, children, contained = false, showOwnerHead
|
|
|
41341
41436
|
// src/DigestScheduler.tsx
|
|
41342
41437
|
var import_react228 = require("react");
|
|
41343
41438
|
var import_react229 = require("@ai-matrx/records/react");
|
|
41344
|
-
var
|
|
41439
|
+
var import_records54 = require("@ai-matrx/records");
|
|
41345
41440
|
var import_design_system112 = require("@ai-matrx/design-system");
|
|
41346
41441
|
|
|
41347
41442
|
// src/scheduleWords.ts
|
|
@@ -41427,7 +41522,7 @@ function DigestScheduler({
|
|
|
41427
41522
|
const [channel, setChannel] = (0, import_react228.useState)(
|
|
41428
41523
|
existing?.channel === "email" || existing?.channel === "sms" ? existing.channel : "in_app"
|
|
41429
41524
|
);
|
|
41430
|
-
const [quiet2, setQuiet] = (0, import_react228.useState)((0,
|
|
41525
|
+
const [quiet2, setQuiet] = (0, import_react228.useState)((0, import_records54.hasQuietHours)(existing?.quiet_hours));
|
|
41431
41526
|
const [quietFrom, setQuietFrom] = (0, import_react228.useState)(existing?.quiet_hours?.start ?? "22:00");
|
|
41432
41527
|
const [quietTo, setQuietTo] = (0, import_react228.useState)(existing?.quiet_hours?.end ?? "07:00");
|
|
41433
41528
|
const [recipients, setRecipients] = (0, import_react228.useState)(
|
|
@@ -41713,7 +41808,7 @@ function DigestScheduler({
|
|
|
41713
41808
|
// src/SubscriptionsPanel.tsx
|
|
41714
41809
|
var import_react232 = require("react");
|
|
41715
41810
|
var import_react233 = require("@ai-matrx/records/react");
|
|
41716
|
-
var
|
|
41811
|
+
var import_records55 = require("@ai-matrx/records");
|
|
41717
41812
|
var import_design_system114 = require("@ai-matrx/design-system");
|
|
41718
41813
|
|
|
41719
41814
|
// src/WebhooksPanel.tsx
|
|
@@ -42076,7 +42171,7 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
|
|
|
42076
42171
|
"Last told you ",
|
|
42077
42172
|
new Date(subscription.last_sent_at).toLocaleString()
|
|
42078
42173
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { children: "It has not told you anything yet." }),
|
|
42079
|
-
(0,
|
|
42174
|
+
(0, import_records55.hasQuietHours)(subscription.quiet_hours) ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { children: [
|
|
42080
42175
|
"Not between ",
|
|
42081
42176
|
subscription.quiet_hours.start,
|
|
42082
42177
|
" and ",
|
|
@@ -42147,7 +42242,7 @@ var import_core24 = require("@dnd-kit/core");
|
|
|
42147
42242
|
var import_sortable = require("@dnd-kit/sortable");
|
|
42148
42243
|
var import_utilities = require("@dnd-kit/utilities");
|
|
42149
42244
|
var import_react238 = require("@ai-matrx/records/react");
|
|
42150
|
-
var
|
|
42245
|
+
var import_records56 = require("@ai-matrx/records");
|
|
42151
42246
|
var import_design_system118 = require("@ai-matrx/design-system");
|
|
42152
42247
|
|
|
42153
42248
|
// src/FormFlowEditor.tsx
|
|
@@ -43470,7 +43565,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
43470
43565
|
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
43471
43566
|
PublishRow,
|
|
43472
43567
|
{
|
|
43473
|
-
url: `${publicOrigin}${(0,
|
|
43568
|
+
url: `${publicOrigin}${(0, import_records56.publicFormPath)(draft.id)}`,
|
|
43474
43569
|
state: draft.state,
|
|
43475
43570
|
mayPublish: rights.structure,
|
|
43476
43571
|
why: rights.why("structure"),
|
|
@@ -43482,7 +43577,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
43482
43577
|
unsaved: dirty
|
|
43483
43578
|
}
|
|
43484
43579
|
),
|
|
43485
|
-
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(EmbedSnippets, { url: `${publicOrigin}${(0,
|
|
43580
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(EmbedSnippets, { url: `${publicOrigin}${(0, import_records56.publicFormPath)(draft.id)}`, label: draft.name }),
|
|
43486
43581
|
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
43487
43582
|
NotifyOnAnswer,
|
|
43488
43583
|
{
|
|
@@ -44535,7 +44630,7 @@ function SignBlock({ tableId, recordId, render, className }) {
|
|
|
44535
44630
|
// src/NotifyRuleEditor.tsx
|
|
44536
44631
|
var import_react246 = require("react");
|
|
44537
44632
|
var import_react247 = require("@ai-matrx/records/react");
|
|
44538
|
-
var
|
|
44633
|
+
var import_records57 = require("@ai-matrx/records");
|
|
44539
44634
|
var import_design_system122 = require("@ai-matrx/design-system");
|
|
44540
44635
|
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
44541
44636
|
var CADENCE_WORDS2 = SUBSCRIPTION_CADENCE_LABEL;
|
|
@@ -44686,7 +44781,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
44686
44781
|
"next ",
|
|
44687
44782
|
new Date(held.next_digest_at).toLocaleString()
|
|
44688
44783
|
] }) : null,
|
|
44689
|
-
(0,
|
|
44784
|
+
(0, import_records57.hasQuietHours)(held.quiet_hours) ? /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
44690
44785
|
"quiet ",
|
|
44691
44786
|
held.quiet_hours.start,
|
|
44692
44787
|
"\u2013",
|
|
@@ -45372,7 +45467,7 @@ function AddChart({ subject, onAdd, onClose }) {
|
|
|
45372
45467
|
}
|
|
45373
45468
|
|
|
45374
45469
|
// src/pages.ts
|
|
45375
|
-
var
|
|
45470
|
+
var import_records58 = require("@ai-matrx/records");
|
|
45376
45471
|
var PAGE_BLOCK_KINDS = ["list", "record", "button", "form", "filter", "chart", "heading", "text", "applet"];
|
|
45377
45472
|
var PAGE_BLOCK_LABEL = {
|
|
45378
45473
|
list: "List",
|
|
@@ -45422,10 +45517,10 @@ function filterTargets(filter, blocks) {
|
|
|
45422
45517
|
}
|
|
45423
45518
|
function combineFilter(base, extra, fieldIdOf) {
|
|
45424
45519
|
const extraKeys = Object.keys(extra);
|
|
45425
|
-
if (!base || !(0,
|
|
45520
|
+
if (!base || !(0, import_records58.isRuleFilter)(base) && Object.keys(base).length === 0) {
|
|
45426
45521
|
return { filter: extraKeys.length > 0 ? { ...extra } : null, dropped: [] };
|
|
45427
45522
|
}
|
|
45428
|
-
if (!(0,
|
|
45523
|
+
if (!(0, import_records58.isRuleFilter)(base)) return { filter: { ...base, ...extra }, dropped: [] };
|
|
45429
45524
|
const dropped = [];
|
|
45430
45525
|
let rule = base;
|
|
45431
45526
|
for (const key of extraKeys) {
|
|
@@ -46083,7 +46178,7 @@ var import_design_system127 = require("@ai-matrx/design-system");
|
|
|
46083
46178
|
var import_react257 = require("@ai-matrx/records/react");
|
|
46084
46179
|
|
|
46085
46180
|
// src/question.ts
|
|
46086
|
-
var
|
|
46181
|
+
var import_records59 = require("@ai-matrx/records");
|
|
46087
46182
|
var import_core26 = require("@ai-matrx/records/core");
|
|
46088
46183
|
var QUESTION_OPS = ["count", "sum", "avg", "min", "max"];
|
|
46089
46184
|
var QUESTION_LIMIT_DEFAULT = 25;
|
|
@@ -46162,7 +46257,7 @@ async function askQuestion(client, tableId, spec, fields) {
|
|
|
46162
46257
|
for (const m of measures) {
|
|
46163
46258
|
if (m.op !== "count" && !m.key) return refusal3(`Pick the column to ${m.op === "avg" ? "average" : m.op}.`);
|
|
46164
46259
|
}
|
|
46165
|
-
const keys = measures.map((m) => (0,
|
|
46260
|
+
const keys = measures.map((m) => (0, import_records59.measureKey)({ op: m.op, ...m.key ? { key: m.key } : {} }));
|
|
46166
46261
|
const group = spec.group;
|
|
46167
46262
|
if (spec.asOf) return askAsOf(client, tableId, spec, fields, measures, keys);
|
|
46168
46263
|
let filter = spec.where ?? {};
|
|
@@ -47007,7 +47102,7 @@ function QuestionAnswerView({ tableId, spec, answer, fields, related = NO_RELATE
|
|
|
47007
47102
|
// src/TableAsk.tsx
|
|
47008
47103
|
var import_react258 = require("react");
|
|
47009
47104
|
var import_design_system128 = require("@ai-matrx/design-system");
|
|
47010
|
-
var
|
|
47105
|
+
var import_records60 = require("@ai-matrx/records");
|
|
47011
47106
|
var import_react259 = require("@ai-matrx/records/react");
|
|
47012
47107
|
|
|
47013
47108
|
// src/askWords.ts
|
|
@@ -47237,7 +47332,7 @@ function TableAsk({ tableId, onOpenInQuestions }) {
|
|
|
47237
47332
|
await Promise.all(
|
|
47238
47333
|
all.filter(isChoiceField).map(async (field2) => {
|
|
47239
47334
|
const got = await fieldOptionsOnce(client, field2.id);
|
|
47240
|
-
if (got.ok) choices[field2.key] = (got.data ?? []).map((o) => (0,
|
|
47335
|
+
if (got.ok) choices[field2.key] = (got.data ?? []).map((o) => (0, import_records60.optionLabel)(o)).filter((w) => Boolean(w));
|
|
47241
47336
|
})
|
|
47242
47337
|
);
|
|
47243
47338
|
const read = questionFromWords(words2, all, choices);
|
|
@@ -48087,7 +48182,7 @@ function onePerKey3(all) {
|
|
|
48087
48182
|
var import_clipboard11 = require("@ai-matrx/kit/clipboard");
|
|
48088
48183
|
var import_react262 = require("react");
|
|
48089
48184
|
var import_react263 = require("@ai-matrx/records/react");
|
|
48090
|
-
var
|
|
48185
|
+
var import_records61 = require("@ai-matrx/records");
|
|
48091
48186
|
var import_design_system130 = require("@ai-matrx/design-system");
|
|
48092
48187
|
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
48093
48188
|
var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
|
|
@@ -48192,7 +48287,7 @@ function FormsPanel({ tableId, activeFormId, className }) {
|
|
|
48192
48287
|
}
|
|
48193
48288
|
) : null,
|
|
48194
48289
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)("ul", { className: "flex flex-col gap-2", children: forms.map((form) => {
|
|
48195
|
-
const url = `${origin}${(0,
|
|
48290
|
+
const url = `${origin}${(0, import_records61.publicFormPath)(form.form_id)}`;
|
|
48196
48291
|
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
48197
48292
|
"li",
|
|
48198
48293
|
{
|
|
@@ -48274,7 +48369,7 @@ var import_design_system132 = require("@ai-matrx/design-system");
|
|
|
48274
48369
|
|
|
48275
48370
|
// src/CaptureRun.tsx
|
|
48276
48371
|
var import_react264 = require("react");
|
|
48277
|
-
var
|
|
48372
|
+
var import_records62 = require("@ai-matrx/records");
|
|
48278
48373
|
var import_react265 = require("@ai-matrx/records/react");
|
|
48279
48374
|
var import_design_system131 = require("@ai-matrx/design-system");
|
|
48280
48375
|
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
@@ -48329,7 +48424,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
48329
48424
|
const [sending, setSending] = (0, import_react264.useState)(false);
|
|
48330
48425
|
const queueRef = (0, import_react264.useRef)(null);
|
|
48331
48426
|
(0, import_react264.useEffect)(() => {
|
|
48332
|
-
const q2 = (0,
|
|
48427
|
+
const q2 = (0, import_records62.openCaptureQueue)({
|
|
48333
48428
|
onChange: (c, all) => {
|
|
48334
48429
|
setCounts(c);
|
|
48335
48430
|
setItems(all);
|
|
@@ -48596,7 +48691,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
48596
48691
|
value: String(answers[q.field] ?? ""),
|
|
48597
48692
|
onChange: (e) => {
|
|
48598
48693
|
const raw = e.target.value;
|
|
48599
|
-
const answered2 = field2 ? (0,
|
|
48694
|
+
const answered2 = field2 ? (0, import_records62.coerceTypedAnswer)(field2, raw, { label: q.ask ?? (0, import_records62.coercionLabel)(field2) }) : { value: raw };
|
|
48600
48695
|
setAnswers((held) => ({
|
|
48601
48696
|
...held,
|
|
48602
48697
|
[q.field]: raw === "" ? "" : "refusal" in answered2 ? raw : answered2.value
|
|
@@ -49250,7 +49345,7 @@ function useEmbedHandshake(args) {
|
|
|
49250
49345
|
// src/TablePage.tsx
|
|
49251
49346
|
var import_clipboard14 = require("@ai-matrx/kit/clipboard");
|
|
49252
49347
|
var import_react284 = require("react");
|
|
49253
|
-
var
|
|
49348
|
+
var import_records63 = require("@ai-matrx/records");
|
|
49254
49349
|
var import_react285 = require("@ai-matrx/records/react");
|
|
49255
49350
|
var import_design_system142 = require("@ai-matrx/design-system");
|
|
49256
49351
|
var import_text_case19 = require("@ai-matrx/kit/text-case");
|
|
@@ -50085,7 +50180,7 @@ function TableNotHere({
|
|
|
50085
50180
|
return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: (0, import_design_system142.cn)("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
50086
50181
|
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-sm font-medium", children: "This table is archived" }),
|
|
50087
50182
|
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
|
|
50088
|
-
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-xs text-muted-foreground", children: (0,
|
|
50183
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-xs text-muted-foreground", children: (0, import_records63.archivedByLine)(row) }),
|
|
50089
50184
|
refusal4 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(RefusalNotice, { error: refusal4 }) : null,
|
|
50090
50185
|
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex gap-2", children: [
|
|
50091
50186
|
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
@@ -51540,7 +51635,7 @@ function TablePage2(props) {
|
|
|
51540
51635
|
|
|
51541
51636
|
// src/DataBindingPicker.tsx
|
|
51542
51637
|
var import_react288 = require("react");
|
|
51543
|
-
var
|
|
51638
|
+
var import_records64 = require("@ai-matrx/records");
|
|
51544
51639
|
var import_react289 = require("@ai-matrx/records/react");
|
|
51545
51640
|
var import_design_system145 = require("@ai-matrx/design-system");
|
|
51546
51641
|
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
@@ -51574,7 +51669,7 @@ function isCompleteDataBinding(binding) {
|
|
|
51574
51669
|
}
|
|
51575
51670
|
function bindingPlaceholdersFor(field2) {
|
|
51576
51671
|
const label = fieldName(field2);
|
|
51577
|
-
if ((0,
|
|
51672
|
+
if ((0, import_records64.isEntityReferenceConfig)(field2.config)) {
|
|
51578
51673
|
return [
|
|
51579
51674
|
{ token: `{${field2.key}.name}`, label: `${label} \xB7 name` },
|
|
51580
51675
|
{ token: `{${field2.key}.id}`, label: `${label} \xB7 id` }
|