@ai-matrx/records-ui 0.116.113 → 0.116.115
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 +8 -0
- package/dist/{SaveToTable-GRDFTAC4.js → SaveToTable-FVDYG5QS.js} +3 -3
- package/dist/{chunk-FZVW6XVB.js → chunk-ESOQXQAE.js} +2 -2
- package/dist/{chunk-LGQLATW5.js → chunk-KUEASKVB.js} +4 -4
- package/dist/{chunk-Z3EUU2NM.js → chunk-OY553AFP.js} +2 -2
- package/dist/{chunk-N76I4VXM.js → chunk-PYLGLSKU.js} +2 -2
- package/dist/{chunk-JTEIYLII.js → chunk-RKI2YQHW.js} +2 -2
- package/dist/chunk-RKI2YQHW.js.map +1 -0
- package/dist/entity-doors.cjs +3 -4
- package/dist/entity-doors.cjs.map +1 -1
- package/dist/entity-doors.js +3 -4
- package/dist/entity-doors.js.map +1 -1
- package/dist/entity-ref.cjs +4 -5
- package/dist/entity-ref.cjs.map +1 -1
- package/dist/entity-ref.js +4 -5
- package/dist/entity-ref.js.map +1 -1
- package/dist/helpers.cjs +2 -3
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +2 -2
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +394 -394
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/pickers.cjs +158 -158
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +3 -3
- package/dist/skeleton.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-JTEIYLII.js.map +0 -1
- /package/dist/{SaveToTable-GRDFTAC4.js.map → SaveToTable-FVDYG5QS.js.map} +0 -0
- /package/dist/{chunk-FZVW6XVB.js.map → chunk-ESOQXQAE.js.map} +0 -0
- /package/dist/{chunk-LGQLATW5.js.map → chunk-KUEASKVB.js.map} +0 -0
- /package/dist/{chunk-Z3EUU2NM.js.map → chunk-OY553AFP.js.map} +0 -0
- /package/dist/{chunk-N76I4VXM.js.map → chunk-PYLGLSKU.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -553,7 +553,7 @@ function setPersonTimeZone(next) {
|
|
|
553
553
|
state.zone = clean;
|
|
554
554
|
(0, import_table_style.setColorRuleTimeZone)(clean);
|
|
555
555
|
(0, import_table_style.setDisplayTimeZone)(clean);
|
|
556
|
-
(0,
|
|
556
|
+
(0, import_views.setReadersTimeZone)(clean);
|
|
557
557
|
state.listeners.forEach((l) => l());
|
|
558
558
|
}
|
|
559
559
|
function getPersonTimeZone() {
|
|
@@ -593,12 +593,12 @@ function instantFromPersonWall(wall) {
|
|
|
593
593
|
}
|
|
594
594
|
return new Date(guess);
|
|
595
595
|
}
|
|
596
|
-
var import_table_style,
|
|
596
|
+
var import_table_style, import_views, import_global_slot, state;
|
|
597
597
|
var init_personZone = __esm({
|
|
598
598
|
"src/personZone.ts"() {
|
|
599
599
|
"use strict";
|
|
600
600
|
import_table_style = require("@ai-matrx/design-system/data-table/table-style");
|
|
601
|
-
|
|
601
|
+
import_views = require("@ai-matrx/records/views");
|
|
602
602
|
import_global_slot = require("@ai-matrx/kit/global-slot");
|
|
603
603
|
state = (0, import_global_slot.globalSlot)("ai-matrx.records-ui.person-time-zone", () => ({
|
|
604
604
|
zone: null,
|
|
@@ -1590,7 +1590,7 @@ function PersonPicker({ field: field2, value, onChange, disabled, id, className,
|
|
|
1590
1590
|
cancelled = true;
|
|
1591
1591
|
};
|
|
1592
1592
|
}, [client, personTable, picked.length, people.length]);
|
|
1593
|
-
const listed = (0,
|
|
1593
|
+
const listed = (0, import_records4.rankTypedMatches)(members ?? [], search, memberName);
|
|
1594
1594
|
if (!membersPort || !client) {
|
|
1595
1595
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: (0, import_design_system9.cn)("text-xs text-muted-foreground", className), children: NO_MEMBERS_REASON });
|
|
1596
1596
|
}
|
|
@@ -1691,13 +1691,13 @@ function PersonPicker({ field: field2, value, onChange, disabled, id, className,
|
|
|
1691
1691
|
)
|
|
1692
1692
|
] });
|
|
1693
1693
|
}
|
|
1694
|
-
var import_react16,
|
|
1694
|
+
var import_react16, import_records4, import_react17, import_design_system9, import_jsx_runtime14;
|
|
1695
1695
|
var init_PersonPicker = __esm({
|
|
1696
1696
|
"src/PersonPicker.tsx"() {
|
|
1697
1697
|
"use strict";
|
|
1698
1698
|
"use client";
|
|
1699
1699
|
import_react16 = require("react");
|
|
1700
|
-
|
|
1700
|
+
import_records4 = require("@ai-matrx/records");
|
|
1701
1701
|
import_react17 = require("@ai-matrx/records/react");
|
|
1702
1702
|
import_design_system9 = require("@ai-matrx/design-system");
|
|
1703
1703
|
init_PickOrAdd();
|
|
@@ -2080,7 +2080,7 @@ function usePickerTables() {
|
|
|
2080
2080
|
};
|
|
2081
2081
|
}, [client, nonce]);
|
|
2082
2082
|
const data = (0, import_react36.useMemo)(
|
|
2083
|
-
() => (0,
|
|
2083
|
+
() => (0, import_records11.withTablePlacement)(tables.data ?? [], facts === "reading" ? null : facts),
|
|
2084
2084
|
[tables.data, facts]
|
|
2085
2085
|
);
|
|
2086
2086
|
return { loading: tables.loading || facts === "reading", data, reload };
|
|
@@ -2099,13 +2099,13 @@ function ShowListsToggle({
|
|
|
2099
2099
|
")"
|
|
2100
2100
|
] });
|
|
2101
2101
|
}
|
|
2102
|
-
var import_react36,
|
|
2102
|
+
var import_react36, import_records11, import_react37, import_design_system20, import_jsx_runtime26;
|
|
2103
2103
|
var init_tablePicking = __esm({
|
|
2104
2104
|
"src/tablePicking.tsx"() {
|
|
2105
2105
|
"use strict";
|
|
2106
2106
|
"use client";
|
|
2107
2107
|
import_react36 = require("react");
|
|
2108
|
-
|
|
2108
|
+
import_records11 = require("@ai-matrx/records");
|
|
2109
2109
|
import_react37 = require("@ai-matrx/records/react");
|
|
2110
2110
|
import_design_system20 = require("@ai-matrx/design-system");
|
|
2111
2111
|
init_tablePickerEntries();
|
|
@@ -3028,7 +3028,7 @@ function choiceOptionsOf(options) {
|
|
|
3028
3028
|
const labels = [];
|
|
3029
3029
|
for (const option of options) {
|
|
3030
3030
|
const id = option.id;
|
|
3031
|
-
const key = (0,
|
|
3031
|
+
const key = (0, import_records16.optionKey)(option);
|
|
3032
3032
|
const label = recordName(option.data, null, "");
|
|
3033
3033
|
if (label) {
|
|
3034
3034
|
labels.push(label);
|
|
@@ -3040,7 +3040,7 @@ function choiceOptionsOf(options) {
|
|
|
3040
3040
|
return { byWord, labels };
|
|
3041
3041
|
}
|
|
3042
3042
|
function valueFromPastedText(field2, raw, options, relationNames) {
|
|
3043
|
-
return (0,
|
|
3043
|
+
return (0, import_records16.coerceTypedAnswer)(field2, raw, {
|
|
3044
3044
|
label: fieldName(field2),
|
|
3045
3045
|
...options ? { options } : {},
|
|
3046
3046
|
...relationNames ? { relationNames } : {}
|
|
@@ -3233,12 +3233,12 @@ function gridRefusalForPastedCell(field2, value) {
|
|
|
3233
3233
|
const judged = valueFromPastedText(field2, value === null ? "" : String(value));
|
|
3234
3234
|
return "refusal" in judged ? judged.refusal : void 0;
|
|
3235
3235
|
}
|
|
3236
|
-
var import_core6,
|
|
3236
|
+
var import_core6, import_records16, sameWords;
|
|
3237
3237
|
var init_pasteValues = __esm({
|
|
3238
3238
|
"src/pasteValues.ts"() {
|
|
3239
3239
|
"use strict";
|
|
3240
3240
|
import_core6 = require("@ai-matrx/records/core");
|
|
3241
|
-
|
|
3241
|
+
import_records16 = require("@ai-matrx/records");
|
|
3242
3242
|
init_dates();
|
|
3243
3243
|
init_parity();
|
|
3244
3244
|
init_names();
|
|
@@ -3362,7 +3362,7 @@ function datesOfColumn(rows, header, opts = {}) {
|
|
|
3362
3362
|
const raw = String(r[header] ?? "").trim();
|
|
3363
3363
|
if (raw === "") return;
|
|
3364
3364
|
filled += 1;
|
|
3365
|
-
const got = (0,
|
|
3365
|
+
const got = (0, import_records17.readTypedDate)(raw, { ...opts.withTime ? { withTime: true } : {}, ...opts.locale ? { locale: opts.locale } : {} });
|
|
3366
3366
|
if (got.ok) read.set(i, opts.withTime && got.instant ? got.instant : got.day);
|
|
3367
3367
|
else unreadable.push({ row: i, raw });
|
|
3368
3368
|
});
|
|
@@ -3395,11 +3395,11 @@ function looksLike(rows, header) {
|
|
|
3395
3395
|
if (share(isPhone) >= 0.6) return "phone";
|
|
3396
3396
|
return null;
|
|
3397
3397
|
}
|
|
3398
|
-
var
|
|
3398
|
+
var import_records17, IMPORT_KINDS, EMAIL2, PHONE2, URLISH;
|
|
3399
3399
|
var init_importKinds = __esm({
|
|
3400
3400
|
"src/importKinds.ts"() {
|
|
3401
3401
|
"use strict";
|
|
3402
|
-
|
|
3402
|
+
import_records17 = require("@ai-matrx/records");
|
|
3403
3403
|
IMPORT_KINDS = [
|
|
3404
3404
|
{ kind: "text", label: "Text" },
|
|
3405
3405
|
{ kind: "date", label: "Date" },
|
|
@@ -3421,7 +3421,7 @@ function titleRepeats(rows, header) {
|
|
|
3421
3421
|
const seen = /* @__PURE__ */ new Set();
|
|
3422
3422
|
let filled = 0;
|
|
3423
3423
|
for (const r of rows) {
|
|
3424
|
-
const key = (0,
|
|
3424
|
+
const key = (0, import_records18.relationNameKey)(String(r[header] ?? ""));
|
|
3425
3425
|
if (key === "") continue;
|
|
3426
3426
|
filled += 1;
|
|
3427
3427
|
seen.add(key);
|
|
@@ -3431,7 +3431,7 @@ function titleRepeats(rows, header) {
|
|
|
3431
3431
|
function sameRecordLikely(rows, header, notIdentity) {
|
|
3432
3432
|
const groups = /* @__PURE__ */ new Map();
|
|
3433
3433
|
for (const r of rows) {
|
|
3434
|
-
const key = (0,
|
|
3434
|
+
const key = (0, import_records18.relationNameKey)(String(r[header] ?? ""));
|
|
3435
3435
|
if (key === "") continue;
|
|
3436
3436
|
const held = groups.get(key);
|
|
3437
3437
|
if (held) held.push(r);
|
|
@@ -3464,7 +3464,7 @@ function combineRows(rows, header) {
|
|
|
3464
3464
|
const out = [];
|
|
3465
3465
|
const outLines = [];
|
|
3466
3466
|
rows.forEach((r, i) => {
|
|
3467
|
-
const key = (0,
|
|
3467
|
+
const key = (0, import_records18.relationNameKey)(String(r[header] ?? ""));
|
|
3468
3468
|
if (key === "") {
|
|
3469
3469
|
out.push({ ...r });
|
|
3470
3470
|
outLines.push([i + 1]);
|
|
@@ -3504,11 +3504,11 @@ function combineRows(rows, header) {
|
|
|
3504
3504
|
index.sort((a, b) => a.lines[0] - b.lines[0]);
|
|
3505
3505
|
return { rows: index.map((e) => e.row), lines: index.map((e) => e.lines), multiValued };
|
|
3506
3506
|
}
|
|
3507
|
-
var
|
|
3507
|
+
var import_records18, LIST_JOIN;
|
|
3508
3508
|
var init_importCombine = __esm({
|
|
3509
3509
|
"src/importCombine.ts"() {
|
|
3510
3510
|
"use strict";
|
|
3511
|
-
|
|
3511
|
+
import_records18 = require("@ai-matrx/records");
|
|
3512
3512
|
LIST_JOIN = "; ";
|
|
3513
3513
|
}
|
|
3514
3514
|
});
|
|
@@ -3977,13 +3977,13 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3977
3977
|
async (wanted) => {
|
|
3978
3978
|
const next = /* @__PURE__ */ new Map();
|
|
3979
3979
|
for (const { header, field: field2 } of wanted) {
|
|
3980
|
-
const names2 = effectiveRows.flatMap((r) => (0,
|
|
3980
|
+
const names2 = effectiveRows.flatMap((r) => (0, import_records19.relationNamesIn)(field2, String(r[header] ?? "")));
|
|
3981
3981
|
const got = await client.relationNamesMatch({ table_id: field2.relation_target, names: names2 });
|
|
3982
3982
|
if (!got.ok) {
|
|
3983
3983
|
setRelationProblem(got.error);
|
|
3984
3984
|
return null;
|
|
3985
3985
|
}
|
|
3986
|
-
next.set(field2.key, (0,
|
|
3986
|
+
next.set(field2.key, (0, import_records19.relationNameIndexOf)(got.data));
|
|
3987
3987
|
}
|
|
3988
3988
|
setRelationProblem(null);
|
|
3989
3989
|
setRelationIndex(next);
|
|
@@ -4007,12 +4007,12 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4007
4007
|
let linked = 0;
|
|
4008
4008
|
let named = 0;
|
|
4009
4009
|
effectiveRows.forEach((row, i) => {
|
|
4010
|
-
const names2 = (0,
|
|
4010
|
+
const names2 = (0, import_records19.relationNamesIn)(field2, String(row[header] ?? ""));
|
|
4011
4011
|
if (String(row[header] ?? "").trim() === "") return;
|
|
4012
4012
|
named += 1;
|
|
4013
4013
|
let ok = true;
|
|
4014
4014
|
for (const name of names2) {
|
|
4015
|
-
const hits = index.byName.get((0,
|
|
4015
|
+
const hits = index.byName.get((0, import_records19.relationNameKey)(name)) ?? [];
|
|
4016
4016
|
if (hits.length === 1) continue;
|
|
4017
4017
|
ok = false;
|
|
4018
4018
|
if (hits.length === 0) unmatched.set(name, [...unmatched.get(name) ?? [], i + 1]);
|
|
@@ -4078,11 +4078,11 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4078
4078
|
const named = index.get(field2.key);
|
|
4079
4079
|
const text = String(row[header] ?? "").trim();
|
|
4080
4080
|
if (!named || text === "") continue;
|
|
4081
|
-
const parts = field2.multi ? (0,
|
|
4081
|
+
const parts = field2.multi ? (0, import_records19.splitListCell)(text) : [text];
|
|
4082
4082
|
const ids = [];
|
|
4083
4083
|
let skip = false;
|
|
4084
4084
|
for (const part of parts) {
|
|
4085
|
-
const hits = (0,
|
|
4085
|
+
const hits = (0, import_records19.relationNamesIn)(field2, part).length === 0 ? null : named.byName.get((0, import_records19.relationNameKey)(part)) ?? [];
|
|
4086
4086
|
if (hits === null) ids.push(part);
|
|
4087
4087
|
else if (hits.length === 1) ids.push(hits[0].id);
|
|
4088
4088
|
else if ((hits.length === 0 ? choiceFor(field2.key).unmatched : choiceFor(field2.key).ambiguous) !== "empty") skip = true;
|
|
@@ -4122,7 +4122,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4122
4122
|
setPhase("linking");
|
|
4123
4123
|
for (const ask2 of toMerge) {
|
|
4124
4124
|
for (const [name] of ask2.ambiguous) {
|
|
4125
|
-
const hits = ask2.index.byName.get((0,
|
|
4125
|
+
const hits = ask2.index.byName.get((0, import_records19.relationNameKey)(name)) ?? [];
|
|
4126
4126
|
const winner = hits[0];
|
|
4127
4127
|
if (!winner) continue;
|
|
4128
4128
|
for (const loser of hits.slice(1)) {
|
|
@@ -5062,7 +5062,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
5062
5062
|
table.error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(RefusalNotice, { error: table.error, onRetry: table.reload }) : null
|
|
5063
5063
|
] });
|
|
5064
5064
|
}
|
|
5065
|
-
var import_react57, import_react58, import_core8, import_design_system32,
|
|
5065
|
+
var import_react57, import_react58, import_core8, import_design_system32, import_records19, import_text_case5, import_jsx_runtime39, BATCH, SAMPLES, COLUMNS_PER_CALL, ABSENT, LEAVE, TITLE_COPY, TYPED_VALUES;
|
|
5066
5066
|
var init_ImportWizard = __esm({
|
|
5067
5067
|
"src/ImportWizard.tsx"() {
|
|
5068
5068
|
"use strict";
|
|
@@ -5071,7 +5071,7 @@ var init_ImportWizard = __esm({
|
|
|
5071
5071
|
import_react58 = require("@ai-matrx/records/react");
|
|
5072
5072
|
import_core8 = require("@ai-matrx/records/core");
|
|
5073
5073
|
import_design_system32 = require("@ai-matrx/design-system");
|
|
5074
|
-
|
|
5074
|
+
import_records19 = require("@ai-matrx/records");
|
|
5075
5075
|
init_Refusal();
|
|
5076
5076
|
init_refusals();
|
|
5077
5077
|
init_importRuleCheck();
|
|
@@ -6226,7 +6226,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
6226
6226
|
if (!rights.structure) {
|
|
6227
6227
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: (0, import_design_system36.cn)("text-xs text-muted-foreground", className), children: rights.why("structure") ?? "Making a booking page needs Full access on this table, because it lets people with no account take time in your calendar." });
|
|
6228
6228
|
}
|
|
6229
|
-
const url = formId ? `${publicOrigin}${(0,
|
|
6229
|
+
const url = formId ? `${publicOrigin}${(0, import_records20.bookingPath)(formId)}` : null;
|
|
6230
6230
|
const shown5 = offer ?? null;
|
|
6231
6231
|
return (
|
|
6232
6232
|
// THE RAIL IS 384px WIDE AND THE VIEWPORT IS NOT (walk 1, 2026-09-21):
|
|
@@ -6625,7 +6625,7 @@ function asksWhoTheyAre(askable) {
|
|
|
6625
6625
|
return kind2 === "email" || kind2 === "phone";
|
|
6626
6626
|
});
|
|
6627
6627
|
}
|
|
6628
|
-
var import_clipboard, import_design_system35, import_react62, import_react63, import_format3,
|
|
6628
|
+
var import_clipboard, import_design_system35, import_react62, import_react63, import_format3, import_records20, import_design_system36, import_controls7, import_jsx_runtime42, STORE_ANSWERS_THESE, DAYS, LENGTHS, WORKING_WEEK;
|
|
6629
6629
|
var init_BookingBuilder = __esm({
|
|
6630
6630
|
"src/BookingBuilder.tsx"() {
|
|
6631
6631
|
"use strict";
|
|
@@ -6635,7 +6635,7 @@ var init_BookingBuilder = __esm({
|
|
|
6635
6635
|
import_react62 = require("react");
|
|
6636
6636
|
import_react63 = require("@ai-matrx/records/react");
|
|
6637
6637
|
import_format3 = require("@ai-matrx/kit/format");
|
|
6638
|
-
|
|
6638
|
+
import_records20 = require("@ai-matrx/records");
|
|
6639
6639
|
import_design_system36 = require("@ai-matrx/design-system");
|
|
6640
6640
|
import_controls7 = require("@ai-matrx/design-system/controls");
|
|
6641
6641
|
init_bookingMessages();
|
|
@@ -7150,9 +7150,9 @@ function ArchivedBuiltOn({ tableId, onRestored }) {
|
|
|
7150
7150
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
7151
7151
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate text-sm", children: thing.title }),
|
|
7152
7152
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
7153
|
-
|
|
7153
|
+
import_records21.BUILT_KIND_WORD[thing.kind],
|
|
7154
7154
|
" \xB7 archived ",
|
|
7155
|
-
(0,
|
|
7155
|
+
(0, import_records21.archivedWhen)(thing.archivedAt)
|
|
7156
7156
|
] }),
|
|
7157
7157
|
refusal3 && refusal3.id === thing.id ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RefusalNotice, { error: refusal3.error, className: "mt-2" }) : null
|
|
7158
7158
|
] }),
|
|
@@ -7173,13 +7173,13 @@ function ArchivedBuiltOn({ tableId, onRestored }) {
|
|
|
7173
7173
|
)) })
|
|
7174
7174
|
] });
|
|
7175
7175
|
}
|
|
7176
|
-
var import_react64,
|
|
7176
|
+
var import_react64, import_records21, import_react65, import_design_system39, import_jsx_runtime46, ARCHIVE_NEEDS_ADMIN;
|
|
7177
7177
|
var init_BuiltOnArchive = __esm({
|
|
7178
7178
|
"src/BuiltOnArchive.tsx"() {
|
|
7179
7179
|
"use strict";
|
|
7180
7180
|
"use client";
|
|
7181
7181
|
import_react64 = require("react");
|
|
7182
|
-
|
|
7182
|
+
import_records21 = require("@ai-matrx/records");
|
|
7183
7183
|
import_react65 = require("@ai-matrx/records/react");
|
|
7184
7184
|
import_design_system39 = require("@ai-matrx/design-system");
|
|
7185
7185
|
init_ObjectActionMenuItems();
|
|
@@ -7313,7 +7313,7 @@ function BookingSlots({ tableId, activeBookingId, className }) {
|
|
|
7313
7313
|
" Open the table the appointments should land in to make one."
|
|
7314
7314
|
] }) : null,
|
|
7315
7315
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("ul", { className: "flex flex-col gap-2", children: pages.map((page) => {
|
|
7316
|
-
const url = `${origin}${(0,
|
|
7316
|
+
const url = `${origin}${(0, import_records22.bookingPath)(page.form_id)}`;
|
|
7317
7317
|
const mayOpen = levels.data?.[page.table_id] === "admin";
|
|
7318
7318
|
const open = page.published_at !== null && page.closed_at === null;
|
|
7319
7319
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
@@ -7430,7 +7430,7 @@ function nextInWords(page) {
|
|
|
7430
7430
|
}
|
|
7431
7431
|
return `Next: ${said2} (${page.timezone}).`;
|
|
7432
7432
|
}
|
|
7433
|
-
var import_clipboard2, import_react66, import_react67,
|
|
7433
|
+
var import_clipboard2, import_react66, import_react67, import_records22, import_design_system40, import_jsx_runtime47, BOOKING_NOT_HERE_LINE, WHAT_A_BOOKING_PAGE_IS, NO_ADMIN, STATE_WORDS;
|
|
7434
7434
|
var init_BookingSlots = __esm({
|
|
7435
7435
|
"src/BookingSlots.tsx"() {
|
|
7436
7436
|
"use strict";
|
|
@@ -7438,7 +7438,7 @@ var init_BookingSlots = __esm({
|
|
|
7438
7438
|
import_clipboard2 = require("@ai-matrx/kit/clipboard");
|
|
7439
7439
|
import_react66 = require("react");
|
|
7440
7440
|
import_react67 = require("@ai-matrx/records/react");
|
|
7441
|
-
|
|
7441
|
+
import_records22 = require("@ai-matrx/records");
|
|
7442
7442
|
import_design_system40 = require("@ai-matrx/design-system");
|
|
7443
7443
|
init_BookingBuilder();
|
|
7444
7444
|
init_BuildOrAsk();
|
|
@@ -7581,7 +7581,7 @@ function WhereItLives({ tableId, knownOrganizationName, onMoved, variant = "head
|
|
|
7581
7581
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SharedNameAddress, { to: choosing, all: answer.home.destinations }),
|
|
7582
7582
|
"?"
|
|
7583
7583
|
] }),
|
|
7584
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: (0,
|
|
7584
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: (0, import_records23.moveConsequence)(answer.home, choosing) }),
|
|
7585
7585
|
said2?.tone === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7586
7586
|
import_design_system41.ErrorBox,
|
|
7587
7587
|
{
|
|
@@ -7659,13 +7659,13 @@ function SharedNameAddress({
|
|
|
7659
7659
|
const address = sharedNameAddress(to, all);
|
|
7660
7660
|
return address ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "ml-1.5 font-normal text-muted-foreground", "data-where-it-lives-address": "", children: address }) : null;
|
|
7661
7661
|
}
|
|
7662
|
-
var import_react68,
|
|
7662
|
+
var import_react68, import_records23, import_react69, import_design_system41, import_jsx_runtime48;
|
|
7663
7663
|
var init_WhereItLives = __esm({
|
|
7664
7664
|
"src/WhereItLives.tsx"() {
|
|
7665
7665
|
"use strict";
|
|
7666
7666
|
"use client";
|
|
7667
7667
|
import_react68 = require("react");
|
|
7668
|
-
|
|
7668
|
+
import_records23 = require("@ai-matrx/records");
|
|
7669
7669
|
import_react69 = require("@ai-matrx/records/react");
|
|
7670
7670
|
init_host();
|
|
7671
7671
|
init_Refusal();
|
|
@@ -7731,7 +7731,7 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
|
|
|
7731
7731
|
alive = false;
|
|
7732
7732
|
};
|
|
7733
7733
|
}, [client]);
|
|
7734
|
-
const listed = facts.phase === "read" ? (0,
|
|
7734
|
+
const listed = facts.phase === "read" ? (0, import_records24.withTablePlacement)(
|
|
7735
7735
|
(0, import_core9.withTableFacts)(tables.data ?? [], facts.rows, me),
|
|
7736
7736
|
facts.rows
|
|
7737
7737
|
) : tables.data ?? [];
|
|
@@ -7888,7 +7888,7 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
|
|
|
7888
7888
|
}) : null
|
|
7889
7889
|
] });
|
|
7890
7890
|
}
|
|
7891
|
-
var import_react70, import_react71, import_core9,
|
|
7891
|
+
var import_react70, import_react71, import_core9, import_records24, import_design_system42, import_jsx_runtime49, TABLE_LANES, LANE_TITLE, LANE_EMPTY, SECTIONS_UNKNOWN, VISIBILITY_LANES, VISIBILITY_LANE_TITLE;
|
|
7892
7892
|
var init_TablesHome = __esm({
|
|
7893
7893
|
"src/TablesHome.tsx"() {
|
|
7894
7894
|
"use strict";
|
|
@@ -7896,7 +7896,7 @@ var init_TablesHome = __esm({
|
|
|
7896
7896
|
import_react70 = require("react");
|
|
7897
7897
|
import_react71 = require("@ai-matrx/records/react");
|
|
7898
7898
|
import_core9 = require("@ai-matrx/records/core");
|
|
7899
|
-
|
|
7899
|
+
import_records24 = require("@ai-matrx/records");
|
|
7900
7900
|
import_design_system42 = require("@ai-matrx/design-system");
|
|
7901
7901
|
init_NewTableStart();
|
|
7902
7902
|
init_Refusal();
|
|
@@ -8588,8 +8588,8 @@ __export(src_exports, {
|
|
|
8588
8588
|
KERNEL_REASON: () => KERNEL_REASON,
|
|
8589
8589
|
LANE_EMPTY: () => LANE_EMPTY,
|
|
8590
8590
|
LANE_TITLE: () => LANE_TITLE,
|
|
8591
|
-
LAYOUT_FIELD_KIND: () =>
|
|
8592
|
-
LAYOUT_LABEL: () =>
|
|
8591
|
+
LAYOUT_FIELD_KIND: () => import_views3.LAYOUT_FIELD_KIND,
|
|
8592
|
+
LAYOUT_LABEL: () => import_views3.LAYOUT_LABEL,
|
|
8593
8593
|
LEVEL_WORD: () => LEVEL_WORD,
|
|
8594
8594
|
LOOK_WORDS: () => LOOK_WORDS,
|
|
8595
8595
|
MACHINE_IDENTITY: () => MACHINE_IDENTITY,
|
|
@@ -8627,8 +8627,8 @@ __export(src_exports, {
|
|
|
8627
8627
|
PAGE_BLOCK_KINDS: () => PAGE_BLOCK_KINDS,
|
|
8628
8628
|
PAGE_BLOCK_LABEL: () => PAGE_BLOCK_LABEL,
|
|
8629
8629
|
PAGE_KIND: () => PAGE_KIND,
|
|
8630
|
-
PAGE_VIEWS: () =>
|
|
8631
|
-
PAGE_VIEW_LABEL: () =>
|
|
8630
|
+
PAGE_VIEWS: () => import_views3.PAGE_VIEWS,
|
|
8631
|
+
PAGE_VIEW_LABEL: () => import_views3.PAGE_VIEW_LABEL,
|
|
8632
8632
|
PARITY_LABEL: () => PARITY_LABEL,
|
|
8633
8633
|
PARITY_MADE_OF: () => PARITY_MADE_OF,
|
|
8634
8634
|
PERSON_KERNEL_TABLE: () => PERSON_KERNEL_TABLE,
|
|
@@ -8696,8 +8696,8 @@ __export(src_exports, {
|
|
|
8696
8696
|
STANDARD_VERBS: () => STANDARD_VERBS,
|
|
8697
8697
|
STORE_ANSWERS_THESE: () => STORE_ANSWERS_THESE,
|
|
8698
8698
|
STORE_DECIDES_REASON: () => STORE_DECIDES_REASON,
|
|
8699
|
-
STORE_KEEPS_TIMELINE: () =>
|
|
8700
|
-
STORE_KEPT_LAYOUTS: () =>
|
|
8699
|
+
STORE_KEEPS_TIMELINE: () => import_views3.STORE_KEEPS_TIMELINE,
|
|
8700
|
+
STORE_KEPT_LAYOUTS: () => import_views3.STORE_KEPT_LAYOUTS,
|
|
8701
8701
|
STRIP_FEATURE_ROWS: () => STRIP_FEATURE_ROWS,
|
|
8702
8702
|
STRUCTURE_LOCKED: () => STRUCTURE_LOCKED,
|
|
8703
8703
|
SUBSCRIBE_ACTION_ID: () => SUBSCRIBE_ACTION_ID,
|
|
@@ -8753,9 +8753,9 @@ __export(src_exports, {
|
|
|
8753
8753
|
TimelineView: () => TimelineView,
|
|
8754
8754
|
UNREAD_RECORD_LABEL: () => UNREAD_RECORD_LABEL,
|
|
8755
8755
|
VIEW_ADDRESS_KEYS: () => VIEW_ADDRESS_KEYS,
|
|
8756
|
-
VIEW_KEYS: () =>
|
|
8757
|
-
VIEW_LAYOUTS: () =>
|
|
8758
|
-
VIEW_NEEDS: () =>
|
|
8756
|
+
VIEW_KEYS: () => import_views2.VIEW_KEYS,
|
|
8757
|
+
VIEW_LAYOUTS: () => import_views3.VIEW_LAYOUTS,
|
|
8758
|
+
VIEW_NEEDS: () => import_views3.VIEW_NEEDS,
|
|
8759
8759
|
VIEW_NOT_SAVED_YET: () => VIEW_NOT_SAVED_YET,
|
|
8760
8760
|
VISIBILITY_LANES: () => VISIBILITY_LANES,
|
|
8761
8761
|
VISIBILITY_LANE_TITLE: () => VISIBILITY_LANE_TITLE,
|
|
@@ -8779,7 +8779,7 @@ __export(src_exports, {
|
|
|
8779
8779
|
addDays: () => addDays,
|
|
8780
8780
|
addFields: () => import_field_kinds6.addFields,
|
|
8781
8781
|
announceTableArchived: () => announceTableArchived,
|
|
8782
|
-
applyLook: () =>
|
|
8782
|
+
applyLook: () => import_views4.applyLook,
|
|
8783
8783
|
archiveConfirmSentence: () => archiveConfirmSentence,
|
|
8784
8784
|
archivedRowLine: () => archivedRowLine,
|
|
8785
8785
|
asRefusal: () => refusals_exports.asRefusal,
|
|
@@ -8842,7 +8842,7 @@ __export(src_exports, {
|
|
|
8842
8842
|
defaultBindingTemplate: () => defaultBindingTemplate,
|
|
8843
8843
|
defaultMapField: () => defaultMapField,
|
|
8844
8844
|
defaultPivotRows: () => defaultPivotRows,
|
|
8845
|
-
defaultViewOf: () =>
|
|
8845
|
+
defaultViewOf: () => import_views3.defaultViewOf,
|
|
8846
8846
|
descriptionPatch: () => descriptionPatch,
|
|
8847
8847
|
drawnBelowOnPage: () => drawnBelowOnPage,
|
|
8848
8848
|
drawnSignatureOf: () => drawnSignatureOf,
|
|
@@ -8896,7 +8896,7 @@ __export(src_exports, {
|
|
|
8896
8896
|
formPresentation: () => import_forms9.formPresentation,
|
|
8897
8897
|
formRoutes: () => import_forms9.formRoutes,
|
|
8898
8898
|
formatForField: () => formatForField,
|
|
8899
|
-
freeColumnName: () =>
|
|
8899
|
+
freeColumnName: () => import_views3.freeColumnName,
|
|
8900
8900
|
freshFormName: () => freshFormName,
|
|
8901
8901
|
getPersonTimeZone: () => getPersonTimeZone,
|
|
8902
8902
|
googleCalendarUrl: () => googleCalendarUrl,
|
|
@@ -8949,10 +8949,10 @@ __export(src_exports, {
|
|
|
8949
8949
|
levelNeededFor: () => levelNeededFor,
|
|
8950
8950
|
liveRecordMakers: () => liveRecordMakers,
|
|
8951
8951
|
lookChecks: () => lookChecks,
|
|
8952
|
-
lookDiffers: () =>
|
|
8952
|
+
lookDiffers: () => import_views4.lookDiffers,
|
|
8953
8953
|
lookDocument: () => lookDocument,
|
|
8954
8954
|
lookFromDocument: () => lookFromDocument,
|
|
8955
|
-
lookPart: () =>
|
|
8955
|
+
lookPart: () => import_views4.lookPart,
|
|
8956
8956
|
looksLikeId: () => looksLikeId,
|
|
8957
8957
|
machineIdentityIn: () => machineIdentityIn,
|
|
8958
8958
|
mapFieldChoices: () => mapFieldChoices,
|
|
@@ -8978,7 +8978,7 @@ __export(src_exports, {
|
|
|
8978
8978
|
packOverlaps: () => packOverlaps,
|
|
8979
8979
|
pageBlocksOf: () => pageBlocksOf,
|
|
8980
8980
|
pagePresentation: () => pagePresentation,
|
|
8981
|
-
pageViewFromParam: () =>
|
|
8981
|
+
pageViewFromParam: () => import_views3.pageViewFromParam,
|
|
8982
8982
|
parityTypesWithNoExplanation: () => parityTypesWithNoExplanation,
|
|
8983
8983
|
parseDelimited: () => parseDelimited,
|
|
8984
8984
|
parseGridPresentation: () => parseGridPresentation,
|
|
@@ -9040,7 +9040,7 @@ __export(src_exports, {
|
|
|
9040
9040
|
sameViewAddress: () => sameViewAddress,
|
|
9041
9041
|
sampleDocument: () => sampleDocument,
|
|
9042
9042
|
saveTableDescription: () => saveTableDescription,
|
|
9043
|
-
saveToViewPlan: () =>
|
|
9043
|
+
saveToViewPlan: () => import_views4.saveToViewPlan,
|
|
9044
9044
|
saveViewPatch: () => saveViewPatch,
|
|
9045
9045
|
scalarText: () => scalarText,
|
|
9046
9046
|
sectionColumns: () => sectionColumns,
|
|
@@ -9064,7 +9064,7 @@ __export(src_exports, {
|
|
|
9064
9064
|
starterPageBlocks: () => starterPageBlocks,
|
|
9065
9065
|
stepFromAgent: () => stepFromAgent,
|
|
9066
9066
|
storeDecidesRights: () => storeDecidesRights,
|
|
9067
|
-
storeKeepsLayout: () =>
|
|
9067
|
+
storeKeepsLayout: () => import_views3.storeKeepsLayout,
|
|
9068
9068
|
storePublishesKind: () => storePublishesKind,
|
|
9069
9069
|
styleFromDecorations: () => styleFromDecorations,
|
|
9070
9070
|
submissionStamp: () => import_forms9.submissionStamp,
|
|
@@ -9087,7 +9087,7 @@ __export(src_exports, {
|
|
|
9087
9087
|
tokenName: () => tokenName,
|
|
9088
9088
|
tokensFromRows: () => tokensFromRows,
|
|
9089
9089
|
unknownRailLine: () => unknownRailLine,
|
|
9090
|
-
unknownViewLine: () =>
|
|
9090
|
+
unknownViewLine: () => import_views3.unknownViewLine,
|
|
9091
9091
|
unreadableKeys: () => question_exports.unreadableKeys,
|
|
9092
9092
|
useAddressDrill: () => useAddressDrill,
|
|
9093
9093
|
useCanShare: () => useCanShare,
|
|
@@ -9127,11 +9127,11 @@ __export(src_exports, {
|
|
|
9127
9127
|
viewAddressToParams: () => viewAddressToParams,
|
|
9128
9128
|
viewDocument: () => viewDocument,
|
|
9129
9129
|
viewFromRow: () => viewFromRow,
|
|
9130
|
-
viewKeysFor: () =>
|
|
9130
|
+
viewKeysFor: () => import_views2.viewKeysFor,
|
|
9131
9131
|
viewNeedFor: () => viewNeedFor,
|
|
9132
9132
|
viewPatchDocument: () => viewPatchDocument,
|
|
9133
9133
|
viewSettings: () => viewSettings,
|
|
9134
|
-
viewSettingsFor: () =>
|
|
9134
|
+
viewSettingsFor: () => import_views2.viewSettingsFor,
|
|
9135
9135
|
viewSettingsPatch: () => viewSettingsPatch,
|
|
9136
9136
|
visibilityLaneFor: () => visibilityLaneFor,
|
|
9137
9137
|
webcalUrl: () => webcalUrl,
|
|
@@ -9148,7 +9148,7 @@ __export(src_exports, {
|
|
|
9148
9148
|
withheldNoticeOf: () => withheldNoticeOf,
|
|
9149
9149
|
withheldSentence: () => withheldSentence,
|
|
9150
9150
|
withoutAddition: () => withoutAddition,
|
|
9151
|
-
wordsList: () =>
|
|
9151
|
+
wordsList: () => import_views3.wordsList
|
|
9152
9152
|
});
|
|
9153
9153
|
module.exports = __toCommonJS(src_exports);
|
|
9154
9154
|
init_host();
|
|
@@ -9336,7 +9336,7 @@ function buildTableSettingsAgent(tableId, live, client, slots2) {
|
|
|
9336
9336
|
var import_react107 = require("react");
|
|
9337
9337
|
var import_react108 = require("@ai-matrx/records/react");
|
|
9338
9338
|
var import_design_system65 = require("@ai-matrx/design-system");
|
|
9339
|
-
var
|
|
9339
|
+
var import_records39 = require("@ai-matrx/records");
|
|
9340
9340
|
|
|
9341
9341
|
// src/gridMenus.ts
|
|
9342
9342
|
init_names();
|
|
@@ -9345,7 +9345,7 @@ init_names();
|
|
|
9345
9345
|
var REVERSE_COLUMN_PREFIX = "linked:";
|
|
9346
9346
|
|
|
9347
9347
|
// src/gridPage.ts
|
|
9348
|
-
var
|
|
9348
|
+
var import_records = require("@ai-matrx/records");
|
|
9349
9349
|
var import_data_table = require("@ai-matrx/design-system/data-table");
|
|
9350
9350
|
|
|
9351
9351
|
// src/personTime.ts
|
|
@@ -9394,7 +9394,7 @@ function markWithheld(fields, keys) {
|
|
|
9394
9394
|
return fields.map((f) => keys.has(f.key) ? { ...f, withheld: true } : f);
|
|
9395
9395
|
}
|
|
9396
9396
|
function skipWhenWithheld(filter) {
|
|
9397
|
-
if (!filter || !(0,
|
|
9397
|
+
if (!filter || !(0, import_records.isRuleFilter)(filter)) return filter;
|
|
9398
9398
|
return { op: "and", args: [filter], skip_withheld: true };
|
|
9399
9399
|
}
|
|
9400
9400
|
var NUMBER_LOOKS = /* @__PURE__ */ new Set(["number", "decimal", "currency", "percent", "progress", "integer", "duration", "file_size"]);
|
|
@@ -9503,7 +9503,7 @@ function storeQuestion(fields, base2, columnFilters, now = /* @__PURE__ */ new D
|
|
|
9503
9503
|
const refused = [];
|
|
9504
9504
|
const flat = {};
|
|
9505
9505
|
const rules = [];
|
|
9506
|
-
if (base2 && (0,
|
|
9506
|
+
if (base2 && (0, import_records.isRuleFilter)(base2)) rules.push(base2);
|
|
9507
9507
|
else if (base2) Object.assign(flat, base2);
|
|
9508
9508
|
for (const [key, value] of Object.entries(columnFilters)) {
|
|
9509
9509
|
if (!value) continue;
|
|
@@ -9555,8 +9555,8 @@ __reExport(askOnce_exports, require("@ai-matrx/records/versions"));
|
|
|
9555
9555
|
// src/labels.tsx
|
|
9556
9556
|
var import_react12 = require("react");
|
|
9557
9557
|
var import_react13 = require("@ai-matrx/records/react");
|
|
9558
|
+
var import_records2 = require("@ai-matrx/records");
|
|
9558
9559
|
var import_records3 = require("@ai-matrx/records");
|
|
9559
|
-
var import_records4 = require("@ai-matrx/records");
|
|
9560
9560
|
init_names();
|
|
9561
9561
|
var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
9562
9562
|
init_docs();
|
|
@@ -11229,17 +11229,17 @@ function isId(value) {
|
|
|
11229
11229
|
return typeof value === "string" && (0, import_uuid2.isUuidShape)(value);
|
|
11230
11230
|
}
|
|
11231
11231
|
function copiesAsWords(field2) {
|
|
11232
|
-
return pointsAtRecords(field2) || isSignatureField(field2) || (0,
|
|
11232
|
+
return pointsAtRecords(field2) || isSignatureField(field2) || (0, import_records2.autonumberPrefixOf)(field2) !== "" || isDateField(field2);
|
|
11233
11233
|
}
|
|
11234
11234
|
function pointsAtRecords(field2) {
|
|
11235
11235
|
return field2.type === "list" || field2.type === "relation";
|
|
11236
11236
|
}
|
|
11237
11237
|
function shownValue(field2, value, labels) {
|
|
11238
11238
|
if (isSignatureField(field2)) return signatureWords(value);
|
|
11239
|
-
if ((0,
|
|
11239
|
+
if ((0, import_records2.autonumberPrefixOf)(field2)) return (0, import_records2.autonumberWords)(field2, value) ?? value;
|
|
11240
11240
|
const dateWords2 = isDateField(field2) ? dateText(field2, value) : null;
|
|
11241
11241
|
if (dateWords2 !== null) return dateWords2;
|
|
11242
|
-
const newerWords = value === null || value === void 0 ? null : (0,
|
|
11242
|
+
const newerWords = value === null || value === void 0 ? null : (0, import_records3.newerKindExportWords)(field2, value);
|
|
11243
11243
|
if (newerWords !== null) return newerWords;
|
|
11244
11244
|
const look = value === null || value === void 0 ? void 0 : registeredLook(shownAsOf(field2));
|
|
11245
11245
|
if (look) {
|
|
@@ -11309,7 +11309,7 @@ function RecordLabelProvider({ children }) {
|
|
|
11309
11309
|
for (const option of result.data ?? []) {
|
|
11310
11310
|
const words2 = recordName(option.data, null, "Unnamed choice");
|
|
11311
11311
|
next[option.id] = words2;
|
|
11312
|
-
const key = (0,
|
|
11312
|
+
const key = (0, import_records3.optionKey)(option);
|
|
11313
11313
|
if (key) next[choiceKeyName(field2.id, key)] = words2;
|
|
11314
11314
|
}
|
|
11315
11315
|
return next;
|
|
@@ -11853,7 +11853,7 @@ init_parity();
|
|
|
11853
11853
|
|
|
11854
11854
|
// src/FieldRetype.tsx
|
|
11855
11855
|
var import_react20 = require("react");
|
|
11856
|
-
var
|
|
11856
|
+
var import_records5 = require("@ai-matrx/records");
|
|
11857
11857
|
var import_react21 = require("@ai-matrx/records/react");
|
|
11858
11858
|
var import_design_system10 = require("@ai-matrx/design-system");
|
|
11859
11859
|
init_parity();
|
|
@@ -12069,7 +12069,7 @@ function FieldRetype({ field: field2, tableId, onRetyped }) {
|
|
|
12069
12069
|
return;
|
|
12070
12070
|
}
|
|
12071
12071
|
const groups = rows.map((r) => ({ value: r.ids.map((id) => people.get(id)?.name ?? "").join(", "), count: 1 }));
|
|
12072
|
-
setPreview((0,
|
|
12072
|
+
setPreview((0, import_records5.previewRetype)({ type: to.behaviour, kind: to.kind }, groups, false));
|
|
12073
12073
|
}).catch((e) => {
|
|
12074
12074
|
if (cancelled) return;
|
|
12075
12075
|
setAsking(false);
|
|
@@ -12633,7 +12633,7 @@ function nextFieldSort(fields) {
|
|
|
12633
12633
|
// src/FormulaTextEditor.tsx
|
|
12634
12634
|
var import_react22 = require("react");
|
|
12635
12635
|
var import_react23 = require("@ai-matrx/records/react");
|
|
12636
|
-
var
|
|
12636
|
+
var import_records6 = require("@ai-matrx/records");
|
|
12637
12637
|
var import_design_system11 = require("@ai-matrx/design-system");
|
|
12638
12638
|
init_host();
|
|
12639
12639
|
init_Refusal();
|
|
@@ -12657,7 +12657,7 @@ var NOT_TYPED_BY_NAME = /* @__PURE__ */ new Set([
|
|
|
12657
12657
|
function formulaFunctionNames(kinds) {
|
|
12658
12658
|
return [...new Set(kinds.map((row) => row.node))].filter((node) => node.startsWith("fx.") && !NOT_TYPED_BY_NAME.has(node)).map((node) => node.slice(3).toUpperCase()).sort();
|
|
12659
12659
|
}
|
|
12660
|
-
var STORE_FORMULA_FUNCTION_NAMES = formulaFunctionNames(
|
|
12660
|
+
var STORE_FORMULA_FUNCTION_NAMES = formulaFunctionNames(import_records6.RULE_NODE_KINDS);
|
|
12661
12661
|
var RESULT_WORD = {
|
|
12662
12662
|
number: "a number",
|
|
12663
12663
|
text: "text",
|
|
@@ -12816,7 +12816,7 @@ function FormulaTextEditor({
|
|
|
12816
12816
|
|
|
12817
12817
|
// src/gridRowLabel.tsx
|
|
12818
12818
|
var import_react25 = require("react");
|
|
12819
|
-
var
|
|
12819
|
+
var import_records7 = require("@ai-matrx/records");
|
|
12820
12820
|
var import_react26 = require("@ai-matrx/records/react");
|
|
12821
12821
|
var import_design_system13 = require("@ai-matrx/design-system");
|
|
12822
12822
|
init_names();
|
|
@@ -12874,7 +12874,7 @@ function RowLabelPicker({
|
|
|
12874
12874
|
const columns = labelColumns(fields);
|
|
12875
12875
|
const mayChange = kept2?.can_change !== false;
|
|
12876
12876
|
const keptFormula = kept2?.formula ?? null;
|
|
12877
|
-
const formulaTooLong = formula.trim().length >
|
|
12877
|
+
const formulaTooLong = formula.trim().length > import_records7.ROW_LABEL_FORMULA_MAX_LENGTH;
|
|
12878
12878
|
const formulaUnchanged = formula.trim() === (keptFormula ?? "").trim() && kept2?.valid !== false;
|
|
12879
12879
|
const saveColumn = async () => {
|
|
12880
12880
|
setBusy(true);
|
|
@@ -12971,7 +12971,7 @@ function RowLabelPicker({
|
|
|
12971
12971
|
) : null,
|
|
12972
12972
|
formulaTooLong ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "text-[11px] text-foreground", children: [
|
|
12973
12973
|
"Up to ",
|
|
12974
|
-
|
|
12974
|
+
import_records7.ROW_LABEL_FORMULA_MAX_LENGTH,
|
|
12975
12975
|
" characters"
|
|
12976
12976
|
] }) : null
|
|
12977
12977
|
] }),
|
|
@@ -12995,7 +12995,7 @@ function RowLabelPicker({
|
|
|
12995
12995
|
type: "button",
|
|
12996
12996
|
size: "sm",
|
|
12997
12997
|
"data-records-row-label-save-formula": "",
|
|
12998
|
-
disabled: busy || !mayChange || (0,
|
|
12998
|
+
disabled: busy || !mayChange || (0, import_records7.clearsRowLabel)(formula) || formulaTooLong || formulaOk === false || formulaUnchanged,
|
|
12999
12999
|
onClick: () => void saveFormula(),
|
|
13000
13000
|
children: busy ? "Saving\u2026" : "Use this formula"
|
|
13001
13001
|
}
|
|
@@ -13010,7 +13010,7 @@ init_PickOne();
|
|
|
13010
13010
|
|
|
13011
13011
|
// src/RecordTypes.tsx
|
|
13012
13012
|
var import_react105 = require("react");
|
|
13013
|
-
var
|
|
13013
|
+
var import_records38 = require("@ai-matrx/records");
|
|
13014
13014
|
var import_react106 = require("@ai-matrx/records/react");
|
|
13015
13015
|
var import_design_system64 = require("@ai-matrx/design-system");
|
|
13016
13016
|
init_PickOne();
|
|
@@ -13018,7 +13018,7 @@ init_PickOne();
|
|
|
13018
13018
|
// src/RecordForm.tsx
|
|
13019
13019
|
var import_react103 = require("react");
|
|
13020
13020
|
var import_react104 = require("@ai-matrx/records/react");
|
|
13021
|
-
var
|
|
13021
|
+
var import_records37 = require("@ai-matrx/records");
|
|
13022
13022
|
var import_core13 = require("@ai-matrx/records/core");
|
|
13023
13023
|
init_writeOnTheWinningVersion();
|
|
13024
13024
|
var import_design_system63 = require("@ai-matrx/design-system");
|
|
@@ -13030,7 +13030,7 @@ var import_design_system15 = require("@ai-matrx/design-system");
|
|
|
13030
13030
|
|
|
13031
13031
|
// src/ChoiceListEditor.tsx
|
|
13032
13032
|
var import_react27 = require("react");
|
|
13033
|
-
var
|
|
13033
|
+
var import_records8 = require("@ai-matrx/records");
|
|
13034
13034
|
var import_react28 = require("@ai-matrx/records/react");
|
|
13035
13035
|
var import_design_system14 = require("@ai-matrx/design-system");
|
|
13036
13036
|
var import_data_table2 = require("@ai-matrx/design-system/data-table");
|
|
@@ -13041,7 +13041,7 @@ var rowSeed = 0;
|
|
|
13041
13041
|
var nextRow = () => `new-${rowSeed += 1}`;
|
|
13042
13042
|
function choiceRowsFrom(options, field2) {
|
|
13043
13043
|
return inTheStoresOrder([...options]).map((option) => {
|
|
13044
|
-
const words2 = (0,
|
|
13044
|
+
const words2 = (0, import_records8.optionLabel)(option);
|
|
13045
13045
|
const key = option.data?.key;
|
|
13046
13046
|
const color = field2 ? storedChoiceColor(field2, words2) ?? storedChoiceColor(field2, key) : void 0;
|
|
13047
13047
|
return { id: option.id, words: words2, row: option.id, color: color ?? null };
|
|
@@ -13211,11 +13211,11 @@ function ChoiceListEditor({
|
|
|
13211
13211
|
"div",
|
|
13212
13212
|
{
|
|
13213
13213
|
role: "group",
|
|
13214
|
-
"aria-label": (0,
|
|
13214
|
+
"aria-label": (0, import_records8.recordsUseSentence)(heldBy(asking), asking.words.trim()),
|
|
13215
13215
|
"data-records-choice-removal-ask": "",
|
|
13216
13216
|
className: "flex flex-col gap-1 rounded border bg-muted/40 p-2",
|
|
13217
13217
|
children: [
|
|
13218
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs", children: (0,
|
|
13218
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs", children: (0, import_records8.recordsUseSentence)(heldBy(asking), asking.words.trim()) }),
|
|
13219
13219
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
13220
13220
|
targets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
13221
13221
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system14.Button, { type: "button", size: "sm", className: "h-7 px-2 text-xs", disabled: moveTo === "", onClick: () => answer({ then: "move", to: moveTo }), children: "Move them to" }),
|
|
@@ -13234,7 +13234,7 @@ function ChoiceListEditor({
|
|
|
13234
13234
|
) : null,
|
|
13235
13235
|
Object.entries(rehome).map(
|
|
13236
13236
|
([id, spec]) => removed[id] ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between gap-2 text-[11px] text-muted-foreground", "data-records-choice-rehome": "", children: [
|
|
13237
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: (0,
|
|
13237
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: (0, import_records8.rehomeSentence)(usage?.[id]?.records ?? 0, removed[id].row.words.trim(), spec, spec.then === "move" ? wordsOf(spec.to) : void 0) }),
|
|
13238
13238
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system14.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-1.5 text-[11px]", onClick: () => putBack(id), children: "Put it back" })
|
|
13239
13239
|
] }, id) : null
|
|
13240
13240
|
),
|
|
@@ -13331,7 +13331,7 @@ function AddChoicesInline({ field: field2, onAdded, disabled = false }) {
|
|
|
13331
13331
|
|
|
13332
13332
|
// src/editors.tsx
|
|
13333
13333
|
var import_react95 = require("react");
|
|
13334
|
-
var
|
|
13334
|
+
var import_records35 = require("@ai-matrx/records");
|
|
13335
13335
|
var import_react96 = require("@ai-matrx/records/react");
|
|
13336
13336
|
var import_design_system59 = require("@ai-matrx/design-system");
|
|
13337
13337
|
init_dates();
|
|
@@ -13339,22 +13339,22 @@ init_dates();
|
|
|
13339
13339
|
// src/newerKindValues.tsx
|
|
13340
13340
|
var import_react31 = require("react");
|
|
13341
13341
|
var import_source = require("@ai-matrx/content-ir/source");
|
|
13342
|
-
var
|
|
13342
|
+
var import_records9 = require("@ai-matrx/records");
|
|
13343
13343
|
var import_design_system16 = require("@ai-matrx/design-system");
|
|
13344
13344
|
var import_outbound_react = require("@ai-matrx/kit/outbound-react");
|
|
13345
13345
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
13346
13346
|
var own = (event) => event.stopPropagation();
|
|
13347
13347
|
function newerKindValue(field2, value, opts = {}) {
|
|
13348
|
-
switch ((0,
|
|
13348
|
+
switch ((0, import_records9.newerKindOf)(field2)) {
|
|
13349
13349
|
case "duration": {
|
|
13350
|
-
const words2 = (0,
|
|
13350
|
+
const words2 = (0, import_records9.durationText)(value);
|
|
13351
13351
|
return words2 === null ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "tabular-nums", "data-records-duration": "", children: words2 });
|
|
13352
13352
|
}
|
|
13353
13353
|
case "created_by":
|
|
13354
13354
|
case "modified_by":
|
|
13355
|
-
return (0,
|
|
13355
|
+
return (0, import_records9.isPersonStamp)(value) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PersonStampChip, { stamp: value }) : void 0;
|
|
13356
13356
|
case "address":
|
|
13357
|
-
return (0,
|
|
13357
|
+
return (0, import_records9.isAddressValue)(value) || typeof value === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AddressLink, { value }) : void 0;
|
|
13358
13358
|
case "barcode":
|
|
13359
13359
|
return typeof value === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs", "data-records-barcode": "", title: value, children: [
|
|
13360
13360
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u25AE\u25AF\u25AE" }),
|
|
@@ -13369,7 +13369,7 @@ function newerKindValue(field2, value, opts = {}) {
|
|
|
13369
13369
|
}
|
|
13370
13370
|
}
|
|
13371
13371
|
function PersonStampChip({ stamp }) {
|
|
13372
|
-
const words2 = (0,
|
|
13372
|
+
const words2 = (0, import_records9.personStampText)(stamp) ?? import_records9.NOT_A_MEMBER_WORDS;
|
|
13373
13373
|
const tier = stamp.actor ?? "user";
|
|
13374
13374
|
const name = tier === "user" ? stamp.name : null;
|
|
13375
13375
|
const initial = tier === "system" ? "\u2699" : tier === "agent" ? "\u2726" : name && name.trim() !== "" ? name.trim()[0].toUpperCase() : "?";
|
|
@@ -13386,8 +13386,8 @@ function PersonStampChip({ stamp }) {
|
|
|
13386
13386
|
] });
|
|
13387
13387
|
}
|
|
13388
13388
|
function AddressLink({ value }) {
|
|
13389
|
-
const words2 = (0,
|
|
13390
|
-
const href = (0,
|
|
13389
|
+
const words2 = (0, import_records9.addressValueText)(value);
|
|
13390
|
+
const href = (0, import_records9.addressMapUrl)(value);
|
|
13391
13391
|
if (!words2 || !href) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
13392
13392
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
13393
13393
|
import_outbound_react.OutboundLink,
|
|
@@ -13406,11 +13406,11 @@ function AddressLink({ value }) {
|
|
|
13406
13406
|
}
|
|
13407
13407
|
var STATUS_GROUP_MARK = { todo: "\u25CB", in_progress: "\u25D0", done: "\u25CF" };
|
|
13408
13408
|
function statusMarkOf(field2, value, document2) {
|
|
13409
|
-
if ((0,
|
|
13409
|
+
if ((0, import_records9.newerKindOf)(field2) !== "status" || typeof value !== "string") return null;
|
|
13410
13410
|
const chosen = document2?.["_choices"]?.[field2.key];
|
|
13411
13411
|
const key = chosen && typeof chosen === "object" && typeof chosen.key === "string" ? chosen.key : value;
|
|
13412
|
-
const group = (0,
|
|
13413
|
-
return { mark: STATUS_GROUP_MARK[group], group, words:
|
|
13412
|
+
const group = (0, import_records9.statusGroupOf)(field2, key);
|
|
13413
|
+
return { mark: STATUS_GROUP_MARK[group], group, words: import_records9.STATUS_GROUP_WORDS[group] };
|
|
13414
13414
|
}
|
|
13415
13415
|
function inline(text, key) {
|
|
13416
13416
|
const out = [];
|
|
@@ -13438,7 +13438,7 @@ function marks(text, key) {
|
|
|
13438
13438
|
if (tok.startsWith("**") || tok.startsWith("__")) out.push(/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: tok.slice(2, -2) }, k));
|
|
13439
13439
|
else if (tok.startsWith("[")) {
|
|
13440
13440
|
const link = /^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(tok);
|
|
13441
|
-
const href = (0,
|
|
13441
|
+
const href = (0, import_records9.safeLinkHref)(link?.[2] ?? "");
|
|
13442
13442
|
out.push(
|
|
13443
13443
|
href ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_outbound_react.OutboundLink, { href, className: "text-primary underline-offset-2 hover:underline", onClick: own, children: link?.[1] }, k) : link?.[1] ?? tok
|
|
13444
13444
|
);
|
|
@@ -13503,7 +13503,7 @@ function SafeMarkdown({ text, clipped }) {
|
|
|
13503
13503
|
);
|
|
13504
13504
|
}
|
|
13505
13505
|
function newerKindControl(props) {
|
|
13506
|
-
switch ((0,
|
|
13506
|
+
switch ((0, import_records9.newerKindOf)(props.field)) {
|
|
13507
13507
|
case "duration":
|
|
13508
13508
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DurationControl, { ...props });
|
|
13509
13509
|
case "address":
|
|
@@ -13519,10 +13519,10 @@ function newerKindControl(props) {
|
|
|
13519
13519
|
}
|
|
13520
13520
|
}
|
|
13521
13521
|
function DurationControl({ value, onChange, disabled, id }) {
|
|
13522
|
-
const [text, setText] = (0, import_react31.useState)(() => (0,
|
|
13522
|
+
const [text, setText] = (0, import_react31.useState)(() => (0, import_records9.durationText)(value) ?? "");
|
|
13523
13523
|
const [wrong, setWrong] = (0, import_react31.useState)(false);
|
|
13524
13524
|
(0, import_react31.useEffect)(() => {
|
|
13525
|
-
setText((0,
|
|
13525
|
+
setText((0, import_records9.durationText)(value) ?? "");
|
|
13526
13526
|
}, [value]);
|
|
13527
13527
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex flex-col gap-1", children: [
|
|
13528
13528
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
@@ -13542,12 +13542,12 @@ function DurationControl({ value, onChange, disabled, id }) {
|
|
|
13542
13542
|
onChange(null);
|
|
13543
13543
|
return;
|
|
13544
13544
|
}
|
|
13545
|
-
const seconds = (0,
|
|
13545
|
+
const seconds = (0, import_records9.readTypedDuration)(e.target.value);
|
|
13546
13546
|
setWrong(seconds === null);
|
|
13547
13547
|
if (seconds !== null) onChange(seconds);
|
|
13548
13548
|
},
|
|
13549
13549
|
onBlur: () => {
|
|
13550
|
-
if (!wrong) setText((0,
|
|
13550
|
+
if (!wrong) setText((0, import_records9.durationText)(value) ?? "");
|
|
13551
13551
|
}
|
|
13552
13552
|
}
|
|
13553
13553
|
),
|
|
@@ -13569,13 +13569,13 @@ var ADDRESS_EXAMPLES = {
|
|
|
13569
13569
|
country: "US"
|
|
13570
13570
|
};
|
|
13571
13571
|
function AddressControl({ value, onChange, disabled, id }) {
|
|
13572
|
-
const held = (0,
|
|
13572
|
+
const held = (0, import_records9.isAddressValue)(value) ? value : typeof value === "string" && value.trim() !== "" ? { street: value } : {};
|
|
13573
13573
|
const set = (part, words2) => {
|
|
13574
13574
|
const next = { ...held, [part]: words2 };
|
|
13575
13575
|
const kept2 = Object.fromEntries(Object.entries(next).filter(([, v]) => typeof v === "string" && v.trim() !== ""));
|
|
13576
13576
|
onChange(Object.keys(kept2).length === 0 ? null : kept2);
|
|
13577
13577
|
};
|
|
13578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { id, className: "grid grid-cols-2 gap-1.5", "data-records-address-control": "", children:
|
|
13578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { id, className: "grid grid-cols-2 gap-1.5", "data-records-address-control": "", children: import_records9.ADDRESS_PARTS.map((part) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
13579
13579
|
import_design_system16.BasicInput,
|
|
13580
13580
|
{
|
|
13581
13581
|
"aria-label": ADDRESS_LABELS[part],
|
|
@@ -13656,7 +13656,7 @@ init_names();
|
|
|
13656
13656
|
|
|
13657
13657
|
// src/RelationPicker.tsx
|
|
13658
13658
|
var import_react32 = require("react");
|
|
13659
|
-
var
|
|
13659
|
+
var import_records10 = require("@ai-matrx/records");
|
|
13660
13660
|
var import_react33 = require("@ai-matrx/records/react");
|
|
13661
13661
|
var import_design_system17 = require("@ai-matrx/design-system");
|
|
13662
13662
|
init_PickOrAdd();
|
|
@@ -13927,7 +13927,7 @@ function RelationPicker({ field: field2, value, onChange, disabled, id, classNam
|
|
|
13927
13927
|
toggle(createdId);
|
|
13928
13928
|
};
|
|
13929
13929
|
const apart = tellApart(rows ?? [], titleOf);
|
|
13930
|
-
const visible = (0,
|
|
13930
|
+
const visible = (0, import_records10.rankTypedMatches)(rows ?? [], search, (row) => [titleOf(row.id), apart.get(row.id) ?? ""]);
|
|
13931
13931
|
const anchored = autoOpen === true;
|
|
13932
13932
|
const cellChips = picked.map((recordId) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
13933
13933
|
RecordChip,
|
|
@@ -14061,7 +14061,7 @@ function readableLink(raw) {
|
|
|
14061
14061
|
var import_react90 = require("react");
|
|
14062
14062
|
var import_design_system56 = require("@ai-matrx/design-system");
|
|
14063
14063
|
var import_data_table7 = require("@ai-matrx/design-system/data-table");
|
|
14064
|
-
var
|
|
14064
|
+
var import_records33 = require("@ai-matrx/records");
|
|
14065
14065
|
var import_react91 = require("@ai-matrx/records/react");
|
|
14066
14066
|
init_host();
|
|
14067
14067
|
|
|
@@ -14725,7 +14725,7 @@ var import_first_page4 = require("@ai-matrx/records/first-page");
|
|
|
14725
14725
|
|
|
14726
14726
|
// src/viewKeys.ts
|
|
14727
14727
|
var base = __toESM(require("@ai-matrx/records/views"), 1);
|
|
14728
|
-
var
|
|
14728
|
+
var import_views2 = require("@ai-matrx/records/views");
|
|
14729
14729
|
var gridPresentationCodec = {
|
|
14730
14730
|
parse: parseGridPresentation,
|
|
14731
14731
|
isEmpty: presentationIsEmpty,
|
|
@@ -14764,7 +14764,7 @@ init_enumLabels();
|
|
|
14764
14764
|
|
|
14765
14765
|
// src/EntityReferenceControl.tsx
|
|
14766
14766
|
var import_react43 = require("react");
|
|
14767
|
-
var
|
|
14767
|
+
var import_records12 = require("@ai-matrx/records");
|
|
14768
14768
|
var import_react44 = require("@ai-matrx/records/react");
|
|
14769
14769
|
var import_design_system23 = require("@ai-matrx/design-system");
|
|
14770
14770
|
init_PickOrAdd();
|
|
@@ -14774,7 +14774,7 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
14774
14774
|
var WITHHELD_ENTITY_LABEL = "Something you have not been given access to";
|
|
14775
14775
|
var ENTITY_REFERENCE_EMPTY = "Nothing is pointed at yet.";
|
|
14776
14776
|
function entityReferenceText(value) {
|
|
14777
|
-
const refs = (0,
|
|
14777
|
+
const refs = (0, import_records12.entityRefsOf)(value);
|
|
14778
14778
|
if (refs.length === 0) return "\u2014";
|
|
14779
14779
|
return refs.map((r) => r.label ?? WITHHELD_ENTITY_LABEL).join(", ");
|
|
14780
14780
|
}
|
|
@@ -14788,7 +14788,7 @@ function EntityReferenceControl(props) {
|
|
|
14788
14788
|
return client ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WithWords, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Chips, { ...props, words: null, picker: null });
|
|
14789
14789
|
}
|
|
14790
14790
|
function WithWords(props) {
|
|
14791
|
-
const refs = (0, import_react43.useMemo)(() => (0,
|
|
14791
|
+
const refs = (0, import_react43.useMemo)(() => (0, import_records12.entityRefsOf)(props.value), [props.value]);
|
|
14792
14792
|
const [known, setKnown] = (0, import_react43.useState)([]);
|
|
14793
14793
|
const withKnown = refs.map((r) => r.label === null ? known.find((k) => k.token === r.token && k.id === r.id) ?? r : r);
|
|
14794
14794
|
const unlabelled = (0, import_react43.useMemo)(
|
|
@@ -14808,14 +14808,14 @@ function WithWords(props) {
|
|
|
14808
14808
|
initialSearch: props.initialSearch,
|
|
14809
14809
|
onTakeOff: (ref) => {
|
|
14810
14810
|
const rest = withKnown.filter((x) => !(x.token === ref.token && x.id === ref.id));
|
|
14811
|
-
props.onChange((0,
|
|
14811
|
+
props.onChange((0, import_records12.entityRefsToWrite)(rest, Boolean(props.field.multi)));
|
|
14812
14812
|
},
|
|
14813
14813
|
labelOf: (r) => r.label ?? words2?.data?.find((w) => w.token === r.token && w.id === r.id)?.label ?? WITHHELD_ENTITY_LABEL,
|
|
14814
14814
|
onPick: (picked) => {
|
|
14815
14815
|
setKnown((k) => [...k.filter((x) => !(x.token === picked.token && x.id === picked.id)), picked]);
|
|
14816
14816
|
const multi = Boolean(props.field.multi);
|
|
14817
14817
|
const next = multi ? [...withKnown.filter((x) => !(x.token === picked.token && x.id === picked.id)), picked] : [picked];
|
|
14818
|
-
props.onChange((0,
|
|
14818
|
+
props.onChange((0, import_records12.entityRefsToWrite)(next, multi));
|
|
14819
14819
|
}
|
|
14820
14820
|
}
|
|
14821
14821
|
);
|
|
@@ -14926,7 +14926,7 @@ function Chips({
|
|
|
14926
14926
|
words: words2,
|
|
14927
14927
|
picker
|
|
14928
14928
|
}) {
|
|
14929
|
-
const refs = (0, import_react43.useMemo)(() => (0,
|
|
14929
|
+
const refs = (0, import_react43.useMemo)(() => (0, import_records12.entityRefsOf)(value), [value]);
|
|
14930
14930
|
const labelOf = (token2, refId, own3) => {
|
|
14931
14931
|
if (own3) return own3;
|
|
14932
14932
|
const read = words2?.data?.find((w) => w.token === token2 && w.id === refId)?.label;
|
|
@@ -14950,7 +14950,7 @@ function Chips({
|
|
|
14950
14950
|
"aria-label": `Take ${label} off`,
|
|
14951
14951
|
onClick: () => {
|
|
14952
14952
|
const rest = refs.filter((x) => !(x.token === r.token && x.id === r.id));
|
|
14953
|
-
onChange((0,
|
|
14953
|
+
onChange((0, import_records12.entityRefsToWrite)(rest, multi));
|
|
14954
14954
|
},
|
|
14955
14955
|
children: "\xD7"
|
|
14956
14956
|
}
|
|
@@ -15633,7 +15633,7 @@ function AttachmentControl({
|
|
|
15633
15633
|
}
|
|
15634
15634
|
|
|
15635
15635
|
// src/ReferenceChips.tsx
|
|
15636
|
-
var
|
|
15636
|
+
var import_records13 = require("@ai-matrx/records");
|
|
15637
15637
|
var import_design_system29 = require("@ai-matrx/design-system");
|
|
15638
15638
|
init_host();
|
|
15639
15639
|
init_kindValues();
|
|
@@ -15654,7 +15654,7 @@ function iconOf(pair) {
|
|
|
15654
15654
|
}
|
|
15655
15655
|
function referenceChipsOf(field2, value, kind2, labels) {
|
|
15656
15656
|
if (kind2 === "entity_reference") {
|
|
15657
|
-
return (0,
|
|
15657
|
+
return (0, import_records13.entityRefsOf)(value).map((r) => ({ token: r.token, id: r.id, label: r.label }));
|
|
15658
15658
|
}
|
|
15659
15659
|
const ids = (Array.isArray(value) ? value : [value]).filter(isId).map(String);
|
|
15660
15660
|
const tableId = typeof field2.relation_target === "string" ? field2.relation_target : void 0;
|
|
@@ -15842,7 +15842,7 @@ function ClampedChips({
|
|
|
15842
15842
|
init_kindValues();
|
|
15843
15843
|
|
|
15844
15844
|
// src/formulaNames.ts
|
|
15845
|
-
var
|
|
15845
|
+
var import_records14 = require("@ai-matrx/records");
|
|
15846
15846
|
init_names();
|
|
15847
15847
|
function fieldRefsOf(expr) {
|
|
15848
15848
|
const out = [];
|
|
@@ -15951,7 +15951,7 @@ function formulaSourceArchived(field2, document2) {
|
|
|
15951
15951
|
const keys = (field2.config ?? {})[FORMULA_INPUT_KEYS];
|
|
15952
15952
|
if (!Array.isArray(keys) || !document2) return null;
|
|
15953
15953
|
for (const key of keys) {
|
|
15954
|
-
const state2 = (0,
|
|
15954
|
+
const state2 = (0, import_records14.sourceArchivedOf)(document2[String(key)]);
|
|
15955
15955
|
if (state2) return state2;
|
|
15956
15956
|
}
|
|
15957
15957
|
return null;
|
|
@@ -15972,7 +15972,7 @@ function withFormulaDisplayNow(field2, fields, kindOf, currencyCodeOf) {
|
|
|
15972
15972
|
}
|
|
15973
15973
|
|
|
15974
15974
|
// src/values.tsx
|
|
15975
|
-
var
|
|
15975
|
+
var import_records25 = require("@ai-matrx/records");
|
|
15976
15976
|
var import_uuid7 = require("@ai-matrx/kit/uuid");
|
|
15977
15977
|
init_userIds();
|
|
15978
15978
|
|
|
@@ -16032,7 +16032,7 @@ function usePeopleTick() {
|
|
|
16032
16032
|
}
|
|
16033
16033
|
|
|
16034
16034
|
// src/cellMarks.tsx
|
|
16035
|
-
var
|
|
16035
|
+
var import_records15 = require("@ai-matrx/records");
|
|
16036
16036
|
|
|
16037
16037
|
// src/RetiredValues.tsx
|
|
16038
16038
|
var import_react53 = require("react");
|
|
@@ -16163,7 +16163,7 @@ function bound(value) {
|
|
|
16163
16163
|
function keptAsideReason(field2, entry) {
|
|
16164
16164
|
const rules = field2.rules ?? [];
|
|
16165
16165
|
const numeric = typeof entry.value === "string" && /^-?\d+(\.\d+)?$/.test(entry.value.trim()) ? Number(entry.value) : entry.value;
|
|
16166
|
-
const rule = (0,
|
|
16166
|
+
const rule = (0, import_records15.ruleThatRefuses)(rules, numeric);
|
|
16167
16167
|
let why = null;
|
|
16168
16168
|
if (rule?.kind === "min") why = `Must be at least ${bound(rule.value)}`;
|
|
16169
16169
|
else if (rule?.kind === "max") why = `Must be at most ${bound(rule.value)}`;
|
|
@@ -16637,7 +16637,7 @@ function structuredNode(field2, structured, room) {
|
|
|
16637
16637
|
return room === "cell" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StructuredCell, { structured, label }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StructuredValueView, { structured, label });
|
|
16638
16638
|
}
|
|
16639
16639
|
function renderValue(field2, value, document2, labels, stillWaitingFor, look, room = "cell") {
|
|
16640
|
-
const archivedSource = (0,
|
|
16640
|
+
const archivedSource = (0, import_records25.sourceArchivedOf)(value);
|
|
16641
16641
|
if (archivedSource) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SourceArchivedValue, { state: archivedSource });
|
|
16642
16642
|
const envelope = envelopeFor(document2, field2.key);
|
|
16643
16643
|
if (envelope?.absent) {
|
|
@@ -16660,7 +16660,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look, ro
|
|
|
16660
16660
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
16661
16661
|
}
|
|
16662
16662
|
if (isSignatureField(field2)) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SignatureValue, { value, fieldKey: field2.key, document: document2 });
|
|
16663
|
-
if ((0,
|
|
16663
|
+
if ((0, import_records25.isButtonField)(field2)) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ButtonValue, { field: field2 });
|
|
16664
16664
|
const newer = newerKindValue(field2, value);
|
|
16665
16665
|
if (newer !== void 0) return newer;
|
|
16666
16666
|
const whole = typeof value === "string" ? (0, import_core10.wholeValueOf)(document2, field2.key) : null;
|
|
@@ -16798,10 +16798,10 @@ function personWordsOf(kind2, value) {
|
|
|
16798
16798
|
}
|
|
16799
16799
|
function scalarText(field2, value, labels, stillWaitingFor) {
|
|
16800
16800
|
if (value === null || value === void 0) return "\u2014";
|
|
16801
|
-
if ((0,
|
|
16801
|
+
if ((0, import_records25.sourceArchivedOf)(value)) return SOURCE_ARCHIVED_WORDS;
|
|
16802
16802
|
if (isSignatureField(field2)) return signatureWords(value) ?? "\u2014";
|
|
16803
|
-
if ((0,
|
|
16804
|
-
const newerWords = (0,
|
|
16803
|
+
if ((0, import_records25.autonumberPrefixOf)(field2)) return (0, import_records25.autonumberWords)(field2, value) ?? String(value);
|
|
16804
|
+
const newerWords = (0, import_records25.newerKindWords)(field2, value);
|
|
16805
16805
|
if (newerWords !== null) return newerWords;
|
|
16806
16806
|
const kind2 = editorKindFor(field2);
|
|
16807
16807
|
if (kind2 === "entity_reference") return entityReferenceText(value);
|
|
@@ -16862,7 +16862,7 @@ function RecordValue({
|
|
|
16862
16862
|
const labels = useRecordLabels(ONE_FIELD_ARRAY_CACHE(field2));
|
|
16863
16863
|
const stillWaitingFor = useLabelWait(field2);
|
|
16864
16864
|
const embeddedLook = useEmbeddedLook();
|
|
16865
|
-
if ((0,
|
|
16865
|
+
if ((0, import_records25.isButtonField)(field2)) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ButtonValue, { field: field2, recordId, inCell });
|
|
16866
16866
|
if (withheld && (value === null || value === void 0)) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WithheldValue, { field: field2, notice: withheld });
|
|
16867
16867
|
if (value === null || value === void 0) {
|
|
16868
16868
|
const failed = workedOutErrorFor(document2, field2.key);
|
|
@@ -16872,7 +16872,7 @@ function RecordValue({
|
|
|
16872
16872
|
const kept2 = keptAsideFor(document2, field2.key);
|
|
16873
16873
|
if (kept2) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(KeptAsideValue, { field: field2, entry: kept2, shown: scalarText(field2, kept2.value) });
|
|
16874
16874
|
}
|
|
16875
|
-
const archivedSource = (0,
|
|
16875
|
+
const archivedSource = (0, import_records25.sourceArchivedOf)(value);
|
|
16876
16876
|
if (archivedSource) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SourceArchivedValue, { state: archivedSource });
|
|
16877
16877
|
if (formulaHasNothingToWorkOn(field2, document2)) return embeddedLook?.blankEmpty ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
16878
16878
|
if (value !== null && value !== void 0 && value !== "" && !envelopeFor(document2, field2.key)?.absent) {
|
|
@@ -16989,7 +16989,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
16989
16989
|
// src/Condition.tsx
|
|
16990
16990
|
var import_react78 = require("react");
|
|
16991
16991
|
var import_design_system47 = require("@ai-matrx/design-system");
|
|
16992
|
-
var
|
|
16992
|
+
var import_records26 = require("@ai-matrx/records");
|
|
16993
16993
|
init_PickOrAdd();
|
|
16994
16994
|
init_choiceLooks();
|
|
16995
16995
|
var import_react79 = require("@ai-matrx/records/react");
|
|
@@ -17105,7 +17105,7 @@ function ChoiceValues({ field: field2, value, onChange }) {
|
|
|
17105
17105
|
let cancelled = false;
|
|
17106
17106
|
void (0, askOnce_exports.fieldOptionsOnce)(client, field2.id).then((got) => {
|
|
17107
17107
|
if (cancelled) return;
|
|
17108
|
-
setChoices(got.ok ? (got.data ?? []).map((o) => ({ key: (0,
|
|
17108
|
+
setChoices(got.ok ? (got.data ?? []).map((o) => ({ key: (0, import_records26.optionKey)(o), label: (0, import_records26.optionLabel)(o) ?? "" })).filter((c) => c.label !== "") : []);
|
|
17109
17109
|
});
|
|
17110
17110
|
return () => {
|
|
17111
17111
|
cancelled = true;
|
|
@@ -17161,7 +17161,7 @@ function ChoiceValue({ field: field2, value, onChange }) {
|
|
|
17161
17161
|
void (0, askOnce_exports.fieldOptionsOnce)(client, field2.id).then((got) => {
|
|
17162
17162
|
if (cancelled) return;
|
|
17163
17163
|
setChoices(
|
|
17164
|
-
got.ok ? (got.data ?? []).map((o) => ({ key: (0,
|
|
17164
|
+
got.ok ? (got.data ?? []).map((o) => ({ key: (0, import_records26.optionKey)(o), label: (0, import_records26.optionLabel)(o) ?? "" })).filter((c) => c.label !== "") : []
|
|
17165
17165
|
);
|
|
17166
17166
|
});
|
|
17167
17167
|
return () => {
|
|
@@ -17179,7 +17179,7 @@ function ChoiceValue({ field: field2, value, onChange }) {
|
|
|
17179
17179
|
}
|
|
17180
17180
|
);
|
|
17181
17181
|
}
|
|
17182
|
-
const shown5 = (0,
|
|
17182
|
+
const shown5 = (0, import_records26.rankTypedMatches)(choices, search.trim(), (c) => c.label);
|
|
17183
17183
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "inline-flex min-w-0", "data-records-condition-choice": "", "data-pick-value": value, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
17184
17184
|
PickOrAdd,
|
|
17185
17185
|
{
|
|
@@ -17691,7 +17691,7 @@ function ConditionGroup({
|
|
|
17691
17691
|
|
|
17692
17692
|
// src/FieldRulePreview.tsx
|
|
17693
17693
|
var import_react80 = require("react");
|
|
17694
|
-
var
|
|
17694
|
+
var import_records27 = require("@ai-matrx/records");
|
|
17695
17695
|
var import_react81 = require("@ai-matrx/records/react");
|
|
17696
17696
|
init_Refusal();
|
|
17697
17697
|
init_names();
|
|
@@ -17741,7 +17741,7 @@ function FieldRulePreview({ field: field2, tableId, rules }) {
|
|
|
17741
17741
|
}
|
|
17742
17742
|
const numbers = holdsNumbers3(field2);
|
|
17743
17743
|
const groups = answer.data.map((row) => ({ value: groupValue(row.groups[field2.key] ?? null, numbers), count: row.row_count }));
|
|
17744
|
-
setPreview((0,
|
|
17744
|
+
setPreview((0, import_records27.previewRuleChange)(latest.current, groups, answer.data.length >= PREVIEW_GROUPS));
|
|
17745
17745
|
}).catch((thrown) => {
|
|
17746
17746
|
if (cancelled) return;
|
|
17747
17747
|
setRefusal((0, refusals_exports.refusalFromThrown)(thrown, `${name}'s values could not be counted.`, "The check still applies when you save."));
|
|
@@ -17926,7 +17926,7 @@ function PickListLink({
|
|
|
17926
17926
|
}
|
|
17927
17927
|
|
|
17928
17928
|
// src/NewerKindQuestions.tsx
|
|
17929
|
-
var
|
|
17929
|
+
var import_records28 = require("@ai-matrx/records");
|
|
17930
17930
|
var import_design_system49 = require("@ai-matrx/design-system");
|
|
17931
17931
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
17932
17932
|
var STATUS_STARTING_CHOICES = [
|
|
@@ -17947,7 +17947,7 @@ function statusGroupRows(field2, rows, keyOfId, changed2) {
|
|
|
17947
17947
|
if (words2 === "") continue;
|
|
17948
17948
|
const ref = r.id ?? words2;
|
|
17949
17949
|
const key = r.id ? keyOfId[r.id] : void 0;
|
|
17950
|
-
const held = field2 && key ? (0,
|
|
17950
|
+
const held = field2 && key ? (0, import_records28.statusGroupOf)(field2, key) : void 0;
|
|
17951
17951
|
out.push({ ref, words: words2, group: changed2[ref] ?? held ?? guessStatusGroup(words2) });
|
|
17952
17952
|
}
|
|
17953
17953
|
return out;
|
|
@@ -17963,10 +17963,10 @@ function StatusGroupsQuestion({
|
|
|
17963
17963
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: r.words }),
|
|
17964
17964
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_design_system49.Select, { value: r.group, onValueChange: (next) => onGroup(r.ref, next), children: [
|
|
17965
17965
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectTrigger, { size: "sm", className: "w-36", "aria-label": `Group for ${r.words}`, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectValue, {}) }),
|
|
17966
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectContent, { children:
|
|
17966
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectContent, { children: import_records28.STATUS_GROUPS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_design_system49.SelectItem, { value: g, children: [
|
|
17967
17967
|
STATUS_GROUP_MARK[g],
|
|
17968
17968
|
" ",
|
|
17969
|
-
|
|
17969
|
+
import_records28.STATUS_GROUP_WORDS[g]
|
|
17970
17970
|
] }, g)) })
|
|
17971
17971
|
] })
|
|
17972
17972
|
] }, r.ref))
|
|
@@ -18004,7 +18004,7 @@ function BarcodeSymbologyQuestion({ value, onChange }) {
|
|
|
18004
18004
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectTrigger, { size: "sm", "aria-label": "Code type", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectValue, {}) }),
|
|
18005
18005
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_design_system49.SelectContent, { children: [
|
|
18006
18006
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectItem, { value: "any", children: "Any code" }),
|
|
18007
|
-
|
|
18007
|
+
import_records28.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system49.SelectItem, { value: s, children: SYMBOLOGY_WORDS[s] }, s))
|
|
18008
18008
|
] })
|
|
18009
18009
|
] })
|
|
18010
18010
|
] });
|
|
@@ -18376,21 +18376,21 @@ function readersSentence(count, tableName2) {
|
|
|
18376
18376
|
|
|
18377
18377
|
// src/FieldEditor.tsx
|
|
18378
18378
|
init_enumLabels();
|
|
18379
|
-
var
|
|
18379
|
+
var import_records31 = require("@ai-matrx/records");
|
|
18380
18380
|
|
|
18381
18381
|
// src/ButtonSettings.tsx
|
|
18382
18382
|
var import_react86 = require("react");
|
|
18383
18383
|
var import_design_system54 = require("@ai-matrx/design-system");
|
|
18384
18384
|
var import_data_table6 = require("@ai-matrx/design-system/data-table");
|
|
18385
|
-
var
|
|
18385
|
+
var import_records30 = require("@ai-matrx/records");
|
|
18386
18386
|
var import_react87 = require("@ai-matrx/records/react");
|
|
18387
18387
|
|
|
18388
18388
|
// src/AccentSwatches.tsx
|
|
18389
|
-
var
|
|
18389
|
+
var import_records29 = require("@ai-matrx/records");
|
|
18390
18390
|
var import_design_system52 = require("@ai-matrx/design-system");
|
|
18391
18391
|
var import_data_table5 = require("@ai-matrx/design-system/data-table");
|
|
18392
18392
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
18393
|
-
function AccentSwatches({ value, onChange, options =
|
|
18393
|
+
function AccentSwatches({ value, onChange, options = import_records29.PORTAL_ACCENTS, noneLabel = "App color" }) {
|
|
18394
18394
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", "aria-label": "Color", children: [
|
|
18395
18395
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
18396
18396
|
"button",
|
|
@@ -18514,7 +18514,7 @@ var DOES_WORDS = {
|
|
|
18514
18514
|
};
|
|
18515
18515
|
function buttonUrlInWords(url, fields) {
|
|
18516
18516
|
let out = url;
|
|
18517
|
-
for (const id of (0,
|
|
18517
|
+
for (const id of (0, import_records30.buttonUrlPlaceholders)(url)) {
|
|
18518
18518
|
const f = fields.find((x) => x.id === id || x.key === id);
|
|
18519
18519
|
if (f) out = out.split(`{{${id}}}`).join(`{${fieldName(f)}}`);
|
|
18520
18520
|
}
|
|
@@ -18609,7 +18609,7 @@ function ButtonSettingsEditor({
|
|
|
18609
18609
|
}
|
|
18610
18610
|
) : null
|
|
18611
18611
|
] }),
|
|
18612
|
-
value.url && (0,
|
|
18612
|
+
value.url && (0, import_records30.buttonUrlPlaceholders)(value.url).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "truncate text-[11px] text-muted-foreground", "data-records-button-url-words": "", children: buttonUrlInWords(value.url, fields) }) : null
|
|
18613
18613
|
] }) : null,
|
|
18614
18614
|
value.do === "add_row" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(AddRowSettings, { value, onChange, tableId, fields }) : null,
|
|
18615
18615
|
value.do === "run_action" ? !tableId ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-xs text-muted-foreground", children: "Row actions belong to a table" }) : actionsRefused ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(RefusalLine, { error: actionsRefused }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col gap-2", "data-records-button-action": "", children: [
|
|
@@ -18716,7 +18716,7 @@ function NewRowAction({
|
|
|
18716
18716
|
}
|
|
18717
18717
|
|
|
18718
18718
|
// src/FieldEditor.tsx
|
|
18719
|
-
var
|
|
18719
|
+
var import_records32 = require("@ai-matrx/records");
|
|
18720
18720
|
|
|
18721
18721
|
// src/standardFieldChoices.ts
|
|
18722
18722
|
var import_field_kinds7 = require("@ai-matrx/records/field-kinds");
|
|
@@ -18738,8 +18738,8 @@ var ADDABLE_TYPES = STANDARD_TABLE_FIELD_CHOICES.map((choice) => ({
|
|
|
18738
18738
|
// src/FieldEditor.tsx
|
|
18739
18739
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
18740
18740
|
var RULE_KINDS = FIELD_RULE_KIND_VALUES.map((kind2) => ({ kind: kind2, label: FIELD_RULE_KIND_LABEL[kind2] }));
|
|
18741
|
-
var SENSITIVITIES =
|
|
18742
|
-
var AGENT_VISIBILITY =
|
|
18741
|
+
var SENSITIVITIES = import_records32.FIELD_SENSITIVITIES.map((value) => ({ value, label: FIELD_SENSITIVITY_LABEL[value] }));
|
|
18742
|
+
var AGENT_VISIBILITY = import_records32.CONTEXT_POLICIES.map((value) => ({ value, label: CONTEXT_POLICY_LABEL[value] }));
|
|
18743
18743
|
var ROLLUP_OPERATIONS = ROLLUP_AGG_VALUES.map((value) => ({
|
|
18744
18744
|
value,
|
|
18745
18745
|
label: ROLLUP_AGG_LABEL[value]
|
|
@@ -18827,7 +18827,7 @@ function FieldEditor(props) {
|
|
|
18827
18827
|
const onEntity = entityToken !== null;
|
|
18828
18828
|
const tableId = props.tableId ?? "";
|
|
18829
18829
|
const table = (0, import_react89.useTable)(onEntity ? null : tableId);
|
|
18830
|
-
const tableFields = (0, import_react89.useFields)(onEntity ? null : tableId,
|
|
18830
|
+
const tableFields = (0, import_react89.useFields)(onEntity ? null : tableId, import_records32.EVERY_RECORD_TYPE);
|
|
18831
18831
|
const entityFields = (0, import_react89.useEntityFields)(entityToken);
|
|
18832
18832
|
const fields = onEntity ? entityFields : tableFields;
|
|
18833
18833
|
const tableRights2 = useTableRights(onEntity ? null : table.data);
|
|
@@ -18848,27 +18848,27 @@ function FieldEditor(props) {
|
|
|
18848
18848
|
const [label, setLabel] = (0, import_react88.useState)(field2?.label ?? (copyOf ? `${copyOf.label} (1)` : startAs?.label ?? ""));
|
|
18849
18849
|
const [type, setType] = (0, import_react88.useState)(() => startAs ? startAs.type : startingType(start));
|
|
18850
18850
|
const [required, setRequired] = (0, import_react88.useState)(start?.required ?? false);
|
|
18851
|
-
const [appliesTo, setAppliesTo] = (0, import_react88.useState)(() => (0,
|
|
18851
|
+
const [appliesTo, setAppliesTo] = (0, import_react88.useState)(() => (0, import_records32.typesOfField)(start ?? { applies_to_types: [] }));
|
|
18852
18852
|
const [multi, setMulti] = (0, import_react88.useState)(start?.multi ?? false);
|
|
18853
18853
|
const [dated, setDated] = (0, import_react88.useState)(start?.dated ?? false);
|
|
18854
18854
|
const [sensitivity, setSensitivity] = (0, import_react88.useState)(String(start?.sensitivity ?? "internal"));
|
|
18855
18855
|
const [contextPolicy, setContextPolicy] = (0, import_react88.useState)(String(start?.context_policy ?? "include"));
|
|
18856
18856
|
const [rules, setRules] = (0, import_react88.useState)(start?.rules ?? []);
|
|
18857
18857
|
const [startsWith, setStartsWith] = (0, import_react88.useState)(start?.default ?? null);
|
|
18858
|
-
const [ratingMax, setRatingMax] = (0, import_react88.useState)(() => start ? (0,
|
|
18858
|
+
const [ratingMax, setRatingMax] = (0, import_react88.useState)(() => start ? (0, import_records32.ratingMaxOf)(start) : 5);
|
|
18859
18859
|
const savedRules = (0, import_react88.useMemo)(
|
|
18860
|
-
() => field2 ? type === "rating" ? (0,
|
|
18860
|
+
() => field2 ? type === "rating" ? (0, import_records32.rulesWithTopStar)(field2.rules ?? [], (0, import_records32.ratingMaxOf)(field2)) : field2.rules ?? [] : [],
|
|
18861
18861
|
[field2, type]
|
|
18862
18862
|
);
|
|
18863
|
-
const editedRules = (0, import_react88.useMemo)(() => type === "rating" ? (0,
|
|
18863
|
+
const editedRules = (0, import_react88.useMemo)(() => type === "rating" ? (0, import_records32.rulesWithTopStar)(rules, ratingMax) : rules, [type, rules, ratingMax]);
|
|
18864
18864
|
const [statusGroups, setStatusGroups] = (0, import_react88.useState)({});
|
|
18865
18865
|
const [statusKeys, setStatusKeys] = (0, import_react88.useState)({});
|
|
18866
18866
|
const [symbology, setSymbology] = (0, import_react88.useState)(String(start?.config?.["symbology"] ?? ""));
|
|
18867
18867
|
const descriptionStart = String(start?.config?.["description"] ?? "");
|
|
18868
18868
|
const [description, setDescription] = (0, import_react88.useState)(descriptionStart);
|
|
18869
|
-
const buttonStart = (0, import_react88.useMemo)(() => (0,
|
|
18869
|
+
const buttonStart = (0, import_react88.useMemo)(() => (0, import_records31.buttonOf)(start) ?? { label: "" }, [start]);
|
|
18870
18870
|
const [buttonSettings, setButtonSettings] = (0, import_react88.useState)(buttonStart);
|
|
18871
|
-
const prefixStart = (0,
|
|
18871
|
+
const prefixStart = (0, import_records31.autonumberPrefixOf)(start);
|
|
18872
18872
|
const [numberPrefix, setNumberPrefix] = (0, import_react88.useState)(prefixStart);
|
|
18873
18873
|
const dependencyStart = start?.config?.["dependency"] === true;
|
|
18874
18874
|
const watchStart = (0, import_react88.useMemo)(() => watchedFieldsOf(start), [start]);
|
|
@@ -18927,7 +18927,7 @@ function FieldEditor(props) {
|
|
|
18927
18927
|
if (!field2 || type !== "status") return;
|
|
18928
18928
|
let live = true;
|
|
18929
18929
|
void client.fieldOptions({ field_id: field2.id }).then((got) => {
|
|
18930
|
-
if (live && got.ok) setStatusKeys(Object.fromEntries((got.data ?? []).map((o) => [String(o.id), (0,
|
|
18930
|
+
if (live && got.ok) setStatusKeys(Object.fromEntries((got.data ?? []).map((o) => [String(o.id), (0, import_records32.optionKey)(o)])));
|
|
18931
18931
|
});
|
|
18932
18932
|
return () => {
|
|
18933
18933
|
live = false;
|
|
@@ -19039,7 +19039,7 @@ function FieldEditor(props) {
|
|
|
19039
19039
|
const typeKey = onEntity ? null : table.data?.type_field ?? null;
|
|
19040
19040
|
const typeField = typeKey ? (fields.data ?? []).find((f) => f.key === typeKey) ?? null : null;
|
|
19041
19041
|
const offersAppliesTo = Boolean(typeField) && !isTitle && field2?.key !== typeKey;
|
|
19042
|
-
const appliesToChanged = JSON.stringify(appliesTo) !== JSON.stringify((0,
|
|
19042
|
+
const appliesToChanged = JSON.stringify(appliesTo) !== JSON.stringify((0, import_records32.typesOfField)(field2 ?? { applies_to_types: [] }));
|
|
19043
19043
|
const offersMany = multiApplies(type) && !isTitle;
|
|
19044
19044
|
if (!mayShape) {
|
|
19045
19045
|
if (onEntity && entityRights.loading) return null;
|
|
@@ -19055,7 +19055,7 @@ function FieldEditor(props) {
|
|
|
19055
19055
|
const nameTaken = columnNameTakenBy(label, others.map(fieldName));
|
|
19056
19056
|
const nameLine = nameTaken ? columnNameTakenLine(nameTaken, noun) : columnNameProblemLine(label, noun);
|
|
19057
19057
|
const listsChoices = type === "select" || type === "multi_select" || type === "status";
|
|
19058
|
-
const buttonMissing = type === "button" && buttonSettings.do ? (0,
|
|
19058
|
+
const buttonMissing = type === "button" && buttonSettings.do ? (0, import_records31.buttonNeeds)(buttonSettings) : null;
|
|
19059
19059
|
const missing = buttonMissing ?? (editing ? formulaMissing ?? (listsChoices ? whatTheChoiceListIsMissing(choiceList) : null) : formulaMissing ?? (listsChoices ? whatTheChoiceListIsMissing(newChoices) : null) ?? (type === "formula" && formulaWritten ? null : whatIsMissing(
|
|
19060
19060
|
type === "count" ? { type: "rollup", label, options, via, pick, agg: "count", of, relations: totalSources, formulaFields, relationTarget, allowedTypes, noun } : { type, label, options, via, pick, agg, of, relations: sourcesFor(type), formulaFields, relationTarget, allowedTypes, noun }
|
|
19061
19061
|
)));
|
|
@@ -19098,7 +19098,7 @@ function FieldEditor(props) {
|
|
|
19098
19098
|
...statusGroupsChanged ? { status_groups: statusGroupsSent } : {},
|
|
19099
19099
|
// V11 #4/#10: a rating's top star goes as `max`, the word custom.field_update now takes the way
|
|
19100
19100
|
// custom.field_declare does; the store writes the max Rule and sets aside any score above it.
|
|
19101
|
-
...type === "rating" && ratingMax !== (0,
|
|
19101
|
+
...type === "rating" && ratingMax !== (0, import_records32.ratingMaxOf)(field2) ? { max: ratingMax } : {},
|
|
19102
19102
|
...type === "barcode" && symbology !== String(field2.config?.["symbology"] ?? "") ? { symbology: symbology === "" ? null : symbology } : {},
|
|
19103
19103
|
...type === "button" && JSON.stringify(buttonSettings) !== JSON.stringify(buttonStart) ? { button: buttonSettings } : {},
|
|
19104
19104
|
...field2.type === "relation" && dependency !== dependencyStart ? { dependency } : {},
|
|
@@ -20274,7 +20274,7 @@ function waitingRunsOf(pressed) {
|
|
|
20274
20274
|
var stop2 = (event) => event.stopPropagation();
|
|
20275
20275
|
function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
20276
20276
|
const client = (0, import_react91.useOptionalRecordsClient)();
|
|
20277
|
-
const b = (0,
|
|
20277
|
+
const b = (0, import_records33.buttonOf)(field2);
|
|
20278
20278
|
const [busy, setBusy] = (0, import_react90.useState)(false);
|
|
20279
20279
|
const [said2, setSaid] = (0, import_react90.useState)(null);
|
|
20280
20280
|
const [settingUp, setSettingUp] = (0, import_react90.useState)(false);
|
|
@@ -20292,7 +20292,7 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
20292
20292
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { id: `${field2.key}-before-save`, className: "whitespace-nowrap text-xs text-muted-foreground", children: "Save the record first" })
|
|
20293
20293
|
] });
|
|
20294
20294
|
}
|
|
20295
|
-
const needs = (0,
|
|
20295
|
+
const needs = (0, import_records33.buttonNeeds)(b);
|
|
20296
20296
|
const tableId = field2.entity_definition_id;
|
|
20297
20297
|
const press = async () => {
|
|
20298
20298
|
if (!client || !recordId) return setSaid({ kind: "public" });
|
|
@@ -20640,7 +20640,7 @@ function formatControl(args) {
|
|
|
20640
20640
|
// src/typedDateHelper.tsx
|
|
20641
20641
|
var import_react94 = require("react");
|
|
20642
20642
|
var import_design_system58 = require("@ai-matrx/design-system");
|
|
20643
|
-
var
|
|
20643
|
+
var import_records34 = require("@ai-matrx/records");
|
|
20644
20644
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
20645
20645
|
var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
20646
20646
|
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
@@ -20649,24 +20649,24 @@ function pad2(n) {
|
|
|
20649
20649
|
}
|
|
20650
20650
|
function readBox(text, kind2) {
|
|
20651
20651
|
if (kind2 === "time") {
|
|
20652
|
-
const t = (0,
|
|
20652
|
+
const t = (0, import_records34.readTypedTime)(text);
|
|
20653
20653
|
if (!t.ok) return { day: null, time: null };
|
|
20654
20654
|
const [h, m] = t.value.split(":").map(Number);
|
|
20655
20655
|
return { day: null, time: { h, m } };
|
|
20656
20656
|
}
|
|
20657
|
-
const read = (0,
|
|
20657
|
+
const read = (0, import_records34.readTypedDate)(text, { withTime: kind2 === "datetime" });
|
|
20658
20658
|
if (!read.ok) return { day: null, time: null };
|
|
20659
20659
|
if (kind2 === "datetime" && read.instant) {
|
|
20660
|
-
const wall = (0,
|
|
20660
|
+
const wall = (0, import_records34.wallPartsInZone)(new Date(read.instant));
|
|
20661
20661
|
return { day: read.day, time: { h: wall.hour, m: wall.minute } };
|
|
20662
20662
|
}
|
|
20663
20663
|
return { day: read.day, time: null };
|
|
20664
20664
|
}
|
|
20665
20665
|
function wordsFor2(kind2, day2, time) {
|
|
20666
|
-
if (kind2 === "time") return time ? (0,
|
|
20666
|
+
if (kind2 === "time") return time ? (0, import_records34.typedTimeText)(time.h, time.m) : "";
|
|
20667
20667
|
if (!day2) return "";
|
|
20668
|
-
const dayText = (0,
|
|
20669
|
-
return kind2 === "datetime" && time ? `${dayText} ${(0,
|
|
20668
|
+
const dayText = (0, import_records34.typedDateText)(day2);
|
|
20669
|
+
return kind2 === "datetime" && time ? `${dayText} ${(0, import_records34.typedTimeText)(time.h, time.m)}` : dayText;
|
|
20670
20670
|
}
|
|
20671
20671
|
var keepFocus = { onMouseDown: (e) => e.preventDefault(), tabIndex: -1 };
|
|
20672
20672
|
function CalendarGlyph() {
|
|
@@ -20788,7 +20788,7 @@ function TypedDateHelper({
|
|
|
20788
20788
|
held.time && held.time.h === t.h && held.time.m === t.m ? "bg-primary text-primary-foreground" : ""
|
|
20789
20789
|
),
|
|
20790
20790
|
onClick: () => pickTime(t),
|
|
20791
|
-
children: (0,
|
|
20791
|
+
children: (0, import_records34.typedTimeText)(t.h, t.m)
|
|
20792
20792
|
},
|
|
20793
20793
|
`${t.h}:${t.m}`
|
|
20794
20794
|
)) })
|
|
@@ -20845,7 +20845,7 @@ function FieldLabel({ field: field2, htmlFor, children }) {
|
|
|
20845
20845
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
|
|
20846
20846
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.Label, { htmlFor, className: "text-xs font-medium", children: fieldName(field2) }),
|
|
20847
20847
|
field2.required ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-xs text-destructive", children: "required" }) : null,
|
|
20848
|
-
field2.unit && (0,
|
|
20848
|
+
field2.unit && (0, import_records35.newerKindOf)(field2) !== "duration" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-xs text-muted-foreground", children: field2.unit }) : null,
|
|
20849
20849
|
children
|
|
20850
20850
|
] });
|
|
20851
20851
|
}
|
|
@@ -20855,7 +20855,7 @@ function isTypedDraft(value) {
|
|
|
20855
20855
|
var TYPED_AS_WORDS = /* @__PURE__ */ new Set(["text", "long_text", "phone"]);
|
|
20856
20856
|
var TYPED_AND_READ = /* @__PURE__ */ new Set(["number", "currency", "percent", "datetime", "select", "multi_select", "email", "url"]);
|
|
20857
20857
|
function typingOpens(field2) {
|
|
20858
|
-
if ((0,
|
|
20858
|
+
if ((0, import_records35.isButtonField)(field2)) return "none";
|
|
20859
20859
|
const kind2 = String(editorKindFor(field2));
|
|
20860
20860
|
if (kind2 === "formula" || kind2 === "lookup" || kind2 === "rollup") return "none";
|
|
20861
20861
|
if (kind2 === "select" || kind2 === "multi_select" || kind2 === "member") return "search";
|
|
@@ -20881,21 +20881,21 @@ function judgeTyped(field2, text, choices, nudge) {
|
|
|
20881
20881
|
const format = formatForField(field2);
|
|
20882
20882
|
if (trimmed === "") return { value: null };
|
|
20883
20883
|
if (format && format.id === "time") {
|
|
20884
|
-
const read2 = (0,
|
|
20884
|
+
const read2 = (0, import_records35.readTypedTime)(trimmed);
|
|
20885
20885
|
return read2.ok ? { value: read2.value } : { refusal: SHORT_REFUSAL.time, why: `${fieldName(field2)} holds a time of day, and ${read2.why}` };
|
|
20886
20886
|
}
|
|
20887
20887
|
if (kind2 === "select" || kind2 === "multi_select") {
|
|
20888
20888
|
if (!choices || nudge === null) return null;
|
|
20889
20889
|
const several = field2.multi || kind2 === "multi_select";
|
|
20890
20890
|
const words2 = several ? trimmed.split(/\s*[,;\n]\s*/).filter(Boolean) : [trimmed];
|
|
20891
|
-
const allowOther = (0,
|
|
20891
|
+
const allowOther = (0, import_records35.allowsOtherValues)(field2);
|
|
20892
20892
|
const parts = [];
|
|
20893
20893
|
const add = [];
|
|
20894
20894
|
const ask2 = [];
|
|
20895
20895
|
const notChoices = [];
|
|
20896
20896
|
let keepOffered = allowOther;
|
|
20897
20897
|
for (const word of words2) {
|
|
20898
|
-
const decided = (0,
|
|
20898
|
+
const decided = (0, import_records35.decideTypedChoice)({ words: word, options: choices, allowOther, nudge });
|
|
20899
20899
|
if (decided.decision === "empty") continue;
|
|
20900
20900
|
if (decided.decision === "chosen") parts.push(decided.key);
|
|
20901
20901
|
else {
|
|
@@ -20928,7 +20928,7 @@ function judgeTyped(field2, text, choices, nudge) {
|
|
|
20928
20928
|
return usual && digits.length >= 7 && digits.length <= 20 ? { value: trimmed } : { refusal: SHORT_REFUSAL.phone };
|
|
20929
20929
|
}
|
|
20930
20930
|
const showsAsPercent = Boolean(format && (format.id === "percent" || format.id === "progress"));
|
|
20931
|
-
const read = (0,
|
|
20931
|
+
const read = (0, import_records35.coerceTypedAnswer)(field2, text, { label: fieldName(field2), showsAsPercent });
|
|
20932
20932
|
if ("refusal" in read) {
|
|
20933
20933
|
if (kind2 === "email" || kind2 === "url") return { refusal: SHORT_REFUSAL[kind2] };
|
|
20934
20934
|
const short = kind2 === "datetime" ? SHORT_REFUSAL.date : kind2 === "number" || kind2 === "currency" || kind2 === "percent" || showsAsPercent ? SHORT_REFUSAL.number : read.refusal.length <= 32 ? read.refusal : SHORT_REFUSAL.value;
|
|
@@ -20949,12 +20949,12 @@ function openingText(field2, value) {
|
|
|
20949
20949
|
if (value === null || value === void 0 || value === "") return "";
|
|
20950
20950
|
const helper = dateHelperKind(field2, value);
|
|
20951
20951
|
if (helper === "time") {
|
|
20952
|
-
const read = (0,
|
|
20952
|
+
const read = (0, import_records35.readTypedTime)(String(value));
|
|
20953
20953
|
if (!read.ok) return String(value);
|
|
20954
20954
|
const [h, m] = read.value.split(":").map(Number);
|
|
20955
|
-
return (0,
|
|
20955
|
+
return (0, import_records35.typedTimeText)(h, m);
|
|
20956
20956
|
}
|
|
20957
|
-
if (helper) return (0,
|
|
20957
|
+
if (helper) return (0, import_records35.typedDateText)(value, { withTime: helper === "datetime" });
|
|
20958
20958
|
const format = formatForField(field2);
|
|
20959
20959
|
return format ? typedText(format, value) : String(value);
|
|
20960
20960
|
}
|
|
@@ -21058,7 +21058,7 @@ function TypedTextControl({ field: field2, value, onChange, disabled, id, onComm
|
|
|
21058
21058
|
" ",
|
|
21059
21059
|
needsChoices ? String(
|
|
21060
21060
|
(Array.isArray(withoutAddition(judged.value).value) ? withoutAddition(judged.value).value : [withoutAddition(judged.value).value]).map((k) => {
|
|
21061
|
-
const option = choices?.find((o) => (0,
|
|
21061
|
+
const option = choices?.find((o) => (0, import_records35.optionKey)(o) === k);
|
|
21062
21062
|
return option ? recordName(option.data, null, String(k)) : String(k);
|
|
21063
21063
|
}).join(", ")
|
|
21064
21064
|
) : (() => {
|
|
@@ -21079,7 +21079,7 @@ function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
21079
21079
|
const ownDetails = (0, import_react96.useOptionalRecordsClient)() === null;
|
|
21080
21080
|
if (isTypedDraft(value)) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TypedTextControl, { field: field2, value, onChange, disabled, id: inputId, onCommit, onCancel });
|
|
21081
21081
|
if (isSignatureField(field2)) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SignaturePad, { id: inputId, value, onChange, disabled });
|
|
21082
|
-
if ((0,
|
|
21082
|
+
if ((0, import_records35.isButtonField)(field2)) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ButtonValue, { field: field2, recordId: recordId ?? null, beforeSave: !recordId });
|
|
21083
21083
|
const newerControl = newerKindControl({ field: field2, value, onChange, disabled, id: inputId });
|
|
21084
21084
|
if (newerControl !== void 0) return newerControl;
|
|
21085
21085
|
const format = formatForField(field2);
|
|
@@ -21249,7 +21249,7 @@ function TypedWordsControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
21249
21249
|
function typedDatePlaceholder(helper) {
|
|
21250
21250
|
const time = "h:mm AM";
|
|
21251
21251
|
if (helper === "time") return time;
|
|
21252
|
-
const pattern = (0,
|
|
21252
|
+
const pattern = (0, import_records35.typedDateText)("2026-11-22").replace("2026", "YYYY").replace("11", "MM").replace("22", "DD");
|
|
21253
21253
|
return helper === "datetime" ? `${pattern} ${time}` : pattern;
|
|
21254
21254
|
}
|
|
21255
21255
|
function CheckboxControl({ field: field2, value, onChange, disabled, id }) {
|
|
@@ -21419,15 +21419,15 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
21419
21419
|
ChoiceAnswer,
|
|
21420
21420
|
{
|
|
21421
21421
|
field: field2,
|
|
21422
|
-
choices: options.map((option) => ({ key: (0,
|
|
21422
|
+
choices: options.map((option) => ({ key: (0, import_records35.optionKey)(option), label: titled(option) })),
|
|
21423
21423
|
value,
|
|
21424
21424
|
onChange,
|
|
21425
21425
|
disabled,
|
|
21426
21426
|
id,
|
|
21427
21427
|
onChosen,
|
|
21428
21428
|
isChosen: (choice, v) => {
|
|
21429
|
-
const option = options.find((o) => (0,
|
|
21430
|
-
return option ? (0,
|
|
21429
|
+
const option = options.find((o) => (0, import_records35.optionKey)(o) === choice.key);
|
|
21430
|
+
return option ? (0, import_records35.isTheChosen)(option, v) : false;
|
|
21431
21431
|
}
|
|
21432
21432
|
}
|
|
21433
21433
|
);
|
|
@@ -21460,7 +21460,7 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
21460
21460
|
onCancel,
|
|
21461
21461
|
initialSearch,
|
|
21462
21462
|
addsChoices,
|
|
21463
|
-
allowOther: (0,
|
|
21463
|
+
allowOther: (0, import_records35.allowsOtherValues)(field2),
|
|
21464
21464
|
onChoicesChanged: () => {
|
|
21465
21465
|
if (client) (0, askOnce_exports.forgetAsked)(client, `field_options:${field2.id}`);
|
|
21466
21466
|
setReread((n) => n + 1);
|
|
@@ -21474,19 +21474,19 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
21474
21474
|
}
|
|
21475
21475
|
const titleOf = (option) => recordName(option.data, null, "Unnamed choice");
|
|
21476
21476
|
if (field2.multi) {
|
|
21477
|
-
const chosen = options.filter((option) => (0,
|
|
21478
|
-
const picked = new Set(chosen.map((option) => (0,
|
|
21477
|
+
const chosen = options.filter((option) => (0, import_records35.choiceValuesOf)(value).some((v) => (0, import_records35.isTheChosen)(option, v)));
|
|
21478
|
+
const picked = new Set(chosen.map((option) => (0, import_records35.optionKey)(option)));
|
|
21479
21479
|
const toggles = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { id: autoOpen ? void 0 : id, className: "flex flex-wrap gap-1", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
21480
21480
|
import_design_system59.Button,
|
|
21481
21481
|
{
|
|
21482
21482
|
type: "button",
|
|
21483
21483
|
size: "sm",
|
|
21484
|
-
variant: picked.has((0,
|
|
21484
|
+
variant: picked.has((0, import_records35.optionKey)(option)) ? "default" : "outline",
|
|
21485
21485
|
disabled,
|
|
21486
21486
|
onClick: () => {
|
|
21487
21487
|
const next = new Set(picked);
|
|
21488
|
-
if (next.has((0,
|
|
21489
|
-
else next.add((0,
|
|
21488
|
+
if (next.has((0, import_records35.optionKey)(option))) next.delete((0, import_records35.optionKey)(option));
|
|
21489
|
+
else next.add((0, import_records35.optionKey)(option));
|
|
21490
21490
|
onChange(next.size === 0 ? null : [...next]);
|
|
21491
21491
|
},
|
|
21492
21492
|
children: titleOf(option)
|
|
@@ -21508,11 +21508,11 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
21508
21508
|
}
|
|
21509
21509
|
);
|
|
21510
21510
|
}
|
|
21511
|
-
const current = options.find((option) => (0,
|
|
21511
|
+
const current = options.find((option) => (0, import_records35.isTheChosen)(option, value));
|
|
21512
21512
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
21513
21513
|
import_design_system59.Select,
|
|
21514
21514
|
{
|
|
21515
|
-
value: current ? (0,
|
|
21515
|
+
value: current ? (0, import_records35.optionKey)(current) : "",
|
|
21516
21516
|
disabled: disabled ?? false,
|
|
21517
21517
|
onValueChange: (next) => onChange(next === "" ? null : next),
|
|
21518
21518
|
...autoOpen ? {
|
|
@@ -21524,7 +21524,7 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
21524
21524
|
} : {},
|
|
21525
21525
|
children: [
|
|
21526
21526
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.SelectTrigger, { id, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.SelectValue, { placeholder: "Choose" }) }),
|
|
21527
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.SelectItem, { value: (0,
|
|
21527
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.SelectItem, { value: (0, import_records35.optionKey)(option), children: titleOf(option) }, option.id)) })
|
|
21528
21528
|
]
|
|
21529
21529
|
}
|
|
21530
21530
|
);
|
|
@@ -21558,23 +21558,23 @@ function OpenChoicePicker({
|
|
|
21558
21558
|
const [addRefused, setAddRefused] = (0, import_react95.useState)(null);
|
|
21559
21559
|
const titleOf = (option) => recordName(option.data, null, "Unnamed choice");
|
|
21560
21560
|
const held = withoutAddition(value);
|
|
21561
|
-
const current = (0,
|
|
21561
|
+
const current = (0, import_records35.choiceValuesOf)(held.value);
|
|
21562
21562
|
const pickedWords = current.map((v) => {
|
|
21563
|
-
const option = options.find((o) => (0,
|
|
21563
|
+
const option = options.find((o) => (0, import_records35.isTheChosen)(o, v));
|
|
21564
21564
|
return option ? titleOf(option) : String(v);
|
|
21565
21565
|
});
|
|
21566
|
-
const chipOf = (option, word) => option ? choiceChipLookOf(field2, (0,
|
|
21566
|
+
const chipOf = (option, word) => option ? choiceChipLookOf(field2, (0, import_records35.optionKey)(option), titleOf(option)) : choiceChipLookOf(field2, word);
|
|
21567
21567
|
const q = search.trim();
|
|
21568
|
-
const visible = (0,
|
|
21569
|
-
const decided = (0,
|
|
21568
|
+
const visible = (0, import_records35.rankTypedMatches)(options, q, titleOf);
|
|
21569
|
+
const decided = (0, import_records35.decideTypedChoice)({ words: q, options, allowOther, nudge: nudge ?? "ask" });
|
|
21570
21570
|
const choose = (word, addingIt = false) => {
|
|
21571
21571
|
const pending = held.add.filter((w) => w.toLowerCase() !== word.toLowerCase());
|
|
21572
21572
|
let next;
|
|
21573
21573
|
let add2 = [...pending];
|
|
21574
21574
|
if (field2.multi) {
|
|
21575
21575
|
const existing = current.map((v) => {
|
|
21576
|
-
const option = options.find((o) => (0,
|
|
21577
|
-
return option ? (0,
|
|
21576
|
+
const option = options.find((o) => (0, import_records35.isTheChosen)(o, v));
|
|
21577
|
+
return option ? (0, import_records35.optionKey)(option) : String(v);
|
|
21578
21578
|
});
|
|
21579
21579
|
const has = existing.some((v) => v.toLowerCase() === word.toLowerCase());
|
|
21580
21580
|
const list = has ? existing.filter((v) => v.toLowerCase() !== word.toLowerCase()) : [...existing, word];
|
|
@@ -21610,7 +21610,7 @@ function OpenChoicePicker({
|
|
|
21610
21610
|
const foot = null;
|
|
21611
21611
|
const add = offList && (decided.decision === "ask" || decided.decision === "add") ? { label: `Create \u201C${q}\u201D`, onAdd: addTyped, disabled: adding } : offList && decided.decision === "keep_as_typed" ? { label: `Use \u201C${q}\u201D`, onAdd: () => choose(q) } : null;
|
|
21612
21612
|
const listed = visible;
|
|
21613
|
-
const pickedOptions = current.map((v) => options.find((o) => (0,
|
|
21613
|
+
const pickedOptions = current.map((v) => options.find((o) => (0, import_records35.isTheChosen)(o, v)));
|
|
21614
21614
|
const cellChips = pickedWords.map((word, i) => {
|
|
21615
21615
|
const chip = chipOf(pickedOptions[i], word);
|
|
21616
21616
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system59.Badge, { variant: "outline", className: (0, import_design_system59.cn)("text-[11px]", chip.className), "data-records-choice-chip": "", children: word }, word);
|
|
@@ -21622,7 +21622,7 @@ function OpenChoicePicker({
|
|
|
21622
21622
|
label: word,
|
|
21623
21623
|
chip: chipOf(option, word).className,
|
|
21624
21624
|
onRemove: () => {
|
|
21625
|
-
if (field2.multi) choose(option ? (0,
|
|
21625
|
+
if (field2.multi) choose(option ? (0, import_records35.optionKey)(option) : String(current[i]));
|
|
21626
21626
|
else onChange(null);
|
|
21627
21627
|
}
|
|
21628
21628
|
};
|
|
@@ -21653,11 +21653,11 @@ function OpenChoicePicker({
|
|
|
21653
21653
|
id: option.id,
|
|
21654
21654
|
label: titleOf(option),
|
|
21655
21655
|
chip: chipOf(option, titleOf(option)).className,
|
|
21656
|
-
picked: current.some((v) => (0,
|
|
21656
|
+
picked: current.some((v) => (0, import_records35.isTheChosen)(option, v))
|
|
21657
21657
|
})),
|
|
21658
21658
|
onPick: (optionId) => {
|
|
21659
21659
|
const option = options.find((o) => o.id === optionId);
|
|
21660
|
-
if (option) choose((0,
|
|
21660
|
+
if (option) choose((0, import_records35.optionKey)(option));
|
|
21661
21661
|
},
|
|
21662
21662
|
empty: q === "" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "p-2 text-xs text-muted-foreground", children: "No choices yet \u2014 type one to add it." }) : null,
|
|
21663
21663
|
add,
|
|
@@ -21713,7 +21713,7 @@ function ChoiceAnswer({
|
|
|
21713
21713
|
onChosen
|
|
21714
21714
|
}) {
|
|
21715
21715
|
const [search, setSearch] = (0, import_react95.useState)("");
|
|
21716
|
-
const held = field2.multi ? (0,
|
|
21716
|
+
const held = field2.multi ? (0, import_records35.choiceValuesOf)(value) : value === null || value === void 0 || value === "" ? [] : [value];
|
|
21717
21717
|
const on = (choice) => held.some((v) => isChosen ? isChosen(choice, v) : String(v) === choice.key || String(v) === choice.label);
|
|
21718
21718
|
const press = (choice) => {
|
|
21719
21719
|
if (!field2.multi) {
|
|
@@ -21834,7 +21834,7 @@ init_Refusal();
|
|
|
21834
21834
|
|
|
21835
21835
|
// src/gridColors.tsx
|
|
21836
21836
|
var import_react97 = require("react");
|
|
21837
|
-
var
|
|
21837
|
+
var import_records36 = require("@ai-matrx/records");
|
|
21838
21838
|
var import_react98 = require("@ai-matrx/records/react");
|
|
21839
21839
|
var import_design_system60 = require("@ai-matrx/design-system");
|
|
21840
21840
|
var import_data_table8 = require("@ai-matrx/design-system/data-table");
|
|
@@ -21916,7 +21916,7 @@ function useChoiceOptions(fields, keys) {
|
|
|
21916
21916
|
function lookOf(option) {
|
|
21917
21917
|
const raw = option.data?.["color"];
|
|
21918
21918
|
const color = typeof raw === "string" && import_data_table8.STYLE_COLORS.includes(raw) ? raw : void 0;
|
|
21919
|
-
return { id: String(option.id), key: (0,
|
|
21919
|
+
return { id: String(option.id), key: (0, import_records36.optionKey)(option), label: (0, import_records36.optionLabel)(option), ...color ? { color } : {} };
|
|
21920
21920
|
}
|
|
21921
21921
|
function paintByOption(style, _fields, index, lookup) {
|
|
21922
21922
|
if (index.size === 0) return { style, documentOf: (doc) => doc, choiceColorFor: lookup };
|
|
@@ -22974,7 +22974,7 @@ function CustomRecordForm({
|
|
|
22974
22974
|
const host = useRecordsUi();
|
|
22975
22975
|
const [draft, setDraft] = (0, import_react103.useState)(() => recordId ? {} : { ...initial ?? {} });
|
|
22976
22976
|
const table = (0, import_react104.useTable)(tableId);
|
|
22977
|
-
const typeInDraft = (0,
|
|
22977
|
+
const typeInDraft = (0, import_records37.recordTypeOf)(table.data, draft);
|
|
22978
22978
|
const typeNow = typeInDraft ?? recordType;
|
|
22979
22979
|
const fields = (0, import_react104.useFields)(tableId, typeNow);
|
|
22980
22980
|
const existing = (0, import_react104.useRecord)(recordId ?? null);
|
|
@@ -23293,9 +23293,9 @@ function useTypeFieldKey() {
|
|
|
23293
23293
|
}
|
|
23294
23294
|
function NotApplicableGate({ field: field2, document: document2, children }) {
|
|
23295
23295
|
const typeKey = useTypeFieldKey();
|
|
23296
|
-
if ((0,
|
|
23297
|
-
const recordType = (0,
|
|
23298
|
-
if ((0,
|
|
23296
|
+
if ((0, import_records38.typesOfField)(field2).length === 0) return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_jsx_runtime73.Fragment, { children });
|
|
23297
|
+
const recordType = (0, import_records38.recordTypeOf)({ type_field: typeKey }, document2);
|
|
23298
|
+
if ((0, import_records38.fieldAppliesToType)(field2, recordType)) return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_jsx_runtime73.Fragment, { children });
|
|
23299
23299
|
const why = notApplicableSentence(field2, recordType);
|
|
23300
23300
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "block w-full truncate text-muted-foreground", title: why, "aria-label": why, "data-records-cell-not-applicable": field2.key, children: "\u2014" });
|
|
23301
23301
|
}
|
|
@@ -23310,7 +23310,7 @@ function useTypeChoices(typeField) {
|
|
|
23310
23310
|
}
|
|
23311
23311
|
let live = true;
|
|
23312
23312
|
void client.fieldOptions({ field_id: id }).then((got) => {
|
|
23313
|
-
if (live && got.ok) setChoices((got.data ?? []).map((o) => ({ key: (0,
|
|
23313
|
+
if (live && got.ok) setChoices((got.data ?? []).map((o) => ({ key: (0, import_records38.optionKey)(o), label: (0, import_records38.optionLabel)(o) })));
|
|
23314
23314
|
});
|
|
23315
23315
|
return () => {
|
|
23316
23316
|
live = false;
|
|
@@ -23319,7 +23319,7 @@ function useTypeChoices(typeField) {
|
|
|
23319
23319
|
return choices;
|
|
23320
23320
|
}
|
|
23321
23321
|
function typeFieldCandidates(fields) {
|
|
23322
|
-
return fields.filter((f) => editorKindFor(f) === "select" && !f.multi && (0,
|
|
23322
|
+
return fields.filter((f) => editorKindFor(f) === "select" && !f.multi && (0, import_records38.typesOfField)(f).length === 0);
|
|
23323
23323
|
}
|
|
23324
23324
|
function RecordTypeSetting({
|
|
23325
23325
|
table,
|
|
@@ -23357,7 +23357,7 @@ function AppliesToTypes({
|
|
|
23357
23357
|
}) {
|
|
23358
23358
|
const choices = useTypeChoices(typeField);
|
|
23359
23359
|
if (!typeField || choices.length === 0) return null;
|
|
23360
|
-
const has = (key, label) => value.some((v) => (0,
|
|
23360
|
+
const has = (key, label) => value.some((v) => (0, import_records38.fieldAppliesToType)({ applies_to_types: [v] }, key) || (0, import_records38.fieldAppliesToType)({ applies_to_types: [v] }, label));
|
|
23361
23361
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-applies-to": "", children: [
|
|
23362
23362
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-muted-foreground", children: "Applies to" }),
|
|
23363
23363
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-1", children: choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
@@ -23368,7 +23368,7 @@ function AppliesToTypes({
|
|
|
23368
23368
|
"aria-label": `Applies to ${choice.label}`,
|
|
23369
23369
|
"data-records-field-applies-to-type": choice.key,
|
|
23370
23370
|
onCheckedChange: (on) => {
|
|
23371
|
-
const rest = value.filter((v) => !((0,
|
|
23371
|
+
const rest = value.filter((v) => !((0, import_records38.fieldAppliesToType)({ applies_to_types: [v] }, choice.key) || (0, import_records38.fieldAppliesToType)({ applies_to_types: [v] }, choice.label)));
|
|
23372
23372
|
onValue(on === true ? [...rest, choice.key] : rest);
|
|
23373
23373
|
}
|
|
23374
23374
|
}
|
|
@@ -23516,7 +23516,7 @@ function RowLabelSetting({
|
|
|
23516
23516
|
}, [client, tableId, table.title_field]);
|
|
23517
23517
|
const mayChange = kept2?.can_change !== false;
|
|
23518
23518
|
const keptFormula = kept2?.formula ?? null;
|
|
23519
|
-
const tooLong = formula.trim().length >
|
|
23519
|
+
const tooLong = formula.trim().length > import_records39.ROW_LABEL_FORMULA_MAX_LENGTH;
|
|
23520
23520
|
const unchanged = formula.trim() === (keptFormula ?? "").trim() && kept2?.valid !== false;
|
|
23521
23521
|
const saveFormula = async () => {
|
|
23522
23522
|
setSaving(true);
|
|
@@ -23568,7 +23568,7 @@ function RowLabelSetting({
|
|
|
23568
23568
|
] }) : null,
|
|
23569
23569
|
tooLong ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("p", { className: "text-[11px] text-foreground", children: [
|
|
23570
23570
|
"Up to ",
|
|
23571
|
-
|
|
23571
|
+
import_records39.ROW_LABEL_FORMULA_MAX_LENGTH,
|
|
23572
23572
|
" characters"
|
|
23573
23573
|
] }) : null,
|
|
23574
23574
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
@@ -23577,7 +23577,7 @@ function RowLabelSetting({
|
|
|
23577
23577
|
type: "button",
|
|
23578
23578
|
size: "sm",
|
|
23579
23579
|
"data-table-row-label-save-formula": "",
|
|
23580
|
-
disabled: saving || busy || !mayChange || (0,
|
|
23580
|
+
disabled: saving || busy || !mayChange || (0, import_records39.clearsRowLabel)(formula) || tooLong || formulaOk === false || unchanged,
|
|
23581
23581
|
onClick: () => void saveFormula(),
|
|
23582
23582
|
children: saving ? "Saving\u2026" : "Use this formula"
|
|
23583
23583
|
}
|
|
@@ -23714,7 +23714,7 @@ init_PersonPicker();
|
|
|
23714
23714
|
|
|
23715
23715
|
// src/gridEditing.tsx
|
|
23716
23716
|
var import_react112 = require("react");
|
|
23717
|
-
var
|
|
23717
|
+
var import_records40 = require("@ai-matrx/records");
|
|
23718
23718
|
var import_core14 = require("@ai-matrx/records/core");
|
|
23719
23719
|
var import_react113 = require("@ai-matrx/records/react");
|
|
23720
23720
|
var import_design_system66 = require("@ai-matrx/design-system");
|
|
@@ -23993,7 +23993,7 @@ function isTypedCharacter(event) {
|
|
|
23993
23993
|
return !event.metaKey && !event.ctrlKey && !event.altKey && event.key.length === 1 && event.key !== " ";
|
|
23994
23994
|
}
|
|
23995
23995
|
function fieldIsEditable(field2) {
|
|
23996
|
-
if ((0,
|
|
23996
|
+
if ((0, import_records40.isButtonField)(field2)) return false;
|
|
23997
23997
|
const kind2 = editorKindFor(field2);
|
|
23998
23998
|
return kind2 !== "formula" && kind2 !== "lookup" && kind2 !== "rollup";
|
|
23999
23999
|
}
|
|
@@ -25548,8 +25548,8 @@ function useWholeTableCount(args) {
|
|
|
25548
25548
|
// src/Grid.tsx
|
|
25549
25549
|
var import_react197 = require("react");
|
|
25550
25550
|
var import_react198 = require("@ai-matrx/records/react");
|
|
25551
|
+
var import_records51 = require("@ai-matrx/records");
|
|
25551
25552
|
var import_records52 = require("@ai-matrx/records");
|
|
25552
|
-
var import_records53 = require("@ai-matrx/records");
|
|
25553
25553
|
var import_data_table14 = require("@ai-matrx/design-system/data-table");
|
|
25554
25554
|
var import_core21 = require("@ai-matrx/records/core");
|
|
25555
25555
|
|
|
@@ -25592,7 +25592,7 @@ function useTableDecorations(tableId, revision) {
|
|
|
25592
25592
|
}
|
|
25593
25593
|
|
|
25594
25594
|
// src/emptyState.tsx
|
|
25595
|
-
var
|
|
25595
|
+
var import_records41 = require("@ai-matrx/records");
|
|
25596
25596
|
var import_design_system67 = require("@ai-matrx/design-system");
|
|
25597
25597
|
var import_format6 = require("@ai-matrx/kit/format");
|
|
25598
25598
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
@@ -25602,7 +25602,7 @@ function lockedRowsWords(count) {
|
|
|
25602
25602
|
function questionIsAsked(args) {
|
|
25603
25603
|
if ((args.search ?? "").trim() !== "") return true;
|
|
25604
25604
|
if (Object.values(args.columnFilters ?? {}).some((value) => value !== void 0 && value !== null)) return true;
|
|
25605
|
-
if (args.filter && (0,
|
|
25605
|
+
if (args.filter && (0, import_records41.stableFilterKey)(args.filter) !== "{}") return true;
|
|
25606
25606
|
return Boolean(args.ruled);
|
|
25607
25607
|
}
|
|
25608
25608
|
function emptyCauseOf(args) {
|
|
@@ -25741,7 +25741,7 @@ function costInPoints(cents, rate) {
|
|
|
25741
25741
|
// src/Enrich.tsx
|
|
25742
25742
|
var import_react121 = require("react");
|
|
25743
25743
|
var import_react122 = require("@ai-matrx/records/react");
|
|
25744
|
-
var
|
|
25744
|
+
var import_records42 = require("@ai-matrx/records");
|
|
25745
25745
|
var import_design_system68 = require("@ai-matrx/design-system");
|
|
25746
25746
|
var import_format8 = require("@ai-matrx/kit/format");
|
|
25747
25747
|
var import_core15 = require("@ai-matrx/records/core");
|
|
@@ -26077,16 +26077,16 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
26077
26077
|
const setup = draft[fieldId] ?? { instruction: "", every: "30" };
|
|
26078
26078
|
const kindOf = target ? editorKindFor(target) : null;
|
|
26079
26079
|
const attachmentColumns = (fields.data ?? []).filter((f) => f.id !== fieldId && editorKindFor(f) === "attachment");
|
|
26080
|
-
const offered = (0,
|
|
26080
|
+
const offered = (0, import_records42.presetsFor)({
|
|
26081
26081
|
targetIsChoice: kindOf === "select" || kindOf === "multi_select",
|
|
26082
26082
|
hasAttachmentColumn: attachmentColumns.length > 0
|
|
26083
26083
|
});
|
|
26084
|
-
const chosen = setup.preset ? (0,
|
|
26085
|
-
const readsPictures = (0,
|
|
26086
|
-
const readsRecord = readsPictures ?? (0,
|
|
26084
|
+
const chosen = setup.preset ? (0, import_records42.aiFieldPreset)(setup.preset) : void 0;
|
|
26085
|
+
const readsPictures = (0, import_records42.presetInputs)(setup.preset, attachmentColumns.map((f) => f.key));
|
|
26086
|
+
const readsRecord = readsPictures ?? (0, import_records42.defaultEnrichInputs)(fields.data ?? [], target?.key ?? "", limits?.enrichmentSensitivityCeiling);
|
|
26087
26087
|
const applyPreset = (preset, answer) => {
|
|
26088
26088
|
const reads = preset === "describe_image" ? attachmentColumns.map((f) => f.name ?? f.label) : void 0;
|
|
26089
|
-
const sentence2 = (0,
|
|
26089
|
+
const sentence2 = (0, import_records42.presetInstruction)(preset, { answer, reads });
|
|
26090
26090
|
setDraft((prev) => ({
|
|
26091
26091
|
...prev,
|
|
26092
26092
|
[fieldId]: { ...setup, preset, ...answer !== void 0 ? { answer } : {}, instruction: sentence2 ?? "" }
|
|
@@ -28381,7 +28381,7 @@ init_names();
|
|
|
28381
28381
|
// src/gridActions.tsx
|
|
28382
28382
|
var import_react147 = require("react");
|
|
28383
28383
|
var import_react148 = require("@ai-matrx/records/react");
|
|
28384
|
-
var
|
|
28384
|
+
var import_records43 = require("@ai-matrx/records");
|
|
28385
28385
|
var import_design_system79 = require("@ai-matrx/design-system");
|
|
28386
28386
|
init_Refusal();
|
|
28387
28387
|
init_names();
|
|
@@ -28466,7 +28466,7 @@ function useActionRunner(args) {
|
|
|
28466
28466
|
const answered = await client.actionRun({ action_id: action3.id, record_ids: ids });
|
|
28467
28467
|
setBusy(null);
|
|
28468
28468
|
if (!answered.ok) {
|
|
28469
|
-
const refusals = (0,
|
|
28469
|
+
const refusals = (0, import_records43.actionRefusals)(answered.error);
|
|
28470
28470
|
setOutcome({
|
|
28471
28471
|
kind: "refused",
|
|
28472
28472
|
action: action3,
|
|
@@ -29262,7 +29262,7 @@ init_writeOnTheWinningVersion();
|
|
|
29262
29262
|
// src/gridSummaries.tsx
|
|
29263
29263
|
var import_react151 = require("react");
|
|
29264
29264
|
var import_react152 = require("@ai-matrx/records/react");
|
|
29265
|
-
var
|
|
29265
|
+
var import_records44 = require("@ai-matrx/records");
|
|
29266
29266
|
var import_design_system82 = require("@ai-matrx/design-system");
|
|
29267
29267
|
init_parity();
|
|
29268
29268
|
init_names();
|
|
@@ -29313,8 +29313,8 @@ function useColumnSummaries(args) {
|
|
|
29313
29313
|
const why = {};
|
|
29314
29314
|
for (const [key, op2] of entries) {
|
|
29315
29315
|
const measure = op2 === "count" ? { op: "count" } : { op: op2, key };
|
|
29316
|
-
out[key] = row?.measures?.[(0,
|
|
29317
|
-
const notice2 = row?.withheld?.[(0,
|
|
29316
|
+
out[key] = row?.measures?.[(0, import_records44.measureKey)(measure)] ?? null;
|
|
29317
|
+
const notice2 = row?.withheld?.[(0, import_records44.measureKey)(measure)];
|
|
29318
29318
|
if (notice2) why[key] = notice2;
|
|
29319
29319
|
}
|
|
29320
29320
|
setValues(out);
|
|
@@ -31140,7 +31140,7 @@ function NewRecordControl({
|
|
|
31140
31140
|
// src/gridDrill.tsx
|
|
31141
31141
|
var import_react164 = require("react");
|
|
31142
31142
|
var import_react165 = require("@ai-matrx/records/react");
|
|
31143
|
-
var
|
|
31143
|
+
var import_records45 = require("@ai-matrx/records");
|
|
31144
31144
|
var import_data_table12 = require("@ai-matrx/design-system/data-table");
|
|
31145
31145
|
init_parity();
|
|
31146
31146
|
init_plainWords();
|
|
@@ -31404,7 +31404,7 @@ function useDrillAnswers(args) {
|
|
|
31404
31404
|
across: question.across ?? null,
|
|
31405
31405
|
show: question.show,
|
|
31406
31406
|
where: args.where,
|
|
31407
|
-
rule: args.rule && (0,
|
|
31407
|
+
rule: args.rule && (0, import_records45.isRuleFilter)(args.rule) ? args.rule : null,
|
|
31408
31408
|
window: question.window ?? null,
|
|
31409
31409
|
compare: question.compare ?? null,
|
|
31410
31410
|
windowKey: args.windowKey ?? null,
|
|
@@ -31637,7 +31637,7 @@ function trailClause(fields, w) {
|
|
|
31637
31637
|
}
|
|
31638
31638
|
function filterWithTrail(fields, base2, trail) {
|
|
31639
31639
|
if (trail.length === 0) return base2;
|
|
31640
|
-
if (!base2 || !(0,
|
|
31640
|
+
if (!base2 || !(0, import_records45.isRuleFilter)(base2)) {
|
|
31641
31641
|
const flat = { ...base2 ?? {} };
|
|
31642
31642
|
for (const w of trail) {
|
|
31643
31643
|
const clause = trailClause(fields, w);
|
|
@@ -31660,7 +31660,7 @@ function filterWithTrail(fields, base2, trail) {
|
|
|
31660
31660
|
return { op: "and", args };
|
|
31661
31661
|
}
|
|
31662
31662
|
function filterWithWindow(fields, base2, key, range) {
|
|
31663
|
-
if (!base2 || !(0,
|
|
31663
|
+
if (!base2 || !(0, import_records45.isRuleFilter)(base2)) return { ...base2 ?? {}, [key]: { from: range.from, to: range.to } };
|
|
31664
31664
|
const field2 = fields.find((f) => f.key === key);
|
|
31665
31665
|
if (!field2) return base2;
|
|
31666
31666
|
const ref = { field: field2.id };
|
|
@@ -31704,8 +31704,8 @@ function useGridDrillConfig(args) {
|
|
|
31704
31704
|
},
|
|
31705
31705
|
[setQuestion, onPresentationChange, presentation]
|
|
31706
31706
|
);
|
|
31707
|
-
const flat = state2.filter && !(0,
|
|
31708
|
-
const rule = state2.filter && (0,
|
|
31707
|
+
const flat = state2.filter && !(0, import_records45.isRuleFilter)(state2.filter) ? state2.filter : void 0;
|
|
31708
|
+
const rule = state2.filter && (0, import_records45.isRuleFilter)(state2.filter) ? filterWithTrailRuleOnly(state2) : void 0;
|
|
31709
31709
|
const { config } = useDrill({
|
|
31710
31710
|
source: state2.source,
|
|
31711
31711
|
question: state2.question,
|
|
@@ -32094,7 +32094,7 @@ function withTypeMark(field2, header) {
|
|
|
32094
32094
|
|
|
32095
32095
|
// src/ReverseColumns.tsx
|
|
32096
32096
|
var import_react166 = require("react");
|
|
32097
|
-
var
|
|
32097
|
+
var import_records46 = require("@ai-matrx/records");
|
|
32098
32098
|
|
|
32099
32099
|
// src/groupReads.ts
|
|
32100
32100
|
var import_first_page6 = require("@ai-matrx/records/first-page");
|
|
@@ -32247,7 +32247,7 @@ function useReverseField(tableId, column) {
|
|
|
32247
32247
|
if (column.read_only || !client) return;
|
|
32248
32248
|
let live = true;
|
|
32249
32249
|
void client.fields({ table_id: tableId, withReverse: true }).then((read) => {
|
|
32250
|
-
if (live && read.ok) setField(read.data.find((f) => f.key === column.key && (0,
|
|
32250
|
+
if (live && read.ok) setField(read.data.find((f) => f.key === column.key && (0, import_records46.isReverseField)(f)) ?? null);
|
|
32251
32251
|
});
|
|
32252
32252
|
return () => {
|
|
32253
32253
|
live = false;
|
|
@@ -33034,13 +33034,13 @@ init_tableShape();
|
|
|
33034
33034
|
|
|
33035
33035
|
// src/TableAsOf.tsx
|
|
33036
33036
|
var import_react174 = require("react");
|
|
33037
|
-
var
|
|
33037
|
+
var import_records48 = require("@ai-matrx/records");
|
|
33038
33038
|
var import_react175 = require("@ai-matrx/records/react");
|
|
33039
33039
|
var import_design_system94 = require("@ai-matrx/design-system");
|
|
33040
33040
|
|
|
33041
33041
|
// src/AsOfReading.tsx
|
|
33042
33042
|
var import_react172 = require("react");
|
|
33043
|
-
var
|
|
33043
|
+
var import_records47 = require("@ai-matrx/records");
|
|
33044
33044
|
var import_react173 = require("@ai-matrx/records/react");
|
|
33045
33045
|
var import_design_system93 = require("@ai-matrx/design-system");
|
|
33046
33046
|
var import_controls9 = require("@ai-matrx/design-system/controls");
|
|
@@ -33065,7 +33065,7 @@ function asOfArgs(record_id, asOf, zone = getPersonTimeZone()) {
|
|
|
33065
33065
|
return asOf.clock === "recorded" ? { record_id, recorded_at: endOfDayIso(asOf.day, zone) } : { record_id, world_on: asOf.day };
|
|
33066
33066
|
}
|
|
33067
33067
|
function AsOfControl({ value, onChange, className }) {
|
|
33068
|
-
const [text, setText] = (0, import_react172.useState)(value ? (0,
|
|
33068
|
+
const [text, setText] = (0, import_react172.useState)(value ? (0, import_records47.typedDateText)(value.day) : "");
|
|
33069
33069
|
const [bad, setBad] = (0, import_react172.useState)(false);
|
|
33070
33070
|
usePersonTimeZone();
|
|
33071
33071
|
const clock = value?.clock ?? "recorded";
|
|
@@ -33075,13 +33075,13 @@ function AsOfControl({ value, onChange, className }) {
|
|
|
33075
33075
|
onChange(null);
|
|
33076
33076
|
return;
|
|
33077
33077
|
}
|
|
33078
|
-
const read = (0,
|
|
33078
|
+
const read = (0, import_records47.readTypedDate)(words2);
|
|
33079
33079
|
if (!read.ok) {
|
|
33080
33080
|
setBad(true);
|
|
33081
33081
|
return;
|
|
33082
33082
|
}
|
|
33083
33083
|
setBad(false);
|
|
33084
|
-
setText((0,
|
|
33084
|
+
setText((0, import_records47.typedDateText)(read.day));
|
|
33085
33085
|
onChange({ day: read.day, clock });
|
|
33086
33086
|
}
|
|
33087
33087
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: (0, import_design_system93.cn)("flex h-6 items-center gap-1", className), "data-records-as-of": "", children: [
|
|
@@ -33186,7 +33186,7 @@ function AsOfReading({
|
|
|
33186
33186
|
if (answer.doc === null) {
|
|
33187
33187
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("p", { className: (0, import_design_system93.cn)(box, "p-2 text-xs text-muted-foreground"), "data-records-as-of-none": "", children: [
|
|
33188
33188
|
"Not there on ",
|
|
33189
|
-
(0,
|
|
33189
|
+
(0, import_records47.typedDateText)(asOf.day)
|
|
33190
33190
|
] });
|
|
33191
33191
|
}
|
|
33192
33192
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("dl", { className: (0, import_design_system93.cn)(box, "grid grid-cols-[minmax(5rem,9rem)_1fr] content-start gap-x-3 gap-y-0.5 p-2 text-[11px]"), "data-records-as-of-reading": "", children: rows.map(({ field: field2, was, now, differs }) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "contents", "data-as-of-field": field2.key, "data-as-of-differs": differs ? "" : void 0, children: [
|
|
@@ -33256,7 +33256,7 @@ function TableAsOfButton({
|
|
|
33256
33256
|
}) {
|
|
33257
33257
|
const [open, setOpen] = (0, import_react174.useState)(false);
|
|
33258
33258
|
usePersonTimeZone();
|
|
33259
|
-
const label = value ? `${TABLE_AS_OF_WORDS.button} ${(0,
|
|
33259
|
+
const label = value ? `${TABLE_AS_OF_WORDS.button} ${(0, import_records48.typedDateText)(value.day)}` : TABLE_AS_OF_WORDS.button;
|
|
33260
33260
|
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_design_system94.Popover, { open, onOpenChange: setOpen, children: [
|
|
33261
33261
|
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_design_system94.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
|
|
33262
33262
|
import_design_system94.Button,
|
|
@@ -33751,7 +33751,7 @@ function useStoreValueFacets(enabled, inputs) {
|
|
|
33751
33751
|
// src/gridGrouping.tsx
|
|
33752
33752
|
var import_react183 = require("react");
|
|
33753
33753
|
var import_react184 = require("@ai-matrx/records/react");
|
|
33754
|
-
var
|
|
33754
|
+
var import_records49 = require("@ai-matrx/records");
|
|
33755
33755
|
init_parity();
|
|
33756
33756
|
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
33757
33757
|
function groupValueKey(value) {
|
|
@@ -33789,8 +33789,8 @@ function useGroupFacts(args) {
|
|
|
33789
33789
|
const withheld = {};
|
|
33790
33790
|
for (const [fieldKey, op2] of entries) {
|
|
33791
33791
|
const m = op2 === "count" ? { op: "count" } : { op: op2, key: fieldKey };
|
|
33792
|
-
values[fieldKey] = row.measures?.[(0,
|
|
33793
|
-
const notice2 = row.withheld?.[(0,
|
|
33792
|
+
values[fieldKey] = row.measures?.[(0, import_records49.measureKey)(m)] ?? null;
|
|
33793
|
+
const notice2 = row.withheld?.[(0, import_records49.measureKey)(m)];
|
|
33794
33794
|
if (notice2) withheld[fieldKey] = notice2;
|
|
33795
33795
|
}
|
|
33796
33796
|
out.set(key, { count: typeof row.measures?.["count"] === "number" ? row.measures["count"] : row.row_count ?? null, measures: values, withheld });
|
|
@@ -34791,12 +34791,12 @@ init_recordVersions();
|
|
|
34791
34791
|
// src/handOrder.tsx
|
|
34792
34792
|
var import_react192 = require("react");
|
|
34793
34793
|
var import_react193 = require("@ai-matrx/records/react");
|
|
34794
|
-
var
|
|
34794
|
+
var import_records50 = require("@ai-matrx/records");
|
|
34795
34795
|
var import_design_system100 = require("@ai-matrx/design-system");
|
|
34796
34796
|
init_Refusal();
|
|
34797
34797
|
|
|
34798
34798
|
// src/views.ts
|
|
34799
|
-
var
|
|
34799
|
+
var import_views3 = require("@ai-matrx/records/views");
|
|
34800
34800
|
var { viewDocument, viewFromRow, declareView, saveViewPatch, viewPatchDocument } = boundViews;
|
|
34801
34801
|
|
|
34802
34802
|
// src/handOrder.tsx
|
|
@@ -34916,7 +34916,7 @@ function useHandOrderRows(args) {
|
|
|
34916
34916
|
const client = (0, import_react193.useRecordsClient)();
|
|
34917
34917
|
const { viewId, active, page, pageSize } = args;
|
|
34918
34918
|
const filter = args.filter && Object.keys(args.filter).length > 0 ? args.filter : null;
|
|
34919
|
-
const filterKey = filter ? (0,
|
|
34919
|
+
const filterKey = filter ? (0, import_records50.stableFilterKey)(filter) : "";
|
|
34920
34920
|
const filterNow = (0, import_react192.useRef)(filter);
|
|
34921
34921
|
filterNow.current = filter;
|
|
34922
34922
|
const [answer, setAnswer] = (0, import_react192.useState)(null);
|
|
@@ -35218,7 +35218,7 @@ function GridBody({
|
|
|
35218
35218
|
const hrefForRecord = host.hrefForRecord;
|
|
35219
35219
|
const client = (0, import_react198.useRecordsClient)();
|
|
35220
35220
|
const table = (0, import_react198.useTable)(tableId);
|
|
35221
|
-
const fields = (0, import_react198.useFields)(tableId,
|
|
35221
|
+
const fields = (0, import_react198.useFields)(tableId, import_records51.EVERY_RECORD_TYPE);
|
|
35222
35222
|
const decorations = useTableDecorations(tableId, fields.data);
|
|
35223
35223
|
const mergedStyle = (0, import_react197.useMemo)(
|
|
35224
35224
|
() => resolveTableStyle(decorations.data, fields.data ?? [], presentation.style),
|
|
@@ -35404,9 +35404,9 @@ function GridBody({
|
|
|
35404
35404
|
const pageAskedFor = (0, import_react197.useRef)(null);
|
|
35405
35405
|
if (fields.data && !table.loading) pageAskedFor.current = tableId;
|
|
35406
35406
|
const pageAsked = !storePaged || Boolean(fields.data) && pageAskedFor.current === tableId;
|
|
35407
|
-
const numberAsked = (0, import_react197.useMemo)(() => (0,
|
|
35407
|
+
const numberAsked = (0, import_react197.useMemo)(() => (0, import_records51.autonumberSearchOf)(fields.data ?? [], searchTerm), [fields.data, searchTerm]);
|
|
35408
35408
|
const pageSearch = numberAsked ? "" : searchTerm;
|
|
35409
|
-
const pageFilter = numberAsked ? (0,
|
|
35409
|
+
const pageFilter = numberAsked ? (0, import_records51.filterWithAutonumber)(readFilter, numberAsked.field, numberAsked.number) : readFilter;
|
|
35410
35410
|
const [tableAsOf, setTableAsOf] = (0, import_react197.useState)(null);
|
|
35411
35411
|
const pastRead = useTableAsOfPage(tableAsOf && storePaged ? tableId : null, tableAsOf, Math.max(0, query.page - 1), query.pageSize);
|
|
35412
35412
|
const serverRead = (0, import_react198.useRecordPage)(storePaged && pageAsked && !tableAsOf ? tableId : null, {
|
|
@@ -35775,7 +35775,7 @@ function GridBody({
|
|
|
35775
35775
|
const names2 = wanted.get(field2.key) ?? [];
|
|
35776
35776
|
if (names2.length === 0) return;
|
|
35777
35777
|
const got = await client.relationNamesMatch({ table_id: field2.relation_target, names: names2 });
|
|
35778
|
-
if (got.ok) relationNames.current.set(field2.key, (0,
|
|
35778
|
+
if (got.ok) relationNames.current.set(field2.key, (0, import_records52.relationNameIndexOf)(got.data));
|
|
35779
35779
|
})
|
|
35780
35780
|
);
|
|
35781
35781
|
},
|
|
@@ -35854,7 +35854,7 @@ function GridBody({
|
|
|
35854
35854
|
field2.key,
|
|
35855
35855
|
lines2.flatMap((line) => {
|
|
35856
35856
|
const cell2 = line[at];
|
|
35857
|
-
return typeof cell2 === "string" ? (0,
|
|
35857
|
+
return typeof cell2 === "string" ? (0, import_records52.relationNamesIn)(field2, cell2) : [];
|
|
35858
35858
|
})
|
|
35859
35859
|
);
|
|
35860
35860
|
}
|
|
@@ -36152,7 +36152,7 @@ function GridBody({
|
|
|
36152
36152
|
tableName: table.data ? tableName(table.data) : "",
|
|
36153
36153
|
fields: fields.data ?? [],
|
|
36154
36154
|
document: row.document ?? {},
|
|
36155
|
-
level: (0,
|
|
36155
|
+
level: (0, import_records52.asPermissionLevel)(row.level)
|
|
36156
36156
|
}),
|
|
36157
36157
|
[host, tableId, table.data, fields.data]
|
|
36158
36158
|
);
|
|
@@ -37656,7 +37656,7 @@ var import_react230 = require("@ai-matrx/records/react");
|
|
|
37656
37656
|
|
|
37657
37657
|
// src/Peek.tsx
|
|
37658
37658
|
var import_react212 = require("react");
|
|
37659
|
-
var
|
|
37659
|
+
var import_records56 = require("@ai-matrx/records");
|
|
37660
37660
|
var import_react213 = require("@ai-matrx/records/react");
|
|
37661
37661
|
var import_react214 = require("@ai-matrx/alchemy/react");
|
|
37662
37662
|
|
|
@@ -37892,7 +37892,7 @@ init_Refusal();
|
|
|
37892
37892
|
|
|
37893
37893
|
// src/ValueAlternates.tsx
|
|
37894
37894
|
var import_react203 = require("react");
|
|
37895
|
-
var
|
|
37895
|
+
var import_records53 = require("@ai-matrx/records");
|
|
37896
37896
|
var import_react204 = require("@ai-matrx/records/react");
|
|
37897
37897
|
var import_text_case17 = require("@ai-matrx/kit/text-case");
|
|
37898
37898
|
var import_design_system104 = require("@ai-matrx/design-system");
|
|
@@ -37948,7 +37948,7 @@ function ValueAlternates({
|
|
|
37948
37948
|
async function use(index) {
|
|
37949
37949
|
setBusy(index);
|
|
37950
37950
|
setRefusal(null);
|
|
37951
|
-
const written = await (0,
|
|
37951
|
+
const written = await (0, import_records53.chooseAlternate)(client, { record_id: recordId, field_key: field2.key, alternate_index: index, ...shownList[index]?.rank !== void 0 ? { rank: shownList[index].rank } : {} });
|
|
37952
37952
|
setBusy(null);
|
|
37953
37953
|
if (!written.ok) return setRefusal(written.error);
|
|
37954
37954
|
setOpen(false);
|
|
@@ -37993,7 +37993,7 @@ function ValueAlternates({
|
|
|
37993
37993
|
|
|
37994
37994
|
// src/ValuePeriods.tsx
|
|
37995
37995
|
var import_react205 = require("react");
|
|
37996
|
-
var
|
|
37996
|
+
var import_records54 = require("@ai-matrx/records");
|
|
37997
37997
|
var import_react206 = require("@ai-matrx/records/react");
|
|
37998
37998
|
var import_design_system105 = require("@ai-matrx/design-system");
|
|
37999
37999
|
var import_controls10 = require("@ai-matrx/design-system/controls");
|
|
@@ -38020,14 +38020,14 @@ function ValuePeriods({
|
|
|
38020
38020
|
setRefusal(null);
|
|
38021
38021
|
const raw = await client.recordAsOf({ record_id: recordId, recorded_at: (/* @__PURE__ */ new Date()).toISOString() });
|
|
38022
38022
|
if (!raw.ok) return setRefusal(raw.error);
|
|
38023
|
-
setRows(asRows((0,
|
|
38023
|
+
setRows(asRows((0, import_records54.valuePeriodsOf)(raw.data, field2.key)));
|
|
38024
38024
|
}
|
|
38025
38025
|
const change = (i, part) => setRows((now) => (now ?? []).map((r, j) => j === i ? { ...r, ...part } : r));
|
|
38026
38026
|
async function save() {
|
|
38027
38027
|
if (!rows) return;
|
|
38028
38028
|
setSaving(true);
|
|
38029
38029
|
setRefusal(null);
|
|
38030
|
-
const written = await (0,
|
|
38030
|
+
const written = await (0, import_records54.setValuePeriods)(client, {
|
|
38031
38031
|
record_id: recordId,
|
|
38032
38032
|
field_key: field2.key,
|
|
38033
38033
|
periods: rows.filter((r) => r.value.trim() !== "" || r.from || r.to).map((r) => ({ from: r.from, to: r.to, value: r.value }))
|
|
@@ -38166,7 +38166,7 @@ function ShareForSomebodyElse({
|
|
|
38166
38166
|
|
|
38167
38167
|
// src/RowControls.tsx
|
|
38168
38168
|
var import_react208 = require("react");
|
|
38169
|
-
var
|
|
38169
|
+
var import_records55 = require("@ai-matrx/records");
|
|
38170
38170
|
var import_react209 = require("@ai-matrx/records/react");
|
|
38171
38171
|
var import_design_system107 = require("@ai-matrx/design-system");
|
|
38172
38172
|
init_Refusal();
|
|
@@ -38182,7 +38182,7 @@ var ROW_CONTROL_WORDS = {
|
|
|
38182
38182
|
applying: "Applying\u2026",
|
|
38183
38183
|
whoMayChangeTable: "Only the table's maker or an admin can change these.",
|
|
38184
38184
|
shownTo: "Shown to",
|
|
38185
|
-
whoMayChangeRow:
|
|
38185
|
+
whoMayChangeRow: import_records55.SHOWN_TO_WHO_MAY_CHANGE
|
|
38186
38186
|
};
|
|
38187
38187
|
function appliedLine(done) {
|
|
38188
38188
|
const rows = `${done.changed} ${done.changed === 1 ? "row" : "rows"} changed`;
|
|
@@ -38196,7 +38196,7 @@ function ShownToSelect({
|
|
|
38196
38196
|
onChange,
|
|
38197
38197
|
testId
|
|
38198
38198
|
}) {
|
|
38199
|
-
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_design_system107.Select, { value, onValueChange: (next) => (0,
|
|
38199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_design_system107.Select, { value, onValueChange: (next) => (0, import_records55.isShownTo)(next) ? onChange(next) : void 0, children: [
|
|
38200
38200
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
38201
38201
|
import_design_system107.SelectTrigger,
|
|
38202
38202
|
{
|
|
@@ -38210,7 +38210,7 @@ function ShownToSelect({
|
|
|
38210
38210
|
]
|
|
38211
38211
|
}
|
|
38212
38212
|
),
|
|
38213
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_design_system107.SelectContent, { children: allowed.map((word) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_design_system107.SelectItem, { value: word, children:
|
|
38213
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_design_system107.SelectContent, { children: allowed.map((word) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_design_system107.SelectItem, { value: word, children: import_records55.SHOWN_TO_LABEL[word] }, word)) })
|
|
38214
38214
|
] });
|
|
38215
38215
|
}
|
|
38216
38216
|
function NewRowsDefaults({ tableId }) {
|
|
@@ -38248,10 +38248,10 @@ function NewRowsDefaults({ tableId }) {
|
|
|
38248
38248
|
setError(null);
|
|
38249
38249
|
setApplied(appliedLine(answer.data));
|
|
38250
38250
|
};
|
|
38251
|
-
if (!(0,
|
|
38251
|
+
if (!(0, import_records55.levelHasShownTo)(table.data?.level)) return null;
|
|
38252
38252
|
if (!d) return error ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(RefusalNotice, { error }) : null;
|
|
38253
38253
|
const shown5 = d.shown_to ?? d.effective.shown_to;
|
|
38254
|
-
const allowed = d.allowed_shown_to.filter(
|
|
38254
|
+
const allowed = d.allowed_shown_to.filter(import_records55.isShownTo);
|
|
38255
38255
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("section", { className: "flex flex-col gap-1.5", "data-testid": "new-rows-defaults", children: [
|
|
38256
38256
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "font-medium", children: ROW_CONTROL_WORDS.block }),
|
|
38257
38257
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
@@ -38265,7 +38265,7 @@ function NewRowsDefaults({ tableId }) {
|
|
|
38265
38265
|
testId: "new-rows-shown-to",
|
|
38266
38266
|
onChange: (next) => void set({ shown_to: next })
|
|
38267
38267
|
}
|
|
38268
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { "data-testid": "new-rows-shown-to-text", children:
|
|
38268
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { "data-testid": "new-rows-shown-to-text", children: import_records55.SHOWN_TO_LABEL[shown5] })
|
|
38269
38269
|
] }),
|
|
38270
38270
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex items-center gap-2", "data-testid": "new-rows-published", children: [
|
|
38271
38271
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "min-w-fit flex-1 whitespace-nowrap", children: ROW_CONTROL_WORDS.publishedToWeb }),
|
|
@@ -38316,10 +38316,10 @@ function RowShownTo({ recordId, tableId }) {
|
|
|
38316
38316
|
}, [read]);
|
|
38317
38317
|
if (error && !c) return null;
|
|
38318
38318
|
if (tableId && table.loading && !table.data) return null;
|
|
38319
|
-
if (!(0,
|
|
38320
|
-
if (!c || c.shown_to.is_child || !(0,
|
|
38319
|
+
if (!(0, import_records55.levelHasShownTo)(table.data?.level)) return null;
|
|
38320
|
+
if (!c || c.shown_to.is_child || !(0, import_records55.isShownTo)(c.shown_to.effective)) return null;
|
|
38321
38321
|
const effective = c.shown_to.effective;
|
|
38322
|
-
const allowed = c.shown_to.allowed.filter(
|
|
38322
|
+
const allowed = c.shown_to.allowed.filter(import_records55.isShownTo);
|
|
38323
38323
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("span", { className: "inline-flex shrink-0 items-center", "data-testid": "row-shown-to", children: [
|
|
38324
38324
|
c.shown_to.can_change ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
38325
38325
|
ShownToSelect,
|
|
@@ -38346,7 +38346,7 @@ function RowShownTo({ recordId, tableId }) {
|
|
|
38346
38346
|
title: ROW_CONTROL_WORDS.whoMayChangeRow,
|
|
38347
38347
|
children: [
|
|
38348
38348
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "text-muted-foreground", children: ROW_CONTROL_WORDS.shownTo }),
|
|
38349
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { "data-testid": "row-shown-to-text", children:
|
|
38349
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { "data-testid": "row-shown-to-text", children: import_records55.SHOWN_TO_LABEL[effective] }),
|
|
38350
38350
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "sr-only", "data-testid": "row-shown-to-who", children: ROW_CONTROL_WORDS.whoMayChangeRow })
|
|
38351
38351
|
]
|
|
38352
38352
|
}
|
|
@@ -38487,7 +38487,7 @@ function Peek3({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
38487
38487
|
usePeopleTick();
|
|
38488
38488
|
const table = (0, import_react213.useTable)(tableId);
|
|
38489
38489
|
const record = (0, import_react213.useRecord)(recordId, true, { tableId });
|
|
38490
|
-
const fields = (0, import_react213.useFields)(tableId, (0,
|
|
38490
|
+
const fields = (0, import_react213.useFields)(tableId, (0, import_records56.recordTypeOf)(table.data, record.data?.document));
|
|
38491
38491
|
const may = useRecordRights(recordId);
|
|
38492
38492
|
const host = useRecordsUi();
|
|
38493
38493
|
const organizationId = (0, import_react213.useRecordsClient)().config.organizationId;
|
|
@@ -38503,7 +38503,7 @@ function Peek3({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
38503
38503
|
if (record.error) return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(RefusalNotice, { error: record.error, className });
|
|
38504
38504
|
if (fields.error) return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
|
|
38505
38505
|
const document2 = record.data?.document;
|
|
38506
|
-
if (document2 && (0,
|
|
38506
|
+
if (document2 && (0, import_records56.isLockedStub)({ document: document2, level: null })) {
|
|
38507
38507
|
const filed = document2["submitted_at"];
|
|
38508
38508
|
const when = typeof filed === "string" && !Number.isNaN(Date.parse(filed)) ? new Date(filed).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", ...(0, import_field_formats16.momentZoneOptions)(filed) }) : null;
|
|
38509
38509
|
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("p", { className: (0, import_design_system109.cn)("text-sm text-muted-foreground", className), "data-records-locked-record": "", children: [
|
|
@@ -41950,7 +41950,7 @@ function TableRenameDialog({
|
|
|
41950
41950
|
|
|
41951
41951
|
// src/TableSettings.tsx
|
|
41952
41952
|
var import_react261 = require("react");
|
|
41953
|
-
var
|
|
41953
|
+
var import_records57 = require("@ai-matrx/records");
|
|
41954
41954
|
|
|
41955
41955
|
// src/ArchiveDeliberately.tsx
|
|
41956
41956
|
var import_react245 = require("react");
|
|
@@ -42707,7 +42707,7 @@ function TableSettings(props) {
|
|
|
42707
42707
|
const ui = useRecordsUi();
|
|
42708
42708
|
const client = (0, import_react262.useRecordsClient)();
|
|
42709
42709
|
const table = (0, import_react262.useTable)(props.tableId);
|
|
42710
|
-
const fields = (0, import_react262.useFields)(props.tableId,
|
|
42710
|
+
const fields = (0, import_react262.useFields)(props.tableId, import_records57.EVERY_RECORD_TYPE);
|
|
42711
42711
|
const now = (0, import_react261.useRef)({ table: table.data ?? null, fields: fields.data ?? [] });
|
|
42712
42712
|
now.current = { table: table.data ?? null, fields: fields.data ?? [] };
|
|
42713
42713
|
const slots2 = (0, import_react261.useRef)({ details: { current: null }, rowActions: { current: null } }).current;
|
|
@@ -42728,7 +42728,7 @@ function TableSettingsPanel({
|
|
|
42728
42728
|
className
|
|
42729
42729
|
}) {
|
|
42730
42730
|
const table = (0, import_react262.useTable)(tableId);
|
|
42731
|
-
const fields = (0, import_react262.useFields)(tableId,
|
|
42731
|
+
const fields = (0, import_react262.useFields)(tableId, import_records57.EVERY_RECORD_TYPE);
|
|
42732
42732
|
const rights = useTableRights(table.data);
|
|
42733
42733
|
const queued = useTableProposals(tableId, proposals === void 0);
|
|
42734
42734
|
const shownProposals = proposals ?? queued.rows ?? void 0;
|
|
@@ -42880,7 +42880,7 @@ function TableSettingsPanel({
|
|
|
42880
42880
|
table.data ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(TableAccessLevel, { tableId, fields: fields.data ?? [] }) : null,
|
|
42881
42881
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)(TableHistoryRetention, { tableId }),
|
|
42882
42882
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_design_system130.Separator, {}),
|
|
42883
|
-
(0,
|
|
42883
|
+
(0, import_records57.levelHasShownTo)(table.data?.level) ? /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(import_jsx_runtime152.Fragment, { children: [
|
|
42884
42884
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)(NewRowsDefaults, { tableId }),
|
|
42885
42885
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_design_system130.Separator, {})
|
|
42886
42886
|
] }) : null,
|
|
@@ -43122,7 +43122,7 @@ function usePlatformTable(spec) {
|
|
|
43122
43122
|
}
|
|
43123
43123
|
|
|
43124
43124
|
// src/viewLook.ts
|
|
43125
|
-
var
|
|
43125
|
+
var import_views4 = require("@ai-matrx/records/views");
|
|
43126
43126
|
var { lookDocument, lookFromDocument, readLooks, keepLook } = boundViews;
|
|
43127
43127
|
var LOOK_WORDS = {
|
|
43128
43128
|
/** The reason, for a tooltip or a screen reader — never a line on the page (interface-text). */
|
|
@@ -43154,7 +43154,7 @@ function lookAfterReset(look) {
|
|
|
43154
43154
|
// src/ViewSwitcher.tsx
|
|
43155
43155
|
var import_react299 = require("react");
|
|
43156
43156
|
var import_react300 = require("@ai-matrx/records/react");
|
|
43157
|
-
var
|
|
43157
|
+
var import_records64 = require("@ai-matrx/records");
|
|
43158
43158
|
var import_design_system146 = require("@ai-matrx/design-system");
|
|
43159
43159
|
var import_data_table23 = require("@ai-matrx/design-system/data-table");
|
|
43160
43160
|
var import_format15 = require("@ai-matrx/kit/format");
|
|
@@ -43358,7 +43358,7 @@ function MoveRefusedBadge({ refused }) {
|
|
|
43358
43358
|
// src/Pipeline.tsx
|
|
43359
43359
|
var import_react267 = require("react");
|
|
43360
43360
|
var import_react268 = require("@ai-matrx/records/react");
|
|
43361
|
-
var
|
|
43361
|
+
var import_records58 = require("@ai-matrx/records");
|
|
43362
43362
|
var import_design_system132 = require("@ai-matrx/design-system");
|
|
43363
43363
|
var import_data_table17 = require("@ai-matrx/design-system/data-table");
|
|
43364
43364
|
init_recordVersions();
|
|
@@ -43473,7 +43473,7 @@ function PipelineBoard({
|
|
|
43473
43473
|
alive.current = false;
|
|
43474
43474
|
};
|
|
43475
43475
|
}, []);
|
|
43476
|
-
const filterKey = (0,
|
|
43476
|
+
const filterKey = (0, import_records58.stableFilterKey)(filter);
|
|
43477
43477
|
const reload = (0, import_react267.useCallback)(async () => {
|
|
43478
43478
|
setLoading(true);
|
|
43479
43479
|
const [read, board, held] = await Promise.all([
|
|
@@ -44230,7 +44230,7 @@ function useRowColorBy(all, colorKey, style) {
|
|
|
44230
44230
|
}
|
|
44231
44231
|
|
|
44232
44232
|
// src/workedOutDate.ts
|
|
44233
|
-
var
|
|
44233
|
+
var import_records59 = require("@ai-matrx/records");
|
|
44234
44234
|
var WORKED_OUT_DATE_LOCK = "Worked out \xB7 can't move";
|
|
44235
44235
|
var FORMULA_TYPING_ROUNDS = 9;
|
|
44236
44236
|
var configOf = (field2) => field2?.config ?? {};
|
|
@@ -44307,7 +44307,7 @@ function formulaResultKind(node, all) {
|
|
|
44307
44307
|
if (op2 === "fx.min" || op2 === "fx.max") {
|
|
44308
44308
|
return args.length > 0 && args.every((a) => formulaResultKind(a, all) === "date") ? "date" : "number";
|
|
44309
44309
|
}
|
|
44310
|
-
return
|
|
44310
|
+
return import_records59.FORMULA_NODE_RESULTS[op2] ?? "unknown";
|
|
44311
44311
|
}
|
|
44312
44312
|
function isDateFormula(field2, all) {
|
|
44313
44313
|
const expr = ownExpression(field2);
|
|
@@ -46143,7 +46143,7 @@ function TimelineView({
|
|
|
46143
46143
|
] });
|
|
46144
46144
|
if (!startField) {
|
|
46145
46145
|
return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: (0, import_design_system134.cn)("flex min-w-0 flex-col gap-2", className), "data-timeline-needs": "", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col gap-2 rounded border border-dashed p-4 text-xs text-muted-foreground", children: [
|
|
46146
|
-
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { children: dates.length > 0 ?
|
|
46146
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { children: dates.length > 0 ? import_views3.VIEW_NEEDS.timeline?.pick : import_views3.VIEW_NEEDS.timeline?.missing }),
|
|
46147
46147
|
dates.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex flex-wrap gap-2", children: settings }) : null
|
|
46148
46148
|
] }) });
|
|
46149
46149
|
}
|
|
@@ -46392,7 +46392,7 @@ init_names();
|
|
|
46392
46392
|
init_Refusal();
|
|
46393
46393
|
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
46394
46394
|
function viewNeedFor(layout) {
|
|
46395
|
-
return
|
|
46395
|
+
return import_views3.VIEW_NEEDS[layout];
|
|
46396
46396
|
}
|
|
46397
46397
|
function columnDeclarationFor(need, label, options, fields) {
|
|
46398
46398
|
const base2 = { label: label.trim(), sort: nextFieldSort(fields) };
|
|
@@ -46423,7 +46423,7 @@ function ViewNeeds({ layout, tableId, fields, onMade, className }) {
|
|
|
46423
46423
|
const mutation = (0, import_react279.useFieldMutation)();
|
|
46424
46424
|
const client = (0, import_react279.useRecordsClient)();
|
|
46425
46425
|
const taken = fields.map((f) => fieldName(f));
|
|
46426
|
-
const [label, setLabel] = (0, import_react278.useState)(() => (0,
|
|
46426
|
+
const [label, setLabel] = (0, import_react278.useState)(() => (0, import_views3.freeColumnName)(need?.starter.label ?? "", taken));
|
|
46427
46427
|
const [options, setOptions] = (0, import_react278.useState)(() => [...need?.starter.options ?? []]);
|
|
46428
46428
|
const [refused, setRefused] = (0, import_react278.useState)(null);
|
|
46429
46429
|
const [pendingId, setPendingId] = (0, import_react278.useState)(null);
|
|
@@ -47001,7 +47001,7 @@ function ListRow({
|
|
|
47001
47001
|
}
|
|
47002
47002
|
|
|
47003
47003
|
// src/pivot.ts
|
|
47004
|
-
var
|
|
47004
|
+
var import_records60 = require("@ai-matrx/records");
|
|
47005
47005
|
var PIVOT_OPS = ["count", "sum", "avg", "min", "max"];
|
|
47006
47006
|
var isPivotOp = (v) => PIVOT_OPS.includes(v ?? "");
|
|
47007
47007
|
var PIVOT_OP_LABEL = { count: "Count", sum: "Sum", avg: "Average", min: "Min", max: "Max" };
|
|
@@ -47034,7 +47034,7 @@ function byValue(a, b) {
|
|
|
47034
47034
|
return a.label.localeCompare(b.label, void 0, { numeric: true, sensitivity: "base" });
|
|
47035
47035
|
}
|
|
47036
47036
|
function pivotTable(q, answers2, label, limit = PIVOT_CELL_LIMIT) {
|
|
47037
|
-
const m = (0,
|
|
47037
|
+
const m = (0, import_records60.measureKey)(q.measure);
|
|
47038
47038
|
const read = (r) => r ? { value: typeof r.measures?.[m] === "number" ? r.measures[m] : null, n: r.row_count } : null;
|
|
47039
47039
|
const axis = (key, sources) => {
|
|
47040
47040
|
if (!key) return [{ id: NONE3, value: null, label: "" }];
|
|
@@ -47068,7 +47068,7 @@ function pivotTable(q, answers2, label, limit = PIVOT_CELL_LIMIT) {
|
|
|
47068
47068
|
// src/ChartLayout.tsx
|
|
47069
47069
|
var import_react290 = require("react");
|
|
47070
47070
|
var import_react291 = require("@ai-matrx/records/react");
|
|
47071
|
-
var
|
|
47071
|
+
var import_records62 = require("@ai-matrx/records");
|
|
47072
47072
|
var import_design_system141 = require("@ai-matrx/design-system");
|
|
47073
47073
|
var import_controls18 = require("@ai-matrx/design-system/controls");
|
|
47074
47074
|
|
|
@@ -47076,7 +47076,7 @@ var import_controls18 = require("@ai-matrx/design-system/controls");
|
|
|
47076
47076
|
var import_controls17 = require("@ai-matrx/design-system/controls");
|
|
47077
47077
|
var import_react289 = require("react");
|
|
47078
47078
|
var import_recharts = require("recharts");
|
|
47079
|
-
var
|
|
47079
|
+
var import_records61 = require("@ai-matrx/records");
|
|
47080
47080
|
var import_core23 = require("@ai-matrx/records/core");
|
|
47081
47081
|
var import_design_system140 = require("@ai-matrx/design-system");
|
|
47082
47082
|
var import_format13 = require("@ai-matrx/kit/format");
|
|
@@ -47663,7 +47663,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
47663
47663
|
const kind2 = shape ? BASE_KIND_OF_SHAPE[shape] : block.kind;
|
|
47664
47664
|
const tableId = block.table_id ?? subject;
|
|
47665
47665
|
const measures = block.measures && block.measures.length > 0 ? block.measures : [{ op: "count" }];
|
|
47666
|
-
const primary = (0,
|
|
47666
|
+
const primary = (0, import_records61.measureKey)(measures[0]);
|
|
47667
47667
|
const windows = kind2 === "stuck" ? null : block.compare ?? null;
|
|
47668
47668
|
const compared = !!windows;
|
|
47669
47669
|
const grain = block.bucket?.by ?? null;
|
|
@@ -47673,7 +47673,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
47673
47673
|
const measureFields = useMeasureFields(primary, source ? void 0 : tableId);
|
|
47674
47674
|
const measureName = useMeasureWords(primary, tableId);
|
|
47675
47675
|
const numberFormat = (0, import_react289.useMemo)(() => source ? null : chartFormatFor(primary, measureFields), [source, primary, measureFields]);
|
|
47676
|
-
const yKey = drawn === "scatter" && measures[1] ? (0,
|
|
47676
|
+
const yKey = drawn === "scatter" && measures[1] ? (0, import_records61.measureKey)(measures[1]) : null;
|
|
47677
47677
|
const yName = useMeasureWords(yKey ?? primary, tableId);
|
|
47678
47678
|
const points = (0, import_react289.useMemo)(() => {
|
|
47679
47679
|
if (kind2 === "stuck") return [];
|
|
@@ -48420,7 +48420,7 @@ var isChartKind = (v) => Object.prototype.hasOwnProperty.call(KIND_LABEL, v ?? "
|
|
|
48420
48420
|
var isChartMeasure = (v) => v === "count" || v === "sum" || v === "avg";
|
|
48421
48421
|
function defaultChartGroup(fields) {
|
|
48422
48422
|
return fields.find((f) => {
|
|
48423
|
-
const kind2 = (0,
|
|
48423
|
+
const kind2 = (0, import_records62.fieldKindFor)(f);
|
|
48424
48424
|
return kind2 === "select" || kind2 === "multi_select";
|
|
48425
48425
|
})?.key ?? null;
|
|
48426
48426
|
}
|
|
@@ -48474,7 +48474,7 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
48474
48474
|
return;
|
|
48475
48475
|
}
|
|
48476
48476
|
const wholeRow = overall && overall.ok ? (overall.data ?? [])[0] : void 0;
|
|
48477
|
-
const wholeValue = wholeRow ? wholeRow.measures[(0,
|
|
48477
|
+
const wholeValue = wholeRow ? wholeRow.measures[(0, import_records62.measureKey)(question.measure)] : void 0;
|
|
48478
48478
|
setState({
|
|
48479
48479
|
error: null,
|
|
48480
48480
|
...question.kind === "donut" ? { total: typeof wholeValue === "number" ? wholeValue : null } : {},
|
|
@@ -48495,7 +48495,7 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
48495
48495
|
}, [client, view.subject, view.name, qKey, filterKey]);
|
|
48496
48496
|
const groupable = fields.filter((f) => !["attachment", "file", "formula", "button"].includes(String(f.type)));
|
|
48497
48497
|
const numeric = fields.filter(isNumberField);
|
|
48498
|
-
const pickMeasure = (0,
|
|
48498
|
+
const pickMeasure = (0, import_records62.measureKey)(q.measure);
|
|
48499
48499
|
const dataLabels = view.presentation?.chartLabels === true;
|
|
48500
48500
|
const legend = view.presentation?.chartLegend !== false;
|
|
48501
48501
|
const setLook = (patch) => onChange({ presentation: { ...view.presentation, ...patch } });
|
|
@@ -48557,7 +48557,7 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
48557
48557
|
// src/PivotLayout.tsx
|
|
48558
48558
|
var import_react292 = require("react");
|
|
48559
48559
|
var import_react293 = require("@ai-matrx/records/react");
|
|
48560
|
-
var
|
|
48560
|
+
var import_records63 = require("@ai-matrx/records");
|
|
48561
48561
|
var import_design_system142 = require("@ai-matrx/design-system");
|
|
48562
48562
|
var import_skeleton2 = require("@ai-matrx/design-system/skeleton");
|
|
48563
48563
|
var import_controls19 = require("@ai-matrx/design-system/controls");
|
|
@@ -48633,7 +48633,7 @@ function PivotLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
48633
48633
|
[view.name, view.subject, q, state2.answers]
|
|
48634
48634
|
);
|
|
48635
48635
|
const named = useLinkGroupNamer(namerBlock, view.subject);
|
|
48636
|
-
const measureName = useMeasureWords((0,
|
|
48636
|
+
const measureName = useMeasureWords((0, import_records63.measureKey)(q.measure), view.subject);
|
|
48637
48637
|
const table = (0, import_react292.useMemo)(
|
|
48638
48638
|
() => state2.answers ? pivotTable(q, state2.answers, (key, value) => groupLabel({ [key]: value }, named), PIVOT_CELL_LIMIT) : null,
|
|
48639
48639
|
[q, state2.answers, named]
|
|
@@ -48671,7 +48671,7 @@ function PivotLayout({ view, fields, filter, onChange, remembered }) {
|
|
|
48671
48671
|
] });
|
|
48672
48672
|
const hasCols = !!q.colKey;
|
|
48673
48673
|
const colHead = (label) => label === "" ? measureName : label;
|
|
48674
|
-
return /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)("div", { className: "flex min-h-0 flex-col gap-2", "data-records-pivot-layout": "", "data-records-pivot-measure": (0,
|
|
48674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)("div", { className: "flex min-h-0 flex-col gap-2", "data-records-pivot-layout": "", "data-records-pivot-measure": (0, import_records63.measureKey)(q.measure), children: [
|
|
48675
48675
|
/* @__PURE__ */ (0, import_jsx_runtime167.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: [
|
|
48676
48676
|
/* @__PURE__ */ (0, import_jsx_runtime167.jsx)("span", { className: "text-muted-foreground", children: "Rows" }),
|
|
48677
48677
|
select(
|
|
@@ -49560,7 +49560,7 @@ var NO_FIELDS2 = [];
|
|
|
49560
49560
|
function useViewRecords(view, pageSize = 200, filter, viewId) {
|
|
49561
49561
|
const client = (0, import_react300.useRecordsClient)();
|
|
49562
49562
|
const [limit, setLimit] = (0, import_react299.useState)(pageSize);
|
|
49563
|
-
const questionKey = `${view.subject}|${(0,
|
|
49563
|
+
const questionKey = `${view.subject}|${(0, import_records64.stableFilterKey)(filter ?? null)}|${JSON.stringify(view.sorts ?? [])}`;
|
|
49564
49564
|
(0, import_react299.useEffect)(() => {
|
|
49565
49565
|
setLimit(pageSize);
|
|
49566
49566
|
}, [questionKey, pageSize]);
|
|
@@ -49721,14 +49721,14 @@ function ViewSwitcherBody({
|
|
|
49721
49721
|
return /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("div", { className: (0, import_design_system146.cn)("flex min-h-0 flex-col gap-2", footer === "sticky" && "flex-1", className), children: [
|
|
49722
49722
|
chooser && !embedded ? /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
49723
49723
|
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { className: "truncate text-sm font-medium", children: view.name }),
|
|
49724
|
-
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Layout", children:
|
|
49724
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Layout", children: import_views3.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
49725
49725
|
import_design_system146.Button,
|
|
49726
49726
|
{
|
|
49727
49727
|
size: "sm",
|
|
49728
49728
|
variant: option === layout ? "secondary" : "ghost",
|
|
49729
49729
|
"aria-pressed": option === layout,
|
|
49730
49730
|
onClick: () => pick(option),
|
|
49731
|
-
children:
|
|
49731
|
+
children: import_views3.LAYOUT_LABEL[option]
|
|
49732
49732
|
},
|
|
49733
49733
|
option
|
|
49734
49734
|
)) })
|
|
@@ -50134,7 +50134,7 @@ function Board({
|
|
|
50134
50134
|
...view.endField ? { endKey: view.endField } : {},
|
|
50135
50135
|
groupKey: view.groupField ?? null,
|
|
50136
50136
|
...view.presentation?.style?.colorBy !== void 0 ? { colorKey: view.presentation.style.colorBy?.field ?? null } : {},
|
|
50137
|
-
layoutKept: remembered &&
|
|
50137
|
+
layoutKept: remembered && import_views3.STORE_KEEPS_TIMELINE,
|
|
50138
50138
|
mayShape: rights.structure,
|
|
50139
50139
|
...view.presentation?.gantt ? { gantt: view.presentation.gantt } : {},
|
|
50140
50140
|
onGanttChange: (patch) => {
|
|
@@ -50145,7 +50145,7 @@ function Board({
|
|
|
50145
50145
|
},
|
|
50146
50146
|
onSettingsChange: (patch) => {
|
|
50147
50147
|
if (patch.startKey !== void 0) {
|
|
50148
|
-
onChange({ startField: patch.startKey, ...
|
|
50148
|
+
onChange({ startField: patch.startKey, ...import_views3.STORE_KEEPS_TIMELINE ? {} : { dateField: patch.startKey } });
|
|
50149
50149
|
}
|
|
50150
50150
|
if (patch.endKey !== void 0) onChange({ endField: patch.endKey });
|
|
50151
50151
|
if (patch.groupKey !== void 0) onChange({ groupField: patch.groupKey });
|
|
@@ -50222,7 +50222,7 @@ function Board({
|
|
|
50222
50222
|
titleKey: titleField?.key ?? titleKey,
|
|
50223
50223
|
onChange,
|
|
50224
50224
|
canWrite: rights.write,
|
|
50225
|
-
remembered: remembered && (0,
|
|
50225
|
+
remembered: remembered && (0, import_views3.storeKeepsLayout)("swipe"),
|
|
50226
50226
|
onChanged: () => {
|
|
50227
50227
|
records.reload();
|
|
50228
50228
|
onMoved?.();
|
|
@@ -50317,7 +50317,7 @@ function FieldPicker({
|
|
|
50317
50317
|
onPick,
|
|
50318
50318
|
placing
|
|
50319
50319
|
}) {
|
|
50320
|
-
const want =
|
|
50320
|
+
const want = import_views3.LAYOUT_FIELD_KIND[layout];
|
|
50321
50321
|
const offerable = want ? offerableFields(all, want, placing) : [];
|
|
50322
50322
|
const chosenField = chosen ? all.find((field2) => field2.key === chosen) : void 0;
|
|
50323
50323
|
const unusual = chosenField && !offerable.some((field2) => field2.key === chosenField.key) ? chosenField : void 0;
|
|
@@ -50346,7 +50346,7 @@ function FieldPicker({
|
|
|
50346
50346
|
}
|
|
50347
50347
|
function Pick({ layout, picker }) {
|
|
50348
50348
|
return /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("div", { className: "flex flex-col gap-2 rounded border border-dashed p-4 text-xs text-muted-foreground", children: [
|
|
50349
|
-
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("p", { children:
|
|
50349
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("p", { children: import_views3.VIEW_NEEDS[layout]?.pick }),
|
|
50350
50350
|
picker
|
|
50351
50351
|
] });
|
|
50352
50352
|
}
|
|
@@ -50792,7 +50792,7 @@ function RecordCard({
|
|
|
50792
50792
|
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { className: "block truncate", children: label }),
|
|
50793
50793
|
parentName ? /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { className: "block truncate text-muted-foreground", "data-records-card-parent": parentId ?? "", children: `Sub-item of ${parentName}` }) : null,
|
|
50794
50794
|
dates && dates.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(CardDates, { record, fields: dates }) : null,
|
|
50795
|
-
(fields ?? []).filter((f) => (0,
|
|
50795
|
+
(fields ?? []).filter((f) => (0, import_records64.isButtonField)(f) || !isEmptyOnCard((record.document ?? {})[f.key]) || withheldNoticeOf(record.hidden, f.key)).map((f) => /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { className: "block truncate text-muted-foreground", "data-records-card-value": f.key, children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
50796
50796
|
RecordValue,
|
|
50797
50797
|
{
|
|
50798
50798
|
field: f,
|
|
@@ -50813,12 +50813,12 @@ function cardHiddenOf(presentation) {
|
|
|
50813
50813
|
}
|
|
50814
50814
|
var STATUS_WORDS = /^(status|stage|state|progress|phase)$/i;
|
|
50815
50815
|
function boardDefaultGroupField(eligible) {
|
|
50816
|
-
return eligible.find((f) => (0,
|
|
50816
|
+
return eligible.find((f) => (0, import_records64.newerKindOf)(f) === "status") ?? eligible.find((f) => STATUS_WORDS.test(fieldName(f).trim()) || STATUS_WORDS.test(f.key)) ?? eligible[0] ?? null;
|
|
50817
50817
|
}
|
|
50818
50818
|
|
|
50819
50819
|
// src/ArchivedView.tsx
|
|
50820
50820
|
var import_react301 = require("react");
|
|
50821
|
-
var
|
|
50821
|
+
var import_records65 = require("@ai-matrx/records");
|
|
50822
50822
|
var import_react302 = require("@ai-matrx/records/react");
|
|
50823
50823
|
var import_design_system147 = require("@ai-matrx/design-system");
|
|
50824
50824
|
init_Refusal();
|
|
@@ -50832,7 +50832,7 @@ function mayNotRestoreLine(why) {
|
|
|
50832
50832
|
return said2 === "" ? "Bringing a record back needs permission to edit this table. Ask somebody who has it." : said2;
|
|
50833
50833
|
}
|
|
50834
50834
|
function archivedRowLine(row, titleKey) {
|
|
50835
|
-
return `${recordName(row.document, titleKey)} \u2014 ${(0,
|
|
50835
|
+
return `${recordName(row.document, titleKey)} \u2014 ${(0, import_records65.archivedByLine)(row)}`;
|
|
50836
50836
|
}
|
|
50837
50837
|
function ArchivedView({
|
|
50838
50838
|
tableId,
|
|
@@ -50846,7 +50846,7 @@ function ArchivedView({
|
|
|
50846
50846
|
const table = (0, import_react302.useTable)(tableId);
|
|
50847
50847
|
const rights = useTableRights(table.data);
|
|
50848
50848
|
const fields = (0, import_react302.useFields)(tableId);
|
|
50849
|
-
const [lane, setLane] = (0, import_react301.useState)(laneFromHost ??
|
|
50849
|
+
const [lane, setLane] = (0, import_react301.useState)(laneFromHost ?? import_records65.DEFAULT_ARCHIVE_LANE);
|
|
50850
50850
|
const [rows, setRows] = (0, import_react301.useState)([]);
|
|
50851
50851
|
const [loading, setLoading] = (0, import_react301.useState)(true);
|
|
50852
50852
|
const [error, setError] = (0, import_react301.useState)(null);
|
|
@@ -50893,15 +50893,15 @@ function ArchivedView({
|
|
|
50893
50893
|
return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: (0, import_design_system147.cn)("flex min-h-0 flex-col gap-2", className), "data-testid": "archived-view", children: [
|
|
50894
50894
|
/* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
50895
50895
|
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("span", { className: "text-sm font-medium", children: "Archived" }),
|
|
50896
|
-
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Archived by", children:
|
|
50896
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Archived by", children: import_records65.ARCHIVE_LANES.map((option) => /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
|
|
50897
50897
|
import_design_system147.Button,
|
|
50898
50898
|
{
|
|
50899
50899
|
size: "sm",
|
|
50900
50900
|
variant: option === lane ? "secondary" : "ghost",
|
|
50901
50901
|
"aria-pressed": option === lane,
|
|
50902
|
-
title:
|
|
50902
|
+
title: import_records65.ARCHIVE_LANE_MEANS[option],
|
|
50903
50903
|
onClick: () => pick(option),
|
|
50904
|
-
children:
|
|
50904
|
+
children: import_records65.ARCHIVE_LANE_LABEL[option]
|
|
50905
50905
|
},
|
|
50906
50906
|
option
|
|
50907
50907
|
)) })
|
|
@@ -50917,7 +50917,7 @@ function ArchivedView({
|
|
|
50917
50917
|
),
|
|
50918
50918
|
error ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(RefusalNotice, { error }) : null,
|
|
50919
50919
|
loading && !error ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_design_system147.Skeleton, { className: "h-24 w-full" }) : null,
|
|
50920
|
-
!loading && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("p", { "data-testid": "archived-empty", className: "rounded-md border border-dashed px-3 py-6 text-xs text-muted-foreground", children: (0,
|
|
50920
|
+
!loading && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("p", { "data-testid": "archived-empty", className: "rounded-md border border-dashed px-3 py-6 text-xs text-muted-foreground", children: (0, import_records65.emptyArchiveLine)(lane) }) : null,
|
|
50921
50921
|
!loading && !error && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("ul", { className: "flex flex-col gap-1", "data-testid": "archived-rows", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)(
|
|
50922
50922
|
"li",
|
|
50923
50923
|
{
|
|
@@ -50927,7 +50927,7 @@ function ArchivedView({
|
|
|
50927
50927
|
children: [
|
|
50928
50928
|
/* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
50929
50929
|
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("span", { className: "truncate text-sm", children: recordName(row.document, titleKey) }),
|
|
50930
|
-
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("span", { className: "truncate text-xs text-muted-foreground", "data-testid": "archived-who", children: (0,
|
|
50930
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("span", { className: "truncate text-xs text-muted-foreground", "data-testid": "archived-who", children: (0, import_records65.archivedByLine)(row) }),
|
|
50931
50931
|
refusal3 && refusal3.recordId === row.id ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(RefusalNotice, { error: refusal3.error, className: "mt-2" }) : null
|
|
50932
50932
|
] }),
|
|
50933
50933
|
mayRestore ? /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
|
|
@@ -50950,7 +50950,7 @@ function ArchivedView({
|
|
|
50950
50950
|
] });
|
|
50951
50951
|
}
|
|
50952
50952
|
function retiredColumnLine(row) {
|
|
50953
|
-
return (0,
|
|
50953
|
+
return (0, import_records65.archivedByLine)(row);
|
|
50954
50954
|
}
|
|
50955
50955
|
function RetiredColumns({ tableId, mayRestore, whyNot }) {
|
|
50956
50956
|
const client = (0, import_react302.useRecordsClient)();
|
|
@@ -51014,7 +51014,7 @@ function RetiredColumns({ tableId, mayRestore, whyNot }) {
|
|
|
51014
51014
|
|
|
51015
51015
|
// src/ArchivedDisclosure.tsx
|
|
51016
51016
|
var import_react303 = require("react");
|
|
51017
|
-
var
|
|
51017
|
+
var import_records66 = require("@ai-matrx/records");
|
|
51018
51018
|
var import_react304 = require("@ai-matrx/records/react");
|
|
51019
51019
|
var import_design_system148 = require("@ai-matrx/design-system");
|
|
51020
51020
|
init_Refusal();
|
|
@@ -51079,10 +51079,10 @@ function ArchivedPortals({
|
|
|
51079
51079
|
error ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(RefusalNotice, { error }) : null,
|
|
51080
51080
|
rows === null && !error ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system148.Skeleton, { className: "h-16 w-full" }) : null,
|
|
51081
51081
|
said2 ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { className: "rounded-md border border-border px-3 py-2 text-xs", "data-testid": "archived-portal-said", children: said2 }) : null,
|
|
51082
|
-
rows !== null && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { "data-testid": "archived-portals-empty", className: "text-xs text-muted-foreground", children: (0,
|
|
51082
|
+
rows !== null && !error && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { "data-testid": "archived-portals-empty", className: "text-xs text-muted-foreground", children: (0, import_records66.emptyPortalArchiveLine)() }) : null,
|
|
51083
51083
|
rows !== null && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("ul", { className: "flex flex-col gap-1.5", "data-testid": "archived-portals", children: rows.map((portal) => {
|
|
51084
51084
|
const asking = confirming === portal.portal_id;
|
|
51085
|
-
const matches2 = (0,
|
|
51085
|
+
const matches2 = (0, import_records66.portalTitleTypedBack)(typed2, portal.title);
|
|
51086
51086
|
return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(
|
|
51087
51087
|
"li",
|
|
51088
51088
|
{
|
|
@@ -51121,7 +51121,7 @@ function ArchivedPortals({
|
|
|
51121
51121
|
] }),
|
|
51122
51122
|
asking ? /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
51123
51123
|
/* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
51124
|
-
(0,
|
|
51124
|
+
(0, import_records66.portalConfirmLine)(portal.title),
|
|
51125
51125
|
" Restoring it puts it back exactly as it was: everyone who was invited can sign in again, and it shows the same Tables."
|
|
51126
51126
|
] }),
|
|
51127
51127
|
/* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
@@ -51279,7 +51279,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51279
51279
|
const [unavailable, setUnavailable] = (0, import_react305.useState)(false);
|
|
51280
51280
|
const [active, setActive] = (0, import_react305.useState)(() => {
|
|
51281
51281
|
if (!initialViews || initialViews.length === 0) return activeViewId ?? null;
|
|
51282
|
-
return (initialViews.find((v) => v.id === activeViewId) ?? (0,
|
|
51282
|
+
return (initialViews.find((v) => v.id === activeViewId) ?? (0, import_views3.defaultViewOf)(initialViews) ?? initialViews[0]).id;
|
|
51283
51283
|
});
|
|
51284
51284
|
const readOnMount = (0, import_react305.useRef)(initialViews === void 0);
|
|
51285
51285
|
const pendingPick = (0, import_react305.useRef)(null);
|
|
@@ -51311,7 +51311,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51311
51311
|
justDragged.current = false;
|
|
51312
51312
|
}, 250);
|
|
51313
51313
|
if (!event.over || !views) return;
|
|
51314
|
-
const writes = (0,
|
|
51314
|
+
const writes = (0, import_views3.planViewDrop)(views, String(event.active.id), String(event.over.id));
|
|
51315
51315
|
if (writes.length > 0) {
|
|
51316
51316
|
const next = views.map((v) => {
|
|
51317
51317
|
const w = writes.find((x) => x.id === v.id);
|
|
@@ -51393,7 +51393,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51393
51393
|
if (!views || views.length === 0) return;
|
|
51394
51394
|
const wanted = pendingPick.current;
|
|
51395
51395
|
pendingPick.current = null;
|
|
51396
|
-
const chosen = views.find((v) => v.id === (wanted ?? activeViewId ?? active)) ?? (0,
|
|
51396
|
+
const chosen = views.find((v) => v.id === (wanted ?? activeViewId ?? active)) ?? (0, import_views3.defaultViewOf)(views) ?? views[0];
|
|
51397
51397
|
if (chosen.id !== active) setActive(chosen.id);
|
|
51398
51398
|
onActiveView?.(chosen);
|
|
51399
51399
|
}, [views, activeViewId]);
|
|
@@ -51462,7 +51462,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51462
51462
|
await load();
|
|
51463
51463
|
}
|
|
51464
51464
|
async function moveToSection(view, name) {
|
|
51465
|
-
if (name !== null && !(0,
|
|
51465
|
+
if (name !== null && !(0, import_views3.sectionNameOk)(name)) return;
|
|
51466
51466
|
const written = await saveViewPatch(client, tableId, view.id, { section: name });
|
|
51467
51467
|
if (!written.ok) {
|
|
51468
51468
|
setError(written.error);
|
|
@@ -51472,11 +51472,11 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51472
51472
|
await load();
|
|
51473
51473
|
}
|
|
51474
51474
|
async function renameSection(from, to) {
|
|
51475
|
-
if (to !== null && (!(0,
|
|
51475
|
+
if (to !== null && (!(0, import_views3.sectionNameOk)(to) || to.trim() === from)) {
|
|
51476
51476
|
setRenamingSection(null);
|
|
51477
51477
|
return;
|
|
51478
51478
|
}
|
|
51479
|
-
const done = await (0,
|
|
51479
|
+
const done = await (0, import_views3.reassignSection)(client, tableId, views ?? [], from, to === null ? null : to.trim());
|
|
51480
51480
|
if (!done.ok) {
|
|
51481
51481
|
setError(done.error);
|
|
51482
51482
|
return;
|
|
@@ -51561,9 +51561,9 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51561
51561
|
/* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(import_design_system149.PopoverContent, { sizing: "content", align: "start", className: "w-64 p-1", "data-view-picker-content": "", children: [
|
|
51562
51562
|
/* @__PURE__ */ (0, import_jsx_runtime174.jsxs)("div", { role: "group", "aria-label": "Saved views", className: "flex max-h-[50dvh] flex-col overflow-y-auto", children: [
|
|
51563
51563
|
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_core24.DndContext, { sensors, collisionDetection: import_core24.closestCenter, onDragStart: () => setDragging(true), onDragCancel: () => setDragging(false), onDragEnd: (e) => void dropped(e), children: (() => {
|
|
51564
|
-
const groups = (0,
|
|
51564
|
+
const groups = (0, import_views3.groupViewsBySection)(views);
|
|
51565
51565
|
return groups.some((g) => g.name === null) || !dragging ? groups : [{ name: null, views: [] }, ...groups];
|
|
51566
|
-
})().map((group) => /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(SectionBox, { id: (0,
|
|
51566
|
+
})().map((group) => /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(SectionBox, { id: (0, import_views3.sectionDropId)(group.name), role: "group", "aria-label": group.name ?? "Views", "data-view-section": group.name ?? "", children: [
|
|
51567
51567
|
group.name === null && group.views.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)("span", { className: "block px-2 py-1.5 text-[11px] text-muted-foreground", children: "No section" }) : null,
|
|
51568
51568
|
/* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(import_sortable.SortableContext, { items: group.views.map((v) => v.id), strategy: import_sortable.verticalListSortingStrategy, children: [
|
|
51569
51569
|
group.name !== null ? renamingSection?.from === group.name ? /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
|
|
@@ -51684,7 +51684,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51684
51684
|
current.name,
|
|
51685
51685
|
"\u201D to"
|
|
51686
51686
|
] }),
|
|
51687
|
-
(0,
|
|
51687
|
+
(0, import_views3.sectionNames)(views).map((name) => /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_controls21.Tile, { variant: "quiet", disabled: current.section === name, title: name, onClick: () => void moveToSection(current, name) }, name)),
|
|
51688
51688
|
current.section ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_controls21.Tile, { variant: "quiet", "data-view-section-none": "", title: "No section", onClick: () => void moveToSection(current, null) }) : null,
|
|
51689
51689
|
/* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
|
|
51690
51690
|
"form",
|
|
@@ -51696,7 +51696,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
51696
51696
|
},
|
|
51697
51697
|
children: [
|
|
51698
51698
|
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_design_system149.Input, { "aria-label": "Name for a new section", value: movingTo, onChange: (e) => setMovingTo(e.target.value), className: "h-7 min-w-0 flex-1 text-xs", placeholder: "New section", maxLength: 60 }),
|
|
51699
|
-
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_design_system149.Button, { size: "sm", type: "submit", className: "h-7", disabled: !(0,
|
|
51699
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_design_system149.Button, { size: "sm", type: "submit", className: "h-7", disabled: !(0, import_views3.sectionNameOk)(movingTo), children: "Add" })
|
|
51700
51700
|
]
|
|
51701
51701
|
}
|
|
51702
51702
|
),
|
|
@@ -53279,7 +53279,7 @@ function clientNoun(table) {
|
|
|
53279
53279
|
var import_clipboard8 = require("@ai-matrx/kit/clipboard");
|
|
53280
53280
|
var import_react318 = require("react");
|
|
53281
53281
|
var import_react319 = require("@ai-matrx/records/react");
|
|
53282
|
-
var
|
|
53282
|
+
var import_records67 = require("@ai-matrx/records");
|
|
53283
53283
|
var import_design_system156 = require("@ai-matrx/design-system");
|
|
53284
53284
|
init_BuildOrAsk();
|
|
53285
53285
|
|
|
@@ -53727,7 +53727,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
|
|
|
53727
53727
|
] }) : null,
|
|
53728
53728
|
activePortalId && !shown5.some((p) => p.portal_id === activePortalId) ? /* @__PURE__ */ (0, import_jsx_runtime181.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,
|
|
53729
53729
|
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)("ul", { className: "flex flex-col gap-2", children: shown5.map((portal) => {
|
|
53730
|
-
const url = `${origin}${(0,
|
|
53730
|
+
const url = `${origin}${(0, import_records67.portalPath)(portal.slug)}`;
|
|
53731
53731
|
const open = openId === portal.portal_id;
|
|
53732
53732
|
const linked = portal.portal_id === activePortalId;
|
|
53733
53733
|
return /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)(
|
|
@@ -53842,8 +53842,8 @@ function ArchivePortalControl({
|
|
|
53842
53842
|
}
|
|
53843
53843
|
),
|
|
53844
53844
|
asking ? /* @__PURE__ */ (0, import_jsx_runtime181.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: [
|
|
53845
|
-
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)("p", { className: "text-xs text-muted-foreground", "data-testid": "portal-archive-consequence", children: (0,
|
|
53846
|
-
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)("p", { className: "text-xs text-muted-foreground", children: (0,
|
|
53845
|
+
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)("p", { className: "text-xs text-muted-foreground", "data-testid": "portal-archive-consequence", children: (0, import_records67.portalArchiveConsequence)(portal.title, portal.signed_in, portal.invited) }),
|
|
53846
|
+
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)("p", { className: "text-xs text-muted-foreground", children: (0, import_records67.portalConfirmLine)(portal.title) }),
|
|
53847
53847
|
/* @__PURE__ */ (0, import_jsx_runtime181.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
53848
53848
|
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)(
|
|
53849
53849
|
import_design_system156.BasicInput,
|
|
@@ -53861,7 +53861,7 @@ function ArchivePortalControl({
|
|
|
53861
53861
|
size: "sm",
|
|
53862
53862
|
variant: "destructive",
|
|
53863
53863
|
"data-testid": "portal-archive-do",
|
|
53864
|
-
disabled: busy || !(0,
|
|
53864
|
+
disabled: busy || !(0, import_records67.portalTitleTypedBack)(typed2, portal.title),
|
|
53865
53865
|
onClick: () => void go(),
|
|
53866
53866
|
children: busy ? "Archiving\u2026" : "Archive it"
|
|
53867
53867
|
}
|
|
@@ -54386,7 +54386,7 @@ function FormLookFrame({ look, title, children, contained = false, showOwnerHead
|
|
|
54386
54386
|
// src/DigestScheduler.tsx
|
|
54387
54387
|
var import_react320 = require("react");
|
|
54388
54388
|
var import_react321 = require("@ai-matrx/records/react");
|
|
54389
|
-
var
|
|
54389
|
+
var import_records68 = require("@ai-matrx/records");
|
|
54390
54390
|
var import_design_system158 = require("@ai-matrx/design-system");
|
|
54391
54391
|
var import_controls23 = require("@ai-matrx/design-system/controls");
|
|
54392
54392
|
init_Refusal();
|
|
@@ -54477,7 +54477,7 @@ function DigestScheduler({
|
|
|
54477
54477
|
const [channel, setChannel] = (0, import_react320.useState)(
|
|
54478
54478
|
existing?.channel === "email" || existing?.channel === "sms" ? existing.channel : "in_app"
|
|
54479
54479
|
);
|
|
54480
|
-
const [quiet2, setQuiet] = (0, import_react320.useState)((0,
|
|
54480
|
+
const [quiet2, setQuiet] = (0, import_react320.useState)((0, import_records68.hasQuietHours)(existing?.quiet_hours));
|
|
54481
54481
|
const [quietFrom, setQuietFrom] = (0, import_react320.useState)(existing?.quiet_hours?.start ?? "22:00");
|
|
54482
54482
|
const [quietTo, setQuietTo] = (0, import_react320.useState)(existing?.quiet_hours?.end ?? "07:00");
|
|
54483
54483
|
const [recipients, setRecipients] = (0, import_react320.useState)(
|
|
@@ -54768,7 +54768,7 @@ function DigestScheduler({
|
|
|
54768
54768
|
// src/SubscriptionsPanel.tsx
|
|
54769
54769
|
var import_react324 = require("react");
|
|
54770
54770
|
var import_react325 = require("@ai-matrx/records/react");
|
|
54771
|
-
var
|
|
54771
|
+
var import_records69 = require("@ai-matrx/records");
|
|
54772
54772
|
var import_design_system160 = require("@ai-matrx/design-system");
|
|
54773
54773
|
init_BuildOrAsk();
|
|
54774
54774
|
init_Refusal();
|
|
@@ -55138,7 +55138,7 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
|
|
|
55138
55138
|
"Last told you ",
|
|
55139
55139
|
new Date(subscription.last_sent_at).toLocaleString()
|
|
55140
55140
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime185.jsx)("span", { children: "It has not told you anything yet." }),
|
|
55141
|
-
(0,
|
|
55141
|
+
(0, import_records69.hasQuietHours)(subscription.quiet_hours) ? /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)("span", { children: [
|
|
55142
55142
|
"Not between ",
|
|
55143
55143
|
subscription.quiet_hours.start,
|
|
55144
55144
|
" and ",
|
|
@@ -55214,7 +55214,7 @@ var import_core25 = require("@dnd-kit/core");
|
|
|
55214
55214
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
55215
55215
|
var import_utilities2 = require("@dnd-kit/utilities");
|
|
55216
55216
|
var import_react332 = require("@ai-matrx/records/react");
|
|
55217
|
-
var
|
|
55217
|
+
var import_records70 = require("@ai-matrx/records");
|
|
55218
55218
|
var import_design_system165 = require("@ai-matrx/design-system");
|
|
55219
55219
|
|
|
55220
55220
|
// src/FormFlowEditor.tsx
|
|
@@ -56831,7 +56831,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
56831
56831
|
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(
|
|
56832
56832
|
PublishRow,
|
|
56833
56833
|
{
|
|
56834
|
-
url: `${publicOrigin}${(0,
|
|
56834
|
+
url: `${publicOrigin}${(0, import_records70.publicFormPath)(draft.id)}`,
|
|
56835
56835
|
state: draft.state,
|
|
56836
56836
|
mayPublish: rights.structure,
|
|
56837
56837
|
why: rights.why("structure"),
|
|
@@ -56843,7 +56843,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
56843
56843
|
unsaved: dirty
|
|
56844
56844
|
}
|
|
56845
56845
|
),
|
|
56846
|
-
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(EmbedSnippets, { url: `${publicOrigin}${(0,
|
|
56846
|
+
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(EmbedSnippets, { url: `${publicOrigin}${(0, import_records70.publicFormPath)(draft.id)}`, label: draft.name }),
|
|
56847
56847
|
/* @__PURE__ */ (0, import_jsx_runtime189.jsx)(
|
|
56848
56848
|
NotifyOnAnswer,
|
|
56849
56849
|
{
|
|
@@ -57786,7 +57786,7 @@ function SignBlock({ tableId, recordId, render, className }) {
|
|
|
57786
57786
|
// src/NotifyRuleEditor.tsx
|
|
57787
57787
|
var import_react338 = require("react");
|
|
57788
57788
|
var import_react339 = require("@ai-matrx/records/react");
|
|
57789
|
-
var
|
|
57789
|
+
var import_records71 = require("@ai-matrx/records");
|
|
57790
57790
|
var import_design_system168 = require("@ai-matrx/design-system");
|
|
57791
57791
|
var import_controls26 = require("@ai-matrx/design-system/controls");
|
|
57792
57792
|
init_Refusal();
|
|
@@ -57944,7 +57944,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
57944
57944
|
"next ",
|
|
57945
57945
|
new Date(held.next_digest_at).toLocaleString()
|
|
57946
57946
|
] }) : null,
|
|
57947
|
-
(0,
|
|
57947
|
+
(0, import_records71.hasQuietHours)(held.quiet_hours) ? /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
57948
57948
|
"quiet ",
|
|
57949
57949
|
held.quiet_hours.start,
|
|
57950
57950
|
"\u2013",
|
|
@@ -58343,7 +58343,7 @@ function AddChart({ subject, onAdd, onClose }) {
|
|
|
58343
58343
|
var import_controls28 = require("@ai-matrx/design-system/controls");
|
|
58344
58344
|
|
|
58345
58345
|
// src/pages.ts
|
|
58346
|
-
var
|
|
58346
|
+
var import_views9 = require("@ai-matrx/records/views");
|
|
58347
58347
|
var PAGE_BLOCK_KINDS = [
|
|
58348
58348
|
"list",
|
|
58349
58349
|
"layout",
|
|
@@ -58439,10 +58439,10 @@ function filterTargets(filter, blocks) {
|
|
|
58439
58439
|
}
|
|
58440
58440
|
function combineFilter(base2, extra, fieldIdOf) {
|
|
58441
58441
|
const extraKeys = Object.keys(extra);
|
|
58442
|
-
if (!base2 || !(0,
|
|
58442
|
+
if (!base2 || !(0, import_views9.isRuleFilter)(base2) && Object.keys(base2).length === 0) {
|
|
58443
58443
|
return { filter: extraKeys.length > 0 ? { ...extra } : null, dropped: [] };
|
|
58444
58444
|
}
|
|
58445
|
-
if (!(0,
|
|
58445
|
+
if (!(0, import_views9.isRuleFilter)(base2)) return { filter: { ...base2, ...extra }, dropped: [] };
|
|
58446
58446
|
const dropped = [];
|
|
58447
58447
|
let rule = base2;
|
|
58448
58448
|
for (const key of extraKeys) {
|
|
@@ -59838,7 +59838,7 @@ function QuestionAnswerView({ tableId, spec, answer, fields, related = NO_RELATE
|
|
|
59838
59838
|
// src/TableAsk.tsx
|
|
59839
59839
|
var import_react346 = require("react");
|
|
59840
59840
|
var import_design_system173 = require("@ai-matrx/design-system");
|
|
59841
|
-
var
|
|
59841
|
+
var import_records72 = require("@ai-matrx/records");
|
|
59842
59842
|
var import_react347 = require("@ai-matrx/records/react");
|
|
59843
59843
|
init_recordVersions();
|
|
59844
59844
|
|
|
@@ -60087,7 +60087,7 @@ function TableAsk({ tableId, onOpenInQuestions, viewId }) {
|
|
|
60087
60087
|
await Promise.all(
|
|
60088
60088
|
all.filter(isChoiceField).map(async (field2) => {
|
|
60089
60089
|
const got = await (0, askOnce_exports.fieldOptionsOnce)(client, field2.id);
|
|
60090
|
-
if (got.ok) choices[field2.key] = (got.data ?? []).map((o) => (0,
|
|
60090
|
+
if (got.ok) choices[field2.key] = (got.data ?? []).map((o) => (0, import_records72.optionLabel)(o)).filter((w) => Boolean(w));
|
|
60091
60091
|
})
|
|
60092
60092
|
);
|
|
60093
60093
|
const read = questionFromWords(words2, all, choices);
|
|
@@ -61999,7 +61999,7 @@ function InterfaceScreen({
|
|
|
61999
61999
|
var import_clipboard12 = require("@ai-matrx/kit/clipboard");
|
|
62000
62000
|
var import_react354 = require("react");
|
|
62001
62001
|
var import_react355 = require("@ai-matrx/records/react");
|
|
62002
|
-
var
|
|
62002
|
+
var import_records73 = require("@ai-matrx/records");
|
|
62003
62003
|
var import_design_system177 = require("@ai-matrx/design-system");
|
|
62004
62004
|
init_BuildOrAsk();
|
|
62005
62005
|
init_BuiltOnArchive();
|
|
@@ -62115,7 +62115,7 @@ function FormsPanel({ tableId, activeFormId, asView = false, className }) {
|
|
|
62115
62115
|
}
|
|
62116
62116
|
) : null,
|
|
62117
62117
|
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)("ul", { className: "flex flex-col gap-2", children: forms.map((form) => {
|
|
62118
|
-
const url = `${origin}${(0,
|
|
62118
|
+
const url = `${origin}${(0, import_records73.publicFormPath)(form.form_id)}`;
|
|
62119
62119
|
return /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
62120
62120
|
"li",
|
|
62121
62121
|
{
|
|
@@ -62206,7 +62206,7 @@ init_plainWords();
|
|
|
62206
62206
|
|
|
62207
62207
|
// src/CaptureRun.tsx
|
|
62208
62208
|
var import_react356 = require("react");
|
|
62209
|
-
var
|
|
62209
|
+
var import_records74 = require("@ai-matrx/records");
|
|
62210
62210
|
var import_react357 = require("@ai-matrx/records/react");
|
|
62211
62211
|
var import_design_system178 = require("@ai-matrx/design-system");
|
|
62212
62212
|
init_host();
|
|
@@ -62273,7 +62273,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
62273
62273
|
const [sending, setSending] = (0, import_react356.useState)(false);
|
|
62274
62274
|
const queueRef = (0, import_react356.useRef)(null);
|
|
62275
62275
|
(0, import_react356.useEffect)(() => {
|
|
62276
|
-
const q2 = (0,
|
|
62276
|
+
const q2 = (0, import_records74.openCaptureQueue)({
|
|
62277
62277
|
onChange: (c, all) => {
|
|
62278
62278
|
setCounts(c);
|
|
62279
62279
|
setItems(all);
|
|
@@ -62543,7 +62543,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
62543
62543
|
value: String(answers2[q.field] ?? ""),
|
|
62544
62544
|
onChange: (e) => {
|
|
62545
62545
|
const raw = e.target.value;
|
|
62546
|
-
const answered2 = field2 ? (0,
|
|
62546
|
+
const answered2 = field2 ? (0, import_records74.coerceTypedAnswer)(field2, raw, { label: q.ask ?? (0, import_records74.coercionLabel)(field2) }) : { value: raw };
|
|
62547
62547
|
setAnswers((held) => ({
|
|
62548
62548
|
...held,
|
|
62549
62549
|
[q.field]: raw === "" ? "" : "refusal" in answered2 ? raw : answered2.value
|
|
@@ -63209,7 +63209,7 @@ init_WhereItLives();
|
|
|
63209
63209
|
// src/TablePage.tsx
|
|
63210
63210
|
var import_clipboard17 = require("@ai-matrx/kit/clipboard");
|
|
63211
63211
|
var import_react377 = require("react");
|
|
63212
|
-
var
|
|
63212
|
+
var import_records75 = require("@ai-matrx/records");
|
|
63213
63213
|
var import_react378 = require("@ai-matrx/records/react");
|
|
63214
63214
|
var import_design_system190 = require("@ai-matrx/design-system");
|
|
63215
63215
|
init_names();
|
|
@@ -64456,7 +64456,7 @@ function TableNotHere({
|
|
|
64456
64456
|
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: (0, import_design_system190.cn)("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
64457
64457
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "text-sm font-medium", children: "This table is archived" }),
|
|
64458
64458
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
|
|
64459
|
-
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "text-xs text-muted-foreground", children: (0,
|
|
64459
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("p", { className: "text-xs text-muted-foreground", children: (0, import_records75.archivedByLine)(row) }),
|
|
64460
64460
|
refusal3 ? /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(RefusalNotice, { error: refusal3 }) : null,
|
|
64461
64461
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex gap-2", children: [
|
|
64462
64462
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
@@ -64563,7 +64563,7 @@ function unknownRailLine(raw) {
|
|
|
64563
64563
|
}
|
|
64564
64564
|
var SHARE_NOT_YOURS_LINE = "The link asked to open this table's sharing, and only someone with Full access on this table can share it, so it did not open. Ask someone with Full access on this table to share it or to give you Full access.";
|
|
64565
64565
|
function openingView(activeView, activeDashboardId) {
|
|
64566
|
-
const named = (0,
|
|
64566
|
+
const named = (0, import_views3.pageViewFromParam)(activeView);
|
|
64567
64567
|
if (named === null) {
|
|
64568
64568
|
const asked4 = typeof activeView === "string" ? activeView.trim() : "";
|
|
64569
64569
|
return {
|
|
@@ -64666,7 +64666,7 @@ function TablePage({
|
|
|
64666
64666
|
const [view, setView] = (0, import_react377.useState)(() => {
|
|
64667
64667
|
if (!seededViews || seededViews.length === 0) return null;
|
|
64668
64668
|
const asked4 = savedViewFromParam(activeView);
|
|
64669
|
-
return seededViews.find((v) => v.id === asked4) ?? (0,
|
|
64669
|
+
return seededViews.find((v) => v.id === asked4) ?? (0, import_views3.defaultViewOf)(seededViews) ?? seededViews[0];
|
|
64670
64670
|
});
|
|
64671
64671
|
const [looks, setLooks] = (0, import_react377.useState)(() => seededViews ? seededOpening?.looks : void 0);
|
|
64672
64672
|
const looksSeededFor = (0, import_react377.useRef)(seededViews && seededOpening ? tableId : null);
|
|
@@ -64686,7 +64686,7 @@ function TablePage({
|
|
|
64686
64686
|
};
|
|
64687
64687
|
}, [client, tableId]);
|
|
64688
64688
|
const look = view && looks ? looks[view.id] : void 0;
|
|
64689
|
-
const shown5 = view ? (0,
|
|
64689
|
+
const shown5 = view ? (0, import_views4.applyLook)(view, look) : null;
|
|
64690
64690
|
const [viewsEpoch, setViewsEpoch] = (0, import_react377.useState)(0);
|
|
64691
64691
|
const opening = openingRail(activeRecordId, activeRail);
|
|
64692
64692
|
const recordsUi = useRecordsUi();
|
|
@@ -64819,7 +64819,7 @@ function TablePage({
|
|
|
64819
64819
|
(k) => look[k] !== void 0 && !(k === "groupField" && activeGroupField) && !(k === "layout" && layoutFromLink)
|
|
64820
64820
|
) : [],
|
|
64821
64821
|
fromAddress: [...layoutFromLink ? ["layout"] : [], ...activeGroupField ? ["groupField"] : []],
|
|
64822
|
-
lookDiffers: view ? (0,
|
|
64822
|
+
lookDiffers: view ? (0, import_views4.lookDiffers)(view, look) : false
|
|
64823
64823
|
};
|
|
64824
64824
|
const shownSignature = JSON.stringify(shownReport);
|
|
64825
64825
|
const reportRef = (0, import_react377.useRef)(onShownViewChange);
|
|
@@ -64877,7 +64877,7 @@ function TablePage({
|
|
|
64877
64877
|
setSurface((now) => ({ ...now, main: "form" }));
|
|
64878
64878
|
return;
|
|
64879
64879
|
}
|
|
64880
|
-
const named = (0,
|
|
64880
|
+
const named = (0, import_views3.pageViewFromParam)(activeView);
|
|
64881
64881
|
if (named === null) return;
|
|
64882
64882
|
const isLayout = named !== "dashboards" && named !== "archived";
|
|
64883
64883
|
setLayoutFromLink(isLayout ? named : null);
|
|
@@ -64905,7 +64905,7 @@ function TablePage({
|
|
|
64905
64905
|
async (asked4) => {
|
|
64906
64906
|
const current = view;
|
|
64907
64907
|
if (!current) return;
|
|
64908
|
-
const part = (0,
|
|
64908
|
+
const part = (0, import_views4.lookPart)(asked4);
|
|
64909
64909
|
if (Object.keys(part).length === 0) return;
|
|
64910
64910
|
const before = looks?.[current.id];
|
|
64911
64911
|
const next = { ...before ?? {}, ...part };
|
|
@@ -64964,7 +64964,7 @@ function TablePage({
|
|
|
64964
64964
|
addressReportRef.current?.(isViewAddressEmpty(addressNow) ? null : addressNow);
|
|
64965
64965
|
}, [addressReady, addressSignature]);
|
|
64966
64966
|
const queryShowing = !isViewAddressEmpty({ ...gridQuery ?? {}, hidden: [] });
|
|
64967
|
-
const lookShowing = Boolean(view && looks && ((0,
|
|
64967
|
+
const lookShowing = Boolean(view && looks && ((0, import_views4.lookDiffers)(view, looks[view.id]) || queryShowing));
|
|
64968
64968
|
const [lookRefused, setLookRefused] = (0, import_react377.useState)(null);
|
|
64969
64969
|
const [namingLook, setNamingLook] = (0, import_react377.useState)(false);
|
|
64970
64970
|
const [lookName, setLookName] = (0, import_react377.useState)("");
|
|
@@ -64996,7 +64996,7 @@ function TablePage({
|
|
|
64996
64996
|
return;
|
|
64997
64997
|
}
|
|
64998
64998
|
setLookRefused(null);
|
|
64999
|
-
const { patch, left } = (0,
|
|
64999
|
+
const { patch, left } = (0, import_views4.saveToViewPlan)(current, mine);
|
|
65000
65000
|
if (Object.keys(viewPatchDocument(patch)).length > 0) {
|
|
65001
65001
|
const written = await saveViewPatch(client, tableId, current.id, patch);
|
|
65002
65002
|
if (!written.ok) {
|
|
@@ -65035,9 +65035,9 @@ function TablePage({
|
|
|
65035
65035
|
const [designateRefused, setDesignateRefused] = (0, import_react377.useState)(null);
|
|
65036
65036
|
const opensAs = view?.isDefault ? view.layout : null;
|
|
65037
65037
|
const canDesignate = Boolean(
|
|
65038
|
-
rights.organise && view && layoutShowing && layoutShowing !== opensAs && (0,
|
|
65038
|
+
rights.organise && view && layoutShowing && layoutShowing !== opensAs && (0, import_views3.storeKeepsLayout)(layoutShowing)
|
|
65039
65039
|
);
|
|
65040
|
-
const layoutShowingLabel = layoutShowing ?
|
|
65040
|
+
const layoutShowingLabel = layoutShowing ? import_views3.LAYOUT_LABEL[layoutShowing] : main === "form" ? FORM_LAYOUT_LABEL : "";
|
|
65041
65041
|
const designate = async () => {
|
|
65042
65042
|
const current = view;
|
|
65043
65043
|
if (!current || !layoutShowing) return;
|
|
@@ -65046,7 +65046,7 @@ function TablePage({
|
|
|
65046
65046
|
return;
|
|
65047
65047
|
}
|
|
65048
65048
|
setDesignateRefused(null);
|
|
65049
|
-
const written = await (0,
|
|
65049
|
+
const written = await (0, import_views3.designateView)(client, tableId, current.id, layoutShowing);
|
|
65050
65050
|
if (!written.ok) {
|
|
65051
65051
|
setDesignateRefused(written.error);
|
|
65052
65052
|
return;
|
|
@@ -65066,17 +65066,17 @@ function TablePage({
|
|
|
65066
65066
|
go({ main: "form" });
|
|
65067
65067
|
return;
|
|
65068
65068
|
}
|
|
65069
|
-
if (
|
|
65069
|
+
if (import_views3.VIEW_LAYOUTS.includes(value)) pickLayout(value);
|
|
65070
65070
|
},
|
|
65071
65071
|
children: [
|
|
65072
|
-
|
|
65072
|
+
import_views3.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_design_system190.DropdownMenuRadioItem, { value: option, children: import_views3.LAYOUT_LABEL[option] }, option)),
|
|
65073
65073
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_design_system190.DropdownMenuRadioItem, { value: FORM_LAYOUT, "data-layout-form": "", children: FORM_LAYOUT_LABEL })
|
|
65074
65074
|
]
|
|
65075
65075
|
}
|
|
65076
65076
|
);
|
|
65077
65077
|
const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(import_jsx_runtime215.Fragment, { children: [
|
|
65078
65078
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("div", { className: "flex items-center gap-2 text-xs", "data-table-sheet-filter": "", "data-matrx-table-tools-keep-open": "", children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(ViewFilter, { tableId, view: shown5, withheldKeys, onApply: (where) => void patchView({ where }) }) }),
|
|
65079
|
-
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("div", { role: "group", "aria-label": "Layout", className: "flex flex-wrap gap-1 pt-1", "data-table-sheet-layout": "", children:
|
|
65079
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)("div", { role: "group", "aria-label": "Layout", className: "flex flex-wrap gap-1 pt-1", "data-table-sheet-layout": "", children: import_views3.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
65080
65080
|
import_design_system190.Button,
|
|
65081
65081
|
{
|
|
65082
65082
|
size: "sm",
|
|
@@ -65084,7 +65084,7 @@ function TablePage({
|
|
|
65084
65084
|
"aria-pressed": layoutShowing === option,
|
|
65085
65085
|
className: "h-8 !w-auto",
|
|
65086
65086
|
onClick: () => pickLayout(option),
|
|
65087
|
-
children:
|
|
65087
|
+
children: import_views3.LAYOUT_LABEL[option]
|
|
65088
65088
|
},
|
|
65089
65089
|
option
|
|
65090
65090
|
)) }),
|
|
@@ -65418,7 +65418,7 @@ function TablePage({
|
|
|
65418
65418
|
] });
|
|
65419
65419
|
}
|
|
65420
65420
|
const lookSavable = Boolean(
|
|
65421
|
-
rights.write && view && Object.keys(viewPatchDocument((0,
|
|
65421
|
+
rights.write && view && Object.keys(viewPatchDocument((0, import_views4.saveToViewPlan)(view, look ?? {}).patch)).length > 0
|
|
65422
65422
|
);
|
|
65423
65423
|
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(ViewAddressContext.Provider, { value: addressPort, children: [
|
|
65424
65424
|
/* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: (0, import_design_system190.cn)("flex h-full min-h-0 gap-4", className), "data-table-footer": footer, children: [
|
|
@@ -65452,7 +65452,7 @@ function TablePage({
|
|
|
65452
65452
|
if (before !== null && before !== next.id) {
|
|
65453
65453
|
setViewLinkMissed(false);
|
|
65454
65454
|
setPickedViewId(next.id);
|
|
65455
|
-
onViewChanged?.(addressForView(next, (0,
|
|
65455
|
+
onViewChanged?.(addressForView(next, (0, import_views4.applyLook)(next, looks?.[next.id]).layout ?? "grid"));
|
|
65456
65456
|
}
|
|
65457
65457
|
},
|
|
65458
65458
|
onViews: setViews,
|
|
@@ -65498,14 +65498,14 @@ function TablePage({
|
|
|
65498
65498
|
viewsEpoch
|
|
65499
65499
|
),
|
|
65500
65500
|
chooserInline ? /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("div", { className: "flex shrink-0 items-center gap-0.5", role: "group", "aria-label": "Layout", "data-toolbar-fit": "chooser", children: [
|
|
65501
|
-
|
|
65501
|
+
import_views3.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
65502
65502
|
import_design_system190.Button,
|
|
65503
65503
|
{
|
|
65504
65504
|
size: "sm",
|
|
65505
65505
|
variant: layoutShowing === option ? "secondary" : "ghost",
|
|
65506
65506
|
"aria-pressed": layoutShowing === option,
|
|
65507
65507
|
onClick: () => pickLayout(option),
|
|
65508
|
-
children:
|
|
65508
|
+
children: import_views3.LAYOUT_LABEL[option]
|
|
65509
65509
|
},
|
|
65510
65510
|
option
|
|
65511
65511
|
)),
|
|
@@ -65710,7 +65710,7 @@ function TablePage({
|
|
|
65710
65710
|
children: [
|
|
65711
65711
|
railUnknown ? /* @__PURE__ */ (0, import_jsx_runtime215.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: unknownRailLine(railUnknown) }) : null,
|
|
65712
65712
|
shareFromLink && rights.known && (!rights.share || !canShare) ? /* @__PURE__ */ (0, import_jsx_runtime215.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: canShare ? SHARE_NOT_YOURS_LINE : shareUnavailableReason() }) : null,
|
|
65713
|
-
opened.unknown ? /* @__PURE__ */ (0, import_jsx_runtime215.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: (0,
|
|
65713
|
+
opened.unknown ? /* @__PURE__ */ (0, import_jsx_runtime215.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: (0, import_views3.unknownViewLine)(opened.unknown) }) : null,
|
|
65714
65714
|
viewLinkMissed ? /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
65715
65715
|
"p",
|
|
65716
65716
|
{
|
|
@@ -66214,7 +66214,7 @@ init_objectActionIcons();
|
|
|
66214
66214
|
|
|
66215
66215
|
// src/DataBindingPicker.tsx
|
|
66216
66216
|
var import_react381 = require("react");
|
|
66217
|
-
var
|
|
66217
|
+
var import_records76 = require("@ai-matrx/records");
|
|
66218
66218
|
var import_react382 = require("@ai-matrx/records/react");
|
|
66219
66219
|
var import_design_system193 = require("@ai-matrx/design-system");
|
|
66220
66220
|
init_names();
|
|
@@ -66249,7 +66249,7 @@ function isCompleteDataBinding(binding) {
|
|
|
66249
66249
|
}
|
|
66250
66250
|
function bindingPlaceholdersFor(field2) {
|
|
66251
66251
|
const label = fieldName(field2);
|
|
66252
|
-
if ((0,
|
|
66252
|
+
if ((0, import_records76.isEntityReferenceConfig)(field2.config)) {
|
|
66253
66253
|
return [
|
|
66254
66254
|
{ token: `{${field2.key}.name}`, label: `${label} \xB7 name` },
|
|
66255
66255
|
{ token: `{${field2.key}.id}`, label: `${label} \xB7 id` }
|