@ai-matrx/records-ui 0.115.73 → 0.115.75
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 +23 -0
- package/dist/index.cjs +689 -510
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +691 -512
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -25702,6 +25702,7 @@ function GridBody({
|
|
|
25702
25702
|
onOpenRecord,
|
|
25703
25703
|
openRecordId = null,
|
|
25704
25704
|
onCloseRecord,
|
|
25705
|
+
onRowsShown,
|
|
25705
25706
|
onAddField,
|
|
25706
25707
|
onNewRecordForm,
|
|
25707
25708
|
toolbarActions,
|
|
@@ -25982,6 +25983,11 @@ function GridBody({
|
|
|
25982
25983
|
const rows = added.rows;
|
|
25983
25984
|
const lockedRows = records.data?.locked ?? 0;
|
|
25984
25985
|
const rowIds = (0, import_react143.useMemo)(() => rows.map((row) => row.id), [rows]);
|
|
25986
|
+
const rowsShownRef = (0, import_react143.useRef)(onRowsShown);
|
|
25987
|
+
rowsShownRef.current = onRowsShown;
|
|
25988
|
+
(0, import_react143.useEffect)(() => {
|
|
25989
|
+
rowsShownRef.current?.(rowIds);
|
|
25990
|
+
}, [rowIds]);
|
|
25985
25991
|
const countedButNotReturned = !records.error && !records.loading && rows.length === 0 && typeof records.data?.total === "number" && records.data.total > 0 && (storePaged ? query.page <= 1 : page <= 0);
|
|
25986
25992
|
const reReads = (0, import_react143.useRef)(0);
|
|
25987
25993
|
const reloadRecords = (0, import_react143.useRef)(records.reload);
|
|
@@ -29393,6 +29399,7 @@ var import_react158 = require("@ai-matrx/records/react");
|
|
|
29393
29399
|
var import_format8 = require("@ai-matrx/kit/format");
|
|
29394
29400
|
var import_records48 = require("@ai-matrx/records");
|
|
29395
29401
|
var import_design_system79 = require("@ai-matrx/design-system");
|
|
29402
|
+
var import_controls2 = require("@ai-matrx/design-system/controls");
|
|
29396
29403
|
|
|
29397
29404
|
// src/publicQuestions.ts
|
|
29398
29405
|
var CANNOT_ASK = {
|
|
@@ -29695,39 +29702,39 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
29695
29702
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
29696
29703
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_design_system79.Label, { className: "text-xs font-medium", children: "How long one appointment is" }),
|
|
29697
29704
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
29698
|
-
|
|
29705
|
+
import_controls2.Select,
|
|
29699
29706
|
{
|
|
29700
|
-
|
|
29701
|
-
value: minutes,
|
|
29702
|
-
|
|
29703
|
-
|
|
29704
|
-
n,
|
|
29705
|
-
" minutes"
|
|
29706
|
-
] }, n))
|
|
29707
|
+
"aria-label": "How long one appointment is",
|
|
29708
|
+
value: String(minutes),
|
|
29709
|
+
onValueChange: (v) => setMinutes(Number(v)),
|
|
29710
|
+
options: LENGTHS.map((n) => ({ value: String(n), label: `${n} minutes` }))
|
|
29707
29711
|
}
|
|
29708
29712
|
)
|
|
29709
29713
|
] }),
|
|
29710
29714
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
29711
29715
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_design_system79.Label, { className: "text-xs font-medium", children: "Gap kept after each one" }),
|
|
29712
29716
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
29713
|
-
|
|
29717
|
+
import_controls2.Select,
|
|
29714
29718
|
{
|
|
29715
|
-
|
|
29716
|
-
value: buffer,
|
|
29717
|
-
|
|
29718
|
-
|
|
29719
|
+
"aria-label": "Gap kept after each one",
|
|
29720
|
+
value: String(buffer),
|
|
29721
|
+
onValueChange: (v) => setBuffer(Number(v)),
|
|
29722
|
+
options: [0, 5, 10, 15, 30].map((n) => ({ value: String(n), label: n === 0 ? "No gap \u2014 back to back" : `${n} minutes` }))
|
|
29719
29723
|
}
|
|
29720
29724
|
)
|
|
29721
29725
|
] }),
|
|
29722
29726
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
29723
29727
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_design_system79.Label, { className: "text-xs font-medium", children: "Earliest somebody may book" }),
|
|
29724
29728
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
29725
|
-
|
|
29729
|
+
import_controls2.Select,
|
|
29726
29730
|
{
|
|
29727
|
-
|
|
29728
|
-
value: lead,
|
|
29729
|
-
|
|
29730
|
-
|
|
29731
|
+
"aria-label": "Earliest somebody may book",
|
|
29732
|
+
value: String(lead),
|
|
29733
|
+
onValueChange: (v) => setLead(Number(v)),
|
|
29734
|
+
options: [0, 60, 120, 240, 1440].map((n) => ({
|
|
29735
|
+
value: String(n),
|
|
29736
|
+
label: n === 0 ? "Right away" : n === 1440 ? "A day from now" : `${(0, import_format8.formatDurationMinutes)(n, { style: "long" })} from now`
|
|
29737
|
+
}))
|
|
29731
29738
|
}
|
|
29732
29739
|
)
|
|
29733
29740
|
] }),
|
|
@@ -29746,15 +29753,12 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
29746
29753
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
29747
29754
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_design_system79.Label, { className: "text-xs font-medium", children: "How far ahead the page offers" }),
|
|
29748
29755
|
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
29749
|
-
|
|
29756
|
+
import_controls2.Select,
|
|
29750
29757
|
{
|
|
29751
|
-
|
|
29752
|
-
value: days,
|
|
29753
|
-
|
|
29754
|
-
|
|
29755
|
-
n,
|
|
29756
|
-
" days"
|
|
29757
|
-
] }, n))
|
|
29758
|
+
"aria-label": "How far ahead the page offers",
|
|
29759
|
+
value: String(days),
|
|
29760
|
+
onValueChange: (v) => setDays(Number(v)),
|
|
29761
|
+
options: [7, 14, 30, 60, 90].map((n) => ({ value: String(n), label: `${n} days` }))
|
|
29758
29762
|
}
|
|
29759
29763
|
)
|
|
29760
29764
|
] }),
|
|
@@ -31237,6 +31241,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
31237
31241
|
var import_react169 = require("react");
|
|
31238
31242
|
var import_react170 = require("@ai-matrx/records/react");
|
|
31239
31243
|
var import_design_system86 = require("@ai-matrx/design-system");
|
|
31244
|
+
var import_controls3 = require("@ai-matrx/design-system/controls");
|
|
31240
31245
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
31241
31246
|
var NO_RULES_YET = "Nothing has to be true to get here yet.";
|
|
31242
31247
|
var NEEDS_A_SENTENCE = "Write the sentence somebody reads when this stops them, the way you would say it out loud.";
|
|
@@ -31367,16 +31372,15 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
31367
31372
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
31368
31373
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "font-medium", children: "Rules for entering" }),
|
|
31369
31374
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
31370
|
-
|
|
31375
|
+
import_controls3.Select,
|
|
31371
31376
|
{
|
|
31372
31377
|
"aria-label": "Stage",
|
|
31373
|
-
className: "h-7 rounded border bg-background px-1 text-xs",
|
|
31374
31378
|
value: stageKey ?? "",
|
|
31375
|
-
|
|
31376
|
-
setChosen(
|
|
31379
|
+
onValueChange: (v) => {
|
|
31380
|
+
setChosen(v);
|
|
31377
31381
|
setDraft(null);
|
|
31378
31382
|
},
|
|
31379
|
-
|
|
31383
|
+
options: stages.filter((s) => !s.retired).map((s) => ({ value: s.key, label: s.label }))
|
|
31380
31384
|
}
|
|
31381
31385
|
),
|
|
31382
31386
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "text-muted-foreground", children: gates.length }),
|
|
@@ -31444,13 +31448,12 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
31444
31448
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
31445
31449
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "text-muted-foreground", children: "and when it does not" }),
|
|
31446
31450
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
31447
|
-
|
|
31451
|
+
import_controls3.Select,
|
|
31448
31452
|
{
|
|
31449
31453
|
"aria-label": "What happens",
|
|
31450
|
-
className: "h-8 rounded border bg-background px-1 text-xs",
|
|
31451
31454
|
value: draft.on_fail ?? "refuse",
|
|
31452
|
-
|
|
31453
|
-
|
|
31455
|
+
onValueChange: (on_fail) => setDraft({ ...draft, on_fail }),
|
|
31456
|
+
options: ON_FAIL.map((o) => ({ value: o.value, label: o.label }))
|
|
31454
31457
|
}
|
|
31455
31458
|
),
|
|
31456
31459
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "text-muted-foreground", children: ON_FAIL.find((o) => o.value === (draft.on_fail ?? "refuse"))?.note })
|
|
@@ -38280,6 +38283,7 @@ function ViewSwitcher({
|
|
|
38280
38283
|
onOpenRecord,
|
|
38281
38284
|
openRecordId,
|
|
38282
38285
|
onCloseRecord,
|
|
38286
|
+
onRowsShown,
|
|
38283
38287
|
onMoved,
|
|
38284
38288
|
onNewRecordForm,
|
|
38285
38289
|
onAskWhoChanged,
|
|
@@ -38357,6 +38361,7 @@ function ViewSwitcher({
|
|
|
38357
38361
|
...onOpenRecord ? { onOpenRecord } : {},
|
|
38358
38362
|
...openRecordId ? { openRecordId } : {},
|
|
38359
38363
|
...onCloseRecord ? { onCloseRecord } : {},
|
|
38364
|
+
...onRowsShown ? { onRowsShown } : {},
|
|
38360
38365
|
...onNewRecordForm ? { onNewRecordForm } : {},
|
|
38361
38366
|
...onAskWhoChanged ? { onAskWhoChanged } : {},
|
|
38362
38367
|
...viewId ? {
|
|
@@ -39716,7 +39721,7 @@ function ArchivedPortals({
|
|
|
39716
39721
|
var import_react231 = require("react");
|
|
39717
39722
|
var import_react232 = require("@ai-matrx/records/react");
|
|
39718
39723
|
var import_design_system112 = require("@ai-matrx/design-system");
|
|
39719
|
-
var
|
|
39724
|
+
var import_controls4 = require("@ai-matrx/design-system/controls");
|
|
39720
39725
|
var import_core22 = require("@dnd-kit/core");
|
|
39721
39726
|
var import_sortable = require("@dnd-kit/sortable");
|
|
39722
39727
|
var import_utilities = require("@dnd-kit/utilities");
|
|
@@ -40115,7 +40120,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40115
40120
|
}
|
|
40116
40121
|
) : /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "group flex min-h-7 items-center gap-1 px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: [
|
|
40117
40122
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
40118
|
-
|
|
40123
|
+
import_controls4.Button,
|
|
40119
40124
|
{
|
|
40120
40125
|
variant: "quiet",
|
|
40121
40126
|
className: "min-w-0 flex-1 justify-start gap-1 px-0",
|
|
@@ -40130,12 +40135,12 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40130
40135
|
}
|
|
40131
40136
|
),
|
|
40132
40137
|
rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
|
|
40133
|
-
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40134
|
-
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40138
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_controls4.Button, { variant: "quiet", className: "shrink-0 normal-case", "data-view-section-rename": "", onClick: () => setRenamingSection({ from: group.name, draft: group.name }), children: "Rename" }),
|
|
40139
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_controls4.Button, { variant: "danger", className: "shrink-0 normal-case", "data-view-section-delete": "", title: "The views stay; they leave the section", onClick: () => void renameSection(group.name, null), children: "Delete" })
|
|
40135
40140
|
] }) : null
|
|
40136
40141
|
] }) : null,
|
|
40137
40142
|
group.name !== null && shut.includes(group.name) && !group.views.some((v) => v.id === active) ? null : group.views.map((view) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SortableRow, { id: view.id, disabled: !(rights.admin || view.personal) || view.presentation?.locked === true, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40138
|
-
|
|
40143
|
+
import_controls4.Tile,
|
|
40139
40144
|
{
|
|
40140
40145
|
variant: "quiet",
|
|
40141
40146
|
selected: view.id === active,
|
|
@@ -40182,7 +40187,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40182
40187
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_design_system112.Button, { size: "sm", type: "submit", className: "h-7", children: "Save" })
|
|
40183
40188
|
] }),
|
|
40184
40189
|
rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("label", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
40185
|
-
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40190
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_controls4.Switch, { checked: namingPersonal, onCheckedChange: setNamingPersonal, "data-view-new-personal": "" }),
|
|
40186
40191
|
"Personal (only you see it)"
|
|
40187
40192
|
] }) : null
|
|
40188
40193
|
]
|
|
@@ -40194,8 +40199,8 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40194
40199
|
current.name,
|
|
40195
40200
|
"\u201D to"
|
|
40196
40201
|
] }),
|
|
40197
|
-
(0, import_views2.sectionNames)(views).map((name) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40198
|
-
current.section ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40202
|
+
(0, import_views2.sectionNames)(views).map((name) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_controls4.Tile, { variant: "quiet", disabled: current.section === name, title: name, onClick: () => void moveToSection(current, name) }, name)),
|
|
40203
|
+
current.section ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_controls4.Tile, { variant: "quiet", "data-view-section-none": "", title: "No section", onClick: () => void moveToSection(current, null) }) : null,
|
|
40199
40204
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
40200
40205
|
"form",
|
|
40201
40206
|
{
|
|
@@ -40255,7 +40260,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40255
40260
|
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
|
|
40256
40261
|
reasons.map((reason) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "truncate px-2 py-1 text-xs text-muted-foreground", "data-view-actions-reason": "", title: reason, children: reason }, reason)),
|
|
40257
40262
|
actions.map((action3) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40258
|
-
|
|
40263
|
+
import_controls4.Tile,
|
|
40259
40264
|
{
|
|
40260
40265
|
variant: "quiet",
|
|
40261
40266
|
...action3.destructive ? { danger: true } : {},
|
|
@@ -40393,6 +40398,7 @@ var import_format11 = require("@ai-matrx/kit/format");
|
|
|
40393
40398
|
var import_react236 = require("react");
|
|
40394
40399
|
var import_react237 = require("@ai-matrx/records/react");
|
|
40395
40400
|
var import_design_system114 = require("@ai-matrx/design-system");
|
|
40401
|
+
var import_controls5 = require("@ai-matrx/design-system/controls");
|
|
40396
40402
|
var import_text_case15 = require("@ai-matrx/kit/text-case");
|
|
40397
40403
|
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
40398
40404
|
var DUE_WORD = DUE_STATE_LABEL;
|
|
@@ -40544,16 +40550,13 @@ function ChecklistRunner({
|
|
|
40544
40550
|
active.overdue > 0 ? ` \xB7 ${active.overdue} overdue` : ""
|
|
40545
40551
|
] }) : null,
|
|
40546
40552
|
runs && runs.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
40547
|
-
|
|
40553
|
+
import_controls5.Select,
|
|
40548
40554
|
{
|
|
40549
40555
|
"aria-label": "Checklist run",
|
|
40550
|
-
className: "ml-auto
|
|
40556
|
+
className: "ml-auto",
|
|
40551
40557
|
value: activeId ?? "",
|
|
40552
|
-
|
|
40553
|
-
|
|
40554
|
-
r.name,
|
|
40555
|
-
r.about ? ` \u2014 ${r.about}` : ""
|
|
40556
|
-
] }, r.run_id))
|
|
40558
|
+
onValueChange: (v) => setActiveId(v),
|
|
40559
|
+
options: runs.map((r) => ({ value: r.run_id, label: `${r.name}${r.about ? ` \u2014 ${r.about}` : ""}` }))
|
|
40557
40560
|
}
|
|
40558
40561
|
) : null
|
|
40559
40562
|
] }),
|
|
@@ -40636,19 +40639,18 @@ function StepRow({
|
|
|
40636
40639
|
] }),
|
|
40637
40640
|
unassigned && onAssign && members && members.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("label", { className: "mt-1 flex items-center gap-1.5 pl-7 text-[11px] text-muted-foreground", children: [
|
|
40638
40641
|
"Give it to",
|
|
40639
|
-
/* @__PURE__ */ (0, import_jsx_runtime133.
|
|
40640
|
-
|
|
40642
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
40643
|
+
import_controls5.Select,
|
|
40641
40644
|
{
|
|
40642
|
-
className: "h-7 rounded border bg-background px-1 text-xs text-foreground",
|
|
40643
40645
|
"aria-label": `Give ${step2.title} to`,
|
|
40644
40646
|
value: "",
|
|
40645
40647
|
disabled: busy,
|
|
40646
|
-
|
|
40647
|
-
if (
|
|
40648
|
+
onValueChange: (v) => {
|
|
40649
|
+
if (v) onAssign(v);
|
|
40648
40650
|
},
|
|
40649
|
-
|
|
40650
|
-
|
|
40651
|
-
members.map((m) =>
|
|
40651
|
+
options: [
|
|
40652
|
+
{ value: "", label: "Choose a person" },
|
|
40653
|
+
...members.map((m) => ({ value: m.userId, label: m.name || m.email || "A member" }))
|
|
40652
40654
|
]
|
|
40653
40655
|
}
|
|
40654
40656
|
)
|
|
@@ -41126,13 +41128,12 @@ function ChecklistTemplateEditor({
|
|
|
41126
41128
|
}
|
|
41127
41129
|
),
|
|
41128
41130
|
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
41129
|
-
|
|
41131
|
+
import_controls5.Select,
|
|
41130
41132
|
{
|
|
41131
41133
|
"aria-label": `Step ${index + 1} asks for`,
|
|
41132
|
-
className: "h-7 rounded border bg-background px-1 text-xs",
|
|
41133
41134
|
value: row.requires,
|
|
41134
|
-
|
|
41135
|
-
|
|
41135
|
+
onValueChange: (v) => change(index, { requires: v }),
|
|
41136
|
+
options: REQUIRES_KINDS.map((kind) => ({ value: kind, label: kind === "none" ? "just a tick" : REQUIRES_WORD[kind] ?? kind }))
|
|
41136
41137
|
}
|
|
41137
41138
|
),
|
|
41138
41139
|
row.requires === "answer" || row.requires === "record_field" ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
@@ -42077,7 +42078,7 @@ var import_react240 = require("react");
|
|
|
42077
42078
|
var import_records64 = require("@ai-matrx/records");
|
|
42078
42079
|
var import_react241 = require("@ai-matrx/records/react");
|
|
42079
42080
|
var import_design_system116 = require("@ai-matrx/design-system");
|
|
42080
|
-
var
|
|
42081
|
+
var import_controls6 = require("@ai-matrx/design-system/controls");
|
|
42081
42082
|
var import_text_case16 = require("@ai-matrx/kit/text-case");
|
|
42082
42083
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
42083
42084
|
function endOfDayIso(day2, zone = getPersonTimeZone()) {
|
|
@@ -42118,7 +42119,7 @@ function AsOfControl({ value, onChange, className }) {
|
|
|
42118
42119
|
}
|
|
42119
42120
|
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: (0, import_design_system116.cn)("flex h-6 items-center gap-1", className), "data-records-as-of": "", children: [
|
|
42120
42121
|
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
42121
|
-
|
|
42122
|
+
import_controls6.Field,
|
|
42122
42123
|
{
|
|
42123
42124
|
type: "text",
|
|
42124
42125
|
inputMode: "numeric",
|
|
@@ -42148,7 +42149,7 @@ function AsOfControl({ value, onChange, className }) {
|
|
|
42148
42149
|
}
|
|
42149
42150
|
),
|
|
42150
42151
|
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { role: "group", "aria-label": "Clock", className: "flex overflow-hidden rounded border text-[11px]", children: ["recorded", "world"].map((which) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
42151
|
-
|
|
42152
|
+
import_controls6.Button,
|
|
42152
42153
|
{
|
|
42153
42154
|
variant: clock === which ? "primary" : "quiet",
|
|
42154
42155
|
pressed: clock === which,
|
|
@@ -43317,6 +43318,7 @@ function FormResultsPanel({ form, className }) {
|
|
|
43317
43318
|
var import_react252 = require("react");
|
|
43318
43319
|
var import_react253 = require("@ai-matrx/records/react");
|
|
43319
43320
|
var import_design_system122 = require("@ai-matrx/design-system");
|
|
43321
|
+
var import_controls7 = require("@ai-matrx/design-system/controls");
|
|
43320
43322
|
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
43321
43323
|
var RESTATING_REPLACES = "Saving replaces what this portal shows: a table you untick stops being visible to every client the moment you save. Who is invited is not touched.";
|
|
43322
43324
|
function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
@@ -43523,15 +43525,15 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
|
43523
43525
|
] }),
|
|
43524
43526
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
43525
43527
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_design_system122.Label, { className: "text-xs font-medium", children: "Which table holds your clients" }),
|
|
43526
|
-
/* @__PURE__ */ (0, import_jsx_runtime141.
|
|
43527
|
-
|
|
43528
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
43529
|
+
import_controls7.Select,
|
|
43528
43530
|
{
|
|
43529
|
-
|
|
43531
|
+
"aria-label": "Which table holds your clients",
|
|
43530
43532
|
value: clientTableId ?? "",
|
|
43531
|
-
|
|
43532
|
-
|
|
43533
|
-
|
|
43534
|
-
all.map((t) =>
|
|
43533
|
+
onValueChange: (v) => setClientTableId(v || null),
|
|
43534
|
+
options: [
|
|
43535
|
+
{ value: "", label: "Pick the table whose records are the people signing in" },
|
|
43536
|
+
...all.map((t) => ({ value: t.id, label: t.name }))
|
|
43535
43537
|
]
|
|
43536
43538
|
}
|
|
43537
43539
|
),
|
|
@@ -43576,15 +43578,15 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
|
43576
43578
|
) : /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
43577
43579
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
43578
43580
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_design_system122.Label, { className: "text-xs font-medium", children: "Which field says whose row it is" }),
|
|
43579
|
-
/* @__PURE__ */ (0, import_jsx_runtime141.
|
|
43580
|
-
|
|
43581
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
43582
|
+
import_controls7.Select,
|
|
43581
43583
|
{
|
|
43582
|
-
|
|
43584
|
+
"aria-label": "Which field says whose row it is",
|
|
43583
43585
|
value: exposure?.namesVia ?? "",
|
|
43584
|
-
|
|
43585
|
-
|
|
43586
|
-
|
|
43587
|
-
ties.map((f) =>
|
|
43586
|
+
onValueChange: (v) => patch(t.id, { namesVia: v }),
|
|
43587
|
+
options: [
|
|
43588
|
+
{ value: "", label: "Pick the field that names the client" },
|
|
43589
|
+
...ties.map((f) => ({ value: f.key, label: fieldName(f) }))
|
|
43588
43590
|
]
|
|
43589
43591
|
}
|
|
43590
43592
|
)
|
|
@@ -44812,6 +44814,7 @@ var import_react258 = require("react");
|
|
|
44812
44814
|
var import_react259 = require("@ai-matrx/records/react");
|
|
44813
44815
|
var import_records66 = require("@ai-matrx/records");
|
|
44814
44816
|
var import_design_system127 = require("@ai-matrx/design-system");
|
|
44817
|
+
var import_controls8 = require("@ai-matrx/design-system/controls");
|
|
44815
44818
|
|
|
44816
44819
|
// src/scheduleWords.ts
|
|
44817
44820
|
var DAYS3 = {
|
|
@@ -45015,15 +45018,15 @@ function DigestScheduler({
|
|
|
45015
45018
|
] }),
|
|
45016
45019
|
savedViewId ? null : /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
45017
45020
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_design_system127.Label, { className: "text-xs font-medium", children: "What it summarises" }),
|
|
45018
|
-
/* @__PURE__ */ (0, import_jsx_runtime146.
|
|
45019
|
-
|
|
45021
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
45022
|
+
import_controls8.Select,
|
|
45020
45023
|
{
|
|
45021
|
-
|
|
45024
|
+
"aria-label": "What it summarises",
|
|
45022
45025
|
value: viewId,
|
|
45023
|
-
|
|
45024
|
-
|
|
45025
|
-
|
|
45026
|
-
(views ?? []).map((v) =>
|
|
45026
|
+
onValueChange: setViewId,
|
|
45027
|
+
options: [
|
|
45028
|
+
{ value: "new", label: subjectName?.trim() ? `What I am looking at now (${subjectName.trim()})` : "What I am looking at now" },
|
|
45029
|
+
...(views ?? []).map((v) => ({ value: v.view_id, label: v.name }))
|
|
45027
45030
|
]
|
|
45028
45031
|
}
|
|
45029
45032
|
),
|
|
@@ -45033,24 +45036,27 @@ function DigestScheduler({
|
|
|
45033
45036
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
45034
45037
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_design_system127.Label, { className: "text-xs font-medium", children: "How often" }),
|
|
45035
45038
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
45036
|
-
|
|
45039
|
+
import_controls8.Select,
|
|
45037
45040
|
{
|
|
45038
|
-
|
|
45041
|
+
"aria-label": "How often",
|
|
45039
45042
|
value: cadence,
|
|
45040
|
-
|
|
45041
|
-
|
|
45043
|
+
onValueChange: (c) => setCadence(c),
|
|
45044
|
+
options: (cadences.length > 0 ? cadences : ["hourly", "daily", "weekly"]).map((c) => ({
|
|
45045
|
+
value: c,
|
|
45046
|
+
label: CADENCE_WORDS[c] ?? c
|
|
45047
|
+
}))
|
|
45042
45048
|
}
|
|
45043
45049
|
)
|
|
45044
45050
|
] }),
|
|
45045
45051
|
cadence === "weekly" ? /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
45046
45052
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_design_system127.Label, { className: "text-xs font-medium", children: "Which day" }),
|
|
45047
45053
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
45048
|
-
|
|
45054
|
+
import_controls8.Select,
|
|
45049
45055
|
{
|
|
45050
|
-
|
|
45056
|
+
"aria-label": "Which day",
|
|
45051
45057
|
value: weekday,
|
|
45052
|
-
|
|
45053
|
-
|
|
45058
|
+
onValueChange: setWeekday,
|
|
45059
|
+
options: WEEKDAYS.map((d) => ({ value: d, label: d[0].toUpperCase() + d.slice(1) }))
|
|
45054
45060
|
}
|
|
45055
45061
|
)
|
|
45056
45062
|
] }) : null,
|
|
@@ -45074,12 +45080,12 @@ function DigestScheduler({
|
|
|
45074
45080
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
45075
45081
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_design_system127.Label, { className: "text-xs font-medium", children: "Where it arrives" }),
|
|
45076
45082
|
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
45077
|
-
|
|
45083
|
+
import_controls8.Select,
|
|
45078
45084
|
{
|
|
45079
|
-
|
|
45085
|
+
"aria-label": "Where it arrives",
|
|
45080
45086
|
value: channel,
|
|
45081
|
-
|
|
45082
|
-
|
|
45087
|
+
onValueChange: setChannel,
|
|
45088
|
+
options: Object.entries(CHANNEL_WORDS).map(([key, words2]) => ({ value: key, label: words2 }))
|
|
45083
45089
|
}
|
|
45084
45090
|
)
|
|
45085
45091
|
] })
|
|
@@ -45611,6 +45617,7 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
|
|
|
45611
45617
|
// src/FormBuilder.tsx
|
|
45612
45618
|
var import_clipboard10 = require("@ai-matrx/kit/clipboard");
|
|
45613
45619
|
var import_design_system132 = require("@ai-matrx/design-system");
|
|
45620
|
+
var import_controls9 = require("@ai-matrx/design-system/controls");
|
|
45614
45621
|
var import_react267 = require("react");
|
|
45615
45622
|
var import_core23 = require("@dnd-kit/core");
|
|
45616
45623
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
@@ -47057,12 +47064,15 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
47057
47064
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
47058
47065
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_design_system133.Label, { className: "text-xs font-medium", children: "Flow" }),
|
|
47059
47066
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
47060
|
-
|
|
47067
|
+
import_controls9.Select,
|
|
47061
47068
|
{
|
|
47062
|
-
|
|
47069
|
+
"aria-label": "Flow",
|
|
47063
47070
|
value: draft.flow ?? "one-at-a-time",
|
|
47064
|
-
|
|
47065
|
-
|
|
47071
|
+
onValueChange: (flow) => patch({ flow }),
|
|
47072
|
+
options: import_forms3.FORM_FLOWS.map((flow) => ({
|
|
47073
|
+
value: flow,
|
|
47074
|
+
label: flow === "one-at-a-time" ? "One question at a time" : "All on one page"
|
|
47075
|
+
}))
|
|
47066
47076
|
}
|
|
47067
47077
|
)
|
|
47068
47078
|
] }),
|
|
@@ -48008,6 +48018,7 @@ var import_react276 = require("react");
|
|
|
48008
48018
|
var import_react277 = require("@ai-matrx/records/react");
|
|
48009
48019
|
var import_records69 = require("@ai-matrx/records");
|
|
48010
48020
|
var import_design_system137 = require("@ai-matrx/design-system");
|
|
48021
|
+
var import_controls10 = require("@ai-matrx/design-system/controls");
|
|
48011
48022
|
var import_jsx_runtime155 = require("react/jsx-runtime");
|
|
48012
48023
|
var CADENCE_WORDS2 = SUBSCRIPTION_CADENCE_LABEL;
|
|
48013
48024
|
var CHANNEL_WORDS3 = SUBSCRIPTION_CHANNEL_LABEL;
|
|
@@ -48021,6 +48032,9 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
48021
48032
|
const [views, setViews] = (0, import_react276.useState)(null);
|
|
48022
48033
|
const [error, setError] = (0, import_react276.useState)(null);
|
|
48023
48034
|
const [busy, setBusy] = (0, import_react276.useState)(false);
|
|
48035
|
+
const [pickView, setPickView] = (0, import_react276.useState)("");
|
|
48036
|
+
const [pickCadence, setPickCadence] = (0, import_react276.useState)("");
|
|
48037
|
+
const [pickChannel, setPickChannel] = (0, import_react276.useState)("in_app");
|
|
48024
48038
|
const [stopping, setStopping] = (0, import_react276.useState)(null);
|
|
48025
48039
|
const load = (0, import_react276.useCallback)(async () => {
|
|
48026
48040
|
const [held, offered] = await Promise.all([
|
|
@@ -48218,9 +48232,36 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
48218
48232
|
if (view) void subscribe(view, name, cadence, channel, schedule, quiet2);
|
|
48219
48233
|
},
|
|
48220
48234
|
children: [
|
|
48221
|
-
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)("
|
|
48222
|
-
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
48223
|
-
|
|
48235
|
+
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)("input", { type: "hidden", name: "view", value: pickView || (views[0]?.id ?? "") }),
|
|
48236
|
+
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
48237
|
+
import_controls10.Select,
|
|
48238
|
+
{
|
|
48239
|
+
"aria-label": "View to be told about",
|
|
48240
|
+
value: pickView || (views[0]?.id ?? ""),
|
|
48241
|
+
onValueChange: setPickView,
|
|
48242
|
+
options: views.map((view) => ({ value: view.id, label: view.name }))
|
|
48243
|
+
}
|
|
48244
|
+
),
|
|
48245
|
+
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)("input", { type: "hidden", name: "cadence", value: pickCadence || (cadences.length > 0 ? cadences : ["instant"])[0] }),
|
|
48246
|
+
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
48247
|
+
import_controls10.Select,
|
|
48248
|
+
{
|
|
48249
|
+
"aria-label": "How often",
|
|
48250
|
+
value: pickCadence || (cadences.length > 0 ? cadences : ["instant"])[0],
|
|
48251
|
+
onValueChange: setPickCadence,
|
|
48252
|
+
options: (cadences.length > 0 ? cadences : ["instant"]).map((cadence) => ({ value: cadence, label: CADENCE_WORDS2[cadence] ?? cadence }))
|
|
48253
|
+
}
|
|
48254
|
+
),
|
|
48255
|
+
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)("input", { type: "hidden", name: "channel", value: pickChannel }),
|
|
48256
|
+
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
48257
|
+
import_controls10.Select,
|
|
48258
|
+
{
|
|
48259
|
+
"aria-label": "Where it arrives",
|
|
48260
|
+
value: pickChannel,
|
|
48261
|
+
onValueChange: setPickChannel,
|
|
48262
|
+
options: ["in_app", "email", "sms"].map((channel) => ({ value: channel, label: CHANNEL_WORDS3[channel] ?? channel }))
|
|
48263
|
+
}
|
|
48264
|
+
),
|
|
48224
48265
|
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
48225
48266
|
"input",
|
|
48226
48267
|
{
|
|
@@ -48268,6 +48309,7 @@ var import_core24 = require("@dnd-kit/core");
|
|
|
48268
48309
|
var import_sortable3 = require("@dnd-kit/sortable");
|
|
48269
48310
|
var import_utilities3 = require("@dnd-kit/utilities");
|
|
48270
48311
|
var import_design_system138 = require("@ai-matrx/design-system");
|
|
48312
|
+
var import_controls11 = require("@ai-matrx/design-system/controls");
|
|
48271
48313
|
|
|
48272
48314
|
// src/dashboardLayout.ts
|
|
48273
48315
|
var SPAN_CHOICES = [
|
|
@@ -48385,13 +48427,13 @@ function GridCell2({
|
|
|
48385
48427
|
}
|
|
48386
48428
|
),
|
|
48387
48429
|
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
48388
|
-
|
|
48430
|
+
import_controls11.Select,
|
|
48389
48431
|
{
|
|
48390
48432
|
"aria-label": `Width of ${item.title}`,
|
|
48391
|
-
className: "ml-auto
|
|
48392
|
-
value: snapSpan(item.span),
|
|
48393
|
-
|
|
48394
|
-
|
|
48433
|
+
className: "ml-auto",
|
|
48434
|
+
value: String(snapSpan(item.span)),
|
|
48435
|
+
onValueChange: (v) => onSpan(index, Number(v)),
|
|
48436
|
+
options: SPAN_CHOICES.map((choice) => ({ value: String(choice.span), label: choice.label }))
|
|
48395
48437
|
}
|
|
48396
48438
|
)
|
|
48397
48439
|
] }) : null,
|
|
@@ -48526,6 +48568,9 @@ function AddChart({ subject, onAdd, onClose }) {
|
|
|
48526
48568
|
] });
|
|
48527
48569
|
}
|
|
48528
48570
|
|
|
48571
|
+
// src/DashboardCanvas.tsx
|
|
48572
|
+
var import_controls12 = require("@ai-matrx/design-system/controls");
|
|
48573
|
+
|
|
48529
48574
|
// src/pages.ts
|
|
48530
48575
|
var import_records70 = require("@ai-matrx/records");
|
|
48531
48576
|
var PAGE_BLOCK_KINDS = ["list", "record", "button", "form", "filter", "chart", "heading", "text", "applet"];
|
|
@@ -48968,13 +49013,12 @@ function BlockSettings({
|
|
|
48968
49013
|
const fields = own3.data ?? [];
|
|
48969
49014
|
return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col items-stretch gap-1.5 text-xs", children: [
|
|
48970
49015
|
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
48971
|
-
|
|
49016
|
+
import_controls12.Select,
|
|
48972
49017
|
{
|
|
48973
49018
|
"aria-label": `Shape of ${title}`,
|
|
48974
|
-
className: "h-7 rounded border bg-background px-1 text-xs",
|
|
48975
49019
|
value: spec.kind,
|
|
48976
|
-
|
|
48977
|
-
|
|
49020
|
+
onValueChange: (kind) => onChange({ ...spec, kind }),
|
|
49021
|
+
options: CHART_KINDS.map((kind) => ({ value: kind, label: CHART_KIND_LABEL[kind] }))
|
|
48978
49022
|
}
|
|
48979
49023
|
),
|
|
48980
49024
|
(spec.groupBy ?? []).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
@@ -52146,7 +52190,7 @@ var import_clipboard17 = require("@ai-matrx/kit/clipboard");
|
|
|
52146
52190
|
var import_react311 = require("react");
|
|
52147
52191
|
var import_records74 = require("@ai-matrx/records");
|
|
52148
52192
|
var import_react312 = require("@ai-matrx/records/react");
|
|
52149
|
-
var
|
|
52193
|
+
var import_design_system158 = require("@ai-matrx/design-system");
|
|
52150
52194
|
var import_text_case22 = require("@ai-matrx/kit/text-case");
|
|
52151
52195
|
|
|
52152
52196
|
// src/calendarFeed.ts
|
|
@@ -52391,42 +52435,143 @@ async function runTablePageAction(kind, args) {
|
|
|
52391
52435
|
}
|
|
52392
52436
|
}
|
|
52393
52437
|
|
|
52394
|
-
// src/
|
|
52395
|
-
var import_react302 = require("react");
|
|
52438
|
+
// src/RecordStepper.tsx
|
|
52396
52439
|
var import_design_system151 = require("@ai-matrx/design-system");
|
|
52397
|
-
var import_react303 = require("@ai-matrx/records/react");
|
|
52398
52440
|
var import_jsx_runtime169 = require("react/jsx-runtime");
|
|
52399
|
-
function
|
|
52400
|
-
const
|
|
52401
|
-
|
|
52402
|
-
return
|
|
52403
|
-
|
|
52404
|
-
|
|
52405
|
-
|
|
52406
|
-
|
|
52407
|
-
|
|
52408
|
-
|
|
52409
|
-
|
|
52410
|
-
|
|
52441
|
+
function neighborsOf(ids, id) {
|
|
52442
|
+
const index = ids.indexOf(id);
|
|
52443
|
+
if (index < 0) return null;
|
|
52444
|
+
return {
|
|
52445
|
+
index,
|
|
52446
|
+
total: ids.length,
|
|
52447
|
+
previous: index > 0 ? ids[index - 1] : null,
|
|
52448
|
+
next: index < ids.length - 1 ? ids[index + 1] : null
|
|
52449
|
+
};
|
|
52450
|
+
}
|
|
52451
|
+
var TEXT_TAGS = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]);
|
|
52452
|
+
function stepKeyOf(event) {
|
|
52453
|
+
if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return null;
|
|
52454
|
+
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") return null;
|
|
52455
|
+
const target = event.target;
|
|
52456
|
+
if (target) {
|
|
52457
|
+
if (TEXT_TAGS.has(target.tagName) || target.isContentEditable) return null;
|
|
52458
|
+
const role = target.getAttribute?.("role");
|
|
52459
|
+
if (role === "combobox" || role === "listbox" || role === "option" || role === "slider" || role === "spinbutton") return null;
|
|
52460
|
+
}
|
|
52461
|
+
return event.key === "ArrowUp" ? -1 : 1;
|
|
52462
|
+
}
|
|
52463
|
+
function RecordStepper({ neighbors, onStep, expanded, onToggleExpand }) {
|
|
52464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("div", { className: "flex items-center gap-1", "data-record-stepper": "", children: [
|
|
52411
52465
|
/* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
52412
|
-
|
|
52466
|
+
import_design_system151.Button,
|
|
52413
52467
|
{
|
|
52414
|
-
|
|
52415
|
-
|
|
52416
|
-
|
|
52468
|
+
size: "sm",
|
|
52469
|
+
variant: "ghost",
|
|
52470
|
+
className: "h-7 w-7 p-0",
|
|
52471
|
+
"aria-label": "Previous record",
|
|
52472
|
+
title: "Previous record (\u2191)",
|
|
52473
|
+
disabled: neighbors.previous === null,
|
|
52474
|
+
onClick: () => neighbors.previous && onStep(neighbors.previous),
|
|
52475
|
+
"data-record-previous": "",
|
|
52476
|
+
children: "\u2191"
|
|
52417
52477
|
}
|
|
52418
52478
|
),
|
|
52419
|
-
|
|
52420
|
-
|
|
52421
|
-
|
|
52422
|
-
|
|
52423
|
-
|
|
52424
|
-
|
|
52425
|
-
|
|
52426
|
-
|
|
52427
|
-
|
|
52479
|
+
/* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
52480
|
+
import_design_system151.Button,
|
|
52481
|
+
{
|
|
52482
|
+
size: "sm",
|
|
52483
|
+
variant: "ghost",
|
|
52484
|
+
className: "h-7 w-7 p-0",
|
|
52485
|
+
"aria-label": "Next record",
|
|
52486
|
+
title: "Next record (\u2193)",
|
|
52487
|
+
disabled: neighbors.next === null,
|
|
52488
|
+
onClick: () => neighbors.next && onStep(neighbors.next),
|
|
52489
|
+
"data-record-next": "",
|
|
52490
|
+
children: "\u2193"
|
|
52491
|
+
}
|
|
52492
|
+
),
|
|
52493
|
+
/* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("span", { className: "text-[11px] tabular-nums text-muted-foreground", "data-record-position": "", children: [
|
|
52494
|
+
neighbors.index + 1,
|
|
52495
|
+
" of ",
|
|
52496
|
+
neighbors.total
|
|
52497
|
+
] }),
|
|
52498
|
+
onToggleExpand ? /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
52499
|
+
import_design_system151.Button,
|
|
52500
|
+
{
|
|
52501
|
+
size: "sm",
|
|
52502
|
+
variant: "ghost",
|
|
52503
|
+
className: "ml-auto h-7 px-2 text-xs",
|
|
52504
|
+
"aria-pressed": Boolean(expanded),
|
|
52505
|
+
onClick: onToggleExpand,
|
|
52506
|
+
"data-record-expand": "",
|
|
52507
|
+
children: expanded ? "Shrink" : "Expand"
|
|
52508
|
+
}
|
|
52509
|
+
) : null
|
|
52428
52510
|
] });
|
|
52429
52511
|
}
|
|
52512
|
+
|
|
52513
|
+
// src/RecordPanel.tsx
|
|
52514
|
+
var import_react302 = require("react");
|
|
52515
|
+
var import_design_system152 = require("@ai-matrx/design-system");
|
|
52516
|
+
var import_react303 = require("@ai-matrx/records/react");
|
|
52517
|
+
var import_jsx_runtime170 = require("react/jsx-runtime");
|
|
52518
|
+
function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = false, neighbors, onStep, expanded, onToggleExpand }) {
|
|
52519
|
+
const host = useRecordsUi();
|
|
52520
|
+
const [asking, setAsking] = (0, import_react302.useState)(null);
|
|
52521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)(
|
|
52522
|
+
"div",
|
|
52523
|
+
{
|
|
52524
|
+
className: "space-y-3 outline-none",
|
|
52525
|
+
tabIndex: -1,
|
|
52526
|
+
"data-record-panel": recordId,
|
|
52527
|
+
onKeyDown: (event) => {
|
|
52528
|
+
if (event.key === "Escape" && !event.defaultPrevented && onClose && !onPage) {
|
|
52529
|
+
const tag = event.target?.tagName;
|
|
52530
|
+
if (tag !== "INPUT" && tag !== "TEXTAREA" && tag !== "SELECT") {
|
|
52531
|
+
event.preventDefault();
|
|
52532
|
+
onClose();
|
|
52533
|
+
}
|
|
52534
|
+
return;
|
|
52535
|
+
}
|
|
52536
|
+
if (!neighbors || !onStep) return;
|
|
52537
|
+
const way = stepKeyOf(event);
|
|
52538
|
+
const to = way === null ? null : way < 0 ? neighbors.previous : neighbors.next;
|
|
52539
|
+
if (to) {
|
|
52540
|
+
event.preventDefault();
|
|
52541
|
+
onStep(to);
|
|
52542
|
+
}
|
|
52543
|
+
},
|
|
52544
|
+
children: [
|
|
52545
|
+
neighbors && onStep ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(RecordStepper, { neighbors, onStep: (to) => onStep(to), expanded, onToggleExpand }) : null,
|
|
52546
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(Peek, { tableId, recordId, onPage, ...onClose ? { onClose } : {} }),
|
|
52547
|
+
onPage ? /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)(import_jsx_runtime170.Fragment, { children: [
|
|
52548
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(RecordBody, { tableId, recordId }),
|
|
52549
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(LinkedLists, { tableId, recordId }),
|
|
52550
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(ReverseLinksSections, { tableId, recordId }),
|
|
52551
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(RecordAsk, { tableId, recordId })
|
|
52552
|
+
] }) : null,
|
|
52553
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52554
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
52555
|
+
HistoryPanel,
|
|
52556
|
+
{
|
|
52557
|
+
tableId,
|
|
52558
|
+
recordId,
|
|
52559
|
+
onAskAboutField: (fieldKey) => onAskAboutField ? onAskAboutField(fieldKey) : setAsking(fieldKey)
|
|
52560
|
+
}
|
|
52561
|
+
),
|
|
52562
|
+
!onAskAboutField && asking ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(FieldHistoryPanel, { tableId, fieldKey: asking, recordId, onClose: () => setAsking(null) }) : null,
|
|
52563
|
+
host.recordSections ? /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)(import_react302.Fragment, { children: [
|
|
52564
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52565
|
+
host.recordSections({ tableId, recordId })
|
|
52566
|
+
] }) : null,
|
|
52567
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52568
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(ChecklistRunner, { tableId, recordId }),
|
|
52569
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52570
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(CommentThread, { tableId, recordId })
|
|
52571
|
+
]
|
|
52572
|
+
}
|
|
52573
|
+
);
|
|
52574
|
+
}
|
|
52430
52575
|
function LinkedLists({ tableId, recordId }) {
|
|
52431
52576
|
const fields = (0, import_react303.useFields)(tableId);
|
|
52432
52577
|
const record = (0, import_react303.useRecord)(recordId, true, { tableId });
|
|
@@ -52436,9 +52581,9 @@ function LinkedLists({ tableId, recordId }) {
|
|
|
52436
52581
|
const may = useRecordRights(recordId);
|
|
52437
52582
|
if (links.length === 0 || !document2) return null;
|
|
52438
52583
|
if (may.write) {
|
|
52439
|
-
return /* @__PURE__ */ (0,
|
|
52440
|
-
/* @__PURE__ */ (0,
|
|
52441
|
-
/* @__PURE__ */ (0,
|
|
52584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
|
|
52585
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52586
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
52442
52587
|
RecordFieldsInPlace,
|
|
52443
52588
|
{
|
|
52444
52589
|
tableId,
|
|
@@ -52451,25 +52596,25 @@ function LinkedLists({ tableId, recordId }) {
|
|
|
52451
52596
|
className: "flex min-w-0 flex-col gap-1",
|
|
52452
52597
|
renderLabel: (field2) => {
|
|
52453
52598
|
const count = referencesOf(field2, document2[field2.key], "relation", labels).length;
|
|
52454
|
-
return /* @__PURE__ */ (0,
|
|
52455
|
-
/* @__PURE__ */ (0,
|
|
52456
|
-
count > 0 ? /* @__PURE__ */ (0,
|
|
52599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("span", { className: "flex items-center gap-2 pt-2 text-foreground", "data-record-linked-list": field2.key, children: [
|
|
52600
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)("span", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
|
|
52601
|
+
count > 0 ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("span", { className: "text-[11px] text-muted-foreground", children: count }) : null
|
|
52457
52602
|
] });
|
|
52458
52603
|
}
|
|
52459
52604
|
}
|
|
52460
52605
|
)
|
|
52461
52606
|
] });
|
|
52462
52607
|
}
|
|
52463
|
-
return /* @__PURE__ */ (0,
|
|
52464
|
-
/* @__PURE__ */ (0,
|
|
52608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
|
|
52609
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52465
52610
|
links.map((field2) => {
|
|
52466
52611
|
const refs = referencesOf(field2, document2[field2.key], "relation", labels);
|
|
52467
|
-
return /* @__PURE__ */ (0,
|
|
52468
|
-
/* @__PURE__ */ (0,
|
|
52469
|
-
/* @__PURE__ */ (0,
|
|
52470
|
-
refs.length > 0 ? /* @__PURE__ */ (0,
|
|
52612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("section", { className: "flex min-w-0 flex-col gap-1", "data-record-linked-list": field2.key, children: [
|
|
52613
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
52614
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)("h4", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
|
|
52615
|
+
refs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("span", { className: "text-[11px] text-muted-foreground", children: refs.length }) : null
|
|
52471
52616
|
] }),
|
|
52472
|
-
refs.length === 0 ? /* @__PURE__ */ (0,
|
|
52617
|
+
refs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("ul", { className: "flex min-w-0 flex-col gap-1", children: refs.map((ref) => /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("li", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(ReferenceChip, { reference: ref }) }, ref.id)) })
|
|
52473
52618
|
] }, field2.id);
|
|
52474
52619
|
})
|
|
52475
52620
|
] });
|
|
@@ -52478,16 +52623,16 @@ function RecordAsk({ tableId, recordId }) {
|
|
|
52478
52623
|
const host = useRecordsUi();
|
|
52479
52624
|
const [open, setOpen] = (0, import_react302.useState)(false);
|
|
52480
52625
|
if (!host.chat) return null;
|
|
52481
|
-
return /* @__PURE__ */ (0,
|
|
52482
|
-
/* @__PURE__ */ (0,
|
|
52483
|
-
open ? /* @__PURE__ */ (0,
|
|
52626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)("section", { className: "flex min-w-0 flex-col gap-1.5", "data-record-ask": open ? "open" : "", children: [
|
|
52627
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Separator, {}),
|
|
52628
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(RecordChat, { tableId, recordId, className: "min-h-[22rem]" }) : /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_design_system152.Button, { size: "sm", variant: "outline", className: "self-start", onClick: () => setOpen(true), "data-record-ask-open": "", children: "Ask about this record" })
|
|
52484
52629
|
] });
|
|
52485
52630
|
}
|
|
52486
52631
|
|
|
52487
52632
|
// src/breakDown.tsx
|
|
52488
52633
|
var import_react304 = require("react");
|
|
52489
|
-
var
|
|
52490
|
-
var
|
|
52634
|
+
var import_design_system153 = require("@ai-matrx/design-system");
|
|
52635
|
+
var import_jsx_runtime171 = require("react/jsx-runtime");
|
|
52491
52636
|
var BREAK_DOWN_ACTION_ID = "break-down";
|
|
52492
52637
|
var NO_DIMENSION_REASON = "No column to break down by";
|
|
52493
52638
|
function breakDownAction(args) {
|
|
@@ -52516,14 +52661,14 @@ function BreakDownDialog({
|
|
|
52516
52661
|
const dimensions = (0, import_react304.useMemo)(() => drillDimensionsOf(def, NO_LABELS), [def]);
|
|
52517
52662
|
const [picked, setPicked] = (0, import_react304.useState)(null);
|
|
52518
52663
|
const key = picked ?? held?.field ?? dimensions[0]?.key ?? "";
|
|
52519
|
-
return /* @__PURE__ */ (0,
|
|
52520
|
-
/* @__PURE__ */ (0,
|
|
52521
|
-
/* @__PURE__ */ (0,
|
|
52522
|
-
/* @__PURE__ */ (0,
|
|
52523
|
-
/* @__PURE__ */ (0,
|
|
52664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(import_design_system153.DialogContent, { "data-break-down": "", className: "max-w-sm", children: [
|
|
52665
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.DialogTitle, { children: "Break down by" }) }),
|
|
52666
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(import_design_system153.Select, { value: key, onValueChange: setPicked, children: [
|
|
52667
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.SelectTrigger, { "aria-label": "Column to break down by", "data-break-down-select": "", children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.SelectValue, { placeholder: def ? NO_DIMENSION_REASON : "Reading this table\u2026" }) }),
|
|
52668
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.SelectContent, { children: dimensions.map((d) => /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(import_design_system153.SelectItem, { value: d.key, children: d.label }, d.key)) })
|
|
52524
52669
|
] }),
|
|
52525
|
-
/* @__PURE__ */ (0,
|
|
52526
|
-
|
|
52670
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
52671
|
+
import_design_system153.Button,
|
|
52527
52672
|
{
|
|
52528
52673
|
type: "button",
|
|
52529
52674
|
"data-break-down-apply": "",
|
|
@@ -52543,8 +52688,8 @@ function BreakDownDialog({
|
|
|
52543
52688
|
var import_clipboard16 = require("@ai-matrx/kit/clipboard");
|
|
52544
52689
|
var import_react305 = require("react");
|
|
52545
52690
|
var import_workspace2 = require("@ai-matrx/alchemy/react/workspace");
|
|
52546
|
-
var
|
|
52547
|
-
var
|
|
52691
|
+
var import_design_system154 = require("@ai-matrx/design-system");
|
|
52692
|
+
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
52548
52693
|
function tableReferenceChoices(tableId, name) {
|
|
52549
52694
|
return [
|
|
52550
52695
|
{
|
|
@@ -52587,11 +52732,11 @@ function TableReferenceDialog({
|
|
|
52587
52732
|
},
|
|
52588
52733
|
[port, notify]
|
|
52589
52734
|
);
|
|
52590
|
-
return /* @__PURE__ */ (0,
|
|
52591
|
-
/* @__PURE__ */ (0,
|
|
52592
|
-
/* @__PURE__ */ (0,
|
|
52593
|
-
/* @__PURE__ */ (0,
|
|
52594
|
-
/* @__PURE__ */ (0,
|
|
52735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_design_system154.Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)(import_design_system154.DialogContent, { className: "sm:max-w-sm", "data-table-reference": "", children: [
|
|
52736
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_design_system154.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_design_system154.DialogTitle, { children: "Get reference" }) }),
|
|
52737
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { className: "flex flex-col gap-2", children: choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-md border px-3 py-2", children: [
|
|
52738
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)("span", { className: "text-sm", children: choice.label }),
|
|
52739
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_design_system154.Button, { size: "sm", variant: "outline", onClick: () => void copy(choice), "data-table-reference-copy": choice.id, children: copied === choice.id ? "Copied" : "Copy" })
|
|
52595
52740
|
] }, choice.id)) })
|
|
52596
52741
|
] }) });
|
|
52597
52742
|
}
|
|
@@ -52600,8 +52745,8 @@ function TableReferenceDialog({
|
|
|
52600
52745
|
var import_format14 = require("@ai-matrx/kit/format");
|
|
52601
52746
|
var import_react306 = require("react");
|
|
52602
52747
|
var import_react307 = require("@ai-matrx/records/react");
|
|
52603
|
-
var
|
|
52604
|
-
var
|
|
52748
|
+
var import_design_system155 = require("@ai-matrx/design-system");
|
|
52749
|
+
var import_jsx_runtime173 = require("react/jsx-runtime");
|
|
52605
52750
|
function copyNameFor(name) {
|
|
52606
52751
|
return `${name.trim() || "Table"} (copy)`;
|
|
52607
52752
|
}
|
|
@@ -52649,13 +52794,13 @@ function TableDuplicateDialog({ tableId, name, open, onOpenChange, onDuplicated
|
|
|
52649
52794
|
if (onDuplicated) onDuplicated(copy);
|
|
52650
52795
|
else if (typeof window !== "undefined") window.location.assign(copy.path);
|
|
52651
52796
|
};
|
|
52652
|
-
return /* @__PURE__ */ (0,
|
|
52653
|
-
/* @__PURE__ */ (0,
|
|
52797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_design_system155.DialogContent, { className: "sm:max-w-md", "data-table-duplicate": tableId, children: [
|
|
52798
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_design_system155.DialogTitle, { children: [
|
|
52654
52799
|
"Duplicate ",
|
|
52655
52800
|
name || "table"
|
|
52656
52801
|
] }) }),
|
|
52657
|
-
phase.kind === "done" ? /* @__PURE__ */ (0,
|
|
52658
|
-
/* @__PURE__ */ (0,
|
|
52802
|
+
phase.kind === "done" ? /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("div", { className: "flex flex-col gap-1.5 text-sm", "data-table-duplicate-done": "", children: [
|
|
52803
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("p", { children: [
|
|
52659
52804
|
phase.copy.table.name,
|
|
52660
52805
|
": ",
|
|
52661
52806
|
phase.copy.copied.fields,
|
|
@@ -52665,14 +52810,14 @@ function TableDuplicateDialog({ tableId, name, open, onOpenChange, onDuplicated
|
|
|
52665
52810
|
phase.copy.copied.withRecords ? `, ${(0, import_format14.formatCount)(phase.copy.copied.records)} records` : "",
|
|
52666
52811
|
"."
|
|
52667
52812
|
] }),
|
|
52668
|
-
phase.copy.notCopied.length > 0 ? /* @__PURE__ */ (0,
|
|
52813
|
+
phase.copy.notCopied.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
52669
52814
|
"Not copied: ",
|
|
52670
52815
|
phase.copy.notCopied.join(", "),
|
|
52671
52816
|
"."
|
|
52672
52817
|
] }) : null
|
|
52673
|
-
] }) : /* @__PURE__ */ (0,
|
|
52674
|
-
/* @__PURE__ */ (0,
|
|
52675
|
-
|
|
52818
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("div", { className: "flex flex-col gap-3 text-sm", children: [
|
|
52819
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)(
|
|
52820
|
+
import_design_system155.Input,
|
|
52676
52821
|
{
|
|
52677
52822
|
autoFocus: true,
|
|
52678
52823
|
"aria-label": "Name of the copy",
|
|
@@ -52684,26 +52829,26 @@ function TableDuplicateDialog({ tableId, name, open, onOpenChange, onDuplicated
|
|
|
52684
52829
|
}
|
|
52685
52830
|
}
|
|
52686
52831
|
),
|
|
52687
|
-
/* @__PURE__ */ (0,
|
|
52688
|
-
/* @__PURE__ */ (0,
|
|
52689
|
-
/* @__PURE__ */ (0,
|
|
52832
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("label", { className: "flex items-center justify-between gap-2", children: [
|
|
52833
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { children: "Copy its records" }),
|
|
52834
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.Switch, { checked: withRecords, disabled: copying, onCheckedChange: setWithRecords, "aria-label": "Copy its records" })
|
|
52690
52835
|
] }),
|
|
52691
|
-
phase.kind === "copying" ? /* @__PURE__ */ (0,
|
|
52692
|
-
phase.kind === "refused" ? /* @__PURE__ */ (0,
|
|
52693
|
-
problem && typed2 !== "" ? /* @__PURE__ */ (0,
|
|
52836
|
+
phase.kind === "copying" ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { className: "text-xs text-muted-foreground", "data-table-duplicate-progress": "", children: phase.progress ? duplicateProgressWords(phase.progress) : "Starting the copy\u2026" }) : null,
|
|
52837
|
+
phase.kind === "refused" ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.ErrorBox, { children: phase.sentence }) : null,
|
|
52838
|
+
problem && typed2 !== "" ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { className: "text-xs text-muted-foreground", children: problem }) : null
|
|
52694
52839
|
] }),
|
|
52695
|
-
/* @__PURE__ */ (0,
|
|
52696
|
-
/* @__PURE__ */ (0,
|
|
52697
|
-
/* @__PURE__ */ (0,
|
|
52840
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.DialogFooter, { children: phase.kind === "done" ? /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.Button, { onClick: () => openCopy(phase.copy), "data-table-duplicate-open": "", children: "Open the copy" }) : /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_jsx_runtime173.Fragment, { children: [
|
|
52841
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.Button, { variant: "ghost", disabled: copying, onClick: () => close(false), children: "Cancel" }),
|
|
52842
|
+
/* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_design_system155.Button, { disabled: copying || problem !== null, onClick: () => void go(), children: copying ? "Duplicating\u2026" : "Duplicate" })
|
|
52698
52843
|
] }) })
|
|
52699
52844
|
] }) });
|
|
52700
52845
|
}
|
|
52701
52846
|
|
|
52702
52847
|
// src/ViewFilter.tsx
|
|
52703
52848
|
var import_react308 = require("react");
|
|
52704
|
-
var
|
|
52849
|
+
var import_design_system156 = require("@ai-matrx/design-system");
|
|
52705
52850
|
var import_react309 = require("@ai-matrx/records/react");
|
|
52706
|
-
var
|
|
52851
|
+
var import_jsx_runtime174 = require("react/jsx-runtime");
|
|
52707
52852
|
function conditionCount(expr) {
|
|
52708
52853
|
if (!expr || typeof expr !== "object" || Array.isArray(expr)) return 0;
|
|
52709
52854
|
const node = expr;
|
|
@@ -52731,8 +52876,8 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52731
52876
|
return (
|
|
52732
52877
|
// THE BUILDER FLOATS OVER THE TABLE (STABLE-TABLES; Notion's filter popover): drawn inside the
|
|
52733
52878
|
// toolbar row it grew the row and pushed the whole table down (0.13 + 0.13 layout shift).
|
|
52734
|
-
/* @__PURE__ */ (0,
|
|
52735
|
-
|
|
52879
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
|
|
52880
|
+
import_design_system156.Popover,
|
|
52736
52881
|
{
|
|
52737
52882
|
open,
|
|
52738
52883
|
onOpenChange: (next) => {
|
|
@@ -52740,8 +52885,8 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52740
52885
|
setOpen(next);
|
|
52741
52886
|
},
|
|
52742
52887
|
children: [
|
|
52743
|
-
/* @__PURE__ */ (0,
|
|
52744
|
-
|
|
52888
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_design_system156.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
|
|
52889
|
+
import_design_system156.Button,
|
|
52745
52890
|
{
|
|
52746
52891
|
size: "sm",
|
|
52747
52892
|
variant: open || count > 0 ? "secondary" : "ghost",
|
|
@@ -52752,17 +52897,17 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52752
52897
|
children: count > 0 ? `Filter \xB7 ${count}` : "Filter"
|
|
52753
52898
|
}
|
|
52754
52899
|
) }),
|
|
52755
|
-
/* @__PURE__ */ (0,
|
|
52900
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_design_system156.PopoverContent, { sizing: "content", align: "start", className: "w-auto max-w-[min(42rem,calc(100vw-2rem))] p-2", children: /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
|
|
52756
52901
|
"div",
|
|
52757
52902
|
{
|
|
52758
52903
|
className: "flex flex-col gap-2 text-xs",
|
|
52759
52904
|
"data-testid": "view-filter-panel",
|
|
52760
52905
|
children: [
|
|
52761
|
-
view.ruleId ? /* @__PURE__ */ (0,
|
|
52906
|
+
view.ruleId ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)("p", { className: "text-muted-foreground", children: "This view's records are chosen by a membership Rule, and the store answers it. Change the Rule to change who is in this view." }) : !conditionIsDrawable(saved) ? /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)("p", { className: "text-muted-foreground", children: [
|
|
52762
52907
|
"This view asks: ",
|
|
52763
52908
|
conditionInWords(saved, conditionFields),
|
|
52764
52909
|
". It cannot be drawn here; clear it to start a new filter."
|
|
52765
|
-
] }) : /* @__PURE__ */ (0,
|
|
52910
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(FilterTermsContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
|
|
52766
52911
|
ConditionGroup,
|
|
52767
52912
|
{
|
|
52768
52913
|
lead: "Show records where",
|
|
@@ -52772,9 +52917,9 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52772
52917
|
onChange: setDraft
|
|
52773
52918
|
}
|
|
52774
52919
|
) }),
|
|
52775
|
-
view.ruleId ? null : /* @__PURE__ */ (0,
|
|
52776
|
-
changed2 ? /* @__PURE__ */ (0,
|
|
52777
|
-
|
|
52920
|
+
view.ruleId ? null : /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
52921
|
+
changed2 ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
|
|
52922
|
+
import_design_system156.Button,
|
|
52778
52923
|
{
|
|
52779
52924
|
size: "sm",
|
|
52780
52925
|
"data-testid": "view-filter-apply",
|
|
@@ -52785,8 +52930,8 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52785
52930
|
children: "Apply"
|
|
52786
52931
|
}
|
|
52787
52932
|
) : null,
|
|
52788
|
-
count > 0 || draft ? /* @__PURE__ */ (0,
|
|
52789
|
-
|
|
52933
|
+
count > 0 || draft ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
|
|
52934
|
+
import_design_system156.Button,
|
|
52790
52935
|
{
|
|
52791
52936
|
size: "sm",
|
|
52792
52937
|
variant: "ghost",
|
|
@@ -52799,7 +52944,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52799
52944
|
children: "Clear filter"
|
|
52800
52945
|
}
|
|
52801
52946
|
) : null,
|
|
52802
|
-
/* @__PURE__ */ (0,
|
|
52947
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_design_system156.Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
52803
52948
|
setDraft(saved);
|
|
52804
52949
|
setOpen(false);
|
|
52805
52950
|
}, children: "Cancel" })
|
|
@@ -52814,11 +52959,11 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
52814
52959
|
}
|
|
52815
52960
|
|
|
52816
52961
|
// src/PhoneTableActions.tsx
|
|
52817
|
-
var
|
|
52818
|
-
var
|
|
52962
|
+
var import_design_system157 = require("@ai-matrx/design-system");
|
|
52963
|
+
var import_jsx_runtime175 = require("react/jsx-runtime");
|
|
52819
52964
|
function PhoneActionRow({ action: action3, groupStart }) {
|
|
52820
52965
|
const disabled = action3.disabledReason !== void 0;
|
|
52821
|
-
return /* @__PURE__ */ (0,
|
|
52966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
|
|
52822
52967
|
"button",
|
|
52823
52968
|
{
|
|
52824
52969
|
type: "button",
|
|
@@ -52828,16 +52973,16 @@ function PhoneActionRow({ action: action3, groupStart }) {
|
|
|
52828
52973
|
onClick: () => {
|
|
52829
52974
|
if (!disabled) void action3.run();
|
|
52830
52975
|
},
|
|
52831
|
-
className: (0,
|
|
52976
|
+
className: (0, import_design_system157.cn)(
|
|
52832
52977
|
"flex min-h-11 w-full items-center gap-3 px-1 text-left text-base disabled:opacity-60",
|
|
52833
52978
|
groupStart && "border-t border-border pt-1",
|
|
52834
52979
|
action3.destructive && "text-destructive"
|
|
52835
52980
|
),
|
|
52836
52981
|
children: [
|
|
52837
|
-
/* @__PURE__ */ (0,
|
|
52838
|
-
/* @__PURE__ */ (0,
|
|
52839
|
-
/* @__PURE__ */ (0,
|
|
52840
|
-
disabled ? /* @__PURE__ */ (0,
|
|
52982
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(ObjectActionGlyph, { name: action3.icon, className: "h-5 w-5 shrink-0" }),
|
|
52983
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsxs)("span", { className: "flex min-w-0 flex-col", children: [
|
|
52984
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "truncate", children: action3.label }),
|
|
52985
|
+
disabled ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "truncate text-xs text-muted-foreground", "data-object-action-reason": "", children: action3.disabledReason }) : null
|
|
52841
52986
|
] })
|
|
52842
52987
|
]
|
|
52843
52988
|
}
|
|
@@ -52845,20 +52990,20 @@ function PhoneActionRow({ action: action3, groupStart }) {
|
|
|
52845
52990
|
}
|
|
52846
52991
|
PhoneActionRow.routeHeaderMenu = true;
|
|
52847
52992
|
function PhoneSubmenu({ label, icon, actions }) {
|
|
52848
|
-
return /* @__PURE__ */ (0,
|
|
52849
|
-
/* @__PURE__ */ (0,
|
|
52993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(import_design_system157.DropdownMenu, { children: [
|
|
52994
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_design_system157.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
|
|
52850
52995
|
"button",
|
|
52851
52996
|
{
|
|
52852
52997
|
type: "button",
|
|
52853
52998
|
"data-object-action-group": "built-on",
|
|
52854
52999
|
className: "flex min-h-11 w-full items-center gap-3 border-t border-border px-1 pt-1 text-left text-base",
|
|
52855
53000
|
children: [
|
|
52856
|
-
icon ? /* @__PURE__ */ (0,
|
|
52857
|
-
/* @__PURE__ */ (0,
|
|
53001
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(ObjectActionGlyph, { name: icon, className: "h-5 w-5 shrink-0" }) : null,
|
|
53002
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "truncate", children: label })
|
|
52858
53003
|
]
|
|
52859
53004
|
}
|
|
52860
53005
|
) }),
|
|
52861
|
-
/* @__PURE__ */ (0,
|
|
53006
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_design_system157.DropdownMenuContent, { align: "end", className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(ObjectActionMenuItems, { actions: actions.map((a) => ({ ...a, group: "manage" })) }) })
|
|
52862
53007
|
] });
|
|
52863
53008
|
}
|
|
52864
53009
|
PhoneSubmenu.routeHeaderMenu = true;
|
|
@@ -52871,13 +53016,13 @@ function phoneTableActions(actions) {
|
|
|
52871
53016
|
continue;
|
|
52872
53017
|
}
|
|
52873
53018
|
if (entry.kind === "submenu") {
|
|
52874
|
-
out.push(/* @__PURE__ */ (0,
|
|
53019
|
+
out.push(/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(PhoneSubmenu, { label: entry.label, icon: entry.icon, actions: entry.actions }, `phone-group-${entry.id}`));
|
|
52875
53020
|
groupStart = false;
|
|
52876
53021
|
continue;
|
|
52877
53022
|
}
|
|
52878
53023
|
const a = entry.action;
|
|
52879
53024
|
out.push(
|
|
52880
|
-
/* @__PURE__ */ (0,
|
|
53025
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
|
|
52881
53026
|
PhoneActionRow,
|
|
52882
53027
|
{
|
|
52883
53028
|
action: a,
|
|
@@ -53103,7 +53248,7 @@ function useSlotScroll(slot) {
|
|
|
53103
53248
|
// src/TablePage.tsx
|
|
53104
53249
|
var import_uuid3 = require("@ai-matrx/kit/uuid");
|
|
53105
53250
|
var import_outbound4 = require("@ai-matrx/kit/outbound");
|
|
53106
|
-
var
|
|
53251
|
+
var import_jsx_runtime176 = require("react/jsx-runtime");
|
|
53107
53252
|
var RAIL_TITLE = {
|
|
53108
53253
|
settings: "Table settings",
|
|
53109
53254
|
inbox: "Inbox",
|
|
@@ -53120,21 +53265,22 @@ var RAIL_TITLE = {
|
|
|
53120
53265
|
export: "Export"
|
|
53121
53266
|
};
|
|
53122
53267
|
function LookGlyph() {
|
|
53123
|
-
return /* @__PURE__ */ (0,
|
|
53124
|
-
/* @__PURE__ */ (0,
|
|
53125
|
-
/* @__PURE__ */ (0,
|
|
53126
|
-
/* @__PURE__ */ (0,
|
|
53268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
53269
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("path", { d: "M4 7h10M18 7h2M4 17h2M10 17h10" }),
|
|
53270
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("circle", { cx: "16", cy: "7", r: "2" }),
|
|
53271
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("circle", { cx: "8", cy: "17", r: "2" })
|
|
53127
53272
|
] });
|
|
53128
53273
|
}
|
|
53129
53274
|
function RailFrame({
|
|
53130
53275
|
phone,
|
|
53131
53276
|
title,
|
|
53132
53277
|
onClose,
|
|
53278
|
+
over = false,
|
|
53133
53279
|
children
|
|
53134
53280
|
}) {
|
|
53135
53281
|
if (phone) {
|
|
53136
|
-
return /* @__PURE__ */ (0,
|
|
53137
|
-
|
|
53282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53283
|
+
import_design_system158.BottomSheet,
|
|
53138
53284
|
{
|
|
53139
53285
|
open: true,
|
|
53140
53286
|
onOpenChange: (open) => {
|
|
@@ -53143,11 +53289,19 @@ function RailFrame({
|
|
|
53143
53289
|
title,
|
|
53144
53290
|
size: "full",
|
|
53145
53291
|
surface: "solid",
|
|
53146
|
-
children: /* @__PURE__ */ (0,
|
|
53292
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { "data-rail-sheet": "", className: "min-h-0 flex-1 overflow-y-auto px-3 pb-6", children })
|
|
53147
53293
|
}
|
|
53148
53294
|
);
|
|
53149
53295
|
}
|
|
53150
|
-
return /* @__PURE__ */ (0,
|
|
53296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53297
|
+
"aside",
|
|
53298
|
+
{
|
|
53299
|
+
"data-rail-column": "",
|
|
53300
|
+
"data-rail-over": over ? "" : void 0,
|
|
53301
|
+
className: over ? "w-[26rem] shrink-0" : "w-[26rem] shrink-0 overflow-y-auto rounded-md border p-3",
|
|
53302
|
+
children: over ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { className: "fixed inset-y-0 right-0 z-40 w-[min(48rem,100vw)] overflow-y-auto border-l bg-background p-4 shadow-xl", children }) : children
|
|
53303
|
+
}
|
|
53304
|
+
);
|
|
53151
53305
|
}
|
|
53152
53306
|
function filterInWords(filter, fields) {
|
|
53153
53307
|
const nameOf2 = (key) => {
|
|
@@ -53200,17 +53354,17 @@ function TableNotHere({
|
|
|
53200
53354
|
alive = false;
|
|
53201
53355
|
};
|
|
53202
53356
|
}, [client, tableId]);
|
|
53203
|
-
if (archived.phase === "asking") return /* @__PURE__ */ (0,
|
|
53357
|
+
if (archived.phase === "asking") return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Skeleton, { className: "h-40 w-full" });
|
|
53204
53358
|
const row = archived.phase === "answered" ? archived.row : null;
|
|
53205
53359
|
if (row) {
|
|
53206
|
-
return /* @__PURE__ */ (0,
|
|
53207
|
-
/* @__PURE__ */ (0,
|
|
53208
|
-
/* @__PURE__ */ (0,
|
|
53209
|
-
/* @__PURE__ */ (0,
|
|
53210
|
-
refusal3 ? /* @__PURE__ */ (0,
|
|
53211
|
-
/* @__PURE__ */ (0,
|
|
53212
|
-
/* @__PURE__ */ (0,
|
|
53213
|
-
|
|
53360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: (0, import_design_system158.cn)("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
53361
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "text-sm font-medium", children: "This table is archived" }),
|
|
53362
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
|
|
53363
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "text-xs text-muted-foreground", children: (0, import_records74.archivedByLine)(row) }),
|
|
53364
|
+
refusal3 ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(RefusalNotice, { error: refusal3 }) : null,
|
|
53365
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: "flex gap-2", children: [
|
|
53366
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53367
|
+
import_design_system158.Button,
|
|
53214
53368
|
{
|
|
53215
53369
|
size: "sm",
|
|
53216
53370
|
disabled: restoring,
|
|
@@ -53228,14 +53382,14 @@ function TableNotHere({
|
|
|
53228
53382
|
children: restoring ? "Bringing it back\u2026" : "Bring it back"
|
|
53229
53383
|
}
|
|
53230
53384
|
),
|
|
53231
|
-
onLeave ? /* @__PURE__ */ (0,
|
|
53385
|
+
onLeave ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
|
|
53232
53386
|
] })
|
|
53233
53387
|
] });
|
|
53234
53388
|
}
|
|
53235
|
-
return /* @__PURE__ */ (0,
|
|
53236
|
-
/* @__PURE__ */ (0,
|
|
53237
|
-
/* @__PURE__ */ (0,
|
|
53238
|
-
onLeave ? /* @__PURE__ */ (0,
|
|
53389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: (0, import_design_system158.cn)("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
53390
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "text-sm font-medium", children: "This table is not here" }),
|
|
53391
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_NOT_REACHABLE }),
|
|
53392
|
+
onLeave ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
|
|
53239
53393
|
] });
|
|
53240
53394
|
}
|
|
53241
53395
|
var TABLE_NOT_REACHABLE = (
|
|
@@ -53369,6 +53523,7 @@ function TablePage({
|
|
|
53369
53523
|
leaveLabel = "Back to your tables",
|
|
53370
53524
|
activeDashboardId,
|
|
53371
53525
|
activeRecordId,
|
|
53526
|
+
onRecordChange,
|
|
53372
53527
|
activeView,
|
|
53373
53528
|
onViewChanged,
|
|
53374
53529
|
activeGroupField,
|
|
@@ -53456,7 +53611,7 @@ function TablePage({
|
|
|
53456
53611
|
const setRail = (next) => setSurface((now) => ({ ...now, rail: next }));
|
|
53457
53612
|
const [importEpoch, setImportEpoch] = (0, import_react311.useState)(0);
|
|
53458
53613
|
const [openRecord, setOpenRecord] = (0, import_react311.useState)(opening.record);
|
|
53459
|
-
const phone = (0,
|
|
53614
|
+
const phone = (0, import_design_system158.useIsMobile)();
|
|
53460
53615
|
const [shareAsked, setShareAsked] = (0, import_react311.useState)(0);
|
|
53461
53616
|
const { open: renameOpen, setOpen: setRenameOpen, ask: askRename, menuContentProps: renameMenuProps } = useRenameFromMenu();
|
|
53462
53617
|
const [archiveAsked, setArchiveAsked] = (0, import_react311.useState)(0);
|
|
@@ -53553,11 +53708,30 @@ function TablePage({
|
|
|
53553
53708
|
onViewChanged?.(addressForView(view, next));
|
|
53554
53709
|
void patchView({ layout: next });
|
|
53555
53710
|
};
|
|
53711
|
+
const reportedRecords = (0, import_react311.useRef)(/* @__PURE__ */ new Set());
|
|
53712
|
+
const lastActiveRecord = (0, import_react311.useRef)(activeRecordId ?? null);
|
|
53556
53713
|
(0, import_react311.useEffect)(() => {
|
|
53557
|
-
|
|
53714
|
+
const before = lastActiveRecord.current;
|
|
53715
|
+
lastActiveRecord.current = activeRecordId ?? null;
|
|
53716
|
+
if (!activeRecordId) {
|
|
53717
|
+
if (before) setSurface((now) => now.rail === "record" ? { ...now, rail: "none" } : now);
|
|
53718
|
+
return;
|
|
53719
|
+
}
|
|
53720
|
+
if (reportedRecords.current.delete(activeRecordId)) return;
|
|
53558
53721
|
setOpenRecord(activeRecordId);
|
|
53559
53722
|
setSurface((now) => ({ ...now, rail: "record" }));
|
|
53560
53723
|
}, [activeRecordId]);
|
|
53724
|
+
const [shownIds, setShownIds] = (0, import_react311.useState)([]);
|
|
53725
|
+
const [recordExpanded, setRecordExpanded] = (0, import_react311.useState)(false);
|
|
53726
|
+
const shownRecord = rail === "record" ? openRecord : null;
|
|
53727
|
+
const reportedRecord = (0, import_react311.useRef)(activeRecordId ?? null);
|
|
53728
|
+
(0, import_react311.useEffect)(() => {
|
|
53729
|
+
if (shownRecord === reportedRecord.current) return;
|
|
53730
|
+
const how = shownRecord === null ? "close" : reportedRecord.current === null ? "open" : "step";
|
|
53731
|
+
reportedRecord.current = shownRecord;
|
|
53732
|
+
if (shownRecord) reportedRecords.current.add(shownRecord);
|
|
53733
|
+
onRecordChange?.(shownRecord, how);
|
|
53734
|
+
}, [shownRecord, onRecordChange]);
|
|
53561
53735
|
(0, import_react311.useEffect)(() => {
|
|
53562
53736
|
if (activeRecordId) return;
|
|
53563
53737
|
const named = railFromParam(activeRail);
|
|
@@ -53744,20 +53918,20 @@ function TablePage({
|
|
|
53744
53918
|
};
|
|
53745
53919
|
const footer = footerOf(shown5?.presentation);
|
|
53746
53920
|
const setFooter = (next) => void patchView({ presentation: { ...shown5?.presentation ?? {}, footer: next } });
|
|
53747
|
-
const layoutRadio = /* @__PURE__ */ (0,
|
|
53748
|
-
|
|
53921
|
+
const layoutRadio = /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53922
|
+
import_design_system158.DropdownMenuRadioGroup,
|
|
53749
53923
|
{
|
|
53750
53924
|
value: layoutShowing ?? "",
|
|
53751
53925
|
onValueChange: (value) => {
|
|
53752
53926
|
if (import_views2.VIEW_LAYOUTS.includes(value)) pickLayout(value);
|
|
53753
53927
|
},
|
|
53754
|
-
children: import_views2.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0,
|
|
53928
|
+
children: import_views2.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuRadioItem, { value: option, children: import_views2.LAYOUT_LABEL[option] }, option))
|
|
53755
53929
|
}
|
|
53756
53930
|
);
|
|
53757
|
-
const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ (0,
|
|
53758
|
-
/* @__PURE__ */ (0,
|
|
53759
|
-
/* @__PURE__ */ (0,
|
|
53760
|
-
|
|
53931
|
+
const sheetExtras = controlsInSheet && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
53932
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { className: "flex items-center gap-2 text-xs", "data-table-sheet-filter": "", "data-matrx-table-tools-keep-open": "", children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) }),
|
|
53933
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { role: "group", "aria-label": "Layout", className: "flex flex-wrap gap-1 pt-1", "data-table-sheet-layout": "", children: import_views2.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53934
|
+
import_design_system158.Button,
|
|
53761
53935
|
{
|
|
53762
53936
|
size: "sm",
|
|
53763
53937
|
variant: layoutShowing === option ? "secondary" : "ghost",
|
|
@@ -53768,7 +53942,7 @@ function TablePage({
|
|
|
53768
53942
|
},
|
|
53769
53943
|
option
|
|
53770
53944
|
)) }),
|
|
53771
|
-
rights.share && canShare ? /* @__PURE__ */ (0,
|
|
53945
|
+
rights.share && canShare ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "ghost", className: "h-8", onClick: () => setShareAsked((n) => n + 1), "data-table-sheet-share": "", children: "Share\u2026" }) : null
|
|
53772
53946
|
] }) : void 0;
|
|
53773
53947
|
const go = (pressed) => {
|
|
53774
53948
|
if (!surfaceChosen(surface, pressed)) press(pressed);
|
|
@@ -53974,9 +54148,9 @@ function TablePage({
|
|
|
53974
54148
|
return () => window.removeEventListener("keydown", onKey);
|
|
53975
54149
|
}, [recordsUi]);
|
|
53976
54150
|
const openedFromMenu = openedEntry ? { ...openedEntry, label: actions.find((a) => a.id === openedEntry.id)?.label ?? openedEntry.key } : null;
|
|
53977
|
-
const pageActions = /* @__PURE__ */ (0,
|
|
53978
|
-
publicReadOnly ? /* @__PURE__ */ (0,
|
|
53979
|
-
!phone && rights.read && table.data ? /* @__PURE__ */ (0,
|
|
54151
|
+
const pageActions = /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54152
|
+
publicReadOnly ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Badge, { variant: "neutral", className: "shrink-0", "data-public-read-only": "", children: PUBLIC_READ_ONLY }, "public-read-only") : null,
|
|
54153
|
+
!phone && rights.read && table.data ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53980
54154
|
TableAsk,
|
|
53981
54155
|
{
|
|
53982
54156
|
tableId,
|
|
@@ -53988,7 +54162,7 @@ function TablePage({
|
|
|
53988
54162
|
},
|
|
53989
54163
|
"ask"
|
|
53990
54164
|
) : null,
|
|
53991
|
-
organizationId ? /* @__PURE__ */ (0,
|
|
54165
|
+
organizationId ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { className: shareInMenu ? "hidden" : "flex shrink-0 items-center", "data-toolbar-fit": "share", children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
53992
54166
|
ShareControl,
|
|
53993
54167
|
{
|
|
53994
54168
|
kind: "table",
|
|
@@ -54002,28 +54176,28 @@ function TablePage({
|
|
|
54002
54176
|
},
|
|
54003
54177
|
`share-${shareAsked}`
|
|
54004
54178
|
) }, "share") : null,
|
|
54005
|
-
phone ? /* @__PURE__ */ (0,
|
|
54006
|
-
!chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ (0,
|
|
54007
|
-
/* @__PURE__ */ (0,
|
|
54008
|
-
/* @__PURE__ */ (0,
|
|
54179
|
+
phone ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54180
|
+
!chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenu, { children: [
|
|
54181
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "ghost", "aria-label": "Layout", title: "Layout", "data-table-layout-menu": "", children: "Layout" }) }),
|
|
54182
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuContent, { align: "end", className: "w-56", children: layoutRadio })
|
|
54009
54183
|
] }, "phone-layout") : null,
|
|
54010
54184
|
phoneTableActions(actions)
|
|
54011
|
-
] }) : /* @__PURE__ */ (0,
|
|
54012
|
-
/* @__PURE__ */ (0,
|
|
54013
|
-
/* @__PURE__ */ (0,
|
|
54014
|
-
/* @__PURE__ */ (0,
|
|
54015
|
-
/* @__PURE__ */ (0,
|
|
54185
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenu, { children: [
|
|
54186
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [
|
|
54187
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("circle", { cx: "5", cy: "12", r: "1.75" }),
|
|
54188
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("circle", { cx: "12", cy: "12", r: "1.75" }),
|
|
54189
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("circle", { cx: "19", cy: "12", r: "1.75" })
|
|
54016
54190
|
] }) }) }),
|
|
54017
|
-
/* @__PURE__ */ (0,
|
|
54018
|
-
!chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ (0,
|
|
54019
|
-
/* @__PURE__ */ (0,
|
|
54191
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenuContent, { align: "end", className: "w-64", "data-table-menu-content": "", ...renameMenuProps, children: [
|
|
54192
|
+
!chooserInline && !chooserCompact && !embedded ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54193
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: "Layout" }),
|
|
54020
54194
|
layoutRadio,
|
|
54021
|
-
/* @__PURE__ */ (0,
|
|
54195
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuSeparator, {})
|
|
54022
54196
|
] }) : null,
|
|
54023
|
-
/* @__PURE__ */ (0,
|
|
54197
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ObjectActionMenuItems, { actions })
|
|
54024
54198
|
] })
|
|
54025
54199
|
] }, "menu"),
|
|
54026
|
-
moveAsked > 0 && !actionHost?.move ? /* @__PURE__ */ (0,
|
|
54200
|
+
moveAsked > 0 && !actionHost?.move ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54027
54201
|
WhereItLives,
|
|
54028
54202
|
{
|
|
54029
54203
|
tableId,
|
|
@@ -54036,7 +54210,7 @@ function TablePage({
|
|
|
54036
54210
|
},
|
|
54037
54211
|
"move"
|
|
54038
54212
|
) : null,
|
|
54039
|
-
breakDownOpen ? /* @__PURE__ */ (0,
|
|
54213
|
+
breakDownOpen ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54040
54214
|
BreakDownDialog,
|
|
54041
54215
|
{
|
|
54042
54216
|
tableId,
|
|
@@ -54047,7 +54221,7 @@ function TablePage({
|
|
|
54047
54221
|
},
|
|
54048
54222
|
"break-down"
|
|
54049
54223
|
) : null,
|
|
54050
|
-
subscribeOpen && recordsUi.calendarFeed && organizationId && view ? /* @__PURE__ */ (0,
|
|
54224
|
+
subscribeOpen && recordsUi.calendarFeed && organizationId && view ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54051
54225
|
CalendarSubscribeDialog,
|
|
54052
54226
|
{
|
|
54053
54227
|
port: recordsUi.calendarFeed,
|
|
@@ -54060,8 +54234,8 @@ function TablePage({
|
|
|
54060
54234
|
},
|
|
54061
54235
|
"subscribe"
|
|
54062
54236
|
) : null,
|
|
54063
|
-
referenceOpen && table.data ? /* @__PURE__ */ (0,
|
|
54064
|
-
duplicateOpen && table.data ? /* @__PURE__ */ (0,
|
|
54237
|
+
referenceOpen && table.data ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TableReferenceDialog, { table: table.data, open: referenceOpen, onOpenChange: setReferenceOpen }, "reference") : null,
|
|
54238
|
+
duplicateOpen && table.data ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54065
54239
|
TableDuplicateDialog,
|
|
54066
54240
|
{
|
|
54067
54241
|
tableId,
|
|
@@ -54072,39 +54246,39 @@ function TablePage({
|
|
|
54072
54246
|
},
|
|
54073
54247
|
"duplicate"
|
|
54074
54248
|
) : null,
|
|
54075
|
-
rights.structure && table.data ? /* @__PURE__ */ (0,
|
|
54249
|
+
rights.structure && table.data ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TableRenameDialog, { tableId, name: table.data.name, open: renameOpen, onOpenChange: setRenameOpen }, "rename") : null
|
|
54076
54250
|
] });
|
|
54077
54251
|
const headerNode = header && !embedded ? header({ actions: table.data ? pageActions : null, tableName: table.data?.name ?? null }) : null;
|
|
54078
|
-
if (table.error) return /* @__PURE__ */ (0,
|
|
54252
|
+
if (table.error) return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54079
54253
|
headerNode,
|
|
54080
|
-
/* @__PURE__ */ (0,
|
|
54254
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(RefusalNotice, { error: table.error })
|
|
54081
54255
|
] });
|
|
54082
54256
|
if (table.loading && !table.data) {
|
|
54083
|
-
return /* @__PURE__ */ (0,
|
|
54257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54084
54258
|
headerNode,
|
|
54085
|
-
/* @__PURE__ */ (0,
|
|
54259
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TablePageSkeleton, { layout: skeletonFace, embedded, tableId, ...className ? { className } : {} })
|
|
54086
54260
|
] });
|
|
54087
54261
|
}
|
|
54088
54262
|
if (!table.data) {
|
|
54089
|
-
return /* @__PURE__ */ (0,
|
|
54263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54090
54264
|
headerNode,
|
|
54091
|
-
/* @__PURE__ */ (0,
|
|
54265
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TableNotHere, { tableId, onLeave, leaveLabel, className })
|
|
54092
54266
|
] });
|
|
54093
54267
|
}
|
|
54094
54268
|
const lookSavable = Boolean(
|
|
54095
54269
|
rights.write && view && Object.keys(viewPatchDocument((0, import_views3.saveToViewPlan)(view, look ?? {}).patch)).length > 0
|
|
54096
54270
|
);
|
|
54097
|
-
return /* @__PURE__ */ (0,
|
|
54271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ViewAddressContext.Provider, { value: addressPort, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: (0, import_design_system158.cn)("flex h-full min-h-0 gap-4", className), "data-table-footer": footer, children: [
|
|
54098
54272
|
headerNode,
|
|
54099
|
-
/* @__PURE__ */ (0,
|
|
54273
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2", children: structure.hidden || !structure.settled ? (
|
|
54100
54274
|
/* THE TOOLBAR ROW'S HEIGHT IS KEPT (min-h-8), so the sentence lands exactly where the bar was. */
|
|
54101
|
-
/* @__PURE__ */ (0,
|
|
54102
|
-
/* @__PURE__ */ (0,
|
|
54103
|
-
structure.hidden ? /* @__PURE__ */ (0,
|
|
54275
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54276
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "aria-hidden": "true" }),
|
|
54277
|
+
structure.hidden ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(StructureLocked, {}) : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(RecordsSkeleton, { layout: skeletonFace, embedded })
|
|
54104
54278
|
] })
|
|
54105
|
-
) : /* @__PURE__ */ (0,
|
|
54106
|
-
/* @__PURE__ */ (0,
|
|
54107
|
-
/* @__PURE__ */ (0,
|
|
54279
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_jsx_runtime176.Fragment, { children: [
|
|
54280
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ImportNotice, { tableId, epoch: importEpoch, onOpenImport: () => setRail("import") }),
|
|
54281
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(
|
|
54108
54282
|
"div",
|
|
54109
54283
|
{
|
|
54110
54284
|
ref: setToolbarRow,
|
|
@@ -54112,7 +54286,7 @@ function TablePage({
|
|
|
54112
54286
|
"data-table-toolbar": "",
|
|
54113
54287
|
"data-table-toolbar-fold": toolbarFold2,
|
|
54114
54288
|
children: [
|
|
54115
|
-
/* @__PURE__ */ (0,
|
|
54289
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54116
54290
|
ViewBar,
|
|
54117
54291
|
{
|
|
54118
54292
|
tableId,
|
|
@@ -54131,26 +54305,26 @@ function TablePage({
|
|
|
54131
54305
|
onViews: setViews,
|
|
54132
54306
|
...seededViews && viewsEpoch === 0 ? { initialViews: seededViews } : {},
|
|
54133
54307
|
seed: seedViews ?? [defaultView(tableId)],
|
|
54134
|
-
settings: view && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ (0,
|
|
54135
|
-
/* @__PURE__ */ (0,
|
|
54136
|
-
["sticky", "inline"].map((option) => /* @__PURE__ */ (0,
|
|
54308
|
+
settings: view && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("div", { className: "flex flex-col gap-0.5 px-1 py-1", role: "radiogroup", "aria-label": FOOTER_WORDS.label, children: [
|
|
54309
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { className: "px-1 pb-0.5 text-[11px] font-medium text-muted-foreground", children: FOOTER_WORDS.label }),
|
|
54310
|
+
["sticky", "inline"].map((option) => /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(
|
|
54137
54311
|
"button",
|
|
54138
54312
|
{
|
|
54139
54313
|
type: "button",
|
|
54140
54314
|
role: "radio",
|
|
54141
54315
|
"aria-checked": footer === option,
|
|
54142
54316
|
"data-view-footer": option,
|
|
54143
|
-
className: (0,
|
|
54317
|
+
className: (0, import_design_system158.cn)(
|
|
54144
54318
|
"flex min-h-7 items-center gap-2 rounded-sm px-1 text-left text-xs text-popover-foreground hover:bg-accent hover:text-accent-foreground",
|
|
54145
54319
|
footer === option && "font-medium"
|
|
54146
54320
|
),
|
|
54147
54321
|
onClick: () => setFooter(option),
|
|
54148
54322
|
children: [
|
|
54149
|
-
/* @__PURE__ */ (0,
|
|
54323
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54150
54324
|
"span",
|
|
54151
54325
|
{
|
|
54152
54326
|
"aria-hidden": "true",
|
|
54153
|
-
className: (0,
|
|
54327
|
+
className: (0, import_design_system158.cn)("h-2 w-2 shrink-0 rounded-full border border-current", footer === option && "bg-current")
|
|
54154
54328
|
}
|
|
54155
54329
|
),
|
|
54156
54330
|
FOOTER_WORDS[option]
|
|
@@ -54162,8 +54336,8 @@ function TablePage({
|
|
|
54162
54336
|
},
|
|
54163
54337
|
viewsEpoch
|
|
54164
54338
|
),
|
|
54165
|
-
chooserInline ? /* @__PURE__ */ (0,
|
|
54166
|
-
|
|
54339
|
+
chooserInline ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { className: "flex shrink-0 items-center gap-0.5", role: "group", "aria-label": "Layout", "data-toolbar-fit": "chooser", children: import_views2.VIEW_LAYOUTS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54340
|
+
import_design_system158.Button,
|
|
54167
54341
|
{
|
|
54168
54342
|
size: "sm",
|
|
54169
54343
|
variant: layoutShowing === option ? "secondary" : "ghost",
|
|
@@ -54177,21 +54351,21 @@ function TablePage({
|
|
|
54177
54351
|
/* THE ROW HAD NO ROOM (lane C, review 2026-09-26 D6: the switcher vanished at 1280 px and
|
|
54178
54352
|
with the record panel open): the chooser folds to ONE button naming the layout that is
|
|
54179
54353
|
showing — it never leaves the row. */
|
|
54180
|
-
/* @__PURE__ */ (0,
|
|
54181
|
-
/* @__PURE__ */ (0,
|
|
54354
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { className: "flex shrink-0 items-center", "data-toolbar-fit": "chooser", "data-layout-chooser-compact": "", children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenu, { children: [
|
|
54355
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.Button, { size: "sm", variant: "outline", className: "h-8 gap-1 px-2 text-xs", "aria-label": `Layout: ${layoutShowingLabel ?? "none"}`, children: [
|
|
54182
54356
|
layoutShowingLabel ?? "Layout",
|
|
54183
|
-
/* @__PURE__ */ (0,
|
|
54357
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5 opacity-70", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("path", { d: "m6 9 6 6 6-6" }) })
|
|
54184
54358
|
] }) }),
|
|
54185
|
-
/* @__PURE__ */ (0,
|
|
54186
|
-
/* @__PURE__ */ (0,
|
|
54359
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenuContent, { align: "start", className: "w-44", "data-layout-chooser-menu": "", children: [
|
|
54360
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: "Layout" }),
|
|
54187
54361
|
layoutRadio
|
|
54188
54362
|
] })
|
|
54189
54363
|
] }) })
|
|
54190
54364
|
) : null,
|
|
54191
|
-
main === "records" && !(controlsInSheet && shownLayout === "grid") ? /* @__PURE__ */ (0,
|
|
54192
|
-
lookShowing && main === "records" && !namingLook ? /* @__PURE__ */ (0,
|
|
54193
|
-
/* @__PURE__ */ (0,
|
|
54194
|
-
|
|
54365
|
+
main === "records" && !(controlsInSheet && shownLayout === "grid") ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ViewFilter, { tableId, view: shown5, onApply: (where) => void patchView({ where }) }) : null,
|
|
54366
|
+
lookShowing && main === "records" && !namingLook ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-view-look-folded": "", "data-toolbar-fit": "look", children: [
|
|
54367
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54368
|
+
import_design_system158.Button,
|
|
54195
54369
|
{
|
|
54196
54370
|
size: "sm",
|
|
54197
54371
|
variant: "outline",
|
|
@@ -54200,36 +54374,36 @@ function TablePage({
|
|
|
54200
54374
|
"aria-label": "Reset view",
|
|
54201
54375
|
onClick: () => void resetLook(),
|
|
54202
54376
|
"data-view-look-reset-button": "",
|
|
54203
|
-
children: /* @__PURE__ */ (0,
|
|
54204
|
-
/* @__PURE__ */ (0,
|
|
54205
|
-
/* @__PURE__ */ (0,
|
|
54377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
54378
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("path", { d: "M3 12a9 9 0 1 0 3-6.7L3 8" }),
|
|
54379
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("path", { d: "M3 3v5h5" })
|
|
54206
54380
|
] })
|
|
54207
54381
|
}
|
|
54208
54382
|
),
|
|
54209
|
-
/* @__PURE__ */ (0,
|
|
54210
|
-
/* @__PURE__ */ (0,
|
|
54211
|
-
/* @__PURE__ */ (0,
|
|
54212
|
-
/* @__PURE__ */ (0,
|
|
54383
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenu, { children: [
|
|
54384
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.Button, { size: "sm", variant: "outline", className: "relative h-8 w-8 shrink-0 px-0", title: LOOK_WORDS.folded, "aria-label": LOOK_WORDS.folded, "data-view-look-menu": "", children: [
|
|
54385
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(LookGlyph, {}),
|
|
54386
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { "aria-hidden": "true", className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-primary" })
|
|
54213
54387
|
] }) }),
|
|
54214
|
-
/* @__PURE__ */ (0,
|
|
54215
|
-
lookSavable ? /* @__PURE__ */ (0,
|
|
54216
|
-
rights.write ? /* @__PURE__ */ (0,
|
|
54217
|
-
/* @__PURE__ */ (0,
|
|
54388
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_design_system158.DropdownMenuContent, { align: "start", className: "w-60", "data-view-look-menu-content": "", children: [
|
|
54389
|
+
lookSavable ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuItem, { onSelect: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
|
|
54390
|
+
rights.write ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuItem, { onSelect: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
|
|
54391
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.DropdownMenuItem, { onSelect: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
|
|
54218
54392
|
] })
|
|
54219
54393
|
] })
|
|
54220
54394
|
] }) : !lookShowing && main === "records" && view && !phone && !controlsInSheet ? (
|
|
54221
54395
|
/* The reserved place keeps its full width at every row width (STABLE-TABLES): when it
|
|
54222
54396
|
shrank on a narrow row, the look arriving on a sort pushed every control after it.
|
|
54223
54397
|
A row too narrow for it scrolls sideways, as the row already does. */
|
|
54224
|
-
/* @__PURE__ */ (0,
|
|
54225
|
-
/* @__PURE__ */ (0,
|
|
54226
|
-
/* @__PURE__ */ (0,
|
|
54398
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("span", { "aria-hidden": "true", className: "invisible flex shrink-0 items-center gap-1 overflow-hidden", "data-view-look-place": "", "data-toolbar-fit-gives": "", children: [
|
|
54399
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(LookGlyph, {}) }),
|
|
54400
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "outline", className: "h-8 w-8 shrink-0 px-0", tabIndex: -1 })
|
|
54227
54401
|
] })
|
|
54228
|
-
) : lookShowing && main === "records" ? /* @__PURE__ */ (0,
|
|
54229
|
-
/* @__PURE__ */ (0,
|
|
54230
|
-
/* @__PURE__ */ (0,
|
|
54231
|
-
lookSavable ? /* @__PURE__ */ (0,
|
|
54232
|
-
rights.write ? namingLook ? /* @__PURE__ */ (0,
|
|
54402
|
+
) : lookShowing && main === "records" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("span", { className: "flex shrink-0 items-center gap-1", "data-view-look": "", "data-toolbar-fit": "look", title: LOOK_WORDS.yours, children: [
|
|
54403
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { className: "sr-only", children: LOOK_WORDS.yours }),
|
|
54404
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary" }),
|
|
54405
|
+
lookSavable ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "outline", className: "h-8 px-2 text-xs", onClick: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
|
|
54406
|
+
rights.write ? namingLook ? /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(
|
|
54233
54407
|
"form",
|
|
54234
54408
|
{
|
|
54235
54409
|
className: "flex items-center gap-1",
|
|
@@ -54238,8 +54412,8 @@ function TablePage({
|
|
|
54238
54412
|
void saveLookAsNewView(lookName);
|
|
54239
54413
|
},
|
|
54240
54414
|
children: [
|
|
54241
|
-
/* @__PURE__ */ (0,
|
|
54242
|
-
|
|
54415
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54416
|
+
import_design_system158.Input,
|
|
54243
54417
|
{
|
|
54244
54418
|
autoFocus: true,
|
|
54245
54419
|
"aria-label": LOOK_WORDS.newName,
|
|
@@ -54249,17 +54423,17 @@ function TablePage({
|
|
|
54249
54423
|
placeholder: "View name"
|
|
54250
54424
|
}
|
|
54251
54425
|
),
|
|
54252
|
-
/* @__PURE__ */ (0,
|
|
54426
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", type: "submit", className: "h-8 px-2 text-xs", disabled: lookName.trim() === "", children: "Save" })
|
|
54253
54427
|
]
|
|
54254
54428
|
}
|
|
54255
|
-
) : /* @__PURE__ */ (0,
|
|
54256
|
-
/* @__PURE__ */ (0,
|
|
54429
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
|
|
54430
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "ghost", className: "h-8 px-2 text-xs", onClick: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
|
|
54257
54431
|
] }) : null,
|
|
54258
|
-
/* @__PURE__ */ (0,
|
|
54432
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54259
54433
|
"div",
|
|
54260
54434
|
{
|
|
54261
54435
|
ref: setToolbarSlot,
|
|
54262
|
-
className: (0,
|
|
54436
|
+
className: (0, import_design_system158.cn)(
|
|
54263
54437
|
// `min-w-9`: never narrower than the layout toolbar's folded "…" (36 px) — a row too
|
|
54264
54438
|
// narrow for its pinned controls folds them behind that "…" (design-system
|
|
54265
54439
|
// `usePinnedFold`), and the "…" itself is never cut (merged-grid leftovers, 2026-09-28).
|
|
@@ -54277,9 +54451,9 @@ function TablePage({
|
|
|
54277
54451
|
"data-clipped": slotClipped
|
|
54278
54452
|
}
|
|
54279
54453
|
),
|
|
54280
|
-
rights.write && view && main === "records" && shownLayout !== "grid" ? /* @__PURE__ */ (0,
|
|
54281
|
-
openedFromMenu ? /* @__PURE__ */ (0,
|
|
54282
|
-
|
|
54454
|
+
rights.write && view && main === "records" && shownLayout !== "grid" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", className: "shrink-0", onClick: () => show("new-record"), children: "New record" }) : null,
|
|
54455
|
+
openedFromMenu ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54456
|
+
import_design_system158.Button,
|
|
54283
54457
|
{
|
|
54284
54458
|
size: "sm",
|
|
54285
54459
|
variant: "secondary",
|
|
@@ -54291,19 +54465,19 @@ function TablePage({
|
|
|
54291
54465
|
children: openedFromMenu.label
|
|
54292
54466
|
}
|
|
54293
54467
|
) : null,
|
|
54294
|
-
header ? null : /* @__PURE__ */ (0,
|
|
54468
|
+
header ? null : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("span", { className: "flex shrink-0 items-center gap-1", "data-table-page-actions": "", children: pageActions })
|
|
54295
54469
|
]
|
|
54296
54470
|
}
|
|
54297
54471
|
),
|
|
54298
|
-
designateRefused ? /* @__PURE__ */ (0,
|
|
54299
|
-
viewSaveRefused ? /* @__PURE__ */ (0,
|
|
54472
|
+
designateRefused ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(RefusalNotice, { error: designateRefused }) : null,
|
|
54473
|
+
viewSaveRefused ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54300
54474
|
RefusalNotice,
|
|
54301
54475
|
{
|
|
54302
54476
|
error: viewSaveRefused.error,
|
|
54303
|
-
actions: /* @__PURE__ */ (0,
|
|
54304
|
-
/* @__PURE__ */ (0,
|
|
54305
|
-
/* @__PURE__ */ (0,
|
|
54306
|
-
|
|
54477
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("span", { className: "flex flex-wrap gap-1 pt-0.5", "data-view-save-refused": "", children: [
|
|
54478
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_design_system158.Button, { size: "sm", variant: "outline", onClick: () => void patchView(viewSaveRefused.patch), children: "Try again" }),
|
|
54479
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54480
|
+
import_design_system158.Button,
|
|
54307
54481
|
{
|
|
54308
54482
|
size: "sm",
|
|
54309
54483
|
variant: "ghost",
|
|
@@ -54323,8 +54497,8 @@ function TablePage({
|
|
|
54323
54497
|
] })
|
|
54324
54498
|
}
|
|
54325
54499
|
) : null,
|
|
54326
|
-
lookRefused ? /* @__PURE__ */ (0,
|
|
54327
|
-
main === "dashboards" ? /* @__PURE__ */ (0,
|
|
54500
|
+
lookRefused ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(RefusalNotice, { error: lookRefused }) : null,
|
|
54501
|
+
main === "dashboards" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(DashboardCanvas, { tableId, activeDashboardId: activeDashboardId ?? null }) : main === "questions" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54328
54502
|
QuestionPanel,
|
|
54329
54503
|
{
|
|
54330
54504
|
tableId,
|
|
@@ -54336,7 +54510,7 @@ function TablePage({
|
|
|
54336
54510
|
page returns to the records rather than leaving the person looking
|
|
54337
54511
|
at a list the record is no longer in — and opens it, because the
|
|
54338
54512
|
thing they just rescued is the thing they came for. */
|
|
54339
|
-
/* @__PURE__ */ (0,
|
|
54513
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54340
54514
|
ArchivedView,
|
|
54341
54515
|
{
|
|
54342
54516
|
tableId,
|
|
@@ -54348,10 +54522,10 @@ function TablePage({
|
|
|
54348
54522
|
}
|
|
54349
54523
|
}
|
|
54350
54524
|
)
|
|
54351
|
-
) : /* @__PURE__ */ (0,
|
|
54525
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TableToolbarSlotContext.Provider, { value: toolbarSlot, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TableToolbarFoldContext.Provider, { value: toolbarFold2, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(TableToolbarSheetExtrasContext.Provider, { value: sheetExtras, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(
|
|
54352
54526
|
"div",
|
|
54353
54527
|
{
|
|
54354
|
-
className: (0,
|
|
54528
|
+
className: (0, import_design_system158.cn)(
|
|
54355
54529
|
"min-h-0 flex-1",
|
|
54356
54530
|
// Inline: a plain scrolling block, so nothing in it shrinks to the height — the
|
|
54357
54531
|
// layout is as tall as its rows and the footer follows the last one.
|
|
@@ -54359,10 +54533,10 @@ function TablePage({
|
|
|
54359
54533
|
),
|
|
54360
54534
|
"data-table-records": "",
|
|
54361
54535
|
children: [
|
|
54362
|
-
railUnknown ? /* @__PURE__ */ (0,
|
|
54363
|
-
shareFromLink && rights.known && (!rights.share || !canShare) ? /* @__PURE__ */ (0,
|
|
54364
|
-
opened.unknown ? /* @__PURE__ */ (0,
|
|
54365
|
-
viewLinkMissed ? /* @__PURE__ */ (0,
|
|
54536
|
+
railUnknown ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: unknownRailLine(railUnknown) }) : null,
|
|
54537
|
+
shareFromLink && rights.known && (!rights.share || !canShare) ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: canShare ? SHARE_NOT_YOURS_LINE : shareUnavailableReason() }) : null,
|
|
54538
|
+
opened.unknown ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "rounded-md border border-amber-600/40 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:border-amber-400/40 dark:text-amber-300", children: (0, import_views2.unknownViewLine)(opened.unknown) }) : null,
|
|
54539
|
+
viewLinkMissed ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54366
54540
|
"p",
|
|
54367
54541
|
{
|
|
54368
54542
|
"data-records-view-link-missed": "",
|
|
@@ -54370,7 +54544,7 @@ function TablePage({
|
|
|
54370
54544
|
children: unknownSavedViewLine(view?.name ?? null)
|
|
54371
54545
|
}
|
|
54372
54546
|
) : null,
|
|
54373
|
-
cameFrom ? /* @__PURE__ */ (0,
|
|
54547
|
+
cameFrom ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54374
54548
|
"p",
|
|
54375
54549
|
{
|
|
54376
54550
|
"data-testid": "came-from-a-number",
|
|
@@ -54380,7 +54554,7 @@ function TablePage({
|
|
|
54380
54554
|
) : null,
|
|
54381
54555
|
faceUnknown ? (
|
|
54382
54556
|
/* REVIEW-FIX 10: a full page paints the rows this table showed last time (else fills). */
|
|
54383
|
-
/* @__PURE__ */ (0,
|
|
54557
|
+
/* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54384
54558
|
RecordsSkeleton,
|
|
54385
54559
|
{
|
|
54386
54560
|
layout: skeletonFace,
|
|
@@ -54388,7 +54562,7 @@ function TablePage({
|
|
|
54388
54562
|
...embedded ? {} : { rows: rememberedRowCount(`${tableId}:page:last`, 100, "fill") }
|
|
54389
54563
|
}
|
|
54390
54564
|
)
|
|
54391
|
-
) : /* @__PURE__ */ (0,
|
|
54565
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54392
54566
|
ViewSwitcher,
|
|
54393
54567
|
{
|
|
54394
54568
|
chooser: false,
|
|
@@ -54430,19 +54604,20 @@ function TablePage({
|
|
|
54430
54604
|
},
|
|
54431
54605
|
openRecordId: rail === "record" ? openRecord : null,
|
|
54432
54606
|
onCloseRecord: () => setRail("none"),
|
|
54607
|
+
onRowsShown: setShownIds,
|
|
54433
54608
|
onAskWhoChanged: (fieldKey, recordId) => {
|
|
54434
54609
|
setAsking({ fieldKey, recordId });
|
|
54435
54610
|
setRail("who-changed");
|
|
54436
54611
|
}
|
|
54437
54612
|
}
|
|
54438
54613
|
),
|
|
54439
|
-
view || faceUnknown || views === void 0 || views !== null && views.length > 0 ? null : /* @__PURE__ */ (0,
|
|
54614
|
+
view || faceUnknown || views === void 0 || views !== null && views.length > 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("p", { className: "text-xs text-muted-foreground", children: VIEW_NOT_SAVED_YET })
|
|
54440
54615
|
]
|
|
54441
54616
|
}
|
|
54442
54617
|
) }) }) })
|
|
54443
54618
|
] }) }),
|
|
54444
|
-
rail === "none" ? null : /* @__PURE__ */ (0,
|
|
54445
|
-
rail === "settings" ? /* @__PURE__ */ (0,
|
|
54619
|
+
rail === "none" ? null : /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(RailFrame, { phone, title: RAIL_TITLE[rail], onClose: () => setRail("none"), over: rail === "record" && recordExpanded, children: [
|
|
54620
|
+
rail === "settings" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54446
54621
|
TableSettings,
|
|
54447
54622
|
{
|
|
54448
54623
|
tableId,
|
|
@@ -54459,7 +54634,7 @@ function TablePage({
|
|
|
54459
54634
|
} : void 0
|
|
54460
54635
|
}
|
|
54461
54636
|
) : null,
|
|
54462
|
-
rail === "inbox" ? /* @__PURE__ */ (0,
|
|
54637
|
+
rail === "inbox" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54463
54638
|
ActionInbox,
|
|
54464
54639
|
{
|
|
54465
54640
|
tableId,
|
|
@@ -54469,9 +54644,9 @@ function TablePage({
|
|
|
54469
54644
|
}
|
|
54470
54645
|
}
|
|
54471
54646
|
) : null,
|
|
54472
|
-
rail === "forms" ? /* @__PURE__ */ (0,
|
|
54473
|
-
rail === "bookings" ? /* @__PURE__ */ (0,
|
|
54474
|
-
rail === "checklists" ? /* @__PURE__ */ (0,
|
|
54647
|
+
rail === "forms" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(FormsPanel, { tableId, activeFormId: itemFor("forms") }) : null,
|
|
54648
|
+
rail === "bookings" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(BookingSlots, { tableId, activeBookingId: itemFor("bookings") }) : null,
|
|
54649
|
+
rail === "checklists" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54475
54650
|
ChecklistsPanel,
|
|
54476
54651
|
{
|
|
54477
54652
|
tableId,
|
|
@@ -54481,12 +54656,12 @@ function TablePage({
|
|
|
54481
54656
|
}
|
|
54482
54657
|
}
|
|
54483
54658
|
) : null,
|
|
54484
|
-
rail === "notifications" ? /* @__PURE__ */ (0,
|
|
54485
|
-
rail === "portals" ? /* @__PURE__ */ (0,
|
|
54486
|
-
rail === "export" ? /* @__PURE__ */ (0,
|
|
54487
|
-
rail === "import" ? /* @__PURE__ */ (0,
|
|
54488
|
-
rail === "field" ? /* @__PURE__ */ (0,
|
|
54489
|
-
rail === "new-record" ? /* @__PURE__ */ (0,
|
|
54659
|
+
rail === "notifications" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(SubscriptionsPanel, { tableId, activeRuleId: itemFor("notifications") }) : null,
|
|
54660
|
+
rail === "portals" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(PortalsPanel, { tableId, activePortalId: itemFor("portals") }) : null,
|
|
54661
|
+
rail === "export" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ExportMenu, { tableId, view: viewReading }) : null,
|
|
54662
|
+
rail === "import" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(ImportWizard, { tableId, onWrote: () => setImportEpoch((n) => n + 1), onDone: () => setRail("none") }) : null,
|
|
54663
|
+
rail === "field" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(FieldEditor, { tableId, onSaved: () => setRail("none"), onCancel: () => setRail("none") }) : null,
|
|
54664
|
+
rail === "new-record" ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54490
54665
|
RecordForm,
|
|
54491
54666
|
{
|
|
54492
54667
|
tableId,
|
|
@@ -54497,7 +54672,7 @@ function TablePage({
|
|
|
54497
54672
|
onCancel: () => setRail("none")
|
|
54498
54673
|
}
|
|
54499
54674
|
) : null,
|
|
54500
|
-
rail === "who-changed" && asking ? /* @__PURE__ */ (0,
|
|
54675
|
+
rail === "who-changed" && asking ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54501
54676
|
FieldHistoryPanel,
|
|
54502
54677
|
{
|
|
54503
54678
|
tableId,
|
|
@@ -54510,12 +54685,16 @@ function TablePage({
|
|
|
54510
54685
|
}
|
|
54511
54686
|
}
|
|
54512
54687
|
) : null,
|
|
54513
|
-
rail === "record" && openRecord ? /* @__PURE__ */ (0,
|
|
54688
|
+
rail === "record" && openRecord ? /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(
|
|
54514
54689
|
RecordPanel,
|
|
54515
54690
|
{
|
|
54516
54691
|
tableId,
|
|
54517
54692
|
recordId: openRecord,
|
|
54518
54693
|
onClose: () => setRail("none"),
|
|
54694
|
+
neighbors: neighborsOf(shownIds, openRecord),
|
|
54695
|
+
onStep: (to) => setOpenRecord(to),
|
|
54696
|
+
expanded: recordExpanded,
|
|
54697
|
+
onToggleExpand: () => setRecordExpanded((now) => !now),
|
|
54519
54698
|
onAskAboutField: (fieldKey) => {
|
|
54520
54699
|
setAsking({ fieldKey, recordId: openRecord });
|
|
54521
54700
|
setRail("who-changed");
|
|
@@ -54554,12 +54733,12 @@ function usePublicReadOnly(client, organizationId, tableId, table, rights) {
|
|
|
54554
54733
|
|
|
54555
54734
|
// src/entityViews.tsx
|
|
54556
54735
|
var import_format15 = require("@ai-matrx/kit/format");
|
|
54557
|
-
var
|
|
54736
|
+
var import_design_system159 = require("@ai-matrx/design-system");
|
|
54558
54737
|
var import_data_table25 = require("@ai-matrx/design-system/data-table");
|
|
54559
54738
|
var import_react313 = require("react");
|
|
54560
|
-
var
|
|
54739
|
+
var import_design_system160 = require("@ai-matrx/design-system");
|
|
54561
54740
|
var import_react314 = require("@ai-matrx/records/react");
|
|
54562
|
-
var
|
|
54741
|
+
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
54563
54742
|
var entityTitleColumn = entityNameColumn;
|
|
54564
54743
|
function shown4(v) {
|
|
54565
54744
|
if (v === null || v === void 0 || v === "") return "";
|
|
@@ -54575,9 +54754,9 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
54575
54754
|
);
|
|
54576
54755
|
const [refused, setRefused] = (0, import_react313.useState)(null);
|
|
54577
54756
|
const [over, setOver] = (0, import_react313.useState)(null);
|
|
54578
|
-
if (entity.error) return /* @__PURE__ */ (0,
|
|
54757
|
+
if (entity.error) return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This board could not be read: ${entity.error}` });
|
|
54579
54758
|
if (!entity.loading && !column) {
|
|
54580
|
-
return /* @__PURE__ */ (0,
|
|
54759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `${entity.label ?? "This table"} has no choice column to make a board of.` });
|
|
54581
54760
|
}
|
|
54582
54761
|
if (!column) return null;
|
|
54583
54762
|
const words2 = column.choices ?? [];
|
|
@@ -54595,14 +54774,14 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
54595
54774
|
const says = await entity.update(id, column, to);
|
|
54596
54775
|
if (says) setRefused({ to, says });
|
|
54597
54776
|
};
|
|
54598
|
-
return /* @__PURE__ */ (0,
|
|
54777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("div", { className: (0, import_design_system160.cn)("flex min-h-40 gap-2 overflow-x-auto pb-1", className), "data-records-entity-board": column.key, children: lanes.map((lane) => {
|
|
54599
54778
|
const cards = rowsOf2(lane.key);
|
|
54600
54779
|
if (lane.key === "" && cards.length === 0) return null;
|
|
54601
|
-
return /* @__PURE__ */ (0,
|
|
54780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(
|
|
54602
54781
|
"section",
|
|
54603
54782
|
{
|
|
54604
54783
|
"aria-label": lane.label,
|
|
54605
|
-
className: (0,
|
|
54784
|
+
className: (0, import_design_system160.cn)("flex w-60 shrink-0 flex-col gap-1.5 rounded-md bg-muted/40 p-1.5", over === lane.key && "ring-1 ring-ring"),
|
|
54606
54785
|
onDragOver: writable && lane.key ? (e) => {
|
|
54607
54786
|
e.preventDefault();
|
|
54608
54787
|
setOver(lane.key);
|
|
@@ -54610,12 +54789,12 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
54610
54789
|
onDragLeave: writable && lane.key ? () => setOver((o) => o === lane.key ? null : o) : void 0,
|
|
54611
54790
|
onDrop: writable && lane.key ? (e) => void drop(e, lane.key) : void 0,
|
|
54612
54791
|
children: [
|
|
54613
|
-
/* @__PURE__ */ (0,
|
|
54614
|
-
/* @__PURE__ */ (0,
|
|
54615
|
-
/* @__PURE__ */ (0,
|
|
54792
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsxs)("header", { className: "flex items-baseline gap-1.5 px-1 text-xs", children: [
|
|
54793
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)("span", { className: "truncate font-medium", children: lane.label }),
|
|
54794
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)("span", { className: "tabular-nums text-muted-foreground", children: cards.length })
|
|
54616
54795
|
] }),
|
|
54617
|
-
refused && refused.to === lane.key ? /* @__PURE__ */ (0,
|
|
54618
|
-
cards.map((row) => /* @__PURE__ */ (0,
|
|
54796
|
+
refused && refused.to === lane.key ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_design_system160.ErrorBox, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: refused.says, operation: "Move a card", origin: "records-ui/entityViews" }) : null,
|
|
54797
|
+
cards.map((row) => /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(
|
|
54619
54798
|
"article",
|
|
54620
54799
|
{
|
|
54621
54800
|
draggable: writable,
|
|
@@ -54623,11 +54802,11 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
54623
54802
|
e.dataTransfer.setData("text/x-entity-row", row._id);
|
|
54624
54803
|
e.dataTransfer.effectAllowed = "move";
|
|
54625
54804
|
},
|
|
54626
|
-
className: (0,
|
|
54805
|
+
className: (0, import_design_system160.cn)("flex flex-col gap-0.5 rounded border bg-card px-2 py-1.5 text-xs shadow-sm", writable && "cursor-grab"),
|
|
54627
54806
|
"data-records-entity-card": row._id,
|
|
54628
54807
|
children: [
|
|
54629
|
-
onOpenRecord ? /* @__PURE__ */ (0,
|
|
54630
|
-
extra.map((c) => entityValueText(c, entityCellValue(row, c)) ? /* @__PURE__ */ (0,
|
|
54808
|
+
onOpenRecord ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("button", { type: "button", className: "truncate text-left font-medium hover:underline", onClick: () => onOpenRecord(row._id), children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }) : /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("span", { className: "truncate font-medium", children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }),
|
|
54809
|
+
extra.map((c) => entityValueText(c, entityCellValue(row, c)) ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("span", { className: "truncate text-muted-foreground", children: entityValueText(c, entityCellValue(row, c)) }, c.key) : null)
|
|
54631
54810
|
]
|
|
54632
54811
|
},
|
|
54633
54812
|
row._id
|
|
@@ -54678,9 +54857,9 @@ function EntityChartBlock({ source, kind, by, measure, title, where, organizatio
|
|
|
54678
54857
|
};
|
|
54679
54858
|
}, [client, ask2, kind, title]);
|
|
54680
54859
|
if (!block) {
|
|
54681
|
-
return /* @__PURE__ */ (0,
|
|
54860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(RecordsSkeleton, { layout: "chart", embedded: variant === "bare", ...className ? { className } : {} });
|
|
54682
54861
|
}
|
|
54683
|
-
return /* @__PURE__ */ (0,
|
|
54862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
54684
54863
|
ChartBlock,
|
|
54685
54864
|
{
|
|
54686
54865
|
block,
|
|
@@ -54693,7 +54872,7 @@ function EntityChartBlock({ source, kind, by, measure, title, where, organizatio
|
|
|
54693
54872
|
);
|
|
54694
54873
|
}
|
|
54695
54874
|
function EntityTablePage(props) {
|
|
54696
|
-
return /* @__PURE__ */ (0,
|
|
54875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(EntityDataScope, { children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(EntityTablePageBody, { ...props }) });
|
|
54697
54876
|
}
|
|
54698
54877
|
function EntityTablePageBody({
|
|
54699
54878
|
source,
|
|
@@ -54743,21 +54922,21 @@ function EntityTablePageBody({
|
|
|
54743
54922
|
rowNoun: (entity.label ?? "record").toLowerCase(),
|
|
54744
54923
|
enabled: layout === "grid"
|
|
54745
54924
|
});
|
|
54746
|
-
return /* @__PURE__ */ (0,
|
|
54747
|
-
presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ (0,
|
|
54748
|
-
presentation === "page" ? /* @__PURE__ */ (0,
|
|
54749
|
-
presentation === "page" ? /* @__PURE__ */ (0,
|
|
54750
|
-
/* @__PURE__ */ (0,
|
|
54751
|
-
boardable ? /* @__PURE__ */ (0,
|
|
54752
|
-
/* @__PURE__ */ (0,
|
|
54753
|
-
/* @__PURE__ */ (0,
|
|
54925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)("div", { className: (0, import_design_system160.cn)("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
|
|
54926
|
+
presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
54927
|
+
presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
|
|
54928
|
+
presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : (0, import_format15.formatCount)(entity.total) }) : null,
|
|
54929
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsxs)("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
54930
|
+
boardable ? /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_jsx_runtime177.Fragment, { children: [
|
|
54931
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_design_system160.Button, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),
|
|
54932
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_design_system160.Button, { size: "sm", variant: layout === "board" ? "secondary" : "ghost", "aria-pressed": layout === "board", onClick: () => choose("board"), children: "Board" })
|
|
54754
54933
|
] }) : null,
|
|
54755
|
-
entity.creatable && naming === null ? /* @__PURE__ */ (0,
|
|
54934
|
+
entity.creatable && naming === null ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_design_system160.Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
54756
54935
|
setAddRefused(null);
|
|
54757
54936
|
setNaming("");
|
|
54758
54937
|
}, children: "New page" }) : null,
|
|
54759
|
-
entity.creatable && naming !== null ? /* @__PURE__ */ (0,
|
|
54760
|
-
|
|
54938
|
+
entity.creatable && naming !== null ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
54939
|
+
import_design_system160.Input,
|
|
54761
54940
|
{
|
|
54762
54941
|
autoFocus: true,
|
|
54763
54942
|
"data-records-entity-new": source.token,
|
|
@@ -54786,10 +54965,10 @@ function EntityTablePageBody({
|
|
|
54786
54965
|
actions
|
|
54787
54966
|
] })
|
|
54788
54967
|
] }) : null,
|
|
54789
|
-
addRefused ? /* @__PURE__ */ (0,
|
|
54790
|
-
entity.error ? /* @__PURE__ */ (0,
|
|
54791
|
-
presentation === "embedded" && searchBox ? /* @__PURE__ */ (0,
|
|
54792
|
-
|
|
54968
|
+
addRefused ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_design_system160.ErrorBox, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: addRefused, operation: "Add a row", origin: "records-ui/entityViews" }) : null,
|
|
54969
|
+
entity.error ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This table could not be read: ${entity.error}` }) : layout === "board" && boardable ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(EntityBoard, { entity, groupBy, onOpenRecord }) : /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_jsx_runtime177.Fragment, { children: [
|
|
54970
|
+
presentation === "embedded" && searchBox ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)("div", { className: "flex min-w-0 items-center justify-end", "data-records-entity-search": "", children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_design_system159.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
54971
|
+
import_design_system159.TapTargetSearchGroup,
|
|
54793
54972
|
{
|
|
54794
54973
|
surface: "solid",
|
|
54795
54974
|
placeholder: "Search",
|
|
@@ -54800,8 +54979,8 @@ function EntityTablePageBody({
|
|
|
54800
54979
|
}
|
|
54801
54980
|
}
|
|
54802
54981
|
) }) }) : null,
|
|
54803
|
-
/* @__PURE__ */ (0,
|
|
54804
|
-
entity.hasMore ? /* @__PURE__ */ (0,
|
|
54982
|
+
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(EntityGrid, { entity, pageSize, embedded: presentation === "embedded", ...drill ? { drill } : {} }),
|
|
54983
|
+
entity.hasMore ? /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
54805
54984
|
import_data_table25.MatrxTableCardShowMore,
|
|
54806
54985
|
{
|
|
54807
54986
|
shown: entity.rows.length,
|
|
@@ -54815,12 +54994,12 @@ function EntityTablePageBody({
|
|
|
54815
54994
|
}
|
|
54816
54995
|
|
|
54817
54996
|
// src/TablePageSource.tsx
|
|
54818
|
-
var
|
|
54997
|
+
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
54819
54998
|
function TablePage2(props) {
|
|
54820
|
-
if (props.source === void 0) return /* @__PURE__ */ (0,
|
|
54999
|
+
if (props.source === void 0) return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(TablePage, { ...props });
|
|
54821
55000
|
const { source, layout, onLayoutChange, groupBy, onOpenRecord, ...rest } = props;
|
|
54822
|
-
if (source.kind === "table") return /* @__PURE__ */ (0,
|
|
54823
|
-
return /* @__PURE__ */ (0,
|
|
55001
|
+
if (source.kind === "table") return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(TablePage, { ...rest, tableId: source.id });
|
|
55002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
|
|
54824
55003
|
EntityTablePage,
|
|
54825
55004
|
{
|
|
54826
55005
|
source,
|
|
@@ -54842,8 +55021,8 @@ function TablePage2(props) {
|
|
|
54842
55021
|
var import_react315 = require("react");
|
|
54843
55022
|
var import_records75 = require("@ai-matrx/records");
|
|
54844
55023
|
var import_react316 = require("@ai-matrx/records/react");
|
|
54845
|
-
var
|
|
54846
|
-
var
|
|
55024
|
+
var import_design_system161 = require("@ai-matrx/design-system");
|
|
55025
|
+
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
54847
55026
|
var DATA_BINDING_SHAPES = [
|
|
54848
55027
|
{ value: "collection", label: "The whole table" },
|
|
54849
55028
|
{ value: "reference", label: "One record" },
|
|
@@ -54910,9 +55089,9 @@ function DataBindingPicker({ dataSource, userId, binding, onChange, disabled, de
|
|
|
54910
55089
|
...binding.semantic_type === "collection" && defaultRowLimit ? { limit: defaultRowLimit } : {}
|
|
54911
55090
|
});
|
|
54912
55091
|
};
|
|
54913
|
-
return /* @__PURE__ */ (0,
|
|
54914
|
-
/* @__PURE__ */ (0,
|
|
54915
|
-
/* @__PURE__ */ (0,
|
|
55092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
55093
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(TablePicker, { dataSource, value: tableId, onChange: selectTable, disabled: Boolean(disabled), tables }),
|
|
55094
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(TableScope, { dataSource, userId, tableId, tables, children: tableId && /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
54916
55095
|
BindingDetails,
|
|
54917
55096
|
{
|
|
54918
55097
|
tableId,
|
|
@@ -54976,9 +55155,9 @@ function BindingDetails({
|
|
|
54976
55155
|
const fieldOptions = fieldList.map((f) => ({ value: f.key, label: fieldName(f) }));
|
|
54977
55156
|
const template = binding.transform?.template ?? "";
|
|
54978
55157
|
const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
|
|
54979
|
-
return /* @__PURE__ */ (0,
|
|
54980
|
-
/* @__PURE__ */ (0,
|
|
54981
|
-
|
|
55158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
55159
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.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_runtime179.jsx)(
|
|
55160
|
+
import_design_system161.Button,
|
|
54982
55161
|
{
|
|
54983
55162
|
type: "button",
|
|
54984
55163
|
size: "sm",
|
|
@@ -54991,7 +55170,7 @@ function BindingDetails({
|
|
|
54991
55170
|
},
|
|
54992
55171
|
s.value
|
|
54993
55172
|
)) }),
|
|
54994
|
-
shape !== "collection" && /* @__PURE__ */ (0,
|
|
55173
|
+
shape !== "collection" && /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
54995
55174
|
RecordPicker,
|
|
54996
55175
|
{
|
|
54997
55176
|
tableId,
|
|
@@ -55000,8 +55179,8 @@ function BindingDetails({
|
|
|
55000
55179
|
disabled: Boolean(disabled)
|
|
55001
55180
|
}
|
|
55002
55181
|
),
|
|
55003
|
-
shape === "value" && /* @__PURE__ */ (0,
|
|
55004
|
-
|
|
55182
|
+
shape === "value" && /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
55183
|
+
import_design_system161.CreatablePicker,
|
|
55005
55184
|
{
|
|
55006
55185
|
value: binding.field_key ?? null,
|
|
55007
55186
|
options: fieldOptions,
|
|
@@ -55014,11 +55193,11 @@ function BindingDetails({
|
|
|
55014
55193
|
ariaLabel: "Column"
|
|
55015
55194
|
}
|
|
55016
55195
|
),
|
|
55017
|
-
shape !== "value" && /* @__PURE__ */ (0,
|
|
55018
|
-
/* @__PURE__ */ (0,
|
|
55196
|
+
shape !== "value" && /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
55197
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
55019
55198
|
"textarea",
|
|
55020
55199
|
{
|
|
55021
|
-
className: (0,
|
|
55200
|
+
className: (0, import_design_system161.cn)(
|
|
55022
55201
|
"min-h-[3.5rem] w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs"
|
|
55023
55202
|
),
|
|
55024
55203
|
"aria-label": "Each row reads as",
|
|
@@ -55027,8 +55206,8 @@ function BindingDetails({
|
|
|
55027
55206
|
onChange: (e) => setTemplate(e.target.value)
|
|
55028
55207
|
}
|
|
55029
55208
|
),
|
|
55030
|
-
!disabled && /* @__PURE__ */ (0,
|
|
55031
|
-
|
|
55209
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime179.jsx)("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
55210
|
+
import_design_system161.Button,
|
|
55032
55211
|
{
|
|
55033
55212
|
type: "button",
|
|
55034
55213
|
size: "sm",
|
|
@@ -55040,10 +55219,10 @@ function BindingDetails({
|
|
|
55040
55219
|
p.token
|
|
55041
55220
|
)) })
|
|
55042
55221
|
] }),
|
|
55043
|
-
shape === "collection" && /* @__PURE__ */ (0,
|
|
55222
|
+
shape === "collection" && /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
55044
55223
|
"Up to",
|
|
55045
|
-
/* @__PURE__ */ (0,
|
|
55046
|
-
|
|
55224
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
55225
|
+
import_design_system161.BasicInput,
|
|
55047
55226
|
{
|
|
55048
55227
|
type: "number",
|
|
55049
55228
|
min: 1,
|
|
@@ -55059,10 +55238,10 @@ function BindingDetails({
|
|
|
55059
55238
|
),
|
|
55060
55239
|
"rows"
|
|
55061
55240
|
] }),
|
|
55062
|
-
/* @__PURE__ */ (0,
|
|
55063
|
-
/* @__PURE__ */ (0,
|
|
55064
|
-
DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ (0,
|
|
55065
|
-
|
|
55241
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
|
|
55242
|
+
/* @__PURE__ */ (0, import_jsx_runtime179.jsx)("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
|
|
55243
|
+
DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(
|
|
55244
|
+
import_design_system161.Button,
|
|
55066
55245
|
{
|
|
55067
55246
|
type: "button",
|
|
55068
55247
|
size: "sm",
|
|
@@ -55081,13 +55260,13 @@ function BindingDetails({
|
|
|
55081
55260
|
|
|
55082
55261
|
// src/PickedSummaries.tsx
|
|
55083
55262
|
var import_react317 = require("@ai-matrx/records/react");
|
|
55084
|
-
var
|
|
55263
|
+
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
55085
55264
|
function TableNameText({ dataSource, tableId }) {
|
|
55086
55265
|
const tables = useTablesAnywhere(dataSource);
|
|
55087
|
-
if (!tableId) return /* @__PURE__ */ (0,
|
|
55088
|
-
if (tables.loading) return /* @__PURE__ */ (0,
|
|
55089
|
-
if (tables.error) return /* @__PURE__ */ (0,
|
|
55090
|
-
return /* @__PURE__ */ (0,
|
|
55266
|
+
if (!tableId) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2014" });
|
|
55267
|
+
if (tables.loading) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2026" });
|
|
55268
|
+
if (tables.error) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "Couldn't load the table's name" });
|
|
55269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: tables.rows.find((t) => t.table_id === tableId)?.table_name ?? "\u2014" });
|
|
55091
55270
|
}
|
|
55092
55271
|
function ColumnValuesText({
|
|
55093
55272
|
dataSource,
|
|
@@ -55095,38 +55274,38 @@ function ColumnValuesText({
|
|
|
55095
55274
|
tableId,
|
|
55096
55275
|
value
|
|
55097
55276
|
}) {
|
|
55098
|
-
if (!tableId) return /* @__PURE__ */ (0,
|
|
55099
|
-
return /* @__PURE__ */ (0,
|
|
55277
|
+
if (!tableId) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2014" });
|
|
55278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
55100
55279
|
TableScope,
|
|
55101
55280
|
{
|
|
55102
55281
|
dataSource,
|
|
55103
55282
|
userId,
|
|
55104
55283
|
tableId,
|
|
55105
|
-
fallback: /* @__PURE__ */ (0,
|
|
55106
|
-
unavailable: /* @__PURE__ */ (0,
|
|
55107
|
-
children: /* @__PURE__ */ (0,
|
|
55284
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2026" }),
|
|
55285
|
+
unavailable: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "Couldn't load this table's columns" }),
|
|
55286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(RecordLabelProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(ColumnValuesWords, { tableId, value }) })
|
|
55108
55287
|
}
|
|
55109
55288
|
);
|
|
55110
55289
|
}
|
|
55111
55290
|
function ColumnValuesWords({ tableId, value }) {
|
|
55112
55291
|
const fields = (0, import_react317.useFields)(tableId);
|
|
55113
55292
|
const labels = useRecordLabels(fields.data ?? void 0);
|
|
55114
|
-
if (fields.loading) return /* @__PURE__ */ (0,
|
|
55115
|
-
if (fields.error) return /* @__PURE__ */ (0,
|
|
55293
|
+
if (fields.loading) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2026" });
|
|
55294
|
+
if (fields.error) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "Couldn't load this table's columns" });
|
|
55116
55295
|
const parts = [];
|
|
55117
55296
|
for (const [key, stored] of Object.entries(value)) {
|
|
55118
55297
|
if (key.startsWith("_")) continue;
|
|
55119
55298
|
const field2 = (fields.data ?? []).find((f) => f.key === key);
|
|
55120
|
-
if (parts.length) parts.push(/* @__PURE__ */ (0,
|
|
55299
|
+
if (parts.length) parts.push(/* @__PURE__ */ (0, import_jsx_runtime180.jsx)("span", { children: ", " }, `${key}-sep`));
|
|
55121
55300
|
parts.push(
|
|
55122
|
-
/* @__PURE__ */ (0,
|
|
55301
|
+
/* @__PURE__ */ (0, import_jsx_runtime180.jsxs)("span", { children: [
|
|
55123
55302
|
field2 ? fieldName(field2) : "A removed column",
|
|
55124
55303
|
" is ",
|
|
55125
55304
|
field2 ? renderValue(field2, stored, void 0, labels) : "\u2014"
|
|
55126
55305
|
] }, key)
|
|
55127
55306
|
);
|
|
55128
55307
|
}
|
|
55129
|
-
return parts.length ? /* @__PURE__ */ (0,
|
|
55308
|
+
return parts.length ? /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: parts }) : /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2014" });
|
|
55130
55309
|
}
|
|
55131
55310
|
function RecordNameText({
|
|
55132
55311
|
dataSource,
|
|
@@ -55134,35 +55313,35 @@ function RecordNameText({
|
|
|
55134
55313
|
tableId,
|
|
55135
55314
|
recordId
|
|
55136
55315
|
}) {
|
|
55137
|
-
if (!tableId || !recordId) return /* @__PURE__ */ (0,
|
|
55138
|
-
return /* @__PURE__ */ (0,
|
|
55316
|
+
if (!tableId || !recordId) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2014" });
|
|
55317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
55139
55318
|
TableScope,
|
|
55140
55319
|
{
|
|
55141
55320
|
dataSource,
|
|
55142
55321
|
userId,
|
|
55143
55322
|
tableId,
|
|
55144
|
-
fallback: /* @__PURE__ */ (0,
|
|
55145
|
-
unavailable: /* @__PURE__ */ (0,
|
|
55146
|
-
children: /* @__PURE__ */ (0,
|
|
55323
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2026" }),
|
|
55324
|
+
unavailable: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "Couldn't load this record" }),
|
|
55325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(RecordNameWords, { tableId, recordId })
|
|
55147
55326
|
}
|
|
55148
55327
|
);
|
|
55149
55328
|
}
|
|
55150
55329
|
function RecordNameWords({ tableId, recordId }) {
|
|
55151
55330
|
const table = (0, import_react317.useTable)(tableId);
|
|
55152
55331
|
const record = (0, import_react317.useRecord)(recordId);
|
|
55153
|
-
if (record.loading || table.loading) return /* @__PURE__ */ (0,
|
|
55154
|
-
if (record.error) return /* @__PURE__ */ (0,
|
|
55155
|
-
if (!record.data) return /* @__PURE__ */ (0,
|
|
55156
|
-
return /* @__PURE__ */ (0,
|
|
55332
|
+
if (record.loading || table.loading) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "\u2026" });
|
|
55333
|
+
if (record.error) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "Couldn't load this record" });
|
|
55334
|
+
if (!record.data) return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: "A record you cannot open" });
|
|
55335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_jsx_runtime180.Fragment, { children: recordName(record.data.document, table.data?.title_field ?? null) });
|
|
55157
55336
|
}
|
|
55158
55337
|
|
|
55159
55338
|
// src/HeldChangeDecision.tsx
|
|
55160
55339
|
var import_react318 = require("react");
|
|
55161
55340
|
var import_react319 = require("@ai-matrx/records/react");
|
|
55162
|
-
var
|
|
55163
|
-
var
|
|
55341
|
+
var import_design_system162 = require("@ai-matrx/design-system");
|
|
55342
|
+
var import_jsx_runtime181 = require("react/jsx-runtime");
|
|
55164
55343
|
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
|
|
55165
|
-
return /* @__PURE__ */ (0,
|
|
55344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_react319.RecordsProvider, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(Decision, { approvalId, onDecided, approveLabel: approveLabel ?? "Approve" }) });
|
|
55166
55345
|
}
|
|
55167
55346
|
function Decision({
|
|
55168
55347
|
approvalId,
|
|
@@ -55195,20 +55374,20 @@ function Decision({
|
|
|
55195
55374
|
if (res.ok) onDecided(approve);
|
|
55196
55375
|
else setError(res.error);
|
|
55197
55376
|
};
|
|
55198
|
-
if (may === null) return /* @__PURE__ */ (0,
|
|
55199
|
-
return /* @__PURE__ */ (0,
|
|
55200
|
-
may ? /* @__PURE__ */ (0,
|
|
55201
|
-
/* @__PURE__ */ (0,
|
|
55202
|
-
/* @__PURE__ */ (0,
|
|
55203
|
-
] }) : !error && /* @__PURE__ */ (0,
|
|
55204
|
-
error ? /* @__PURE__ */ (0,
|
|
55377
|
+
if (may === null) return /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
|
|
55378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
55379
|
+
may ? /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)("div", { className: "flex gap-2", children: [
|
|
55380
|
+
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_design_system162.Button, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
|
|
55381
|
+
/* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_design_system162.Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
|
|
55382
|
+
] }) : !error && /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
|
|
55383
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(RefusalLine, { error }) : null
|
|
55205
55384
|
] });
|
|
55206
55385
|
}
|
|
55207
55386
|
|
|
55208
55387
|
// src/CalendarLinks.tsx
|
|
55209
55388
|
var import_react320 = require("react");
|
|
55210
|
-
var
|
|
55211
|
-
var
|
|
55389
|
+
var import_design_system163 = require("@ai-matrx/design-system");
|
|
55390
|
+
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
55212
55391
|
var day = (iso) => iso ? new Date(iso).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }) : null;
|
|
55213
55392
|
function CalendarLinks({ port }) {
|
|
55214
55393
|
const [rows, setRows] = (0, import_react320.useState)(null);
|
|
@@ -55233,15 +55412,15 @@ function CalendarLinks({ port }) {
|
|
|
55233
55412
|
setError(asRefusal3(e, "That didn\u2019t work"));
|
|
55234
55413
|
}
|
|
55235
55414
|
};
|
|
55236
|
-
if (rows === null && !error) return /* @__PURE__ */ (0,
|
|
55237
|
-
return /* @__PURE__ */ (0,
|
|
55238
|
-
error ? /* @__PURE__ */ (0,
|
|
55239
|
-
rows && rows.length === 0 ? /* @__PURE__ */ (0,
|
|
55240
|
-
rows?.map((row) => /* @__PURE__ */ (0,
|
|
55241
|
-
/* @__PURE__ */ (0,
|
|
55242
|
-
/* @__PURE__ */ (0,
|
|
55243
|
-
/* @__PURE__ */ (0,
|
|
55244
|
-
/* @__PURE__ */ (0,
|
|
55415
|
+
if (rows === null && !error) return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("p", { className: "text-sm text-muted-foreground", "data-calendar-links-loading": "", children: "Reading your links\u2026" });
|
|
55416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("div", { className: "flex flex-col gap-2", "data-calendar-links": "", children: [
|
|
55417
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(RefusalNotice, { error }) : null,
|
|
55418
|
+
rows && rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("p", { className: "text-sm text-muted-foreground", children: "No calendar links yet." }) : null,
|
|
55419
|
+
rows?.map((row) => /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("div", { className: "flex flex-col gap-2 rounded-md border px-3 py-2", "data-calendar-link-row": row.id, children: [
|
|
55420
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
55421
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("div", { className: "min-w-0", children: [
|
|
55422
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)("div", { className: "truncate text-sm font-medium", children: row.title }),
|
|
55423
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("div", { className: "text-xs text-muted-foreground", children: [
|
|
55245
55424
|
"Made ",
|
|
55246
55425
|
day(row.created_at),
|
|
55247
55426
|
" \xB7 ",
|
|
@@ -55250,9 +55429,9 @@ function CalendarLinks({ port }) {
|
|
|
55250
55429
|
row.expired ? "Expired" : row.expires_at ? `Expires ${day(row.expires_at)}` : "Never expires"
|
|
55251
55430
|
] })
|
|
55252
55431
|
] }),
|
|
55253
|
-
/* @__PURE__ */ (0,
|
|
55254
|
-
/* @__PURE__ */ (0,
|
|
55255
|
-
|
|
55432
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("div", { className: "flex shrink-0 gap-2", children: [
|
|
55433
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
55434
|
+
import_design_system163.Button,
|
|
55256
55435
|
{
|
|
55257
55436
|
size: "sm",
|
|
55258
55437
|
variant: "outline",
|
|
@@ -55265,8 +55444,8 @@ function CalendarLinks({ port }) {
|
|
|
55265
55444
|
children: "Rotate"
|
|
55266
55445
|
}
|
|
55267
55446
|
),
|
|
55268
|
-
/* @__PURE__ */ (0,
|
|
55269
|
-
|
|
55447
|
+
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
55448
|
+
import_design_system163.Button,
|
|
55270
55449
|
{
|
|
55271
55450
|
size: "sm",
|
|
55272
55451
|
variant: "outline",
|
|
@@ -55281,7 +55460,7 @@ function CalendarLinks({ port }) {
|
|
|
55281
55460
|
)
|
|
55282
55461
|
] })
|
|
55283
55462
|
] }),
|
|
55284
|
-
fresh?.id === row.id ? /* @__PURE__ */ (0,
|
|
55463
|
+
fresh?.id === row.id ? /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(CalendarLinkOnce, { url: fresh.url }) : null
|
|
55285
55464
|
] }, row.id))
|
|
55286
55465
|
] });
|
|
55287
55466
|
}
|
|
@@ -55291,7 +55470,7 @@ var import_react321 = require("react");
|
|
|
55291
55470
|
var import_memory = require("@ai-matrx/records/memory");
|
|
55292
55471
|
var import_react322 = require("@ai-matrx/records/react");
|
|
55293
55472
|
var import_forms7 = require("@ai-matrx/records/forms");
|
|
55294
|
-
var
|
|
55473
|
+
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
55295
55474
|
function useTemplatePreview(spec, today) {
|
|
55296
55475
|
return (0, import_react321.useMemo)(() => (0, import_memory.templatePreview)(spec, today ? { today } : {}), [spec, today]);
|
|
55297
55476
|
}
|
|
@@ -55302,9 +55481,9 @@ function TemplatePreview({ spec, today, initialTable, host, aside, booking, clas
|
|
|
55302
55481
|
const [active, setActive] = (0, import_react321.useState)(first?.id ?? null);
|
|
55303
55482
|
const table = preview.tables.find((t) => t.id === active) ?? first;
|
|
55304
55483
|
if (!table) return null;
|
|
55305
|
-
return /* @__PURE__ */ (0,
|
|
55306
|
-
preview.tables.length > 1 || aside ? /* @__PURE__ */ (0,
|
|
55307
|
-
preview.tables.map((t) => /* @__PURE__ */ (0,
|
|
55484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)("div", { className: ["flex min-w-0 flex-col gap-3", className].filter(Boolean).join(" "), "data-template-preview": preview.tables.length, children: [
|
|
55485
|
+
preview.tables.length > 1 || aside ? /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", role: "tablist", "aria-label": "Tables", children: [
|
|
55486
|
+
preview.tables.map((t) => /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(
|
|
55308
55487
|
"button",
|
|
55309
55488
|
{
|
|
55310
55489
|
type: "button",
|
|
@@ -55318,19 +55497,19 @@ function TemplatePreview({ spec, today, initialTable, host, aside, booking, clas
|
|
|
55318
55497
|
].join(" "),
|
|
55319
55498
|
children: [
|
|
55320
55499
|
t.name,
|
|
55321
|
-
/* @__PURE__ */ (0,
|
|
55500
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: t.rows })
|
|
55322
55501
|
]
|
|
55323
55502
|
},
|
|
55324
55503
|
t.id
|
|
55325
55504
|
)),
|
|
55326
|
-
aside ? /* @__PURE__ */ (0,
|
|
55505
|
+
aside ? /* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: "ml-auto", children: aside }) : null
|
|
55327
55506
|
] }) : null,
|
|
55328
|
-
/* @__PURE__ */ (0,
|
|
55329
|
-
/* @__PURE__ */ (0,
|
|
55330
|
-
/* @__PURE__ */ (0,
|
|
55331
|
-
preview.dashboards.length ? /* @__PURE__ */ (0,
|
|
55332
|
-
/* @__PURE__ */ (0,
|
|
55333
|
-
preview.dashboards.map((d) => /* @__PURE__ */ (0,
|
|
55507
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(RecordsMount, { config: preview.config, host: bound2, children: [
|
|
55508
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: "min-h-[32rem] min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(TablePage, { tableId: table.id }, table.id) }),
|
|
55509
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)(PreviewForms, { preview, booking }),
|
|
55510
|
+
preview.dashboards.length ? /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Dashboards", "data-template-preview-dashboards": preview.dashboards.length, children: [
|
|
55511
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("h2", { className: "text-lg font-semibold tracking-tight", children: "Dashboards" }),
|
|
55512
|
+
preview.dashboards.map((d) => /* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card p-3", "data-template-preview-dashboard": d.token, children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(DashboardCanvas, { tableId: d.tableId, activeDashboardId: d.id }) }, d.id))
|
|
55334
55513
|
] }) : null
|
|
55335
55514
|
] })
|
|
55336
55515
|
] });
|
|
@@ -55358,14 +55537,14 @@ function PreviewForms({ preview, booking }) {
|
|
|
55358
55537
|
};
|
|
55359
55538
|
}, [client, preview, booking]);
|
|
55360
55539
|
if (!forms?.length && !pages.length) return null;
|
|
55361
|
-
return /* @__PURE__ */ (0,
|
|
55362
|
-
/* @__PURE__ */ (0,
|
|
55363
|
-
/* @__PURE__ */ (0,
|
|
55364
|
-
/* @__PURE__ */ (0,
|
|
55365
|
-
/* @__PURE__ */ (0,
|
|
55540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Forms and booking", "data-template-preview-forms": forms?.length ?? 0, children: [
|
|
55541
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("h2", { className: "text-lg font-semibold tracking-tight", children: "Forms and booking" }),
|
|
55542
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: "grid min-w-0 gap-4 md:grid-cols-2", children: (forms ?? []).map((f) => /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-form": f.slug ?? f.id, children: [
|
|
55543
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("h3", { className: "mb-3 text-sm font-semibold", children: f.name }),
|
|
55544
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)(FormRunner, { form: f, preview: true })
|
|
55366
55545
|
] }, f.id)) }),
|
|
55367
|
-
booking ? pages.map((p) => /* @__PURE__ */ (0,
|
|
55368
|
-
/* @__PURE__ */ (0,
|
|
55546
|
+
booking ? pages.map((p) => /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-booking": p.id, children: [
|
|
55547
|
+
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("h3", { className: "mb-3 text-sm font-semibold", children: String(p.page["title"] ?? "") }),
|
|
55369
55548
|
booking(p.page)
|
|
55370
55549
|
] }, p.id)) : null
|
|
55371
55550
|
] });
|