@ai-matrx/records-ui 0.116.115 → 0.116.117
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 +14 -0
- package/dist/{SaveToTable-FVDYG5QS.js → SaveToTable-VNAYIDXB.js} +3 -3
- package/dist/{chunk-PYLGLSKU.js → chunk-6RFL5KYR.js} +2 -2
- package/dist/{chunk-KUEASKVB.js → chunk-ATJH5PBT.js} +3 -3
- package/dist/{chunk-DZ4KNUSS.js → chunk-KJAVVXRW.js} +3 -2
- package/dist/{chunk-DZ4KNUSS.js.map → chunk-KJAVVXRW.js.map} +1 -1
- package/dist/index.cjs +2340 -2286
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +59 -6
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +470 -469
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +2 -2
- package/package.json +2 -2
- /package/dist/{SaveToTable-FVDYG5QS.js.map → SaveToTable-VNAYIDXB.js.map} +0 -0
- /package/dist/{chunk-PYLGLSKU.js.map → chunk-6RFL5KYR.js.map} +0 -0
- /package/dist/{chunk-KUEASKVB.js.map → chunk-ATJH5PBT.js.map} +0 -0
package/dist/pickers.cjs
CHANGED
|
@@ -1226,7 +1226,7 @@ function PickOrAdd({
|
|
|
1226
1226
|
),
|
|
1227
1227
|
notice,
|
|
1228
1228
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system8.ScrollArea, { className: "max-h-64", children: [
|
|
1229
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { role: "listbox", "aria-label": triggerLabel, "aria-multiselectable": multi ? true : void 0, children: [
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { role: "listbox", "data-matrx-picker-list": "", className: import_design_system9.PICKER_LIST_CLASS, "aria-label": triggerLabel, "aria-multiselectable": multi ? true : void 0, children: [
|
|
1230
1230
|
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1231
1231
|
PickRow,
|
|
1232
1232
|
{
|
|
@@ -1257,7 +1257,7 @@ function PickOrAdd({
|
|
|
1257
1257
|
)
|
|
1258
1258
|
] });
|
|
1259
1259
|
}
|
|
1260
|
-
var import_react9, import_design_system8, import_jsx_runtime8, TICK, CROSS, PLUS;
|
|
1260
|
+
var import_react9, import_design_system8, import_design_system9, import_jsx_runtime8, TICK, CROSS, PLUS;
|
|
1261
1261
|
var init_PickOrAdd = __esm({
|
|
1262
1262
|
"src/PickOrAdd.tsx"() {
|
|
1263
1263
|
"use strict";
|
|
@@ -1265,6 +1265,7 @@ var init_PickOrAdd = __esm({
|
|
|
1265
1265
|
import_react9 = require("react");
|
|
1266
1266
|
init_personChip();
|
|
1267
1267
|
import_design_system8 = require("@ai-matrx/design-system");
|
|
1268
|
+
import_design_system9 = require("@ai-matrx/design-system");
|
|
1268
1269
|
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1269
1270
|
TICK = "m5 12 4 4L19 6";
|
|
1270
1271
|
CROSS = "M18 6 6 18M6 6l12 12";
|
|
@@ -1375,13 +1376,13 @@ function useReadRefusal(key) {
|
|
|
1375
1376
|
);
|
|
1376
1377
|
return { take };
|
|
1377
1378
|
}
|
|
1378
|
-
var import_react13,
|
|
1379
|
+
var import_react13, import_design_system12, import_jsx_runtime12, kept, listeners, docks, emit, READ_RETRY_PAUSE_MS;
|
|
1379
1380
|
var init_readRefusals = __esm({
|
|
1380
1381
|
"src/readRefusals.tsx"() {
|
|
1381
1382
|
"use strict";
|
|
1382
1383
|
"use client";
|
|
1383
1384
|
import_react13 = require("react");
|
|
1384
|
-
|
|
1385
|
+
import_design_system12 = require("@ai-matrx/design-system");
|
|
1385
1386
|
init_refusalSaid();
|
|
1386
1387
|
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1387
1388
|
kept = [];
|
|
@@ -1427,14 +1428,14 @@ function ShowListsToggle({
|
|
|
1427
1428
|
className
|
|
1428
1429
|
}) {
|
|
1429
1430
|
if (count === 0) return null;
|
|
1430
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: (0,
|
|
1431
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: (0, import_design_system13.cn)("flex items-center gap-1.5 text-[11px] text-muted-foreground", className), children: [
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system13.Checkbox, { checked: on, onCheckedChange: (next) => onChange(next === true), "aria-label": "Show lists" }),
|
|
1432
1433
|
"Show lists (",
|
|
1433
1434
|
count,
|
|
1434
1435
|
")"
|
|
1435
1436
|
] });
|
|
1436
1437
|
}
|
|
1437
|
-
var import_react14, import_records4, import_react15,
|
|
1438
|
+
var import_react14, import_records4, import_react15, import_design_system13, import_jsx_runtime13;
|
|
1438
1439
|
var init_tablePicking = __esm({
|
|
1439
1440
|
"src/tablePicking.tsx"() {
|
|
1440
1441
|
"use strict";
|
|
@@ -1442,7 +1443,7 @@ var init_tablePicking = __esm({
|
|
|
1442
1443
|
import_react14 = require("react");
|
|
1443
1444
|
import_records4 = require("@ai-matrx/records");
|
|
1444
1445
|
import_react15 = require("@ai-matrx/records/react");
|
|
1445
|
-
|
|
1446
|
+
import_design_system13 = require("@ai-matrx/design-system");
|
|
1446
1447
|
init_tablePickerEntries();
|
|
1447
1448
|
init_readRefusals();
|
|
1448
1449
|
import_jsx_runtime13 = require("react/jsx-runtime");
|
|
@@ -1573,7 +1574,7 @@ function PickOne({
|
|
|
1573
1574
|
if (options.length > PICK_ONE_SEARCH_AFTER) {
|
|
1574
1575
|
const q = search.trim().toLowerCase();
|
|
1575
1576
|
const shown2 = q === "" ? options : options.filter((o) => o.label.toLowerCase().includes(q));
|
|
1576
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: (0,
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: (0, import_design_system20.cn)("inline-flex min-w-0", className), "data-records-pick-one": "search", "data-pick-value": value, ...attrs ?? {}, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1577
1578
|
PickOrAdd,
|
|
1578
1579
|
{
|
|
1579
1580
|
triggerSize: "compact",
|
|
@@ -1603,25 +1604,25 @@ function PickOne({
|
|
|
1603
1604
|
}
|
|
1604
1605
|
) });
|
|
1605
1606
|
}
|
|
1606
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_design_system20.Select, { value: current ? inner(current.value) : "", onValueChange: (v) => onChange(outer(v)), disabled: disabled ?? false, children: [
|
|
1607
1608
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1608
|
-
|
|
1609
|
+
import_design_system20.SelectTrigger,
|
|
1609
1610
|
{
|
|
1610
1611
|
id,
|
|
1611
1612
|
size: "sm",
|
|
1612
1613
|
"aria-label": label,
|
|
1613
|
-
className: (0,
|
|
1614
|
+
className: (0, import_design_system20.cn)("h-7 w-auto min-w-[7rem] text-xs", className),
|
|
1614
1615
|
"data-records-pick-one": "list",
|
|
1615
1616
|
"data-pick-value": value,
|
|
1616
1617
|
...attrs ?? {},
|
|
1617
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_design_system20.SelectValue, { placeholder })
|
|
1618
1619
|
}
|
|
1619
1620
|
),
|
|
1620
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1621
|
-
([group, items]) => group ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1622
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1623
|
-
items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1624
|
-
] }, group) : items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_design_system20.SelectContent, { children: groupsOf(options).map(
|
|
1622
|
+
([group, items]) => group ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_design_system20.SelectGroup, { children: [
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_design_system20.SelectLabel, { children: group }),
|
|
1624
|
+
items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_design_system20.SelectItem, { value: inner(o.value), "data-pick-value": o.value, "data-pick-group": group, children: o.label }, inner(o.value)))
|
|
1625
|
+
] }, group) : items.map((o) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_design_system20.SelectItem, { value: inner(o.value), "data-pick-value": o.value, children: o.label }, inner(o.value)))
|
|
1625
1626
|
) })
|
|
1626
1627
|
] });
|
|
1627
1628
|
}
|
|
@@ -1634,13 +1635,13 @@ function groupsOf(options) {
|
|
|
1634
1635
|
}
|
|
1635
1636
|
return out;
|
|
1636
1637
|
}
|
|
1637
|
-
var import_react30,
|
|
1638
|
+
var import_react30, import_design_system20, import_jsx_runtime23, PICK_ONE_SEARCH_AFTER, EMPTY, inner, outer;
|
|
1638
1639
|
var init_PickOne = __esm({
|
|
1639
1640
|
"src/PickOne.tsx"() {
|
|
1640
1641
|
"use strict";
|
|
1641
1642
|
"use client";
|
|
1642
1643
|
import_react30 = require("react");
|
|
1643
|
-
|
|
1644
|
+
import_design_system20 = require("@ai-matrx/design-system");
|
|
1644
1645
|
init_PickOrAdd();
|
|
1645
1646
|
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1646
1647
|
PICK_ONE_SEARCH_AFTER = 7;
|
|
@@ -1684,7 +1685,7 @@ function FilePicker({
|
|
|
1684
1685
|
"div",
|
|
1685
1686
|
{
|
|
1686
1687
|
"data-matrx-file-picker": true,
|
|
1687
|
-
className: (0,
|
|
1688
|
+
className: (0, import_design_system25.cn)("flex min-w-0 flex-col gap-1", className),
|
|
1688
1689
|
onDragOver: (e) => {
|
|
1689
1690
|
if (disabled) return;
|
|
1690
1691
|
e.preventDefault();
|
|
@@ -1696,7 +1697,7 @@ function FilePicker({
|
|
|
1696
1697
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1697
1698
|
"div",
|
|
1698
1699
|
{
|
|
1699
|
-
className: (0,
|
|
1700
|
+
className: (0, import_design_system25.cn)(
|
|
1700
1701
|
"flex min-w-0 flex-wrap items-center gap-2 rounded-md border border-dashed px-2 py-1.5",
|
|
1701
1702
|
over ? "border-primary bg-primary/5" : "border-border",
|
|
1702
1703
|
disabled && "opacity-60"
|
|
@@ -1720,7 +1721,7 @@ function FilePicker({
|
|
|
1720
1721
|
}
|
|
1721
1722
|
),
|
|
1722
1723
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1723
|
-
|
|
1724
|
+
import_design_system25.Button,
|
|
1724
1725
|
{
|
|
1725
1726
|
type: "button",
|
|
1726
1727
|
size: "sm",
|
|
@@ -1731,7 +1732,7 @@ function FilePicker({
|
|
|
1731
1732
|
}
|
|
1732
1733
|
),
|
|
1733
1734
|
chosenName ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 flex-1 truncate text-xs", title: chosenName, children: chosenName }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xs text-muted-foreground", children: "or drop it here" }),
|
|
1734
|
-
chosenName && onClear ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1735
|
+
chosenName && onClear ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system25.Button, { type: "button", size: "sm", variant: "ghost", disabled, onClick: onClear, children: "Cancel" }) : null
|
|
1735
1736
|
]
|
|
1736
1737
|
}
|
|
1737
1738
|
),
|
|
@@ -1740,13 +1741,13 @@ function FilePicker({
|
|
|
1740
1741
|
}
|
|
1741
1742
|
);
|
|
1742
1743
|
}
|
|
1743
|
-
var import_react36,
|
|
1744
|
+
var import_react36, import_design_system25, import_jsx_runtime28;
|
|
1744
1745
|
var init_FilePicker = __esm({
|
|
1745
1746
|
"src/FilePicker.tsx"() {
|
|
1746
1747
|
"use strict";
|
|
1747
1748
|
"use client";
|
|
1748
1749
|
import_react36 = require("react");
|
|
1749
|
-
|
|
1750
|
+
import_design_system25 = require("@ai-matrx/design-system");
|
|
1750
1751
|
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1751
1752
|
}
|
|
1752
1753
|
});
|
|
@@ -1907,10 +1908,10 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
|
|
|
1907
1908
|
}, [client, personTable, picked.length, people.length]);
|
|
1908
1909
|
const listed = (0, import_records11.rankTypedMatches)(members ?? [], search, memberName);
|
|
1909
1910
|
if (!membersPort || !client) {
|
|
1910
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: (0,
|
|
1911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: (0, import_design_system28.cn)("text-xs text-muted-foreground", className), children: NO_MEMBERS_REASON });
|
|
1911
1912
|
}
|
|
1912
1913
|
if (!personTable) {
|
|
1913
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("p", { className: (0,
|
|
1914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("p", { className: (0, import_design_system28.cn)("text-xs text-muted-foreground", className), children: [
|
|
1914
1915
|
fieldName(field),
|
|
1915
1916
|
" 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."
|
|
1916
1917
|
] });
|
|
@@ -1961,7 +1962,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
|
|
|
1961
1962
|
);
|
|
1962
1963
|
const anchored = autoOpen === true;
|
|
1963
1964
|
const cellChips = picked.map((recordId) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PersonChip, { name: nameOfRecord(recordId), ...disabled || anchored ? {} : { onRemove: () => drop(recordId) } }, recordId));
|
|
1964
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0,
|
|
1965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_design_system28.cn)("flex flex-wrap items-center gap-1", className), children: [
|
|
1965
1966
|
anchored && !disabled ? null : cellChips,
|
|
1966
1967
|
disabled ? null : (
|
|
1967
1968
|
// THE ONE "PICK OR ADD" BUILDER (lane CELL-EDITORS, 2026-10-06): the person list used to carry
|
|
@@ -2006,7 +2007,7 @@ function PersonPicker({ field, value, onChange, disabled, id, className, autoOpe
|
|
|
2006
2007
|
)
|
|
2007
2008
|
] });
|
|
2008
2009
|
}
|
|
2009
|
-
var import_react40, import_records11, import_react41,
|
|
2010
|
+
var import_react40, import_records11, import_react41, import_design_system28, import_jsx_runtime31;
|
|
2010
2011
|
var init_PersonPicker = __esm({
|
|
2011
2012
|
"src/PersonPicker.tsx"() {
|
|
2012
2013
|
"use strict";
|
|
@@ -2014,7 +2015,7 @@ var init_PersonPicker = __esm({
|
|
|
2014
2015
|
import_react40 = require("react");
|
|
2015
2016
|
import_records11 = require("@ai-matrx/records");
|
|
2016
2017
|
import_react41 = require("@ai-matrx/records/react");
|
|
2017
|
-
|
|
2018
|
+
import_design_system28 = require("@ai-matrx/design-system");
|
|
2018
2019
|
init_PickOrAdd();
|
|
2019
2020
|
init_personChip();
|
|
2020
2021
|
init_host();
|
|
@@ -3713,7 +3714,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3713
3714
|
void run();
|
|
3714
3715
|
}, [autoRun, autoRan, source, phase, plan, busy, rights.write, rows.length, titleMissing, ruleVerdicts, run]);
|
|
3715
3716
|
const afterWrite = !busy && (phase === "done" || alreadyRan !== null || ledger !== null && ledger.seen > 0);
|
|
3716
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: (0,
|
|
3717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: (0, import_design_system29.cn)("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
3717
3718
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3718
3719
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium", children: "Import" }),
|
|
3719
3720
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-muted-foreground", children: table.data?.name }),
|
|
@@ -3760,7 +3761,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3760
3761
|
titleKey && titleTakesWords ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-2 rounded border bg-muted/40 px-2 py-1.5", children: [
|
|
3761
3762
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "font-medium", children: "What each record is called" }),
|
|
3762
3763
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3763
|
-
|
|
3764
|
+
import_design_system29.Select,
|
|
3764
3765
|
{
|
|
3765
3766
|
value: titleMappedTo ?? "",
|
|
3766
3767
|
disabled: busy,
|
|
@@ -3781,15 +3782,15 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3781
3782
|
},
|
|
3782
3783
|
children: [
|
|
3783
3784
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3784
|
-
|
|
3785
|
+
import_design_system29.SelectTrigger,
|
|
3785
3786
|
{
|
|
3786
3787
|
size: "sm",
|
|
3787
3788
|
"aria-label": "Which column each record is named by",
|
|
3788
3789
|
className: "min-w-[14rem]",
|
|
3789
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectValue, { placeholder: "\u2014 choose the column \u2014" })
|
|
3790
3791
|
}
|
|
3791
3792
|
),
|
|
3792
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3793
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectContent, { children: plan.columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectItem, { value: c.header, children: c.header }, c.header)) })
|
|
3793
3794
|
]
|
|
3794
3795
|
}
|
|
3795
3796
|
),
|
|
@@ -3812,7 +3813,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3812
3813
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "min-w-[8rem] flex-1 break-words font-medium", children: column.header }),
|
|
3813
3814
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-muted-foreground", children: "goes to" }),
|
|
3814
3815
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3815
|
-
|
|
3816
|
+
import_design_system29.Select,
|
|
3816
3817
|
{
|
|
3817
3818
|
value: leftOut.has(column.header) ? LEAVE : to || ABSENT,
|
|
3818
3819
|
disabled: busy,
|
|
@@ -3832,19 +3833,19 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3832
3833
|
},
|
|
3833
3834
|
children: [
|
|
3834
3835
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3835
|
-
|
|
3836
|
+
import_design_system29.SelectTrigger,
|
|
3836
3837
|
{
|
|
3837
3838
|
size: "sm",
|
|
3838
3839
|
"aria-label": `Where ${column.header} goes`,
|
|
3839
3840
|
"data-goes-to": column.header,
|
|
3840
3841
|
className: "min-w-[14rem] flex-1",
|
|
3841
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectValue, {})
|
|
3842
3843
|
}
|
|
3843
3844
|
),
|
|
3844
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3845
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3846
|
-
unmapped !== "ignore" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3847
|
-
plan.fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3845
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system29.SelectContent, { children: [
|
|
3846
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectItem, { value: ABSENT, children: absent }),
|
|
3847
|
+
unmapped !== "ignore" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectItem, { value: LEAVE, children: "\u2014 leave it out \u2014" }) : null,
|
|
3848
|
+
plan.fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.SelectItem, { value: f.key, children: f.label || f.key }, f.field_id))
|
|
3848
3849
|
] })
|
|
3849
3850
|
]
|
|
3850
3851
|
}
|
|
@@ -3874,7 +3875,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3874
3875
|
]
|
|
3875
3876
|
}
|
|
3876
3877
|
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3877
|
-
|
|
3878
|
+
import_design_system29.Badge,
|
|
3878
3879
|
{
|
|
3879
3880
|
variant: column.matched ? "secondary" : "outline",
|
|
3880
3881
|
className: "text-[11px] font-normal",
|
|
@@ -3923,7 +3924,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
3923
3924
|
column.header
|
|
3924
3925
|
);
|
|
3925
3926
|
}) }),
|
|
3926
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.Separator, {}),
|
|
3927
3928
|
titleRepeating && titleHeader && titleStats ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3928
3929
|
"div",
|
|
3929
3930
|
{
|
|
@@ -4048,7 +4049,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4048
4049
|
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"}.`
|
|
4049
4050
|
] }),
|
|
4050
4051
|
canAdd && nudge !== "always_add" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4051
|
-
|
|
4052
|
+
import_design_system29.Button,
|
|
4052
4053
|
{
|
|
4053
4054
|
size: "sm",
|
|
4054
4055
|
variant: "outline",
|
|
@@ -4073,7 +4074,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4073
4074
|
"div",
|
|
4074
4075
|
{
|
|
4075
4076
|
"data-import-relation": ask.field.key,
|
|
4076
|
-
className: (0,
|
|
4077
|
+
className: (0, import_design_system29.cn)(
|
|
4077
4078
|
"flex flex-col gap-1 rounded border px-2 py-1.5",
|
|
4078
4079
|
clean ? "bg-muted/40" : "border-amber-500/40 bg-amber-500/5"
|
|
4079
4080
|
),
|
|
@@ -4214,12 +4215,12 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4214
4215
|
RefusalNotice,
|
|
4215
4216
|
{
|
|
4216
4217
|
error: problem,
|
|
4217
|
-
actions: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4218
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.Button, { size: "sm", variant: "outline", className: "mt-1", disabled: busy, onClick: () => void run(), children: "Try again" })
|
|
4218
4219
|
}
|
|
4219
4220
|
) }) : null,
|
|
4220
4221
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4221
4222
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4222
|
-
|
|
4223
|
+
import_design_system29.Button,
|
|
4223
4224
|
{
|
|
4224
4225
|
size: "sm",
|
|
4225
4226
|
disabled: busy || !rights.write || rows.length === 0 || titleMissing || ruleVerdicts.length > 0 && !goAheadAnyway,
|
|
@@ -4227,7 +4228,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4227
4228
|
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"}`
|
|
4228
4229
|
}
|
|
4229
4230
|
),
|
|
4230
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: (0,
|
|
4231
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: (0, import_design_system29.cn)("text-muted-foreground", titleMissing && "text-destructive"), children: [
|
|
4231
4232
|
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` : ""),
|
|
4232
4233
|
fileHash || titleMissing ? "" : " \xB7 this browser cannot recognize the file again, so importing it twice would write it twice"
|
|
4233
4234
|
] })
|
|
@@ -4248,14 +4249,14 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4248
4249
|
] }) : null,
|
|
4249
4250
|
alreadyRan ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-muted-foreground", children: alreadyRan }) : null,
|
|
4250
4251
|
outcomes.length > 0 || summary || ledger ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4251
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4252
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.Separator, {}),
|
|
4252
4253
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4253
4254
|
/* @__PURE__ */ (0, import_jsx_runtime32.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` }),
|
|
4254
4255
|
ledger && !ledger.final && phase !== "writing" ? /* @__PURE__ */ (0, import_jsx_runtime32.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,
|
|
4255
4256
|
(ledger ? ledger.refused + ledger.duplicate : counts.refused + counts.duplicate) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4256
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: (0,
|
|
4257
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: (0,
|
|
4258
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: (0,
|
|
4257
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: (0, import_design_system29.cn)("underline underline-offset-2", show === "all" && "font-medium"), onClick: () => setShow("all"), children: "everything that did not land" }),
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: (0, import_design_system29.cn)("underline underline-offset-2", show === "refused" && "font-medium"), onClick: () => setShow("refused"), children: "refused" }),
|
|
4259
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: (0, import_design_system29.cn)("underline underline-offset-2", show === "duplicate" && "font-medium"), onClick: () => setShow("duplicate"), children: "already here" })
|
|
4259
4260
|
] }) : null
|
|
4260
4261
|
] }),
|
|
4261
4262
|
summary ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-muted-foreground", children: summary }) : null,
|
|
@@ -4276,7 +4277,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4276
4277
|
g.example
|
|
4277
4278
|
] }, g.reason)) }),
|
|
4278
4279
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4279
|
-
|
|
4280
|
+
import_design_system29.Button,
|
|
4280
4281
|
{
|
|
4281
4282
|
size: "sm",
|
|
4282
4283
|
variant: "outline",
|
|
@@ -4351,7 +4352,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4351
4352
|
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}`
|
|
4352
4353
|
] }, p.column)) }) : null,
|
|
4353
4354
|
phase === "done" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4354
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.Button, { size: "sm", onClick: () => onDone?.(ledger?.written ?? 0), children: "Done" }),
|
|
4355
4356
|
(ledger?.refused ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
4356
4357
|
"The ",
|
|
4357
4358
|
ledger?.refused,
|
|
@@ -4369,7 +4370,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4369
4370
|
] }) : null,
|
|
4370
4371
|
runsProblem ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RefusalNotice, { error: runsProblem }) : null,
|
|
4371
4372
|
runs && runs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4372
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system29.Separator, {}),
|
|
4373
4374
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "font-medium", children: "Imports into this table" }),
|
|
4374
4375
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: "flex flex-col gap-1", children: runs.map((r) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("li", { className: "flex flex-col gap-1", children: [
|
|
4375
4376
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
@@ -4432,7 +4433,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4432
4433
|
table.error ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RefusalNotice, { error: table.error, onRetry: table.reload }) : null
|
|
4433
4434
|
] });
|
|
4434
4435
|
}
|
|
4435
|
-
var import_react46, import_react47, import_core6,
|
|
4436
|
+
var import_react46, import_react47, import_core6, import_design_system29, import_records15, import_text_case5, import_jsx_runtime32, BATCH, SAMPLES, COLUMNS_PER_CALL, ABSENT, LEAVE, TITLE_COPY, TYPED_VALUES;
|
|
4436
4437
|
var init_ImportWizard = __esm({
|
|
4437
4438
|
"src/ImportWizard.tsx"() {
|
|
4438
4439
|
"use strict";
|
|
@@ -4440,7 +4441,7 @@ var init_ImportWizard = __esm({
|
|
|
4440
4441
|
import_react46 = require("react");
|
|
4441
4442
|
import_react47 = require("@ai-matrx/records/react");
|
|
4442
4443
|
import_core6 = require("@ai-matrx/records/core");
|
|
4443
|
-
|
|
4444
|
+
import_design_system29 = require("@ai-matrx/design-system");
|
|
4444
4445
|
import_records15 = require("@ai-matrx/records");
|
|
4445
4446
|
init_Refusal();
|
|
4446
4447
|
init_refusals();
|
|
@@ -4498,7 +4499,7 @@ var init_tableLanes = __esm({
|
|
|
4498
4499
|
});
|
|
4499
4500
|
|
|
4500
4501
|
// src/TablesHome.tsx
|
|
4501
|
-
var import_react48, import_react49, import_core7, import_records16,
|
|
4502
|
+
var import_react48, import_react49, import_core7, import_records16, import_design_system30, import_jsx_runtime33;
|
|
4502
4503
|
var init_TablesHome = __esm({
|
|
4503
4504
|
"src/TablesHome.tsx"() {
|
|
4504
4505
|
"use strict";
|
|
@@ -4507,7 +4508,7 @@ var init_TablesHome = __esm({
|
|
|
4507
4508
|
import_react49 = require("@ai-matrx/records/react");
|
|
4508
4509
|
import_core7 = require("@ai-matrx/records/core");
|
|
4509
4510
|
import_records16 = require("@ai-matrx/records");
|
|
4510
|
-
|
|
4511
|
+
import_design_system30 = require("@ai-matrx/design-system");
|
|
4511
4512
|
init_tableLanes();
|
|
4512
4513
|
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4513
4514
|
}
|
|
@@ -4617,7 +4618,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4617
4618
|
[sourceName, headers, rows, sourceText]
|
|
4618
4619
|
);
|
|
4619
4620
|
if (!shape) {
|
|
4620
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: (0,
|
|
4621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: (0, import_design_system31.cn)("flex flex-col gap-2 text-sm", className), "data-save-to-table": "", children: /* @__PURE__ */ (0, import_jsx_runtime34.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." }) });
|
|
4621
4622
|
}
|
|
4622
4623
|
const chooseShape = (i) => {
|
|
4623
4624
|
setWhich(i);
|
|
@@ -4748,11 +4749,11 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4748
4749
|
};
|
|
4749
4750
|
makeRef.current = make;
|
|
4750
4751
|
const busy = phase === "making" || phase === "writing";
|
|
4751
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0,
|
|
4752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: (0, import_design_system31.cn)("flex min-w-0 flex-col gap-3 text-sm", className), "data-save-to-table": "", children: [
|
|
4752
4753
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4753
|
-
shapes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4754
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4755
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4754
|
+
shapes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system31.Select, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
|
|
4755
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectTrigger, { size: "sm", "aria-label": "Which of these to save", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectValue, {}) }),
|
|
4756
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectContent, { children: shapes.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system31.SelectItem, { value: String(i), children: [
|
|
4756
4757
|
s.name ? `${s.name} \u2014 ` : "",
|
|
4757
4758
|
s.said
|
|
4758
4759
|
] }, i)) })
|
|
@@ -4761,7 +4762,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4761
4762
|
shape.said
|
|
4762
4763
|
] }),
|
|
4763
4764
|
shape.splits.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4764
|
-
|
|
4765
|
+
import_design_system31.Select,
|
|
4765
4766
|
{
|
|
4766
4767
|
value: split || "__one__",
|
|
4767
4768
|
onValueChange: (v) => {
|
|
@@ -4770,10 +4771,10 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4770
4771
|
},
|
|
4771
4772
|
disabled: busy || phase === "done",
|
|
4772
4773
|
children: [
|
|
4773
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4774
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4775
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4776
|
-
shape.splits.map((s) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4774
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectTrigger, { size: "sm", "aria-label": "How to read the list", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectValue, {}) }),
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system31.SelectContent, { children: [
|
|
4776
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectItem, { value: "__one__", children: "One column" }),
|
|
4777
|
+
shape.splits.map((s) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectItem, { value: s.delimiter, children: s.label }, s.delimiter))
|
|
4777
4778
|
] })
|
|
4778
4779
|
]
|
|
4779
4780
|
}
|
|
@@ -4792,13 +4793,13 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4792
4793
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: made.sentence }),
|
|
4793
4794
|
problem ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RefusalNotice, { error: problem }) : null,
|
|
4794
4795
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-2", children: [
|
|
4795
|
-
onOpenTable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4796
|
-
onClose ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4796
|
+
onOpenTable ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.Button, { size: "sm", onClick: () => onOpenTable(made.tableId), children: "Open the table" }) : null,
|
|
4797
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.Button, { size: "sm", variant: "outline", onClick: onClose, children: "Done" }) : null
|
|
4797
4798
|
] })
|
|
4798
4799
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
4799
4800
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-wrap gap-2", role: "radiogroup", "aria-label": "Where to save these rows", children: [
|
|
4800
4801
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4801
|
-
|
|
4802
|
+
import_design_system31.Button,
|
|
4802
4803
|
{
|
|
4803
4804
|
size: "sm",
|
|
4804
4805
|
variant: target === "new" ? "default" : "outline",
|
|
@@ -4810,7 +4811,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4810
4811
|
}
|
|
4811
4812
|
),
|
|
4812
4813
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4813
|
-
|
|
4814
|
+
import_design_system31.Button,
|
|
4814
4815
|
{
|
|
4815
4816
|
size: "sm",
|
|
4816
4817
|
variant: target === "existing" ? "default" : "outline",
|
|
@@ -4826,7 +4827,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4826
4827
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
4827
4828
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xs font-medium", children: "Table name" }),
|
|
4828
4829
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4829
|
-
|
|
4830
|
+
import_design_system31.Input,
|
|
4830
4831
|
{
|
|
4831
4832
|
value: name ?? proposedName,
|
|
4832
4833
|
onChange: (e) => setName(e.target.value),
|
|
@@ -4838,7 +4839,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4838
4839
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
4839
4840
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xs font-medium", children: "Description (optional)" }),
|
|
4840
4841
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4841
|
-
|
|
4842
|
+
import_design_system31.Input,
|
|
4842
4843
|
{
|
|
4843
4844
|
value: description,
|
|
4844
4845
|
onChange: (e) => setDescription(e.target.value),
|
|
@@ -4857,7 +4858,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4857
4858
|
"data-save-to-table-column": c.header,
|
|
4858
4859
|
children: [
|
|
4859
4860
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4860
|
-
|
|
4861
|
+
import_design_system31.Checkbox,
|
|
4861
4862
|
{
|
|
4862
4863
|
checked: c.use,
|
|
4863
4864
|
disabled: busy,
|
|
@@ -4866,7 +4867,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4866
4867
|
}
|
|
4867
4868
|
),
|
|
4868
4869
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4869
|
-
|
|
4870
|
+
import_design_system31.Input,
|
|
4870
4871
|
{
|
|
4871
4872
|
value: c.label,
|
|
4872
4873
|
"aria-label": `Name of the column ${c.header}`,
|
|
@@ -4875,7 +4876,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4875
4876
|
}
|
|
4876
4877
|
),
|
|
4877
4878
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4878
|
-
|
|
4879
|
+
import_design_system31.Select,
|
|
4879
4880
|
{
|
|
4880
4881
|
value: c.guess.type,
|
|
4881
4882
|
disabled: busy || !c.use,
|
|
@@ -4889,13 +4890,13 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4889
4890
|
})
|
|
4890
4891
|
),
|
|
4891
4892
|
children: [
|
|
4892
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4893
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectTrigger, { size: "sm", "aria-label": `What the column ${c.label || c.header} holds`, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectValue, {}) }),
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectContent, { children: SAVE_TO_TABLE_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectItem, { value: t, children: typeWord2(t) }, t)) })
|
|
4894
4895
|
]
|
|
4895
4896
|
}
|
|
4896
4897
|
),
|
|
4897
4898
|
c.guess.type === "select" && c.use ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4898
|
-
|
|
4899
|
+
import_design_system31.Input,
|
|
4899
4900
|
{
|
|
4900
4901
|
className: "col-span-2 col-start-2",
|
|
4901
4902
|
value: c.options,
|
|
@@ -4911,17 +4912,17 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4911
4912
|
] }),
|
|
4912
4913
|
problem ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RefusalNotice, { error: problem }) : null,
|
|
4913
4914
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4914
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4915
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.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"}` }),
|
|
4915
4916
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xs text-muted-foreground", children: "Nothing is made until you press it." })
|
|
4916
4917
|
] })
|
|
4917
4918
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-2", "data-save-to-table-existing": "", children: [
|
|
4918
|
-
tables.loading || levels.loading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.jsxs)(
|
|
4919
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4920
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4919
|
+
tables.loading || levels.loading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-muted-foreground", children: "Reading your tables\u2026" }) : tables.error ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RefusalNotice, { error: tables.error }) : writable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.jsxs)(import_design_system31.Select, { value: tableId, onValueChange: setTableId, disabled: busy, children: [
|
|
4920
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectTrigger, { size: "sm", "aria-label": "Which table to add the rows to", className: "min-w-[16rem]", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectValue, { placeholder: "Choose a table" }) }),
|
|
4921
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectContent, { children: writable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system31.SelectItem, { value: t.id, children: t.name }, t.id)) })
|
|
4921
4922
|
] }),
|
|
4922
4923
|
tableId ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-col gap-1", "data-save-to-table-replace": "", children: replaced?.tableId === tableId ? /* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.jsxs)("label", { className: "flex items-center gap-2 text-xs", children: [
|
|
4923
4924
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4924
|
-
|
|
4925
|
+
import_design_system31.Checkbox,
|
|
4925
4926
|
{
|
|
4926
4927
|
checked: replaceAsked,
|
|
4927
4928
|
disabled: busy || replacing,
|
|
@@ -4932,7 +4933,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4932
4933
|
"Replace what this table holds (its current rows move to the archive first)"
|
|
4933
4934
|
] }) }) : null,
|
|
4934
4935
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4935
|
-
|
|
4936
|
+
import_design_system31.ConfirmDialog,
|
|
4936
4937
|
{
|
|
4937
4938
|
open: replaceAsked && Boolean(tableId) && replaced?.tableId !== tableId,
|
|
4938
4939
|
onOpenChange: (open) => {
|
|
@@ -4991,14 +4992,14 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
4991
4992
|
] })
|
|
4992
4993
|
] });
|
|
4993
4994
|
}
|
|
4994
|
-
var import_react50, import_react51,
|
|
4995
|
+
var import_react50, import_react51, import_design_system31, import_jsx_runtime34, SAVE_TO_TABLE_TYPES;
|
|
4995
4996
|
var init_SaveToTable = __esm({
|
|
4996
4997
|
"src/SaveToTable.tsx"() {
|
|
4997
4998
|
"use strict";
|
|
4998
4999
|
"use client";
|
|
4999
5000
|
import_react50 = require("react");
|
|
5000
5001
|
import_react51 = require("@ai-matrx/records/react");
|
|
5001
|
-
|
|
5002
|
+
import_design_system31 = require("@ai-matrx/design-system");
|
|
5002
5003
|
init_createTable();
|
|
5003
5004
|
init_unfinishedTable();
|
|
5004
5005
|
init_ImportWizard();
|
|
@@ -5053,7 +5054,7 @@ module.exports = __toCommonJS(pickers_exports);
|
|
|
5053
5054
|
// src/TablePickers.tsx
|
|
5054
5055
|
var import_react82 = require("react");
|
|
5055
5056
|
var import_react83 = require("@ai-matrx/records/react");
|
|
5056
|
-
var
|
|
5057
|
+
var import_design_system50 = require("@ai-matrx/design-system");
|
|
5057
5058
|
|
|
5058
5059
|
// src/askOnce.ts
|
|
5059
5060
|
var askOnce_exports = {};
|
|
@@ -5369,7 +5370,7 @@ function AddChoicesInline({ field, onAdded, disabled = false }) {
|
|
|
5369
5370
|
var import_react78 = require("react");
|
|
5370
5371
|
var import_records29 = require("@ai-matrx/records");
|
|
5371
5372
|
var import_react79 = require("@ai-matrx/records/react");
|
|
5372
|
-
var
|
|
5373
|
+
var import_design_system49 = require("@ai-matrx/design-system");
|
|
5373
5374
|
init_dates();
|
|
5374
5375
|
|
|
5375
5376
|
// src/newerKindValues.tsx
|
|
@@ -5694,7 +5695,7 @@ init_names();
|
|
|
5694
5695
|
var import_react10 = require("react");
|
|
5695
5696
|
var import_records3 = require("@ai-matrx/records");
|
|
5696
5697
|
var import_react11 = require("@ai-matrx/records/react");
|
|
5697
|
-
var
|
|
5698
|
+
var import_design_system10 = require("@ai-matrx/design-system");
|
|
5698
5699
|
init_PickOrAdd();
|
|
5699
5700
|
init_names();
|
|
5700
5701
|
init_Refusal();
|
|
@@ -5902,7 +5903,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
5902
5903
|
};
|
|
5903
5904
|
}, [client, open, allowCreate, several, target, targetRefusal, field.relation_target]);
|
|
5904
5905
|
if (!client) {
|
|
5905
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id, className: (0,
|
|
5906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id, className: (0, import_design_system10.cn)("text-xs text-muted-foreground", className), children: NO_STORE_ON_THIS_SCREEN_REASON });
|
|
5906
5907
|
}
|
|
5907
5908
|
if (!field.relation_target) {
|
|
5908
5909
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -5975,7 +5976,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
5975
5976
|
));
|
|
5976
5977
|
return (
|
|
5977
5978
|
// Never wider than where it is drawn (a grid cell beside a sticky column: B3-07) — chips truncate, the button wraps.
|
|
5978
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0,
|
|
5979
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_design_system10.cn)("flex min-w-0 max-w-full flex-wrap items-center gap-1", className), children: [
|
|
5979
5980
|
anchored && !disabled ? null : cellChips,
|
|
5980
5981
|
disabled ? null : (
|
|
5981
5982
|
// THE ONE "PICK OR ADD" BUILDER (PickOrAdd.tsx) — the choice editor draws the same one.
|
|
@@ -6032,7 +6033,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
6032
6033
|
} : null,
|
|
6033
6034
|
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: [
|
|
6034
6035
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6035
|
-
|
|
6036
|
+
import_design_system10.BasicInput,
|
|
6036
6037
|
{
|
|
6037
6038
|
autoFocus: true,
|
|
6038
6039
|
value: newTitle,
|
|
@@ -6049,7 +6050,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
|
|
|
6049
6050
|
}
|
|
6050
6051
|
),
|
|
6051
6052
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6052
|
-
|
|
6053
|
+
import_design_system10.Button,
|
|
6053
6054
|
{
|
|
6054
6055
|
type: "button",
|
|
6055
6056
|
size: "sm",
|
|
@@ -6095,7 +6096,7 @@ function readableLink(raw) {
|
|
|
6095
6096
|
|
|
6096
6097
|
// src/buttonCell.tsx
|
|
6097
6098
|
var import_react73 = require("react");
|
|
6098
|
-
var
|
|
6099
|
+
var import_design_system46 = require("@ai-matrx/design-system");
|
|
6099
6100
|
var import_data_table6 = require("@ai-matrx/design-system/data-table");
|
|
6100
6101
|
var import_records27 = require("@ai-matrx/records");
|
|
6101
6102
|
var import_react74 = require("@ai-matrx/records/react");
|
|
@@ -6150,10 +6151,10 @@ function columnNameProblemLine(name, noun = "column") {
|
|
|
6150
6151
|
var import_react71 = require("react");
|
|
6151
6152
|
var import_react72 = require("@ai-matrx/records/react");
|
|
6152
6153
|
var import_core9 = require("@ai-matrx/records/core");
|
|
6153
|
-
var
|
|
6154
|
+
var import_design_system45 = require("@ai-matrx/design-system");
|
|
6154
6155
|
|
|
6155
6156
|
// src/WatchFieldsPicker.tsx
|
|
6156
|
-
var
|
|
6157
|
+
var import_design_system11 = require("@ai-matrx/design-system");
|
|
6157
6158
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
6158
6159
|
function watchedFieldsOf(field) {
|
|
6159
6160
|
const list = field?.config?.["only_fields"];
|
|
@@ -6171,15 +6172,15 @@ function watchable(field) {
|
|
|
6171
6172
|
function WatchFieldsPicker({ fields, value, onChange }) {
|
|
6172
6173
|
const choices = fields.filter(watchable);
|
|
6173
6174
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("fieldset", { className: "flex flex-col gap-1", "data-records-watch-fields": "", children: [
|
|
6174
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
6175
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system11.Label, { className: "text-xs", children: "Changes to" }),
|
|
6175
6176
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-wrap gap-x-3 gap-y-1", children: [
|
|
6176
6177
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
6177
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
6178
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system11.Checkbox, { checked: value.length === 0, "aria-label": "Any field", onCheckedChange: (v) => v === true && onChange([]) }),
|
|
6178
6179
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "Any field" })
|
|
6179
6180
|
] }),
|
|
6180
6181
|
choices.map((f) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
6181
6182
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
6182
|
-
|
|
6183
|
+
import_design_system11.Checkbox,
|
|
6183
6184
|
{
|
|
6184
6185
|
checked: value.includes(f.key),
|
|
6185
6186
|
"aria-label": f.label,
|
|
@@ -6204,7 +6205,7 @@ var import_core2 = require("@ai-matrx/records/core");
|
|
|
6204
6205
|
init_createTable();
|
|
6205
6206
|
init_Refusal();
|
|
6206
6207
|
init_tablePicking();
|
|
6207
|
-
var
|
|
6208
|
+
var import_design_system14 = require("@ai-matrx/design-system");
|
|
6208
6209
|
init_names();
|
|
6209
6210
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6210
6211
|
var DEFAULT_SEPARATOR = " ";
|
|
@@ -6324,7 +6325,7 @@ function ReferenceBuilder({
|
|
|
6324
6325
|
};
|
|
6325
6326
|
const mayMakeTable = (0, import_core2.doorReady)(client.config, import_core2.DOORS.tableFind) && (0, import_core2.doorReady)(client.config, import_core2.DOORS.tableEnsure);
|
|
6326
6327
|
const newTableButton = !mayMakeTable ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6327
|
-
|
|
6328
|
+
import_design_system14.Button,
|
|
6328
6329
|
{
|
|
6329
6330
|
type: "button",
|
|
6330
6331
|
size: "sm",
|
|
@@ -6353,16 +6354,16 @@ function ReferenceBuilder({
|
|
|
6353
6354
|
next.splice(to, 0, next.splice(at, 1)[0]);
|
|
6354
6355
|
setDisplay({ columns: next, separator });
|
|
6355
6356
|
};
|
|
6356
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: (0,
|
|
6357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: (0, import_design_system14.cn)("flex max-w-[26rem] flex-col gap-3", className), children: [
|
|
6357
6358
|
!lockTarget && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
6358
6359
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
6359
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6360
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.Label, { className: "text-xs", children: "The table it points at" }),
|
|
6360
6361
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ShowListsToggle, { count: picking.listCount, on: showLists, onChange: setShowLists })
|
|
6361
6362
|
] }),
|
|
6362
6363
|
naming !== null ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-1", "data-new-link-table": "", children: [
|
|
6363
6364
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6364
6365
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6365
|
-
|
|
6366
|
+
import_design_system14.BasicInput,
|
|
6366
6367
|
{
|
|
6367
6368
|
autoFocus: true,
|
|
6368
6369
|
value: naming,
|
|
@@ -6385,7 +6386,7 @@ function ReferenceBuilder({
|
|
|
6385
6386
|
}
|
|
6386
6387
|
),
|
|
6387
6388
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6388
|
-
|
|
6389
|
+
import_design_system14.Button,
|
|
6389
6390
|
{
|
|
6390
6391
|
type: "button",
|
|
6391
6392
|
size: "sm",
|
|
@@ -6395,7 +6396,7 @@ function ReferenceBuilder({
|
|
|
6395
6396
|
}
|
|
6396
6397
|
),
|
|
6397
6398
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6398
|
-
|
|
6399
|
+
import_design_system14.Button,
|
|
6399
6400
|
{
|
|
6400
6401
|
type: "button",
|
|
6401
6402
|
size: "sm",
|
|
@@ -6414,7 +6415,7 @@ function ReferenceBuilder({
|
|
|
6414
6415
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No tables yet." }),
|
|
6415
6416
|
newTableButton
|
|
6416
6417
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
6417
|
-
|
|
6418
|
+
import_design_system14.Select,
|
|
6418
6419
|
{
|
|
6419
6420
|
value: value.targetTableId,
|
|
6420
6421
|
onValueChange: (next) => {
|
|
@@ -6426,13 +6427,13 @@ function ReferenceBuilder({
|
|
|
6426
6427
|
onChange({ targetTableId: next, display: null });
|
|
6427
6428
|
},
|
|
6428
6429
|
children: [
|
|
6429
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6430
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
6431
|
-
offered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
6430
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.SelectTrigger, { size: "sm", "aria-label": "The table this column points at", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.SelectValue, { placeholder: "Choose a table" }) }),
|
|
6431
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_design_system14.SelectContent, { children: [
|
|
6432
|
+
offered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_design_system14.SelectItem, { value: t.id, children: [
|
|
6432
6433
|
t.label,
|
|
6433
6434
|
t.id === tableId ? " \u2014 this table" : ""
|
|
6434
6435
|
] }, t.id)),
|
|
6435
|
-
mayMakeTable ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6436
|
+
mayMakeTable ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.SelectItem, { value: NEW_TABLE, children: "New table\u2026" }) : null
|
|
6436
6437
|
] })
|
|
6437
6438
|
]
|
|
6438
6439
|
}
|
|
@@ -6440,12 +6441,12 @@ function ReferenceBuilder({
|
|
|
6440
6441
|
] }),
|
|
6441
6442
|
target && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
6442
6443
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6443
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6444
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.Label, { className: "text-xs", children: "Shown as" }),
|
|
6444
6445
|
/* @__PURE__ */ (0, import_jsx_runtime14.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" })
|
|
6445
6446
|
] }),
|
|
6446
6447
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
6447
6448
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6448
|
-
|
|
6449
|
+
import_design_system14.Checkbox,
|
|
6449
6450
|
{
|
|
6450
6451
|
checked: overriding,
|
|
6451
6452
|
onCheckedChange: (next) => {
|
|
@@ -6463,7 +6464,7 @@ function ReferenceBuilder({
|
|
|
6463
6464
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-wrap gap-1", children: columns.keys.map((key) => {
|
|
6464
6465
|
const on = chosen.includes(key);
|
|
6465
6466
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
6466
|
-
|
|
6467
|
+
import_design_system14.Button,
|
|
6467
6468
|
{
|
|
6468
6469
|
type: "button",
|
|
6469
6470
|
size: "sm",
|
|
@@ -6483,7 +6484,7 @@ function ReferenceBuilder({
|
|
|
6483
6484
|
chosen.map((key, at) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "flex items-center gap-0.5", children: [
|
|
6484
6485
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-[11px]", children: key }),
|
|
6485
6486
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6486
|
-
|
|
6487
|
+
import_design_system14.Button,
|
|
6487
6488
|
{
|
|
6488
6489
|
type: "button",
|
|
6489
6490
|
size: "sm",
|
|
@@ -6495,7 +6496,7 @@ function ReferenceBuilder({
|
|
|
6495
6496
|
}
|
|
6496
6497
|
),
|
|
6497
6498
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6498
|
-
|
|
6499
|
+
import_design_system14.Button,
|
|
6499
6500
|
{
|
|
6500
6501
|
type: "button",
|
|
6501
6502
|
size: "sm",
|
|
@@ -6509,9 +6510,9 @@ function ReferenceBuilder({
|
|
|
6509
6510
|
] }, key))
|
|
6510
6511
|
] }),
|
|
6511
6512
|
chosen.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6512
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.Label, { className: "text-xs whitespace-nowrap", children: "Joined by" }),
|
|
6513
6514
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6514
|
-
|
|
6515
|
+
import_design_system14.BasicInput,
|
|
6515
6516
|
{
|
|
6516
6517
|
value: separator,
|
|
6517
6518
|
onChange: (e) => setDisplay({ columns: chosen, separator: e.target.value }),
|
|
@@ -6523,7 +6524,7 @@ function ReferenceBuilder({
|
|
|
6523
6524
|
] })
|
|
6524
6525
|
] }) }),
|
|
6525
6526
|
target && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
|
|
6526
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6527
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system14.Label, { className: "text-xs", children: "It will read" }),
|
|
6527
6528
|
preview.loading ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.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_runtime14.jsx)("ul", { className: "flex flex-col gap-0.5", children: (preview.data?.rows ?? []).map((row) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "truncate text-[11px] text-foreground", children: previewWords(
|
|
6528
6529
|
row.document,
|
|
6529
6530
|
display,
|
|
@@ -6537,7 +6538,7 @@ function ReferenceBuilder({
|
|
|
6537
6538
|
var import_react18 = require("react");
|
|
6538
6539
|
var import_react19 = require("@ai-matrx/records/react");
|
|
6539
6540
|
var import_records5 = require("@ai-matrx/records");
|
|
6540
|
-
var
|
|
6541
|
+
var import_design_system15 = require("@ai-matrx/design-system");
|
|
6541
6542
|
init_host();
|
|
6542
6543
|
init_Refusal();
|
|
6543
6544
|
init_plainWords();
|
|
@@ -6650,9 +6651,9 @@ function FormulaTextEditor({
|
|
|
6650
6651
|
const at = Math.max(0, Math.min(parsed.position ?? 0, parsed.text.length));
|
|
6651
6652
|
return { before: parsed.text.slice(0, at), after: parsed.text.slice(at) };
|
|
6652
6653
|
}, [parsed]);
|
|
6653
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { "data-records-formula-editor": "", className: (0,
|
|
6654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { "data-records-formula-editor": "", className: (0, import_design_system15.cn)("flex flex-col gap-1.5", className), children: [
|
|
6654
6655
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6655
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6656
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system15.Label, { className: "text-xs", children: "The formula" }),
|
|
6656
6657
|
host.formulaHelp ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "data-records-formula-help": "", className: "ml-auto", children: host.formulaHelp({
|
|
6657
6658
|
tableId,
|
|
6658
6659
|
text,
|
|
@@ -6664,7 +6665,7 @@ function FormulaTextEditor({
|
|
|
6664
6665
|
}) }) : null
|
|
6665
6666
|
] }),
|
|
6666
6667
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6667
|
-
|
|
6668
|
+
import_design_system15.BasicTextarea,
|
|
6668
6669
|
{
|
|
6669
6670
|
ref: box,
|
|
6670
6671
|
value: text,
|
|
@@ -6687,7 +6688,7 @@ function FormulaTextEditor({
|
|
|
6687
6688
|
sampleRecordId ? "This record" : "First row",
|
|
6688
6689
|
": "
|
|
6689
6690
|
] }),
|
|
6690
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: (0,
|
|
6691
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: (0, import_design_system15.cn)("font-mono", parsed.error ? "text-muted-foreground" : "text-foreground"), children: sampleWords(parsed) })
|
|
6691
6692
|
] }) : null,
|
|
6692
6693
|
parsed && !parsed.ok ? (
|
|
6693
6694
|
// NOT A REFUSAL, SO NOT RED: nothing was pressed. It is the store's reading of the
|
|
@@ -6704,7 +6705,7 @@ function FormulaTextEditor({
|
|
|
6704
6705
|
error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefusalLine, { error }) : null,
|
|
6705
6706
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
6706
6707
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-[11px] text-muted-foreground", children: "Columns:" }),
|
|
6707
|
-
columns.map((f) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6708
|
+
columns.map((f) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system15.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-1.5 text-[11px]", onClick: () => insert(`{${fieldName(f)}}`), children: fieldName(f) }, f.id))
|
|
6708
6709
|
] }),
|
|
6709
6710
|
STORE_FORMULA_FUNCTION_NAMES.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "text-[11px] text-muted-foreground", children: [
|
|
6710
6711
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { className: "cursor-pointer", children: [
|
|
@@ -6712,7 +6713,7 @@ function FormulaTextEditor({
|
|
|
6712
6713
|
STORE_FORMULA_FUNCTION_NAMES.length,
|
|
6713
6714
|
")"
|
|
6714
6715
|
] }),
|
|
6715
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-1 flex flex-wrap gap-1", children: STORE_FORMULA_FUNCTION_NAMES.map((name) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6716
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-1 flex flex-wrap gap-1", children: STORE_FORMULA_FUNCTION_NAMES.map((name) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system15.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-1.5 font-mono text-[11px]", onClick: () => insert(`${name}()`), children: name }, name)) })
|
|
6716
6717
|
] }) : null
|
|
6717
6718
|
] });
|
|
6718
6719
|
}
|
|
@@ -6720,7 +6721,7 @@ function FormulaTextEditor({
|
|
|
6720
6721
|
// src/EntityReferenceKindPicker.tsx
|
|
6721
6722
|
var import_react20 = require("react");
|
|
6722
6723
|
var import_react21 = require("@ai-matrx/records/react");
|
|
6723
|
-
var
|
|
6724
|
+
var import_design_system16 = require("@ai-matrx/design-system");
|
|
6724
6725
|
init_Refusal();
|
|
6725
6726
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
6726
6727
|
var ENTITY_REFERENCE_KINDS_MISSING = "Choose at least one kind of thing this column points at.";
|
|
@@ -6756,9 +6757,9 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
6756
6757
|
if (on) onChange(chosen.has(token) ? [...value] : [...value, token]);
|
|
6757
6758
|
else onChange(value.filter((t) => t !== token));
|
|
6758
6759
|
};
|
|
6759
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0,
|
|
6760
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6761
|
-
value.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-wrap gap-1", "aria-label": "Chosen kinds", children: value.map((token) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_design_system16.cn)("flex flex-col gap-2", className), children: [
|
|
6761
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system16.Label, { className: "text-xs", children: "What it points at" }),
|
|
6762
|
+
value.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-wrap gap-1", "aria-label": "Chosen kinds", children: value.map((token) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_design_system16.Badge, { variant: "secondary", className: "gap-1 text-[11px]", children: [
|
|
6762
6763
|
labelOf.get(token) ?? token,
|
|
6763
6764
|
locked ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6764
6765
|
"button",
|
|
@@ -6771,9 +6772,9 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
6771
6772
|
}
|
|
6772
6773
|
)
|
|
6773
6774
|
] }, token)) }) : null,
|
|
6774
|
-
locked ? /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(RefusalNotice, { error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6775
|
+
locked ? /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(RefusalNotice, { error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system16.Skeleton, { className: "h-24 w-full" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
6775
6776
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6776
|
-
|
|
6777
|
+
import_design_system16.BasicInput,
|
|
6777
6778
|
{
|
|
6778
6779
|
"aria-label": "Find a kind of thing",
|
|
6779
6780
|
placeholder: "Find a kind \u2014 note, web site, agent\u2026",
|
|
@@ -6790,7 +6791,7 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
6790
6791
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: category }),
|
|
6791
6792
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-1 gap-1 sm:grid-cols-2", children: kinds.map((k) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "flex items-center gap-1.5 text-xs", children: [
|
|
6792
6793
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6793
|
-
|
|
6794
|
+
import_design_system16.Checkbox,
|
|
6794
6795
|
{
|
|
6795
6796
|
checked: chosen.has(k.token),
|
|
6796
6797
|
"aria-label": k.label,
|
|
@@ -6810,7 +6811,7 @@ init_Refusal();
|
|
|
6810
6811
|
|
|
6811
6812
|
// src/SourceArchivedNotice.tsx
|
|
6812
6813
|
var import_react54 = require("react");
|
|
6813
|
-
var
|
|
6814
|
+
var import_design_system34 = require("@ai-matrx/design-system");
|
|
6814
6815
|
var import_react55 = require("@ai-matrx/records/react");
|
|
6815
6816
|
init_Refusal();
|
|
6816
6817
|
|
|
@@ -6823,7 +6824,7 @@ function withoutLeadingBlank(text) {
|
|
|
6823
6824
|
init_personChip();
|
|
6824
6825
|
var import_data_table3 = require("@ai-matrx/design-system/data-table");
|
|
6825
6826
|
var import_field_formats9 = require("@ai-matrx/design-system/field-formats");
|
|
6826
|
-
var
|
|
6827
|
+
var import_design_system33 = require("@ai-matrx/design-system");
|
|
6827
6828
|
init_parity();
|
|
6828
6829
|
init_dates();
|
|
6829
6830
|
|
|
@@ -6934,7 +6935,7 @@ var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
|
6934
6935
|
|
|
6935
6936
|
// src/signature.tsx
|
|
6936
6937
|
var import_react23 = require("react");
|
|
6937
|
-
var
|
|
6938
|
+
var import_design_system17 = require("@ai-matrx/design-system");
|
|
6938
6939
|
var import_react24 = require("@ai-matrx/records/react");
|
|
6939
6940
|
init_docs();
|
|
6940
6941
|
init_host();
|
|
@@ -7001,7 +7002,7 @@ function DrawnImage({ src, inCell }) {
|
|
|
7001
7002
|
src,
|
|
7002
7003
|
alt: SIGNED_WORD,
|
|
7003
7004
|
"data-records-signature": "",
|
|
7004
|
-
className: (0,
|
|
7005
|
+
className: (0, import_design_system17.cn)("max-w-[12rem] object-contain object-left dark:invert", inCell ? "h-7" : "h-12")
|
|
7005
7006
|
}
|
|
7006
7007
|
);
|
|
7007
7008
|
}
|
|
@@ -7031,7 +7032,7 @@ function SignatureDrawing({
|
|
|
7031
7032
|
}, [client, recordId, fieldKey, knownFile]);
|
|
7032
7033
|
if (drawing?.src) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DrawnImage, { src: drawing.src, inCell });
|
|
7033
7034
|
if (drawing?.hostFileId && host.fileImage) {
|
|
7034
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0,
|
|
7035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_design_system17.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 }) });
|
|
7035
7036
|
}
|
|
7036
7037
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-serif italic", children: String(value) });
|
|
7037
7038
|
}
|
|
@@ -7131,12 +7132,12 @@ function SignaturePad({
|
|
|
7131
7132
|
onChange(null);
|
|
7132
7133
|
};
|
|
7133
7134
|
if (!showPad) {
|
|
7134
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { id, className: (0,
|
|
7135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { id, className: (0, import_design_system17.cn)("flex items-center justify-between gap-2 rounded-md border px-3 py-2", className), children: [
|
|
7135
7136
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SignatureValue, { value }),
|
|
7136
|
-
!disabled ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7137
|
+
!disabled ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system17.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, children: "Sign again" }) : null
|
|
7137
7138
|
] });
|
|
7138
7139
|
}
|
|
7139
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0,
|
|
7140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_design_system17.cn)("flex w-full flex-col gap-1", className), children: [
|
|
7140
7141
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
|
|
7141
7142
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7142
7143
|
"canvas",
|
|
@@ -7151,7 +7152,7 @@ function SignaturePad({
|
|
|
7151
7152
|
onPointerUp: end,
|
|
7152
7153
|
onPointerLeave: end,
|
|
7153
7154
|
onPointerCancel: end,
|
|
7154
|
-
className: (0,
|
|
7155
|
+
className: (0, import_design_system17.cn)(
|
|
7155
7156
|
"block h-36 w-full touch-none rounded-md border border-border bg-white",
|
|
7156
7157
|
disabled ? "cursor-not-allowed opacity-60" : "cursor-crosshair"
|
|
7157
7158
|
)
|
|
@@ -7161,7 +7162,7 @@ function SignaturePad({
|
|
|
7161
7162
|
] }),
|
|
7162
7163
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [
|
|
7163
7164
|
tooBig ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7164
|
-
|
|
7165
|
+
import_design_system17.ErrorBox,
|
|
7165
7166
|
{
|
|
7166
7167
|
as: "span",
|
|
7167
7168
|
className: "mr-auto text-xs text-destructive",
|
|
@@ -7170,7 +7171,7 @@ function SignaturePad({
|
|
|
7170
7171
|
origin: "records-ui/signature"
|
|
7171
7172
|
}
|
|
7172
7173
|
) : null,
|
|
7173
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7174
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system17.Button, { type: "button", variant: "ghost", size: "sm", onClick: clear, disabled: disabled || !dirty, children: "Clear" })
|
|
7174
7175
|
] })
|
|
7175
7176
|
] });
|
|
7176
7177
|
}
|
|
@@ -7207,7 +7208,7 @@ function encodeAt(canvas, type, maxWidth, quality) {
|
|
|
7207
7208
|
// src/looks/designLooks.tsx
|
|
7208
7209
|
var import_react25 = require("react");
|
|
7209
7210
|
var import_icons = require("@ai-matrx/design-system/icons");
|
|
7210
|
-
var
|
|
7211
|
+
var import_design_system18 = require("@ai-matrx/design-system");
|
|
7211
7212
|
var import_controls3 = require("@ai-matrx/design-system/controls");
|
|
7212
7213
|
var import_field_formats5 = require("@ai-matrx/design-system/field-formats");
|
|
7213
7214
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
@@ -7222,7 +7223,7 @@ function numberOf(value) {
|
|
|
7222
7223
|
return null;
|
|
7223
7224
|
}
|
|
7224
7225
|
function Swatch({ color, className }) {
|
|
7225
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": true, className: (0,
|
|
7226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": true, className: (0, import_design_system18.cn)("inline-block h-4 w-4 shrink-0 rounded border border-border", className), style: { backgroundColor: color } });
|
|
7226
7227
|
}
|
|
7227
7228
|
function colorPairGround(format, context) {
|
|
7228
7229
|
const fixed = format.options?.contrastWith;
|
|
@@ -7253,7 +7254,7 @@ function ContrastMark({ ratio, min }) {
|
|
|
7253
7254
|
{
|
|
7254
7255
|
"data-records-contrast": level,
|
|
7255
7256
|
title: level === "pass" ? `Readable: ${said2}` : level === "large-only" ? `Large text only: ${said2}` : `Hard to read: ${said2}`,
|
|
7256
|
-
className: (0,
|
|
7257
|
+
className: (0, import_design_system18.cn)("shrink-0 text-xs tabular-nums", level === "pass" ? "text-muted-foreground" : "text-warning-ink"),
|
|
7257
7258
|
children: [
|
|
7258
7259
|
level === "pass" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons.CheckIcon, { className: "mr-0.5 inline h-3 w-3 align-[-1px]" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons.AlertTriangleIcon, { className: "mr-0.5 inline h-3 w-3 align-[-1px]" }),
|
|
7259
7260
|
said2
|
|
@@ -7273,7 +7274,7 @@ function ColorPairView({ value, format }) {
|
|
|
7273
7274
|
] }),
|
|
7274
7275
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
7275
7276
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Swatch, { color: pair.dark ?? pair.light }),
|
|
7276
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: (0,
|
|
7277
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: (0, import_design_system18.cn)("font-mono text-xs uppercase", !pair.dark && "text-muted-foreground"), children: pair.dark ?? "Inherits light" }),
|
|
7277
7278
|
contrast.dark !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContrastMark, { ratio: contrast.dark, min: pair.min }) : null
|
|
7278
7279
|
] })
|
|
7279
7280
|
] });
|
|
@@ -7294,7 +7295,7 @@ function ColorWell({
|
|
|
7294
7295
|
}
|
|
7295
7296
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
7296
7297
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7297
|
-
|
|
7298
|
+
import_design_system18.BasicInput,
|
|
7298
7299
|
{
|
|
7299
7300
|
type: "color",
|
|
7300
7301
|
"aria-label": `${label}: pick a color`,
|
|
@@ -7308,7 +7309,7 @@ function ColorWell({
|
|
|
7308
7309
|
}
|
|
7309
7310
|
),
|
|
7310
7311
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7311
|
-
|
|
7312
|
+
import_design_system18.BasicInput,
|
|
7312
7313
|
{
|
|
7313
7314
|
id,
|
|
7314
7315
|
"aria-label": label,
|
|
@@ -7407,14 +7408,14 @@ function NumberBox({
|
|
|
7407
7408
|
const typed = FINISHED_NUMBER.test(text.trim()) ? Number(text.trim()) : void 0;
|
|
7408
7409
|
if (typed !== value) setText(value === null || value === void 0 ? "" : String(value));
|
|
7409
7410
|
}
|
|
7410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: (0,
|
|
7411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: (0, import_design_system18.cn)("relative flex items-center", className), children: [
|
|
7411
7412
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7412
|
-
|
|
7413
|
+
import_design_system18.BasicInput,
|
|
7413
7414
|
{
|
|
7414
7415
|
...id ? { id } : {},
|
|
7415
7416
|
"aria-label": label,
|
|
7416
7417
|
inputMode: "decimal",
|
|
7417
|
-
className: (0,
|
|
7418
|
+
className: (0, import_design_system18.cn)("h-7 text-xs tabular-nums", unit ? "pr-9" : ""),
|
|
7418
7419
|
value: text,
|
|
7419
7420
|
disabled,
|
|
7420
7421
|
onChange: (e) => {
|
|
@@ -7528,7 +7529,7 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7528
7529
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex w-full flex-col gap-1.5", children: [
|
|
7529
7530
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: FIELD, children: [
|
|
7530
7531
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Font" }),
|
|
7531
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7532
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.BasicInput, { id, "aria-label": `${label} font`, value: font, placeholder: "Geist", disabled, onChange: (e) => {
|
|
7532
7533
|
setFont(e.target.value);
|
|
7533
7534
|
write({ font: e.target.value });
|
|
7534
7535
|
} })
|
|
@@ -7536,9 +7537,9 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7536
7537
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: FIELD, children: [
|
|
7537
7538
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Weight" }),
|
|
7538
7539
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "grid grid-cols-[1fr_6rem] gap-2", children: [
|
|
7539
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7540
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7541
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7540
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system18.Select, { value: String(clampWeight(style.weight)), disabled: disabled ?? false, onValueChange: (v) => write({ weight: clampWeight(Number(v)) }), children: [
|
|
7541
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectTrigger, { "aria-label": `${label} weight`, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectValue, {}) }),
|
|
7542
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectContent, { children: import_field_formats5.TYPE_WEIGHTS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectItem, { value: String(w.value), children: w.label }, w.value)) })
|
|
7542
7543
|
] }),
|
|
7543
7544
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(UnitInput, { label: `${label} size`, unit: "px", value: style.size, disabled, onChange: (n) => n !== null && write({ size: clampSize(n) }) })
|
|
7544
7545
|
] })
|
|
@@ -7573,9 +7574,9 @@ function ShadowSwatch({ layers, theme, size = "sm" }) {
|
|
|
7573
7574
|
{
|
|
7574
7575
|
"aria-hidden": true,
|
|
7575
7576
|
"data-records-shadow-swatch": theme,
|
|
7576
|
-
className: (0,
|
|
7577
|
+
className: (0, import_design_system18.cn)("flex shrink-0 items-center justify-center rounded-md", size === "lg" ? "h-24 w-full" : "h-7 w-11"),
|
|
7577
7578
|
style: { backgroundColor: g.ground },
|
|
7578
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0,
|
|
7579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_design_system18.cn)("rounded", size === "lg" ? "h-12 w-20" : "h-3.5 w-6"), style: { backgroundColor: g.card, boxShadow: (0, import_field_formats5.shadowCss)(layers) } })
|
|
7579
7580
|
}
|
|
7580
7581
|
);
|
|
7581
7582
|
}
|
|
@@ -7663,7 +7664,7 @@ function ShadowPreview({ value }) {
|
|
|
7663
7664
|
}
|
|
7664
7665
|
var CHECKER = "repeating-conic-gradient(#d4d4d8 0% 25%, #ffffff 0% 50%) 50% / 8px 8px";
|
|
7665
7666
|
function OpacitySwatch({ opacity, size = "sm" }) {
|
|
7666
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": true, className: (0,
|
|
7667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": true, className: (0, import_design_system18.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_runtime18.jsx)("span", { className: "absolute inset-0 bg-foreground", style: { opacity } }) });
|
|
7667
7668
|
}
|
|
7668
7669
|
function OpacityView({ value }) {
|
|
7669
7670
|
const o = (0, import_field_formats5.readOpacity)(value);
|
|
@@ -7690,7 +7691,7 @@ function OpacityPreview({ value }) {
|
|
|
7690
7691
|
}
|
|
7691
7692
|
function MotionTrack({ motion, size = "sm" }) {
|
|
7692
7693
|
const id = `m${Math.round(motion.duration)}-${motion.easing.replace(/[^a-z0-9]/gi, "")}`;
|
|
7693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "aria-hidden": true, className: (0,
|
|
7694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "aria-hidden": true, className: (0, import_design_system18.cn)("relative inline-block shrink-0 rounded-full bg-muted", size === "lg" ? "h-3 w-full" : "h-2 w-12"), children: [
|
|
7694
7695
|
/* @__PURE__ */ (0, import_jsx_runtime18.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}}` }),
|
|
7695
7696
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7696
7697
|
"span",
|
|
@@ -7720,9 +7721,9 @@ function MotionEditor({ value, onChange, disabled, id, label }) {
|
|
|
7720
7721
|
const write = (next) => onChange(JSON.stringify({ ...m, ...next }));
|
|
7721
7722
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
7722
7723
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NumberBox, { id, label: `${label} duration`, value: m.duration, unit: "ms", disabled, className: "w-24", onChange: (n) => n !== null && n >= 0 && write({ duration: n }) }),
|
|
7723
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7724
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7725
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system18.Select, { value: m.easing, disabled: disabled ?? false, onValueChange: (v) => write({ easing: v }), children: [
|
|
7725
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectTrigger, { "aria-label": `${label} easing`, className: "h-7 w-36 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectValue, {}) }),
|
|
7726
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectContent, { children: import_field_formats5.MOTION_EASINGS.map((e) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system18.SelectItem, { value: e.value, children: e.label }, e.value)) })
|
|
7726
7727
|
] }),
|
|
7727
7728
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MotionTrack, { motion: m })
|
|
7728
7729
|
] });
|
|
@@ -7756,7 +7757,7 @@ var DESIGN_LOOK_IDS = DESIGN_LOOKS.map((look) => look.id);
|
|
|
7756
7757
|
|
|
7757
7758
|
// src/looks/htmlLook.tsx
|
|
7758
7759
|
var import_react27 = require("react");
|
|
7759
|
-
var
|
|
7760
|
+
var import_design_system19 = require("@ai-matrx/design-system");
|
|
7760
7761
|
var import_controls4 = require("@ai-matrx/design-system/controls");
|
|
7761
7762
|
|
|
7762
7763
|
// src/looks/htmlFrame.tsx
|
|
@@ -7977,7 +7978,7 @@ function HtmlSampleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7977
7978
|
};
|
|
7978
7979
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", "data-records-look": "html_sample", "data-records-editing": "", children: [
|
|
7979
7980
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7980
|
-
|
|
7981
|
+
import_design_system19.BasicTextarea,
|
|
7981
7982
|
{
|
|
7982
7983
|
ref: box,
|
|
7983
7984
|
id,
|
|
@@ -8001,7 +8002,7 @@ function HtmlSampleEditor({ value, onChange, disabled, id, label }) {
|
|
|
8001
8002
|
}
|
|
8002
8003
|
),
|
|
8003
8004
|
shown2.trim() ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(HtmlSampleFrame, { html: shown2, title: `${label} preview` }) : null,
|
|
8004
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
8005
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system19.Button, { type: "button", variant: "outline", onClick: done, children: "Done" }) })
|
|
8005
8006
|
] });
|
|
8006
8007
|
}
|
|
8007
8008
|
var FIXED_COLOR = /#[0-9a-f]{3,8}\b|\brgba?\(|\bhsla?\(/i;
|
|
@@ -8279,7 +8280,7 @@ init_enumLabels();
|
|
|
8279
8280
|
var import_react31 = require("react");
|
|
8280
8281
|
var import_records8 = require("@ai-matrx/records");
|
|
8281
8282
|
var import_react32 = require("@ai-matrx/records/react");
|
|
8282
|
-
var
|
|
8283
|
+
var import_design_system21 = require("@ai-matrx/design-system");
|
|
8283
8284
|
init_PickOrAdd();
|
|
8284
8285
|
init_Refusal();
|
|
8285
8286
|
init_PickOne();
|
|
@@ -8332,7 +8333,7 @@ function WithWords(props) {
|
|
|
8332
8333
|
}
|
|
8333
8334
|
}
|
|
8334
8335
|
);
|
|
8335
|
-
if (props.autoOpen && !props.disabled) return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { id: props.id, className: (0,
|
|
8336
|
+
if (props.autoOpen && !props.disabled) return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { id: props.id, className: (0, import_design_system21.cn)("flex min-w-0 max-w-full flex-wrap items-center gap-1", props.className), children: picker });
|
|
8336
8337
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Chips, { ...props, value: withKnown, words, picker });
|
|
8337
8338
|
}
|
|
8338
8339
|
function EntityReferencePicker({
|
|
@@ -8370,7 +8371,7 @@ function EntityReferencePicker({
|
|
|
8370
8371
|
attrs: { "data-entity-reference-candidate": `${r.token}:${r.id}` }
|
|
8371
8372
|
}));
|
|
8372
8373
|
const kindChoice = allowed.length > 1 ? allowed.length <= 4 ? /* @__PURE__ */ (0, import_jsx_runtime24.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_runtime24.jsx)(
|
|
8373
|
-
|
|
8374
|
+
import_design_system21.Button,
|
|
8374
8375
|
{
|
|
8375
8376
|
type: "button",
|
|
8376
8377
|
size: "sm",
|
|
@@ -8449,11 +8450,11 @@ function Chips({
|
|
|
8449
8450
|
return WITHHELD_ENTITY_LABEL;
|
|
8450
8451
|
};
|
|
8451
8452
|
const multi = Boolean(field.multi);
|
|
8452
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { id, className: (0,
|
|
8453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { id, className: (0, import_design_system21.cn)("flex flex-wrap items-center gap-1", className), "aria-label": `What ${field.label} points at`, children: [
|
|
8453
8454
|
refs.length === 0 && !picker ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-[11px] text-muted-foreground", children: ENTITY_REFERENCE_EMPTY }) : null,
|
|
8454
8455
|
refs.map((r) => {
|
|
8455
8456
|
const label = labelOf(r.token, r.id, r.label);
|
|
8456
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_design_system21.Badge, { variant: "secondary", className: "gap-1 text-[11px]", "data-entity-reference-chip": `${r.token}:${r.id}`, children: [
|
|
8457
8458
|
label,
|
|
8458
8459
|
disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8459
8460
|
"button",
|
|
@@ -8480,7 +8481,7 @@ var import_core8 = require("@ai-matrx/records/core");
|
|
|
8480
8481
|
// src/WholeValue.tsx
|
|
8481
8482
|
var import_react33 = require("react");
|
|
8482
8483
|
var import_core3 = require("@ai-matrx/records/core");
|
|
8483
|
-
var
|
|
8484
|
+
var import_design_system22 = require("@ai-matrx/design-system");
|
|
8484
8485
|
init_host();
|
|
8485
8486
|
var import_outbound_react2 = require("@ai-matrx/kit/outbound-react");
|
|
8486
8487
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
@@ -8509,12 +8510,12 @@ var import_field_formats10 = require("@ai-matrx/design-system/field-formats");
|
|
|
8509
8510
|
var import_react35 = require("react");
|
|
8510
8511
|
var import_data_table2 = require("@ai-matrx/design-system/data-table");
|
|
8511
8512
|
var import_field_formats7 = require("@ai-matrx/design-system/field-formats");
|
|
8512
|
-
var
|
|
8513
|
+
var import_design_system24 = require("@ai-matrx/design-system");
|
|
8513
8514
|
var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
|
|
8514
8515
|
|
|
8515
8516
|
// src/LinkPreviewCard.tsx
|
|
8516
8517
|
var import_react34 = require("react");
|
|
8517
|
-
var
|
|
8518
|
+
var import_design_system23 = require("@ai-matrx/design-system");
|
|
8518
8519
|
init_host();
|
|
8519
8520
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8520
8521
|
var answers = /* @__PURE__ */ new Map();
|
|
@@ -8551,7 +8552,7 @@ function LinkPreviewCard({ url, children }) {
|
|
|
8551
8552
|
(0, import_react34.useEffect)(() => {
|
|
8552
8553
|
if (!shown2) return;
|
|
8553
8554
|
let live = true;
|
|
8554
|
-
void (0,
|
|
8555
|
+
void (0, import_design_system23.resolveSiteIcon)(url, shown2.faviconUrl).then((src) => live && setIcon({ key: iconKey, src }));
|
|
8555
8556
|
return () => {
|
|
8556
8557
|
live = false;
|
|
8557
8558
|
};
|
|
@@ -8573,7 +8574,7 @@ function LinkPreviewCard({ url, children }) {
|
|
|
8573
8574
|
};
|
|
8574
8575
|
const chip = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: ask, onFocus: ask, children });
|
|
8575
8576
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8576
|
-
|
|
8577
|
+
import_design_system23.PeekHoverCard,
|
|
8577
8578
|
{
|
|
8578
8579
|
trigger: chip,
|
|
8579
8580
|
label: record?.title ?? "Link",
|
|
@@ -8585,7 +8586,7 @@ function LinkPreviewCard({ url, children }) {
|
|
|
8585
8586
|
if (next) ask();
|
|
8586
8587
|
setOpen(next);
|
|
8587
8588
|
},
|
|
8588
|
-
children: record ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8589
|
+
children: record ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system23.Peek, { record, size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, {})
|
|
8589
8590
|
}
|
|
8590
8591
|
);
|
|
8591
8592
|
}
|
|
@@ -8625,7 +8626,7 @@ function RatingStars({
|
|
|
8625
8626
|
children: Array.from({ length: max }, (_, i) => {
|
|
8626
8627
|
const n = i + 1;
|
|
8627
8628
|
const lit = n <= shown2;
|
|
8628
|
-
const star = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": true, className: (0,
|
|
8629
|
+
const star = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": true, className: (0, import_design_system24.cn)("text-sm leading-none", lit ? "text-amber-400" : "text-muted-foreground/40"), children: "\u2605" });
|
|
8629
8630
|
return onRate ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
8630
8631
|
"button",
|
|
8631
8632
|
{
|
|
@@ -8689,7 +8690,7 @@ function rich(id, text, raw, format) {
|
|
|
8689
8690
|
"aria-valuemax": 100,
|
|
8690
8691
|
"aria-valuenow": Math.round(clamped),
|
|
8691
8692
|
className: "h-1.5 min-w-8 flex-1 overflow-hidden rounded-full bg-muted",
|
|
8692
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: (0,
|
|
8693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: (0, import_design_system24.cn)("block h-full rounded-full", pct >= 100 ? "bg-emerald-500" : "bg-primary"), style: { width: `${clamped}%` } })
|
|
8693
8694
|
}
|
|
8694
8695
|
),
|
|
8695
8696
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: text })
|
|
@@ -8749,7 +8750,7 @@ init_host();
|
|
|
8749
8750
|
// src/gridAttachments.tsx
|
|
8750
8751
|
var import_react37 = require("react");
|
|
8751
8752
|
var import_react38 = require("@ai-matrx/records/react");
|
|
8752
|
-
var
|
|
8753
|
+
var import_design_system26 = require("@ai-matrx/design-system");
|
|
8753
8754
|
var import_controls5 = require("@ai-matrx/design-system/controls");
|
|
8754
8755
|
init_host();
|
|
8755
8756
|
init_names();
|
|
@@ -8825,7 +8826,7 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
8825
8826
|
type: "button",
|
|
8826
8827
|
title,
|
|
8827
8828
|
"aria-label": onPreview ? `Preview ${words}` : words,
|
|
8828
|
-
className: (0,
|
|
8829
|
+
className: (0, import_design_system26.cn)(
|
|
8829
8830
|
"relative block size-20 overflow-hidden rounded-md border bg-muted",
|
|
8830
8831
|
"[[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"
|
|
8831
8832
|
),
|
|
@@ -8857,10 +8858,10 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
8857
8858
|
] });
|
|
8858
8859
|
}
|
|
8859
8860
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
8860
|
-
|
|
8861
|
+
import_design_system26.Badge,
|
|
8861
8862
|
{
|
|
8862
8863
|
variant: "secondary",
|
|
8863
|
-
className: (0,
|
|
8864
|
+
className: (0, import_design_system26.cn)("max-w-[14rem] gap-1 text-[11px]", onPreview && "cursor-pointer"),
|
|
8864
8865
|
"data-records-file-chip": id,
|
|
8865
8866
|
title,
|
|
8866
8867
|
...onPreview ? {
|
|
@@ -8951,8 +8952,8 @@ function AttachmentViewer({
|
|
|
8951
8952
|
const name = read?.name ?? (read ? FILE_CHIP_UNREAD : "\u2026");
|
|
8952
8953
|
const href = read?.fileId ? host.hrefForFile?.({ fileId: read.fileId }) : void 0;
|
|
8953
8954
|
const go = (way) => onIndex(stepAttachment(index, ids.length, way));
|
|
8954
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8955
|
-
|
|
8955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system26.Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
8956
|
+
import_design_system26.DialogContent,
|
|
8956
8957
|
{
|
|
8957
8958
|
className: "sm:max-w-3xl",
|
|
8958
8959
|
"data-records-attachment-viewer": id,
|
|
@@ -8979,11 +8980,11 @@ function AttachmentViewer({
|
|
|
8979
8980
|
},
|
|
8980
8981
|
onClick: (event) => event.stopPropagation(),
|
|
8981
8982
|
children: [
|
|
8982
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8983
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system26.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system26.DialogTitle, { className: "truncate text-sm", children: name }) }),
|
|
8983
8984
|
/* @__PURE__ */ (0, import_jsx_runtime29.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 }),
|
|
8984
8985
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8985
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8986
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8986
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system26.Button, { size: "sm", variant: "outline", "aria-label": "Previous file", disabled: index === 0, onClick: () => go(-1), "data-records-attachment-previous": "", children: "\u2190" }),
|
|
8987
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system26.Button, { size: "sm", variant: "outline", "aria-label": "Next file", disabled: index >= ids.length - 1, onClick: () => go(1), "data-records-attachment-next": "", children: "\u2192" }),
|
|
8987
8988
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", "data-records-attachment-position": "", children: [
|
|
8988
8989
|
index + 1,
|
|
8989
8990
|
" of ",
|
|
@@ -9049,7 +9050,7 @@ function AttachmentControl({
|
|
|
9049
9050
|
}
|
|
9050
9051
|
),
|
|
9051
9052
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
9052
|
-
host.pickFiles ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9053
|
+
host.pickFiles ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system26.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,
|
|
9053
9054
|
host.upload ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9054
9055
|
FilePicker,
|
|
9055
9056
|
{
|
|
@@ -9076,7 +9077,7 @@ function AttachmentControl({
|
|
|
9076
9077
|
|
|
9077
9078
|
// src/ReferenceChips.tsx
|
|
9078
9079
|
var import_records9 = require("@ai-matrx/records");
|
|
9079
|
-
var
|
|
9080
|
+
var import_design_system27 = require("@ai-matrx/design-system");
|
|
9080
9081
|
init_host();
|
|
9081
9082
|
init_kindValues();
|
|
9082
9083
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -9123,14 +9124,14 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
9123
9124
|
const host = useRecordsUi();
|
|
9124
9125
|
const look = useEmbeddedLook();
|
|
9125
9126
|
const pending = reference.label == null && reference.token === "record" && !waiting && !host.renderReference;
|
|
9126
|
-
const pendingMark = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
9127
|
+
const pendingMark = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system27.Skeleton, { "aria-label": "Loading", "data-records-reference-pending": "", className: "inline-block h-3 w-16 shrink-0 rounded-sm align-middle" });
|
|
9127
9128
|
const words = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
|
|
9128
9129
|
const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words }) : null;
|
|
9129
9130
|
if (look?.plainRelation) {
|
|
9130
9131
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
9131
9132
|
"span",
|
|
9132
9133
|
{
|
|
9133
|
-
className: (0,
|
|
9134
|
+
className: (0, import_design_system27.cn)(
|
|
9134
9135
|
"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",
|
|
9135
9136
|
reference.archived && "opacity-70"
|
|
9136
9137
|
),
|
|
@@ -9147,10 +9148,10 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
9147
9148
|
);
|
|
9148
9149
|
}
|
|
9149
9150
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
9150
|
-
|
|
9151
|
+
import_design_system27.Badge,
|
|
9151
9152
|
{
|
|
9152
9153
|
variant: "secondary",
|
|
9153
|
-
className: (0,
|
|
9154
|
+
className: (0, import_design_system27.cn)(
|
|
9154
9155
|
"max-w-full min-w-0 gap-1 px-1.5 py-0 text-[11px] font-normal",
|
|
9155
9156
|
reference.archived && "opacity-70"
|
|
9156
9157
|
),
|
|
@@ -9178,7 +9179,7 @@ function KindValueCell({
|
|
|
9178
9179
|
return /* @__PURE__ */ (0, import_jsx_runtime30.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 }) });
|
|
9179
9180
|
}
|
|
9180
9181
|
const named = kv.items.map(kindItemWords).filter((w) => w !== null);
|
|
9181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: (0,
|
|
9182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: (0, import_design_system27.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_runtime30.jsx)(import_design_system27.Badge, { variant: "secondary", className: "px-1.5 py-0 text-[11px] font-normal", children: w }, `${w}-${i}`)) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system27.Badge, { variant: "outline", className: "px-1.5 py-0 text-[11px] font-normal", children: kindLabel(kv.kind) }) });
|
|
9182
9183
|
}
|
|
9183
9184
|
|
|
9184
9185
|
// src/values.tsx
|
|
@@ -9289,7 +9290,7 @@ var import_outbound_react6 = require("@ai-matrx/kit/outbound-react");
|
|
|
9289
9290
|
|
|
9290
9291
|
// src/structuredValue.tsx
|
|
9291
9292
|
var import_react52 = require("react");
|
|
9292
|
-
var
|
|
9293
|
+
var import_design_system32 = require("@ai-matrx/design-system");
|
|
9293
9294
|
var import_controls6 = require("@ai-matrx/design-system/controls");
|
|
9294
9295
|
var import_react53 = require("@ai-matrx/alchemy/react");
|
|
9295
9296
|
var import_outbound_react5 = require("@ai-matrx/kit/outbound-react");
|
|
@@ -9419,7 +9420,7 @@ function Thumb({ src, size }) {
|
|
|
9419
9420
|
alt: "",
|
|
9420
9421
|
loading: "lazy",
|
|
9421
9422
|
referrerPolicy: "no-referrer",
|
|
9422
|
-
className: (0,
|
|
9423
|
+
className: (0, import_design_system32.cn)("rounded border border-border bg-muted object-cover", size === "sm" ? "size-6" : "size-12")
|
|
9423
9424
|
}
|
|
9424
9425
|
) });
|
|
9425
9426
|
}
|
|
@@ -9430,7 +9431,7 @@ function LinkChip({ href, dense }) {
|
|
|
9430
9431
|
href,
|
|
9431
9432
|
title: href,
|
|
9432
9433
|
onClick: stop,
|
|
9433
|
-
className: (0,
|
|
9434
|
+
className: (0, import_design_system32.cn)(
|
|
9434
9435
|
"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",
|
|
9435
9436
|
// A percentage max-width means nothing inside an auto-layout table cell, so a link column would hold
|
|
9436
9437
|
// its full address; in a table the chip gets a real ceiling and shortens with an ellipsis.
|
|
@@ -9459,7 +9460,7 @@ function Scalar({ value, keyName, dense }) {
|
|
|
9459
9460
|
const date = dateWords(text);
|
|
9460
9461
|
if (date) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { title: text, children: date });
|
|
9461
9462
|
if (!dense && ui.renderText && text.length > 40 && MARKDOWN.test(text)) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "min-w-0", children: ui.renderText(text, "cell") });
|
|
9462
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0,
|
|
9463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0, import_design_system32.cn)(dense ? "line-clamp-2 break-words" : "whitespace-pre-wrap [overflow-wrap:anywhere]"), children: text });
|
|
9463
9464
|
}
|
|
9464
9465
|
var TABLE_ROWS = 8;
|
|
9465
9466
|
var TABLE_COLUMNS = 12;
|
|
@@ -9473,7 +9474,7 @@ function RecordsTable({ items }) {
|
|
|
9473
9474
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { scope: "col", className: "px-2 py-1 font-medium text-muted-foreground [overflow-wrap:anywhere]", children: structuredKeyWords(k) }, k)) }) }),
|
|
9474
9475
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsx)(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
|
|
9475
9476
|
] }) }),
|
|
9476
|
-
items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9477
|
+
items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system32.Button, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
|
|
9477
9478
|
stop(e);
|
|
9478
9479
|
setAll((a) => !a);
|
|
9479
9480
|
}, children: all ? "Show fewer" : `Show all ${items.length}` }) : null
|
|
@@ -9499,7 +9500,7 @@ function Nested({ value, keyName, dense, depth = 0 }) {
|
|
|
9499
9500
|
}
|
|
9500
9501
|
function ScalarChips({ items, keyName }) {
|
|
9501
9502
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex min-w-0 flex-wrap gap-1", "data-records-structured": "chips", children: items.map(
|
|
9502
|
-
(item, i) => typeof item === "string" && isUrl(item) ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Scalar, { value: item, keyName, dense: true }, i) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9503
|
+
(item, i) => typeof item === "string" && isUrl(item) ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Scalar, { value: item, keyName, dense: true }, i) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system32.Badge, { variant: "secondary", className: "max-w-full text-[11px] font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "truncate", children: scalarWords(item) }) }, i)
|
|
9503
9504
|
) });
|
|
9504
9505
|
}
|
|
9505
9506
|
function Shape({ data, depth = 0 }) {
|
|
@@ -9541,12 +9542,12 @@ function StructuredValueView({ structured, label, className }) {
|
|
|
9541
9542
|
const ui = useRecordsUi();
|
|
9542
9543
|
const savable = shapeOfValue(structured.data) !== null;
|
|
9543
9544
|
const text = rawTextOf(structured);
|
|
9544
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: (0,
|
|
9545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: (0, import_design_system32.cn)("flex min-w-0 flex-col gap-1.5 whitespace-normal", className), "data-records-structured-view": "", children: [
|
|
9545
9546
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-w-0 items-center gap-1", onClick: stop, children: [
|
|
9546
9547
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "min-w-0 flex-1 truncate text-xs text-muted-foreground", children: recordsCount(structured.data) }),
|
|
9547
|
-
savable ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9548
|
+
savable ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system32.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,
|
|
9548
9549
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9549
|
-
|
|
9550
|
+
import_design_system32.Button,
|
|
9550
9551
|
{
|
|
9551
9552
|
type: "button",
|
|
9552
9553
|
variant: raw ? "secondary" : "ghost",
|
|
@@ -9561,10 +9562,10 @@ function StructuredValueView({ structured, label, className }) {
|
|
|
9561
9562
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react53.AlchemyMenu, { label, sourceId: `records:value:${label}`, size: "xs", json: () => structured.data, human: () => text })
|
|
9562
9563
|
] }),
|
|
9563
9564
|
raw ? /* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsx)(Shape, { data: structured.data }),
|
|
9564
|
-
saving ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9565
|
+
saving ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system32.Dialog, { open: true, onOpenChange: (open) => {
|
|
9565
9566
|
if (!open) setSaving(false);
|
|
9566
|
-
}, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9567
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9567
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_design_system32.DialogContent, { className: "max-h-[90vh] max-w-3xl overflow-y-auto", children: [
|
|
9568
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system32.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_design_system32.DialogTitle, { children: [
|
|
9568
9569
|
"Save ",
|
|
9569
9570
|
label,
|
|
9570
9571
|
" as a table"
|
|
@@ -9591,8 +9592,8 @@ function StructuredCell({ structured, label }) {
|
|
|
9591
9592
|
const summary = structuredSummary(structured.data);
|
|
9592
9593
|
const first = Array.isArray(structured.data) ? structured.data.find(isPlainObject2) : structured.data;
|
|
9593
9594
|
const picture = isPlainObject2(first) ? Object.entries(first).find(([k, v]) => isImageUrl(v, k))?.[1] : void 0;
|
|
9594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9595
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_design_system32.Popover, { children: [
|
|
9596
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system32.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9596
9597
|
import_controls6.Button,
|
|
9597
9598
|
{
|
|
9598
9599
|
type: "button",
|
|
@@ -9609,7 +9610,7 @@ function StructuredCell({ structured, label }) {
|
|
|
9609
9610
|
}
|
|
9610
9611
|
) }),
|
|
9611
9612
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9612
|
-
|
|
9613
|
+
import_design_system32.PopoverContent,
|
|
9613
9614
|
{
|
|
9614
9615
|
align: "start",
|
|
9615
9616
|
collisionPadding: 8,
|
|
@@ -9735,14 +9736,14 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9735
9736
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "flex flex-wrap gap-1", "data-records-choice-chips": "", children: items.map((item, i) => {
|
|
9736
9737
|
const chip = chipOf(item);
|
|
9737
9738
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9738
|
-
|
|
9739
|
+
import_design_system33.Badge,
|
|
9739
9740
|
{
|
|
9740
9741
|
variant: "outline",
|
|
9741
|
-
className: (0,
|
|
9742
|
+
className: (0, import_design_system33.cn)("text-[11px]", chip.className),
|
|
9742
9743
|
"data-records-choice-chip": "",
|
|
9743
9744
|
...chip.tinted ? { "data-records-choice-tint": "" } : {},
|
|
9744
9745
|
children: [
|
|
9745
|
-
look?.choiceDot ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: (0,
|
|
9746
|
+
look?.choiceDot ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: (0, import_design_system33.cn)("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
|
|
9746
9747
|
statusMark(field, item, Array.isArray(value) ? void 0 : document2),
|
|
9747
9748
|
scalarText(field, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
|
|
9748
9749
|
]
|
|
@@ -9753,7 +9754,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9753
9754
|
}
|
|
9754
9755
|
if (kind === "attachment") return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AttachmentChips, { value });
|
|
9755
9756
|
if (Array.isArray(value)) {
|
|
9756
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system33.Badge, { variant: "secondary", className: "text-[11px]", children: scalarText(field, item, labels) }, `${String(item)}-${i}`)) });
|
|
9757
9758
|
}
|
|
9758
9759
|
const pictureAt = imageAddressOf(field, value);
|
|
9759
9760
|
if (pictureAt) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ImageUrlValue, { url: pictureAt, alt: field.label || field.key, room });
|
|
@@ -9793,7 +9794,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9793
9794
|
if (typeof value === "boolean") {
|
|
9794
9795
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: kind === "checkbox" ? "text-sm" : "", title: value ? "Yes" : "No", children: value ? "\u2713" : "\u2014" });
|
|
9795
9796
|
}
|
|
9796
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: (0,
|
|
9797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: (0, import_design_system33.cn)("truncate", kind === "number" || kind === "currency" || kind === "percent" ? "tabular-nums" : ""), children: scalarText(field, value, labels, stillWaitingFor) });
|
|
9797
9798
|
}
|
|
9798
9799
|
function isImageUrl2(value) {
|
|
9799
9800
|
const text = value.trim();
|
|
@@ -9821,7 +9822,7 @@ function ImageUrlValue({ url, alt, room }) {
|
|
|
9821
9822
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9822
9823
|
import_outbound_react6.OutboundLink,
|
|
9823
9824
|
{
|
|
9824
|
-
className: (0,
|
|
9825
|
+
className: (0, import_design_system33.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"),
|
|
9825
9826
|
href: url,
|
|
9826
9827
|
title: url,
|
|
9827
9828
|
"data-records-image-url": "",
|
|
@@ -9932,7 +9933,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
9932
9933
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-sm", children: SOURCE_ARCHIVED_WORDS }),
|
|
9933
9934
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: sourceArchivedSentence(state2) })
|
|
9934
9935
|
] }),
|
|
9935
|
-
state2.field_id ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
9936
|
+
state2.field_id ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system34.Button, { type: "button", size: "sm", variant: "secondary", disabled: busy, onClick: () => void restore(), children: bringBackLabel(state2) }) : null,
|
|
9936
9937
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(RefusalNotice, { error: refused, className: "basis-full" }) : null
|
|
9937
9938
|
]
|
|
9938
9939
|
}
|
|
@@ -9941,7 +9942,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
9941
9942
|
|
|
9942
9943
|
// src/Condition.tsx
|
|
9943
9944
|
var import_react57 = require("react");
|
|
9944
|
-
var
|
|
9945
|
+
var import_design_system35 = require("@ai-matrx/design-system");
|
|
9945
9946
|
var import_records18 = require("@ai-matrx/records");
|
|
9946
9947
|
init_PickOrAdd();
|
|
9947
9948
|
init_choiceLooks();
|
|
@@ -10086,7 +10087,7 @@ function ChoiceValues({ field, value, onChange }) {
|
|
|
10086
10087
|
};
|
|
10087
10088
|
if (!choices || choices.length === 0) {
|
|
10088
10089
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10089
|
-
|
|
10090
|
+
import_design_system35.BasicInput,
|
|
10090
10091
|
{
|
|
10091
10092
|
className: "h-8 w-40 text-xs",
|
|
10092
10093
|
"aria-label": "Condition values, separated by commas",
|
|
@@ -10097,7 +10098,7 @@ function ChoiceValues({ field, value, onChange }) {
|
|
|
10097
10098
|
}
|
|
10098
10099
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "inline-flex flex-wrap items-center gap-1", "data-records-condition-choices": "", "data-pick-values": value.join("|"), children: [
|
|
10099
10100
|
choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10100
|
-
|
|
10101
|
+
import_design_system35.Button,
|
|
10101
10102
|
{
|
|
10102
10103
|
type: "button",
|
|
10103
10104
|
size: "sm",
|
|
@@ -10110,7 +10111,7 @@ function ChoiceValues({ field, value, onChange }) {
|
|
|
10110
10111
|
},
|
|
10111
10112
|
c.key
|
|
10112
10113
|
)),
|
|
10113
|
-
strays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10114
|
+
strays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system35.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}`))
|
|
10114
10115
|
] });
|
|
10115
10116
|
}
|
|
10116
10117
|
function ChoiceValue({ field, value, onChange }) {
|
|
@@ -10133,7 +10134,7 @@ function ChoiceValue({ field, value, onChange }) {
|
|
|
10133
10134
|
}, [client, field.id]);
|
|
10134
10135
|
if (!choices || choices.length === 0) {
|
|
10135
10136
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10136
|
-
|
|
10137
|
+
import_design_system35.BasicInput,
|
|
10137
10138
|
{
|
|
10138
10139
|
className: "h-8 w-28 text-xs",
|
|
10139
10140
|
"aria-label": "Condition value",
|
|
@@ -10422,7 +10423,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
10422
10423
|
}
|
|
10423
10424
|
),
|
|
10424
10425
|
relative ? relativeTerm?.takesDays ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10425
|
-
|
|
10426
|
+
import_design_system35.BasicInput,
|
|
10426
10427
|
{
|
|
10427
10428
|
className: "h-8 w-16 text-xs",
|
|
10428
10429
|
type: "number",
|
|
@@ -10450,7 +10451,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
10450
10451
|
}
|
|
10451
10452
|
)
|
|
10452
10453
|
) : isChoiceColumn(chosen) && CHOICE_LIST_OPS.has(op) ? /* @__PURE__ */ (0, import_jsx_runtime38.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_runtime38.jsx)(ChoiceValue, { field: chosen.field, value: String(value ?? ""), onChange: (word) => write({ value: word }) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10453
|
-
|
|
10454
|
+
import_design_system35.BasicInput,
|
|
10454
10455
|
{
|
|
10455
10456
|
className: "h-8 w-28 text-xs",
|
|
10456
10457
|
"aria-label": "Condition value",
|
|
@@ -10558,7 +10559,7 @@ function ConditionGroup({
|
|
|
10558
10559
|
}
|
|
10559
10560
|
),
|
|
10560
10561
|
nested && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10561
|
-
|
|
10562
|
+
import_design_system35.Button,
|
|
10562
10563
|
{
|
|
10563
10564
|
size: "sm",
|
|
10564
10565
|
variant: "ghost",
|
|
@@ -10625,7 +10626,7 @@ function ConditionGroup({
|
|
|
10625
10626
|
) }) : null,
|
|
10626
10627
|
args.length > 0 && !drafting ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
10627
10628
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10628
|
-
|
|
10629
|
+
import_design_system35.Button,
|
|
10629
10630
|
{
|
|
10630
10631
|
size: "sm",
|
|
10631
10632
|
variant: "ghost",
|
|
@@ -10636,7 +10637,7 @@ function ConditionGroup({
|
|
|
10636
10637
|
}
|
|
10637
10638
|
),
|
|
10638
10639
|
allowNesting && (maxDepth === void 0 || depth < maxDepth) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10639
|
-
|
|
10640
|
+
import_design_system35.Button,
|
|
10640
10641
|
{
|
|
10641
10642
|
size: "sm",
|
|
10642
10643
|
variant: "ghost",
|
|
@@ -10656,7 +10657,7 @@ function ConditionGroup({
|
|
|
10656
10657
|
var import_react59 = require("react");
|
|
10657
10658
|
var import_records19 = require("@ai-matrx/records");
|
|
10658
10659
|
var import_react60 = require("@ai-matrx/records/react");
|
|
10659
|
-
var
|
|
10660
|
+
var import_design_system36 = require("@ai-matrx/design-system");
|
|
10660
10661
|
init_parity();
|
|
10661
10662
|
init_names();
|
|
10662
10663
|
init_Refusal();
|
|
@@ -10983,12 +10984,12 @@ function FieldRetype({ field, tableId, onRetyped }) {
|
|
|
10983
10984
|
};
|
|
10984
10985
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-col gap-1.5", "data-records-retype": "", children: [
|
|
10985
10986
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
10986
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10987
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10988
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10987
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system36.Select, { value: to?.id ?? "", onValueChange: (next) => setTo(targets.find((t) => t.id === next) ?? null), children: [
|
|
10988
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system36.SelectTrigger, { size: "sm", "aria-label": "Change what this column holds", className: "w-auto min-w-[12rem]", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system36.SelectValue, { placeholder: "Change what this column holds" }) }),
|
|
10989
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system36.SelectContent, { children: targets.map((t) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system36.SelectItem, { value: t.id, children: t.label }, t.id)) })
|
|
10989
10990
|
] }),
|
|
10990
|
-
to ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10991
|
-
to ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10991
|
+
to ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system36.Button, { size: "sm", disabled: busy || asking || preview === null, onClick: () => void change(), "data-records-retype-go": "", children: busy ? "Changing\u2026" : `Change to ${to.label}` }) : null,
|
|
10992
|
+
to ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system36.Button, { size: "sm", variant: "ghost", onClick: () => setTo(null), disabled: busy, children: "Cancel" }) : null
|
|
10992
10993
|
] }),
|
|
10993
10994
|
to && asking ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
10994
10995
|
"Counting ",
|
|
@@ -11186,7 +11187,7 @@ function choiceLookForNewList(multi, rows) {
|
|
|
11186
11187
|
// src/PickListLink.tsx
|
|
11187
11188
|
var import_react63 = require("react");
|
|
11188
11189
|
var import_react64 = require("@ai-matrx/records/react");
|
|
11189
|
-
var
|
|
11190
|
+
var import_design_system37 = require("@ai-matrx/design-system");
|
|
11190
11191
|
init_plainWords();
|
|
11191
11192
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11192
11193
|
var OWN_LIST = "__own__";
|
|
@@ -11227,9 +11228,9 @@ function PickListLink({
|
|
|
11227
11228
|
const linked = lists?.some((l) => l.id === current) ?? null;
|
|
11228
11229
|
const shown2 = value ?? (linked === false ? OWN_LIST : current ?? void 0);
|
|
11229
11230
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-1", "data-records-pick-list-link": "", children: [
|
|
11230
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11231
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system37.Label, { className: "text-xs", children: "Choices come from" }),
|
|
11231
11232
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
11232
|
-
|
|
11233
|
+
import_design_system37.Select,
|
|
11233
11234
|
{
|
|
11234
11235
|
...shown2 !== void 0 ? { value: shown2 } : {},
|
|
11235
11236
|
onValueChange: (next) => onChange(next === current || next === OWN_LIST && linked === false ? null : next),
|
|
@@ -11237,11 +11238,11 @@ function PickListLink({
|
|
|
11237
11238
|
if (open) read();
|
|
11238
11239
|
},
|
|
11239
11240
|
children: [
|
|
11240
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11241
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
11242
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11243
|
-
current && lists === null ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11244
|
-
(lists ?? []).map((l) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11241
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system37.SelectTrigger, { size: "sm", "aria-label": "Pick list for this column", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system37.SelectValue, { placeholder: "This column only" }) }),
|
|
11242
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system37.SelectContent, { children: [
|
|
11243
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system37.SelectItem, { value: OWN_LIST, children: "This column only" }),
|
|
11244
|
+
current && lists === null ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system37.SelectItem, { value: current, children: "Its current choices" }) : null,
|
|
11245
|
+
(lists ?? []).map((l) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system37.SelectItem, { value: l.id, children: l.count === null ? l.name : `${l.name} (${l.count})` }, l.id)),
|
|
11245
11246
|
lists !== null && lists.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "px-2 py-1.5 text-xs text-muted-foreground", children: "No pick lists yet." }) : null
|
|
11246
11247
|
] })
|
|
11247
11248
|
]
|
|
@@ -11253,7 +11254,7 @@ function PickListLink({
|
|
|
11253
11254
|
|
|
11254
11255
|
// src/NewerKindQuestions.tsx
|
|
11255
11256
|
var import_records21 = require("@ai-matrx/records");
|
|
11256
|
-
var
|
|
11257
|
+
var import_design_system38 = require("@ai-matrx/design-system");
|
|
11257
11258
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11258
11259
|
var STATUS_STARTING_CHOICES = [
|
|
11259
11260
|
{ words: "Not started", group: "todo" },
|
|
@@ -11284,12 +11285,12 @@ function StatusGroupsQuestion({
|
|
|
11284
11285
|
}) {
|
|
11285
11286
|
if (rows.length === 0) return null;
|
|
11286
11287
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1", "data-records-status-groups": "", children: [
|
|
11287
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11288
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.Label, { className: "text-xs", children: "Groups" }),
|
|
11288
11289
|
rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11289
11290
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: r.words }),
|
|
11290
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
11291
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11292
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11291
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_design_system38.Select, { value: r.group, onValueChange: (next) => onGroup(r.ref, next), children: [
|
|
11292
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectTrigger, { size: "sm", className: "w-36", "aria-label": `Group for ${r.words}`, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectValue, {}) }),
|
|
11293
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectContent, { children: import_records21.STATUS_GROUPS.map((g) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_design_system38.SelectItem, { value: g, children: [
|
|
11293
11294
|
STATUS_GROUP_MARK[g],
|
|
11294
11295
|
" ",
|
|
11295
11296
|
import_records21.STATUS_GROUP_WORDS[g]
|
|
@@ -11300,10 +11301,10 @@ function StatusGroupsQuestion({
|
|
|
11300
11301
|
}
|
|
11301
11302
|
function RatingMaxQuestion({ value, onChange }) {
|
|
11302
11303
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
11303
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11304
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
11305
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11306
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11304
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.Label, { className: "text-xs", children: "Out of" }),
|
|
11305
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_design_system38.Select, { value: String(value), onValueChange: (next) => onChange(Number(next)), children: [
|
|
11306
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectTrigger, { size: "sm", "aria-label": "Out of", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectValue, {}) }),
|
|
11307
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectContent, { children: Array.from({ length: 10 }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_design_system38.SelectItem, { value: String(n), children: [
|
|
11307
11308
|
n,
|
|
11308
11309
|
" ",
|
|
11309
11310
|
n === 1 ? "star" : "stars"
|
|
@@ -11325,19 +11326,19 @@ var SYMBOLOGY_WORDS = {
|
|
|
11325
11326
|
};
|
|
11326
11327
|
function BarcodeSymbologyQuestion({ value, onChange }) {
|
|
11327
11328
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
11328
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11329
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
11330
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11331
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
11332
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11333
|
-
import_records21.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11329
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.Label, { className: "text-xs", children: "Code type" }),
|
|
11330
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_design_system38.Select, { value: value === "" ? "any" : value, onValueChange: (next) => onChange(next === "any" ? "" : next), children: [
|
|
11331
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectTrigger, { size: "sm", "aria-label": "Code type", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectValue, {}) }),
|
|
11332
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_design_system38.SelectContent, { children: [
|
|
11333
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectItem, { value: "any", children: "Any code" }),
|
|
11334
|
+
import_records21.BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system38.SelectItem, { value: s, children: SYMBOLOGY_WORDS[s] }, s))
|
|
11334
11335
|
] })
|
|
11335
11336
|
] })
|
|
11336
11337
|
] });
|
|
11337
11338
|
}
|
|
11338
11339
|
|
|
11339
11340
|
// src/FieldFormatPicker.tsx
|
|
11340
|
-
var
|
|
11341
|
+
var import_design_system39 = require("@ai-matrx/design-system");
|
|
11341
11342
|
var import_field_formats11 = require("@ai-matrx/design-system/field-formats");
|
|
11342
11343
|
init_PickOne();
|
|
11343
11344
|
init_choiceLooks();
|
|
@@ -11470,7 +11471,7 @@ function FieldFormatPicker({
|
|
|
11470
11471
|
control
|
|
11471
11472
|
] }, key) : null;
|
|
11472
11473
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-1", "data-records-format-picker": "", children: [
|
|
11473
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11474
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system39.Label, { className: "text-xs", htmlFor: `records-shows-as-${field.id}`, children: "Shows as" }),
|
|
11474
11475
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11475
11476
|
PickOne,
|
|
11476
11477
|
{
|
|
@@ -11634,7 +11635,7 @@ function FieldFormatPicker({
|
|
|
11634
11635
|
init_names();
|
|
11635
11636
|
|
|
11636
11637
|
// src/AlsoPointsAt.tsx
|
|
11637
|
-
var
|
|
11638
|
+
var import_design_system40 = require("@ai-matrx/design-system");
|
|
11638
11639
|
init_tablePicking();
|
|
11639
11640
|
init_names();
|
|
11640
11641
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
@@ -11647,11 +11648,11 @@ function AlsoPointsAt({ own: own3, value, onChange }) {
|
|
|
11647
11648
|
const unseen = tables.loading ? [] : value.filter((id) => !entries.some((e) => e.id === id));
|
|
11648
11649
|
const toggle = (id, on) => onChange(on ? [...value.filter((v) => v !== id), id] : value.filter((v) => v !== id));
|
|
11649
11650
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1", "data-records-link-also-points-at": "", children: [
|
|
11650
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11651
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system40.Label, { className: "text-xs", children: "Also points at" }),
|
|
11651
11652
|
tables.loading && entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "h-40 text-xs text-muted-foreground", "data-records-also-box": "", children: "Reading tables\u2026" }) : entries.length === 0 && unseen.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "h-40 text-xs text-muted-foreground", "data-records-also-box": "", children: "No other tables yet." }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex h-40 flex-col gap-1 overflow-y-auto", "data-records-also-box": "", children: [
|
|
11652
11653
|
entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
11653
11654
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11654
|
-
|
|
11655
|
+
import_design_system40.Checkbox,
|
|
11655
11656
|
{
|
|
11656
11657
|
checked: value.includes(e.id),
|
|
11657
11658
|
"aria-label": `Also points at ${e.label}`,
|
|
@@ -11662,7 +11663,7 @@ function AlsoPointsAt({ own: own3, value, onChange }) {
|
|
|
11662
11663
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "truncate", children: e.label })
|
|
11663
11664
|
] }, e.id)),
|
|
11664
11665
|
unseen.map((id) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", children: [
|
|
11665
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11666
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system40.Checkbox, { checked: true, "aria-label": "Also points at a table you cannot open", "data-records-also-target": id, onCheckedChange: (v) => toggle(id, v === true) }),
|
|
11666
11667
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "truncate text-muted-foreground", children: "A table you cannot open" })
|
|
11667
11668
|
] }, id))
|
|
11668
11669
|
] })
|
|
@@ -11697,14 +11698,14 @@ var import_records25 = require("@ai-matrx/records");
|
|
|
11697
11698
|
|
|
11698
11699
|
// src/ButtonSettings.tsx
|
|
11699
11700
|
var import_react67 = require("react");
|
|
11700
|
-
var
|
|
11701
|
+
var import_design_system43 = require("@ai-matrx/design-system");
|
|
11701
11702
|
var import_data_table5 = require("@ai-matrx/design-system/data-table");
|
|
11702
11703
|
var import_records23 = require("@ai-matrx/records");
|
|
11703
11704
|
var import_react68 = require("@ai-matrx/records/react");
|
|
11704
11705
|
|
|
11705
11706
|
// src/AccentSwatches.tsx
|
|
11706
11707
|
var import_records22 = require("@ai-matrx/records");
|
|
11707
|
-
var
|
|
11708
|
+
var import_design_system41 = require("@ai-matrx/design-system");
|
|
11708
11709
|
var import_data_table4 = require("@ai-matrx/design-system/data-table");
|
|
11709
11710
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11710
11711
|
function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACCENTS, noneLabel = "App color" }) {
|
|
@@ -11716,7 +11717,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
|
|
|
11716
11717
|
role: "radio",
|
|
11717
11718
|
"aria-checked": value === "",
|
|
11718
11719
|
onClick: () => onChange(""),
|
|
11719
|
-
className: (0,
|
|
11720
|
+
className: (0, import_design_system41.cn)(
|
|
11720
11721
|
"h-7 rounded border px-2 text-xs",
|
|
11721
11722
|
value === "" ? "border-foreground" : "border-border text-muted-foreground"
|
|
11722
11723
|
),
|
|
@@ -11732,7 +11733,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
|
|
|
11732
11733
|
"aria-label": import_data_table4.STYLE_COLOR_LABELS[c],
|
|
11733
11734
|
title: import_data_table4.STYLE_COLOR_LABELS[c],
|
|
11734
11735
|
onClick: () => onChange(c),
|
|
11735
|
-
className: (0,
|
|
11736
|
+
className: (0, import_design_system41.cn)("h-7 w-7 rounded-full border-2", import_data_table4.SWATCH_CLASS[c], value === c ? "border-foreground" : "border-transparent")
|
|
11736
11737
|
},
|
|
11737
11738
|
c
|
|
11738
11739
|
))
|
|
@@ -11743,7 +11744,7 @@ function AccentSwatches({ value, onChange, options = import_records22.PORTAL_ACC
|
|
|
11743
11744
|
init_PickOne();
|
|
11744
11745
|
|
|
11745
11746
|
// src/AddRowSettings.tsx
|
|
11746
|
-
var
|
|
11747
|
+
var import_design_system42 = require("@ai-matrx/design-system");
|
|
11747
11748
|
var import_react65 = require("@ai-matrx/records/react");
|
|
11748
11749
|
var import_react66 = require("react");
|
|
11749
11750
|
init_tablePicking();
|
|
@@ -11776,7 +11777,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
11776
11777
|
}, [client, target]);
|
|
11777
11778
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-2", "data-records-button-add-row": "", children: [
|
|
11778
11779
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11779
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11780
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system42.Label, { className: "text-xs", children: "Adds to" }),
|
|
11780
11781
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11781
11782
|
PickOne,
|
|
11782
11783
|
{
|
|
@@ -11789,7 +11790,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
11789
11790
|
)
|
|
11790
11791
|
] }),
|
|
11791
11792
|
templates.length || value.template_id ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11792
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11793
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system42.Label, { className: "text-xs", children: "Starts from" }),
|
|
11793
11794
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11794
11795
|
PickOne,
|
|
11795
11796
|
{
|
|
@@ -11871,11 +11872,11 @@ function ButtonSettingsEditor({
|
|
|
11871
11872
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-2 rounded-md border p-2", "data-records-button-settings": "", children: [
|
|
11872
11873
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
11873
11874
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
11874
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11875
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11875
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.Label, { className: "text-xs", children: "Button label" }),
|
|
11876
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.BasicInput, { className: "h-8 text-xs", value: value.label, "data-records-button-label": "", onChange: (e) => set({ label: e.target.value }) })
|
|
11876
11877
|
] }),
|
|
11877
11878
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11878
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11879
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.Label, { className: "text-xs", children: "Does" }),
|
|
11879
11880
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11880
11881
|
PickOne,
|
|
11881
11882
|
{
|
|
@@ -11889,7 +11890,7 @@ function ButtonSettingsEditor({
|
|
|
11889
11890
|
] })
|
|
11890
11891
|
] }),
|
|
11891
11892
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11892
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11893
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.Label, { className: "text-xs", children: "Color" }),
|
|
11893
11894
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11894
11895
|
AccentSwatches,
|
|
11895
11896
|
{
|
|
@@ -11901,10 +11902,10 @@ function ButtonSettingsEditor({
|
|
|
11901
11902
|
)
|
|
11902
11903
|
] }),
|
|
11903
11904
|
value.do === "open_url" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11904
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11905
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.Label, { className: "text-xs", children: "Link" }),
|
|
11905
11906
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-1", children: [
|
|
11906
11907
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11907
|
-
|
|
11908
|
+
import_design_system43.BasicInput,
|
|
11908
11909
|
{
|
|
11909
11910
|
className: "h-8 flex-1 font-mono text-xs",
|
|
11910
11911
|
placeholder: "https://",
|
|
@@ -12011,7 +12012,7 @@ function NewRowAction({
|
|
|
12011
12012
|
onMade(made.id, all);
|
|
12012
12013
|
};
|
|
12013
12014
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-1", "data-records-button-new-action": "", children: [
|
|
12014
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12015
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.Label, { className: "text-xs", children: "New row action" }),
|
|
12015
12016
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
12016
12017
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12017
12018
|
PickOne,
|
|
@@ -12025,8 +12026,8 @@ function NewRowAction({
|
|
|
12025
12026
|
options: settable.map((f) => ({ value: f.id, label: fieldName(f) }))
|
|
12026
12027
|
}
|
|
12027
12028
|
),
|
|
12028
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12029
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12029
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.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) }),
|
|
12030
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system43.Button, { type: "button", size: "sm", variant: "outline", disabled: busy || fieldId === "", "data-records-button-action-make": "", onClick: () => void make(), children: busy ? "Making\u2026" : "Make" })
|
|
12030
12031
|
] }),
|
|
12031
12032
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RefusalLine, { error: refused }) : null
|
|
12032
12033
|
] });
|
|
@@ -12039,7 +12040,7 @@ var import_records26 = require("@ai-matrx/records");
|
|
|
12039
12040
|
var import_react69 = require("react");
|
|
12040
12041
|
var import_records24 = require("@ai-matrx/records");
|
|
12041
12042
|
var import_react70 = require("@ai-matrx/records/react");
|
|
12042
|
-
var
|
|
12043
|
+
var import_design_system44 = require("@ai-matrx/design-system");
|
|
12043
12044
|
|
|
12044
12045
|
// src/standardFieldChoices.ts
|
|
12045
12046
|
var import_field_kinds7 = require("@ai-matrx/records/field-kinds");
|
|
@@ -12092,7 +12093,7 @@ function AppliesToTypes({
|
|
|
12092
12093
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-muted-foreground", children: "Applies to" }),
|
|
12093
12094
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-1", children: choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12094
12095
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12095
|
-
|
|
12096
|
+
import_design_system44.Checkbox,
|
|
12096
12097
|
{
|
|
12097
12098
|
checked: has(choice.key, choice.label),
|
|
12098
12099
|
"aria-label": `Applies to ${choice.label}`,
|
|
@@ -12411,7 +12412,7 @@ function FieldEditor(props) {
|
|
|
12411
12412
|
const offersMany = multiApplies(type) && !isTitle;
|
|
12412
12413
|
if (!mayShape) {
|
|
12413
12414
|
if (onEntity && entityRights.loading) return null;
|
|
12414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: (0,
|
|
12415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: (0, import_design_system45.cn)("text-xs text-muted-foreground", className), children: props.tableLabel && storeLabel && whyNot ? whyNot.split(storeLabel).join(props.tableLabel) : whyNot });
|
|
12415
12416
|
}
|
|
12416
12417
|
const options = newChoices.map((r) => r.words.trim()).filter((word) => word !== "");
|
|
12417
12418
|
const shownStatusRows = type !== "status" ? [] : statusGroupRows(field, editing ? choiceList ?? [] : newChoices, statusKeys, statusGroups);
|
|
@@ -12647,16 +12648,16 @@ function FieldEditor(props) {
|
|
|
12647
12648
|
if (gone) (onRemoved ?? onSaved)?.();
|
|
12648
12649
|
else setAskingToRemove(false);
|
|
12649
12650
|
};
|
|
12650
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: (0,
|
|
12651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: (0, import_design_system45.cn)("flex min-w-0 flex-col gap-3 text-xs", className), "data-records-field-editor": "", children: [
|
|
12651
12652
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12652
12653
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium", children: field ? `Field \xB7 ${fieldName(field)}` : "New field" }),
|
|
12653
12654
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "ml-auto text-muted-foreground", children: tableLabel })
|
|
12654
12655
|
] }),
|
|
12655
12656
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
12656
12657
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
12657
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12658
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Name" }),
|
|
12658
12659
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12659
|
-
|
|
12660
|
+
import_design_system45.BasicInput,
|
|
12660
12661
|
{
|
|
12661
12662
|
value: label,
|
|
12662
12663
|
autoFocus: true,
|
|
@@ -12683,9 +12684,9 @@ function FieldEditor(props) {
|
|
|
12683
12684
|
) : null
|
|
12684
12685
|
] }),
|
|
12685
12686
|
field ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex flex-col gap-1 sm:col-span-2", children: [
|
|
12686
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12687
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Help text" }),
|
|
12687
12688
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12688
|
-
|
|
12689
|
+
import_design_system45.BasicInput,
|
|
12689
12690
|
{
|
|
12690
12691
|
value: description,
|
|
12691
12692
|
maxLength: 300,
|
|
@@ -12696,18 +12697,18 @@ function FieldEditor(props) {
|
|
|
12696
12697
|
)
|
|
12697
12698
|
] }) : null,
|
|
12698
12699
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12699
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12700
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "What it holds" }),
|
|
12700
12701
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12701
|
-
|
|
12702
|
+
import_design_system45.Select,
|
|
12702
12703
|
{
|
|
12703
12704
|
value: type,
|
|
12704
12705
|
disabled: editing,
|
|
12705
12706
|
onValueChange: (next) => setType(next),
|
|
12706
12707
|
children: [
|
|
12707
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12708
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12709
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12710
|
-
FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12708
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "What this field holds", ...choice?.explanation ? { title: choice.explanation } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
12709
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectGroup, { children: [
|
|
12710
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectLabel, { children: group }),
|
|
12711
|
+
FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: c.id, children: c.label }, c.id))
|
|
12711
12712
|
] }, group)) })
|
|
12712
12713
|
]
|
|
12713
12714
|
}
|
|
@@ -12718,7 +12719,7 @@ function FieldEditor(props) {
|
|
|
12718
12719
|
type === "formula" && others.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12719
12720
|
editing ? startingFormulaText.trim() === "" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: EDITING_A_WORKED_OUT_COLUMN }) : null : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-1", role: "group", "aria-label": "How to make this column", children: [
|
|
12720
12721
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12721
|
-
|
|
12722
|
+
import_design_system45.Button,
|
|
12722
12723
|
{
|
|
12723
12724
|
type: "button",
|
|
12724
12725
|
size: "sm",
|
|
@@ -12729,7 +12730,7 @@ function FieldEditor(props) {
|
|
|
12729
12730
|
}
|
|
12730
12731
|
),
|
|
12731
12732
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12732
|
-
|
|
12733
|
+
import_design_system45.Button,
|
|
12733
12734
|
{
|
|
12734
12735
|
type: "button",
|
|
12735
12736
|
size: "sm",
|
|
@@ -12813,48 +12814,48 @@ function FieldEditor(props) {
|
|
|
12813
12814
|
type === "button" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ButtonSettingsEditor, { value: buttonSettings, onChange: setButtonSettings, tableId: onEntity ? null : tableId, fields: others }) : null,
|
|
12814
12815
|
type === "modified_time" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WatchFieldsPicker, { fields: others, value: watchFields, onChange: setWatchFields }) : null,
|
|
12815
12816
|
type === "autonumber" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
12816
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12817
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12817
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Prefix" }),
|
|
12818
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.BasicInput, { className: "h-8 text-xs", placeholder: "TASK-", maxLength: 16, "data-records-autonumber-prefix": "", value: numberPrefix, onChange: (e) => setNumberPrefix(e.target.value) })
|
|
12818
12819
|
] }) : null,
|
|
12819
12820
|
editing && field?.type === "relation" && field.relation_target && field.relation_target === field.entity_definition_id ? /* @__PURE__ */ (0, import_jsx_runtime49.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: [
|
|
12820
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12821
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
12821
12822
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Waits on the linked records" })
|
|
12822
12823
|
] }) : null,
|
|
12823
12824
|
editing && limitTarget ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", "data-records-limit-to-view": "", children: [
|
|
12824
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12825
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12826
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12827
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12828
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12829
|
-
(targetViews ?? []).map((v) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12830
|
-
limitView !== "" && targetViews !== null && !targetViews.some((v) => v.id === limitView) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12825
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Choices come from" }),
|
|
12826
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: limitView === "" ? "__all" : limitView, onValueChange: (next) => setLimitView(next === "__all" ? "" : next), disabled: targetViews === null, children: [
|
|
12827
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "Limit the choices to a view", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
12828
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectContent, { children: [
|
|
12829
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "__all", children: "Every record" }),
|
|
12830
|
+
(targetViews ?? []).map((v) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: v.id, children: v.name }, v.id)),
|
|
12831
|
+
limitView !== "" && targetViews !== null && !targetViews.some((v) => v.id === limitView) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: limitView, children: "A view that is gone" }) : null
|
|
12831
12832
|
] })
|
|
12832
12833
|
] })
|
|
12833
12834
|
] }) : null,
|
|
12834
12835
|
editing && limitTarget ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AlsoPointsAt, { own: limitTarget, value: alsoTargets, onChange: setAlsoTargets }) : null,
|
|
12835
12836
|
editing && field?.type === "relation" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", "data-records-link-binding": "", children: [
|
|
12836
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12837
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12838
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12839
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12840
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12841
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12837
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "When a linked record changes" }),
|
|
12838
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: binding, onValueChange: (next) => setBinding(next === "snapshot" ? "snapshot" : "live"), children: [
|
|
12839
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "When a linked record changes", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
12840
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectContent, { children: [
|
|
12841
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "live", children: "Show its changes" }),
|
|
12842
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "snapshot", children: "Keep it as it was when linked" })
|
|
12842
12843
|
] })
|
|
12843
12844
|
] })
|
|
12844
12845
|
] }) : null,
|
|
12845
12846
|
editing && field?.type === "relation" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", "data-records-link-on-archive": "", children: [
|
|
12846
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12847
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "When a linked record is archived" }),
|
|
12847
12848
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12848
|
-
|
|
12849
|
+
import_design_system45.Select,
|
|
12849
12850
|
{
|
|
12850
12851
|
value: onDelete,
|
|
12851
12852
|
onValueChange: (next) => setOnDelete(next === "cascade" || next === "restrict" ? next : "set_null"),
|
|
12852
12853
|
children: [
|
|
12853
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12854
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12855
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12856
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12857
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12854
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "When a linked record is archived", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
12855
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectContent, { children: [
|
|
12856
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "set_null", children: "Keep the link, shown as archived" }),
|
|
12857
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "cascade", children: "Archive this record too" }),
|
|
12858
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "restrict", children: "Refuse while it is linked" })
|
|
12858
12859
|
] })
|
|
12859
12860
|
]
|
|
12860
12861
|
}
|
|
@@ -12862,18 +12863,18 @@ function FieldEditor(props) {
|
|
|
12862
12863
|
] }) : null,
|
|
12863
12864
|
editing && field?.type === "relation" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1.5", "data-records-link-carries": "", children: [
|
|
12864
12865
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "Whoever can see a linked record can also see this one", children: [
|
|
12865
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12866
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Checkbox, { checked: carries, "aria-label": "Carries access", onCheckedChange: (v) => setCarries(v === true) }),
|
|
12866
12867
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Whoever sees a linked record sees this one" })
|
|
12867
12868
|
] }),
|
|
12868
|
-
carries ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12869
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12870
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12871
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12872
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12869
|
+
carries ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: carriesMax, onValueChange: (next) => setCarriesMax(next === "editor" ? "editor" : "viewer"), children: [
|
|
12870
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "Carried access level", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
12871
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectContent, { children: [
|
|
12872
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "viewer", children: "Up to view" }),
|
|
12873
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: "editor", children: "Up to edit" })
|
|
12873
12874
|
] })
|
|
12874
12875
|
] }) : null,
|
|
12875
12876
|
field.relation_target && field.relation_target === field.entity_definition_id ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "Two records may point at each other along this link", children: [
|
|
12876
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12877
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Checkbox, { checked: loops, "aria-label": "Two records can link each other", onCheckedChange: (v) => setLoops(v === true) }),
|
|
12877
12878
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Two records can link each other" })
|
|
12878
12879
|
] }) : null,
|
|
12879
12880
|
carries && loops ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-xs text-muted-foreground", "data-records-loop-consequence": "", children: [
|
|
@@ -12884,7 +12885,7 @@ function FieldEditor(props) {
|
|
|
12884
12885
|
] }) : null,
|
|
12885
12886
|
personColumn ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5 text-sm", title: "Each person added to this column gets a notice", children: [
|
|
12886
12887
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12887
|
-
|
|
12888
|
+
import_design_system45.Checkbox,
|
|
12888
12889
|
{
|
|
12889
12890
|
checked: notify,
|
|
12890
12891
|
disabled: notifyStart === null,
|
|
@@ -12911,7 +12912,7 @@ function FieldEditor(props) {
|
|
|
12911
12912
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-wrap items-center gap-4", children: [
|
|
12912
12913
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12913
12914
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12914
|
-
|
|
12915
|
+
import_design_system45.Checkbox,
|
|
12915
12916
|
{
|
|
12916
12917
|
checked: required,
|
|
12917
12918
|
"aria-label": "Required",
|
|
@@ -12922,7 +12923,7 @@ function FieldEditor(props) {
|
|
|
12922
12923
|
] }),
|
|
12923
12924
|
offersMany ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12924
12925
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12925
|
-
|
|
12926
|
+
import_design_system45.Checkbox,
|
|
12926
12927
|
{
|
|
12927
12928
|
checked: multi,
|
|
12928
12929
|
"aria-label": "Can hold more than one",
|
|
@@ -12933,7 +12934,7 @@ function FieldEditor(props) {
|
|
|
12933
12934
|
] }) : null,
|
|
12934
12935
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12935
12936
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12936
|
-
|
|
12937
|
+
import_design_system45.Checkbox,
|
|
12937
12938
|
{
|
|
12938
12939
|
checked: dated,
|
|
12939
12940
|
"aria-label": "Each value has its own date",
|
|
@@ -12944,7 +12945,7 @@ function FieldEditor(props) {
|
|
|
12944
12945
|
] }),
|
|
12945
12946
|
!field && type === "relation" && otherTable.data && otherTable.data.id !== tableId ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12946
12947
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12947
|
-
|
|
12948
|
+
import_design_system45.Checkbox,
|
|
12948
12949
|
{
|
|
12949
12950
|
checked: showOnOther,
|
|
12950
12951
|
"aria-label": `Show on ${otherTable.data.name ?? "the other table"}`,
|
|
@@ -12956,12 +12957,12 @@ function FieldEditor(props) {
|
|
|
12956
12957
|
otherTable.data.name ?? "the other table"
|
|
12957
12958
|
] }) : null,
|
|
12958
12959
|
!field && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", title: "A timeline draws a line to each record this one waits on", children: [
|
|
12959
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12960
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
12960
12961
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Waits on the linked records" })
|
|
12961
12962
|
] }) : null,
|
|
12962
12963
|
!field && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12963
12964
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12964
|
-
|
|
12965
|
+
import_design_system45.Checkbox,
|
|
12965
12966
|
{
|
|
12966
12967
|
checked: nestsSubItems,
|
|
12967
12968
|
"aria-label": "Sub-items",
|
|
@@ -12976,7 +12977,7 @@ function FieldEditor(props) {
|
|
|
12976
12977
|
] }) : null,
|
|
12977
12978
|
CHOICE_EDITOR_ADDS_WHAT_IS_TYPED && (type === "select" || type === "multi_select") ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
12978
12979
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12979
|
-
|
|
12980
|
+
import_design_system45.Checkbox,
|
|
12980
12981
|
{
|
|
12981
12982
|
checked: allowOther,
|
|
12982
12983
|
"aria-label": "A value that is not one of the choices is added to them",
|
|
@@ -12988,7 +12989,7 @@ function FieldEditor(props) {
|
|
|
12988
12989
|
] }),
|
|
12989
12990
|
!editing && !onEntity && newColumnTakesADefault(type) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NewColumnDefault, { type, choices: options, value: startsWith, onChange: setStartsWith }) : null,
|
|
12990
12991
|
editing && field && takesADefault(liveField ?? field) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-default": "", children: [
|
|
12991
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12992
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { htmlFor: "records-field-default", className: "text-xs", children: DEFAULT_LABEL }),
|
|
12992
12993
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12993
12994
|
FieldControl,
|
|
12994
12995
|
{
|
|
@@ -12999,29 +13000,29 @@ function FieldEditor(props) {
|
|
|
12999
13000
|
}
|
|
13000
13001
|
)
|
|
13001
13002
|
] }) : null,
|
|
13002
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13003
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Separator, {}),
|
|
13003
13004
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
13004
13005
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13005
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13006
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13007
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13008
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13006
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Who can see what is in it" }),
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: sensitivity, onValueChange: setSensitivity, children: [
|
|
13008
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "Who can see what is in it", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
13009
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: sensitivities.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
13009
13010
|
] })
|
|
13010
13011
|
] }),
|
|
13011
13012
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13012
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13013
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13014
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13015
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13013
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Can an assistant read it" }),
|
|
13014
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: contextPolicy, onValueChange: setContextPolicy, children: [
|
|
13015
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "Can an assistant read it", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
13016
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: AGENT_VISIBILITY.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
13016
13017
|
] })
|
|
13017
13018
|
] })
|
|
13018
13019
|
] }),
|
|
13019
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13020
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Separator, {}),
|
|
13020
13021
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
13021
13022
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
13022
13023
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium", children: "What counts as a good value" }),
|
|
13023
13024
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13024
|
-
|
|
13025
|
+
import_design_system45.Button,
|
|
13025
13026
|
{
|
|
13026
13027
|
type: "button",
|
|
13027
13028
|
size: "sm",
|
|
@@ -13034,7 +13035,7 @@ function FieldEditor(props) {
|
|
|
13034
13035
|
] }),
|
|
13035
13036
|
canBeUnique(type, multi) || rules.some((r) => r.kind === "unique") ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", "data-records-field-unique": "", children: [
|
|
13036
13037
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13037
|
-
|
|
13038
|
+
import_design_system45.Checkbox,
|
|
13038
13039
|
{
|
|
13039
13040
|
checked: rules.some((r) => r.kind === "unique"),
|
|
13040
13041
|
"aria-label": UNIQUE_LABEL,
|
|
@@ -13046,18 +13047,18 @@ function FieldEditor(props) {
|
|
|
13046
13047
|
rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-muted-foreground", children: "No checks." }) : null,
|
|
13047
13048
|
rules.map((rule, index) => rule.kind === "unique" ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
13048
13049
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13049
|
-
|
|
13050
|
+
import_design_system45.Select,
|
|
13050
13051
|
{
|
|
13051
13052
|
value: rule.kind,
|
|
13052
13053
|
onValueChange: (kind) => setRules(rules.map((r, i) => i === index ? { ...r, kind } : r)),
|
|
13053
13054
|
children: [
|
|
13054
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13055
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13055
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", className: "w-52", "aria-label": `Check ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
13056
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: RULE_KINDS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: row.kind, children: row.label }, row.kind)) })
|
|
13056
13057
|
]
|
|
13057
13058
|
}
|
|
13058
13059
|
),
|
|
13059
13060
|
rule.kind === "length" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13060
|
-
|
|
13061
|
+
import_design_system45.BasicInput,
|
|
13061
13062
|
{
|
|
13062
13063
|
className: "h-8 w-24",
|
|
13063
13064
|
inputMode: "numeric",
|
|
@@ -13068,7 +13069,7 @@ function FieldEditor(props) {
|
|
|
13068
13069
|
}
|
|
13069
13070
|
) : null,
|
|
13070
13071
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13071
|
-
|
|
13072
|
+
import_design_system45.BasicInput,
|
|
13072
13073
|
{
|
|
13073
13074
|
className: "h-8",
|
|
13074
13075
|
...rule.kind === "length" ? { inputMode: "numeric", placeholder: "most" } : {},
|
|
@@ -13078,7 +13079,7 @@ function FieldEditor(props) {
|
|
|
13078
13079
|
}
|
|
13079
13080
|
),
|
|
13080
13081
|
rule.kind === "pattern" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13081
|
-
|
|
13082
|
+
import_design_system45.BasicInput,
|
|
13082
13083
|
{
|
|
13083
13084
|
className: "h-8",
|
|
13084
13085
|
placeholder: "for example 949-555-0142",
|
|
@@ -13088,7 +13089,7 @@ function FieldEditor(props) {
|
|
|
13088
13089
|
}
|
|
13089
13090
|
) : null,
|
|
13090
13091
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13091
|
-
|
|
13092
|
+
import_design_system45.Button,
|
|
13092
13093
|
{
|
|
13093
13094
|
type: "button",
|
|
13094
13095
|
size: "sm",
|
|
@@ -13116,7 +13117,7 @@ function FieldEditor(props) {
|
|
|
13116
13117
|
rehomed ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { "data-records-choice-rehomed": "", className: "flex flex-wrap items-center gap-2 text-[11px]", children: [
|
|
13117
13118
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: rehomed.said }),
|
|
13118
13119
|
rehomed.undo ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13119
|
-
|
|
13120
|
+
import_design_system45.Button,
|
|
13120
13121
|
{
|
|
13121
13122
|
type: "button",
|
|
13122
13123
|
size: "sm",
|
|
@@ -13140,7 +13141,7 @@ function FieldEditor(props) {
|
|
|
13140
13141
|
children: "Undo"
|
|
13141
13142
|
}
|
|
13142
13143
|
) : null,
|
|
13143
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13144
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", onClick: () => onSaved?.(), children: "Done" })
|
|
13144
13145
|
] }) : null,
|
|
13145
13146
|
reverseRefused ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { "data-records-reverse-field-refused": "", className: "flex flex-col gap-1", children: [
|
|
13146
13147
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px]", children: "The link is made. Its column on the other table was not:" }),
|
|
@@ -13152,7 +13153,7 @@ function FieldEditor(props) {
|
|
|
13152
13153
|
] }) : null,
|
|
13153
13154
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex min-w-0 flex-nowrap items-center gap-2", "data-field-editor-footer": "", children: [
|
|
13154
13155
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13155
|
-
|
|
13156
|
+
import_design_system45.Button,
|
|
13156
13157
|
{
|
|
13157
13158
|
size: "sm",
|
|
13158
13159
|
disabled: mutation.saving || Boolean(formulaMissing) || Boolean(nameLine) && label.trim() !== (field?.label ?? "").trim(),
|
|
@@ -13167,7 +13168,7 @@ function FieldEditor(props) {
|
|
|
13167
13168
|
children: mutation.saving ? "Saving\u2026" : field ? EDIT_FIELD_SAVE_LABEL : onEntity ? ADD_STANDARD_FIELD_SAVE_LABEL : ADD_FIELD_SAVE_LABEL
|
|
13168
13169
|
}
|
|
13169
13170
|
),
|
|
13170
|
-
onCancel ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13171
|
+
onCancel ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Button, { size: "sm", variant: "ghost", onClick: onCancel, children: "Cancel" }) : null,
|
|
13171
13172
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13172
13173
|
"span",
|
|
13173
13174
|
{
|
|
@@ -13185,11 +13186,11 @@ function FieldEditor(props) {
|
|
|
13185
13186
|
the dialog card 0.2278 and closing it 0.1303. The consequence is the tooltip of
|
|
13186
13187
|
"Remove it" (interface-text: the slot holds a label, never a paragraph). */
|
|
13187
13188
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ml-auto grid shrink-0 items-center", "data-field-editor-remove": askingToRemove ? "asking" : "idle", children: [
|
|
13188
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0,
|
|
13189
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: (0,
|
|
13189
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0, import_design_system45.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_runtime49.jsx)(import_design_system45.Button, { size: "sm", variant: "outline", tabIndex: askingToRemove ? -1 : void 0, onClick: () => setAskingToRemove(true), children: "Remove this field" }) }),
|
|
13190
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: (0, import_design_system45.cn)("col-start-1 row-start-1 flex items-center justify-end gap-2", !askingToRemove && "invisible"), "aria-hidden": !askingToRemove || void 0, children: [
|
|
13190
13191
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "whitespace-nowrap text-destructive", "data-field-editor-remove-ask": "", children: "Archive this field?" }),
|
|
13191
13192
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13192
|
-
|
|
13193
|
+
import_design_system45.Button,
|
|
13193
13194
|
{
|
|
13194
13195
|
size: "sm",
|
|
13195
13196
|
variant: "destructive",
|
|
@@ -13201,7 +13202,7 @@ function FieldEditor(props) {
|
|
|
13201
13202
|
children: "Remove it"
|
|
13202
13203
|
}
|
|
13203
13204
|
),
|
|
13204
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13205
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Button, { size: "sm", variant: "ghost", tabIndex: askingToRemove ? void 0 : -1, onClick: () => setAskingToRemove(false), children: "Keep it" })
|
|
13205
13206
|
] })
|
|
13206
13207
|
] })
|
|
13207
13208
|
) : null
|
|
@@ -13320,9 +13321,9 @@ function TypeQuestions(props) {
|
|
|
13320
13321
|
}
|
|
13321
13322
|
if (type === "currency") {
|
|
13322
13323
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
13323
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13324
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "The currency" }),
|
|
13324
13325
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13325
|
-
|
|
13326
|
+
import_design_system45.BasicInput,
|
|
13326
13327
|
{
|
|
13327
13328
|
value: props.unit,
|
|
13328
13329
|
"aria-label": "The currency",
|
|
@@ -13335,7 +13336,7 @@ function TypeQuestions(props) {
|
|
|
13335
13336
|
if (type === "datetime") {
|
|
13336
13337
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
13337
13338
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13338
|
-
|
|
13339
|
+
import_design_system45.Checkbox,
|
|
13339
13340
|
{
|
|
13340
13341
|
checked: props.withTime,
|
|
13341
13342
|
"aria-label": "Include a time of day",
|
|
@@ -13352,10 +13353,10 @@ function TypeQuestions(props) {
|
|
|
13352
13353
|
}
|
|
13353
13354
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
13354
13355
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13355
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13356
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13357
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13358
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13356
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: type !== "lookup" ? "Across the records in" : "Read it from" }),
|
|
13357
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: props.via, onValueChange: props.setVia, children: [
|
|
13358
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": type !== "lookup" ? "Across the records in" : "Read it from", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, { placeholder: "Choose a column" }) }),
|
|
13359
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: usable.map((f) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectItem, { value: f.key, children: [
|
|
13359
13360
|
fieldName(f),
|
|
13360
13361
|
isBackLinkSource(f) ? BACK_LINK_SOURCE_SUFFIX : "",
|
|
13361
13362
|
sourceKindOf(f) === "person" ? " \u2014 a person" : sourceKindOf(f) === "file" ? " \u2014 a file" : "",
|
|
@@ -13373,10 +13374,10 @@ function TypeQuestions(props) {
|
|
|
13373
13374
|
onChange: props.setPick
|
|
13374
13375
|
}
|
|
13375
13376
|
) : type === "count" ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13376
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13377
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13378
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13379
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13377
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "What to work out" }),
|
|
13378
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: props.agg, onValueChange: (v) => props.setAgg(v), children: [
|
|
13379
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": "What to work out", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
13380
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: ROLLUP_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
13380
13381
|
] }),
|
|
13381
13382
|
props.agg !== "count" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13382
13383
|
ValueOnTheOtherSide,
|
|
@@ -13398,18 +13399,18 @@ function TypeQuestions(props) {
|
|
|
13398
13399
|
}
|
|
13399
13400
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
13400
13401
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13401
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13402
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13403
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13404
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13402
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "What to do" }),
|
|
13403
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: props.formulaOp, onValueChange: props.setFormulaOp, children: [
|
|
13404
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", className: "max-w-[18rem]", "aria-label": "What to do", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
13405
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: FORMULA_OPERATIONS.map((row) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: row.value, children: row.label }, row.value)) })
|
|
13405
13406
|
] })
|
|
13406
13407
|
] }),
|
|
13407
13408
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13408
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13409
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: "Which columns" }),
|
|
13409
13410
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex flex-wrap gap-1", children: props.others.map((f) => {
|
|
13410
13411
|
const picked = props.formulaFields.includes(f.id);
|
|
13411
13412
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13412
|
-
|
|
13413
|
+
import_design_system45.Button,
|
|
13413
13414
|
{
|
|
13414
13415
|
type: "button",
|
|
13415
13416
|
size: "sm",
|
|
@@ -13424,9 +13425,9 @@ function TypeQuestions(props) {
|
|
|
13424
13425
|
}) })
|
|
13425
13426
|
] }),
|
|
13426
13427
|
props.formulaOp === "concat" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13427
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13428
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", children: FORMULA_SEPARATOR_LABEL }),
|
|
13428
13429
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13429
|
-
|
|
13430
|
+
import_design_system45.BasicInput,
|
|
13430
13431
|
{
|
|
13431
13432
|
value: props.formulaSeparator,
|
|
13432
13433
|
"aria-label": FORMULA_SEPARATOR_LABEL,
|
|
@@ -13493,7 +13494,7 @@ function RollupFilterQuestion({
|
|
|
13493
13494
|
conditionInWords(value, conditionFields),
|
|
13494
13495
|
"."
|
|
13495
13496
|
] }),
|
|
13496
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13497
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onChange(null), children: "Clear" })
|
|
13497
13498
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChoiceListTermsContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13498
13499
|
ConditionGroup,
|
|
13499
13500
|
{
|
|
@@ -13520,13 +13521,13 @@ function ValueOnTheOtherSide({
|
|
|
13520
13521
|
const carried = sample.data?.rows[0]?.document ?? null;
|
|
13521
13522
|
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) }));
|
|
13522
13523
|
const stillAsking = columns.loading || declared.length === 0 && sample.loading;
|
|
13523
|
-
const body = !relation ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13524
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13525
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13524
|
+
const body = !relation ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value, onValueChange: onChange, children: [
|
|
13525
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { size: "sm", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, { placeholder: "Choose a column" }) }),
|
|
13526
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectContent, { children: offered.map((column) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: column.key, children: column.name }, column.key)) })
|
|
13526
13527
|
] });
|
|
13527
13528
|
if (compact) return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mt-1 flex flex-col gap-1", children: body });
|
|
13528
13529
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
13529
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13530
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { className: "text-xs", title: help, children: label }),
|
|
13530
13531
|
body
|
|
13531
13532
|
] });
|
|
13532
13533
|
}
|
|
@@ -13553,18 +13554,18 @@ function NewColumnDefault({
|
|
|
13553
13554
|
}) {
|
|
13554
13555
|
const none = "__none__";
|
|
13555
13556
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", "data-records-field-default": "", "data-records-new-field-default": "", children: [
|
|
13556
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13557
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Label, { htmlFor: "records-new-field-default", className: "text-xs", children: DEFAULT_LABEL }),
|
|
13557
13558
|
type === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-2", children: [
|
|
13558
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13559
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.Checkbox, { id: "records-new-field-default", "aria-label": DEFAULT_LABEL, checked: value === true, onCheckedChange: (on) => onChange(on === true ? true : null) }),
|
|
13559
13560
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "Ticked" })
|
|
13560
|
-
] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13561
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13562
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
13563
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13564
|
-
choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13561
|
+
] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.Select, { value: typeof value === "string" && choices.includes(value) ? value : none, onValueChange: (v) => onChange(v === none ? null : v), children: [
|
|
13562
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectTrigger, { id: "records-new-field-default", size: "sm", "aria-label": DEFAULT_LABEL, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectValue, {}) }),
|
|
13563
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system45.SelectContent, { children: [
|
|
13564
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: none, children: "Nothing" }),
|
|
13565
|
+
choices.map((c) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system45.SelectItem, { value: c, children: c }, c))
|
|
13565
13566
|
] })
|
|
13566
13567
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13567
|
-
|
|
13568
|
+
import_design_system45.BasicInput,
|
|
13568
13569
|
{
|
|
13569
13570
|
id: "records-new-field-default",
|
|
13570
13571
|
value: typeof value === "string" ? value : value === null || value === void 0 ? "" : String(value),
|
|
@@ -13656,7 +13657,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13656
13657
|
const color = (0, import_data_table6.isStyleColor)(b.color) ? import_data_table6.CHOICE_CHIP_CLASS[b.color] : import_data_table6.NEUTRAL_CHIP_CLASS;
|
|
13657
13658
|
if (beforeSave) {
|
|
13658
13659
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-2", "data-records-button-before-save": field.key, children: [
|
|
13659
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13660
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system46.Button, { type: "button", size: "xs", variant: "outline", disabled: true, "aria-describedby": `${field.key}-before-save`, "data-records-button": field.key, className: (0, import_design_system46.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "truncate", children: b.label }) }),
|
|
13660
13661
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { id: `${field.key}-before-save`, className: "whitespace-nowrap text-xs text-muted-foreground", children: "Save the record first" })
|
|
13661
13662
|
] });
|
|
13662
13663
|
}
|
|
@@ -13755,7 +13756,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13755
13756
|
};
|
|
13756
13757
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
13757
13758
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
13758
|
-
|
|
13759
|
+
import_design_system46.Popover,
|
|
13759
13760
|
{
|
|
13760
13761
|
open: said2 !== null,
|
|
13761
13762
|
onOpenChange: (open) => {
|
|
@@ -13765,8 +13766,8 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13765
13766
|
setSaid(null);
|
|
13766
13767
|
},
|
|
13767
13768
|
children: [
|
|
13768
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13769
|
-
|
|
13769
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system46.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13770
|
+
import_design_system46.Button,
|
|
13770
13771
|
{
|
|
13771
13772
|
type: "button",
|
|
13772
13773
|
size: "xs",
|
|
@@ -13776,7 +13777,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13776
13777
|
"aria-busy": busy || opening || void 0,
|
|
13777
13778
|
"data-records-button-pending": busy || opening ? "" : void 0,
|
|
13778
13779
|
disabled: busy || opening,
|
|
13779
|
-
className: (0,
|
|
13780
|
+
className: (0, import_design_system46.cn)("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color, needs && "border-dashed opacity-80"),
|
|
13780
13781
|
onPointerDown: stop2,
|
|
13781
13782
|
onDoubleClick: stop2,
|
|
13782
13783
|
onClick: (event) => {
|
|
@@ -13784,13 +13785,13 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13784
13785
|
event.preventDefault();
|
|
13785
13786
|
void press();
|
|
13786
13787
|
},
|
|
13787
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: (0,
|
|
13788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: (0, import_design_system46.cn)("truncate", (busy || opening) && "matrx-shimmer"), children: b.label })
|
|
13788
13789
|
}
|
|
13789
13790
|
) }),
|
|
13790
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
13791
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_design_system46.PopoverContent, { className: "w-72 space-y-2 p-3 text-sm", onClick: stop2, onPointerDown: stop2, "data-records-button-said": said2?.kind, children: [
|
|
13791
13792
|
said2?.kind === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RefusalLine, { error: said2.error }) : null,
|
|
13792
13793
|
said2?.kind === "waiting" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
|
|
13793
|
-
said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13794
|
+
said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system46.ErrorBox, { as: "p", className: "break-words text-destructive", message: said2.says, origin: "records-ui/buttonCell", children: said2.says }) : null,
|
|
13794
13795
|
said2?.kind === "public" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: "Buttons run for signed-in people." }) : null,
|
|
13795
13796
|
said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "break-words", children: [
|
|
13796
13797
|
said2.value ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(StructuredValueView, { structured: said2.value, label: b.label }) : null,
|
|
@@ -13801,7 +13802,7 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13801
13802
|
said2?.kind === "needs" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
13802
13803
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: said2.says }),
|
|
13803
13804
|
tableId ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
13804
|
-
|
|
13805
|
+
import_design_system46.Button,
|
|
13805
13806
|
{
|
|
13806
13807
|
type: "button",
|
|
13807
13808
|
size: "sm",
|
|
@@ -13821,10 +13822,10 @@ function ButtonValue({ field, recordId, inCell, beforeSave }) {
|
|
|
13821
13822
|
]
|
|
13822
13823
|
}
|
|
13823
13824
|
),
|
|
13824
|
-
settingUp && tableId ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13825
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
13826
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13827
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13825
|
+
settingUp && tableId ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system46.Dialog, { open: true, onOpenChange: (open) => open ? null : setSettingUp(false), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_design_system46.DialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl", onClick: stop2, onPointerDown: stop2, children: [
|
|
13826
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_design_system46.DialogHeader, { children: [
|
|
13827
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system46.DialogTitle, { children: `Column settings \xB7 ${fieldName(field)}` }),
|
|
13828
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system46.DialogDescription, { className: "sr-only", children: "What the button does" })
|
|
13828
13829
|
] }),
|
|
13829
13830
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FieldEditor, { tableId, field, onSaved: () => setSettingUp(false), onCancel: () => setSettingUp(false) })
|
|
13830
13831
|
] }) }) : null
|
|
@@ -13906,7 +13907,7 @@ init_refusals();
|
|
|
13906
13907
|
|
|
13907
13908
|
// src/formatControls.tsx
|
|
13908
13909
|
var import_react76 = require("react");
|
|
13909
|
-
var
|
|
13910
|
+
var import_design_system47 = require("@ai-matrx/design-system");
|
|
13910
13911
|
var import_field_formats12 = require("@ai-matrx/design-system/field-formats");
|
|
13911
13912
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
13912
13913
|
var TYPED_NUMBERS = /* @__PURE__ */ new Set(["currency", "percent", "progress", "decimal", "duration", "file_size", "integer"]);
|
|
@@ -13932,7 +13933,7 @@ function NumberInFormat({ format, value, onChange, disabled, id }) {
|
|
|
13932
13933
|
setText(typedText(format, value));
|
|
13933
13934
|
}, [value, format]);
|
|
13934
13935
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
13935
|
-
|
|
13936
|
+
import_design_system47.BasicInput,
|
|
13936
13937
|
{
|
|
13937
13938
|
id,
|
|
13938
13939
|
inputMode: "decimal",
|
|
@@ -13971,7 +13972,7 @@ function formatControl(args) {
|
|
|
13971
13972
|
case "url":
|
|
13972
13973
|
case "tel":
|
|
13973
13974
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
13974
|
-
|
|
13975
|
+
import_design_system47.BasicInput,
|
|
13975
13976
|
{
|
|
13976
13977
|
id,
|
|
13977
13978
|
type: def.editor,
|
|
@@ -13985,7 +13986,7 @@ function formatControl(args) {
|
|
|
13985
13986
|
case "color":
|
|
13986
13987
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
13987
13988
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
13988
|
-
|
|
13989
|
+
import_design_system47.BasicInput,
|
|
13989
13990
|
{
|
|
13990
13991
|
id: `${id}-swatch`,
|
|
13991
13992
|
type: "color",
|
|
@@ -13996,10 +13997,10 @@ function formatControl(args) {
|
|
|
13996
13997
|
onChange: (e) => commit(e.target.value)
|
|
13997
13998
|
}
|
|
13998
13999
|
),
|
|
13999
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14000
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system47.BasicInput, { id, value: text, placeholder: "#3b82f6", disabled, onChange: (e) => commit(e.target.value) })
|
|
14000
14001
|
] });
|
|
14001
14002
|
case "textarea":
|
|
14002
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system47.BasicTextarea, { id, rows: 4, value: text, disabled, onChange: (e) => commit(e.target.value) });
|
|
14003
14004
|
default:
|
|
14004
14005
|
return null;
|
|
14005
14006
|
}
|
|
@@ -14007,7 +14008,7 @@ function formatControl(args) {
|
|
|
14007
14008
|
|
|
14008
14009
|
// src/typedDateHelper.tsx
|
|
14009
14010
|
var import_react77 = require("react");
|
|
14010
|
-
var
|
|
14011
|
+
var import_design_system48 = require("@ai-matrx/design-system");
|
|
14011
14012
|
var import_records28 = require("@ai-matrx/records");
|
|
14012
14013
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
14013
14014
|
var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
@@ -14087,8 +14088,8 @@ function TypedDateHelper({
|
|
|
14087
14088
|
const at = new Date(shown2.y, shown2.m + by, 1);
|
|
14088
14089
|
setMonth({ y: at.getFullYear(), m: at.getMonth() });
|
|
14089
14090
|
};
|
|
14090
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
14091
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_design_system48.Popover, { open, onOpenChange: setOpen, children: [
|
|
14092
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system48.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14092
14093
|
"button",
|
|
14093
14094
|
{
|
|
14094
14095
|
type: "button",
|
|
@@ -14101,7 +14102,7 @@ function TypedDateHelper({
|
|
|
14101
14102
|
}
|
|
14102
14103
|
) }),
|
|
14103
14104
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14104
|
-
|
|
14105
|
+
import_design_system48.PopoverContent,
|
|
14105
14106
|
{
|
|
14106
14107
|
sizing: "content",
|
|
14107
14108
|
align: "start",
|
|
@@ -14132,7 +14133,7 @@ function TypedDateHelper({
|
|
|
14132
14133
|
type: "button",
|
|
14133
14134
|
...keepFocus,
|
|
14134
14135
|
"data-records-date-helper-day": key,
|
|
14135
|
-
className: (0,
|
|
14136
|
+
className: (0, import_design_system48.cn)(
|
|
14136
14137
|
"h-6 w-6 rounded tabular-nums hover:bg-muted",
|
|
14137
14138
|
key === held.day ? "bg-primary text-primary-foreground hover:bg-primary" : "",
|
|
14138
14139
|
key === todayKey && key !== held.day ? "ring-1 ring-ring" : ""
|
|
@@ -14151,7 +14152,7 @@ function TypedDateHelper({
|
|
|
14151
14152
|
type: "button",
|
|
14152
14153
|
...keepFocus,
|
|
14153
14154
|
"data-records-date-helper-time": `${pad(t.h)}:${pad(t.m)}`,
|
|
14154
|
-
className: (0,
|
|
14155
|
+
className: (0, import_design_system48.cn)(
|
|
14155
14156
|
"whitespace-nowrap rounded px-2 py-0.5 text-left tabular-nums hover:bg-muted",
|
|
14156
14157
|
held.time && held.time.h === t.h && held.time.m === t.m ? "bg-primary text-primary-foreground" : ""
|
|
14157
14158
|
),
|
|
@@ -14202,9 +14203,9 @@ function ChoiceAskButtons({
|
|
|
14202
14203
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { "data-records-choice-ask": "", "data-records-cell-note": "", role: "group", "aria-label": choiceAskSentence(field, words), className: "flex flex-col gap-1", children: [
|
|
14203
14204
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-[11px] leading-snug", children: choiceAskSentence(field, words) }),
|
|
14204
14205
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
14205
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14206
|
-
keepOffered ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14207
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14206
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Button, { type: "button", size: "sm", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onAdd, children: "Add" }),
|
|
14207
|
+
keepOffered ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Button, { type: "button", size: "sm", variant: "outline", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onKeep, children: "Keep as typed" }) : null,
|
|
14208
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onCancel, children: "Cancel" })
|
|
14208
14209
|
] })
|
|
14209
14210
|
] });
|
|
14210
14211
|
}
|
|
@@ -14344,7 +14345,7 @@ function TypedTextControl({ field, value, onChange, disabled, id, onCommit, onCa
|
|
|
14344
14345
|
...value.openedAs !== void 0 ? { openedAs: value.openedAs } : {}
|
|
14345
14346
|
});
|
|
14346
14347
|
const box = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14347
|
-
|
|
14348
|
+
import_design_system49.BasicInput,
|
|
14348
14349
|
{
|
|
14349
14350
|
id,
|
|
14350
14351
|
value: value.text,
|
|
@@ -14382,7 +14383,7 @@ function TypedTextControl({ field, value, onChange, disabled, id, onCommit, onCa
|
|
|
14382
14383
|
}
|
|
14383
14384
|
) : "refusal" in judged ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
14384
14385
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FloatingRefusal, { text: judged.refusal, why: "why" in judged ? judged.why : void 0 }),
|
|
14385
|
-
judged.cancelOnly && onCancel ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14386
|
+
judged.cancelOnly && onCancel ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onCancel(), children: "Cancel" }) }) : null
|
|
14386
14387
|
] }) : judged.value === null || judged.value === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(ReadsAsNote, { typed: value.text, always: isChoiceAddition(judged.value), children: [
|
|
14387
14388
|
isChoiceAddition(judged.value) ? `Adds ${quoted(judged.value.add)} to the choices for ${fieldName(field)}. ` : null,
|
|
14388
14389
|
"Reads as",
|
|
@@ -14448,7 +14449,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
14448
14449
|
});
|
|
14449
14450
|
}
|
|
14450
14451
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14451
|
-
|
|
14452
|
+
import_design_system49.BasicTextarea,
|
|
14452
14453
|
{
|
|
14453
14454
|
id: inputId,
|
|
14454
14455
|
rows: 3,
|
|
@@ -14461,7 +14462,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
14461
14462
|
case "currency":
|
|
14462
14463
|
case "percent":
|
|
14463
14464
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14464
|
-
|
|
14465
|
+
import_design_system49.BasicInput,
|
|
14465
14466
|
{
|
|
14466
14467
|
id: inputId,
|
|
14467
14468
|
type: "number",
|
|
@@ -14478,7 +14479,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
14478
14479
|
case "phone":
|
|
14479
14480
|
case "url":
|
|
14480
14481
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14481
|
-
|
|
14482
|
+
import_design_system49.BasicInput,
|
|
14482
14483
|
{
|
|
14483
14484
|
id: inputId,
|
|
14484
14485
|
type: kind === "email" ? "email" : kind === "phone" ? "tel" : "url",
|
|
@@ -14508,7 +14509,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
14508
14509
|
default:
|
|
14509
14510
|
if (typeof value === "boolean" || field.config?.["kind"] === "boolean") {
|
|
14510
14511
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14511
|
-
|
|
14512
|
+
import_design_system49.Checkbox,
|
|
14512
14513
|
{
|
|
14513
14514
|
id: inputId,
|
|
14514
14515
|
checked: value === true,
|
|
@@ -14518,7 +14519,7 @@ function FieldControl({ field, value, onChange, disabled, id, autoOpen, onClose,
|
|
|
14518
14519
|
);
|
|
14519
14520
|
}
|
|
14520
14521
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14521
|
-
|
|
14522
|
+
import_design_system49.BasicInput,
|
|
14522
14523
|
{
|
|
14523
14524
|
id: inputId,
|
|
14524
14525
|
...ownDetails && isPersonsName(field) ? { autoComplete: "name" } : {},
|
|
@@ -14556,7 +14557,7 @@ function TypedWordsControl({ field, value, onChange, disabled, id }) {
|
|
|
14556
14557
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "flex flex-col gap-0.5", children: [
|
|
14557
14558
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
14558
14559
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14559
|
-
|
|
14560
|
+
import_design_system49.BasicInput,
|
|
14560
14561
|
{
|
|
14561
14562
|
id,
|
|
14562
14563
|
value: text,
|
|
@@ -14587,7 +14588,7 @@ function CheckboxControl({ field, value, onChange, disabled, id }) {
|
|
|
14587
14588
|
const unanswered = value === null || value === void 0;
|
|
14588
14589
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14589
14590
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14590
|
-
|
|
14591
|
+
import_design_system49.Checkbox,
|
|
14591
14592
|
{
|
|
14592
14593
|
id,
|
|
14593
14594
|
checked: value === true,
|
|
@@ -14599,7 +14600,7 @@ function CheckboxControl({ field, value, onChange, disabled, id }) {
|
|
|
14599
14600
|
unanswered ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs italic text-muted-foreground", children: "not answered yet" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
14600
14601
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs text-muted-foreground", children: value === true ? "Yes" : "No" }),
|
|
14601
14602
|
field.required ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14602
|
-
|
|
14603
|
+
import_design_system49.Button,
|
|
14603
14604
|
{
|
|
14604
14605
|
size: "sm",
|
|
14605
14606
|
variant: "ghost",
|
|
@@ -14617,7 +14618,7 @@ function StructuredTextControl({ field, value, onChange, disabled, id, rows }) {
|
|
|
14617
14618
|
const reads = structuredOf(text) !== null;
|
|
14618
14619
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-1", "data-records-structured-editor": "", children: [
|
|
14619
14620
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14620
|
-
|
|
14621
|
+
import_design_system49.BasicTextarea,
|
|
14621
14622
|
{
|
|
14622
14623
|
id,
|
|
14623
14624
|
rows,
|
|
@@ -14629,7 +14630,7 @@ function StructuredTextControl({ field, value, onChange, disabled, id, rows }) {
|
|
|
14629
14630
|
}
|
|
14630
14631
|
),
|
|
14631
14632
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex h-6 items-center gap-2 text-xs", children: reads ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14632
|
-
|
|
14633
|
+
import_design_system49.Button,
|
|
14633
14634
|
{
|
|
14634
14635
|
type: "button",
|
|
14635
14636
|
variant: "ghost",
|
|
@@ -14649,7 +14650,7 @@ function JsonControl({ field, value, onChange, disabled, id }) {
|
|
|
14649
14650
|
const [broken, setBroken] = (0, import_react78.useState)(null);
|
|
14650
14651
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
14651
14652
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14652
|
-
|
|
14653
|
+
import_design_system49.BasicTextarea,
|
|
14653
14654
|
{
|
|
14654
14655
|
id,
|
|
14655
14656
|
rows: 4,
|
|
@@ -14730,7 +14731,7 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14730
14731
|
if (!client) {
|
|
14731
14732
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
14732
14733
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14733
|
-
|
|
14734
|
+
import_design_system49.BasicInput,
|
|
14734
14735
|
{
|
|
14735
14736
|
id,
|
|
14736
14737
|
value: value === null || value === void 0 ? "" : String(value),
|
|
@@ -14808,7 +14809,7 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14808
14809
|
const chosen = options.filter((option) => (0, import_records29.choiceValuesOf)(value).some((v) => (0, import_records29.isTheChosen)(option, v)));
|
|
14809
14810
|
const picked = new Set(chosen.map((option) => (0, import_records29.optionKey)(option)));
|
|
14810
14811
|
const toggles = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { id: autoOpen ? void 0 : id, className: "flex flex-wrap gap-1", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14811
|
-
|
|
14812
|
+
import_design_system49.Button,
|
|
14812
14813
|
{
|
|
14813
14814
|
type: "button",
|
|
14814
14815
|
size: "sm",
|
|
@@ -14826,22 +14827,22 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14826
14827
|
)) });
|
|
14827
14828
|
if (!autoOpen) return toggles;
|
|
14828
14829
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14829
|
-
|
|
14830
|
+
import_design_system49.Popover,
|
|
14830
14831
|
{
|
|
14831
14832
|
defaultOpen: true,
|
|
14832
14833
|
onOpenChange: (open) => {
|
|
14833
14834
|
if (!open) onClose?.();
|
|
14834
14835
|
},
|
|
14835
14836
|
children: [
|
|
14836
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14837
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14837
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Button, { id, type: "button", size: "sm", variant: "outline", className: "h-6 max-w-full truncate", children: chosen.length === 0 ? "Choose" : chosen.map(titleOf).join(", ") }) }),
|
|
14838
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.PopoverContent, { sizing: "content", className: "max-w-[20rem] p-2", align: "start", children: toggles })
|
|
14838
14839
|
]
|
|
14839
14840
|
}
|
|
14840
14841
|
);
|
|
14841
14842
|
}
|
|
14842
14843
|
const current = options.find((option) => (0, import_records29.isTheChosen)(option, value));
|
|
14843
14844
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14844
|
-
|
|
14845
|
+
import_design_system49.Select,
|
|
14845
14846
|
{
|
|
14846
14847
|
value: current ? (0, import_records29.optionKey)(current) : "",
|
|
14847
14848
|
disabled: disabled ?? false,
|
|
@@ -14854,8 +14855,8 @@ function OptionControl({ field, value, onChange, disabled, id, autoOpen, onClose
|
|
|
14854
14855
|
}
|
|
14855
14856
|
} : {},
|
|
14856
14857
|
children: [
|
|
14857
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14858
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14858
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.SelectTrigger, { id, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.SelectValue, { placeholder: "Choose" }) }),
|
|
14859
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.SelectItem, { value: (0, import_records29.optionKey)(option), children: titleOf(option) }, option.id)) })
|
|
14859
14860
|
]
|
|
14860
14861
|
}
|
|
14861
14862
|
);
|
|
@@ -14944,7 +14945,7 @@ function OpenChoicePicker({
|
|
|
14944
14945
|
const pickedOptions = current.map((v) => options.find((o) => (0, import_records29.isTheChosen)(o, v)));
|
|
14945
14946
|
const cellChips = pickedWords.map((word, i) => {
|
|
14946
14947
|
const chip = chipOf(pickedOptions[i], word);
|
|
14947
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Badge, { variant: "outline", className: (0, import_design_system49.cn)("text-[11px]", chip.className), "data-records-choice-chip": "", children: word }, word);
|
|
14948
14949
|
});
|
|
14949
14950
|
const headChips = pickedWords.map((word, i) => {
|
|
14950
14951
|
const option = pickedOptions[i];
|
|
@@ -14997,7 +14998,7 @@ function OpenChoicePicker({
|
|
|
14997
14998
|
// never_add on a column that takes only its choices: said, never a silent nothing.
|
|
14998
14999
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
14999
15000
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { "data-records-typed-refusal": "", className: "p-2 text-xs text-muted-foreground", children: notAChoiceSentence(field, [q]) }),
|
|
15000
|
-
autoOpen ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
15001
|
+
autoOpen ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system49.Button, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => setOpen(false), children: "Cancel" }) }) : null
|
|
15001
15002
|
] })
|
|
15002
15003
|
) : null,
|
|
15003
15004
|
children: anchored ? cellChips : null
|
|
@@ -15017,7 +15018,7 @@ function RecordChip({
|
|
|
15017
15018
|
// name. So it caps at its container and ends in an ellipsis with the whole name in
|
|
15018
15019
|
// its tooltip, rather than being cut mid-word by whatever box it landed in
|
|
15019
15020
|
// (lane FIX-14, 2026-09-22).
|
|
15020
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
15021
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_design_system49.Badge, { variant: "secondary", className: (0, import_design_system49.cn)("max-w-full gap-1 text-[11px]", className), title, children: [
|
|
15021
15022
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "min-w-0 truncate", children: title }),
|
|
15022
15023
|
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${title}`, className: "shrink-0 opacity-60 hover:opacity-100", children: "\xD7" }) : null
|
|
15023
15024
|
] })
|
|
@@ -15072,7 +15073,7 @@ function ChoiceAnswer({
|
|
|
15072
15073
|
tabIndex: field.multi || choice.key === tabStop ? 0 : -1,
|
|
15073
15074
|
onClick: () => press(choice),
|
|
15074
15075
|
"data-records-choice-answer": choice.key,
|
|
15075
|
-
className: (0,
|
|
15076
|
+
className: (0, import_design_system49.cn)(
|
|
15076
15077
|
"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",
|
|
15077
15078
|
chosen ? "border-primary bg-primary/10" : "border-primary/30 bg-primary/[0.03] hover:bg-primary/10"
|
|
15078
15079
|
),
|
|
@@ -15081,7 +15082,7 @@ function ChoiceAnswer({
|
|
|
15081
15082
|
"kbd",
|
|
15082
15083
|
{
|
|
15083
15084
|
"aria-hidden": "true",
|
|
15084
|
-
className: (0,
|
|
15085
|
+
className: (0, import_design_system49.cn)(
|
|
15085
15086
|
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded border font-sans text-xs font-semibold",
|
|
15086
15087
|
chosen ? "border-primary bg-primary text-primary-foreground" : "border-primary/40 text-primary"
|
|
15087
15088
|
),
|
|
@@ -15128,7 +15129,7 @@ function ChoiceAnswer({
|
|
|
15128
15129
|
const shown2 = q === "" ? choices : choices.filter((c) => c.label.toLowerCase().includes(q));
|
|
15129
15130
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { id, className: "flex w-full flex-col gap-2", onKeyDown, children: [
|
|
15130
15131
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
15131
|
-
|
|
15132
|
+
import_design_system49.BasicInput,
|
|
15132
15133
|
{
|
|
15133
15134
|
value: search,
|
|
15134
15135
|
onChange: (e) => setSearch(e.target.value),
|
|
@@ -15232,7 +15233,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
|
|
|
15232
15233
|
const secondOf = (r) => [r.created_by_name ? `by ${r.created_by_name}` : null, r.updated_at ? `changed ${new Date(r.updated_at).toLocaleDateString(void 0, (0, import_field_formats13.momentZoneOptions)(r.updated_at))}` : null].filter(Boolean).join(" \xB7 ");
|
|
15233
15234
|
const base = secondOf(row);
|
|
15234
15235
|
const alike = options.filter((o) => o.organization_id === t.organization_id && o.table_name.trim().toLowerCase() === t.table_name.trim().toLowerCase() && secondOf(o) === base).length;
|
|
15235
|
-
const second = alike > 1 ? [base, `#${(0,
|
|
15236
|
+
const second = alike > 1 ? [base, `#${(0, import_design_system50.displayId)(t.table_id)}`].filter(Boolean).join(" \xB7 ") : base;
|
|
15236
15237
|
return {
|
|
15237
15238
|
value: t.table_id,
|
|
15238
15239
|
// The organization hint already tells two same-named tables apart across organizations.
|
|
@@ -15250,7 +15251,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
|
|
|
15250
15251
|
const missing = Boolean(value) && !list.loading && !list.error && !list.rows.some((t) => t.table_id === value);
|
|
15251
15252
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
15252
15253
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
15253
|
-
|
|
15254
|
+
import_design_system50.CreatablePicker,
|
|
15254
15255
|
{
|
|
15255
15256
|
value: value || null,
|
|
15256
15257
|
options: pickerOptions,
|
|
@@ -15330,7 +15331,7 @@ function ColumnValuesEditor({ tableId, value, onChange, disabled, addLabel }) {
|
|
|
15330
15331
|
onRemove: () => setAdding(false)
|
|
15331
15332
|
}
|
|
15332
15333
|
),
|
|
15333
|
-
!disabled && !adding && keys.length < all.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
15334
|
+
!disabled && !adding && keys.length < all.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system50.Button, { type: "button", variant: "outline", size: "sm", className: "self-start", onClick: () => setAdding(true), children: addLabel })
|
|
15334
15335
|
] });
|
|
15335
15336
|
}
|
|
15336
15337
|
function ColumnValueRow({
|
|
@@ -15349,7 +15350,7 @@ function ColumnValueRow({
|
|
|
15349
15350
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col gap-1 rounded-md border border-border/60 p-2", children: [
|
|
15350
15351
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
15351
15352
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
15352
|
-
|
|
15353
|
+
import_design_system50.CreatablePicker,
|
|
15353
15354
|
{
|
|
15354
15355
|
value: columnKey,
|
|
15355
15356
|
options: shown2,
|
|
@@ -15362,7 +15363,7 @@ function ColumnValueRow({
|
|
|
15362
15363
|
ariaLabel: "Column"
|
|
15363
15364
|
}
|
|
15364
15365
|
) }),
|
|
15365
|
-
!disabled && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
15366
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system50.Button, { type: "button", variant: "ghost", size: "sm", "aria-label": "Remove", onClick: onRemove, children: "\u2715" })
|
|
15366
15367
|
] }),
|
|
15367
15368
|
field ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FieldControl, { field, value, onChange: onValue, disabled }) : orphan ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-[11px] text-muted-foreground", children: value === null || value === void 0 ? "\u2014" : String(value) }) : null
|
|
15368
15369
|
] });
|
|
@@ -15378,7 +15379,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
|
|
|
15378
15379
|
const missing = Boolean(value) && !records.loading && !records.error && !rows.some((r) => r.id === value);
|
|
15379
15380
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
15380
15381
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
15381
|
-
|
|
15382
|
+
import_design_system50.CreatablePicker,
|
|
15382
15383
|
{
|
|
15383
15384
|
value: value || null,
|
|
15384
15385
|
options,
|
|
@@ -15399,7 +15400,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
|
|
|
15399
15400
|
var import_react84 = require("react");
|
|
15400
15401
|
var import_records30 = require("@ai-matrx/records");
|
|
15401
15402
|
var import_react85 = require("@ai-matrx/records/react");
|
|
15402
|
-
var
|
|
15403
|
+
var import_design_system51 = require("@ai-matrx/design-system");
|
|
15403
15404
|
init_names();
|
|
15404
15405
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
15405
15406
|
var DATA_BINDING_SHAPES = [
|
|
@@ -15536,7 +15537,7 @@ function BindingDetails({
|
|
|
15536
15537
|
const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
|
|
15537
15538
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
15538
15539
|
/* @__PURE__ */ (0, import_jsx_runtime57.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_runtime57.jsx)(
|
|
15539
|
-
|
|
15540
|
+
import_design_system51.Button,
|
|
15540
15541
|
{
|
|
15541
15542
|
type: "button",
|
|
15542
15543
|
size: "sm",
|
|
@@ -15559,7 +15560,7 @@ function BindingDetails({
|
|
|
15559
15560
|
}
|
|
15560
15561
|
),
|
|
15561
15562
|
shape === "value" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
15562
|
-
|
|
15563
|
+
import_design_system51.CreatablePicker,
|
|
15563
15564
|
{
|
|
15564
15565
|
value: binding.field_key ?? null,
|
|
15565
15566
|
options: fieldOptions,
|
|
@@ -15576,7 +15577,7 @@ function BindingDetails({
|
|
|
15576
15577
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
15577
15578
|
"textarea",
|
|
15578
15579
|
{
|
|
15579
|
-
className: (0,
|
|
15580
|
+
className: (0, import_design_system51.cn)(
|
|
15580
15581
|
"min-h-[3.5rem] w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs"
|
|
15581
15582
|
),
|
|
15582
15583
|
"aria-label": "Each row reads as",
|
|
@@ -15586,7 +15587,7 @@ function BindingDetails({
|
|
|
15586
15587
|
}
|
|
15587
15588
|
),
|
|
15588
15589
|
!disabled && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
15589
|
-
|
|
15590
|
+
import_design_system51.Button,
|
|
15590
15591
|
{
|
|
15591
15592
|
type: "button",
|
|
15592
15593
|
size: "sm",
|
|
@@ -15601,7 +15602,7 @@ function BindingDetails({
|
|
|
15601
15602
|
shape === "collection" && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
15602
15603
|
"Up to",
|
|
15603
15604
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
15604
|
-
|
|
15605
|
+
import_design_system51.BasicInput,
|
|
15605
15606
|
{
|
|
15606
15607
|
type: "number",
|
|
15607
15608
|
min: 1,
|
|
@@ -15620,7 +15621,7 @@ function BindingDetails({
|
|
|
15620
15621
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
|
|
15621
15622
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
|
|
15622
15623
|
DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
15623
|
-
|
|
15624
|
+
import_design_system51.Button,
|
|
15624
15625
|
{
|
|
15625
15626
|
type: "button",
|
|
15626
15627
|
size: "sm",
|
|
@@ -15718,7 +15719,7 @@ function RecordNameWords({ tableId, recordId }) {
|
|
|
15718
15719
|
// src/HeldChangeDecision.tsx
|
|
15719
15720
|
var import_react87 = require("react");
|
|
15720
15721
|
var import_react88 = require("@ai-matrx/records/react");
|
|
15721
|
-
var
|
|
15722
|
+
var import_design_system52 = require("@ai-matrx/design-system");
|
|
15722
15723
|
init_Refusal();
|
|
15723
15724
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
15724
15725
|
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
|
|
@@ -15758,8 +15759,8 @@ function Decision({
|
|
|
15758
15759
|
if (may === null) return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
|
|
15759
15760
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
15760
15761
|
may ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex gap-2", children: [
|
|
15761
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
15762
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
15762
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_design_system52.Button, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
|
|
15763
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_design_system52.Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
|
|
15763
15764
|
] }) : !error && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
|
|
15764
15765
|
error ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RefusalLine, { error }) : null
|
|
15765
15766
|
] });
|