@ai-matrx/records-ui 0.116.44 → 0.116.46
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 +36 -1
- package/dist/{SaveToTable-EGBEB5WG.js → SaveToTable-SWB2ZN5X.js} +3 -3
- package/dist/{chunk-CV4D2BZY.js → chunk-UTMV5ES2.js} +5 -5
- package/dist/{chunk-CV4D2BZY.js.map → chunk-UTMV5ES2.js.map} +1 -1
- package/dist/{chunk-KP2R7LVO.js → chunk-Y5QOV3XA.js} +79 -76
- package/dist/chunk-Y5QOV3XA.js.map +1 -0
- package/dist/{chunk-KEILC5XG.js → chunk-ZUQUZOL5.js} +43 -20
- package/dist/chunk-ZUQUZOL5.js.map +1 -0
- package/dist/helpers.cjs +6 -4
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +6 -4
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +2392 -2332
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +240 -210
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +565 -538
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-KEILC5XG.js.map +0 -1
- package/dist/chunk-KP2R7LVO.js.map +0 -1
- /package/dist/{SaveToTable-EGBEB5WG.js.map → SaveToTable-SWB2ZN5X.js.map} +0 -0
package/dist/pickers.cjs
CHANGED
|
@@ -173,21 +173,22 @@ function exampleOf(error) {
|
|
|
173
173
|
}
|
|
174
174
|
function refusalForAPerson(error) {
|
|
175
175
|
const code = error.code ?? "internal";
|
|
176
|
+
const timedOut = code === "timed_out" || error.sqlstate === "57014" || /canceling statement due to statement timeout/i.test(String(error.message ?? ""));
|
|
176
177
|
const ours = error.ours === true;
|
|
177
178
|
const hint = plainSentence(String(error.hint ?? ""));
|
|
178
179
|
const message = ours ? plainSentence(String(error.message ?? "")) : peopleSentence(String(error.message ?? ""));
|
|
179
|
-
const title = TITLE[code] ?? "That was refused";
|
|
180
|
+
const title = timedOut ? TITLE["timed_out"] : TITLE[code] ?? "That was refused";
|
|
180
181
|
const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
|
|
181
182
|
const example = exampleOf(error);
|
|
182
|
-
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? REMEDY[code] ?? REMEDY["internal"];
|
|
183
|
+
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
|
|
183
184
|
const messageIsForEngineers = isEngineerText(String(error.message ?? ""));
|
|
184
|
-
const said2 = (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
185
|
+
const said2 = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
185
186
|
const forEngineers = [
|
|
186
187
|
error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,
|
|
187
188
|
// The client's own note about a class it did not recognize, or a call that
|
|
188
189
|
// never reached the store. It is rendered out of sight, never as a sentence.
|
|
189
190
|
error.diagnostic ? error.diagnostic : null,
|
|
190
|
-
messageIsForEngineers ? `Message: ${error.message}` : null,
|
|
191
|
+
messageIsForEngineers || timedOut ? `Message: ${error.message}` : null,
|
|
191
192
|
error.hint && (hintIsForEngineers || hint.kept !== error.hint) ? `Hint: ${error.hint}` : null,
|
|
192
193
|
message.dropped.length > 0 || hint.dropped.length > 0 ? `Dropped from the person's view: ${[...message.dropped, ...hint.dropped].join(" | ")}` : null
|
|
193
194
|
].filter(Boolean).join(" ");
|
|
@@ -211,7 +212,7 @@ function refusalLineForAPerson(error) {
|
|
|
211
212
|
function refusalIsMissingInput(error) {
|
|
212
213
|
return error.sqlstate === "22023" || error.code === "invalid_argument";
|
|
213
214
|
}
|
|
214
|
-
var MACHINE_IDENTITY, TITLE, REMEDY, ENGINEER_TEXT;
|
|
215
|
+
var MACHINE_IDENTITY, TITLE, REMEDY, ENGINEER_TEXT, TIMED_OUT_SAID;
|
|
215
216
|
var init_plainWords = __esm({
|
|
216
217
|
"src/plainWords.ts"() {
|
|
217
218
|
"use strict";
|
|
@@ -294,6 +295,7 @@ var init_plainWords = __esm({
|
|
|
294
295
|
// the app, arriving on the screen of somebody who cannot act on it.
|
|
295
296
|
/\bbind\s+[`'"A-Za-z]/i
|
|
296
297
|
];
|
|
298
|
+
TIMED_OUT_SAID = "This took too long. Please try again.";
|
|
297
299
|
}
|
|
298
300
|
});
|
|
299
301
|
|
|
@@ -521,6 +523,18 @@ var init_ArchivedOrganizationNotice = __esm({
|
|
|
521
523
|
}
|
|
522
524
|
});
|
|
523
525
|
|
|
526
|
+
// src/refusalSaid.ts
|
|
527
|
+
function refusalTimedOut(error) {
|
|
528
|
+
return (0, import_design_system3.isTimedOutError)(error);
|
|
529
|
+
}
|
|
530
|
+
var import_design_system3;
|
|
531
|
+
var init_refusalSaid = __esm({
|
|
532
|
+
"src/refusalSaid.ts"() {
|
|
533
|
+
"use strict";
|
|
534
|
+
import_design_system3 = require("@ai-matrx/design-system");
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
|
|
524
538
|
// src/Refusal.tsx
|
|
525
539
|
function RefusalNotice({
|
|
526
540
|
error,
|
|
@@ -534,7 +548,8 @@ function RefusalNotice({
|
|
|
534
548
|
if (archivedOrg) {
|
|
535
549
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ArchivedOrganizationNotice, { organizationId: archivedOrg, error, className });
|
|
536
550
|
}
|
|
537
|
-
const
|
|
551
|
+
const said2 = refusalForAPerson(error);
|
|
552
|
+
const plain = refusalTimedOut(error) ? { ...said2, sentence: import_design_system4.TIMED_OUT_SENTENCE, storeSaid: true } : said2;
|
|
538
553
|
const doors = onKeepEditing || onDiscard || onRetry ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-wrap items-center gap-1 pt-0.5", "data-refusal-doors": "", children: [
|
|
539
554
|
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
540
555
|
"button",
|
|
@@ -568,18 +583,18 @@ function RefusalNotice({
|
|
|
568
583
|
) : null
|
|
569
584
|
] }) : null;
|
|
570
585
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
571
|
-
|
|
586
|
+
import_design_system4.Alert,
|
|
572
587
|
{
|
|
573
588
|
variant: "destructive",
|
|
574
589
|
role: "alert",
|
|
575
590
|
"data-refusal-notice": "",
|
|
576
|
-
className: (0,
|
|
591
|
+
className: (0, import_design_system4.cn)("text-xs", className),
|
|
577
592
|
errorFacts: { message: plain.sentence, title: plain.title, error, origin: "records-ui/RefusalNotice" },
|
|
578
593
|
...plain.forEngineers ? { "data-for-engineers": plain.forEngineers } : {},
|
|
579
594
|
...error.sqlstate ? { "data-sqlstate": error.sqlstate } : {},
|
|
580
595
|
children: [
|
|
581
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
582
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system4.AlertTitle, { className: "text-xs font-medium", children: plain.storeSaid ? plain.sentence : plain.title }),
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system4.AlertDescription, { className: "space-y-1 text-xs", children: [
|
|
583
598
|
plain.storeSaid || plain.sentence.replace(/\.$/, "") === plain.title ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: plain.sentence }),
|
|
584
599
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "opacity-80", children: plain.remedy }),
|
|
585
600
|
actions,
|
|
@@ -589,29 +604,39 @@ function RefusalNotice({
|
|
|
589
604
|
}
|
|
590
605
|
);
|
|
591
606
|
}
|
|
592
|
-
function RefusalLine({
|
|
607
|
+
function RefusalLine({
|
|
608
|
+
error,
|
|
609
|
+
className,
|
|
610
|
+
onRetry
|
|
611
|
+
}) {
|
|
593
612
|
const plain = refusalForAPerson(error);
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
613
|
+
const timedOut = refusalTimedOut(error);
|
|
614
|
+
const line = timedOut ? import_design_system4.TIMED_OUT_SENTENCE : refusalLineForAPerson(error);
|
|
615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
617
|
+
import_design_system4.ErrorBox,
|
|
618
|
+
{
|
|
619
|
+
"data-refusal-line": "",
|
|
620
|
+
className: (0, import_design_system4.cn)("whitespace-normal break-words text-xs text-destructive [overflow-wrap:anywhere]", className),
|
|
621
|
+
message: (0, import_core.archivedOrganizationId)(error) ? "This organization is archived. An owner can restore it." : line,
|
|
622
|
+
error,
|
|
623
|
+
origin: "records-ui/RefusalLine",
|
|
624
|
+
...plain.forEngineers ? { "data-for-engineers": plain.forEngineers } : {}
|
|
625
|
+
}
|
|
626
|
+
),
|
|
627
|
+
timedOut && onRetry ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "data-refusal-retry": "", className: "rounded border px-2 py-0.5 text-xs hover:bg-muted", onClick: onRetry, children: "Try again" }) : null
|
|
628
|
+
] });
|
|
605
629
|
}
|
|
606
|
-
var import_core,
|
|
630
|
+
var import_core, import_design_system4, import_jsx_runtime4;
|
|
607
631
|
var init_Refusal = __esm({
|
|
608
632
|
"src/Refusal.tsx"() {
|
|
609
633
|
"use strict";
|
|
610
634
|
"use client";
|
|
611
635
|
import_core = require("@ai-matrx/records/core");
|
|
612
|
-
|
|
636
|
+
import_design_system4 = require("@ai-matrx/design-system");
|
|
613
637
|
init_ArchivedOrganizationNotice();
|
|
614
638
|
init_plainWords();
|
|
639
|
+
init_refusalSaid();
|
|
615
640
|
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
616
641
|
}
|
|
617
642
|
});
|
|
@@ -885,7 +910,7 @@ function PersonAvatar({ name, size = "sm" }) {
|
|
|
885
910
|
{
|
|
886
911
|
"aria-hidden": "true",
|
|
887
912
|
"data-records-person-avatar": "",
|
|
888
|
-
className: (0,
|
|
913
|
+
className: (0, import_design_system7.cn)(
|
|
889
914
|
"inline-flex shrink-0 items-center justify-center rounded-full bg-foreground/10 font-medium text-foreground/80",
|
|
890
915
|
size === "md" ? "size-5 text-[10px]" : "size-4 text-[9px]"
|
|
891
916
|
),
|
|
@@ -899,7 +924,7 @@ function PersonChip({ name, onRemove, onOpen, className }) {
|
|
|
899
924
|
{
|
|
900
925
|
"data-records-person-chip": "",
|
|
901
926
|
title: name,
|
|
902
|
-
className: (0,
|
|
927
|
+
className: (0, import_design_system7.cn)("inline-flex min-w-0 max-w-full items-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-foreground", className),
|
|
903
928
|
children: [
|
|
904
929
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PersonAvatar, { name }),
|
|
905
930
|
onOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: onOpen, "data-records-person-open": "", className: "min-w-0 truncate hover:underline", children: name }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "min-w-0 truncate", children: name }),
|
|
@@ -908,12 +933,12 @@ function PersonChip({ name, onRemove, onOpen, className }) {
|
|
|
908
933
|
}
|
|
909
934
|
);
|
|
910
935
|
}
|
|
911
|
-
var
|
|
936
|
+
var import_design_system7, import_format, import_jsx_runtime7, PERSON_INITIALS;
|
|
912
937
|
var init_personChip = __esm({
|
|
913
938
|
"src/personChip.tsx"() {
|
|
914
939
|
"use strict";
|
|
915
940
|
"use client";
|
|
916
|
-
|
|
941
|
+
import_design_system7 = require("@ai-matrx/design-system");
|
|
917
942
|
import_format = require("@ai-matrx/kit/format");
|
|
918
943
|
import_jsx_runtime7 = require("react/jsx-runtime");
|
|
919
944
|
PERSON_INITIALS = { splitHandles: true, dropHonorifics: true };
|
|
@@ -990,7 +1015,7 @@ function PickRow({
|
|
|
990
1015
|
title: title ?? label,
|
|
991
1016
|
...attrs ?? {},
|
|
992
1017
|
"data-pick-highlighted": highlighted ? "" : void 0,
|
|
993
|
-
className: (0,
|
|
1018
|
+
className: (0, import_design_system8.cn)(
|
|
994
1019
|
"flex w-full min-w-0 items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none disabled:opacity-50",
|
|
995
1020
|
highlighted ? "bg-accent text-accent-foreground" : ""
|
|
996
1021
|
),
|
|
@@ -1001,7 +1026,7 @@ function PickRow({
|
|
|
1001
1026
|
] }),
|
|
1002
1027
|
person ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PersonAvatar, { name: label, size: "md" }) : null,
|
|
1003
1028
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
1004
|
-
chip ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: (0,
|
|
1029
|
+
chip ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: (0, import_design_system8.cn)("inline-flex max-w-full truncate rounded-md border px-1.5 py-0.5 text-xs font-medium", chip), "data-records-choice-chip": "", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block truncate", children: label }),
|
|
1005
1030
|
detail ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "block truncate text-xs text-muted-foreground", "data-tell-apart": "", children: detail }) : null
|
|
1006
1031
|
] })
|
|
1007
1032
|
]
|
|
@@ -1016,7 +1041,7 @@ function PickChips({ chips }) {
|
|
|
1016
1041
|
{
|
|
1017
1042
|
"data-pick-chip": "",
|
|
1018
1043
|
title: c.label,
|
|
1019
|
-
className: (0,
|
|
1044
|
+
className: (0, import_design_system8.cn)(
|
|
1020
1045
|
"inline-flex max-w-full items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-medium",
|
|
1021
1046
|
c.chip ?? "bg-secondary text-secondary-foreground"
|
|
1022
1047
|
),
|
|
@@ -1097,10 +1122,10 @@ function PickOrAdd({
|
|
|
1097
1122
|
onPoint: () => keys.setHighlight(addAt)
|
|
1098
1123
|
}
|
|
1099
1124
|
) : null;
|
|
1100
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1101
|
-
anchored ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system8.Popover, { open, onOpenChange, children: [
|
|
1126
|
+
anchored ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system8.PopoverAnchor, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-pick-anchor": "", className: "flex min-h-6 w-full min-w-0 flex-wrap items-center gap-1", "aria-label": triggerLabel, children }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system8.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system8.Button, { id: triggerId, type: "button", size: "sm", variant: "outline", className: triggerSize === "field" ? "h-9" : void 0, "aria-label": triggerLabel, children: triggerText }) }),
|
|
1102
1127
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1103
|
-
|
|
1128
|
+
import_design_system8.PopoverContent,
|
|
1104
1129
|
{
|
|
1105
1130
|
sizing: "content",
|
|
1106
1131
|
padding: "xs",
|
|
@@ -1123,7 +1148,7 @@ function PickOrAdd({
|
|
|
1123
1148
|
children: [
|
|
1124
1149
|
chips ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PickChips, { chips }) : null,
|
|
1125
1150
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1126
|
-
|
|
1151
|
+
import_design_system8.BasicInput,
|
|
1127
1152
|
{
|
|
1128
1153
|
value: search,
|
|
1129
1154
|
onChange: (e) => onSearch(e.target.value),
|
|
@@ -1136,7 +1161,7 @@ function PickOrAdd({
|
|
|
1136
1161
|
}
|
|
1137
1162
|
),
|
|
1138
1163
|
notice,
|
|
1139
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system8.ScrollArea, { className: "max-h-64", children: [
|
|
1140
1165
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { role: "listbox", "aria-label": triggerLabel, "aria-multiselectable": multi ? true : void 0, children: [
|
|
1141
1166
|
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1142
1167
|
PickRow,
|
|
@@ -1168,14 +1193,14 @@ function PickOrAdd({
|
|
|
1168
1193
|
)
|
|
1169
1194
|
] });
|
|
1170
1195
|
}
|
|
1171
|
-
var import_react9,
|
|
1196
|
+
var import_react9, import_design_system8, import_jsx_runtime8, TICK, CROSS, PLUS;
|
|
1172
1197
|
var init_PickOrAdd = __esm({
|
|
1173
1198
|
"src/PickOrAdd.tsx"() {
|
|
1174
1199
|
"use strict";
|
|
1175
1200
|
"use client";
|
|
1176
1201
|
import_react9 = require("react");
|
|
1177
1202
|
init_personChip();
|
|
1178
|
-
|
|
1203
|
+
import_design_system8 = require("@ai-matrx/design-system");
|
|
1179
1204
|
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1180
1205
|
TICK = "m5 12 4 4L19 6";
|
|
1181
1206
|
CROSS = "M18 6 6 18M6 6l12 12";
|
|
@@ -1285,14 +1310,14 @@ function ShowListsToggle({
|
|
|
1285
1310
|
className
|
|
1286
1311
|
}) {
|
|
1287
1312
|
if (count === 0) return null;
|
|
1288
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: (0,
|
|
1289
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: (0, import_design_system11.cn)("flex items-center gap-1.5 text-[11px] text-muted-foreground", className), children: [
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system11.Checkbox, { checked: on, onCheckedChange: (next) => onChange(next === true), "aria-label": "Show lists" }),
|
|
1290
1315
|
"Show lists (",
|
|
1291
1316
|
count,
|
|
1292
1317
|
")"
|
|
1293
1318
|
] });
|
|
1294
1319
|
}
|
|
1295
|
-
var import_react13, import_records4, import_react14,
|
|
1320
|
+
var import_react13, import_records4, import_react14, import_design_system11, import_jsx_runtime12;
|
|
1296
1321
|
var init_tablePicking = __esm({
|
|
1297
1322
|
"src/tablePicking.tsx"() {
|
|
1298
1323
|
"use strict";
|
|
@@ -1300,7 +1325,7 @@ var init_tablePicking = __esm({
|
|
|
1300
1325
|
import_react13 = require("react");
|
|
1301
1326
|
import_records4 = require("@ai-matrx/records");
|
|
1302
1327
|
import_react14 = require("@ai-matrx/records/react");
|
|
1303
|
-
|
|
1328
|
+
import_design_system11 = require("@ai-matrx/design-system");
|
|
1304
1329
|
init_tablePickerEntries();
|
|
1305
1330
|
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1306
1331
|
}
|
|
@@ -1430,7 +1455,7 @@ function PickOne({
|
|
|
1430
1455
|
if (options.length > PICK_ONE_SEARCH_AFTER) {
|
|
1431
1456
|
const q = search.trim().toLowerCase();
|
|
1432
1457
|
const shown2 = q === "" ? options : options.filter((o) => o.label.toLowerCase().includes(q));
|
|
1433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0,
|
|
1458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_design_system18.cn)("inline-flex min-w-0", className), "data-records-pick-one": "search", "data-pick-value": value, ...attrs ?? {}, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1434
1459
|
PickOrAdd,
|
|
1435
1460
|
{
|
|
1436
1461
|
triggerSize: "compact",
|
|
@@ -1460,25 +1485,25 @@ function PickOne({
|
|
|
1460
1485
|
}
|
|
1461
1486
|
) });
|
|
1462
1487
|
}
|
|
1463
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_design_system18.Select, { value: current ? inner(current.value) : "", onValueChange: (v) => onChange(outer(v)), disabled: disabled ?? false, children: [
|
|
1464
1489
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1465
|
-
|
|
1490
|
+
import_design_system18.SelectTrigger,
|
|
1466
1491
|
{
|
|
1467
1492
|
id,
|
|
1468
1493
|
size: "sm",
|
|
1469
1494
|
"aria-label": label,
|
|
1470
|
-
className: (0,
|
|
1495
|
+
className: (0, import_design_system18.cn)("h-7 w-auto min-w-[7rem] text-xs", className),
|
|
1471
1496
|
"data-records-pick-one": "list",
|
|
1472
1497
|
"data-pick-value": value,
|
|
1473
1498
|
...attrs ?? {},
|
|
1474
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1499
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectValue, { placeholder })
|
|
1475
1500
|
}
|
|
1476
1501
|
),
|
|
1477
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1478
|
-
([group, items]) => group ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1479
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1480
|
-
items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1481
|
-
] }, group) : items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectContent, { children: groupsOf(options).map(
|
|
1503
|
+
([group, items]) => group ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_design_system18.SelectGroup, { children: [
|
|
1504
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectLabel, { children: group }),
|
|
1505
|
+
items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectItem, { value: inner(o.value), "data-pick-value": o.value, "data-pick-group": group, children: o.label }, inner(o.value)))
|
|
1506
|
+
] }, group) : items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system18.SelectItem, { value: inner(o.value), "data-pick-value": o.value, children: o.label }, inner(o.value)))
|
|
1482
1507
|
) })
|
|
1483
1508
|
] });
|
|
1484
1509
|
}
|
|
@@ -1491,13 +1516,13 @@ function groupsOf(options) {
|
|
|
1491
1516
|
}
|
|
1492
1517
|
return out;
|
|
1493
1518
|
}
|
|
1494
|
-
var import_react29,
|
|
1519
|
+
var import_react29, import_design_system18, import_jsx_runtime22, PICK_ONE_SEARCH_AFTER, EMPTY, inner, outer;
|
|
1495
1520
|
var init_PickOne = __esm({
|
|
1496
1521
|
"src/PickOne.tsx"() {
|
|
1497
1522
|
"use strict";
|
|
1498
1523
|
"use client";
|
|
1499
1524
|
import_react29 = require("react");
|
|
1500
|
-
|
|
1525
|
+
import_design_system18 = require("@ai-matrx/design-system");
|
|
1501
1526
|
init_PickOrAdd();
|
|
1502
1527
|
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1503
1528
|
PICK_ONE_SEARCH_AFTER = 7;
|
|
@@ -1541,7 +1566,7 @@ function FilePicker({
|
|
|
1541
1566
|
"div",
|
|
1542
1567
|
{
|
|
1543
1568
|
"data-matrx-file-picker": true,
|
|
1544
|
-
className: (0,
|
|
1569
|
+
className: (0, import_design_system23.cn)("flex min-w-0 flex-col gap-1", className),
|
|
1545
1570
|
onDragOver: (e) => {
|
|
1546
1571
|
if (disabled) return;
|
|
1547
1572
|
e.preventDefault();
|
|
@@ -1553,7 +1578,7 @@ function FilePicker({
|
|
|
1553
1578
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1554
1579
|
"div",
|
|
1555
1580
|
{
|
|
1556
|
-
className: (0,
|
|
1581
|
+
className: (0, import_design_system23.cn)(
|
|
1557
1582
|
"flex min-w-0 flex-wrap items-center gap-2 rounded-md border border-dashed px-2 py-1.5",
|
|
1558
1583
|
over ? "border-primary bg-primary/5" : "border-border",
|
|
1559
1584
|
disabled && "opacity-60"
|
|
@@ -1577,7 +1602,7 @@ function FilePicker({
|
|
|
1577
1602
|
}
|
|
1578
1603
|
),
|
|
1579
1604
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1580
|
-
|
|
1605
|
+
import_design_system23.Button,
|
|
1581
1606
|
{
|
|
1582
1607
|
type: "button",
|
|
1583
1608
|
size: "sm",
|
|
@@ -1588,7 +1613,7 @@ function FilePicker({
|
|
|
1588
1613
|
}
|
|
1589
1614
|
),
|
|
1590
1615
|
chosenName ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 flex-1 truncate text-xs", title: chosenName, children: chosenName }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: "or drop it here" }),
|
|
1591
|
-
chosenName && onClear ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1616
|
+
chosenName && onClear ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_design_system23.Button, { type: "button", size: "sm", variant: "ghost", disabled, onClick: onClear, children: "Cancel" }) : null
|
|
1592
1617
|
]
|
|
1593
1618
|
}
|
|
1594
1619
|
),
|
|
@@ -1597,13 +1622,13 @@ function FilePicker({
|
|
|
1597
1622
|
}
|
|
1598
1623
|
);
|
|
1599
1624
|
}
|
|
1600
|
-
var import_react35,
|
|
1625
|
+
var import_react35, import_design_system23, import_jsx_runtime27;
|
|
1601
1626
|
var init_FilePicker = __esm({
|
|
1602
1627
|
"src/FilePicker.tsx"() {
|
|
1603
1628
|
"use strict";
|
|
1604
1629
|
"use client";
|
|
1605
1630
|
import_react35 = require("react");
|
|
1606
|
-
|
|
1631
|
+
import_design_system23 = require("@ai-matrx/design-system");
|
|
1607
1632
|
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1608
1633
|
}
|
|
1609
1634
|
});
|
|
@@ -3305,7 +3330,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3305
3330
|
void run();
|
|
3306
3331
|
}, [autoRun, autoRan, source, phase, plan, busy, rights.write, rows.length, titleMissing, ruleVerdicts, run]);
|
|
3307
3332
|
const afterWrite = !busy && (phase === "done" || alreadyRan !== null || ledger !== null && ledger.seen > 0);
|
|
3308
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0,
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_design_system27.cn)("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
3309
3334
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3310
3335
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "font-medium", children: "Import" }),
|
|
3311
3336
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: table.data?.name }),
|
|
@@ -3352,7 +3377,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3352
3377
|
titleKey && titleTakesWords ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2 rounded border bg-muted/40 px-2 py-1.5", children: [
|
|
3353
3378
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "font-medium", children: "What each record is called" }),
|
|
3354
3379
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3355
|
-
|
|
3380
|
+
import_design_system27.Select,
|
|
3356
3381
|
{
|
|
3357
3382
|
value: titleMappedTo ?? "",
|
|
3358
3383
|
disabled: busy,
|
|
@@ -3373,15 +3398,15 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3373
3398
|
},
|
|
3374
3399
|
children: [
|
|
3375
3400
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3376
|
-
|
|
3401
|
+
import_design_system27.SelectTrigger,
|
|
3377
3402
|
{
|
|
3378
3403
|
size: "sm",
|
|
3379
3404
|
"aria-label": "Which column each record is named by",
|
|
3380
3405
|
className: "min-w-[14rem]",
|
|
3381
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectValue, { placeholder: "\u2014 choose the column \u2014" })
|
|
3382
3407
|
}
|
|
3383
3408
|
),
|
|
3384
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3409
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectContent, { children: plan.columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: c.header, children: c.header }, c.header)) })
|
|
3385
3410
|
]
|
|
3386
3411
|
}
|
|
3387
3412
|
),
|
|
@@ -3404,7 +3429,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3404
3429
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "min-w-[8rem] flex-1 break-words font-medium", children: column.header }),
|
|
3405
3430
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-muted-foreground", children: "goes to" }),
|
|
3406
3431
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3407
|
-
|
|
3432
|
+
import_design_system27.Select,
|
|
3408
3433
|
{
|
|
3409
3434
|
value: leftOut.has(column.header) ? LEAVE : to || ABSENT,
|
|
3410
3435
|
disabled: busy,
|
|
@@ -3424,19 +3449,19 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3424
3449
|
},
|
|
3425
3450
|
children: [
|
|
3426
3451
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3427
|
-
|
|
3452
|
+
import_design_system27.SelectTrigger,
|
|
3428
3453
|
{
|
|
3429
3454
|
size: "sm",
|
|
3430
3455
|
"aria-label": `Where ${column.header} goes`,
|
|
3431
3456
|
"data-goes-to": column.header,
|
|
3432
3457
|
className: "min-w-[14rem] flex-1",
|
|
3433
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectValue, {})
|
|
3434
3459
|
}
|
|
3435
3460
|
),
|
|
3436
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3437
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3438
|
-
unmapped !== "ignore" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3439
|
-
plan.fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3461
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system27.SelectContent, { children: [
|
|
3462
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: ABSENT, children: absent }),
|
|
3463
|
+
unmapped !== "ignore" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: LEAVE, children: "\u2014 leave it out \u2014" }) : null,
|
|
3464
|
+
plan.fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.SelectItem, { value: f.key, children: f.label || f.key }, f.field_id))
|
|
3440
3465
|
] })
|
|
3441
3466
|
]
|
|
3442
3467
|
}
|
|
@@ -3466,7 +3491,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3466
3491
|
]
|
|
3467
3492
|
}
|
|
3468
3493
|
) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3469
|
-
|
|
3494
|
+
import_design_system27.Badge,
|
|
3470
3495
|
{
|
|
3471
3496
|
variant: column.matched ? "secondary" : "outline",
|
|
3472
3497
|
className: "text-[11px] font-normal",
|
|
@@ -3515,7 +3540,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3515
3540
|
column.header
|
|
3516
3541
|
);
|
|
3517
3542
|
}) }),
|
|
3518
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3543
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Separator, {}),
|
|
3519
3544
|
titleRepeating && titleHeader && titleStats ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3520
3545
|
"div",
|
|
3521
3546
|
{
|
|
@@ -3640,7 +3665,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3640
3665
|
nudge === "always_add" && rights.admin ? `Your organization adds new choices without asking, so ${ask.words.length === 1 ? "it is" : "they are"} added when you import.` : canAdd ? `Add ${ask.words.length === 1 ? "it" : "them"}, or the rows that use ${ask.words.length === 1 ? "it" : "them"} are refused.` : `The rows that use ${ask.words.length === 1 ? "it" : "them"} are refused${rights.admin ? " (your organization does not add new choices from an import)" : " \u2014 only someone who manages this table can add choices"}.`
|
|
3641
3666
|
] }),
|
|
3642
3667
|
canAdd && nudge !== "always_add" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3643
|
-
|
|
3668
|
+
import_design_system27.Button,
|
|
3644
3669
|
{
|
|
3645
3670
|
size: "sm",
|
|
3646
3671
|
variant: "outline",
|
|
@@ -3665,7 +3690,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3665
3690
|
"div",
|
|
3666
3691
|
{
|
|
3667
3692
|
"data-import-relation": ask.field.key,
|
|
3668
|
-
className: (0,
|
|
3693
|
+
className: (0, import_design_system27.cn)(
|
|
3669
3694
|
"flex flex-col gap-1 rounded border px-2 py-1.5",
|
|
3670
3695
|
clean ? "bg-muted/40" : "border-amber-500/40 bg-amber-500/5"
|
|
3671
3696
|
),
|
|
@@ -3806,12 +3831,12 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3806
3831
|
RefusalNotice,
|
|
3807
3832
|
{
|
|
3808
3833
|
error: problem,
|
|
3809
|
-
actions: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3834
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Button, { size: "sm", variant: "outline", className: "mt-1", disabled: busy, onClick: () => void run(), children: "Try again" })
|
|
3810
3835
|
}
|
|
3811
3836
|
) }) : null,
|
|
3812
3837
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3813
3838
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3814
|
-
|
|
3839
|
+
import_design_system27.Button,
|
|
3815
3840
|
{
|
|
3816
3841
|
size: "sm",
|
|
3817
3842
|
disabled: busy || !rights.write || rows.length === 0 || titleMissing || ruleVerdicts.length > 0 && !goAheadAnyway,
|
|
@@ -3819,7 +3844,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3819
3844
|
children: phase === "linking" ? "Linking the names\u2026" : phase === "declaring" ? "Adding the columns\u2026" : phase === "writing" ? `Writing\u2026 ${progress} of ${effectiveRows.length}` : combining ? `Import ${effectiveRows.length} records from ${rows.length} rows` : `Import ${rows.length} row${rows.length === 1 ? "" : "s"}`
|
|
3820
3845
|
}
|
|
3821
3846
|
),
|
|
3822
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: (0,
|
|
3847
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: (0, import_design_system27.cn)("text-muted-foreground", titleMissing && "text-destructive"), children: [
|
|
3823
3848
|
titleMissing ? `Nothing goes into ${titleFieldLabel} yet, so these records would have no name. Choose the column above, then this will run.` : columnsSentence(mappedCount, plan.columns.length - leftOut.size, unmapped) + (leftOut.size > 0 ? ` \xB7 ${leftOut.size} left out` : ""),
|
|
3824
3849
|
fileHash || titleMissing ? "" : " \xB7 this browser cannot recognize the file again, so importing it twice would write it twice"
|
|
3825
3850
|
] })
|
|
@@ -3840,14 +3865,14 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3840
3865
|
] }) : null,
|
|
3841
3866
|
alreadyRan ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground", children: alreadyRan }) : null,
|
|
3842
3867
|
outcomes.length > 0 || summary || ledger ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
3843
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Separator, {}),
|
|
3844
3869
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3845
3870
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: ledger ? `${ledger.written} landed \xB7 ${ledger.duplicate} already here \xB7 ${ledger.refused} refused, of ${ledger.seen} row${ledger.seen === 1 ? "" : "s"} offered` : `${counts.landed} landed \xB7 ${counts.duplicate} already here \xB7 ${counts.refused} refused` }),
|
|
3846
3871
|
ledger && !ledger.final && phase !== "writing" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-destructive", children: "The run stopped here, so the rest of the file was never offered \u2014 these are the rows that were dealt with before it stopped, not the whole file." }) : null,
|
|
3847
3872
|
(ledger ? ledger.refused + ledger.duplicate : counts.refused + counts.duplicate) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
3848
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0,
|
|
3849
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0,
|
|
3850
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0,
|
|
3873
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system27.cn)("underline underline-offset-2", show === "all" && "font-medium"), onClick: () => setShow("all"), children: "everything that did not land" }),
|
|
3874
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system27.cn)("underline underline-offset-2", show === "refused" && "font-medium"), onClick: () => setShow("refused"), children: "refused" }),
|
|
3875
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: (0, import_design_system27.cn)("underline underline-offset-2", show === "duplicate" && "font-medium"), onClick: () => setShow("duplicate"), children: "already here" })
|
|
3851
3876
|
] }) : null
|
|
3852
3877
|
] }),
|
|
3853
3878
|
summary ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground", children: summary }) : null,
|
|
@@ -3868,7 +3893,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3868
3893
|
g.example
|
|
3869
3894
|
] }, g.reason)) }),
|
|
3870
3895
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3871
|
-
|
|
3896
|
+
import_design_system27.Button,
|
|
3872
3897
|
{
|
|
3873
3898
|
size: "sm",
|
|
3874
3899
|
variant: "outline",
|
|
@@ -3943,7 +3968,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3943
3968
|
p.state === "waiting" ? " is waiting in the approvals inbox." : p.state === "accepted" ? " was added as a column." : p.state === "ignored" ? " was left out." : p.state === "refused" ? ` could not be added: ${p.reason ?? ""}` : ` \u2014 ${p.state}`
|
|
3944
3969
|
] }, p.column)) }) : null,
|
|
3945
3970
|
phase === "done" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3946
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3971
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Button, { size: "sm", onClick: () => onDone?.(ledger?.written ?? 0), children: "Done" }),
|
|
3947
3972
|
(ledger?.refused ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
3948
3973
|
"The ",
|
|
3949
3974
|
ledger?.refused,
|
|
@@ -3961,7 +3986,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3961
3986
|
] }) : null,
|
|
3962
3987
|
runsProblem ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RefusalNotice, { error: runsProblem }) : null,
|
|
3963
3988
|
runs && runs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
3964
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system27.Separator, {}),
|
|
3965
3990
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "font-medium", children: "Imports into this table" }),
|
|
3966
3991
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { className: "flex flex-col gap-1", children: runs.map((r) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("li", { className: "flex flex-col gap-1", children: [
|
|
3967
3992
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
@@ -4024,7 +4049,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4024
4049
|
table.error ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RefusalNotice, { error: table.error, onRetry: table.reload }) : null
|
|
4025
4050
|
] });
|
|
4026
4051
|
}
|
|
4027
|
-
var import_react45, import_react46, import_core6,
|
|
4052
|
+
var import_react45, import_react46, import_core6, import_design_system27, import_records15, import_text_case5, import_jsx_runtime31, BATCH, SAMPLES, COLUMNS_PER_CALL, ABSENT, LEAVE, TITLE_COPY, TYPED_VALUES;
|
|
4028
4053
|
var init_ImportWizard = __esm({
|
|
4029
4054
|
"src/ImportWizard.tsx"() {
|
|
4030
4055
|
"use strict";
|
|
@@ -4032,7 +4057,7 @@ var init_ImportWizard = __esm({
|
|
|
4032
4057
|
import_react45 = require("react");
|
|
4033
4058
|
import_react46 = require("@ai-matrx/records/react");
|
|
4034
4059
|
import_core6 = require("@ai-matrx/records/core");
|
|
4035
|
-
|
|
4060
|
+
import_design_system27 = require("@ai-matrx/design-system");
|
|
4036
4061
|
import_records15 = require("@ai-matrx/records");
|
|
4037
4062
|
init_Refusal();
|
|
4038
4063
|
init_refusals();
|
|
@@ -4090,7 +4115,7 @@ var init_tableLanes = __esm({
|
|
|
4090
4115
|
});
|
|
4091
4116
|
|
|
4092
4117
|
// src/TablesHome.tsx
|
|
4093
|
-
var import_react47, import_react48, import_core7, import_records16,
|
|
4118
|
+
var import_react47, import_react48, import_core7, import_records16, import_design_system28, import_jsx_runtime32;
|
|
4094
4119
|
var init_TablesHome = __esm({
|
|
4095
4120
|
"src/TablesHome.tsx"() {
|
|
4096
4121
|
"use strict";
|
|
@@ -4099,7 +4124,7 @@ var init_TablesHome = __esm({
|
|
|
4099
4124
|
import_react48 = require("@ai-matrx/records/react");
|
|
4100
4125
|
import_core7 = require("@ai-matrx/records/core");
|
|
4101
4126
|
import_records16 = require("@ai-matrx/records");
|
|
4102
|
-
|
|
4127
|
+
import_design_system28 = require("@ai-matrx/design-system");
|
|
4103
4128
|
init_tableLanes();
|
|
4104
4129
|
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4105
4130
|
}
|
|
@@ -4209,7 +4234,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4209
4234
|
[sourceName, headers, rows, sourceText]
|
|
4210
4235
|
);
|
|
4211
4236
|
if (!shape) {
|
|
4212
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: (0,
|
|
4237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: (0, import_design_system29.cn)("flex flex-col gap-2 text-sm", className), "data-save-to-table": "", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Nothing here reads as rows \u2014 a table, a list, lines of \u201CName: value\u201D, CSV or pasted spreadsheet cells can be saved as a table." }) });
|
|
4213
4238
|
}
|
|
4214
4239
|
const chooseShape = (i) => {
|
|
4215
4240
|
setWhich(i);
|
|
@@ -4340,11 +4365,11 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4340
4365
|
};
|
|
4341
4366
|
makeRef.current = make;
|
|
4342
4367
|
const busy = phase === "making" || phase === "writing";
|
|
4343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: (0,
|
|
4368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: (0, import_design_system29.cn)("flex min-w-0 flex-col gap-3 text-sm", className), "data-save-to-table": "", children: [
|
|
4344
4369
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4345
|
-
shapes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4346
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4347
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4370
|
+
shapes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.Select, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": "Which of these to save", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, {}) }),
|
|
4372
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectContent, { children: shapes.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.SelectItem, { value: String(i), children: [
|
|
4348
4373
|
s.name ? `${s.name} \u2014 ` : "",
|
|
4349
4374
|
s.said
|
|
4350
4375
|
] }, i)) })
|
|
@@ -4353,7 +4378,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4353
4378
|
shape.said
|
|
4354
4379
|
] }),
|
|
4355
4380
|
shape.splits.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4356
|
-
|
|
4381
|
+
import_design_system29.Select,
|
|
4357
4382
|
{
|
|
4358
4383
|
value: split || "__one__",
|
|
4359
4384
|
onValueChange: (v) => {
|
|
@@ -4362,10 +4387,10 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4362
4387
|
},
|
|
4363
4388
|
disabled: busy || phase === "done",
|
|
4364
4389
|
children: [
|
|
4365
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4366
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4367
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4368
|
-
shape.splits.map((s) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4390
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": "How to read the list", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, {}) }),
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.SelectContent, { children: [
|
|
4392
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: "__one__", children: "One column" }),
|
|
4393
|
+
shape.splits.map((s) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: s.delimiter, children: s.label }, s.delimiter))
|
|
4369
4394
|
] })
|
|
4370
4395
|
]
|
|
4371
4396
|
}
|
|
@@ -4384,13 +4409,13 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4384
4409
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: made.sentence }),
|
|
4385
4410
|
problem ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: problem }) : null,
|
|
4386
4411
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex gap-2", children: [
|
|
4387
|
-
onOpenTable ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4388
|
-
onClose ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4412
|
+
onOpenTable ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.Button, { size: "sm", onClick: () => onOpenTable(made.tableId), children: "Open the table" }) : null,
|
|
4413
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.Button, { size: "sm", variant: "outline", onClick: onClose, children: "Done" }) : null
|
|
4389
4414
|
] })
|
|
4390
4415
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
4391
4416
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap gap-2", role: "radiogroup", "aria-label": "Where to save these rows", children: [
|
|
4392
4417
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4393
|
-
|
|
4418
|
+
import_design_system29.Button,
|
|
4394
4419
|
{
|
|
4395
4420
|
size: "sm",
|
|
4396
4421
|
variant: target === "new" ? "default" : "outline",
|
|
@@ -4402,7 +4427,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4402
4427
|
}
|
|
4403
4428
|
),
|
|
4404
4429
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4405
|
-
|
|
4430
|
+
import_design_system29.Button,
|
|
4406
4431
|
{
|
|
4407
4432
|
size: "sm",
|
|
4408
4433
|
variant: target === "existing" ? "default" : "outline",
|
|
@@ -4418,7 +4443,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4418
4443
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
4419
4444
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: "Table name" }),
|
|
4420
4445
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4421
|
-
|
|
4446
|
+
import_design_system29.Input,
|
|
4422
4447
|
{
|
|
4423
4448
|
value: name ?? proposedName,
|
|
4424
4449
|
onChange: (e) => setName(e.target.value),
|
|
@@ -4430,7 +4455,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4430
4455
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
4431
4456
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: "Description (optional)" }),
|
|
4432
4457
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4433
|
-
|
|
4458
|
+
import_design_system29.Input,
|
|
4434
4459
|
{
|
|
4435
4460
|
value: description,
|
|
4436
4461
|
onChange: (e) => setDescription(e.target.value),
|
|
@@ -4449,7 +4474,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4449
4474
|
"data-save-to-table-column": c.header,
|
|
4450
4475
|
children: [
|
|
4451
4476
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4452
|
-
|
|
4477
|
+
import_design_system29.Checkbox,
|
|
4453
4478
|
{
|
|
4454
4479
|
checked: c.use,
|
|
4455
4480
|
disabled: busy,
|
|
@@ -4458,7 +4483,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4458
4483
|
}
|
|
4459
4484
|
),
|
|
4460
4485
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4461
|
-
|
|
4486
|
+
import_design_system29.Input,
|
|
4462
4487
|
{
|
|
4463
4488
|
value: c.label,
|
|
4464
4489
|
"aria-label": `Name of the column ${c.header}`,
|
|
@@ -4467,7 +4492,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4467
4492
|
}
|
|
4468
4493
|
),
|
|
4469
4494
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4470
|
-
|
|
4495
|
+
import_design_system29.Select,
|
|
4471
4496
|
{
|
|
4472
4497
|
value: c.guess.type,
|
|
4473
4498
|
disabled: busy || !c.use,
|
|
@@ -4481,13 +4506,13 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4481
4506
|
})
|
|
4482
4507
|
),
|
|
4483
4508
|
children: [
|
|
4484
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4485
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4509
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": `What the column ${c.label || c.header} holds`, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, {}) }),
|
|
4510
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectContent, { children: SAVE_TO_TABLE_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: t, children: typeWord2(t) }, t)) })
|
|
4486
4511
|
]
|
|
4487
4512
|
}
|
|
4488
4513
|
),
|
|
4489
4514
|
c.guess.type === "select" && c.use ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4490
|
-
|
|
4515
|
+
import_design_system29.Input,
|
|
4491
4516
|
{
|
|
4492
4517
|
className: "col-span-2 col-start-2",
|
|
4493
4518
|
value: c.options,
|
|
@@ -4503,17 +4528,17 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4503
4528
|
] }),
|
|
4504
4529
|
problem ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: problem }) : null,
|
|
4505
4530
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4506
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4531
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.Button, { size: "sm", disabled: busy, onClick: () => void make(), children: phase === "making" ? "Making the table\u2026" : phase === "writing" ? "Writing the rows\u2026" : rows.length === 0 ? "Make the table with these columns" : `Make the table with ${rows.length} row${rows.length === 1 ? "" : "s"}` }),
|
|
4507
4532
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs text-muted-foreground", children: "Nothing is made until you press it." })
|
|
4508
4533
|
] })
|
|
4509
4534
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-2", "data-save-to-table-existing": "", children: [
|
|
4510
|
-
tables.loading || levels.loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "There is no table in this organization you can add rows to. Make a new one instead." }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4511
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4512
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4535
|
+
tables.loading || levels.loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: "There is no table in this organization you can add rows to. Make a new one instead." }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system29.Select, { value: tableId, onValueChange: setTableId, disabled: busy, children: [
|
|
4536
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectTrigger, { size: "sm", "aria-label": "Which table to add the rows to", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectValue, { placeholder: "Choose a table" }) }),
|
|
4537
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectContent, { children: writable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system29.SelectItem, { value: t.id, children: t.name }, t.id)) })
|
|
4513
4538
|
] }),
|
|
4514
4539
|
tableId ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col gap-1", "data-save-to-table-replace": "", children: replaced?.tableId === tableId ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-muted-foreground", children: replaced.count === 0 ? "The table held no rows, so nothing was archived." : `${replaced.count} row${replaced.count === 1 ? "" : "s"} it held moved to the archive, where ${replaced.count === 1 ? "it" : "they"} can be restored. The rows below go in their place.` }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "flex items-center gap-2 text-xs", children: [
|
|
4515
4540
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4516
|
-
|
|
4541
|
+
import_design_system29.Checkbox,
|
|
4517
4542
|
{
|
|
4518
4543
|
checked: replaceAsked,
|
|
4519
4544
|
disabled: busy || replacing,
|
|
@@ -4524,7 +4549,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4524
4549
|
"Replace what this table holds (its current rows move to the archive first)"
|
|
4525
4550
|
] }) }) : null,
|
|
4526
4551
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4527
|
-
|
|
4552
|
+
import_design_system29.ConfirmDialog,
|
|
4528
4553
|
{
|
|
4529
4554
|
open: replaceAsked && Boolean(tableId) && replaced?.tableId !== tableId,
|
|
4530
4555
|
onOpenChange: (open) => {
|
|
@@ -4583,14 +4608,14 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4583
4608
|
] })
|
|
4584
4609
|
] });
|
|
4585
4610
|
}
|
|
4586
|
-
var import_react49, import_react50,
|
|
4611
|
+
var import_react49, import_react50, import_design_system29, import_jsx_runtime33, SAVE_TO_TABLE_TYPES;
|
|
4587
4612
|
var init_SaveToTable = __esm({
|
|
4588
4613
|
"src/SaveToTable.tsx"() {
|
|
4589
4614
|
"use strict";
|
|
4590
4615
|
"use client";
|
|
4591
4616
|
import_react49 = require("react");
|
|
4592
4617
|
import_react50 = require("@ai-matrx/records/react");
|
|
4593
|
-
|
|
4618
|
+
import_design_system29 = require("@ai-matrx/design-system");
|
|
4594
4619
|
init_createTable();
|
|
4595
4620
|
init_unfinishedTable();
|
|
4596
4621
|
init_ImportWizard();
|
|
@@ -4645,7 +4670,7 @@ module.exports = __toCommonJS(pickers_exports);
|
|
|
4645
4670
|
// src/TablePickers.tsx
|
|
4646
4671
|
var import_react77 = require("react");
|
|
4647
4672
|
var import_react78 = require("@ai-matrx/records/react");
|
|
4648
|
-
var
|
|
4673
|
+
var import_design_system45 = require("@ai-matrx/design-system");
|
|
4649
4674
|
|
|
4650
4675
|
// src/askOnce.ts
|
|
4651
4676
|
var askOnce_exports = {};
|
|
@@ -4654,7 +4679,7 @@ __reExport(askOnce_exports, require("@ai-matrx/records/versions"));
|
|
|
4654
4679
|
// src/AddChoicesInline.tsx
|
|
4655
4680
|
var import_react6 = require("react");
|
|
4656
4681
|
var import_react7 = require("@ai-matrx/records/react");
|
|
4657
|
-
var
|
|
4682
|
+
var import_design_system5 = require("@ai-matrx/design-system");
|
|
4658
4683
|
|
|
4659
4684
|
// src/ChoiceListEditor.tsx
|
|
4660
4685
|
var import_react = require("react");
|
|
@@ -4946,13 +4971,13 @@ function AddChoicesInline({ field, onAdded, disabled = false }) {
|
|
|
4946
4971
|
setRows([newChoiceRow([])]);
|
|
4947
4972
|
onAdded();
|
|
4948
4973
|
};
|
|
4949
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
4950
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4951
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
4974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system5.Popover, { open, onOpenChange: setOpen, children: [
|
|
4975
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.Button, { type: "button", size: "sm", variant: "outline", className: "h-7 self-start text-xs", disabled, "data-records-add-choices": "", children: "Add choices" }) }),
|
|
4976
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system5.PopoverContent, { className: "w-72 space-y-2 p-3", align: "start", children: [
|
|
4952
4977
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChoiceListEditor, { isNew: true, rows, onRows: setRows }),
|
|
4953
4978
|
missing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-[11px] text-muted-foreground", children: missing }) : null,
|
|
4954
4979
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RefusalLine, { error: refused }) : null,
|
|
4955
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system5.Button, { type: "button", size: "sm", className: "h-7 text-xs", disabled: saving || words.length === 0 || missing !== null, onClick: () => void save(), children: "Save choices" })
|
|
4956
4981
|
] })
|
|
4957
4982
|
] });
|
|
4958
4983
|
}
|
|
@@ -4961,14 +4986,14 @@ function AddChoicesInline({ field, onAdded, disabled = false }) {
|
|
|
4961
4986
|
var import_react73 = require("react");
|
|
4962
4987
|
var import_records28 = require("@ai-matrx/records");
|
|
4963
4988
|
var import_react74 = require("@ai-matrx/records/react");
|
|
4964
|
-
var
|
|
4989
|
+
var import_design_system44 = require("@ai-matrx/design-system");
|
|
4965
4990
|
init_dates();
|
|
4966
4991
|
|
|
4967
4992
|
// src/newerKindValues.tsx
|
|
4968
4993
|
var import_react8 = require("react");
|
|
4969
4994
|
var import_source = require("@ai-matrx/content-ir/source");
|
|
4970
4995
|
var import_records2 = require("@ai-matrx/records");
|
|
4971
|
-
var
|
|
4996
|
+
var import_design_system6 = require("@ai-matrx/design-system");
|
|
4972
4997
|
var import_outbound_react = require("@ai-matrx/kit/outbound-react");
|
|
4973
4998
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4974
4999
|
var own = (event) => event.stopPropagation();
|
|
@@ -5010,7 +5035,7 @@ function PersonStampChip({ stamp }) {
|
|
|
5010
5035
|
children: initial
|
|
5011
5036
|
}
|
|
5012
5037
|
),
|
|
5013
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0,
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_design_system6.cn)("truncate", tier === "user" && !name ? "italic text-muted-foreground" : ""), children: words })
|
|
5014
5039
|
] });
|
|
5015
5040
|
}
|
|
5016
5041
|
function AddressLink({ value }) {
|
|
@@ -5124,7 +5149,7 @@ function SafeMarkdown({ text, clipped }) {
|
|
|
5124
5149
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5125
5150
|
"span",
|
|
5126
5151
|
{
|
|
5127
|
-
className: (0,
|
|
5152
|
+
className: (0, import_design_system6.cn)("block min-w-0 space-y-1 whitespace-normal text-sm", clipped ? "max-h-[4.5em] overflow-hidden" : ""),
|
|
5128
5153
|
"data-records-rich-text": "",
|
|
5129
5154
|
children: blocks
|
|
5130
5155
|
}
|
|
@@ -5154,7 +5179,7 @@ function DurationControl({ value, onChange, disabled, id }) {
|
|
|
5154
5179
|
}, [value]);
|
|
5155
5180
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex flex-col gap-1", children: [
|
|
5156
5181
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5157
|
-
|
|
5182
|
+
import_design_system6.BasicInput,
|
|
5158
5183
|
{
|
|
5159
5184
|
id,
|
|
5160
5185
|
value: text,
|
|
@@ -5204,7 +5229,7 @@ function AddressControl({ value, onChange, disabled, id }) {
|
|
|
5204
5229
|
onChange(Object.keys(kept).length === 0 ? null : kept);
|
|
5205
5230
|
};
|
|
5206
5231
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { id, className: "grid grid-cols-2 gap-1.5", "data-records-address-control": "", children: import_records2.ADDRESS_PARTS.map((part) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5207
|
-
|
|
5232
|
+
import_design_system6.BasicInput,
|
|
5208
5233
|
{
|
|
5209
5234
|
"aria-label": ADDRESS_LABELS[part],
|
|
5210
5235
|
placeholder: ADDRESS_EXAMPLES[part],
|
|
@@ -5228,7 +5253,7 @@ function BarcodeControl({ value, onChange, disabled, id }) {
|
|
|
5228
5253
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex flex-col gap-1", children: [
|
|
5229
5254
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
5230
5255
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5231
|
-
|
|
5256
|
+
import_design_system6.BasicInput,
|
|
5232
5257
|
{
|
|
5233
5258
|
id,
|
|
5234
5259
|
className: "font-mono",
|
|
@@ -5286,7 +5311,7 @@ init_names();
|
|
|
5286
5311
|
var import_react10 = require("react");
|
|
5287
5312
|
var import_records3 = require("@ai-matrx/records");
|
|
5288
5313
|
var import_react11 = require("@ai-matrx/records/react");
|
|
5289
|
-
var
|
|
5314
|
+
var import_design_system9 = require("@ai-matrx/design-system");
|
|
5290
5315
|
init_PickOrAdd();
|
|
5291
5316
|
init_names();
|
|
5292
5317
|
init_Refusal();
|
|
@@ -5420,7 +5445,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
5420
5445
|
};
|
|
5421
5446
|
}, [client, open, allowCreate, target, targetRefusal, field.relation_target]);
|
|
5422
5447
|
if (!client) {
|
|
5423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id, className: (0,
|
|
5448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id, className: (0, import_design_system9.cn)("text-xs text-muted-foreground", className), children: NO_STORE_ON_THIS_SCREEN_REASON });
|
|
5424
5449
|
}
|
|
5425
5450
|
if (!field.relation_target) {
|
|
5426
5451
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -5493,7 +5518,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
5493
5518
|
));
|
|
5494
5519
|
return (
|
|
5495
5520
|
// Never wider than where it is drawn (a grid cell beside a sticky column: B3-07) — chips truncate, the button wraps.
|
|
5496
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0,
|
|
5521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_design_system9.cn)("flex min-w-0 max-w-full flex-wrap items-center gap-1", className), children: [
|
|
5497
5522
|
anchored && !disabled ? null : cellChips,
|
|
5498
5523
|
disabled ? null : (
|
|
5499
5524
|
// THE ONE "PICK OR ADD" BUILDER (PickOrAdd.tsx) — the choice editor draws the same one.
|
|
@@ -5548,7 +5573,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
5548
5573
|
} : null,
|
|
5549
5574
|
foot: !allowCreate || full ? void 0 : targetRefusal ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RefusalLine, { error: targetRefusal, className: "p-2" }) : !target ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "p-2 text-xs text-muted-foreground", children: "Reading that table\u2026" }) : creating ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1 p-1", children: [
|
|
5550
5575
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5551
|
-
|
|
5576
|
+
import_design_system9.BasicInput,
|
|
5552
5577
|
{
|
|
5553
5578
|
autoFocus: true,
|
|
5554
5579
|
value: newTitle,
|
|
@@ -5565,7 +5590,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
5565
5590
|
}
|
|
5566
5591
|
),
|
|
5567
5592
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5568
|
-
|
|
5593
|
+
import_design_system9.Button,
|
|
5569
5594
|
{
|
|
5570
5595
|
type: "button",
|
|
5571
5596
|
size: "sm",
|
|
@@ -5611,7 +5636,7 @@ function readableLink(raw) {
|
|
|
5611
5636
|
|
|
5612
5637
|
// src/buttonCell.tsx
|
|
5613
5638
|
var import_react68 = require("react");
|
|
5614
|
-
var
|
|
5639
|
+
var import_design_system41 = require("@ai-matrx/design-system");
|
|
5615
5640
|
var import_data_table6 = require("@ai-matrx/design-system/data-table");
|
|
5616
5641
|
var import_records26 = require("@ai-matrx/records");
|
|
5617
5642
|
var import_react69 = require("@ai-matrx/records/react");
|
|
@@ -5666,10 +5691,10 @@ function columnNameProblemLine(name, noun = "column") {
|
|
|
5666
5691
|
var import_react66 = require("react");
|
|
5667
5692
|
var import_react67 = require("@ai-matrx/records/react");
|
|
5668
5693
|
var import_core9 = require("@ai-matrx/records/core");
|
|
5669
|
-
var
|
|
5694
|
+
var import_design_system40 = require("@ai-matrx/design-system");
|
|
5670
5695
|
|
|
5671
5696
|
// src/WatchFieldsPicker.tsx
|
|
5672
|
-
var
|
|
5697
|
+
var import_design_system10 = require("@ai-matrx/design-system");
|
|
5673
5698
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5674
5699
|
function watchedFieldsOf(field) {
|
|
5675
5700
|
const list = field?.config?.["only_fields"];
|
|
@@ -5687,15 +5712,15 @@ function watchable(field) {
|
|
|
5687
5712
|
function WatchFieldsPicker({ fields, value, onChange }) {
|
|
5688
5713
|
const choices = fields.filter(watchable);
|
|
5689
5714
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("fieldset", { className: "flex flex-col gap-1", "data-records-watch-fields": "", children: [
|
|
5690
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system10.Label, { className: "text-xs", children: "Changes to" }),
|
|
5691
5716
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-wrap gap-x-3 gap-y-1", children: [
|
|
5692
5717
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
5693
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5718
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system10.Checkbox, { checked: value.length === 0, "aria-label": "Any field", onCheckedChange: (v) => v === true && onChange([]) }),
|
|
5694
5719
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "Any field" })
|
|
5695
5720
|
] }),
|
|
5696
5721
|
choices.map((f) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
5697
5722
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5698
|
-
|
|
5723
|
+
import_design_system10.Checkbox,
|
|
5699
5724
|
{
|
|
5700
5725
|
checked: value.includes(f.key),
|
|
5701
5726
|
"aria-label": f.label,
|
|
@@ -5720,7 +5745,7 @@ var import_core2 = require("@ai-matrx/records/core");
|
|
|
5720
5745
|
init_createTable();
|
|
5721
5746
|
init_Refusal();
|
|
5722
5747
|
init_tablePicking();
|
|
5723
|
-
var
|
|
5748
|
+
var import_design_system12 = require("@ai-matrx/design-system");
|
|
5724
5749
|
init_names();
|
|
5725
5750
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
5726
5751
|
var DEFAULT_SEPARATOR = " ";
|
|
@@ -5840,7 +5865,7 @@ function ReferenceBuilder({
|
|
|
5840
5865
|
};
|
|
5841
5866
|
const mayMakeTable = (0, import_core2.doorReady)(client.config, import_core2.DOORS.tableFind) && (0, import_core2.doorReady)(client.config, import_core2.DOORS.tableEnsure);
|
|
5842
5867
|
const newTableButton = !mayMakeTable ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5843
|
-
|
|
5868
|
+
import_design_system12.Button,
|
|
5844
5869
|
{
|
|
5845
5870
|
type: "button",
|
|
5846
5871
|
size: "sm",
|
|
@@ -5869,16 +5894,16 @@ function ReferenceBuilder({
|
|
|
5869
5894
|
next.splice(to, 0, next.splice(at, 1)[0]);
|
|
5870
5895
|
setDisplay({ columns: next, separator });
|
|
5871
5896
|
};
|
|
5872
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0,
|
|
5897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_design_system12.cn)("flex max-w-[26rem] flex-col gap-3", className), children: [
|
|
5873
5898
|
!lockTarget && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5874
5899
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5875
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5900
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs", children: "The table it points at" }),
|
|
5876
5901
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ShowListsToggle, { count: picking.listCount, on: showLists, onChange: setShowLists })
|
|
5877
5902
|
] }),
|
|
5878
5903
|
naming !== null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", "data-new-link-table": "", children: [
|
|
5879
5904
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
5880
5905
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5881
|
-
|
|
5906
|
+
import_design_system12.BasicInput,
|
|
5882
5907
|
{
|
|
5883
5908
|
autoFocus: true,
|
|
5884
5909
|
value: naming,
|
|
@@ -5901,7 +5926,7 @@ function ReferenceBuilder({
|
|
|
5901
5926
|
}
|
|
5902
5927
|
),
|
|
5903
5928
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5904
|
-
|
|
5929
|
+
import_design_system12.Button,
|
|
5905
5930
|
{
|
|
5906
5931
|
type: "button",
|
|
5907
5932
|
size: "sm",
|
|
@@ -5911,7 +5936,7 @@ function ReferenceBuilder({
|
|
|
5911
5936
|
}
|
|
5912
5937
|
),
|
|
5913
5938
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5914
|
-
|
|
5939
|
+
import_design_system12.Button,
|
|
5915
5940
|
{
|
|
5916
5941
|
type: "button",
|
|
5917
5942
|
size: "sm",
|
|
@@ -5930,7 +5955,7 @@ function ReferenceBuilder({
|
|
|
5930
5955
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No tables yet." }),
|
|
5931
5956
|
newTableButton
|
|
5932
5957
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5933
|
-
|
|
5958
|
+
import_design_system12.Select,
|
|
5934
5959
|
{
|
|
5935
5960
|
value: value.targetTableId,
|
|
5936
5961
|
onValueChange: (next) => {
|
|
@@ -5942,13 +5967,13 @@ function ReferenceBuilder({
|
|
|
5942
5967
|
onChange({ targetTableId: next, display: null });
|
|
5943
5968
|
},
|
|
5944
5969
|
children: [
|
|
5945
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5946
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5947
|
-
offered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5970
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.SelectTrigger, { size: "sm", "aria-label": "The table this column points at", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.SelectValue, { placeholder: "Choose a table" }) }),
|
|
5971
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system12.SelectContent, { children: [
|
|
5972
|
+
offered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_design_system12.SelectItem, { value: t.id, children: [
|
|
5948
5973
|
t.label,
|
|
5949
5974
|
t.id === tableId ? " \u2014 this table" : ""
|
|
5950
5975
|
] }, t.id)),
|
|
5951
|
-
mayMakeTable ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5976
|
+
mayMakeTable ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.SelectItem, { value: NEW_TABLE, children: "New table\u2026" }) : null
|
|
5952
5977
|
] })
|
|
5953
5978
|
]
|
|
5954
5979
|
}
|
|
@@ -5956,12 +5981,12 @@ function ReferenceBuilder({
|
|
|
5956
5981
|
] }),
|
|
5957
5982
|
target && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5958
5983
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5959
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5984
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs", children: "Shown as" }),
|
|
5960
5985
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[11px] text-muted-foreground", children: titleField ? `${titleField} \u2014 what ${targetTable ? tableName(targetTable) : "that table"} is titled by` : "whatever each record is named by" })
|
|
5961
5986
|
] }),
|
|
5962
5987
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
5963
5988
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5964
|
-
|
|
5989
|
+
import_design_system12.Checkbox,
|
|
5965
5990
|
{
|
|
5966
5991
|
checked: overriding,
|
|
5967
5992
|
onCheckedChange: (next) => {
|
|
@@ -5979,7 +6004,7 @@ function ReferenceBuilder({
|
|
|
5979
6004
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-wrap gap-1", children: columns.keys.map((key) => {
|
|
5980
6005
|
const on = chosen.includes(key);
|
|
5981
6006
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5982
|
-
|
|
6007
|
+
import_design_system12.Button,
|
|
5983
6008
|
{
|
|
5984
6009
|
type: "button",
|
|
5985
6010
|
size: "sm",
|
|
@@ -5999,7 +6024,7 @@ function ReferenceBuilder({
|
|
|
5999
6024
|
chosen.map((key, at) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex items-center gap-0.5", children: [
|
|
6000
6025
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[11px]", children: key }),
|
|
6001
6026
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6002
|
-
|
|
6027
|
+
import_design_system12.Button,
|
|
6003
6028
|
{
|
|
6004
6029
|
type: "button",
|
|
6005
6030
|
size: "sm",
|
|
@@ -6011,7 +6036,7 @@ function ReferenceBuilder({
|
|
|
6011
6036
|
}
|
|
6012
6037
|
),
|
|
6013
6038
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6014
|
-
|
|
6039
|
+
import_design_system12.Button,
|
|
6015
6040
|
{
|
|
6016
6041
|
type: "button",
|
|
6017
6042
|
size: "sm",
|
|
@@ -6025,9 +6050,9 @@ function ReferenceBuilder({
|
|
|
6025
6050
|
] }, key))
|
|
6026
6051
|
] }),
|
|
6027
6052
|
chosen.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6028
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6053
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs whitespace-nowrap", children: "Joined by" }),
|
|
6029
6054
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6030
|
-
|
|
6055
|
+
import_design_system12.BasicInput,
|
|
6031
6056
|
{
|
|
6032
6057
|
value: separator,
|
|
6033
6058
|
onChange: (e) => setDisplay({ columns: chosen, separator: e.target.value }),
|
|
@@ -6039,7 +6064,7 @@ function ReferenceBuilder({
|
|
|
6039
6064
|
] })
|
|
6040
6065
|
] }) }),
|
|
6041
6066
|
target && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
|
|
6042
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6067
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system12.Label, { className: "text-xs", children: "It will read" }),
|
|
6043
6068
|
preview.loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading a few of its records\u2026" }) : (preview.data?.rows?.length ?? 0) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "That table has no records yet, so there is nothing to show here \u2014 this column will still work, and the first record added is the first thing it offers." }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-col gap-0.5", children: (preview.data?.rows ?? []).map((row) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { className: "truncate text-[11px] text-foreground", children: previewWords(
|
|
6044
6069
|
row.document,
|
|
6045
6070
|
display,
|
|
@@ -6053,7 +6078,7 @@ function ReferenceBuilder({
|
|
|
6053
6078
|
var import_react17 = require("react");
|
|
6054
6079
|
var import_react18 = require("@ai-matrx/records/react");
|
|
6055
6080
|
var import_records5 = require("@ai-matrx/records");
|
|
6056
|
-
var
|
|
6081
|
+
var import_design_system13 = require("@ai-matrx/design-system");
|
|
6057
6082
|
init_host();
|
|
6058
6083
|
init_Refusal();
|
|
6059
6084
|
init_plainWords();
|
|
@@ -6166,9 +6191,9 @@ function FormulaTextEditor({
|
|
|
6166
6191
|
const at = Math.max(0, Math.min(parsed.position ?? 0, parsed.text.length));
|
|
6167
6192
|
return { before: parsed.text.slice(0, at), after: parsed.text.slice(at) };
|
|
6168
6193
|
}, [parsed]);
|
|
6169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "data-records-formula-editor": "", className: (0,
|
|
6194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "data-records-formula-editor": "", className: (0, import_design_system13.cn)("flex flex-col gap-1.5", className), children: [
|
|
6170
6195
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6171
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6196
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system13.Label, { className: "text-xs", children: "The formula" }),
|
|
6172
6197
|
host.formulaHelp ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "data-records-formula-help": "", className: "ml-auto", children: host.formulaHelp({
|
|
6173
6198
|
tableId,
|
|
6174
6199
|
text,
|
|
@@ -6180,7 +6205,7 @@ function FormulaTextEditor({
|
|
|
6180
6205
|
}) }) : null
|
|
6181
6206
|
] }),
|
|
6182
6207
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6183
|
-
|
|
6208
|
+
import_design_system13.BasicTextarea,
|
|
6184
6209
|
{
|
|
6185
6210
|
ref: box,
|
|
6186
6211
|
value: text,
|
|
@@ -6203,7 +6228,7 @@ function FormulaTextEditor({
|
|
|
6203
6228
|
sampleRecordId ? "This record" : "First row",
|
|
6204
6229
|
": "
|
|
6205
6230
|
] }),
|
|
6206
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0,
|
|
6231
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0, import_design_system13.cn)("font-mono", parsed.error ? "text-muted-foreground" : "text-foreground"), children: sampleWords(parsed) })
|
|
6207
6232
|
] }) : null,
|
|
6208
6233
|
parsed && !parsed.ok ? (
|
|
6209
6234
|
// NOT A REFUSAL, SO NOT RED: nothing was pressed. It is the store's reading of the
|
|
@@ -6220,7 +6245,7 @@ function FormulaTextEditor({
|
|
|
6220
6245
|
error ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RefusalLine, { error }) : null,
|
|
6221
6246
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
6222
6247
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-[11px] text-muted-foreground", children: "Columns:" }),
|
|
6223
|
-
columns.map((f) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6248
|
+
columns.map((f) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system13.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-1.5 text-[11px]", onClick: () => insert(`{${fieldName(f)}}`), children: fieldName(f) }, f.id))
|
|
6224
6249
|
] }),
|
|
6225
6250
|
STORE_FORMULA_FUNCTION_NAMES.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "text-[11px] text-muted-foreground", children: [
|
|
6226
6251
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { className: "cursor-pointer", children: [
|
|
@@ -6228,7 +6253,7 @@ function FormulaTextEditor({
|
|
|
6228
6253
|
STORE_FORMULA_FUNCTION_NAMES.length,
|
|
6229
6254
|
")"
|
|
6230
6255
|
] }),
|
|
6231
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-1 flex flex-wrap gap-1", children: STORE_FORMULA_FUNCTION_NAMES.map((name) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6256
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mt-1 flex flex-wrap gap-1", children: STORE_FORMULA_FUNCTION_NAMES.map((name) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system13.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-1.5 font-mono text-[11px]", onClick: () => insert(`${name}()`), children: name }, name)) })
|
|
6232
6257
|
] }) : null
|
|
6233
6258
|
] });
|
|
6234
6259
|
}
|
|
@@ -6236,7 +6261,7 @@ function FormulaTextEditor({
|
|
|
6236
6261
|
// src/EntityReferenceKindPicker.tsx
|
|
6237
6262
|
var import_react19 = require("react");
|
|
6238
6263
|
var import_react20 = require("@ai-matrx/records/react");
|
|
6239
|
-
var
|
|
6264
|
+
var import_design_system14 = require("@ai-matrx/design-system");
|
|
6240
6265
|
init_Refusal();
|
|
6241
6266
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6242
6267
|
var ENTITY_REFERENCE_KINDS_MISSING = "Choose at least one kind of thing this column points at.";
|
|
@@ -6272,9 +6297,9 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
6272
6297
|
if (on) onChange(chosen.has(token) ? [...value] : [...value, token]);
|
|
6273
6298
|
else onChange(value.filter((t) => t !== token));
|
|
6274
6299
|
};
|
|
6275
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0,
|
|
6276
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6277
|
-
value.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-wrap gap-1", "aria-label": "Chosen kinds", children: value.map((token) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
6300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_design_system14.cn)("flex flex-col gap-2", className), children: [
|
|
6301
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system14.Label, { className: "text-xs", children: "What it points at" }),
|
|
6302
|
+
value.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-wrap gap-1", "aria-label": "Chosen kinds", children: value.map((token) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system14.Badge, { variant: "secondary", className: "gap-1 text-[11px]", children: [
|
|
6278
6303
|
labelOf.get(token) ?? token,
|
|
6279
6304
|
locked ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6280
6305
|
"button",
|
|
@@ -6287,9 +6312,9 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
6287
6312
|
}
|
|
6288
6313
|
)
|
|
6289
6314
|
] }, token)) }) : null,
|
|
6290
|
-
locked ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "The kinds an existing column points at are kept as they are; add a new column to point at others." }) : error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefusalNotice, { error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6315
|
+
locked ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "The kinds an existing column points at are kept as they are; add a new column to point at others." }) : error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefusalNotice, { error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system14.Skeleton, { className: "h-24 w-full" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
6291
6316
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6292
|
-
|
|
6317
|
+
import_design_system14.BasicInput,
|
|
6293
6318
|
{
|
|
6294
6319
|
"aria-label": "Find a kind of thing",
|
|
6295
6320
|
placeholder: "Find a kind \u2014 note, web site, agent\u2026",
|
|
@@ -6306,7 +6331,7 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
6306
6331
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: category }),
|
|
6307
6332
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "grid grid-cols-1 gap-1 sm:grid-cols-2", children: kinds.map((k) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "flex items-center gap-1.5 text-xs", children: [
|
|
6308
6333
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6309
|
-
|
|
6334
|
+
import_design_system14.Checkbox,
|
|
6310
6335
|
{
|
|
6311
6336
|
checked: chosen.has(k.token),
|
|
6312
6337
|
"aria-label": k.label,
|
|
@@ -6326,7 +6351,7 @@ init_Refusal();
|
|
|
6326
6351
|
|
|
6327
6352
|
// src/SourceArchivedNotice.tsx
|
|
6328
6353
|
var import_react53 = require("react");
|
|
6329
|
-
var
|
|
6354
|
+
var import_design_system32 = require("@ai-matrx/design-system");
|
|
6330
6355
|
var import_react54 = require("@ai-matrx/records/react");
|
|
6331
6356
|
init_Refusal();
|
|
6332
6357
|
|
|
@@ -6339,7 +6364,7 @@ function withoutLeadingBlank(text) {
|
|
|
6339
6364
|
init_personChip();
|
|
6340
6365
|
var import_data_table3 = require("@ai-matrx/design-system/data-table");
|
|
6341
6366
|
var import_field_formats6 = require("@ai-matrx/design-system/field-formats");
|
|
6342
|
-
var
|
|
6367
|
+
var import_design_system31 = require("@ai-matrx/design-system");
|
|
6343
6368
|
init_parity();
|
|
6344
6369
|
init_dates();
|
|
6345
6370
|
|
|
@@ -6450,7 +6475,7 @@ var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
|
6450
6475
|
|
|
6451
6476
|
// src/signature.tsx
|
|
6452
6477
|
var import_react22 = require("react");
|
|
6453
|
-
var
|
|
6478
|
+
var import_design_system15 = require("@ai-matrx/design-system");
|
|
6454
6479
|
var import_react23 = require("@ai-matrx/records/react");
|
|
6455
6480
|
init_docs();
|
|
6456
6481
|
init_host();
|
|
@@ -6517,7 +6542,7 @@ function DrawnImage({ src, inCell }) {
|
|
|
6517
6542
|
src,
|
|
6518
6543
|
alt: SIGNED_WORD,
|
|
6519
6544
|
"data-records-signature": "",
|
|
6520
|
-
className: (0,
|
|
6545
|
+
className: (0, import_design_system15.cn)("max-w-[12rem] object-contain object-left dark:invert", inCell ? "h-7" : "h-12")
|
|
6521
6546
|
}
|
|
6522
6547
|
);
|
|
6523
6548
|
}
|
|
@@ -6547,7 +6572,7 @@ function SignatureDrawing({
|
|
|
6547
6572
|
}, [client, recordId, fieldKey, knownFile]);
|
|
6548
6573
|
if (drawing?.src) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawnImage, { src: drawing.src, inCell });
|
|
6549
6574
|
if (drawing?.hostFileId && host.fileImage) {
|
|
6550
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: (0,
|
|
6575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: (0, import_design_system15.cn)("inline-block max-w-[12rem] dark:invert", inCell ? "h-7" : "h-12"), "data-records-signature": "", children: host.fileImage({ fileId: drawing.hostFileId, alt: SIGNED_WORD }) });
|
|
6551
6576
|
}
|
|
6552
6577
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-serif italic", children: String(value) });
|
|
6553
6578
|
}
|
|
@@ -6647,12 +6672,12 @@ function SignaturePad({
|
|
|
6647
6672
|
onChange(null);
|
|
6648
6673
|
};
|
|
6649
6674
|
if (!showPad) {
|
|
6650
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, className: (0,
|
|
6675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, className: (0, import_design_system15.cn)("flex items-center justify-between gap-2 rounded-md border px-3 py-2", className), children: [
|
|
6651
6676
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SignatureValue, { value }),
|
|
6652
|
-
!disabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6677
|
+
!disabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system15.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, children: "Sign again" }) : null
|
|
6653
6678
|
] });
|
|
6654
6679
|
}
|
|
6655
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0,
|
|
6680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_design_system15.cn)("flex w-full flex-col gap-1", className), children: [
|
|
6656
6681
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative", children: [
|
|
6657
6682
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6658
6683
|
"canvas",
|
|
@@ -6667,7 +6692,7 @@ function SignaturePad({
|
|
|
6667
6692
|
onPointerUp: end,
|
|
6668
6693
|
onPointerLeave: end,
|
|
6669
6694
|
onPointerCancel: end,
|
|
6670
|
-
className: (0,
|
|
6695
|
+
className: (0, import_design_system15.cn)(
|
|
6671
6696
|
"block h-36 w-full touch-none rounded-md border border-border bg-white",
|
|
6672
6697
|
disabled ? "cursor-not-allowed opacity-60" : "cursor-crosshair"
|
|
6673
6698
|
)
|
|
@@ -6677,7 +6702,7 @@ function SignaturePad({
|
|
|
6677
6702
|
] }),
|
|
6678
6703
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [
|
|
6679
6704
|
tooBig ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6680
|
-
|
|
6705
|
+
import_design_system15.ErrorBox,
|
|
6681
6706
|
{
|
|
6682
6707
|
as: "span",
|
|
6683
6708
|
className: "mr-auto text-xs text-destructive",
|
|
@@ -6686,7 +6711,7 @@ function SignaturePad({
|
|
|
6686
6711
|
origin: "records-ui/signature"
|
|
6687
6712
|
}
|
|
6688
6713
|
) : null,
|
|
6689
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6714
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system15.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, disabled: disabled || !dirty, children: "Clear" })
|
|
6690
6715
|
] })
|
|
6691
6716
|
] });
|
|
6692
6717
|
}
|
|
@@ -6723,7 +6748,7 @@ function encodeAt(canvas, type, maxWidth, quality) {
|
|
|
6723
6748
|
// src/looks/designLooks.tsx
|
|
6724
6749
|
var import_react24 = require("react");
|
|
6725
6750
|
var import_icons = require("@ai-matrx/design-system/icons");
|
|
6726
|
-
var
|
|
6751
|
+
var import_design_system16 = require("@ai-matrx/design-system");
|
|
6727
6752
|
var import_field_formats3 = require("@ai-matrx/design-system/field-formats");
|
|
6728
6753
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6729
6754
|
var TYPE_SAMPLE = "The quick brown fox jumps over the lazy dog";
|
|
@@ -6737,7 +6762,7 @@ function numberOf(value) {
|
|
|
6737
6762
|
return null;
|
|
6738
6763
|
}
|
|
6739
6764
|
function Swatch({ color, className }) {
|
|
6740
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0,
|
|
6765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0, import_design_system16.cn)("inline-block h-4 w-4 shrink-0 rounded border border-border", className), style: { backgroundColor: color } });
|
|
6741
6766
|
}
|
|
6742
6767
|
function colorPairGround(format, context) {
|
|
6743
6768
|
const fixed = format.options?.contrastWith;
|
|
@@ -6768,7 +6793,7 @@ function ContrastMark({ ratio, min }) {
|
|
|
6768
6793
|
{
|
|
6769
6794
|
"data-records-contrast": level,
|
|
6770
6795
|
title: level === "pass" ? `Readable: ${said2}` : level === "large-only" ? `Large text only: ${said2}` : `Hard to read: ${said2}`,
|
|
6771
|
-
className: (0,
|
|
6796
|
+
className: (0, import_design_system16.cn)("shrink-0 text-xs tabular-nums", level === "pass" ? "text-muted-foreground" : "text-warning-ink"),
|
|
6772
6797
|
children: [
|
|
6773
6798
|
level === "pass" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons.CheckIcon, { className: "mr-0.5 inline h-3 w-3 align-[-1px]" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons.AlertTriangleIcon, { className: "mr-0.5 inline h-3 w-3 align-[-1px]" }),
|
|
6774
6799
|
said2
|
|
@@ -6788,7 +6813,7 @@ function ColorPairView({ value, format }) {
|
|
|
6788
6813
|
] }),
|
|
6789
6814
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
6790
6815
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Swatch, { color: pair.dark ?? pair.light }),
|
|
6791
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: (0,
|
|
6816
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: (0, import_design_system16.cn)("font-mono text-xs uppercase", !pair.dark && "text-muted-foreground"), children: pair.dark ?? "Inherits light" }),
|
|
6792
6817
|
contrast.dark !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContrastMark, { ratio: contrast.dark, min: pair.min }) : null
|
|
6793
6818
|
] })
|
|
6794
6819
|
] });
|
|
@@ -6809,7 +6834,7 @@ function ColorWell({
|
|
|
6809
6834
|
}
|
|
6810
6835
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
6811
6836
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6812
|
-
|
|
6837
|
+
import_design_system16.BasicInput,
|
|
6813
6838
|
{
|
|
6814
6839
|
type: "color",
|
|
6815
6840
|
"aria-label": `${label}: pick a color`,
|
|
@@ -6823,7 +6848,7 @@ function ColorWell({
|
|
|
6823
6848
|
}
|
|
6824
6849
|
),
|
|
6825
6850
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6826
|
-
|
|
6851
|
+
import_design_system16.BasicInput,
|
|
6827
6852
|
{
|
|
6828
6853
|
id,
|
|
6829
6854
|
"aria-label": label,
|
|
@@ -6922,14 +6947,14 @@ function NumberBox({
|
|
|
6922
6947
|
const typed = FINISHED_NUMBER.test(text.trim()) ? Number(text.trim()) : void 0;
|
|
6923
6948
|
if (typed !== value) setText(value === null || value === void 0 ? "" : String(value));
|
|
6924
6949
|
}
|
|
6925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: (0,
|
|
6950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: (0, import_design_system16.cn)("relative flex items-center", className), children: [
|
|
6926
6951
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6927
|
-
|
|
6952
|
+
import_design_system16.BasicInput,
|
|
6928
6953
|
{
|
|
6929
6954
|
...id ? { id } : {},
|
|
6930
6955
|
"aria-label": label,
|
|
6931
6956
|
inputMode: "decimal",
|
|
6932
|
-
className: (0,
|
|
6957
|
+
className: (0, import_design_system16.cn)("h-7 text-xs tabular-nums", unit ? "pr-9" : ""),
|
|
6933
6958
|
value: text,
|
|
6934
6959
|
disabled,
|
|
6935
6960
|
onChange: (e) => {
|
|
@@ -7046,7 +7071,7 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7046
7071
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex w-full flex-col gap-1.5", children: [
|
|
7047
7072
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: FIELD, children: [
|
|
7048
7073
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground", children: "Font" }),
|
|
7049
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7074
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.BasicInput, { id, "aria-label": `${label} font`, value: font, placeholder: "Geist", disabled, onChange: (e) => {
|
|
7050
7075
|
setFont(e.target.value);
|
|
7051
7076
|
write({ font: e.target.value });
|
|
7052
7077
|
} })
|
|
@@ -7054,9 +7079,9 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7054
7079
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: FIELD, children: [
|
|
7055
7080
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground", children: "Weight" }),
|
|
7056
7081
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "grid grid-cols-[1fr_6rem] gap-2", children: [
|
|
7057
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7058
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7059
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7082
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system16.Select, { value: String(clampWeight(style.weight)), disabled: disabled ?? false, onValueChange: (v) => write({ weight: clampWeight(Number(v)) }), children: [
|
|
7083
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectTrigger, { "aria-label": `${label} weight`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectValue, {}) }),
|
|
7084
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectContent, { children: import_field_formats3.TYPE_WEIGHTS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectItem, { value: String(w.value), children: w.label }, w.value)) })
|
|
7060
7085
|
] }),
|
|
7061
7086
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(UnitInput, { label: `${label} size`, unit: "px", value: style.size, disabled, onChange: (n) => n !== null && write({ size: clampSize(n) }) })
|
|
7062
7087
|
] })
|
|
@@ -7091,9 +7116,9 @@ function ShadowSwatch({ layers, theme, size = "sm" }) {
|
|
|
7091
7116
|
{
|
|
7092
7117
|
"aria-hidden": true,
|
|
7093
7118
|
"data-records-shadow-swatch": theme,
|
|
7094
|
-
className: (0,
|
|
7119
|
+
className: (0, import_design_system16.cn)("flex shrink-0 items-center justify-center rounded-md", size === "lg" ? "h-24 w-full" : "h-7 w-11"),
|
|
7095
7120
|
style: { backgroundColor: g.ground },
|
|
7096
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0,
|
|
7121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_design_system16.cn)("rounded", size === "lg" ? "h-12 w-20" : "h-3.5 w-6"), style: { backgroundColor: g.card, boxShadow: (0, import_field_formats3.shadowCss)(layers) } })
|
|
7097
7122
|
}
|
|
7098
7123
|
);
|
|
7099
7124
|
}
|
|
@@ -7152,7 +7177,7 @@ function ShadowEditor({ value, onChange, disabled, id, label }) {
|
|
|
7152
7177
|
type: "button",
|
|
7153
7178
|
role: "tab",
|
|
7154
7179
|
"aria-selected": theme === t,
|
|
7155
|
-
className: (0,
|
|
7180
|
+
className: (0, import_design_system16.cn)("rounded-md px-2 py-0.5 text-xs", theme === t ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
7156
7181
|
onClick: () => setTheme(t),
|
|
7157
7182
|
children: t === "light" ? "Light" : "Dark"
|
|
7158
7183
|
},
|
|
@@ -7181,7 +7206,7 @@ function ShadowPreview({ value }) {
|
|
|
7181
7206
|
}
|
|
7182
7207
|
var CHECKER = "repeating-conic-gradient(#d4d4d8 0% 25%, #ffffff 0% 50%) 50% / 8px 8px";
|
|
7183
7208
|
function OpacitySwatch({ opacity, size = "sm" }) {
|
|
7184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0,
|
|
7209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, className: (0, import_design_system16.cn)("relative inline-block shrink-0 overflow-hidden rounded border border-border", size === "lg" ? "h-24 w-full" : "h-5 w-5"), style: { background: CHECKER }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "absolute inset-0 bg-foreground", style: { opacity } }) });
|
|
7185
7210
|
}
|
|
7186
7211
|
function OpacityView({ value }) {
|
|
7187
7212
|
const o = (0, import_field_formats3.readOpacity)(value);
|
|
@@ -7208,7 +7233,7 @@ function OpacityPreview({ value }) {
|
|
|
7208
7233
|
}
|
|
7209
7234
|
function MotionTrack({ motion, size = "sm" }) {
|
|
7210
7235
|
const id = `m${Math.round(motion.duration)}-${motion.easing.replace(/[^a-z0-9]/gi, "")}`;
|
|
7211
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { "aria-hidden": true, className: (0,
|
|
7236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { "aria-hidden": true, className: (0, import_design_system16.cn)("relative inline-block shrink-0 rounded-full bg-muted", size === "lg" ? "h-3 w-full" : "h-2 w-12"), children: [
|
|
7212
7237
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("style", { children: `@keyframes records-motion-${id}{0%{left:0}50%{left:calc(100% - var(--d))}100%{left:0}}@media (prefers-reduced-motion: reduce){[data-records-motion-dot]{animation:none!important}}` }),
|
|
7213
7238
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7214
7239
|
"span",
|
|
@@ -7238,9 +7263,9 @@ function MotionEditor({ value, onChange, disabled, id, label }) {
|
|
|
7238
7263
|
const write = (next) => onChange(JSON.stringify({ ...m, ...next }));
|
|
7239
7264
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
7240
7265
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NumberBox, { id, label: `${label} duration`, value: m.duration, unit: "ms", disabled, className: "w-24", onChange: (n) => n !== null && n >= 0 && write({ duration: n }) }),
|
|
7241
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7242
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7243
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_design_system16.Select, { value: m.easing, disabled: disabled ?? false, onValueChange: (v) => write({ easing: v }), children: [
|
|
7267
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectTrigger, { "aria-label": `${label} easing`, className: "h-7 w-36 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectValue, {}) }),
|
|
7268
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectContent, { children: import_field_formats3.MOTION_EASINGS.map((e) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system16.SelectItem, { value: e.value, children: e.label }, e.value)) })
|
|
7244
7269
|
] }),
|
|
7245
7270
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MotionTrack, { motion: m })
|
|
7246
7271
|
] });
|
|
@@ -7274,7 +7299,7 @@ var DESIGN_LOOK_IDS = DESIGN_LOOKS.map((look) => look.id);
|
|
|
7274
7299
|
|
|
7275
7300
|
// src/looks/htmlLook.tsx
|
|
7276
7301
|
var import_react26 = require("react");
|
|
7277
|
-
var
|
|
7302
|
+
var import_design_system17 = require("@ai-matrx/design-system");
|
|
7278
7303
|
|
|
7279
7304
|
// src/looks/htmlFrame.tsx
|
|
7280
7305
|
var import_react25 = require("react");
|
|
@@ -7492,7 +7517,7 @@ function HtmlSampleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7492
7517
|
};
|
|
7493
7518
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", "data-records-look": "html_sample", "data-records-editing": "", children: [
|
|
7494
7519
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7495
|
-
|
|
7520
|
+
import_design_system17.BasicTextarea,
|
|
7496
7521
|
{
|
|
7497
7522
|
ref: box,
|
|
7498
7523
|
id,
|
|
@@ -7516,7 +7541,7 @@ function HtmlSampleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7516
7541
|
}
|
|
7517
7542
|
),
|
|
7518
7543
|
shown2.trim() ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HtmlSampleFrame, { html: shown2, title: `${label} preview` }) : null,
|
|
7519
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7544
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system17.Button, { type: "button", variant: "outline", onClick: done, children: "Done" }) })
|
|
7520
7545
|
] });
|
|
7521
7546
|
}
|
|
7522
7547
|
var FIXED_COLOUR = /#[0-9a-f]{3,8}\b|\brgba?\(|\bhsla?\(/i;
|
|
@@ -7790,7 +7815,7 @@ init_enumLabels();
|
|
|
7790
7815
|
var import_react30 = require("react");
|
|
7791
7816
|
var import_records8 = require("@ai-matrx/records");
|
|
7792
7817
|
var import_react31 = require("@ai-matrx/records/react");
|
|
7793
|
-
var
|
|
7818
|
+
var import_design_system19 = require("@ai-matrx/design-system");
|
|
7794
7819
|
init_PickOrAdd();
|
|
7795
7820
|
init_Refusal();
|
|
7796
7821
|
init_PickOne();
|
|
@@ -7858,7 +7883,7 @@ function EntityReferencePicker({
|
|
|
7858
7883
|
attrs: { "data-entity-reference-candidate": `${r.token}:${r.id}` }
|
|
7859
7884
|
}));
|
|
7860
7885
|
const kindChoice = allowed.length > 1 ? allowed.length <= 4 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mb-1 flex flex-wrap gap-1", role: "group", "aria-label": `Which kind \u2014 ${field.label}`, children: [null, ...allowed].map((token) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7861
|
-
|
|
7886
|
+
import_design_system19.Button,
|
|
7862
7887
|
{
|
|
7863
7888
|
type: "button",
|
|
7864
7889
|
size: "sm",
|
|
@@ -7929,11 +7954,11 @@ function Chips({
|
|
|
7929
7954
|
return WITHHELD_ENTITY_LABEL;
|
|
7930
7955
|
};
|
|
7931
7956
|
const multi = Boolean(field.multi);
|
|
7932
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { id, className: (0,
|
|
7957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { id, className: (0, import_design_system19.cn)("flex flex-wrap items-center gap-1", className), "aria-label": `What ${field.label} points at`, children: [
|
|
7933
7958
|
refs.length === 0 && !picker ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-[11px] text-muted-foreground", children: ENTITY_REFERENCE_EMPTY }) : null,
|
|
7934
7959
|
refs.map((r) => {
|
|
7935
7960
|
const label = labelOf(r.token, r.id, r.label);
|
|
7936
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
7961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_design_system19.Badge, { variant: "secondary", className: "gap-1 text-[11px]", "data-entity-reference-chip": `${r.token}:${r.id}`, children: [
|
|
7937
7962
|
label,
|
|
7938
7963
|
disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7939
7964
|
"button",
|
|
@@ -7960,7 +7985,7 @@ var import_core8 = require("@ai-matrx/records/core");
|
|
|
7960
7985
|
// src/WholeValue.tsx
|
|
7961
7986
|
var import_react32 = require("react");
|
|
7962
7987
|
var import_core3 = require("@ai-matrx/records/core");
|
|
7963
|
-
var
|
|
7988
|
+
var import_design_system20 = require("@ai-matrx/design-system");
|
|
7964
7989
|
init_host();
|
|
7965
7990
|
var import_outbound_react2 = require("@ai-matrx/kit/outbound-react");
|
|
7966
7991
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
@@ -7986,12 +8011,63 @@ init_choiceLooks();
|
|
|
7986
8011
|
var import_field_formats7 = require("@ai-matrx/design-system/field-formats");
|
|
7987
8012
|
|
|
7988
8013
|
// src/formattedValue.tsx
|
|
7989
|
-
var
|
|
8014
|
+
var import_react34 = require("react");
|
|
7990
8015
|
var import_data_table2 = require("@ai-matrx/design-system/data-table");
|
|
7991
8016
|
var import_field_formats5 = require("@ai-matrx/design-system/field-formats");
|
|
7992
|
-
var
|
|
8017
|
+
var import_design_system22 = require("@ai-matrx/design-system");
|
|
7993
8018
|
var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
|
|
8019
|
+
|
|
8020
|
+
// src/LinkPreviewCard.tsx
|
|
8021
|
+
var import_react33 = require("react");
|
|
8022
|
+
var import_design_system21 = require("@ai-matrx/design-system");
|
|
8023
|
+
init_host();
|
|
7994
8024
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8025
|
+
var answers = /* @__PURE__ */ new Map();
|
|
8026
|
+
function LinkPreviewCard({ url, children }) {
|
|
8027
|
+
const port = useRecordsUi().linkPreview;
|
|
8028
|
+
const [preview, setPreview] = (0, import_react33.useState)(void 0);
|
|
8029
|
+
const [open, setOpen] = (0, import_react33.useState)(false);
|
|
8030
|
+
const timer = (0, import_react33.useRef)(null);
|
|
8031
|
+
(0, import_react33.useEffect)(() => () => void (timer.current && clearTimeout(timer.current)), []);
|
|
8032
|
+
if (!port) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children });
|
|
8033
|
+
const ask = () => {
|
|
8034
|
+
if (preview !== void 0) return;
|
|
8035
|
+
let pending = answers.get(url);
|
|
8036
|
+
if (!pending) {
|
|
8037
|
+
pending = port.read(url).catch(() => null);
|
|
8038
|
+
answers.set(url, pending);
|
|
8039
|
+
}
|
|
8040
|
+
void pending.then((found) => setPreview(found));
|
|
8041
|
+
};
|
|
8042
|
+
const enter = () => {
|
|
8043
|
+
ask();
|
|
8044
|
+
if (timer.current) clearTimeout(timer.current);
|
|
8045
|
+
timer.current = setTimeout(() => setOpen(true), 350);
|
|
8046
|
+
};
|
|
8047
|
+
const leave = () => {
|
|
8048
|
+
if (timer.current) clearTimeout(timer.current);
|
|
8049
|
+
setOpen(false);
|
|
8050
|
+
};
|
|
8051
|
+
const shown2 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
8052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_design_system21.HoverCard, { open: open && shown2 !== null, onOpenChange: (next) => next ? void 0 : setOpen(false), children: [
|
|
8053
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_design_system21.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: enter, onMouseLeave: leave, onFocus: enter, onBlur: leave, children }) }),
|
|
8054
|
+
shown2 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_design_system21.HoverCardContent, { align: "start", className: "w-72 space-y-1.5 p-2 text-xs", "data-records-link-preview": "", children: [
|
|
8055
|
+
shown2.imageUrl ? (
|
|
8056
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
8057
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: shown2.imageUrl, alt: "", className: "h-28 w-full rounded object-cover", referrerPolicy: "no-referrer" })
|
|
8058
|
+
) : null,
|
|
8059
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
8060
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_design_system21.SiteIcon, { site: url, iconUrl: shown2.faviconUrl, className: "h-3.5 w-3.5" }),
|
|
8061
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "truncate text-muted-foreground", children: shown2.siteName ?? "" })
|
|
8062
|
+
] }),
|
|
8063
|
+
shown2.title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "line-clamp-2 font-medium", children: shown2.title }) : null,
|
|
8064
|
+
shown2.description ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "line-clamp-3 text-muted-foreground", children: shown2.description }) : null
|
|
8065
|
+
] }) : null
|
|
8066
|
+
] });
|
|
8067
|
+
}
|
|
8068
|
+
|
|
8069
|
+
// src/formattedValue.tsx
|
|
8070
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
7995
8071
|
var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
|
|
7996
8072
|
var own2 = (event) => event.stopPropagation();
|
|
7997
8073
|
function numberOf2(value) {
|
|
@@ -8009,11 +8085,11 @@ function RatingStars({
|
|
|
8009
8085
|
label,
|
|
8010
8086
|
selectFirst
|
|
8011
8087
|
}) {
|
|
8012
|
-
const armed = (0,
|
|
8088
|
+
const armed = (0, import_react34.useRef)(true);
|
|
8013
8089
|
const score = numberOf2(value) ?? 0;
|
|
8014
8090
|
const shown2 = Math.round(score);
|
|
8015
8091
|
const said2 = `${shown2} out of ${max}`;
|
|
8016
|
-
return /* @__PURE__ */ (0,
|
|
8092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8017
8093
|
"span",
|
|
8018
8094
|
{
|
|
8019
8095
|
"data-records-rating": "",
|
|
@@ -8025,8 +8101,8 @@ function RatingStars({
|
|
|
8025
8101
|
children: Array.from({ length: max }, (_, i) => {
|
|
8026
8102
|
const n = i + 1;
|
|
8027
8103
|
const lit = n <= shown2;
|
|
8028
|
-
const star = /* @__PURE__ */ (0,
|
|
8029
|
-
return onRate ? /* @__PURE__ */ (0,
|
|
8104
|
+
const star = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": true, className: (0, import_design_system22.cn)("text-sm leading-none", lit ? "text-amber-400" : "text-muted-foreground/40"), children: "\u2605" });
|
|
8105
|
+
return onRate ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8030
8106
|
"button",
|
|
8031
8107
|
{
|
|
8032
8108
|
type: "button",
|
|
@@ -8051,7 +8127,7 @@ function RatingStars({
|
|
|
8051
8127
|
children: star
|
|
8052
8128
|
},
|
|
8053
8129
|
n
|
|
8054
|
-
) : /* @__PURE__ */ (0,
|
|
8130
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: star }, n);
|
|
8055
8131
|
})
|
|
8056
8132
|
}
|
|
8057
8133
|
);
|
|
@@ -8059,20 +8135,20 @@ function RatingStars({
|
|
|
8059
8135
|
function rich(id, text, raw, format) {
|
|
8060
8136
|
switch (id) {
|
|
8061
8137
|
case "email":
|
|
8062
|
-
return /* @__PURE__ */ (0,
|
|
8138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: readableLink(text) }) });
|
|
8063
8139
|
case "url":
|
|
8064
|
-
return /* @__PURE__ */ (0,
|
|
8140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LinkPreviewCard, { url: text.includes("://") ? text : `https://${text}`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_outbound_react3.OutboundLink, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: text }) }) });
|
|
8065
8141
|
case "phone":
|
|
8066
|
-
return /* @__PURE__ */ (0,
|
|
8142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate tabular-nums", children: (0, import_field_formats5.formatPhone)(text) }) });
|
|
8067
8143
|
case "address":
|
|
8068
|
-
return /* @__PURE__ */ (0,
|
|
8144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8069
8145
|
import_outbound_react3.OutboundLink,
|
|
8070
8146
|
{
|
|
8071
8147
|
href: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(text)}`,
|
|
8072
8148
|
className: LINK,
|
|
8073
8149
|
title: "Open in maps",
|
|
8074
8150
|
onClick: own2,
|
|
8075
|
-
children: /* @__PURE__ */ (0,
|
|
8151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: text })
|
|
8076
8152
|
}
|
|
8077
8153
|
);
|
|
8078
8154
|
case "progress": {
|
|
@@ -8080,8 +8156,8 @@ function rich(id, text, raw, format) {
|
|
|
8080
8156
|
if (n === null) return void 0;
|
|
8081
8157
|
const pct = format.options?.percentScale === "fraction" ? n * 100 : n;
|
|
8082
8158
|
const clamped = Math.max(0, Math.min(100, pct));
|
|
8083
|
-
return /* @__PURE__ */ (0,
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "inline-flex w-full min-w-0 items-center gap-2", title: text, children: [
|
|
8160
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8085
8161
|
"span",
|
|
8086
8162
|
{
|
|
8087
8163
|
role: "progressbar",
|
|
@@ -8089,24 +8165,24 @@ function rich(id, text, raw, format) {
|
|
|
8089
8165
|
"aria-valuemax": 100,
|
|
8090
8166
|
"aria-valuenow": Math.round(clamped),
|
|
8091
8167
|
className: "h-1.5 min-w-8 flex-1 overflow-hidden rounded-full bg-muted",
|
|
8092
|
-
children: /* @__PURE__ */ (0,
|
|
8168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: (0, import_design_system22.cn)("block h-full rounded-full", pct >= 100 ? "bg-emerald-500" : "bg-primary"), style: { width: `${clamped}%` } })
|
|
8093
8169
|
}
|
|
8094
8170
|
),
|
|
8095
|
-
/* @__PURE__ */ (0,
|
|
8171
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: text })
|
|
8096
8172
|
] });
|
|
8097
8173
|
}
|
|
8098
8174
|
case "color":
|
|
8099
|
-
return /* @__PURE__ */ (0,
|
|
8100
|
-
/* @__PURE__ */ (0,
|
|
8101
|
-
/* @__PURE__ */ (0,
|
|
8175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
8176
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "h-4 w-4 shrink-0 rounded border border-border", style: { backgroundColor: text } }),
|
|
8177
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { className: "font-mono text-xs", children: text })
|
|
8102
8178
|
] });
|
|
8103
8179
|
case "tags": {
|
|
8104
8180
|
const items = Array.isArray(raw) ? raw.map(String) : text.split(",").map((s) => s.trim()).filter(Boolean);
|
|
8105
8181
|
if (items.length === 0) return void 0;
|
|
8106
|
-
return /* @__PURE__ */ (0,
|
|
8182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex flex-wrap items-center gap-1", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "inline-flex items-center rounded-md border border-border bg-muted px-1.5 py-0.5 text-xs", children: item }, `${item}-${i}`)) });
|
|
8107
8183
|
}
|
|
8108
8184
|
case "rating":
|
|
8109
|
-
return numberOf2(raw) === null ? void 0 : /* @__PURE__ */ (0,
|
|
8185
|
+
return numberOf2(raw) === null ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RatingStars, { value: raw, max: format.options?.ratingMax ?? 5 });
|
|
8110
8186
|
default:
|
|
8111
8187
|
return void 0;
|
|
8112
8188
|
}
|
|
@@ -8121,16 +8197,16 @@ function FormattedValue({
|
|
|
8121
8197
|
const score = numberOf2(value);
|
|
8122
8198
|
const max = format.options?.ratingMax ?? 5;
|
|
8123
8199
|
if (def?.id === "rating" && onRate && (value === null || value === void 0 || value === "" || score !== null && score >= 0 && score <= max)) {
|
|
8124
|
-
return /* @__PURE__ */ (0,
|
|
8200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RatingStars, { value, max: format.options?.ratingMax ?? 5, onRate, selectFirst });
|
|
8125
8201
|
}
|
|
8126
8202
|
const result = (0, import_field_formats5.formatFieldValue)(value, format);
|
|
8127
|
-
if (!result.ok || result.empty || !def?.rich) return /* @__PURE__ */ (0,
|
|
8203
|
+
if (!result.ok || result.empty || !def?.rich) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_data_table2.FormattedCell, { result });
|
|
8128
8204
|
const look = fieldLookFor(def.id);
|
|
8129
8205
|
if (look) {
|
|
8130
8206
|
const View = look.View;
|
|
8131
|
-
return /* @__PURE__ */ (0,
|
|
8207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(View, { value, format });
|
|
8132
8208
|
}
|
|
8133
|
-
return rich(def.id, result.text, value, format) ?? /* @__PURE__ */ (0,
|
|
8209
|
+
return rich(def.id, result.text, value, format) ?? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_data_table2.FormattedCell, { result });
|
|
8134
8210
|
}
|
|
8135
8211
|
function linkChipText(raw) {
|
|
8136
8212
|
try {
|
|
@@ -8146,59 +8222,10 @@ function linkChipText(raw) {
|
|
|
8146
8222
|
// src/values.tsx
|
|
8147
8223
|
init_host();
|
|
8148
8224
|
|
|
8149
|
-
// src/LinkPreviewCard.tsx
|
|
8150
|
-
var import_react34 = require("react");
|
|
8151
|
-
var import_design_system21 = require("@ai-matrx/design-system");
|
|
8152
|
-
init_host();
|
|
8153
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8154
|
-
var answers = /* @__PURE__ */ new Map();
|
|
8155
|
-
function LinkPreviewCard({ url, children }) {
|
|
8156
|
-
const port = useRecordsUi().linkPreview;
|
|
8157
|
-
const [preview, setPreview] = (0, import_react34.useState)(void 0);
|
|
8158
|
-
const [open, setOpen] = (0, import_react34.useState)(false);
|
|
8159
|
-
const timer = (0, import_react34.useRef)(null);
|
|
8160
|
-
(0, import_react34.useEffect)(() => () => void (timer.current && clearTimeout(timer.current)), []);
|
|
8161
|
-
if (!port) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children });
|
|
8162
|
-
const ask = () => {
|
|
8163
|
-
if (preview !== void 0) return;
|
|
8164
|
-
let pending = answers.get(url);
|
|
8165
|
-
if (!pending) {
|
|
8166
|
-
pending = port.read(url).catch(() => null);
|
|
8167
|
-
answers.set(url, pending);
|
|
8168
|
-
}
|
|
8169
|
-
void pending.then((found) => setPreview(found));
|
|
8170
|
-
};
|
|
8171
|
-
const enter = () => {
|
|
8172
|
-
ask();
|
|
8173
|
-
if (timer.current) clearTimeout(timer.current);
|
|
8174
|
-
timer.current = setTimeout(() => setOpen(true), 350);
|
|
8175
|
-
};
|
|
8176
|
-
const leave = () => {
|
|
8177
|
-
if (timer.current) clearTimeout(timer.current);
|
|
8178
|
-
setOpen(false);
|
|
8179
|
-
};
|
|
8180
|
-
const shown2 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
8181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_design_system21.HoverCard, { open: open && shown2 !== null, onOpenChange: (next) => next ? void 0 : setOpen(false), children: [
|
|
8182
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system21.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: enter, onMouseLeave: leave, onFocus: enter, onBlur: leave, children }) }),
|
|
8183
|
-
shown2 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_design_system21.HoverCardContent, { align: "start", className: "w-72 space-y-1.5 p-2 text-xs", "data-records-link-preview": "", children: [
|
|
8184
|
-
shown2.imageUrl ? (
|
|
8185
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
8186
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("img", { src: shown2.imageUrl, alt: "", className: "h-28 w-full rounded object-cover", referrerPolicy: "no-referrer" })
|
|
8187
|
-
) : null,
|
|
8188
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
8189
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system21.SiteIcon, { site: url, iconUrl: shown2.faviconUrl, className: "h-3.5 w-3.5" }),
|
|
8190
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-muted-foreground", children: shown2.siteName ?? "" })
|
|
8191
|
-
] }),
|
|
8192
|
-
shown2.title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "line-clamp-2 font-medium", children: shown2.title }) : null,
|
|
8193
|
-
shown2.description ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "line-clamp-3 text-muted-foreground", children: shown2.description }) : null
|
|
8194
|
-
] }) : null
|
|
8195
|
-
] });
|
|
8196
|
-
}
|
|
8197
|
-
|
|
8198
8225
|
// src/gridAttachments.tsx
|
|
8199
8226
|
var import_react36 = require("react");
|
|
8200
8227
|
var import_react37 = require("@ai-matrx/records/react");
|
|
8201
|
-
var
|
|
8228
|
+
var import_design_system24 = require("@ai-matrx/design-system");
|
|
8202
8229
|
init_host();
|
|
8203
8230
|
init_names();
|
|
8204
8231
|
init_FilePicker();
|
|
@@ -8273,7 +8300,7 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
8273
8300
|
type: "button",
|
|
8274
8301
|
title,
|
|
8275
8302
|
"aria-label": onPreview ? `Preview ${words}` : words,
|
|
8276
|
-
className: (0,
|
|
8303
|
+
className: (0, import_design_system24.cn)(
|
|
8277
8304
|
"relative block size-20 overflow-hidden rounded-md border bg-muted",
|
|
8278
8305
|
"[[data-matrx-cell-lines]_&]:size-6 [[data-matrx-cell-lines=two]_&]:size-10 [[data-matrx-cell-lines=four]_&]:size-[4.5rem] [[data-matrx-cell-lines=six]_&]:size-24"
|
|
8279
8306
|
),
|
|
@@ -8303,10 +8330,10 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
8303
8330
|
] });
|
|
8304
8331
|
}
|
|
8305
8332
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
8306
|
-
|
|
8333
|
+
import_design_system24.Badge,
|
|
8307
8334
|
{
|
|
8308
8335
|
variant: "secondary",
|
|
8309
|
-
className: (0,
|
|
8336
|
+
className: (0, import_design_system24.cn)("max-w-[14rem] gap-1 text-[11px]", onPreview && "cursor-pointer"),
|
|
8310
8337
|
"data-records-file-chip": id,
|
|
8311
8338
|
title,
|
|
8312
8339
|
...onPreview ? {
|
|
@@ -8394,8 +8421,8 @@ function AttachmentViewer({
|
|
|
8394
8421
|
const name = read?.name ?? (read ? FILE_CHIP_UNREAD : "\u2026");
|
|
8395
8422
|
const href = read?.fileId ? host.hrefForFile?.({ fileId: read.fileId }) : void 0;
|
|
8396
8423
|
const go = (way) => onIndex(stepAttachment(index, ids.length, way));
|
|
8397
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8398
|
-
|
|
8424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
8425
|
+
import_design_system24.DialogContent,
|
|
8399
8426
|
{
|
|
8400
8427
|
className: "sm:max-w-3xl",
|
|
8401
8428
|
"data-records-attachment-viewer": id,
|
|
@@ -8422,11 +8449,11 @@ function AttachmentViewer({
|
|
|
8422
8449
|
},
|
|
8423
8450
|
onClick: (event) => event.stopPropagation(),
|
|
8424
8451
|
children: [
|
|
8425
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8452
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.DialogTitle, { className: "truncate text-sm", children: name }) }),
|
|
8426
8453
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "relative h-[60vh] w-full overflow-hidden rounded-md bg-muted", "data-records-attachment-stage": "", children: read?.fileId ? host.fileImage?.({ fileId: read.fileId, alt: name }) : null }),
|
|
8427
8454
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8428
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8429
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8455
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Button, { size: "sm", variant: "outline", "aria-label": "Previous file", disabled: index === 0, onClick: () => go(-1), "data-records-attachment-previous": "", children: "\u2190" }),
|
|
8456
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Button, { size: "sm", variant: "outline", "aria-label": "Next file", disabled: index >= ids.length - 1, onClick: () => go(1), "data-records-attachment-next": "", children: "\u2192" }),
|
|
8430
8457
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", "data-records-attachment-position": "", children: [
|
|
8431
8458
|
index + 1,
|
|
8432
8459
|
" of ",
|
|
@@ -8492,7 +8519,7 @@ function AttachmentControl({
|
|
|
8492
8519
|
}
|
|
8493
8520
|
),
|
|
8494
8521
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
8495
|
-
host.pickFiles ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8522
|
+
host.pickFiles ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system24.Button, { size: "sm", variant: "outline", disabled: disabled || busy, onClick: () => void pick(), "data-records-attach-files": "", children: busy ? "Choosing\u2026" : attachmentIdsOf(value).length > 0 ? "Add files\u2026" : "Attach files\u2026" }) : null,
|
|
8496
8523
|
host.upload ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8497
8524
|
FilePicker,
|
|
8498
8525
|
{
|
|
@@ -8519,7 +8546,7 @@ function AttachmentControl({
|
|
|
8519
8546
|
|
|
8520
8547
|
// src/ReferenceChips.tsx
|
|
8521
8548
|
var import_records9 = require("@ai-matrx/records");
|
|
8522
|
-
var
|
|
8549
|
+
var import_design_system25 = require("@ai-matrx/design-system");
|
|
8523
8550
|
init_host();
|
|
8524
8551
|
init_kindValues();
|
|
8525
8552
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -8566,14 +8593,14 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
8566
8593
|
const host = useRecordsUi();
|
|
8567
8594
|
const look = useEmbeddedLook();
|
|
8568
8595
|
const pending = reference.label == null && reference.token === "record" && !waiting && !host.renderReference;
|
|
8569
|
-
const pendingMark = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8596
|
+
const pendingMark = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system25.Skeleton, { "aria-label": "Loading", "data-records-reference-pending": "", className: "inline-block h-3 w-16 shrink-0 rounded-sm align-middle" });
|
|
8570
8597
|
const words = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
|
|
8571
8598
|
const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words }) : null;
|
|
8572
8599
|
if (look?.plainRelation) {
|
|
8573
8600
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
8574
8601
|
"span",
|
|
8575
8602
|
{
|
|
8576
|
-
className: (0,
|
|
8603
|
+
className: (0, import_design_system25.cn)(
|
|
8577
8604
|
"inline-flex max-w-full min-w-0 items-center gap-1.5 text-sm text-foreground hover:underline [&_a]:text-inherit [&_a]:no-underline [&_a:hover]:underline",
|
|
8578
8605
|
reference.archived && "opacity-70"
|
|
8579
8606
|
),
|
|
@@ -8590,10 +8617,10 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
8590
8617
|
);
|
|
8591
8618
|
}
|
|
8592
8619
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
8593
|
-
|
|
8620
|
+
import_design_system25.Badge,
|
|
8594
8621
|
{
|
|
8595
8622
|
variant: "secondary",
|
|
8596
|
-
className: (0,
|
|
8623
|
+
className: (0, import_design_system25.cn)(
|
|
8597
8624
|
"max-w-full min-w-0 gap-1 px-1.5 py-0 text-[11px] font-normal",
|
|
8598
8625
|
reference.archived && "opacity-70"
|
|
8599
8626
|
),
|
|
@@ -8621,7 +8648,7 @@ function KindValueCell({
|
|
|
8621
8648
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "flex min-w-0 max-w-full items-center", "data-records-kind-value": kv.kind, children: host.renderKind({ value: kv.value, kind: kv.kind, where, title }) });
|
|
8622
8649
|
}
|
|
8623
8650
|
const named = kv.items.map(kindItemWords).filter((w) => w !== null);
|
|
8624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: (0,
|
|
8651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: (0, import_design_system25.cn)("flex min-w-0 flex-wrap gap-1"), "data-records-kind-value": kv.kind, title: JSON.stringify(kv.value), children: named.length > 0 ? named.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system25.Badge, { variant: "secondary", className: "px-1.5 py-0 text-[11px] font-normal", children: w }, `${w}-${i}`)) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system25.Badge, { variant: "outline", className: "px-1.5 py-0 text-[11px] font-normal", children: kindLabel(kv.kind) }) });
|
|
8625
8652
|
}
|
|
8626
8653
|
|
|
8627
8654
|
// src/values.tsx
|
|
@@ -8738,7 +8765,7 @@ init_host();
|
|
|
8738
8765
|
var import_react39 = require("react");
|
|
8739
8766
|
var import_records11 = require("@ai-matrx/records");
|
|
8740
8767
|
var import_react40 = require("@ai-matrx/records/react");
|
|
8741
|
-
var
|
|
8768
|
+
var import_design_system26 = require("@ai-matrx/design-system");
|
|
8742
8769
|
init_PickOrAdd();
|
|
8743
8770
|
init_personChip();
|
|
8744
8771
|
init_host();
|
|
@@ -8826,10 +8853,10 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
|
|
|
8826
8853
|
}, [client, personTable, picked.length, people.length]);
|
|
8827
8854
|
const listed = (0, import_records11.rankTypedMatches)(members ?? [], search, memberName);
|
|
8828
8855
|
if (!membersPort || !client) {
|
|
8829
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: (0,
|
|
8856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: (0, import_design_system26.cn)("text-xs text-muted-foreground", className), children: NO_MEMBERS_REASON });
|
|
8830
8857
|
}
|
|
8831
8858
|
if (!personTable) {
|
|
8832
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: (0,
|
|
8859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: (0, import_design_system26.cn)("text-xs text-muted-foreground", className), children: [
|
|
8833
8860
|
fieldName(field),
|
|
8834
8861
|
" is a person field, but it does not say which Table the people are records of yet, so there is nothing to pick from. A table admin sets its target in the field editor."
|
|
8835
8862
|
] });
|
|
@@ -8880,7 +8907,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
|
|
|
8880
8907
|
);
|
|
8881
8908
|
const anchored = autoOpen === true;
|
|
8882
8909
|
const cellChips = picked.map((recordId) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PersonChip, { name: nameOfRecord(recordId), ...disabled || anchored ? {} : { onRemove: () => drop(recordId) } }, recordId));
|
|
8883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0,
|
|
8910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_design_system26.cn)("flex flex-wrap items-center gap-1", className), children: [
|
|
8884
8911
|
anchored && !disabled ? null : cellChips,
|
|
8885
8912
|
disabled ? null : (
|
|
8886
8913
|
// THE ONE "PICK OR ADD" BUILDER (lane CELL-EDITORS, 2026-10-06): the person list used to carry
|
|
@@ -8975,7 +9002,7 @@ var import_outbound_react6 = require("@ai-matrx/kit/outbound-react");
|
|
|
8975
9002
|
|
|
8976
9003
|
// src/structuredValue.tsx
|
|
8977
9004
|
var import_react51 = require("react");
|
|
8978
|
-
var
|
|
9005
|
+
var import_design_system30 = require("@ai-matrx/design-system");
|
|
8979
9006
|
var import_controls = require("@ai-matrx/design-system/controls");
|
|
8980
9007
|
var import_react52 = require("@ai-matrx/alchemy/react");
|
|
8981
9008
|
var import_outbound_react5 = require("@ai-matrx/kit/outbound-react");
|
|
@@ -9104,7 +9131,7 @@ function Thumb({ src, size }) {
|
|
|
9104
9131
|
alt: "",
|
|
9105
9132
|
loading: "lazy",
|
|
9106
9133
|
referrerPolicy: "no-referrer",
|
|
9107
|
-
className: (0,
|
|
9134
|
+
className: (0, import_design_system30.cn)("rounded border border-border bg-muted object-cover", size === "sm" ? "size-6" : "size-12")
|
|
9108
9135
|
}
|
|
9109
9136
|
) });
|
|
9110
9137
|
}
|
|
@@ -9115,7 +9142,7 @@ function LinkChip({ href, dense }) {
|
|
|
9115
9142
|
href,
|
|
9116
9143
|
title: href,
|
|
9117
9144
|
onClick: stop,
|
|
9118
|
-
className: (0,
|
|
9145
|
+
className: (0, import_design_system30.cn)(
|
|
9119
9146
|
"inline-flex min-w-0 max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent",
|
|
9120
9147
|
// A percentage max-width means nothing inside an auto-layout table cell, so a link column would hold
|
|
9121
9148
|
// its full address; in a table the chip gets a real ceiling and shortens with an ellipsis.
|
|
@@ -9144,7 +9171,7 @@ function Scalar({ value, keyName, dense }) {
|
|
|
9144
9171
|
const date = dateWords(text);
|
|
9145
9172
|
if (date) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { title: text, children: date });
|
|
9146
9173
|
if (!dense && ui.renderText && text.length > 40 && MARKDOWN.test(text)) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "min-w-0", children: ui.renderText(text, "cell") });
|
|
9147
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: (0,
|
|
9174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: (0, import_design_system30.cn)(dense ? "line-clamp-2 break-words" : "whitespace-pre-wrap [overflow-wrap:anywhere]"), children: text });
|
|
9148
9175
|
}
|
|
9149
9176
|
var TABLE_ROWS = 8;
|
|
9150
9177
|
var TABLE_COLUMNS = 12;
|
|
@@ -9158,7 +9185,7 @@ function RecordsTable({ items }) {
|
|
|
9158
9185
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("th", { scope: "col", className: "px-2 py-1 font-medium text-muted-foreground [overflow-wrap:anywhere]", children: structuredKeyWords(k) }, k)) }) }),
|
|
9159
9186
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: "min-w-[2rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
|
|
9160
9187
|
] }) }),
|
|
9161
|
-
items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9188
|
+
items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Button, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
|
|
9162
9189
|
stop(e);
|
|
9163
9190
|
setAll((a) => !a);
|
|
9164
9191
|
}, children: all ? "Show fewer" : `Show all ${items.length}` }) : null
|
|
@@ -9184,7 +9211,7 @@ function Nested({ value, keyName, dense, depth = 0 }) {
|
|
|
9184
9211
|
}
|
|
9185
9212
|
function ScalarChips({ items, keyName }) {
|
|
9186
9213
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex min-w-0 flex-wrap gap-1", "data-records-structured": "chips", children: items.map(
|
|
9187
|
-
(item, i) => typeof item === "string" && isUrl(item) ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Scalar, { value: item, keyName, dense: true }, i) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9214
|
+
(item, i) => typeof item === "string" && isUrl(item) ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Scalar, { value: item, keyName, dense: true }, i) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Badge, { variant: "secondary", className: "max-w-full text-[11px] font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "truncate", children: scalarWords(item) }) }, i)
|
|
9188
9215
|
) });
|
|
9189
9216
|
}
|
|
9190
9217
|
function Shape({ data, depth = 0 }) {
|
|
@@ -9226,12 +9253,12 @@ function StructuredValueView({ structured, label, className }) {
|
|
|
9226
9253
|
const ui = useRecordsUi();
|
|
9227
9254
|
const savable = shapeOfValue(structured.data) !== null;
|
|
9228
9255
|
const text = rawTextOf(structured);
|
|
9229
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0,
|
|
9256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0, import_design_system30.cn)("flex min-w-0 flex-col gap-1.5 whitespace-normal", className), "data-records-structured-view": "", children: [
|
|
9230
9257
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 items-center gap-1", onClick: stop, children: [
|
|
9231
9258
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0 flex-1 truncate text-xs text-muted-foreground", children: recordsCount(structured.data) }),
|
|
9232
|
-
savable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9259
|
+
savable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Button, { type: "button", variant: "ghost", size: "sm", className: "h-6 px-2 text-xs", onClick: () => setSaving(true), "data-records-structured-save": "", children: "Save as table" }) : null,
|
|
9233
9260
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9234
|
-
|
|
9261
|
+
import_design_system30.Button,
|
|
9235
9262
|
{
|
|
9236
9263
|
type: "button",
|
|
9237
9264
|
variant: raw ? "secondary" : "ghost",
|
|
@@ -9246,10 +9273,10 @@ function StructuredValueView({ structured, label, className }) {
|
|
|
9246
9273
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react52.AlchemyMenu, { label, sourceId: `records:value:${label}`, size: "xs", json: () => structured.data, human: () => text })
|
|
9247
9274
|
] }),
|
|
9248
9275
|
raw ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/60 p-2 font-mono text-xs", "data-records-structured-raw": "", children: structured.raw !== null ? prettyJsonText(structured.raw) : text }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Shape, { data: structured.data }),
|
|
9249
|
-
saving ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9276
|
+
saving ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.Dialog, { open: true, onOpenChange: (open) => {
|
|
9250
9277
|
if (!open) setSaving(false);
|
|
9251
|
-
}, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9252
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9278
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system30.DialogContent, { className: "max-h-[90vh] max-w-3xl overflow-y-auto", children: [
|
|
9279
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system30.DialogTitle, { children: [
|
|
9253
9280
|
"Save ",
|
|
9254
9281
|
label,
|
|
9255
9282
|
" as a table"
|
|
@@ -9276,8 +9303,8 @@ function StructuredCell({ structured, label }) {
|
|
|
9276
9303
|
const summary = structuredSummary(structured.data);
|
|
9277
9304
|
const first = Array.isArray(structured.data) ? structured.data.find(isPlainObject2) : structured.data;
|
|
9278
9305
|
const picture = isPlainObject2(first) ? Object.entries(first).find(([k, v]) => isImageUrl(v, k))?.[1] : void 0;
|
|
9279
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9280
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system30.Popover, { children: [
|
|
9307
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system30.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9281
9308
|
"button",
|
|
9282
9309
|
{
|
|
9283
9310
|
type: "button",
|
|
@@ -9293,7 +9320,7 @@ function StructuredCell({ structured, label }) {
|
|
|
9293
9320
|
}
|
|
9294
9321
|
) }),
|
|
9295
9322
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9296
|
-
|
|
9323
|
+
import_design_system30.PopoverContent,
|
|
9297
9324
|
{
|
|
9298
9325
|
align: "start",
|
|
9299
9326
|
collisionPadding: 8,
|
|
@@ -9419,14 +9446,14 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9419
9446
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex flex-wrap gap-1", "data-records-choice-chips": "", children: items.map((item, i) => {
|
|
9420
9447
|
const chip = chipOf(item);
|
|
9421
9448
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9422
|
-
|
|
9449
|
+
import_design_system31.Badge,
|
|
9423
9450
|
{
|
|
9424
9451
|
variant: "outline",
|
|
9425
|
-
className: (0,
|
|
9452
|
+
className: (0, import_design_system31.cn)("text-[11px]", chip.className),
|
|
9426
9453
|
"data-records-choice-chip": "",
|
|
9427
9454
|
...chip.tinted ? { "data-records-choice-tint": "" } : {},
|
|
9428
9455
|
children: [
|
|
9429
|
-
look?.choiceDot ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: (0,
|
|
9456
|
+
look?.choiceDot ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: (0, import_design_system31.cn)("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
|
|
9430
9457
|
statusMark(field, item, Array.isArray(value) ? void 0 : document2),
|
|
9431
9458
|
scalarText(field, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
|
|
9432
9459
|
]
|
|
@@ -9437,7 +9464,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9437
9464
|
}
|
|
9438
9465
|
if (kind === "attachment") return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AttachmentChips, { value });
|
|
9439
9466
|
if (Array.isArray(value)) {
|
|
9440
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system31.Badge, { variant: "secondary", className: "text-[11px]", children: scalarText(field, item, labels) }, `${String(item)}-${i}`)) });
|
|
9441
9468
|
}
|
|
9442
9469
|
const pictureAt = imageAddressOf(field, value);
|
|
9443
9470
|
if (pictureAt) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ImageUrlValue, { url: pictureAt, alt: field.label || field.key, room });
|
|
@@ -9477,7 +9504,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9477
9504
|
if (typeof value === "boolean") {
|
|
9478
9505
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: kind === "checkbox" ? "text-sm" : "", title: value ? "Yes" : "No", children: value ? "\u2713" : "\u2014" });
|
|
9479
9506
|
}
|
|
9480
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0,
|
|
9507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0, import_design_system31.cn)("truncate", kind === "number" || kind === "currency" || kind === "percent" ? "tabular-nums" : ""), children: scalarText(field, value, labels, stillWaitingFor) });
|
|
9481
9508
|
}
|
|
9482
9509
|
function isImageUrl2(value) {
|
|
9483
9510
|
const text = value.trim();
|
|
@@ -9505,7 +9532,7 @@ function ImageUrlValue({ url, alt, room }) {
|
|
|
9505
9532
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9506
9533
|
import_outbound_react6.OutboundLink,
|
|
9507
9534
|
{
|
|
9508
|
-
className: (0,
|
|
9535
|
+
className: (0, import_design_system31.cn)("inline-flex shrink-0 overflow-hidden rounded-md border border-border bg-muted/40", host.fileImage ? box : "min-w-0 max-w-full items-center gap-1 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent"),
|
|
9509
9536
|
href: url,
|
|
9510
9537
|
title: url,
|
|
9511
9538
|
"data-records-image-url": "",
|
|
@@ -9616,7 +9643,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
9616
9643
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm", children: SOURCE_ARCHIVED_WORDS }),
|
|
9617
9644
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: sourceArchivedSentence(state2) })
|
|
9618
9645
|
] }),
|
|
9619
|
-
state2.field_id ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9646
|
+
state2.field_id ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system32.Button, { type: "button", size: "sm", variant: "secondary", disabled: busy, onClick: () => void restore(), children: bringBackLabel(state2) }) : null,
|
|
9620
9647
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RefusalNotice, { error: refused, className: "basis-full" }) : null
|
|
9621
9648
|
]
|
|
9622
9649
|
}
|
|
@@ -9625,7 +9652,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
9625
9652
|
|
|
9626
9653
|
// src/Condition.tsx
|
|
9627
9654
|
var import_react56 = require("react");
|
|
9628
|
-
var
|
|
9655
|
+
var import_design_system33 = require("@ai-matrx/design-system");
|
|
9629
9656
|
var import_records18 = require("@ai-matrx/records");
|
|
9630
9657
|
init_PickOrAdd();
|
|
9631
9658
|
init_choiceLooks();
|
|
@@ -9802,7 +9829,7 @@ function ChoiceValues({ field, value, onChange }) {
|
|
|
9802
9829
|
};
|
|
9803
9830
|
if (!choices || choices.length === 0) {
|
|
9804
9831
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
9805
|
-
|
|
9832
|
+
import_design_system33.BasicInput,
|
|
9806
9833
|
{
|
|
9807
9834
|
className: "h-8 w-40 text-xs",
|
|
9808
9835
|
"aria-label": "Condition values, separated by commas",
|
|
@@ -9813,7 +9840,7 @@ function ChoiceValues({ field, value, onChange }) {
|
|
|
9813
9840
|
}
|
|
9814
9841
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "inline-flex flex-wrap items-center gap-1", "data-records-condition-choices": "", "data-pick-values": value.join("|"), children: [
|
|
9815
9842
|
choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
9816
|
-
|
|
9843
|
+
import_design_system33.Button,
|
|
9817
9844
|
{
|
|
9818
9845
|
type: "button",
|
|
9819
9846
|
size: "sm",
|
|
@@ -9826,7 +9853,7 @@ function ChoiceValues({ field, value, onChange }) {
|
|
|
9826
9853
|
},
|
|
9827
9854
|
c.key
|
|
9828
9855
|
)),
|
|
9829
|
-
strays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
9856
|
+
strays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system33.Button, { type: "button", size: "sm", variant: "default", className: "h-7 px-2 text-xs", "aria-pressed": true, "aria-label": `${w} (not a choice of this column)`, onClick: () => onChange(value.filter((x) => x !== w)), children: w }, `stray-${w}`))
|
|
9830
9857
|
] });
|
|
9831
9858
|
}
|
|
9832
9859
|
function ChoiceValue({ field, value, onChange }) {
|
|
@@ -9849,7 +9876,7 @@ function ChoiceValue({ field, value, onChange }) {
|
|
|
9849
9876
|
}, [client, field.id]);
|
|
9850
9877
|
if (!choices || choices.length === 0) {
|
|
9851
9878
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
9852
|
-
|
|
9879
|
+
import_design_system33.BasicInput,
|
|
9853
9880
|
{
|
|
9854
9881
|
className: "h-8 w-28 text-xs",
|
|
9855
9882
|
"aria-label": "Condition value",
|
|
@@ -10067,7 +10094,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
10067
10094
|
}
|
|
10068
10095
|
),
|
|
10069
10096
|
relative ? relativeTerm?.takesDays ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10070
|
-
|
|
10097
|
+
import_design_system33.BasicInput,
|
|
10071
10098
|
{
|
|
10072
10099
|
className: "h-8 w-16 text-xs",
|
|
10073
10100
|
type: "number",
|
|
@@ -10095,7 +10122,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
10095
10122
|
}
|
|
10096
10123
|
)
|
|
10097
10124
|
) : isChoiceColumn(chosen) && CHOICE_LIST_OPS.has(op) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChoiceValues, { field: chosen.field, value: wordsOfValue(value), onChange: (words) => write({ value: words }) }) : isChoiceColumn(chosen) && (op === "eq" || op === "ne" || op === "contains" || op === "not_contains") ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChoiceValue, { field: chosen.field, value: String(value ?? ""), onChange: (word) => write({ value: word }) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10098
|
-
|
|
10125
|
+
import_design_system33.BasicInput,
|
|
10099
10126
|
{
|
|
10100
10127
|
className: "h-8 w-28 text-xs",
|
|
10101
10128
|
"aria-label": "Condition value",
|
|
@@ -10203,7 +10230,7 @@ function ConditionGroup({
|
|
|
10203
10230
|
}
|
|
10204
10231
|
),
|
|
10205
10232
|
nested && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10206
|
-
|
|
10233
|
+
import_design_system33.Button,
|
|
10207
10234
|
{
|
|
10208
10235
|
size: "sm",
|
|
10209
10236
|
variant: "ghost",
|
|
@@ -10270,7 +10297,7 @@ function ConditionGroup({
|
|
|
10270
10297
|
) }) : null,
|
|
10271
10298
|
args.length > 0 && !drafting ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
10272
10299
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10273
|
-
|
|
10300
|
+
import_design_system33.Button,
|
|
10274
10301
|
{
|
|
10275
10302
|
size: "sm",
|
|
10276
10303
|
variant: "ghost",
|
|
@@ -10281,7 +10308,7 @@ function ConditionGroup({
|
|
|
10281
10308
|
}
|
|
10282
10309
|
),
|
|
10283
10310
|
allowNesting && (maxDepth === void 0 || depth < maxDepth) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10284
|
-
|
|
10311
|
+
import_design_system33.Button,
|
|
10285
10312
|
{
|
|
10286
10313
|
size: "sm",
|
|
10287
10314
|
variant: "ghost",
|
|
@@ -10301,7 +10328,7 @@ function ConditionGroup({
|
|
|
10301
10328
|
var import_react58 = require("react");
|
|
10302
10329
|
var import_records19 = require("@ai-matrx/records");
|
|
10303
10330
|
var import_react59 = require("@ai-matrx/records/react");
|
|
10304
|
-
var
|
|
10331
|
+
var import_design_system34 = require("@ai-matrx/design-system");
|
|
10305
10332
|
init_parity();
|
|
10306
10333
|
init_names();
|
|
10307
10334
|
init_Refusal();
|
|
@@ -10625,12 +10652,12 @@ function FieldRetype({ field, tableId, onRetyped }) {
|
|
|
10625
10652
|
};
|
|
10626
10653
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-1.5", "data-records-retype": "", children: [
|
|
10627
10654
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
10628
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
10629
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10630
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10655
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_design_system34.Select, { value: to?.id ?? "", onValueChange: (next) => setTo(targets.find((t) => t.id === next) ?? null), children: [
|
|
10656
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectTrigger, { size: "sm", "aria-label": "Change what this column holds", className: "w-auto min-w-[12rem]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectValue, { placeholder: "Change what this column holds" }) }),
|
|
10657
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectContent, { children: targets.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.SelectItem, { value: t.id, children: t.label }, t.id)) })
|
|
10631
10658
|
] }),
|
|
10632
|
-
to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10633
|
-
to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10659
|
+
to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.Button, { size: "sm", disabled: busy || asking || preview === null, onClick: () => void change(), "data-records-retype-go": "", children: busy ? "Changing\u2026" : `Change to ${to.label}` }) : null,
|
|
10660
|
+
to ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system34.Button, { size: "sm", variant: "ghost", onClick: () => setTo(null), disabled: busy, children: "Cancel" }) : null
|
|
10634
10661
|
] }),
|
|
10635
10662
|
to && asking ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
10636
10663
|
"Counting ",
|
|
@@ -10819,7 +10846,7 @@ function choiceLookForNewList(multi, rows) {
|
|
|
10819
10846
|
|
|
10820
10847
|
// src/NewerKindQuestions.tsx
|
|
10821
10848
|
var import_records21 = require("@ai-matrx/records");
|
|
10822
|
-
var
|
|
10849
|
+
var import_design_system35 = require("@ai-matrx/design-system");
|
|
10823
10850
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
10824
10851
|
var STATUS_STARTING_CHOICES = [
|
|
10825
10852
|
{ words: "Not started", group: "todo" },
|
|
@@ -10850,12 +10877,12 @@ function StatusGroupsQuestion({
|
|
|
10850
10877
|
}) {
|
|
10851
10878
|
if (rows.length === 0) return null;
|
|
10852
10879
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-1", "data-records-status-groups": "", children: [
|
|
10853
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10880
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.Label, { className: "text-xs", children: "Groups" }),
|
|
10854
10881
|
rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10855
10882
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: r.words }),
|
|
10856
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10857
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10858
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10883
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.Select, { value: r.group, onValueChange: (next) => onGroup(r.ref, next), children: [
|
|
10884
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectTrigger, { size: "sm", className: "w-36", "aria-label": `Group for ${r.words}`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectValue, {}) }),
|
|
10885
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectContent, { children: import_records21.STATUS_GROUPS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.SelectItem, { value: g, children: [
|
|
10859
10886
|
STATUS_GROUP_MARK[g],
|
|
10860
10887
|
" ",
|
|
10861
10888
|
import_records21.STATUS_GROUP_WORDS[g]
|
|
@@ -10866,10 +10893,10 @@ function StatusGroupsQuestion({
|
|
|
10866
10893
|
}
|
|
10867
10894
|
function RatingMaxQuestion({ value, onChange }) {
|
|
10868
10895
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
10869
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10870
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10871
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10872
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10896
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.Label, { className: "text-xs", children: "Out of" }),
|
|
10897
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.Select, { value: String(value), onValueChange: (next) => onChange(Number(next)), children: [
|
|
10898
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectTrigger, { size: "sm", "aria-label": "Out of", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectValue, {}) }),
|
|
10899
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectContent, { children: Array.from({ length: 10 }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.SelectItem, { value: String(n), children: [
|
|
10873
10900
|
n,
|
|
10874
10901
|
" ",
|
|
10875
10902
|
n === 1 ? "star" : "stars"
|
|
@@ -10891,19 +10918,19 @@ var SYMBOLOGY_WORDS = {
|
|
|
10891
10918
|
};
|
|
10892
10919
|
function BarcodeSymbologyQuestion({ value, onChange }) {
|
|
10893
10920
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
10894
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10895
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10896
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10897
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10898
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10899
|
-
import_records21.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10921
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.Label, { className: "text-xs", children: "Code type" }),
|
|
10922
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.Select, { value: value === "" ? "any" : value, onValueChange: (next) => onChange(next === "any" ? "" : next), children: [
|
|
10923
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectTrigger, { size: "sm", "aria-label": "Code type", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectValue, {}) }),
|
|
10924
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system35.SelectContent, { children: [
|
|
10925
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectItem, { value: "any", children: "Any code" }),
|
|
10926
|
+
import_records21.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system35.SelectItem, { value: s, children: SYMBOLOGY_WORDS[s] }, s))
|
|
10900
10927
|
] })
|
|
10901
10928
|
] })
|
|
10902
10929
|
] });
|
|
10903
10930
|
}
|
|
10904
10931
|
|
|
10905
10932
|
// src/FieldFormatPicker.tsx
|
|
10906
|
-
var
|
|
10933
|
+
var import_design_system36 = require("@ai-matrx/design-system");
|
|
10907
10934
|
var import_field_formats8 = require("@ai-matrx/design-system/field-formats");
|
|
10908
10935
|
init_PickOne();
|
|
10909
10936
|
init_choiceLooks();
|
|
@@ -11036,7 +11063,7 @@ function FieldFormatPicker({
|
|
|
11036
11063
|
control
|
|
11037
11064
|
] }, key) : null;
|
|
11038
11065
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-1", "data-records-format-picker": "", children: [
|
|
11039
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11066
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system36.Label, { className: "text-xs", htmlFor: `records-shows-as-${field.id}`, children: "Shows as" }),
|
|
11040
11067
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11041
11068
|
PickOne,
|
|
11042
11069
|
{
|
|
@@ -11225,14 +11252,14 @@ var import_records24 = require("@ai-matrx/records");
|
|
|
11225
11252
|
|
|
11226
11253
|
// src/ButtonSettings.tsx
|
|
11227
11254
|
var import_react64 = require("react");
|
|
11228
|
-
var
|
|
11255
|
+
var import_design_system39 = require("@ai-matrx/design-system");
|
|
11229
11256
|
var import_data_table5 = require("@ai-matrx/design-system/data-table");
|
|
11230
11257
|
var import_records23 = require("@ai-matrx/records");
|
|
11231
11258
|
var import_react65 = require("@ai-matrx/records/react");
|
|
11232
11259
|
|
|
11233
11260
|
// src/AccentSwatches.tsx
|
|
11234
11261
|
var import_records22 = require("@ai-matrx/records");
|
|
11235
|
-
var
|
|
11262
|
+
var import_design_system37 = require("@ai-matrx/design-system");
|
|
11236
11263
|
var import_data_table4 = require("@ai-matrx/design-system/data-table");
|
|
11237
11264
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11238
11265
|
function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACCENTS, noneLabel = "App color" }) {
|
|
@@ -11244,7 +11271,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
|
|
|
11244
11271
|
role: "radio",
|
|
11245
11272
|
"aria-checked": value === "",
|
|
11246
11273
|
onClick: () => onChange(""),
|
|
11247
|
-
className: (0,
|
|
11274
|
+
className: (0, import_design_system37.cn)(
|
|
11248
11275
|
"h-7 rounded border px-2 text-xs",
|
|
11249
11276
|
value === "" ? "border-foreground" : "border-border text-muted-foreground"
|
|
11250
11277
|
),
|
|
@@ -11260,7 +11287,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
|
|
|
11260
11287
|
"aria-label": import_data_table4.STYLE_COLOR_LABELS[c],
|
|
11261
11288
|
title: import_data_table4.STYLE_COLOR_LABELS[c],
|
|
11262
11289
|
onClick: () => onChange(c),
|
|
11263
|
-
className: (0,
|
|
11290
|
+
className: (0, import_design_system37.cn)("h-7 w-7 rounded-full border-2", import_data_table4.SWATCH_CLASS[c], value === c ? "border-foreground" : "border-transparent")
|
|
11264
11291
|
},
|
|
11265
11292
|
c
|
|
11266
11293
|
))
|
|
@@ -11271,7 +11298,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
|
|
|
11271
11298
|
init_PickOne();
|
|
11272
11299
|
|
|
11273
11300
|
// src/AddRowSettings.tsx
|
|
11274
|
-
var
|
|
11301
|
+
var import_design_system38 = require("@ai-matrx/design-system");
|
|
11275
11302
|
var import_react62 = require("@ai-matrx/records/react");
|
|
11276
11303
|
var import_react63 = require("react");
|
|
11277
11304
|
init_tablePicking();
|
|
@@ -11304,7 +11331,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
11304
11331
|
}, [client, target]);
|
|
11305
11332
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-2", "data-records-button-add-row": "", children: [
|
|
11306
11333
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11307
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11334
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system38.Label, { className: "text-xs", children: "Adds to" }),
|
|
11308
11335
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11309
11336
|
PickOne,
|
|
11310
11337
|
{
|
|
@@ -11317,7 +11344,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
11317
11344
|
)
|
|
11318
11345
|
] }),
|
|
11319
11346
|
templates.length || value.template_id ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11320
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11347
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system38.Label, { className: "text-xs", children: "Starts from" }),
|
|
11321
11348
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11322
11349
|
PickOne,
|
|
11323
11350
|
{
|
|
@@ -11399,11 +11426,11 @@ function ButtonSettingsEditor({
|
|
|
11399
11426
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-2 rounded-md border p-2", "data-records-button-settings": "", children: [
|
|
11400
11427
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
11401
11428
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
11402
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11403
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11429
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Button label" }),
|
|
11430
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.BasicInput, { className: "h-8 text-xs", value: value.label, "data-records-button-label": "", onChange: (e) => set({ label: e.target.value }) })
|
|
11404
11431
|
] }),
|
|
11405
11432
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11406
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11433
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Does" }),
|
|
11407
11434
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11408
11435
|
PickOne,
|
|
11409
11436
|
{
|
|
@@ -11417,7 +11444,7 @@ function ButtonSettingsEditor({
|
|
|
11417
11444
|
] })
|
|
11418
11445
|
] }),
|
|
11419
11446
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11420
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11447
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Color" }),
|
|
11421
11448
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11422
11449
|
AccentSwatches,
|
|
11423
11450
|
{
|
|
@@ -11429,10 +11456,10 @@ function ButtonSettingsEditor({
|
|
|
11429
11456
|
)
|
|
11430
11457
|
] }),
|
|
11431
11458
|
value.do === "open_url" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11432
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11459
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "Link" }),
|
|
11433
11460
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex gap-1", children: [
|
|
11434
11461
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11435
|
-
|
|
11462
|
+
import_design_system39.BasicInput,
|
|
11436
11463
|
{
|
|
11437
11464
|
className: "h-8 flex-1 font-mono text-xs",
|
|
11438
11465
|
placeholder: "https://",
|
|
@@ -11539,7 +11566,7 @@ function NewRowAction({
|
|
|
11539
11566
|
onMade(made.id, all);
|
|
11540
11567
|
};
|
|
11541
11568
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", "data-records-button-new-action": "", children: [
|
|
11542
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11569
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Label, { className: "text-xs", children: "New row action" }),
|
|
11543
11570
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
11544
11571
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11545
11572
|
PickOne,
|
|
@@ -11553,8 +11580,8 @@ function NewRowAction({
|
|
|
11553
11580
|
options: settable.map((f) => ({ value: f.id, label: fieldName(f) }))
|
|
11554
11581
|
}
|
|
11555
11582
|
),
|
|
11556
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11557
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11583
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.BasicInput, { className: "h-8 w-32 text-xs", placeholder: "Value", "aria-label": "Value", "data-records-button-action-value": "", value: setTo, onChange: (e) => setSetTo(e.target.value) }),
|
|
11584
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system39.Button, { type: "button", size: "sm", variant: "outline", disabled: busy || fieldId === "", "data-records-button-action-make": "", onClick: () => void make(), children: busy ? "Making\u2026" : "Make" })
|
|
11558
11585
|
] }),
|
|
11559
11586
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RefusalLine, { error: refused }) : null
|
|
11560
11587
|
] });
|
|
@@ -11847,7 +11874,7 @@ function FieldEditor(props) {
|
|
|
11847
11874
|
const offersMany = multiApplies(type) && !isTitle;
|
|
11848
11875
|
if (!mayShape) {
|
|
11849
11876
|
if (onEntity && entityRights.loading) return null;
|
|
11850
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: (0,
|
|
11877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: (0, import_design_system40.cn)("text-xs text-muted-foreground", className), children: props.tableLabel && storeLabel && whyNot ? whyNot.split(storeLabel).join(props.tableLabel) : whyNot });
|
|
11851
11878
|
}
|
|
11852
11879
|
const options = newChoices.map((r) => r.words.trim()).filter((word) => word !== "");
|
|
11853
11880
|
const shownStatusRows = type !== "status" ? [] : statusGroupRows(field, editing ? choiceList ?? [] : newChoices, statusKeys, statusGroups);
|
|
@@ -12065,16 +12092,16 @@ function FieldEditor(props) {
|
|
|
12065
12092
|
if (gone) (onRemoved ?? onSaved)?.();
|
|
12066
12093
|
else setAskingToRemove(false);
|
|
12067
12094
|
};
|
|
12068
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0,
|
|
12095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_design_system40.cn)("flex min-w-0 flex-col gap-3 text-xs", className), "data-records-field-editor": "", children: [
|
|
12069
12096
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12070
12097
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-medium", children: field ? `Field \xB7 ${fieldName(field)}` : "New field" }),
|
|
12071
12098
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ml-auto text-muted-foreground", children: tableLabel })
|
|
12072
12099
|
] }),
|
|
12073
12100
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
12074
12101
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
12075
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12102
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Name" }),
|
|
12076
12103
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12077
|
-
|
|
12104
|
+
import_design_system40.BasicInput,
|
|
12078
12105
|
{
|
|
12079
12106
|
value: label,
|
|
12080
12107
|
autoFocus: true,
|
|
@@ -12101,9 +12128,9 @@ function FieldEditor(props) {
|
|
|
12101
12128
|
) : null
|
|
12102
12129
|
] }),
|
|
12103
12130
|
field ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex flex-col gap-1 sm:col-span-2", children: [
|
|
12104
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12131
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Help text" }),
|
|
12105
12132
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12106
|
-
|
|
12133
|
+
import_design_system40.BasicInput,
|
|
12107
12134
|
{
|
|
12108
12135
|
value: description,
|
|
12109
12136
|
maxLength: 300,
|
|
@@ -12114,18 +12141,18 @@ function FieldEditor(props) {
|
|
|
12114
12141
|
)
|
|
12115
12142
|
] }) : null,
|
|
12116
12143
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12117
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12144
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "What it holds" }),
|
|
12118
12145
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12119
|
-
|
|
12146
|
+
import_design_system40.Select,
|
|
12120
12147
|
{
|
|
12121
12148
|
value: type,
|
|
12122
12149
|
disabled: editing,
|
|
12123
12150
|
onValueChange: (next) => setType(next),
|
|
12124
12151
|
children: [
|
|
12125
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12126
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12127
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12128
|
-
FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12152
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "What this field holds", ...choice?.explanation ? { title: choice.explanation } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12153
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.SelectGroup, { children: [
|
|
12154
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectLabel, { children: group }),
|
|
12155
|
+
FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: c.id, children: c.label }, c.id))
|
|
12129
12156
|
] }, group)) })
|
|
12130
12157
|
]
|
|
12131
12158
|
}
|
|
@@ -12136,7 +12163,7 @@ function FieldEditor(props) {
|
|
|
12136
12163
|
type === "formula" && others.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12137
12164
|
editing ? startingFormulaText.trim() === "" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: EDITING_A_WORKED_OUT_COLUMN }) : null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-1", role: "group", "aria-label": "How to make this column", children: [
|
|
12138
12165
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12139
|
-
|
|
12166
|
+
import_design_system40.Button,
|
|
12140
12167
|
{
|
|
12141
12168
|
type: "button",
|
|
12142
12169
|
size: "sm",
|
|
@@ -12147,7 +12174,7 @@ function FieldEditor(props) {
|
|
|
12147
12174
|
}
|
|
12148
12175
|
),
|
|
12149
12176
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12150
|
-
|
|
12177
|
+
import_design_system40.Button,
|
|
12151
12178
|
{
|
|
12152
12179
|
type: "button",
|
|
12153
12180
|
size: "sm",
|
|
@@ -12228,16 +12255,16 @@ function FieldEditor(props) {
|
|
|
12228
12255
|
type === "button" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ButtonSettingsEditor, { value: buttonSettings, onChange: setButtonSettings, tableId: onEntity ? null : tableId, fields: others }) : null,
|
|
12229
12256
|
type === "modified_time" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WatchFieldsPicker, { fields: others, value: watchFields, onChange: setWatchFields }) : null,
|
|
12230
12257
|
type === "autonumber" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
12231
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12232
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12258
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Prefix" }),
|
|
12259
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.BasicInput, { className: "h-8 text-xs", placeholder: "TASK-", maxLength: 16, "data-records-autonumber-prefix": "", value: numberPrefix, onChange: (e) => setNumberPrefix(e.target.value) })
|
|
12233
12260
|
] }) : null,
|
|
12234
12261
|
editing && field?.type === "relation" && field.relation_target && field.relation_target === field.entity_definition_id ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "A timeline draws a line to each record this one waits on", children: [
|
|
12235
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12262
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
12236
12263
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Waits on the linked records" })
|
|
12237
12264
|
] }) : null,
|
|
12238
12265
|
personColumn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "Each person added to this column gets a notice", children: [
|
|
12239
12266
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12240
|
-
|
|
12267
|
+
import_design_system40.Checkbox,
|
|
12241
12268
|
{
|
|
12242
12269
|
checked: notify,
|
|
12243
12270
|
disabled: notifyStart === null,
|
|
@@ -12263,7 +12290,7 @@ function FieldEditor(props) {
|
|
|
12263
12290
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-wrap items-center gap-4", children: [
|
|
12264
12291
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12265
12292
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12266
|
-
|
|
12293
|
+
import_design_system40.Checkbox,
|
|
12267
12294
|
{
|
|
12268
12295
|
checked: required,
|
|
12269
12296
|
"aria-label": "Required",
|
|
@@ -12274,7 +12301,7 @@ function FieldEditor(props) {
|
|
|
12274
12301
|
] }),
|
|
12275
12302
|
offersMany ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12276
12303
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12277
|
-
|
|
12304
|
+
import_design_system40.Checkbox,
|
|
12278
12305
|
{
|
|
12279
12306
|
checked: multi,
|
|
12280
12307
|
"aria-label": "Can hold more than one",
|
|
@@ -12285,7 +12312,7 @@ function FieldEditor(props) {
|
|
|
12285
12312
|
] }) : null,
|
|
12286
12313
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12287
12314
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12288
|
-
|
|
12315
|
+
import_design_system40.Checkbox,
|
|
12289
12316
|
{
|
|
12290
12317
|
checked: dated,
|
|
12291
12318
|
"aria-label": "Each value has its own date",
|
|
@@ -12296,7 +12323,7 @@ function FieldEditor(props) {
|
|
|
12296
12323
|
] }),
|
|
12297
12324
|
!field && type === "relation" && otherTable.data && otherTable.data.id !== tableId ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12298
12325
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12299
|
-
|
|
12326
|
+
import_design_system40.Checkbox,
|
|
12300
12327
|
{
|
|
12301
12328
|
checked: showOnOther,
|
|
12302
12329
|
"aria-label": `Show on ${otherTable.data.name ?? "the other table"}`,
|
|
@@ -12308,12 +12335,12 @@ function FieldEditor(props) {
|
|
|
12308
12335
|
otherTable.data.name ?? "the other table"
|
|
12309
12336
|
] }) : null,
|
|
12310
12337
|
!field && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", title: "A timeline draws a line to each record this one waits on", children: [
|
|
12311
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12338
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
12312
12339
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Waits on the linked records" })
|
|
12313
12340
|
] }) : null,
|
|
12314
12341
|
!field && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12315
12342
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12316
|
-
|
|
12343
|
+
import_design_system40.Checkbox,
|
|
12317
12344
|
{
|
|
12318
12345
|
checked: nestsSubItems,
|
|
12319
12346
|
"aria-label": "Sub-items",
|
|
@@ -12328,7 +12355,7 @@ function FieldEditor(props) {
|
|
|
12328
12355
|
] }) : null,
|
|
12329
12356
|
CHOICE_EDITOR_ADDS_WHAT_IS_TYPED && (type === "select" || type === "multi_select") ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12330
12357
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12331
|
-
|
|
12358
|
+
import_design_system40.Checkbox,
|
|
12332
12359
|
{
|
|
12333
12360
|
checked: allowOther,
|
|
12334
12361
|
"aria-label": "A value that is not one of the choices is added to them",
|
|
@@ -12340,7 +12367,7 @@ function FieldEditor(props) {
|
|
|
12340
12367
|
] }),
|
|
12341
12368
|
!editing && !onEntity && newColumnTakesADefault(type) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NewColumnDefault, { type, choices: options, value: startsWith, onChange: setStartsWith }) : null,
|
|
12342
12369
|
editing && field && takesADefault(liveField ?? field) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-default": "", children: [
|
|
12343
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12370
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { htmlFor: "records-field-default", className: "text-xs", children: DEFAULT_LABEL }),
|
|
12344
12371
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12345
12372
|
FieldControl,
|
|
12346
12373
|
{
|
|
@@ -12351,29 +12378,29 @@ function FieldEditor(props) {
|
|
|
12351
12378
|
}
|
|
12352
12379
|
)
|
|
12353
12380
|
] }) : null,
|
|
12354
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12381
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Separator, {}),
|
|
12355
12382
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
12356
12383
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12357
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12358
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12359
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12360
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12384
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Who can see what is in it" }),
|
|
12385
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: sensitivity, onValueChange: setSensitivity, children: [
|
|
12386
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "Who can see what is in it", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12387
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: sensitivities.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
12361
12388
|
] })
|
|
12362
12389
|
] }),
|
|
12363
12390
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12364
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12365
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12366
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12367
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12391
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Can an assistant read it" }),
|
|
12392
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: contextPolicy, onValueChange: setContextPolicy, children: [
|
|
12393
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "Can an assistant read it", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12394
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: AGENT_VISIBILITY.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
12368
12395
|
] })
|
|
12369
12396
|
] })
|
|
12370
12397
|
] }),
|
|
12371
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12398
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Separator, {}),
|
|
12372
12399
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12373
12400
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12374
12401
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-medium", children: "What counts as a good value" }),
|
|
12375
12402
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12376
|
-
|
|
12403
|
+
import_design_system40.Button,
|
|
12377
12404
|
{
|
|
12378
12405
|
type: "button",
|
|
12379
12406
|
size: "sm",
|
|
@@ -12386,7 +12413,7 @@ function FieldEditor(props) {
|
|
|
12386
12413
|
] }),
|
|
12387
12414
|
canBeUnique(type, multi) || rules.some((r) => r.kind === "unique") ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", "data-records-field-unique": "", children: [
|
|
12388
12415
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12389
|
-
|
|
12416
|
+
import_design_system40.Checkbox,
|
|
12390
12417
|
{
|
|
12391
12418
|
checked: rules.some((r) => r.kind === "unique"),
|
|
12392
12419
|
"aria-label": UNIQUE_LABEL,
|
|
@@ -12398,18 +12425,18 @@ function FieldEditor(props) {
|
|
|
12398
12425
|
rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-muted-foreground", children: "No checks." }) : null,
|
|
12399
12426
|
rules.map((rule, index) => rule.kind === "unique" ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
12400
12427
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12401
|
-
|
|
12428
|
+
import_design_system40.Select,
|
|
12402
12429
|
{
|
|
12403
12430
|
value: rule.kind,
|
|
12404
12431
|
onValueChange: (kind) => setRules(rules.map((r, i) => i === index ? { ...r, kind } : r)),
|
|
12405
12432
|
children: [
|
|
12406
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12407
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12433
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", className: "w-52", "aria-label": `Check ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12434
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: RULE_KINDS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.kind, children: row.label }, row.kind)) })
|
|
12408
12435
|
]
|
|
12409
12436
|
}
|
|
12410
12437
|
),
|
|
12411
12438
|
rule.kind === "length" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12412
|
-
|
|
12439
|
+
import_design_system40.BasicInput,
|
|
12413
12440
|
{
|
|
12414
12441
|
className: "h-8 w-24",
|
|
12415
12442
|
inputMode: "numeric",
|
|
@@ -12420,7 +12447,7 @@ function FieldEditor(props) {
|
|
|
12420
12447
|
}
|
|
12421
12448
|
) : null,
|
|
12422
12449
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12423
|
-
|
|
12450
|
+
import_design_system40.BasicInput,
|
|
12424
12451
|
{
|
|
12425
12452
|
className: "h-8",
|
|
12426
12453
|
...rule.kind === "length" ? { inputMode: "numeric", placeholder: "most" } : {},
|
|
@@ -12430,7 +12457,7 @@ function FieldEditor(props) {
|
|
|
12430
12457
|
}
|
|
12431
12458
|
),
|
|
12432
12459
|
rule.kind === "pattern" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12433
|
-
|
|
12460
|
+
import_design_system40.BasicInput,
|
|
12434
12461
|
{
|
|
12435
12462
|
className: "h-8",
|
|
12436
12463
|
placeholder: "for example 949-555-0142",
|
|
@@ -12440,7 +12467,7 @@ function FieldEditor(props) {
|
|
|
12440
12467
|
}
|
|
12441
12468
|
) : null,
|
|
12442
12469
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12443
|
-
|
|
12470
|
+
import_design_system40.Button,
|
|
12444
12471
|
{
|
|
12445
12472
|
type: "button",
|
|
12446
12473
|
size: "sm",
|
|
@@ -12468,7 +12495,7 @@ function FieldEditor(props) {
|
|
|
12468
12495
|
rehomed ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { "data-records-choice-rehomed": "", className: "flex flex-wrap items-center gap-2 text-[11px]", children: [
|
|
12469
12496
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: rehomed.said }),
|
|
12470
12497
|
rehomed.undo ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12471
|
-
|
|
12498
|
+
import_design_system40.Button,
|
|
12472
12499
|
{
|
|
12473
12500
|
type: "button",
|
|
12474
12501
|
size: "sm",
|
|
@@ -12492,7 +12519,7 @@ function FieldEditor(props) {
|
|
|
12492
12519
|
children: "Undo"
|
|
12493
12520
|
}
|
|
12494
12521
|
) : null,
|
|
12495
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12522
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", onClick: () => onSaved?.(), children: "Done" })
|
|
12496
12523
|
] }) : null,
|
|
12497
12524
|
reverseRefused ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { "data-records-reverse-field-refused": "", className: "flex flex-col gap-1", children: [
|
|
12498
12525
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px]", children: "The link is made. Its column on the other table was not:" }),
|
|
@@ -12504,7 +12531,7 @@ function FieldEditor(props) {
|
|
|
12504
12531
|
] }) : null,
|
|
12505
12532
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 flex-nowrap items-center gap-2", "data-field-editor-footer": "", children: [
|
|
12506
12533
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12507
|
-
|
|
12534
|
+
import_design_system40.Button,
|
|
12508
12535
|
{
|
|
12509
12536
|
size: "sm",
|
|
12510
12537
|
disabled: mutation.saving || Boolean(formulaMissing) || Boolean(nameLine) && label.trim() !== (field?.label ?? "").trim(),
|
|
@@ -12519,7 +12546,7 @@ function FieldEditor(props) {
|
|
|
12519
12546
|
children: mutation.saving ? "Saving\u2026" : field ? EDIT_FIELD_SAVE_LABEL : onEntity ? ADD_STANDARD_FIELD_SAVE_LABEL : ADD_FIELD_SAVE_LABEL
|
|
12520
12547
|
}
|
|
12521
12548
|
),
|
|
12522
|
-
onCancel ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12549
|
+
onCancel ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { size: "sm", variant: "ghost", onClick: onCancel, children: "Cancel" }) : null,
|
|
12523
12550
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12524
12551
|
"span",
|
|
12525
12552
|
{
|
|
@@ -12537,11 +12564,11 @@ function FieldEditor(props) {
|
|
|
12537
12564
|
the dialog card 0.2278 and closing it 0.1303. The consequence is the tooltip of
|
|
12538
12565
|
"Remove it" (interface-text: the slot holds a label, never a paragraph). */
|
|
12539
12566
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "ml-auto grid shrink-0 items-center", "data-field-editor-remove": askingToRemove ? "asking" : "idle", children: [
|
|
12540
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: (0,
|
|
12541
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0,
|
|
12567
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: (0, import_design_system40.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", askingToRemove && "invisible"), "aria-hidden": askingToRemove || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { size: "sm", variant: "outline", tabIndex: askingToRemove ? -1 : void 0, onClick: () => setAskingToRemove(true), children: "Remove this field" }) }),
|
|
12568
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_design_system40.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", !askingToRemove && "invisible"), "aria-hidden": !askingToRemove || void 0, children: [
|
|
12542
12569
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "whitespace-nowrap text-destructive", "data-field-editor-remove-ask": "", children: "Archive this field?" }),
|
|
12543
12570
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12544
|
-
|
|
12571
|
+
import_design_system40.Button,
|
|
12545
12572
|
{
|
|
12546
12573
|
size: "sm",
|
|
12547
12574
|
variant: "destructive",
|
|
@@ -12553,7 +12580,7 @@ function FieldEditor(props) {
|
|
|
12553
12580
|
children: "Remove it"
|
|
12554
12581
|
}
|
|
12555
12582
|
),
|
|
12556
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12583
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { size: "sm", variant: "ghost", tabIndex: askingToRemove ? void 0 : -1, onClick: () => setAskingToRemove(false), children: "Keep it" })
|
|
12557
12584
|
] })
|
|
12558
12585
|
] })
|
|
12559
12586
|
) : null
|
|
@@ -12672,9 +12699,9 @@ function TypeQuestions(props) {
|
|
|
12672
12699
|
}
|
|
12673
12700
|
if (type === "currency") {
|
|
12674
12701
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
12675
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12702
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "The currency" }),
|
|
12676
12703
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12677
|
-
|
|
12704
|
+
import_design_system40.BasicInput,
|
|
12678
12705
|
{
|
|
12679
12706
|
value: props.unit,
|
|
12680
12707
|
"aria-label": "The currency",
|
|
@@ -12687,7 +12714,7 @@ function TypeQuestions(props) {
|
|
|
12687
12714
|
if (type === "datetime") {
|
|
12688
12715
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12689
12716
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12690
|
-
|
|
12717
|
+
import_design_system40.Checkbox,
|
|
12691
12718
|
{
|
|
12692
12719
|
checked: props.withTime,
|
|
12693
12720
|
"aria-label": "Include a time of day",
|
|
@@ -12704,10 +12731,10 @@ function TypeQuestions(props) {
|
|
|
12704
12731
|
}
|
|
12705
12732
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
12706
12733
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12707
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12708
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12709
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12710
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12734
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: type !== "lookup" ? "Across the records in" : "Read it from" }),
|
|
12735
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: props.via, onValueChange: props.setVia, children: [
|
|
12736
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": type !== "lookup" ? "Across the records in" : "Read it from", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, { placeholder: "Choose a column" }) }),
|
|
12737
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: usable.map((f) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.SelectItem, { value: f.key, children: [
|
|
12711
12738
|
fieldName(f),
|
|
12712
12739
|
isBackLinkSource(f) ? BACK_LINK_SOURCE_SUFFIX : "",
|
|
12713
12740
|
sourceKindOf(f) === "person" ? " \u2014 a person" : sourceKindOf(f) === "file" ? " \u2014 a file" : "",
|
|
@@ -12725,10 +12752,10 @@ function TypeQuestions(props) {
|
|
|
12725
12752
|
onChange: props.setPick
|
|
12726
12753
|
}
|
|
12727
12754
|
) : type === "count" ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12728
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12729
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12730
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12731
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12755
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "What to work out" }),
|
|
12756
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: props.agg, onValueChange: (v) => props.setAgg(v), children: [
|
|
12757
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": "What to work out", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12758
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: ROLLUP_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
12732
12759
|
] }),
|
|
12733
12760
|
props.agg !== "count" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12734
12761
|
ValueOnTheOtherSide,
|
|
@@ -12750,18 +12777,18 @@ function TypeQuestions(props) {
|
|
|
12750
12777
|
}
|
|
12751
12778
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12752
12779
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12753
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12754
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12755
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12756
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12780
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "What to do" }),
|
|
12781
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: props.formulaOp, onValueChange: props.setFormulaOp, children: [
|
|
12782
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", className: "max-w-[18rem]", "aria-label": "What to do", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12783
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: FORMULA_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
12757
12784
|
] })
|
|
12758
12785
|
] }),
|
|
12759
12786
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12760
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12787
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: "Which columns" }),
|
|
12761
12788
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex flex-wrap gap-1", children: props.others.map((f) => {
|
|
12762
12789
|
const picked = props.formulaFields.includes(f.id);
|
|
12763
12790
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12764
|
-
|
|
12791
|
+
import_design_system40.Button,
|
|
12765
12792
|
{
|
|
12766
12793
|
type: "button",
|
|
12767
12794
|
size: "sm",
|
|
@@ -12776,9 +12803,9 @@ function TypeQuestions(props) {
|
|
|
12776
12803
|
}) })
|
|
12777
12804
|
] }),
|
|
12778
12805
|
props.formulaOp === "concat" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12779
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12806
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", children: FORMULA_SEPARATOR_LABEL }),
|
|
12780
12807
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12781
|
-
|
|
12808
|
+
import_design_system40.BasicInput,
|
|
12782
12809
|
{
|
|
12783
12810
|
value: props.formulaSeparator,
|
|
12784
12811
|
"aria-label": FORMULA_SEPARATOR_LABEL,
|
|
@@ -12845,7 +12872,7 @@ function RollupFilterQuestion({
|
|
|
12845
12872
|
conditionInWords(value, conditionFields),
|
|
12846
12873
|
"."
|
|
12847
12874
|
] }),
|
|
12848
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12875
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onChange(null), children: "Clear" })
|
|
12849
12876
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ChoiceListTermsContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12850
12877
|
ConditionGroup,
|
|
12851
12878
|
{
|
|
@@ -12872,13 +12899,13 @@ function ValueOnTheOtherSide({
|
|
|
12872
12899
|
const carried = sample.data?.rows[0]?.document ?? null;
|
|
12873
12900
|
const offered = declared.length > 0 ? declared.map((f) => ({ key: f.key, name: fieldName(f) })) : Object.keys(carried ?? {}).map((key) => ({ key, name: (0, import_text_case7.humanizeIdentifier)(key) }));
|
|
12874
12901
|
const stillAsking = columns.loading || declared.length === 0 && sample.loading;
|
|
12875
|
-
const body = !relation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12876
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12877
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12902
|
+
const body = !relation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value, onValueChange: onChange, children: [
|
|
12903
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { size: "sm", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, { placeholder: "Choose a column" }) }),
|
|
12904
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectContent, { children: offered.map((column) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: column.key, children: column.name }, column.key)) })
|
|
12878
12905
|
] });
|
|
12879
12906
|
if (compact) return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mt-1 flex flex-col gap-1", children: body });
|
|
12880
12907
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12881
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12908
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { className: "text-xs", title: help, children: label }),
|
|
12882
12909
|
body
|
|
12883
12910
|
] });
|
|
12884
12911
|
}
|
|
@@ -12905,18 +12932,18 @@ function NewColumnDefault({
|
|
|
12905
12932
|
}) {
|
|
12906
12933
|
const none = "__none__";
|
|
12907
12934
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-default": "", "data-records-new-field-default": "", children: [
|
|
12908
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12935
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Label, { htmlFor: "records-new-field-default", className: "text-xs", children: DEFAULT_LABEL }),
|
|
12909
12936
|
type === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "flex items-center gap-2", children: [
|
|
12910
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12937
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.Checkbox, { id: "records-new-field-default", "aria-label": DEFAULT_LABEL, checked: value === true, onCheckedChange: (on) => onChange(on === true ? true : null) }),
|
|
12911
12938
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "Ticked" })
|
|
12912
|
-
] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12913
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12914
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12915
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12916
|
-
choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12939
|
+
] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.Select, { value: typeof value === "string" && choices.includes(value) ? value : none, onValueChange: (v) => onChange(v === none ? null : v), children: [
|
|
12940
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectTrigger, { id: "records-new-field-default", size: "sm", "aria-label": DEFAULT_LABEL, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectValue, {}) }),
|
|
12941
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system40.SelectContent, { children: [
|
|
12942
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: none, children: "Nothing" }),
|
|
12943
|
+
choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system40.SelectItem, { value: c, children: c }, c))
|
|
12917
12944
|
] })
|
|
12918
12945
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12919
|
-
|
|
12946
|
+
import_design_system40.BasicInput,
|
|
12920
12947
|
{
|
|
12921
12948
|
id: "records-new-field-default",
|
|
12922
12949
|
value: typeof value === "string" ? value : value === null || value === void 0 ? "" : String(value),
|
|
@@ -13008,7 +13035,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13008
13035
|
const color = (0, import_data_table6.isStyleColor)(b.color) ? import_data_table6.CHOICE_CHIP_CLASS[b.color] : import_data_table6.NEUTRAL_CHIP_CLASS;
|
|
13009
13036
|
if (beforeSave) {
|
|
13010
13037
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-2", "data-records-button-before-save": field.key, children: [
|
|
13011
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13038
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.Button, { type: "button", size: "xs", variant: "outline", disabled: true, "aria-describedby": `${field.key}-before-save`, "data-records-button": field.key, className: (0, import_design_system41.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: b.label }) }),
|
|
13012
13039
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { id: `${field.key}-before-save`, className: "whitespace-nowrap text-xs text-muted-foreground", children: "Save the record first" })
|
|
13013
13040
|
] });
|
|
13014
13041
|
}
|
|
@@ -13107,7 +13134,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13107
13134
|
};
|
|
13108
13135
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
13109
13136
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
13110
|
-
|
|
13137
|
+
import_design_system41.Popover,
|
|
13111
13138
|
{
|
|
13112
13139
|
open: said2 !== null,
|
|
13113
13140
|
onOpenChange: (open) => {
|
|
@@ -13117,8 +13144,8 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13117
13144
|
setSaid(null);
|
|
13118
13145
|
},
|
|
13119
13146
|
children: [
|
|
13120
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13121
|
-
|
|
13147
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13148
|
+
import_design_system41.Button,
|
|
13122
13149
|
{
|
|
13123
13150
|
type: "button",
|
|
13124
13151
|
size: "xs",
|
|
@@ -13128,7 +13155,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13128
13155
|
"aria-busy": busy || opening || void 0,
|
|
13129
13156
|
"data-records-button-pending": busy || opening ? "" : void 0,
|
|
13130
13157
|
disabled: busy || opening,
|
|
13131
|
-
className: (0,
|
|
13158
|
+
className: (0, import_design_system41.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color, needs && "border-dashed opacity-80"),
|
|
13132
13159
|
onPointerDown: stop2,
|
|
13133
13160
|
onDoubleClick: stop2,
|
|
13134
13161
|
onClick: (event) => {
|
|
@@ -13136,13 +13163,13 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13136
13163
|
event.preventDefault();
|
|
13137
13164
|
void press();
|
|
13138
13165
|
},
|
|
13139
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: (0,
|
|
13166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: (0, import_design_system41.cn)("truncate", (busy || opening) && "matrx-shimmer"), children: b.label })
|
|
13140
13167
|
}
|
|
13141
13168
|
) }),
|
|
13142
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
13169
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system41.PopoverContent, { className: "w-72 space-y-2 p-3 text-sm", onClick: stop2, onPointerDown: stop2, "data-records-button-said": said2?.kind, children: [
|
|
13143
13170
|
said2?.kind === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RefusalLine, { error: said2.error }) : null,
|
|
13144
13171
|
said2?.kind === "waiting" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
|
|
13145
|
-
said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13172
|
+
said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.ErrorBox, { as: "p", className: "break-words text-destructive", message: said2.says, origin: "records-ui/buttonCell", children: said2.says }) : null,
|
|
13146
13173
|
said2?.kind === "public" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "Buttons run for signed-in people." }) : null,
|
|
13147
13174
|
said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "break-words", children: [
|
|
13148
13175
|
said2.value ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StructuredValueView, { structured: said2.value, label: b.label }) : null,
|
|
@@ -13153,7 +13180,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13153
13180
|
said2?.kind === "needs" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
13154
13181
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: said2.says }),
|
|
13155
13182
|
tableId ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
13156
|
-
|
|
13183
|
+
import_design_system41.Button,
|
|
13157
13184
|
{
|
|
13158
13185
|
type: "button",
|
|
13159
13186
|
size: "sm",
|
|
@@ -13173,10 +13200,10 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13173
13200
|
]
|
|
13174
13201
|
}
|
|
13175
13202
|
),
|
|
13176
|
-
settingUp && tableId ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13177
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
13178
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13179
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13203
|
+
settingUp && tableId ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.Dialog, { open: true, onOpenChange: (open) => open ? null : setSettingUp(false), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system41.DialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl", onClick: stop2, onPointerDown: stop2, children: [
|
|
13204
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system41.DialogHeader, { children: [
|
|
13205
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.DialogTitle, { children: `Column settings \xB7 ${fieldName(field)}` }),
|
|
13206
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system41.DialogDescription, { className: "sr-only", children: "What the button does" })
|
|
13180
13207
|
] }),
|
|
13181
13208
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FieldEditor, { tableId, field, onSaved: () => setSettingUp(false), onCancel: () => setSettingUp(false) })
|
|
13182
13209
|
] }) }) : null
|
|
@@ -13257,7 +13284,7 @@ init_refusals();
|
|
|
13257
13284
|
|
|
13258
13285
|
// src/formatControls.tsx
|
|
13259
13286
|
var import_react71 = require("react");
|
|
13260
|
-
var
|
|
13287
|
+
var import_design_system42 = require("@ai-matrx/design-system");
|
|
13261
13288
|
var import_field_formats9 = require("@ai-matrx/design-system/field-formats");
|
|
13262
13289
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
13263
13290
|
var TYPED_NUMBERS = /* @__PURE__ */ new Set(["currency", "percent", "progress", "decimal", "duration", "file_size", "integer"]);
|
|
@@ -13283,7 +13310,7 @@ function NumberInFormat({ format, value, onChange, disabled, id }) {
|
|
|
13283
13310
|
setText(typedText(format, value));
|
|
13284
13311
|
}, [value, format]);
|
|
13285
13312
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13286
|
-
|
|
13313
|
+
import_design_system42.BasicInput,
|
|
13287
13314
|
{
|
|
13288
13315
|
id,
|
|
13289
13316
|
inputMode: "decimal",
|
|
@@ -13322,7 +13349,7 @@ function formatControl(args) {
|
|
|
13322
13349
|
case "url":
|
|
13323
13350
|
case "tel":
|
|
13324
13351
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13325
|
-
|
|
13352
|
+
import_design_system42.BasicInput,
|
|
13326
13353
|
{
|
|
13327
13354
|
id,
|
|
13328
13355
|
type: def.editor,
|
|
@@ -13336,7 +13363,7 @@ function formatControl(args) {
|
|
|
13336
13363
|
case "color":
|
|
13337
13364
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
13338
13365
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13339
|
-
|
|
13366
|
+
import_design_system42.BasicInput,
|
|
13340
13367
|
{
|
|
13341
13368
|
id: `${id}-swatch`,
|
|
13342
13369
|
type: "color",
|
|
@@ -13347,10 +13374,10 @@ function formatControl(args) {
|
|
|
13347
13374
|
onChange: (e) => commit(e.target.value)
|
|
13348
13375
|
}
|
|
13349
13376
|
),
|
|
13350
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13377
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system42.BasicInput, { id, value: text, placeholder: "#3b82f6", disabled, onChange: (e) => commit(e.target.value) })
|
|
13351
13378
|
] });
|
|
13352
13379
|
case "textarea":
|
|
13353
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system42.BasicTextarea, { id, rows: 4, value: text, disabled, onChange: (e) => commit(e.target.value) });
|
|
13354
13381
|
default:
|
|
13355
13382
|
return null;
|
|
13356
13383
|
}
|
|
@@ -13358,7 +13385,7 @@ function formatControl(args) {
|
|
|
13358
13385
|
|
|
13359
13386
|
// src/typedDateHelper.tsx
|
|
13360
13387
|
var import_react72 = require("react");
|
|
13361
|
-
var
|
|
13388
|
+
var import_design_system43 = require("@ai-matrx/design-system");
|
|
13362
13389
|
var import_records27 = require("@ai-matrx/records");
|
|
13363
13390
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
13364
13391
|
var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
@@ -13438,8 +13465,8 @@ function TypedDateHelper({
|
|
|
13438
13465
|
const at = new Date(shown2.y, shown2.m + by, 1);
|
|
13439
13466
|
setMonth({ y: at.getFullYear(), m: at.getMonth() });
|
|
13440
13467
|
};
|
|
13441
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13442
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system43.Popover, { open, onOpenChange: setOpen, children: [
|
|
13469
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system43.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13443
13470
|
"button",
|
|
13444
13471
|
{
|
|
13445
13472
|
type: "button",
|
|
@@ -13452,7 +13479,7 @@ function TypedDateHelper({
|
|
|
13452
13479
|
}
|
|
13453
13480
|
) }),
|
|
13454
13481
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13455
|
-
|
|
13482
|
+
import_design_system43.PopoverContent,
|
|
13456
13483
|
{
|
|
13457
13484
|
sizing: "content",
|
|
13458
13485
|
align: "start",
|
|
@@ -13483,7 +13510,7 @@ function TypedDateHelper({
|
|
|
13483
13510
|
type: "button",
|
|
13484
13511
|
...keepFocus,
|
|
13485
13512
|
"data-records-date-helper-day": key,
|
|
13486
|
-
className: (0,
|
|
13513
|
+
className: (0, import_design_system43.cn)(
|
|
13487
13514
|
"h-6 w-6 rounded tabular-nums hover:bg-muted",
|
|
13488
13515
|
key === held.day ? "bg-primary text-primary-foreground hover:bg-primary" : "",
|
|
13489
13516
|
key === todayKey && key !== held.day ? "ring-1 ring-ring" : ""
|
|
@@ -13502,7 +13529,7 @@ function TypedDateHelper({
|
|
|
13502
13529
|
type: "button",
|
|
13503
13530
|
...keepFocus,
|
|
13504
13531
|
"data-records-date-helper-time": `${pad(t.h)}:${pad(t.m)}`,
|
|
13505
|
-
className: (0,
|
|
13532
|
+
className: (0, import_design_system43.cn)(
|
|
13506
13533
|
"whitespace-nowrap rounded px-2 py-0.5 text-left tabular-nums hover:bg-muted",
|
|
13507
13534
|
held.time && held.time.h === t.h && held.time.m === t.m ? "bg-primary text-primary-foreground" : ""
|
|
13508
13535
|
),
|
|
@@ -13553,9 +13580,9 @@ function ChoiceAskButtons({
|
|
|
13553
13580
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { "data-records-choice-ask": "", "data-records-cell-note": "", role: "group", "aria-label": choiceAskSentence(field, words), className: "flex flex-col gap-1", children: [
|
|
13554
13581
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-[11px] leading-snug", children: choiceAskSentence(field, words) }),
|
|
13555
13582
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
13556
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13557
|
-
keepOffered ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13558
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13583
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onAdd, children: "Add" }),
|
|
13584
|
+
keepOffered ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onKeep, children: "Keep as typed" }) : null,
|
|
13585
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onCancel, children: "Cancel" })
|
|
13559
13586
|
] })
|
|
13560
13587
|
] });
|
|
13561
13588
|
}
|
|
@@ -13695,7 +13722,7 @@ function TypedTextControl({ field, value, onChange, disabled, id, onCommit, onCa
|
|
|
13695
13722
|
...value.openedAs !== void 0 ? { openedAs: value.openedAs } : {}
|
|
13696
13723
|
});
|
|
13697
13724
|
const box = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13698
|
-
|
|
13725
|
+
import_design_system44.BasicInput,
|
|
13699
13726
|
{
|
|
13700
13727
|
id,
|
|
13701
13728
|
value: value.text,
|
|
@@ -13733,7 +13760,7 @@ function TypedTextControl({ field, value, onChange, disabled, id, onCommit, onCa
|
|
|
13733
13760
|
}
|
|
13734
13761
|
) : "refusal" in judged ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
13735
13762
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FloatingRefusal, { text: judged.refusal, why: "why" in judged ? judged.why : void 0 }),
|
|
13736
|
-
judged.cancelOnly && onCancel ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13763
|
+
judged.cancelOnly && onCancel ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onCancel(), children: "Cancel" }) }) : null
|
|
13737
13764
|
] }) : judged.value === null || judged.value === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(ReadsAsNote, { typed: value.text, always: isChoiceAddition(judged.value), children: [
|
|
13738
13765
|
isChoiceAddition(judged.value) ? `Adds ${quoted(judged.value.add)} to the choices for ${fieldName(field)}. ` : null,
|
|
13739
13766
|
"Reads as",
|
|
@@ -13799,7 +13826,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
13799
13826
|
});
|
|
13800
13827
|
}
|
|
13801
13828
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13802
|
-
|
|
13829
|
+
import_design_system44.BasicTextarea,
|
|
13803
13830
|
{
|
|
13804
13831
|
id: inputId,
|
|
13805
13832
|
rows: 3,
|
|
@@ -13812,7 +13839,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
13812
13839
|
case "currency":
|
|
13813
13840
|
case "percent":
|
|
13814
13841
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13815
|
-
|
|
13842
|
+
import_design_system44.BasicInput,
|
|
13816
13843
|
{
|
|
13817
13844
|
id: inputId,
|
|
13818
13845
|
type: "number",
|
|
@@ -13829,7 +13856,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
13829
13856
|
case "phone":
|
|
13830
13857
|
case "url":
|
|
13831
13858
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13832
|
-
|
|
13859
|
+
import_design_system44.BasicInput,
|
|
13833
13860
|
{
|
|
13834
13861
|
id: inputId,
|
|
13835
13862
|
type: kind === "email" ? "email" : kind === "phone" ? "tel" : "url",
|
|
@@ -13859,7 +13886,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
13859
13886
|
default:
|
|
13860
13887
|
if (typeof value === "boolean" || field.config?.["kind"] === "boolean") {
|
|
13861
13888
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13862
|
-
|
|
13889
|
+
import_design_system44.Checkbox,
|
|
13863
13890
|
{
|
|
13864
13891
|
id: inputId,
|
|
13865
13892
|
checked: value === true,
|
|
@@ -13869,7 +13896,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
13869
13896
|
);
|
|
13870
13897
|
}
|
|
13871
13898
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13872
|
-
|
|
13899
|
+
import_design_system44.BasicInput,
|
|
13873
13900
|
{
|
|
13874
13901
|
id: inputId,
|
|
13875
13902
|
...ownDetails && isPersonsName(field) ? { autoComplete: "name" } : {},
|
|
@@ -13907,7 +13934,7 @@ function TypedWordsControl({ field, value, onChange, disabled, id }) {
|
|
|
13907
13934
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex flex-col gap-0.5", children: [
|
|
13908
13935
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
13909
13936
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13910
|
-
|
|
13937
|
+
import_design_system44.BasicInput,
|
|
13911
13938
|
{
|
|
13912
13939
|
id,
|
|
13913
13940
|
value: text,
|
|
@@ -13938,7 +13965,7 @@ function CheckboxControl({ field, value, onChange, disabled, id }) {
|
|
|
13938
13965
|
const unanswered = value === null || value === void 0;
|
|
13939
13966
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
13940
13967
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13941
|
-
|
|
13968
|
+
import_design_system44.Checkbox,
|
|
13942
13969
|
{
|
|
13943
13970
|
id,
|
|
13944
13971
|
checked: value === true,
|
|
@@ -13950,7 +13977,7 @@ function CheckboxControl({ field, value, onChange, disabled, id }) {
|
|
|
13950
13977
|
unanswered ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs italic text-muted-foreground", children: "not answered yet" }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
13951
13978
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs text-muted-foreground", children: value === true ? "Yes" : "No" }),
|
|
13952
13979
|
field.required ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13953
|
-
|
|
13980
|
+
import_design_system44.Button,
|
|
13954
13981
|
{
|
|
13955
13982
|
size: "sm",
|
|
13956
13983
|
variant: "ghost",
|
|
@@ -13968,7 +13995,7 @@ function StructuredTextControl({ field, value, onChange, disabled, id, rows }) {
|
|
|
13968
13995
|
const reads = structuredOf(text) !== null;
|
|
13969
13996
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-1", "data-records-structured-editor": "", children: [
|
|
13970
13997
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13971
|
-
|
|
13998
|
+
import_design_system44.BasicTextarea,
|
|
13972
13999
|
{
|
|
13973
14000
|
id,
|
|
13974
14001
|
rows,
|
|
@@ -13980,7 +14007,7 @@ function StructuredTextControl({ field, value, onChange, disabled, id, rows }) {
|
|
|
13980
14007
|
}
|
|
13981
14008
|
),
|
|
13982
14009
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex h-6 items-center gap-2 text-xs", children: reads ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13983
|
-
|
|
14010
|
+
import_design_system44.Button,
|
|
13984
14011
|
{
|
|
13985
14012
|
type: "button",
|
|
13986
14013
|
variant: "ghost",
|
|
@@ -14000,7 +14027,7 @@ function JsonControl({ field, value, onChange, disabled, id }) {
|
|
|
14000
14027
|
const [broken, setBroken] = (0, import_react73.useState)(null);
|
|
14001
14028
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
14002
14029
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14003
|
-
|
|
14030
|
+
import_design_system44.BasicTextarea,
|
|
14004
14031
|
{
|
|
14005
14032
|
id,
|
|
14006
14033
|
rows: 4,
|
|
@@ -14081,7 +14108,7 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14081
14108
|
if (!client) {
|
|
14082
14109
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
14083
14110
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14084
|
-
|
|
14111
|
+
import_design_system44.BasicInput,
|
|
14085
14112
|
{
|
|
14086
14113
|
id,
|
|
14087
14114
|
value: value === null || value === void 0 ? "" : String(value),
|
|
@@ -14159,7 +14186,7 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14159
14186
|
const chosen = options.filter((option) => (0, import_records28.choiceValuesOf)(value).some((v) => (0, import_records28.isTheChosen)(option, v)));
|
|
14160
14187
|
const picked = new Set(chosen.map((option) => (0, import_records28.optionKey)(option)));
|
|
14161
14188
|
const toggles = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { id: autoOpen ? void 0 : id, className: "flex flex-wrap gap-1", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14162
|
-
|
|
14189
|
+
import_design_system44.Button,
|
|
14163
14190
|
{
|
|
14164
14191
|
type: "button",
|
|
14165
14192
|
size: "sm",
|
|
@@ -14177,22 +14204,22 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14177
14204
|
)) });
|
|
14178
14205
|
if (!autoOpen) return toggles;
|
|
14179
14206
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
14180
|
-
|
|
14207
|
+
import_design_system44.Popover,
|
|
14181
14208
|
{
|
|
14182
14209
|
defaultOpen: true,
|
|
14183
14210
|
onOpenChange: (open) => {
|
|
14184
14211
|
if (!open) onClose?.();
|
|
14185
14212
|
},
|
|
14186
14213
|
children: [
|
|
14187
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14188
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14214
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { id, type: "button", size: "sm", variant: "outline", className: "h-6 max-w-full truncate", children: chosen.length === 0 ? "Choose" : chosen.map(titleOf).join(", ") }) }),
|
|
14215
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.PopoverContent, { sizing: "content", className: "max-w-[20rem] p-2", align: "start", children: toggles })
|
|
14189
14216
|
]
|
|
14190
14217
|
}
|
|
14191
14218
|
);
|
|
14192
14219
|
}
|
|
14193
14220
|
const current = options.find((option) => (0, import_records28.isTheChosen)(option, value));
|
|
14194
14221
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
14195
|
-
|
|
14222
|
+
import_design_system44.Select,
|
|
14196
14223
|
{
|
|
14197
14224
|
value: current ? (0, import_records28.optionKey)(current) : "",
|
|
14198
14225
|
disabled: disabled ?? false,
|
|
@@ -14205,8 +14232,8 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14205
14232
|
}
|
|
14206
14233
|
} : {},
|
|
14207
14234
|
children: [
|
|
14208
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14209
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14235
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectTrigger, { id, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectValue, { placeholder: "Choose" }) }),
|
|
14236
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.SelectItem, { value: (0, import_records28.optionKey)(option), children: titleOf(option) }, option.id)) })
|
|
14210
14237
|
]
|
|
14211
14238
|
}
|
|
14212
14239
|
);
|
|
@@ -14295,7 +14322,7 @@ function OpenChoicePicker({
|
|
|
14295
14322
|
const pickedOptions = current.map((v) => options.find((o) => (0, import_records28.isTheChosen)(o, v)));
|
|
14296
14323
|
const cellChips = pickedWords.map((word, i) => {
|
|
14297
14324
|
const chip = chipOf(pickedOptions[i], word);
|
|
14298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Badge, { variant: "outline", className: (0, import_design_system44.cn)("text-[11px]", chip.className), "data-records-choice-chip": "", children: word }, word);
|
|
14299
14326
|
});
|
|
14300
14327
|
const headChips = pickedWords.map((word, i) => {
|
|
14301
14328
|
const option = pickedOptions[i];
|
|
@@ -14348,7 +14375,7 @@ function OpenChoicePicker({
|
|
|
14348
14375
|
// never_add on a column that takes only its choices: said, never a silent nothing.
|
|
14349
14376
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
14350
14377
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { "data-records-typed-refusal": "", className: "p-2 text-xs text-muted-foreground", children: notAChoiceSentence(field, [q]) }),
|
|
14351
|
-
autoOpen ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14378
|
+
autoOpen ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system44.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => setOpen(false), children: "Cancel" }) }) : null
|
|
14352
14379
|
] })
|
|
14353
14380
|
) : null,
|
|
14354
14381
|
children: anchored ? cellChips : null
|
|
@@ -14368,7 +14395,7 @@ function RecordChip({
|
|
|
14368
14395
|
// name. So it caps at its container and ends in an ellipsis with the whole name in
|
|
14369
14396
|
// its tooltip, rather than being cut mid-word by whatever box it landed in
|
|
14370
14397
|
// (lane FIX-14, 2026-09-22).
|
|
14371
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
14398
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_design_system44.Badge, { variant: "secondary", className: (0, import_design_system44.cn)("max-w-full gap-1 text-[11px]", className), title, children: [
|
|
14372
14399
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "min-w-0 truncate", children: title }),
|
|
14373
14400
|
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${title}`, className: "shrink-0 opacity-60 hover:opacity-100", children: "\xD7" }) : null
|
|
14374
14401
|
] })
|
|
@@ -14423,7 +14450,7 @@ function ChoiceAnswer({
|
|
|
14423
14450
|
tabIndex: field.multi || choice.key === tabStop ? 0 : -1,
|
|
14424
14451
|
onClick: () => press(choice),
|
|
14425
14452
|
"data-records-choice-answer": choice.key,
|
|
14426
|
-
className: (0,
|
|
14453
|
+
className: (0, import_design_system44.cn)(
|
|
14427
14454
|
"flex min-h-11 w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-base font-medium text-foreground transition-colors sm:min-h-10 sm:text-sm",
|
|
14428
14455
|
chosen ? "border-primary bg-primary/10" : "border-primary/30 bg-primary/[0.03] hover:bg-primary/10"
|
|
14429
14456
|
),
|
|
@@ -14432,7 +14459,7 @@ function ChoiceAnswer({
|
|
|
14432
14459
|
"kbd",
|
|
14433
14460
|
{
|
|
14434
14461
|
"aria-hidden": "true",
|
|
14435
|
-
className: (0,
|
|
14462
|
+
className: (0, import_design_system44.cn)(
|
|
14436
14463
|
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded border font-sans text-xs font-semibold",
|
|
14437
14464
|
chosen ? "border-primary bg-primary text-primary-foreground" : "border-primary/40 text-primary"
|
|
14438
14465
|
),
|
|
@@ -14479,7 +14506,7 @@ function ChoiceAnswer({
|
|
|
14479
14506
|
const shown2 = q === "" ? choices : choices.filter((c) => c.label.toLowerCase().includes(q));
|
|
14480
14507
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { id, className: "flex w-full flex-col gap-2", onKeyDown, children: [
|
|
14481
14508
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14482
|
-
|
|
14509
|
+
import_design_system44.BasicInput,
|
|
14483
14510
|
{
|
|
14484
14511
|
value: search,
|
|
14485
14512
|
onChange: (e) => setSearch(e.target.value),
|
|
@@ -14598,7 +14625,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
|
|
|
14598
14625
|
const missing = Boolean(value) && !list.loading && !list.error && !list.rows.some((t) => t.table_id === value);
|
|
14599
14626
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
14600
14627
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14601
|
-
|
|
14628
|
+
import_design_system45.CreatablePicker,
|
|
14602
14629
|
{
|
|
14603
14630
|
value: value || null,
|
|
14604
14631
|
options: pickerOptions,
|
|
@@ -14678,7 +14705,7 @@ function ColumnValuesEditor({ tableId, value, onChange, disabled, addLabel }) {
|
|
|
14678
14705
|
onRemove: () => setAdding(false)
|
|
14679
14706
|
}
|
|
14680
14707
|
),
|
|
14681
|
-
!disabled && !adding && keys.length < all.length && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14708
|
+
!disabled && !adding && keys.length < all.length && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system45.Button, { type: "button", variant: "outline", size: "sm", className: "self-start", onClick: () => setAdding(true), children: addLabel })
|
|
14682
14709
|
] });
|
|
14683
14710
|
}
|
|
14684
14711
|
function ColumnValueRow({
|
|
@@ -14697,7 +14724,7 @@ function ColumnValueRow({
|
|
|
14697
14724
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1 rounded-md border border-border/60 p-2", children: [
|
|
14698
14725
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14699
14726
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14700
|
-
|
|
14727
|
+
import_design_system45.CreatablePicker,
|
|
14701
14728
|
{
|
|
14702
14729
|
value: columnKey,
|
|
14703
14730
|
options: shown2,
|
|
@@ -14710,7 +14737,7 @@ function ColumnValueRow({
|
|
|
14710
14737
|
ariaLabel: "Column"
|
|
14711
14738
|
}
|
|
14712
14739
|
) }),
|
|
14713
|
-
!disabled && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14740
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system45.Button, { type: "button", variant: "ghost", size: "sm", "aria-label": "Remove", onClick: onRemove, children: "\u2715" })
|
|
14714
14741
|
] }),
|
|
14715
14742
|
field ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldControl, { field, value, onChange: onValue, disabled }) : orphan ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-[11px] text-muted-foreground", children: value === null || value === void 0 ? "\u2014" : String(value) }) : null
|
|
14716
14743
|
] });
|
|
@@ -14726,7 +14753,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
|
|
|
14726
14753
|
const missing = Boolean(value) && !records.loading && !records.error && !rows.some((r) => r.id === value);
|
|
14727
14754
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
14728
14755
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14729
|
-
|
|
14756
|
+
import_design_system45.CreatablePicker,
|
|
14730
14757
|
{
|
|
14731
14758
|
value: value || null,
|
|
14732
14759
|
options,
|
|
@@ -14747,7 +14774,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
|
|
|
14747
14774
|
var import_react79 = require("react");
|
|
14748
14775
|
var import_records29 = require("@ai-matrx/records");
|
|
14749
14776
|
var import_react80 = require("@ai-matrx/records/react");
|
|
14750
|
-
var
|
|
14777
|
+
var import_design_system46 = require("@ai-matrx/design-system");
|
|
14751
14778
|
init_names();
|
|
14752
14779
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
14753
14780
|
var DATA_BINDING_SHAPES = [
|
|
@@ -14884,7 +14911,7 @@ function BindingDetails({
|
|
|
14884
14911
|
const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
|
|
14885
14912
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
14886
14913
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14887
|
-
|
|
14914
|
+
import_design_system46.Button,
|
|
14888
14915
|
{
|
|
14889
14916
|
type: "button",
|
|
14890
14917
|
size: "sm",
|
|
@@ -14907,7 +14934,7 @@ function BindingDetails({
|
|
|
14907
14934
|
}
|
|
14908
14935
|
),
|
|
14909
14936
|
shape === "value" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14910
|
-
|
|
14937
|
+
import_design_system46.CreatablePicker,
|
|
14911
14938
|
{
|
|
14912
14939
|
value: binding.field_key ?? null,
|
|
14913
14940
|
options: fieldOptions,
|
|
@@ -14924,7 +14951,7 @@ function BindingDetails({
|
|
|
14924
14951
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14925
14952
|
"textarea",
|
|
14926
14953
|
{
|
|
14927
|
-
className: (0,
|
|
14954
|
+
className: (0, import_design_system46.cn)(
|
|
14928
14955
|
"min-h-[3.5rem] w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs"
|
|
14929
14956
|
),
|
|
14930
14957
|
"aria-label": "Each row reads as",
|
|
@@ -14934,7 +14961,7 @@ function BindingDetails({
|
|
|
14934
14961
|
}
|
|
14935
14962
|
),
|
|
14936
14963
|
!disabled && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14937
|
-
|
|
14964
|
+
import_design_system46.Button,
|
|
14938
14965
|
{
|
|
14939
14966
|
type: "button",
|
|
14940
14967
|
size: "sm",
|
|
@@ -14949,7 +14976,7 @@ function BindingDetails({
|
|
|
14949
14976
|
shape === "collection" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
14950
14977
|
"Up to",
|
|
14951
14978
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14952
|
-
|
|
14979
|
+
import_design_system46.BasicInput,
|
|
14953
14980
|
{
|
|
14954
14981
|
type: "number",
|
|
14955
14982
|
min: 1,
|
|
@@ -14968,7 +14995,7 @@ function BindingDetails({
|
|
|
14968
14995
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
|
|
14969
14996
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
|
|
14970
14997
|
DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14971
|
-
|
|
14998
|
+
import_design_system46.Button,
|
|
14972
14999
|
{
|
|
14973
15000
|
type: "button",
|
|
14974
15001
|
size: "sm",
|
|
@@ -15066,7 +15093,7 @@ function RecordNameWords({ tableId, recordId }) {
|
|
|
15066
15093
|
// src/HeldChangeDecision.tsx
|
|
15067
15094
|
var import_react82 = require("react");
|
|
15068
15095
|
var import_react83 = require("@ai-matrx/records/react");
|
|
15069
|
-
var
|
|
15096
|
+
var import_design_system47 = require("@ai-matrx/design-system");
|
|
15070
15097
|
init_Refusal();
|
|
15071
15098
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
15072
15099
|
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
|
|
@@ -15106,8 +15133,8 @@ function Decision({
|
|
|
15106
15133
|
if (may === null) return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
|
|
15107
15134
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
15108
15135
|
may ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex gap-2", children: [
|
|
15109
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
15110
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system47.Button, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
|
|
15137
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system47.Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
|
|
15111
15138
|
] }) : !error && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
|
|
15112
15139
|
error ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RefusalLine, { error }) : null
|
|
15113
15140
|
] });
|