@ai-matrx/records-ui 0.115.78 → 0.115.80
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 +29 -1
- package/dist/index.cjs +220 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +578 -428
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +129 -49
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +162 -82
- package/dist/pickers.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3755,7 +3755,7 @@ import { useCallback as useCallback10, useEffect as useEffect25, useMemo as useM
|
|
|
3755
3755
|
import { isButtonField as isButtonField4 } from "@ai-matrx/records";
|
|
3756
3756
|
import { asWriteConflict, wholeValueOf as wholeValueOf2 } from "@ai-matrx/records/core";
|
|
3757
3757
|
import { useRecordsClient as useRecordsClient13 } from "@ai-matrx/records/react";
|
|
3758
|
-
import { Button as Button20, Checkbox as Checkbox6, Popover as Popover8, PopoverContent as PopoverContent8, PopoverTrigger as PopoverTrigger8, cn as
|
|
3758
|
+
import { Button as Button20, Checkbox as Checkbox6, Popover as Popover8, PopoverContent as PopoverContent8, PopoverTrigger as PopoverTrigger8, cn as cn27 } from "@ai-matrx/design-system";
|
|
3759
3759
|
|
|
3760
3760
|
// src/presentation.ts
|
|
3761
3761
|
import { COLOR_ROTATION, parseTableStyle, tableStyleIsEmpty } from "@ai-matrx/design-system/data-table/table-style";
|
|
@@ -4521,7 +4521,7 @@ import {
|
|
|
4521
4521
|
SelectItem as SelectItem7,
|
|
4522
4522
|
SelectTrigger as SelectTrigger7,
|
|
4523
4523
|
SelectValue as SelectValue7,
|
|
4524
|
-
cn as
|
|
4524
|
+
cn as cn26
|
|
4525
4525
|
} from "@ai-matrx/design-system";
|
|
4526
4526
|
|
|
4527
4527
|
// src/newerKindValues.tsx
|
|
@@ -5173,7 +5173,7 @@ function RelationPicker({ field: field2, value, onChange, disabled, id, classNam
|
|
|
5173
5173
|
|
|
5174
5174
|
// src/buttonCell.tsx
|
|
5175
5175
|
import { useState as useState28 } from "react";
|
|
5176
|
-
import { Button as Button18, Dialog as Dialog2, DialogContent as DialogContent2, DialogDescription, DialogHeader as DialogHeader2, DialogTitle as DialogTitle2, Popover as Popover5, PopoverContent as PopoverContent5, PopoverTrigger as PopoverTrigger5, cn as
|
|
5176
|
+
import { Button as Button18, Dialog as Dialog2, DialogContent as DialogContent2, DialogDescription, DialogHeader as DialogHeader2, DialogTitle as DialogTitle2, Popover as Popover5, PopoverContent as PopoverContent5, PopoverTrigger as PopoverTrigger5, cn as cn24 } from "@ai-matrx/design-system";
|
|
5177
5177
|
import { CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS2, NEUTRAL_CHIP_CLASS as NEUTRAL_CHIP_CLASS2, isStyleColor as isStyleColor2 } from "@ai-matrx/design-system/data-table";
|
|
5178
5178
|
import { buttonNeeds as buttonNeeds2, buttonOf as buttonOf2 } from "@ai-matrx/records";
|
|
5179
5179
|
import { useOptionalRecordsClient as useOptionalRecordsClient9 } from "@ai-matrx/records/react";
|
|
@@ -5241,7 +5241,7 @@ import {
|
|
|
5241
5241
|
SelectTrigger as SelectTrigger6,
|
|
5242
5242
|
SelectValue as SelectValue6,
|
|
5243
5243
|
Separator,
|
|
5244
|
-
cn as
|
|
5244
|
+
cn as cn23
|
|
5245
5245
|
} from "@ai-matrx/design-system";
|
|
5246
5246
|
|
|
5247
5247
|
// src/FormulaTextEditor.tsx
|
|
@@ -5574,7 +5574,7 @@ function WithheldValue({ field: field2, notice }) {
|
|
|
5574
5574
|
}
|
|
5575
5575
|
|
|
5576
5576
|
// src/values.tsx
|
|
5577
|
-
import { Badge as Badge5, cn as
|
|
5577
|
+
import { Badge as Badge5, cn as cn21 } from "@ai-matrx/design-system";
|
|
5578
5578
|
|
|
5579
5579
|
// src/embeddedLook.tsx
|
|
5580
5580
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
@@ -6210,7 +6210,7 @@ function linkChipText(raw) {
|
|
|
6210
6210
|
// src/gridAttachments.tsx
|
|
6211
6211
|
import { useEffect as useEffect14, useRef as useRef12, useState as useState20 } from "react";
|
|
6212
6212
|
import { useOptionalRecordsClient as useOptionalRecordsClient6 } from "@ai-matrx/records/react";
|
|
6213
|
-
import { Badge as Badge3, Button as Button12, Dialog, DialogContent, DialogHeader, DialogTitle } from "@ai-matrx/design-system";
|
|
6213
|
+
import { Badge as Badge3, Button as Button12, cn as cn18, Dialog, DialogContent, DialogHeader, DialogTitle } from "@ai-matrx/design-system";
|
|
6214
6214
|
|
|
6215
6215
|
// src/FilePicker.tsx
|
|
6216
6216
|
import { useCallback as useCallback5, useId, useRef as useRef11, useState as useState19 } from "react";
|
|
@@ -6366,46 +6366,63 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
6366
6366
|
const words2 = read?.name ?? (read ? FILE_CHIP_UNREAD : "\u2026");
|
|
6367
6367
|
const href = read?.fileId ? host.hrefForFile?.({ fileId: read.fileId }) : void 0;
|
|
6368
6368
|
const title = onPreview ? `Preview ${words2}` : href ? `Open ${words2}` : read?.why ?? FILE_CHIP_NO_PAGE;
|
|
6369
|
-
return /* @__PURE__ */ jsxs22(
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6369
|
+
return /* @__PURE__ */ jsxs22(
|
|
6370
|
+
Badge3,
|
|
6371
|
+
{
|
|
6372
|
+
variant: "secondary",
|
|
6373
|
+
className: cn18("max-w-[14rem] gap-1 text-[11px]", onPreview && "cursor-pointer"),
|
|
6374
|
+
"data-records-file-chip": id,
|
|
6375
|
+
title,
|
|
6376
|
+
...onPreview ? {
|
|
6376
6377
|
onClick: (event) => {
|
|
6377
6378
|
event.stopPropagation();
|
|
6378
6379
|
onPreview();
|
|
6379
6380
|
},
|
|
6380
6381
|
onMouseDown: (event) => event.stopPropagation(),
|
|
6381
|
-
onDoubleClick: (event) => event.stopPropagation()
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6382
|
+
onDoubleClick: (event) => event.stopPropagation()
|
|
6383
|
+
} : {},
|
|
6384
|
+
children: [
|
|
6385
|
+
onPreview ? /* @__PURE__ */ jsx25(
|
|
6386
|
+
"button",
|
|
6387
|
+
{
|
|
6388
|
+
type: "button",
|
|
6389
|
+
className: "truncate underline-offset-2 hover:underline",
|
|
6390
|
+
"data-records-file-preview": id,
|
|
6391
|
+
onClick: (event) => {
|
|
6392
|
+
event.stopPropagation();
|
|
6393
|
+
onPreview();
|
|
6394
|
+
},
|
|
6395
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
6396
|
+
onDoubleClick: (event) => event.stopPropagation(),
|
|
6397
|
+
children: words2
|
|
6398
|
+
}
|
|
6399
|
+
) : href ? /* @__PURE__ */ jsx25(
|
|
6400
|
+
OutboundLink4,
|
|
6401
|
+
{
|
|
6402
|
+
href,
|
|
6403
|
+
className: "truncate underline-offset-2 hover:underline",
|
|
6404
|
+
"data-records-file-link": read?.fileId ?? "",
|
|
6405
|
+
onClick: (event) => event.stopPropagation(),
|
|
6406
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
6407
|
+
children: words2
|
|
6408
|
+
}
|
|
6409
|
+
) : /* @__PURE__ */ jsx25("span", { className: "truncate", children: words2 }),
|
|
6410
|
+
onRemove ? /* @__PURE__ */ jsx25(
|
|
6411
|
+
"button",
|
|
6412
|
+
{
|
|
6413
|
+
type: "button",
|
|
6414
|
+
"aria-label": `Remove ${words2}`,
|
|
6415
|
+
className: "shrink-0 rounded px-0.5 text-muted-foreground hover:text-foreground",
|
|
6416
|
+
onClick: (event) => {
|
|
6417
|
+
event.stopPropagation();
|
|
6418
|
+
onRemove();
|
|
6419
|
+
},
|
|
6420
|
+
children: "\xD7"
|
|
6421
|
+
}
|
|
6422
|
+
) : null
|
|
6423
|
+
]
|
|
6424
|
+
}
|
|
6425
|
+
);
|
|
6409
6426
|
}
|
|
6410
6427
|
function AttachmentChips({ value, onRemove }) {
|
|
6411
6428
|
const host = useRecordsUi();
|
|
@@ -6446,6 +6463,18 @@ function AttachmentViewer({
|
|
|
6446
6463
|
{
|
|
6447
6464
|
className: "sm:max-w-3xl",
|
|
6448
6465
|
"data-records-attachment-viewer": id,
|
|
6466
|
+
tabIndex: -1,
|
|
6467
|
+
onOpenAutoFocus: (event) => {
|
|
6468
|
+
event.preventDefault();
|
|
6469
|
+
event.currentTarget.focus();
|
|
6470
|
+
},
|
|
6471
|
+
onCloseAutoFocus: (event) => {
|
|
6472
|
+
const chip = document.querySelector(`[data-records-file-preview="${ids[index]}"]`);
|
|
6473
|
+
if (chip) {
|
|
6474
|
+
event.preventDefault();
|
|
6475
|
+
chip.focus();
|
|
6476
|
+
}
|
|
6477
|
+
},
|
|
6449
6478
|
onKeyDown: (event) => {
|
|
6450
6479
|
if (event.key === "ArrowLeft") {
|
|
6451
6480
|
event.preventDefault();
|
|
@@ -6554,7 +6583,7 @@ function AttachmentControl({
|
|
|
6554
6583
|
|
|
6555
6584
|
// src/ReferenceChips.tsx
|
|
6556
6585
|
import { entityRefsOf as entityRefsOf2 } from "@ai-matrx/records";
|
|
6557
|
-
import { Badge as Badge4, Skeleton as Skeleton2, cn as
|
|
6586
|
+
import { Badge as Badge4, Skeleton as Skeleton2, cn as cn19 } from "@ai-matrx/design-system";
|
|
6558
6587
|
|
|
6559
6588
|
// src/kindValues.ts
|
|
6560
6589
|
import { tryDecodeDirective } from "@ai-matrx/content-ir/directives";
|
|
@@ -6659,7 +6688,7 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
6659
6688
|
return /* @__PURE__ */ jsxs23(
|
|
6660
6689
|
"span",
|
|
6661
6690
|
{
|
|
6662
|
-
className:
|
|
6691
|
+
className: cn19(
|
|
6663
6692
|
"inline-flex max-w-full min-w-0 items-center gap-1.5 text-sm text-foreground hover:underline [&_a]:text-inherit [&_a]:no-underline [&_a:hover]:underline",
|
|
6664
6693
|
reference.archived && "opacity-70"
|
|
6665
6694
|
),
|
|
@@ -6679,7 +6708,7 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
6679
6708
|
Badge4,
|
|
6680
6709
|
{
|
|
6681
6710
|
variant: "secondary",
|
|
6682
|
-
className:
|
|
6711
|
+
className: cn19(
|
|
6683
6712
|
"max-w-full min-w-0 gap-1 px-1.5 py-0 text-[11px] font-normal",
|
|
6684
6713
|
reference.archived && "opacity-70"
|
|
6685
6714
|
),
|
|
@@ -6707,12 +6736,12 @@ function KindValueCell({
|
|
|
6707
6736
|
return /* @__PURE__ */ jsx26("span", { className: "flex min-w-0 max-w-full items-center", "data-records-kind-value": kv.kind, children: host.renderKind({ value: kv.value, kind: kv.kind, where, title }) });
|
|
6708
6737
|
}
|
|
6709
6738
|
const named = kv.items.map(kindItemWords).filter((w) => w !== null);
|
|
6710
|
-
return /* @__PURE__ */ jsx26("span", { className:
|
|
6739
|
+
return /* @__PURE__ */ jsx26("span", { className: cn19("flex min-w-0 flex-wrap gap-1"), "data-records-kind-value": kv.kind, title: JSON.stringify(kv.value), children: named.length > 0 ? named.map((w, i) => /* @__PURE__ */ jsx26(Badge4, { variant: "secondary", className: "px-1.5 py-0 text-[11px] font-normal", children: w }, `${w}-${i}`)) : /* @__PURE__ */ jsx26(Badge4, { variant: "outline", className: "px-1.5 py-0 text-[11px] font-normal", children: kindLabel(kv.kind) }) });
|
|
6711
6740
|
}
|
|
6712
6741
|
|
|
6713
6742
|
// src/ClampedChips.tsx
|
|
6714
6743
|
import { useCallback as useCallback6, useLayoutEffect, useRef as useRef13, useState as useState21 } from "react";
|
|
6715
|
-
import { Popover as Popover4, PopoverContent as PopoverContent4, PopoverTrigger as PopoverTrigger4, cn as
|
|
6744
|
+
import { Popover as Popover4, PopoverContent as PopoverContent4, PopoverTrigger as PopoverTrigger4, cn as cn20 } from "@ai-matrx/design-system";
|
|
6716
6745
|
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6717
6746
|
var GAP = 4;
|
|
6718
6747
|
var OVERFLOW_ROOM = 34;
|
|
@@ -6783,7 +6812,7 @@ function ClampedChips({
|
|
|
6783
6812
|
"span",
|
|
6784
6813
|
{
|
|
6785
6814
|
ref: box,
|
|
6786
|
-
className:
|
|
6815
|
+
className: cn20("flex min-w-0 max-w-full flex-nowrap items-center gap-1 overflow-hidden [[data-matrx-cell-lines]:not([data-matrx-cell-lines=one])_&]:flex-wrap", className),
|
|
6787
6816
|
"data-records-clamped": dataAttr ?? "",
|
|
6788
6817
|
children: [
|
|
6789
6818
|
shown5.map((item) => /* @__PURE__ */ jsx27("span", { "data-clamp-item": "", className: "inline-flex min-w-0 shrink-0 max-w-full", children: item.node }, item.key)),
|
|
@@ -7209,11 +7238,11 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look) {
|
|
|
7209
7238
|
Badge5,
|
|
7210
7239
|
{
|
|
7211
7240
|
variant: "outline",
|
|
7212
|
-
className:
|
|
7241
|
+
className: cn21("text-[11px]", chip.className),
|
|
7213
7242
|
"data-records-choice-chip": "",
|
|
7214
7243
|
...chip.tinted ? { "data-records-choice-tint": "" } : {},
|
|
7215
7244
|
children: [
|
|
7216
|
-
look?.choiceDot ? /* @__PURE__ */ jsx30("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className:
|
|
7245
|
+
look?.choiceDot ? /* @__PURE__ */ jsx30("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: cn21("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
|
|
7217
7246
|
statusMark(field2, item, Array.isArray(value) ? void 0 : document2),
|
|
7218
7247
|
scalarText(field2, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
|
|
7219
7248
|
]
|
|
@@ -7262,7 +7291,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look) {
|
|
|
7262
7291
|
if (typeof value === "boolean") {
|
|
7263
7292
|
return /* @__PURE__ */ jsx30("span", { className: kind2 === "checkbox" ? "text-sm" : "", title: value ? "Yes" : "No", children: value ? "\u2713" : "\u2014" });
|
|
7264
7293
|
}
|
|
7265
|
-
return /* @__PURE__ */ jsx30("span", { className:
|
|
7294
|
+
return /* @__PURE__ */ jsx30("span", { className: cn21("truncate", kind2 === "number" || kind2 === "currency" || kind2 === "percent" ? "tabular-nums" : ""), children: scalarText(field2, value, labels, stillWaitingFor) });
|
|
7266
7295
|
}
|
|
7267
7296
|
function scalarText(field2, value, labels, stillWaitingFor) {
|
|
7268
7297
|
if (value === null || value === void 0) return "\u2014";
|
|
@@ -7457,6 +7486,33 @@ var CONDITION_OPS = [
|
|
|
7457
7486
|
{ op: "gte", label: "is at least" },
|
|
7458
7487
|
{ op: "lte", label: "is at most" }
|
|
7459
7488
|
];
|
|
7489
|
+
var LIST_TERMS = [
|
|
7490
|
+
{ op: "contains", label: "contains" },
|
|
7491
|
+
{ op: "not_contains", label: "does not contain" },
|
|
7492
|
+
{ op: "is_empty", label: "is empty" },
|
|
7493
|
+
{ op: "is_not_empty", label: "is not empty" }
|
|
7494
|
+
];
|
|
7495
|
+
var VALUELESS_OPS = /* @__PURE__ */ new Set(["present", "is_empty", "is_not_empty"]);
|
|
7496
|
+
var LINK_SEP = ">";
|
|
7497
|
+
function linkedNode(viaId, innerId, op2, value) {
|
|
7498
|
+
return {
|
|
7499
|
+
op: "linked",
|
|
7500
|
+
match: op2 === "eq" ? "any" : "none",
|
|
7501
|
+
args: [{ field: viaId }, { op: "eq", args: [{ field: innerId }, { const: value }] }]
|
|
7502
|
+
};
|
|
7503
|
+
}
|
|
7504
|
+
function linkedOf(expr) {
|
|
7505
|
+
const node = asNode(expr);
|
|
7506
|
+
if (!node || node["op"] !== "linked") return null;
|
|
7507
|
+
const [rel, cond] = argsOf(node);
|
|
7508
|
+
const innerNode = asNode(cond);
|
|
7509
|
+
const [a, b] = innerNode ? argsOf(innerNode) : [];
|
|
7510
|
+
const match = node["match"] ?? "any";
|
|
7511
|
+
if (!rel || typeof rel["field"] !== "string" || !innerNode || innerNode["op"] !== "eq") return null;
|
|
7512
|
+
if (!a || typeof a["field"] !== "string" || !b || !("const" in b)) return null;
|
|
7513
|
+
if (match !== "any" && match !== "none") return null;
|
|
7514
|
+
return { via: rel["field"], inner: a["field"], op: match === "any" ? "eq" : "ne", value: b["const"] };
|
|
7515
|
+
}
|
|
7460
7516
|
var FilterTermsContext = createContext5(false);
|
|
7461
7517
|
var RELATIVE_DAY_TERMS = [
|
|
7462
7518
|
{ kind: "today", label: "is today" },
|
|
@@ -7569,13 +7625,15 @@ function ChoiceValue({ field: field2, value, onChange }) {
|
|
|
7569
7625
|
}
|
|
7570
7626
|
function conditionIsSimple(expr) {
|
|
7571
7627
|
if (expr === null || expr === void 0) return true;
|
|
7572
|
-
if (relativeDayOf(expr) !== null || meOf(expr) !== null) return true;
|
|
7628
|
+
if (relativeDayOf(expr) !== null || meOf(expr) !== null || linkedOf(expr) !== null) return true;
|
|
7573
7629
|
const node = expr;
|
|
7574
|
-
if (typeof node.op !== "string" || !CONDITION_OPS.some((c) => c.op === node.op))
|
|
7630
|
+
if (typeof node.op !== "string" || !(CONDITION_OPS.some((c) => c.op === node.op) || LIST_TERMS.some((c) => c.op === node.op))) {
|
|
7631
|
+
return false;
|
|
7632
|
+
}
|
|
7575
7633
|
if (!Array.isArray(node.args)) return false;
|
|
7576
7634
|
const first = node.args[0];
|
|
7577
7635
|
if (!first || typeof first.field !== "string") return false;
|
|
7578
|
-
if (node.op
|
|
7636
|
+
if (VALUELESS_OPS.has(node.op)) return node.args.length === 1;
|
|
7579
7637
|
const second = node.args[1];
|
|
7580
7638
|
return node.args.length === 2 && !!second && "const" in second;
|
|
7581
7639
|
}
|
|
@@ -7593,7 +7651,13 @@ function conditionInWords(expr, fields) {
|
|
|
7593
7651
|
lte: "is at most",
|
|
7594
7652
|
and: "and",
|
|
7595
7653
|
or: "or",
|
|
7596
|
-
matches: "matches"
|
|
7654
|
+
matches: "matches",
|
|
7655
|
+
contains: "contains",
|
|
7656
|
+
not_contains: "does not contain",
|
|
7657
|
+
has_any: "has any of",
|
|
7658
|
+
has_all: "has all of",
|
|
7659
|
+
has_none: "has none of",
|
|
7660
|
+
is_exactly: "is exactly"
|
|
7597
7661
|
};
|
|
7598
7662
|
const walk = (node) => {
|
|
7599
7663
|
if (node === null || node === void 0) return "nothing";
|
|
@@ -7614,6 +7678,12 @@ function conditionInWords(expr, fields) {
|
|
|
7614
7678
|
const args = Array.isArray(n["args"]) ? n["args"] : [];
|
|
7615
7679
|
if (op2 === "not") return `not ${walk(args[0])}`;
|
|
7616
7680
|
if (op2 === "present") return `${walk(args[0])} has been answered`;
|
|
7681
|
+
if (op2 === "is_empty") return `${walk(args[0])} is empty`;
|
|
7682
|
+
if (op2 === "is_not_empty") return `${walk(args[0])} is not empty`;
|
|
7683
|
+
if (op2 === "linked") {
|
|
7684
|
+
const how = n["match"] === "every" ? "every" : n["match"] === "none" ? "none of" : "any";
|
|
7685
|
+
return `${how} linked record in ${walk(args[0])}: ${walk(args[1])}`;
|
|
7686
|
+
}
|
|
7617
7687
|
const dayRange = relativeDayOf(n);
|
|
7618
7688
|
if (dayRange) {
|
|
7619
7689
|
const term = RELATIVE_DAY_TERMS.find((t) => t.kind === dayRange.kind);
|
|
@@ -7646,12 +7716,14 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
7646
7716
|
const filterTerms = useContext5(FilterTermsContext);
|
|
7647
7717
|
const relative = relativeDayOf(expr);
|
|
7648
7718
|
const reader = meOf(expr);
|
|
7649
|
-
const
|
|
7650
|
-
const
|
|
7651
|
-
const
|
|
7719
|
+
const linked = linkedOf(expr);
|
|
7720
|
+
const op2 = relative ? `rel:${relative.kind}` : reader ? reader.which : linked ? linked.op : node?.op ?? "";
|
|
7721
|
+
const onField = linked ? `${linked.via}${LINK_SEP}${linked.inner}` : node?.args?.[0]?.field ?? "";
|
|
7722
|
+
const value = relative || reader ? "" : linked ? linked.value : node?.args?.[1]?.const ?? "";
|
|
7652
7723
|
const chosen = fields.find((f) => f.id === onField);
|
|
7653
7724
|
const chosenKind = chosen?.field ? String(editorKindFor(chosen.field)) : "";
|
|
7654
|
-
const extraTerms = !filterTerms ? [] : chosenKind === "datetime" ? RELATIVE_DAY_TERMS.map((t) => ({ op: `rel:${t.kind}`, label: t.label })) : chosenKind === "member" ? [{ op: "me", label: "is me" }, { op: "not_me", label: "is not me" }] : [];
|
|
7725
|
+
const extraTerms = !filterTerms || chosen?.via ? [] : chosenKind === "datetime" ? RELATIVE_DAY_TERMS.map((t) => ({ op: `rel:${t.kind}`, label: t.label })) : chosenKind === "member" ? [{ op: "me", label: "is me" }, { op: "not_me", label: "is not me" }] : chosenKind === "multi_select" ? LIST_TERMS : [];
|
|
7726
|
+
const baseTerms = chosen?.via ? CONDITION_OPS.filter((c) => c.op === "eq" || c.op === "ne") : CONDITION_OPS;
|
|
7655
7727
|
const relativeTerm = relative ? RELATIVE_DAY_TERMS.find((t) => t.kind === relative.kind) : void 0;
|
|
7656
7728
|
function write(next) {
|
|
7657
7729
|
const picked = next.op;
|
|
@@ -7664,8 +7736,11 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
7664
7736
|
onChange(relativeDayNode(fieldNow, relative.kind, next.days));
|
|
7665
7737
|
return;
|
|
7666
7738
|
}
|
|
7667
|
-
if (next.field !== void 0 && (relative || reader)) {
|
|
7668
|
-
|
|
7739
|
+
if (next.field !== void 0 && (relative || reader || linked)) {
|
|
7740
|
+
const target2 = fields.find((f) => f.id === next.field);
|
|
7741
|
+
onChange(
|
|
7742
|
+
!next.field ? null : target2?.via ? linkedNode(target2.via.id, target2.via.fieldId, "eq", "") : { op: CONDITION_OPS[0].op, args: [{ field: next.field }, { const: "" }] }
|
|
7743
|
+
);
|
|
7669
7744
|
return;
|
|
7670
7745
|
}
|
|
7671
7746
|
const chosenOp = next.op ?? (op2 || (next.field ? CONDITION_OPS[0].op : ""));
|
|
@@ -7675,8 +7750,13 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
7675
7750
|
onChange(null);
|
|
7676
7751
|
return;
|
|
7677
7752
|
}
|
|
7753
|
+
const target = fields.find((f) => f.id === chosenField);
|
|
7754
|
+
if (target?.via) {
|
|
7755
|
+
onChange(linkedNode(target.via.id, target.via.fieldId, chosenOp === "ne" ? "ne" : "eq", chosenValue));
|
|
7756
|
+
return;
|
|
7757
|
+
}
|
|
7678
7758
|
onChange(
|
|
7679
|
-
chosenOp
|
|
7759
|
+
VALUELESS_OPS.has(chosenOp) ? { op: chosenOp, args: [{ field: chosenField }] } : { op: chosenOp, args: [{ field: chosenField }, { const: chosenValue }] }
|
|
7680
7760
|
);
|
|
7681
7761
|
}
|
|
7682
7762
|
return /* @__PURE__ */ jsxs28("div", { className: className ?? "flex flex-wrap items-center gap-1 text-xs", children: [
|
|
@@ -7709,7 +7789,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
7709
7789
|
className: "h-8 w-auto min-w-[6rem] text-xs",
|
|
7710
7790
|
value: op2,
|
|
7711
7791
|
onChange: (next) => write({ op: next }),
|
|
7712
|
-
options: [...
|
|
7792
|
+
options: [...baseTerms, ...extraTerms].map((c) => ({ value: c.op, label: c.label })),
|
|
7713
7793
|
attrs: { "data-condition": "comparison" }
|
|
7714
7794
|
}
|
|
7715
7795
|
),
|
|
@@ -7723,7 +7803,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
7723
7803
|
value: String(relative.days ?? 7),
|
|
7724
7804
|
onChange: (e) => write({ days: Math.max(0, Math.floor(Number(e.target.value) || 0)) })
|
|
7725
7805
|
}
|
|
7726
|
-
) : null : reader || op2
|
|
7806
|
+
) : null : reader || VALUELESS_OPS.has(op2) ? null : pointsAtARecord(chosen) ? (
|
|
7727
7807
|
// A RECORD IS PICKED BY ITS WORDS, NEVER TYPED AS AN ID. The same picker the
|
|
7728
7808
|
// cell uses, on the same `relation_words_many` the cell reads, so a filter and
|
|
7729
7809
|
// the column it filters can never disagree about what a record is called. It
|
|
@@ -7741,7 +7821,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
7741
7821
|
allowCreate: false
|
|
7742
7822
|
}
|
|
7743
7823
|
)
|
|
7744
|
-
) : isChoiceColumn(chosen) && (op2 === "eq" || op2 === "ne") ? /* @__PURE__ */ jsx32(ChoiceValue, { field: chosen.field, value: String(value ?? ""), onChange: (word) => write({ value: word }) }) : /* @__PURE__ */ jsx32(
|
|
7824
|
+
) : isChoiceColumn(chosen) && (op2 === "eq" || op2 === "ne" || op2 === "contains" || op2 === "not_contains") ? /* @__PURE__ */ jsx32(ChoiceValue, { field: chosen.field, value: String(value ?? ""), onChange: (word) => write({ value: word }) }) : /* @__PURE__ */ jsx32(
|
|
7745
7825
|
BasicInput7,
|
|
7746
7826
|
{
|
|
7747
7827
|
className: "h-8 w-28 text-xs",
|
|
@@ -8520,7 +8600,7 @@ import { useOptionalRecordsClient as useOptionalRecordsClient8 } from "@ai-matrx
|
|
|
8520
8600
|
|
|
8521
8601
|
// src/AccentSwatches.tsx
|
|
8522
8602
|
import { PORTAL_ACCENTS } from "@ai-matrx/records";
|
|
8523
|
-
import { cn as
|
|
8603
|
+
import { cn as cn22 } from "@ai-matrx/design-system";
|
|
8524
8604
|
import { STYLE_COLOR_LABELS as STYLE_COLOR_LABELS2, SWATCH_CLASS as SWATCH_CLASS3 } from "@ai-matrx/design-system/data-table";
|
|
8525
8605
|
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8526
8606
|
function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel = "App colour" }) {
|
|
@@ -8532,7 +8612,7 @@ function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel =
|
|
|
8532
8612
|
role: "radio",
|
|
8533
8613
|
"aria-checked": value === "",
|
|
8534
8614
|
onClick: () => onChange(""),
|
|
8535
|
-
className:
|
|
8615
|
+
className: cn22(
|
|
8536
8616
|
"h-7 rounded border px-2 text-xs",
|
|
8537
8617
|
value === "" ? "border-foreground" : "border-border text-muted-foreground"
|
|
8538
8618
|
),
|
|
@@ -8548,7 +8628,7 @@ function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel =
|
|
|
8548
8628
|
"aria-label": STYLE_COLOR_LABELS2[c],
|
|
8549
8629
|
title: STYLE_COLOR_LABELS2[c],
|
|
8550
8630
|
onClick: () => onChange(c),
|
|
8551
|
-
className:
|
|
8631
|
+
className: cn22("h-7 w-7 rounded-full border-2", SWATCH_CLASS3[c], value === c ? "border-foreground" : "border-transparent")
|
|
8552
8632
|
},
|
|
8553
8633
|
c
|
|
8554
8634
|
))
|
|
@@ -9026,7 +9106,7 @@ function FieldEditor(props) {
|
|
|
9026
9106
|
const offersMany = multiApplies(type) && !isTitle;
|
|
9027
9107
|
if (!mayShape) {
|
|
9028
9108
|
if (onEntity && entityRights.loading) return null;
|
|
9029
|
-
return /* @__PURE__ */ jsx38("p", { className:
|
|
9109
|
+
return /* @__PURE__ */ jsx38("p", { className: cn23("text-xs text-muted-foreground", className), children: props.tableLabel && storeLabel && whyNot ? whyNot.split(storeLabel).join(props.tableLabel) : whyNot });
|
|
9030
9110
|
}
|
|
9031
9111
|
const options = newChoices.map((r) => r.words.trim()).filter((word) => word !== "");
|
|
9032
9112
|
const shownStatusRows = type !== "status" ? [] : statusGroupRows(field2, editing ? choiceList ?? [] : newChoices, statusKeys, statusGroups);
|
|
@@ -9226,7 +9306,7 @@ function FieldEditor(props) {
|
|
|
9226
9306
|
if (gone) (onRemoved ?? onSaved)?.();
|
|
9227
9307
|
else setAskingToRemove(false);
|
|
9228
9308
|
};
|
|
9229
|
-
return /* @__PURE__ */ jsxs34("div", { className:
|
|
9309
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn23("flex min-w-0 flex-col gap-3 text-xs", className), "data-records-field-editor": "", children: [
|
|
9230
9310
|
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
9231
9311
|
/* @__PURE__ */ jsx38("span", { className: "font-medium", children: field2 ? `Field \xB7 ${fieldName(field2)}` : "New field" }),
|
|
9232
9312
|
/* @__PURE__ */ jsx38("span", { className: "ml-auto text-muted-foreground", children: tableLabel })
|
|
@@ -9683,8 +9763,8 @@ function FieldEditor(props) {
|
|
|
9683
9763
|
the dialog card 0.2278 and closing it 0.1303. The consequence is the tooltip of
|
|
9684
9764
|
"Remove it" (interface-text: the slot holds a label, never a paragraph). */
|
|
9685
9765
|
/* @__PURE__ */ jsxs34("div", { className: "ml-auto grid shrink-0 items-center", "data-field-editor-remove": askingToRemove ? "asking" : "idle", children: [
|
|
9686
|
-
/* @__PURE__ */ jsx38("div", { className:
|
|
9687
|
-
/* @__PURE__ */ jsxs34("div", { className:
|
|
9766
|
+
/* @__PURE__ */ jsx38("div", { className: cn23("col-start-1 row-start-1 flex items-center justify-end gap-2", askingToRemove && "invisible"), "aria-hidden": askingToRemove || void 0, children: /* @__PURE__ */ jsx38(Button17, { size: "sm", variant: "outline", tabIndex: askingToRemove ? -1 : void 0, onClick: () => setAskingToRemove(true), children: "Remove this field" }) }),
|
|
9767
|
+
/* @__PURE__ */ jsxs34("div", { className: cn23("col-start-1 row-start-1 flex items-center justify-end gap-2", !askingToRemove && "invisible"), "aria-hidden": !askingToRemove || void 0, children: [
|
|
9688
9768
|
/* @__PURE__ */ jsx38("span", { className: "whitespace-nowrap text-destructive", "data-field-editor-remove-ask": "", children: "Archive this field?" }),
|
|
9689
9769
|
/* @__PURE__ */ jsx38(
|
|
9690
9770
|
Button17,
|
|
@@ -10123,7 +10203,7 @@ function ButtonValue({ field: field2, recordId, inCell }) {
|
|
|
10123
10203
|
"data-records-button-unset": needs ? "" : void 0,
|
|
10124
10204
|
"aria-busy": busy || void 0,
|
|
10125
10205
|
disabled: busy,
|
|
10126
|
-
className:
|
|
10206
|
+
className: cn24("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color, needs && "border-dashed opacity-80"),
|
|
10127
10207
|
onPointerDown: stop,
|
|
10128
10208
|
onDoubleClick: stop,
|
|
10129
10209
|
onClick: (event) => {
|
|
@@ -10335,7 +10415,7 @@ function formatControl(args) {
|
|
|
10335
10415
|
|
|
10336
10416
|
// src/typedDateHelper.tsx
|
|
10337
10417
|
import { useState as useState31 } from "react";
|
|
10338
|
-
import { Popover as Popover6, PopoverContent as PopoverContent6, PopoverTrigger as PopoverTrigger6, cn as
|
|
10418
|
+
import { Popover as Popover6, PopoverContent as PopoverContent6, PopoverTrigger as PopoverTrigger6, cn as cn25 } from "@ai-matrx/design-system";
|
|
10339
10419
|
import { readTypedDate, readTypedTime, typedDateText, typedTimeText } from "@ai-matrx/records";
|
|
10340
10420
|
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10341
10421
|
var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
@@ -10460,7 +10540,7 @@ function TypedDateHelper({
|
|
|
10460
10540
|
type: "button",
|
|
10461
10541
|
...keepFocus,
|
|
10462
10542
|
"data-records-date-helper-day": key,
|
|
10463
|
-
className:
|
|
10543
|
+
className: cn25(
|
|
10464
10544
|
"h-6 w-6 rounded tabular-nums hover:bg-muted",
|
|
10465
10545
|
key === held.day ? "bg-primary text-primary-foreground hover:bg-primary" : "",
|
|
10466
10546
|
key === todayKey && key !== held.day ? "ring-1 ring-ring" : ""
|
|
@@ -10479,7 +10559,7 @@ function TypedDateHelper({
|
|
|
10479
10559
|
type: "button",
|
|
10480
10560
|
...keepFocus,
|
|
10481
10561
|
"data-records-date-helper-time": `${pad2(t.h)}:${pad2(t.m)}`,
|
|
10482
|
-
className:
|
|
10562
|
+
className: cn25(
|
|
10483
10563
|
"whitespace-nowrap rounded px-2 py-0.5 text-left tabular-nums hover:bg-muted",
|
|
10484
10564
|
held.time && held.time.h === t.h && held.time.m === t.m ? "bg-primary text-primary-foreground" : ""
|
|
10485
10565
|
),
|
|
@@ -11305,7 +11385,7 @@ function OpenChoicePicker({
|
|
|
11305
11385
|
const pickedOptions = current.map((v) => options.find((o) => isTheChosen(o, v)));
|
|
11306
11386
|
const cellChips = pickedWords.map((word, i) => {
|
|
11307
11387
|
const chip = chipOf(pickedOptions[i], word);
|
|
11308
|
-
return /* @__PURE__ */ jsx43(Badge6, { variant: "outline", className:
|
|
11388
|
+
return /* @__PURE__ */ jsx43(Badge6, { variant: "outline", className: cn26("text-[11px]", chip.className), "data-records-choice-chip": "", children: word }, word);
|
|
11309
11389
|
});
|
|
11310
11390
|
const headChips = pickedWords.map((word, i) => {
|
|
11311
11391
|
const option = pickedOptions[i];
|
|
@@ -11378,7 +11458,7 @@ function RecordChip({
|
|
|
11378
11458
|
// name. So it caps at its container and ends in an ellipsis with the whole name in
|
|
11379
11459
|
// its tooltip, rather than being cut mid-word by whatever box it landed in
|
|
11380
11460
|
// (lane FIX-14, 2026-09-22).
|
|
11381
|
-
/* @__PURE__ */ jsxs39(Badge6, { variant: "secondary", className:
|
|
11461
|
+
/* @__PURE__ */ jsxs39(Badge6, { variant: "secondary", className: cn26("max-w-full gap-1 text-[11px]", className), title, children: [
|
|
11382
11462
|
/* @__PURE__ */ jsx43("span", { className: "min-w-0 truncate", children: title }),
|
|
11383
11463
|
onRemove ? /* @__PURE__ */ jsx43("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${title}`, className: "shrink-0 opacity-60 hover:opacity-100", children: "\xD7" }) : null
|
|
11384
11464
|
] })
|
|
@@ -11433,7 +11513,7 @@ function ChoiceAnswer({
|
|
|
11433
11513
|
tabIndex: field2.multi || choice.key === tabStop ? 0 : -1,
|
|
11434
11514
|
onClick: () => press(choice),
|
|
11435
11515
|
"data-records-choice-answer": choice.key,
|
|
11436
|
-
className:
|
|
11516
|
+
className: cn26(
|
|
11437
11517
|
"flex min-h-11 w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-base font-medium text-foreground transition-colors sm:min-h-10 sm:text-sm",
|
|
11438
11518
|
chosen ? "border-primary bg-primary/10" : "border-primary/30 bg-primary/[0.03] hover:bg-primary/10"
|
|
11439
11519
|
),
|
|
@@ -11442,7 +11522,7 @@ function ChoiceAnswer({
|
|
|
11442
11522
|
"kbd",
|
|
11443
11523
|
{
|
|
11444
11524
|
"aria-hidden": "true",
|
|
11445
|
-
className:
|
|
11525
|
+
className: cn26(
|
|
11446
11526
|
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded border font-sans text-xs font-semibold",
|
|
11447
11527
|
chosen ? "border-primary bg-primary text-primary-foreground" : "border-primary/40 text-primary"
|
|
11448
11528
|
),
|
|
@@ -12503,7 +12583,7 @@ function GridCell({
|
|
|
12503
12583
|
disabled: !editable,
|
|
12504
12584
|
"aria-label": editable ? `${fieldName(field2)} \u2014 press Space to ${value === true ? "untick" : "tick"}` : fieldName(field2),
|
|
12505
12585
|
title: editable ? answered ? `${fieldName(field2)} \u2014 press Space to change` : `${fieldName(field2)} \u2014 nobody has answered this yet` : whyNot ?? `${fieldName(field2)} \u2014 you cannot change this record`,
|
|
12506
|
-
className:
|
|
12586
|
+
className: cn27(state2 === "saving" ? "opacity-60" : "", state2 === "refused" ? "ring-1 ring-destructive" : ""),
|
|
12507
12587
|
onCheckedChange: (next) => editing?.setCell(row.id, field2.key, next === true)
|
|
12508
12588
|
}
|
|
12509
12589
|
),
|
|
@@ -12571,7 +12651,7 @@ function GridCell({
|
|
|
12571
12651
|
// after it has been typed into.
|
|
12572
12652
|
`${fieldName(field2)} \u2014 ${whyNot ?? "you cannot change this record"}`
|
|
12573
12653
|
) : `${fieldName(field2)} is worked out by the system, so it cannot be typed in`,
|
|
12574
|
-
className:
|
|
12654
|
+
className: cn27(
|
|
12575
12655
|
// `w-full` so the whole cell is the control. A gap beside it is bare
|
|
12576
12656
|
// table cell, and a click there is a row click.
|
|
12577
12657
|
"block w-full min-w-0 flex-1 truncate rounded px-1 py-0.5",
|
|
@@ -12880,7 +12960,7 @@ function OpenCell({
|
|
|
12880
12960
|
style: wideTo ? { width: wideTo, minWidth: wideTo, maxWidth: "28rem", right: "auto" } : void 0,
|
|
12881
12961
|
"data-matrx-cell-editor": "",
|
|
12882
12962
|
tabIndex: -1,
|
|
12883
|
-
className:
|
|
12963
|
+
className: cn27(
|
|
12884
12964
|
// OVER the cell's ghost (see `data-records-open-cell`), never in the table's measuring.
|
|
12885
12965
|
"absolute inset-x-0 top-1/2 z-[25] flex w-full min-w-0 max-w-full -translate-y-1/2 flex-col gap-1 outline-none",
|
|
12886
12966
|
// A box reaching over the next column is opaque, so what it covers never shows through it
|
|
@@ -12947,7 +13027,7 @@ function OpenCell({
|
|
|
12947
13027
|
}
|
|
12948
13028
|
),
|
|
12949
13029
|
/* @__PURE__ */ jsxs40("span", { "data-records-cell-tray": "", className: FLOATING_CELL_TRAY_CLASS, children: [
|
|
12950
|
-
picker || asksAboutAChoice(draft) ? null : blurCommits ? null : /* @__PURE__ */ jsxs40("span", { className:
|
|
13030
|
+
picker || asksAboutAChoice(draft) ? null : blurCommits ? null : /* @__PURE__ */ jsxs40("span", { className: cn27("flex items-center gap-1", FLOATING_CELL_TRAY_PIECE_CLASS), children: [
|
|
12951
13031
|
/* @__PURE__ */ jsx45(Button20, { size: "sm", onClick: () => once(() => onCommit(null, "pick")), children: "Save" }),
|
|
12952
13032
|
/* @__PURE__ */ jsx45(Button20, { size: "sm", variant: "ghost", onClick: () => once(() => onCancel("pick")), children: "Cancel" })
|
|
12953
13033
|
] }),
|
|
@@ -12994,7 +13074,7 @@ function rememberLayout(tableId, layout) {
|
|
|
12994
13074
|
|
|
12995
13075
|
// src/RecordsSkeleton.tsx
|
|
12996
13076
|
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
12997
|
-
import { cn as
|
|
13077
|
+
import { cn as cn28, Skeleton as Skeleton3 } from "@ai-matrx/design-system";
|
|
12998
13078
|
import { MatrxDataTable } from "@ai-matrx/design-system/data-table";
|
|
12999
13079
|
import { Fragment as Fragment14, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13000
13080
|
var NEVER = () => () => {
|
|
@@ -13058,7 +13138,7 @@ function GridSkeleton({ embedded, rows }) {
|
|
|
13058
13138
|
...embedded ? {
|
|
13059
13139
|
appearance: "embedded",
|
|
13060
13140
|
hidePagination: true,
|
|
13061
|
-
tableClassName:
|
|
13141
|
+
tableClassName: cn28(EMBEDDED_TABLE_CLASS, EMBEDDED_PLAIN_FOOTER_CLASS)
|
|
13062
13142
|
} : {}
|
|
13063
13143
|
}
|
|
13064
13144
|
);
|
|
@@ -13141,7 +13221,7 @@ function RecordsSkeleton({ layout = "grid", embedded = false, rows, className })
|
|
|
13141
13221
|
"aria-label": "Loading",
|
|
13142
13222
|
"aria-busy": "true",
|
|
13143
13223
|
"data-records-skeleton": layout,
|
|
13144
|
-
className:
|
|
13224
|
+
className: cn28("flex min-h-0 flex-col", !embedded && "flex-1", className),
|
|
13145
13225
|
children: /* @__PURE__ */ jsx46(BodySkeleton, { layout, embedded, rows: rows ?? (embedded ? 5 : "fill") })
|
|
13146
13226
|
}
|
|
13147
13227
|
);
|
|
@@ -13157,7 +13237,7 @@ function TablePageSkeleton({
|
|
|
13157
13237
|
const rememberedFace = useRememberedLayout(embedded || layoutAsked ? void 0 : tableId);
|
|
13158
13238
|
const layout = layoutAsked ?? skeletonLayoutFor(rememberedFace);
|
|
13159
13239
|
const painted = rows ?? (remembered === "fill" ? void 0 : remembered);
|
|
13160
|
-
return /* @__PURE__ */ jsx46("div", { className:
|
|
13240
|
+
return /* @__PURE__ */ jsx46("div", { className: cn28(TABLE_PAGE_FRAME_CLASS, className), "data-records-skeleton-page": layout, children: /* @__PURE__ */ jsxs41("div", { className: TABLE_PAGE_COLUMN_CLASS, children: [
|
|
13161
13241
|
/* @__PURE__ */ jsxs41("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "data-records-skeleton-part": "toolbar", "aria-hidden": "true", children: [
|
|
13162
13242
|
/* @__PURE__ */ jsx46(Skeleton3, { shape: "control", width: "sm", className: "w-28" }),
|
|
13163
13243
|
/* @__PURE__ */ jsx46(Skeleton3, { shape: "control", className: "w-16" }),
|
|
@@ -15164,13 +15244,13 @@ import {
|
|
|
15164
15244
|
SelectItem as SelectItem8,
|
|
15165
15245
|
SelectTrigger as SelectTrigger8,
|
|
15166
15246
|
SelectValue as SelectValue8,
|
|
15167
|
-
cn as
|
|
15247
|
+
cn as cn31
|
|
15168
15248
|
} from "@ai-matrx/design-system";
|
|
15169
15249
|
|
|
15170
15250
|
// src/rowActionPreview.tsx
|
|
15171
15251
|
import { useEffect as useEffect31, useState as useState44 } from "react";
|
|
15172
15252
|
import { useRecordsClient as useRecordsClient21 } from "@ai-matrx/records/react";
|
|
15173
|
-
import { cn as
|
|
15253
|
+
import { cn as cn29 } from "@ai-matrx/design-system";
|
|
15174
15254
|
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
15175
15255
|
function isComputed(field2) {
|
|
15176
15256
|
const kind2 = String(field2.type);
|
|
@@ -15271,7 +15351,7 @@ function ActionRowPreview({
|
|
|
15271
15351
|
{
|
|
15272
15352
|
role: "columnheader",
|
|
15273
15353
|
title: cell2.name,
|
|
15274
|
-
className:
|
|
15354
|
+
className: cn29("truncate border-l bg-muted/60 px-2 py-1 font-medium", cell2.changed ? "text-foreground" : "text-muted-foreground"),
|
|
15275
15355
|
children: cell2.name
|
|
15276
15356
|
},
|
|
15277
15357
|
cell2.key
|
|
@@ -15288,7 +15368,7 @@ function ActionRowPreview({
|
|
|
15288
15368
|
"data-changed": cell2.changed ? "true" : void 0,
|
|
15289
15369
|
"data-records-preview-cell": cell2.key,
|
|
15290
15370
|
title: shown5.text,
|
|
15291
|
-
className:
|
|
15371
|
+
className: cn29(
|
|
15292
15372
|
"truncate border-l border-t px-2 py-1",
|
|
15293
15373
|
shown5.text === "empty" && "italic text-muted-foreground",
|
|
15294
15374
|
cell2.changed && which === "before" && "bg-destructive/10 text-destructive line-through",
|
|
@@ -15312,7 +15392,7 @@ function ActionRowPreview({
|
|
|
15312
15392
|
import { useCallback as useCallback13, useEffect as useEffect32, useMemo as useMemo20, useState as useState45 } from "react";
|
|
15313
15393
|
import { useRecordsClient as useRecordsClient22, useRowActions } from "@ai-matrx/records/react";
|
|
15314
15394
|
import { actionRefusals } from "@ai-matrx/records";
|
|
15315
|
-
import { Button as Button28, ConfirmDialog, cn as
|
|
15395
|
+
import { Button as Button28, ConfirmDialog, cn as cn30 } from "@ai-matrx/design-system";
|
|
15316
15396
|
import { jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
15317
15397
|
var EMPTY_ACTIONS = [];
|
|
15318
15398
|
var actionListeners = /* @__PURE__ */ new Map();
|
|
@@ -15470,7 +15550,7 @@ function ActionButton({
|
|
|
15470
15550
|
{
|
|
15471
15551
|
size: "sm",
|
|
15472
15552
|
variant: count === void 0 ? "ghost" : "outline",
|
|
15473
|
-
className:
|
|
15553
|
+
className: cn30("h-7 px-2", className),
|
|
15474
15554
|
"data-records-row-action": action3.id,
|
|
15475
15555
|
title: action3.kind === "agent" ? `Hand this to an agent: ${action3.prompt ?? action3.name}` : action3.name,
|
|
15476
15556
|
disabled: busy,
|
|
@@ -15492,7 +15572,7 @@ function ActionOutcomeNotice({
|
|
|
15492
15572
|
{
|
|
15493
15573
|
role: "status",
|
|
15494
15574
|
"data-records-action-outcome": outcome.kind,
|
|
15495
|
-
className:
|
|
15575
|
+
className: cn30(
|
|
15496
15576
|
"flex flex-col gap-1 rounded border px-2 py-1 text-xs",
|
|
15497
15577
|
outcome.kind === "refused" ? "border-destructive/40 bg-destructive/5" : "border-border bg-muted/40"
|
|
15498
15578
|
),
|
|
@@ -15505,7 +15585,7 @@ function ActionOutcomeNotice({
|
|
|
15505
15585
|
{
|
|
15506
15586
|
size: "sm",
|
|
15507
15587
|
variant: "ghost",
|
|
15508
|
-
className:
|
|
15588
|
+
className: cn30("h-6", outcome.kind === "ran" && outcome.undo ? "" : "ml-auto"),
|
|
15509
15589
|
onClick: onDismiss,
|
|
15510
15590
|
children: "Dismiss"
|
|
15511
15591
|
}
|
|
@@ -15779,7 +15859,7 @@ function RowActionsSection({
|
|
|
15779
15859
|
}
|
|
15780
15860
|
);
|
|
15781
15861
|
}
|
|
15782
|
-
return /* @__PURE__ */ jsxs51("div", { className:
|
|
15862
|
+
return /* @__PURE__ */ jsxs51("div", { className: cn31("flex flex-col gap-2", className), "data-records-row-actions-editor": "", children: [
|
|
15783
15863
|
/* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-2", children: [
|
|
15784
15864
|
/* @__PURE__ */ jsx57("span", { className: "font-medium", children: "Row actions" }),
|
|
15785
15865
|
loaded && !readError ? /* @__PURE__ */ jsx57("span", { className: "text-muted-foreground", children: actions.length }) : null,
|
|
@@ -15926,7 +16006,7 @@ function ActionForm({
|
|
|
15926
16006
|
const first = settable2.find((f) => doc[f.key] !== null && doc[f.key] !== void 0 && doc[f.key] !== "");
|
|
15927
16007
|
return first ? shown2(doc[first.key]) : row.id;
|
|
15928
16008
|
};
|
|
15929
|
-
return /* @__PURE__ */ jsxs51("div", { className:
|
|
16009
|
+
return /* @__PURE__ */ jsxs51("div", { className: cn31("flex flex-col gap-3 text-xs", className), "data-records-action-form": "", children: [
|
|
15930
16010
|
/* @__PURE__ */ jsx57("span", { className: "font-medium", children: original ? `Row action \xB7 ${original.name}` : "New row action" }),
|
|
15931
16011
|
/* @__PURE__ */ jsxs51("label", { className: "flex flex-col gap-1", children: [
|
|
15932
16012
|
/* @__PURE__ */ jsx57(Label10, { className: "text-xs", children: "Name" }),
|
|
@@ -16193,7 +16273,7 @@ import {
|
|
|
16193
16273
|
DropdownMenuLabel,
|
|
16194
16274
|
DropdownMenuSeparator,
|
|
16195
16275
|
DropdownMenuTrigger,
|
|
16196
|
-
cn as
|
|
16276
|
+
cn as cn32
|
|
16197
16277
|
} from "@ai-matrx/design-system";
|
|
16198
16278
|
import { Fragment as Fragment16, jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
16199
16279
|
var SUMMARY_ROW_ID = "__records_ui_summary__";
|
|
@@ -16298,7 +16378,7 @@ function SummaryCell({
|
|
|
16298
16378
|
size: "sm",
|
|
16299
16379
|
variant: "ghost",
|
|
16300
16380
|
"data-records-summary": field2.key,
|
|
16301
|
-
className:
|
|
16381
|
+
className: cn32(
|
|
16302
16382
|
"h-6 max-w-full justify-start gap-1 px-1 text-xs font-normal",
|
|
16303
16383
|
// AN UNCHOSEN SUMMARY IS A HOVER, NOT A WORD IN EVERY FOOTER CELL (lane C, review
|
|
16304
16384
|
// 2026-09-26 E1 — Airtable's footer): it shows under the pointer, on keyboard focus and
|
|
@@ -16322,7 +16402,7 @@ function SummaryCell({
|
|
|
16322
16402
|
{
|
|
16323
16403
|
"data-records-summary-choice": op2,
|
|
16324
16404
|
onSelect: () => onChoose(op2),
|
|
16325
|
-
className:
|
|
16405
|
+
className: cn32(op2 === chosen && "font-medium"),
|
|
16326
16406
|
children: words2(op2, "menu")
|
|
16327
16407
|
},
|
|
16328
16408
|
op2
|
|
@@ -17976,7 +18056,7 @@ function selectOpenCellText() {
|
|
|
17976
18056
|
}
|
|
17977
18057
|
|
|
17978
18058
|
// src/Grid.tsx
|
|
17979
|
-
import { Button as Button49, ConfirmDialog as ConfirmDialog5, TapTargetSearchGroup, cn as
|
|
18059
|
+
import { Button as Button49, ConfirmDialog as ConfirmDialog5, TapTargetSearchGroup, cn as cn41, useIsMobile } from "@ai-matrx/design-system";
|
|
17980
18060
|
|
|
17981
18061
|
// src/gridAddRow.tsx
|
|
17982
18062
|
import { useCallback as useCallback18, useEffect as useEffect41, useMemo as useMemo27, useRef as useRef29, useState as useState55 } from "react";
|
|
@@ -18002,13 +18082,13 @@ import {
|
|
|
18002
18082
|
useRecordsClient as useRecordsClient30
|
|
18003
18083
|
} from "@ai-matrx/records/react";
|
|
18004
18084
|
import { asWriteConflict as asWriteConflict2, predictWriteRefusals, wholeValueOf as wholeValueOf3 } from "@ai-matrx/records/core";
|
|
18005
|
-
import { Button as Button37, Separator as Separator3, cn as
|
|
18085
|
+
import { Button as Button37, Separator as Separator3, cn as cn35 } from "@ai-matrx/design-system";
|
|
18006
18086
|
import { humanizeIdentifier as humanizeIdentifier6 } from "@ai-matrx/kit/text-case";
|
|
18007
18087
|
|
|
18008
18088
|
// src/StandardRecordForm.tsx
|
|
18009
18089
|
import { useState as useState53 } from "react";
|
|
18010
18090
|
import { useEntityRecord as useEntityRecord2, useRecordsClient as useRecordsClient29 } from "@ai-matrx/records/react";
|
|
18011
|
-
import { Input as Input2, Textarea as Textarea2, cn as
|
|
18091
|
+
import { Input as Input2, Textarea as Textarea2, cn as cn34 } from "@ai-matrx/design-system";
|
|
18012
18092
|
|
|
18013
18093
|
// src/CustomFieldsSection.tsx
|
|
18014
18094
|
import { useEffect as useEffect39, useMemo as useMemo25, useRef as useRef27, useState as useState52 } from "react";
|
|
@@ -18018,7 +18098,7 @@ import {
|
|
|
18018
18098
|
useEntityRecord,
|
|
18019
18099
|
useRecordsClient as useRecordsClient28
|
|
18020
18100
|
} from "@ai-matrx/records/react";
|
|
18021
|
-
import { Button as Button36, Separator as Separator2, cn as
|
|
18101
|
+
import { Button as Button36, Separator as Separator2, cn as cn33 } from "@ai-matrx/design-system";
|
|
18022
18102
|
import { mapPgError } from "@ai-matrx/records/core";
|
|
18023
18103
|
import { jsx as jsx64, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
18024
18104
|
function isEmptyValue(value) {
|
|
@@ -18274,7 +18354,7 @@ function CustomFieldsSection({
|
|
|
18274
18354
|
const values = read.data?.custom ?? {};
|
|
18275
18355
|
const empty = fields.length === 0;
|
|
18276
18356
|
if (empty && !adding) {
|
|
18277
|
-
return /* @__PURE__ */ jsxs58("section", { className:
|
|
18357
|
+
return /* @__PURE__ */ jsxs58("section", { className: cn33("flex min-w-0 flex-col gap-1 text-xs", className), children: [
|
|
18278
18358
|
/* @__PURE__ */ jsxs58("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
18279
18359
|
/* @__PURE__ */ jsx64("h3", { className: "text-sm font-medium", children: title }),
|
|
18280
18360
|
!read.loading ? /* @__PURE__ */ jsx64("span", { className: "text-muted-foreground", children: "None yet" }) : null,
|
|
@@ -18283,7 +18363,7 @@ function CustomFieldsSection({
|
|
|
18283
18363
|
cannotAdd
|
|
18284
18364
|
] });
|
|
18285
18365
|
}
|
|
18286
|
-
return /* @__PURE__ */ jsxs58("section", { className:
|
|
18366
|
+
return /* @__PURE__ */ jsxs58("section", { className: cn33("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
18287
18367
|
/* @__PURE__ */ jsxs58("div", { className: "flex items-center gap-2", children: [
|
|
18288
18368
|
/* @__PURE__ */ jsx64("h3", { className: "text-sm font-medium", children: title }),
|
|
18289
18369
|
!empty ? /* @__PURE__ */ jsx64("span", { className: "text-muted-foreground", children: fields.length }) : null,
|
|
@@ -18498,7 +18578,7 @@ function StandardRecordForm({ token: token2, recordId, columns, onSaved, classNa
|
|
|
18498
18578
|
onSaved?.(recordId);
|
|
18499
18579
|
};
|
|
18500
18580
|
if (read.error) return /* @__PURE__ */ jsx65(RefusalLine, { error: read.error, className });
|
|
18501
|
-
return /* @__PURE__ */ jsxs59("div", { className:
|
|
18581
|
+
return /* @__PURE__ */ jsxs59("div", { className: cn34("flex min-w-0 flex-col gap-2 text-xs", className), "data-records-standard-form": entityToken, children: [
|
|
18502
18582
|
/* @__PURE__ */ jsx65("dl", { className: "grid grid-cols-[minmax(5rem,7rem)_1fr] gap-x-3 gap-y-1", children: columns.map((column) => {
|
|
18503
18583
|
const id = `std-${recordId}-${column.key}`;
|
|
18504
18584
|
const value = stored[column.key];
|
|
@@ -18744,7 +18824,7 @@ function CustomRecordForm({
|
|
|
18744
18824
|
return /* @__PURE__ */ jsxs60(
|
|
18745
18825
|
"form",
|
|
18746
18826
|
{
|
|
18747
|
-
className:
|
|
18827
|
+
className: cn35("flex min-w-0 flex-col gap-3", className),
|
|
18748
18828
|
onSubmit: (e) => {
|
|
18749
18829
|
e.preventDefault();
|
|
18750
18830
|
void save();
|
|
@@ -18834,7 +18914,7 @@ function FieldRow({
|
|
|
18834
18914
|
const id = `field-${field2.id}`;
|
|
18835
18915
|
const storedWords = document2?.[field2.key];
|
|
18836
18916
|
const whole = typeof storedWords === "string" ? wholeValueOf3(document2, field2.key) : null;
|
|
18837
|
-
return /* @__PURE__ */ jsxs60("div", { className:
|
|
18917
|
+
return /* @__PURE__ */ jsxs60("div", { className: cn35("flex min-w-0 flex-col gap-1", whole && "sm:col-span-2"), children: [
|
|
18838
18918
|
/* @__PURE__ */ jsx66(FieldLabel, { field: field2, htmlFor: id, children: /* @__PURE__ */ jsx66(ProvenanceBadge, { document: document2, fieldKey: field2.key }) }),
|
|
18839
18919
|
whole ? (
|
|
18840
18920
|
// A TEXT KEPT AS A FILE opens WHOLE, never as the 1000 characters its cell holds —
|
|
@@ -19719,7 +19799,7 @@ import {
|
|
|
19719
19799
|
Label as Label14,
|
|
19720
19800
|
Skeleton as Skeleton6,
|
|
19721
19801
|
Switch,
|
|
19722
|
-
cn as
|
|
19802
|
+
cn as cn36
|
|
19723
19803
|
} from "@ai-matrx/design-system";
|
|
19724
19804
|
import { formatRelativeTime as formatRelativeTime2 } from "@ai-matrx/kit/format";
|
|
19725
19805
|
import { Fragment as Fragment19, jsx as jsx68, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
@@ -19742,7 +19822,7 @@ function EnrichBadge({ cell: cell2, onPin, className }) {
|
|
|
19742
19822
|
const alternates = cell2.alternates ?? [];
|
|
19743
19823
|
const word = state2 === "yours" ? "yours" : state2 === "unsure" ? "unsure" : "agent";
|
|
19744
19824
|
return /* @__PURE__ */ jsxs62(HoverCard, { children: [
|
|
19745
|
-
/* @__PURE__ */ jsx68(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsxs62("span", { className:
|
|
19825
|
+
/* @__PURE__ */ jsx68(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsxs62("span", { className: cn36("inline-flex items-center gap-1 align-middle", className), children: [
|
|
19746
19826
|
/* @__PURE__ */ jsx68(
|
|
19747
19827
|
Badge8,
|
|
19748
19828
|
{
|
|
@@ -19908,12 +19988,12 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
19908
19988
|
[host, load, tableId]
|
|
19909
19989
|
);
|
|
19910
19990
|
if (error) return /* @__PURE__ */ jsx68(RefusalNotice, { error, className });
|
|
19911
|
-
if (rows === null) return /* @__PURE__ */ jsx68(Skeleton6, { className:
|
|
19991
|
+
if (rows === null) return /* @__PURE__ */ jsx68(Skeleton6, { className: cn36("h-40 w-full", className) });
|
|
19912
19992
|
if (shown5.length === 0 && fieldId) {
|
|
19913
19993
|
const target = (fields.data ?? []).find((f) => f.id === fieldId);
|
|
19914
19994
|
const setup = draft[fieldId] ?? { instruction: "", every: "30" };
|
|
19915
19995
|
if (!rights.admin) {
|
|
19916
|
-
return /* @__PURE__ */ jsxs62("div", { className:
|
|
19996
|
+
return /* @__PURE__ */ jsxs62("div", { className: cn36("space-y-2 p-4 text-sm", className), children: [
|
|
19917
19997
|
/* @__PURE__ */ jsxs62("p", { className: "font-medium", children: [
|
|
19918
19998
|
"Nothing fills ",
|
|
19919
19999
|
target?.name ?? "this column",
|
|
@@ -19922,7 +20002,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
19922
20002
|
/* @__PURE__ */ jsx68("p", { className: "text-muted-foreground", children: "An admin on this table sets that up." })
|
|
19923
20003
|
] });
|
|
19924
20004
|
}
|
|
19925
|
-
return /* @__PURE__ */ jsxs62("div", { className:
|
|
20005
|
+
return /* @__PURE__ */ jsxs62("div", { className: cn36("space-y-3 p-4 text-sm", className), children: [
|
|
19926
20006
|
/* @__PURE__ */ jsxs62("p", { className: "font-medium", children: [
|
|
19927
20007
|
"Let a model keep ",
|
|
19928
20008
|
target?.name ?? "this column",
|
|
@@ -19973,12 +20053,12 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
19973
20053
|
] });
|
|
19974
20054
|
}
|
|
19975
20055
|
if (shown5.length === 0) {
|
|
19976
|
-
return /* @__PURE__ */ jsxs62("div", { className:
|
|
20056
|
+
return /* @__PURE__ */ jsxs62("div", { className: cn36("space-y-2 p-4 text-sm", className), children: [
|
|
19977
20057
|
/* @__PURE__ */ jsx68("p", { className: "font-medium", children: "No column here is filled in by a model." }),
|
|
19978
20058
|
/* @__PURE__ */ jsx68("p", { className: "text-muted-foreground", children: rights.admin ? "Open a column's menu and choose \u201CLet AI fill\u201D to set one up \u2014 or just ask for it in plain words and the agent will." : "An admin on this table sets that up." })
|
|
19979
20059
|
] });
|
|
19980
20060
|
}
|
|
19981
|
-
return /* @__PURE__ */ jsx68("div", { className:
|
|
20061
|
+
return /* @__PURE__ */ jsx68("div", { className: cn36("space-y-6 p-4", className), children: shown5.map((row) => {
|
|
19982
20062
|
const d = draft[row.field_id] ?? {
|
|
19983
20063
|
instruction: row.enrichment?.instruction ?? "",
|
|
19984
20064
|
every: row.review_interval_days ? String(row.review_interval_days) : ""
|
|
@@ -20359,6 +20439,8 @@ function columnForField(field2, editing, mayWriteRow, whyNotRow, look, onAskWhoC
|
|
|
20359
20439
|
] }) : name
|
|
20360
20440
|
),
|
|
20361
20441
|
label: name,
|
|
20442
|
+
// The field's own description, one hover away on every header (not only the type mark's glyph).
|
|
20443
|
+
...fieldHelpText(field2) ? { helpText: fieldHelpText(field2) } : {},
|
|
20362
20444
|
accessorFn: (row) => row.document?.[field2.key],
|
|
20363
20445
|
// A column the store keeps no value for is not offered a sort it would refuse (`sortRefusal`).
|
|
20364
20446
|
sortable: sortRefusal(field2) === null,
|
|
@@ -20517,7 +20599,7 @@ import {
|
|
|
20517
20599
|
|
|
20518
20600
|
// src/ReverseColumns.tsx
|
|
20519
20601
|
import { useFields as useFields9, useOptionalRecordsClient as useOptionalRecordsClient12, useReverseColumns as useReverseColumns3, useReverseLinks, useTable as useTable7 } from "@ai-matrx/records/react";
|
|
20520
|
-
import { Button as Button41, Dialog as Dialog14, DialogContent as DialogContent14, DialogHeader as DialogHeader14, DialogTitle as DialogTitle14, Popover as Popover9, PopoverContent as PopoverContent9, PopoverTrigger as PopoverTrigger9, Separator as Separator4, Skeleton as Skeleton7, cn as
|
|
20602
|
+
import { Button as Button41, Dialog as Dialog14, DialogContent as DialogContent14, DialogHeader as DialogHeader14, DialogTitle as DialogTitle14, Popover as Popover9, PopoverContent as PopoverContent9, PopoverTrigger as PopoverTrigger9, Separator as Separator4, Skeleton as Skeleton7, cn as cn37 } from "@ai-matrx/design-system";
|
|
20521
20603
|
import { Fragment as Fragment20, jsx as jsx70, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
20522
20604
|
function reverseColumnId(column) {
|
|
20523
20605
|
return `${REVERSE_COLUMN_PREFIX}${column.key}`;
|
|
@@ -20554,7 +20636,7 @@ function ReverseLinkChips({
|
|
|
20554
20636
|
}
|
|
20555
20637
|
);
|
|
20556
20638
|
}
|
|
20557
|
-
return /* @__PURE__ */ jsxs64("span", { className:
|
|
20639
|
+
return /* @__PURE__ */ jsxs64("span", { className: cn37("flex min-w-0 flex-wrap items-center gap-1", className), "data-records-reverse-cell": column.key, children: [
|
|
20558
20640
|
refs.map((r) => /* @__PURE__ */ jsx70(ReferenceChip, { reference: r }, r.id)),
|
|
20559
20641
|
more > 0 ? /* @__PURE__ */ jsxs64("span", { className: "shrink-0 text-[11px] text-muted-foreground", title: `${more} more`, "data-records-reverse-more": "", children: [
|
|
20560
20642
|
"+",
|
|
@@ -21151,7 +21233,7 @@ import {
|
|
|
21151
21233
|
DropdownMenu as DropdownMenu4,
|
|
21152
21234
|
DropdownMenuContent as DropdownMenuContent4,
|
|
21153
21235
|
DropdownMenuTrigger as DropdownMenuTrigger4,
|
|
21154
|
-
cn as
|
|
21236
|
+
cn as cn38
|
|
21155
21237
|
} from "@ai-matrx/design-system";
|
|
21156
21238
|
|
|
21157
21239
|
// src/ObjectActionMenuItems.tsx
|
|
@@ -21405,7 +21487,7 @@ function RecordActionMenu({ tableId, row, name, onOpenRecord, onChanged, childre
|
|
|
21405
21487
|
[row.id, tableId, name, rights, actionHost]
|
|
21406
21488
|
);
|
|
21407
21489
|
return /* @__PURE__ */ jsxs68(ContextMenu, { children: [
|
|
21408
|
-
/* @__PURE__ */ jsx75(ContextMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs68("div", { className:
|
|
21490
|
+
/* @__PURE__ */ jsx75(ContextMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs68("div", { className: cn38("group/record-card relative", className), "data-record-actions": row.id, children: [
|
|
21409
21491
|
children,
|
|
21410
21492
|
/* @__PURE__ */ jsxs68(DropdownMenu4, { children: [
|
|
21411
21493
|
/* @__PURE__ */ jsx75(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx75(
|
|
@@ -21547,15 +21629,15 @@ import {
|
|
|
21547
21629
|
SelectTrigger as SelectTrigger9,
|
|
21548
21630
|
SelectValue as SelectValue9,
|
|
21549
21631
|
Separator as Separator6,
|
|
21550
|
-
cn as
|
|
21632
|
+
cn as cn39
|
|
21551
21633
|
} from "@ai-matrx/design-system";
|
|
21552
21634
|
import { relationNameIndexOf, relationNameKey as relationNameKey2, relationNamesIn, splitListCell } from "@ai-matrx/records";
|
|
21553
21635
|
|
|
21554
21636
|
// src/importRuleCheck.ts
|
|
21555
21637
|
import { predictValueRefusals as predictValueRefusals2 } from "@ai-matrx/records/core";
|
|
21556
|
-
function
|
|
21638
|
+
function refusedCellsOf(fields, rows, mapping, choiceOptions, relationNames) {
|
|
21557
21639
|
const byKey = new Map(fields.map((f) => [f.key, f]));
|
|
21558
|
-
const
|
|
21640
|
+
const cells = [];
|
|
21559
21641
|
for (const [header, key] of Object.entries(mapping)) {
|
|
21560
21642
|
const field2 = byKey.get(key);
|
|
21561
21643
|
if (!field2) continue;
|
|
@@ -21565,9 +21647,8 @@ function checkImportRules(fields, rows, mapping, choiceOptions, relationNames) {
|
|
|
21565
21647
|
if (isChoice && !options) continue;
|
|
21566
21648
|
const named = relationNames?.get(key);
|
|
21567
21649
|
if (kind2 === "relation" && !named) continue;
|
|
21568
|
-
let refused = 0;
|
|
21569
21650
|
let judged = 0;
|
|
21570
|
-
|
|
21651
|
+
const mine = [];
|
|
21571
21652
|
rows.forEach((row, i) => {
|
|
21572
21653
|
const raw = String(row[header] ?? "").trim();
|
|
21573
21654
|
if (raw === "") return;
|
|
@@ -21583,17 +21664,20 @@ function checkImportRules(fields, rows, mapping, choiceOptions, relationNames) {
|
|
|
21583
21664
|
);
|
|
21584
21665
|
if (predicted.length > 0) why = predicted[0].message;
|
|
21585
21666
|
}
|
|
21586
|
-
if (why !== null) {
|
|
21587
|
-
refused += 1;
|
|
21588
|
-
if (!first) first = { why, line: i + 1, raw };
|
|
21589
|
-
}
|
|
21667
|
+
if (why !== null) mine.push({ header, line: i + 1, raw, why });
|
|
21590
21668
|
});
|
|
21591
|
-
|
|
21592
|
-
const f = first;
|
|
21593
|
-
verdicts.push({ header, field: field2, refused, judged, firstWhy: f.why, firstLine: f.line, firstRaw: f.raw });
|
|
21594
|
-
}
|
|
21669
|
+
for (const c of mine) cells.push({ ...c, judged, field: field2 });
|
|
21595
21670
|
}
|
|
21596
|
-
return
|
|
21671
|
+
return cells;
|
|
21672
|
+
}
|
|
21673
|
+
function checkImportRules(fields, rows, mapping, choiceOptions, relationNames) {
|
|
21674
|
+
const verdicts = /* @__PURE__ */ new Map();
|
|
21675
|
+
for (const c of refusedCellsOf(fields, rows, mapping, choiceOptions, relationNames)) {
|
|
21676
|
+
const have = verdicts.get(c.header);
|
|
21677
|
+
if (have) have.refused += 1;
|
|
21678
|
+
else verdicts.set(c.header, { header: c.header, field: c.field, refused: 1, judged: c.judged, firstWhy: c.why, firstLine: c.line, firstRaw: c.raw });
|
|
21679
|
+
}
|
|
21680
|
+
return [...verdicts.values()];
|
|
21597
21681
|
}
|
|
21598
21682
|
|
|
21599
21683
|
// src/ImportWizard.tsx
|
|
@@ -22005,7 +22089,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22005
22089
|
},
|
|
22006
22090
|
[client, openRun]
|
|
22007
22091
|
);
|
|
22008
|
-
const declared2 = fields.data ?? [];
|
|
22092
|
+
const declared2 = useMemo32(() => fields.data ?? [], [fields.data]);
|
|
22009
22093
|
const titleKey = table.data?.title_field ?? null;
|
|
22010
22094
|
const titleHeader = titleFrom ?? (titleKey ? Object.entries(mapping).find(([h, key]) => key === titleKey && h !== TITLE_COPY)?.[0] ?? null : null);
|
|
22011
22095
|
const distinctRows = useMemo32(() => {
|
|
@@ -22299,6 +22383,12 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22299
22383
|
() => exactDuplicateRows(effectiveRows, (plan?.columns ?? []).map((c) => c.header).filter((h) => !leftOut.has(h))),
|
|
22300
22384
|
[effectiveRows, plan, leftOut]
|
|
22301
22385
|
);
|
|
22386
|
+
const [goAheadAnyway, setGoAheadAnyway] = useState62(false);
|
|
22387
|
+
const refusedCells = useMemo32(
|
|
22388
|
+
() => goAheadAnyway ? refusedCellsOf(declared2, effectiveRows, mapping, choiceIndex, relationIndex) : [],
|
|
22389
|
+
[goAheadAnyway, declared2, effectiveRows, mapping, choiceIndex, relationIndex]
|
|
22390
|
+
);
|
|
22391
|
+
const [keptAside, setKeptAside] = useState62([]);
|
|
22302
22392
|
const rowsToSend = useCallback22(
|
|
22303
22393
|
(index) => {
|
|
22304
22394
|
const repeated = new Set(skipRepeats ? repeats.map((r) => r.row) : []);
|
|
@@ -22308,6 +22398,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22308
22398
|
if (repeated.has(at)) return;
|
|
22309
22399
|
const out = {};
|
|
22310
22400
|
for (const [header, value] of Object.entries(row)) if (!leftOut.has(header)) out[header] = value;
|
|
22401
|
+
for (const c of refusedCells) if (c.line === at + 1 && c.header in out) out[c.header] = "";
|
|
22311
22402
|
if (titleFrom) out[TITLE_COPY] = String(row[titleFrom] ?? "").trim();
|
|
22312
22403
|
for (const { header, field: field2 } of mappedRelations) {
|
|
22313
22404
|
const named = index.get(field2.key);
|
|
@@ -22337,7 +22428,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22337
22428
|
return { rows: sent, lines };
|
|
22338
22429
|
},
|
|
22339
22430
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- choiceFor reads unlinkedChoice
|
|
22340
|
-
[effectiveRows, combined, titleFrom, leftOut, mappedRelations, unlinkedChoice, dateAsks, dateMiss, repeats, skipRepeats]
|
|
22431
|
+
[effectiveRows, combined, titleFrom, leftOut, mappedRelations, unlinkedChoice, dateAsks, dateMiss, repeats, skipRepeats, refusedCells]
|
|
22341
22432
|
);
|
|
22342
22433
|
const run = useCallback22(async () => {
|
|
22343
22434
|
if (!plan) return;
|
|
@@ -22405,6 +22496,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22405
22496
|
index = reread;
|
|
22406
22497
|
}
|
|
22407
22498
|
const { rows: sendRows, lines: sendLines } = rowsToSend(index);
|
|
22499
|
+
setKeptAside(refusedCells.map(({ header, line, raw, why }) => ({ header, line, raw, why })));
|
|
22408
22500
|
setSentLines(sendLines);
|
|
22409
22501
|
setRepeatsSkipped(effectiveRows.length - sendRows.length);
|
|
22410
22502
|
let sendMapping = mapping;
|
|
@@ -22538,7 +22630,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22538
22630
|
setPhase("done");
|
|
22539
22631
|
onWrote?.(finished.data.rows_written);
|
|
22540
22632
|
void loadRuns();
|
|
22541
|
-
}, [newColumns, makesColumns, kindChoice, guessedKind, addChoiceWords, client, dedupeKey, effectiveRows, fileBytes, fileHash, fileName, format, leftOut, loadRuns, mappedRelations, mapping, newChoiceWords, nudge, onDuplicate, onWrote, plan, readRelationNames, relationAsks, relationIndex, rights.admin, rowsToSend, tableId, unmapped, unlinkedChoice]);
|
|
22633
|
+
}, [newColumns, makesColumns, kindChoice, guessedKind, addChoiceWords, client, dedupeKey, effectiveRows, fileBytes, fileHash, fileName, format, leftOut, loadRuns, mappedRelations, mapping, newChoiceWords, nudge, onDuplicate, onWrote, plan, readRelationNames, refusedCells, relationAsks, relationIndex, rights.admin, rowsToSend, tableId, unmapped, unlinkedChoice]);
|
|
22542
22634
|
const counts = useMemo32(() => {
|
|
22543
22635
|
let landed = 0;
|
|
22544
22636
|
let duplicate = 0;
|
|
@@ -22567,8 +22659,8 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22567
22659
|
);
|
|
22568
22660
|
const ruleVerdictOf = useMemo32(() => new Map(ruleVerdicts.map((v) => [v.header, v])), [ruleVerdicts]);
|
|
22569
22661
|
const refusedByRules = ruleVerdicts.reduce((n, v) => n + v.refused, 0);
|
|
22570
|
-
const
|
|
22571
|
-
useEffect46(() => setGoAheadAnyway(false), [
|
|
22662
|
+
const verdictKey = ruleVerdicts.map((v) => `${v.header}:${v.refused}/${v.judged}`).join("|");
|
|
22663
|
+
useEffect46(() => setGoAheadAnyway(false), [verdictKey]);
|
|
22572
22664
|
const [autoRan, setAutoRan] = useState62(false);
|
|
22573
22665
|
useEffect46(() => {
|
|
22574
22666
|
if (!autoRun || autoRan || !source || phase !== "ready" || !plan) return;
|
|
@@ -22577,7 +22669,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22577
22669
|
void run();
|
|
22578
22670
|
}, [autoRun, autoRan, source, phase, plan, busy, rights.write, rows.length, titleMissing, ruleVerdicts, run]);
|
|
22579
22671
|
const afterWrite = !busy && (phase === "done" || alreadyRan !== null || ledger !== null && ledger.seen > 0);
|
|
22580
|
-
return /* @__PURE__ */ jsxs70("div", { className:
|
|
22672
|
+
return /* @__PURE__ */ jsxs70("div", { className: cn39("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
22581
22673
|
/* @__PURE__ */ jsxs70("div", { className: "flex items-center gap-2", children: [
|
|
22582
22674
|
/* @__PURE__ */ jsx77("span", { className: "font-medium", children: "Import" }),
|
|
22583
22675
|
/* @__PURE__ */ jsx77("span", { className: "text-muted-foreground", children: table.data?.name }),
|
|
@@ -22937,7 +23029,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
22937
23029
|
"div",
|
|
22938
23030
|
{
|
|
22939
23031
|
"data-import-relation": ask2.field.key,
|
|
22940
|
-
className:
|
|
23032
|
+
className: cn39(
|
|
22941
23033
|
"flex flex-col gap-1 rounded border px-2 py-1.5",
|
|
22942
23034
|
clean ? "bg-muted/40" : "border-amber-500/40 bg-amber-500/5"
|
|
22943
23035
|
),
|
|
@@ -23091,7 +23183,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
23091
23183
|
children: phase === "linking" ? "Linking the names\u2026" : phase === "declaring" ? "Adding the columns\u2026" : phase === "writing" ? `Writing\u2026 ${progress} of ${effectiveRows.length}` : combining ? `Import ${effectiveRows.length} records from ${rows.length} rows` : `Import ${rows.length} row${rows.length === 1 ? "" : "s"}`
|
|
23092
23184
|
}
|
|
23093
23185
|
),
|
|
23094
|
-
/* @__PURE__ */ jsxs70("span", { className:
|
|
23186
|
+
/* @__PURE__ */ jsxs70("span", { className: cn39("text-muted-foreground", titleMissing && "text-destructive"), children: [
|
|
23095
23187
|
titleMissing ? `Nothing goes into ${titleFieldLabel} yet, so these records would have no name. Choose the column above, then this will run.` : columnsSentence(mappedCount, plan.columns.length - leftOut.size, unmapped) + (leftOut.size > 0 ? ` \xB7 ${leftOut.size} left out` : ""),
|
|
23096
23188
|
fileHash || titleMissing ? "" : " \xB7 this browser cannot recognise the file again, so importing it twice would write it twice"
|
|
23097
23189
|
] })
|
|
@@ -23117,9 +23209,9 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
23117
23209
|
/* @__PURE__ */ jsx77("span", { children: ledger ? `${ledger.written} landed \xB7 ${ledger.duplicate} already here \xB7 ${ledger.refused} refused, of ${ledger.seen} row${ledger.seen === 1 ? "" : "s"} offered` : `${counts.landed} landed \xB7 ${counts.duplicate} already here \xB7 ${counts.refused} refused` }),
|
|
23118
23210
|
ledger && !ledger.final && phase !== "writing" ? /* @__PURE__ */ jsx77("span", { className: "text-destructive", children: "The run stopped here, so the rest of the file was never offered \u2014 these are the rows that were dealt with before it stopped, not the whole file." }) : null,
|
|
23119
23211
|
(ledger ? ledger.refused + ledger.duplicate : counts.refused + counts.duplicate) > 0 ? /* @__PURE__ */ jsxs70(Fragment24, { children: [
|
|
23120
|
-
/* @__PURE__ */ jsx77("button", { type: "button", className:
|
|
23121
|
-
/* @__PURE__ */ jsx77("button", { type: "button", className:
|
|
23122
|
-
/* @__PURE__ */ jsx77("button", { type: "button", className:
|
|
23212
|
+
/* @__PURE__ */ jsx77("button", { type: "button", className: cn39("underline underline-offset-2", show === "all" && "font-medium"), onClick: () => setShow("all"), children: "everything that did not land" }),
|
|
23213
|
+
/* @__PURE__ */ jsx77("button", { type: "button", className: cn39("underline underline-offset-2", show === "refused" && "font-medium"), onClick: () => setShow("refused"), children: "refused" }),
|
|
23214
|
+
/* @__PURE__ */ jsx77("button", { type: "button", className: cn39("underline underline-offset-2", show === "duplicate" && "font-medium"), onClick: () => setShow("duplicate"), children: "already here" })
|
|
23123
23215
|
] }) : null
|
|
23124
23216
|
] }),
|
|
23125
23217
|
summary ? /* @__PURE__ */ jsx77("p", { className: "text-muted-foreground", children: summary }) : null,
|
|
@@ -23158,6 +23250,23 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
23158
23250
|
] })
|
|
23159
23251
|
}
|
|
23160
23252
|
) }) : null,
|
|
23253
|
+
afterWrite && keptAside.length > 0 ? /* @__PURE__ */ jsxs70("div", { "data-import-kept-aside": "", className: "flex flex-col gap-0.5", children: [
|
|
23254
|
+
/* @__PURE__ */ jsxs70("p", { children: [
|
|
23255
|
+
keptAside.length,
|
|
23256
|
+
" cell",
|
|
23257
|
+
keptAside.length === 1 ? " was" : "s were",
|
|
23258
|
+
" kept aside and left empty; every other value in those rows was written."
|
|
23259
|
+
] }),
|
|
23260
|
+
/* @__PURE__ */ jsx77("ul", { className: "flex flex-col gap-0.5 text-muted-foreground", children: keptAside.map((c) => /* @__PURE__ */ jsxs70("li", { children: [
|
|
23261
|
+
c.header,
|
|
23262
|
+
", ",
|
|
23263
|
+
source ? `row ${c.line}` : `line ${lineInYourFile(c.line)}`,
|
|
23264
|
+
": ",
|
|
23265
|
+
c.raw,
|
|
23266
|
+
" \u2014 ",
|
|
23267
|
+
c.why
|
|
23268
|
+
] }, `${c.header}:${c.line}`)) })
|
|
23269
|
+
] }) : null,
|
|
23161
23270
|
repeatsSkipped > 0 ? /* @__PURE__ */ jsxs70("p", { className: "text-muted-foreground", "data-import-repeats-skipped": "", children: [
|
|
23162
23271
|
repeatsSkipped,
|
|
23163
23272
|
" repeated row",
|
|
@@ -25201,7 +25310,7 @@ function BulkActions({
|
|
|
25201
25310
|
import { useEffect as useEffect53, useMemo as useMemo38, useRef as useRef36, useState as useState69 } from "react";
|
|
25202
25311
|
import { useRecordsClient as useRecordsClient41 } from "@ai-matrx/records/react";
|
|
25203
25312
|
import { stableFilterKey as stableFilterKey2 } from "@ai-matrx/records";
|
|
25204
|
-
import { Button as Button48, ConfirmDialog as ConfirmDialog4, Popover as Popover11, PopoverContent as PopoverContent11, PopoverTrigger as PopoverTrigger11, cn as
|
|
25313
|
+
import { Button as Button48, ConfirmDialog as ConfirmDialog4, Popover as Popover11, PopoverContent as PopoverContent11, PopoverTrigger as PopoverTrigger11, cn as cn40 } from "@ai-matrx/design-system";
|
|
25205
25314
|
|
|
25206
25315
|
// src/views.ts
|
|
25207
25316
|
import {
|
|
@@ -25446,7 +25555,7 @@ function HandOrderDialog({
|
|
|
25446
25555
|
setDragging(index);
|
|
25447
25556
|
},
|
|
25448
25557
|
onDragEnd: () => setDragging(null),
|
|
25449
|
-
className:
|
|
25558
|
+
className: cn40(
|
|
25450
25559
|
"flex items-center gap-2 border-b border-border px-2 py-1 text-sm last:border-b-0",
|
|
25451
25560
|
dragging === index && "bg-muted"
|
|
25452
25561
|
),
|
|
@@ -27451,7 +27560,7 @@ function GridBody({
|
|
|
27451
27560
|
return /* @__PURE__ */ jsx88(WhoChangedSource, { tableId, labelOf: labelOfField, children: /* @__PURE__ */ jsxs77(
|
|
27452
27561
|
"div",
|
|
27453
27562
|
{
|
|
27454
|
-
className:
|
|
27563
|
+
className: cn41("relative flex min-h-0 flex-col gap-2", fills && "flex-1", className),
|
|
27455
27564
|
"data-records-grid-footer": footer ?? "natural",
|
|
27456
27565
|
...merged ? {
|
|
27457
27566
|
// THE SUMMARY MEASURES ARE ASKED WHEN A PERSON REACHES FOR THE GRID — a header menu, a
|
|
@@ -27645,7 +27754,7 @@ function GridBody({
|
|
|
27645
27754
|
...valueFacets ? { facets: valueFacets, filterUi: VALUE_FILTER_UI } : {},
|
|
27646
27755
|
...classicInCard || embeddedMore ? { hidePagination: true } : {},
|
|
27647
27756
|
...embedded ? { appearance: "embedded" } : {},
|
|
27648
|
-
tableClassName:
|
|
27757
|
+
tableClassName: cn41(
|
|
27649
27758
|
!look.wrap && lines === 1 && "[&_tbody_td]:max-w-[28rem] [&_tbody_td]:overflow-hidden [&_tbody_td]:text-ellipsis [&_tbody_td]:whitespace-nowrap! [&_tbody_td_*]:whitespace-nowrap!",
|
|
27650
27759
|
embedded && EMBEDDED_TABLE_CLASS,
|
|
27651
27760
|
embedded && !calculationChosen && EMBEDDED_PLAIN_FOOTER_CLASS
|
|
@@ -28250,7 +28359,7 @@ function cutWords(written) {
|
|
|
28250
28359
|
|
|
28251
28360
|
// src/ExportMenu.tsx
|
|
28252
28361
|
import { AlchemyMenu } from "@ai-matrx/alchemy/react";
|
|
28253
|
-
import { Button as Button51, cn as
|
|
28362
|
+
import { Button as Button51, cn as cn42 } from "@ai-matrx/design-system";
|
|
28254
28363
|
import { jsx as jsx91, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
28255
28364
|
function toRows(fields, records, labels) {
|
|
28256
28365
|
return records.map((record) => {
|
|
@@ -28331,7 +28440,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
28331
28440
|
if (!rows && !view && page.error) return /* @__PURE__ */ jsx91(RefusalLine, { error: page.error, className });
|
|
28332
28441
|
if (!rows && viewHeld && "error" in viewHeld) return /* @__PURE__ */ jsx91(RefusalLine, { error: viewHeld.error, className });
|
|
28333
28442
|
if (!fields.data || !rows && (view ? !viewHeld : !page.data)) {
|
|
28334
|
-
return /* @__PURE__ */ jsx91("span", { className:
|
|
28443
|
+
return /* @__PURE__ */ jsx91("span", { className: cn42("text-xs text-muted-foreground", className), children: "Reading this table\u2026" });
|
|
28335
28444
|
}
|
|
28336
28445
|
const exported = () => rowsForFile({ client, host, fields: columns, records, labels });
|
|
28337
28446
|
const tableName2 = table.data?.name ?? name;
|
|
@@ -28342,7 +28451,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
28342
28451
|
{ id: "copy-json", label: "Copy JSON", word: "JSON", suffix: "", copy: true, write: exportJson },
|
|
28343
28452
|
{ id: "copy-full-schema", label: "Copy full schema", word: "full schema", suffix: "", copy: true, write: (c, r) => exportFullSchema({ name: tableName2, settings }, c, r) }
|
|
28344
28453
|
];
|
|
28345
|
-
return /* @__PURE__ */ jsxs79("div", { className:
|
|
28454
|
+
return /* @__PURE__ */ jsxs79("div", { className: cn42("flex items-center gap-1", className), children: [
|
|
28346
28455
|
/* @__PURE__ */ jsx91(
|
|
28347
28456
|
Button51,
|
|
28348
28457
|
{
|
|
@@ -28445,7 +28554,7 @@ function ExportMenu({ tableId, rows, label, className, view }) {
|
|
|
28445
28554
|
// src/ImportNotice.tsx
|
|
28446
28555
|
import { useCallback as useCallback29, useEffect as useEffect57, useMemo as useMemo41, useState as useState73 } from "react";
|
|
28447
28556
|
import { useRecordsClient as useRecordsClient46 } from "@ai-matrx/records/react";
|
|
28448
|
-
import { Button as Button52, cn as
|
|
28557
|
+
import { Button as Button52, cn as cn43 } from "@ai-matrx/design-system";
|
|
28449
28558
|
import { jsx as jsx92, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
28450
28559
|
var DISMISSED_KEY = (importId) => `records-ui.import-notice.dismissed.${importId}`;
|
|
28451
28560
|
function wasDismissed(importId) {
|
|
@@ -28508,7 +28617,7 @@ function ImportNotice({ tableId, onOpenImport, epoch = 0, className }) {
|
|
|
28508
28617
|
if (problem) return /* @__PURE__ */ jsx92(RefusalNotice, { error: problem, className });
|
|
28509
28618
|
if (!shown5) return null;
|
|
28510
28619
|
const reasons = report && report.import_id === shown5.import_id ? groupReasons(report.rows.map((r) => String(r.reason ?? ""))) : [];
|
|
28511
|
-
return /* @__PURE__ */ jsx92("div", { className:
|
|
28620
|
+
return /* @__PURE__ */ jsx92("div", { className: cn43("shrink-0", className), "data-import-notice": shown5.import_id, children: /* @__PURE__ */ jsx92(
|
|
28512
28621
|
RefusalNotice,
|
|
28513
28622
|
{
|
|
28514
28623
|
error: (0, refusals_exports.refusal)(
|
|
@@ -28559,7 +28668,7 @@ import {
|
|
|
28559
28668
|
SelectItem as SelectItem11,
|
|
28560
28669
|
SelectTrigger as SelectTrigger11,
|
|
28561
28670
|
SelectValue as SelectValue11,
|
|
28562
|
-
cn as
|
|
28671
|
+
cn as cn49
|
|
28563
28672
|
} from "@ai-matrx/design-system";
|
|
28564
28673
|
|
|
28565
28674
|
// src/unfinishedTable.ts
|
|
@@ -28602,7 +28711,7 @@ import { useEffect as useEffect62, useState as useState79 } from "react";
|
|
|
28602
28711
|
import { useRecordsClient as useRecordsClient52, useTables as useTables2 } from "@ai-matrx/records/react";
|
|
28603
28712
|
import { withTableFacts } from "@ai-matrx/records/core";
|
|
28604
28713
|
import { withTablePlacement as withTablePlacement2 } from "@ai-matrx/records";
|
|
28605
|
-
import { Button as Button59, Skeleton as Skeleton10, cn as
|
|
28714
|
+
import { Button as Button59, Skeleton as Skeleton10, cn as cn48 } from "@ai-matrx/design-system";
|
|
28606
28715
|
|
|
28607
28716
|
// src/NewTableStart.tsx
|
|
28608
28717
|
import { useCallback as useCallback30, useMemo as useMemo42, useRef as useRef38, useState as useState74 } from "react";
|
|
@@ -28618,7 +28727,7 @@ import {
|
|
|
28618
28727
|
SelectValue as SelectValue10,
|
|
28619
28728
|
Switch as Switch2,
|
|
28620
28729
|
Textarea as Textarea3,
|
|
28621
|
-
cn as
|
|
28730
|
+
cn as cn44
|
|
28622
28731
|
} from "@ai-matrx/design-system";
|
|
28623
28732
|
import { Tile } from "@ai-matrx/design-system/controls";
|
|
28624
28733
|
|
|
@@ -29218,7 +29327,7 @@ function NewTableStart({
|
|
|
29218
29327
|
return /* @__PURE__ */ jsxs81(
|
|
29219
29328
|
"div",
|
|
29220
29329
|
{
|
|
29221
|
-
className:
|
|
29330
|
+
className: cn44("relative flex h-full min-h-0 flex-col", className),
|
|
29222
29331
|
"data-new-table-start": step2.at,
|
|
29223
29332
|
onDragOver: (e) => {
|
|
29224
29333
|
if (step2.at === "wizard" || !e.dataTransfer?.types?.includes("Files")) return;
|
|
@@ -29307,7 +29416,7 @@ import { copyText as copyText5 } from "@ai-matrx/kit/clipboard";
|
|
|
29307
29416
|
import { useCallback as useCallback33, useEffect as useEffect60, useMemo as useMemo44, useState as useState77 } from "react";
|
|
29308
29417
|
import { useRecordsClient as useRecordsClient50, useMyLevels as useMyLevels2 } from "@ai-matrx/records/react";
|
|
29309
29418
|
import { bookingPath as bookingPath2 } from "@ai-matrx/records";
|
|
29310
|
-
import { Badge as Badge11, Button as Button57, Skeleton as Skeleton9, cn as
|
|
29419
|
+
import { Badge as Badge11, Button as Button57, Skeleton as Skeleton9, cn as cn47 } from "@ai-matrx/design-system";
|
|
29311
29420
|
|
|
29312
29421
|
// src/BookingBuilder.tsx
|
|
29313
29422
|
import { copyText as copyText4 } from "@ai-matrx/kit/clipboard";
|
|
@@ -29318,7 +29427,7 @@ import { formatDurationMinutes } from "@ai-matrx/kit/format";
|
|
|
29318
29427
|
import {
|
|
29319
29428
|
bookingPath
|
|
29320
29429
|
} from "@ai-matrx/records";
|
|
29321
|
-
import { BasicInput as BasicInput17, BasicTextarea as BasicTextarea7, Button as Button54, Checkbox as Checkbox10, Label as Label18, Skeleton as Skeleton8, cn as
|
|
29430
|
+
import { BasicInput as BasicInput17, BasicTextarea as BasicTextarea7, Button as Button54, Checkbox as Checkbox10, Label as Label18, Skeleton as Skeleton8, cn as cn45 } from "@ai-matrx/design-system";
|
|
29322
29431
|
import { Select as Select11 } from "@ai-matrx/design-system/controls";
|
|
29323
29432
|
|
|
29324
29433
|
// src/publicQuestions.ts
|
|
@@ -29595,9 +29704,9 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
29595
29704
|
await load();
|
|
29596
29705
|
onSaved?.({ form_id: formId });
|
|
29597
29706
|
}
|
|
29598
|
-
if (!loaded || fields.loading && !fields.data) return /* @__PURE__ */ jsx95(Skeleton8, { className:
|
|
29707
|
+
if (!loaded || fields.loading && !fields.data) return /* @__PURE__ */ jsx95(Skeleton8, { className: cn45("h-64 w-full", className) });
|
|
29599
29708
|
if (!rights.structure) {
|
|
29600
|
-
return /* @__PURE__ */ jsx95("p", { className:
|
|
29709
|
+
return /* @__PURE__ */ jsx95("p", { className: cn45("text-xs text-muted-foreground", className), children: rights.why("structure") ?? "Making a booking page needs the admin level on this table, because it lets people with no account take time in your calendar." });
|
|
29601
29710
|
}
|
|
29602
29711
|
const url = formId ? `${publicOrigin}${bookingPath(formId)}` : null;
|
|
29603
29712
|
const shown5 = offer ?? null;
|
|
@@ -29605,7 +29714,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
29605
29714
|
// THE RAIL IS 384px WIDE AND THE VIEWPORT IS NOT (walk 1, 2026-09-21):
|
|
29606
29715
|
// every split below is a CONTAINER query, so this screen is the same
|
|
29607
29716
|
// screen in a rail, a dialog and a full page.
|
|
29608
|
-
/* @__PURE__ */ jsxs83("section", { className:
|
|
29717
|
+
/* @__PURE__ */ jsxs83("section", { className: cn45("@container flex flex-col gap-3", className), children: [
|
|
29609
29718
|
/* @__PURE__ */ jsxs83("header", { className: "flex items-center gap-2", children: [
|
|
29610
29719
|
/* @__PURE__ */ jsx95("h3", { className: "text-sm font-medium", children: existing ? "Booking page" : "New booking page" }),
|
|
29611
29720
|
/* @__PURE__ */ jsx95("div", { className: "flex-1" }),
|
|
@@ -29821,7 +29930,7 @@ function asksWhoTheyAre(askable) {
|
|
|
29821
29930
|
}
|
|
29822
29931
|
|
|
29823
29932
|
// src/BuildOrAsk.tsx
|
|
29824
|
-
import { Button as Button55, cn as
|
|
29933
|
+
import { Button as Button55, cn as cn46 } from "@ai-matrx/design-system";
|
|
29825
29934
|
import { jsx as jsx96, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
29826
29935
|
var NO_AGENT_PORT = "Asking for one in words needs an agent, which this screen reaches through its host's `onAskForOne` port \u2014 it is not bound here, so build it below instead.";
|
|
29827
29936
|
function BuildOrAsk({
|
|
@@ -29839,7 +29948,7 @@ function BuildOrAsk({
|
|
|
29839
29948
|
className
|
|
29840
29949
|
}) {
|
|
29841
29950
|
const mayAsk = mayBuild && Boolean(onAsk);
|
|
29842
|
-
return /* @__PURE__ */ jsxs84("div", { className:
|
|
29951
|
+
return /* @__PURE__ */ jsxs84("div", { className: cn46("rounded-md border border-dashed p-3", className), children: [
|
|
29843
29952
|
/* @__PURE__ */ jsx96("p", { className: "text-xs text-muted-foreground", children }),
|
|
29844
29953
|
mayBuild && editor ? /* @__PURE__ */ jsx96("div", { className: "mt-2.5", children: editor }) : null,
|
|
29845
29954
|
mayBuild ? /* @__PURE__ */ jsxs84("div", { className: "mt-2.5 flex flex-wrap items-center gap-2", children: [
|
|
@@ -30089,10 +30198,10 @@ function BookingSlots({ tableId, activeBookingId, className }) {
|
|
|
30089
30198
|
setShown(url);
|
|
30090
30199
|
}
|
|
30091
30200
|
}, []);
|
|
30092
|
-
if (pages === null) return /* @__PURE__ */ jsx98(Skeleton9, { className:
|
|
30201
|
+
if (pages === null) return /* @__PURE__ */ jsx98(Skeleton9, { className: cn47("h-32 w-full", className) });
|
|
30093
30202
|
if (pages.length === 0 && !tableId && !error && !building) return null;
|
|
30094
30203
|
const origin = host.publicOrigin ?? (typeof window === "undefined" ? "" : window.location.origin);
|
|
30095
|
-
return /* @__PURE__ */ jsxs86("section", { className:
|
|
30204
|
+
return /* @__PURE__ */ jsxs86("section", { className: cn47("flex flex-col gap-3", className), "data-testid": "booking-slots", children: [
|
|
30096
30205
|
/* @__PURE__ */ jsxs86("header", { className: "flex items-center gap-2", children: [
|
|
30097
30206
|
/* @__PURE__ */ jsx98("h3", { className: "text-sm font-medium", children: "Bookings" }),
|
|
30098
30207
|
/* @__PURE__ */ jsx98("span", { className: "text-xs text-muted-foreground", children: pages.length === 0 ? "none yet" : `${pages.length}` }),
|
|
@@ -30154,7 +30263,7 @@ function BookingSlots({ tableId, activeBookingId, className }) {
|
|
|
30154
30263
|
"data-testid": "booking-page",
|
|
30155
30264
|
"data-linked": page.form_id === activeBookingId ? "true" : void 0,
|
|
30156
30265
|
ref: page.form_id === activeBookingId ? (el) => el?.scrollIntoView({ block: "nearest" }) : void 0,
|
|
30157
|
-
className:
|
|
30266
|
+
className: cn47(
|
|
30158
30267
|
"rounded-md border p-2.5",
|
|
30159
30268
|
page.form_id === activeBookingId && "border-primary ring-1 ring-primary"
|
|
30160
30269
|
),
|
|
@@ -30591,8 +30700,8 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
|
|
|
30591
30700
|
cancelled = true;
|
|
30592
30701
|
};
|
|
30593
30702
|
}, [client, makingOnly]);
|
|
30594
|
-
return /* @__PURE__ */ jsxs88("div", { className:
|
|
30595
|
-
creating ? /* @__PURE__ */ jsx100("div", { className:
|
|
30703
|
+
return /* @__PURE__ */ jsxs88("div", { className: cn48("flex min-h-0 flex-col gap-4", className), children: [
|
|
30704
|
+
creating ? /* @__PURE__ */ jsx100("div", { className: cn48("min-h-0", hostButtons ? "flex-1" : "h-[36rem] max-w-2xl rounded-lg border"), children: /* @__PURE__ */ jsx100(
|
|
30596
30705
|
NewTableStart,
|
|
30597
30706
|
{
|
|
30598
30707
|
templatesHref,
|
|
@@ -30627,7 +30736,7 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
|
|
|
30627
30736
|
type: "button",
|
|
30628
30737
|
disabled: !board.table_id,
|
|
30629
30738
|
onClick: () => board.table_id ? onOpenTable?.(board.table_id, board.dashboard_id) : void 0,
|
|
30630
|
-
className:
|
|
30739
|
+
className: cn48(
|
|
30631
30740
|
"w-full rounded-md border px-3 py-2 text-left transition-colors",
|
|
30632
30741
|
onOpenTable && board.table_id ? "hover:bg-accent" : "cursor-default"
|
|
30633
30742
|
),
|
|
@@ -30667,7 +30776,7 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
|
|
|
30667
30776
|
{
|
|
30668
30777
|
type: "button",
|
|
30669
30778
|
onClick: () => onOpenTable?.(table.id),
|
|
30670
|
-
className:
|
|
30779
|
+
className: cn48(
|
|
30671
30780
|
"w-full rounded-md px-3 py-2 text-left transition-colors",
|
|
30672
30781
|
onOpenTable ? "hover:bg-accent" : "cursor-default"
|
|
30673
30782
|
),
|
|
@@ -30801,7 +30910,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
30801
30910
|
[sourceName, headers, rows, sourceText]
|
|
30802
30911
|
);
|
|
30803
30912
|
if (!shape) {
|
|
30804
|
-
return /* @__PURE__ */ jsx101("div", { className:
|
|
30913
|
+
return /* @__PURE__ */ jsx101("div", { className: cn49("flex flex-col gap-2 text-sm", className), "data-save-to-table": "", children: /* @__PURE__ */ jsx101("p", { className: "text-muted-foreground", children: "Nothing here reads as rows \u2014 a table, a list, lines of \u201CName: value\u201D, CSV or pasted spreadsheet cells can be saved as a table." }) });
|
|
30805
30914
|
}
|
|
30806
30915
|
const chooseShape = (i) => {
|
|
30807
30916
|
setWhich(i);
|
|
@@ -30921,7 +31030,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
30921
31030
|
};
|
|
30922
31031
|
makeRef.current = make;
|
|
30923
31032
|
const busy = phase === "making" || phase === "writing";
|
|
30924
|
-
return /* @__PURE__ */ jsxs89("div", { className:
|
|
31033
|
+
return /* @__PURE__ */ jsxs89("div", { className: cn49("flex min-w-0 flex-col gap-3 text-sm", className), "data-save-to-table": "", children: [
|
|
30925
31034
|
/* @__PURE__ */ jsxs89("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
30926
31035
|
shapes.length > 1 ? /* @__PURE__ */ jsxs89(Select12, { value: String(which), onValueChange: (v) => chooseShape(Number(v)), disabled: busy || phase === "done", children: [
|
|
30927
31036
|
/* @__PURE__ */ jsx101(SelectTrigger11, { size: "sm", "aria-label": "Which of these to save", className: "min-w-[16rem]", children: /* @__PURE__ */ jsx101(SelectValue11, {}) }),
|
|
@@ -31168,7 +31277,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
31168
31277
|
// src/StageRules.tsx
|
|
31169
31278
|
import { useCallback as useCallback34, useEffect as useEffect64, useMemo as useMemo46, useState as useState81 } from "react";
|
|
31170
31279
|
import { useFields as useFields16, useRecordsClient as useRecordsClient54, useTable as useTable14 } from "@ai-matrx/records/react";
|
|
31171
|
-
import { BasicInput as BasicInput18, BasicTextarea as BasicTextarea8, Button as Button61, Separator as Separator7, Skeleton as Skeleton11, cn as
|
|
31280
|
+
import { BasicInput as BasicInput18, BasicTextarea as BasicTextarea8, Button as Button61, Separator as Separator7, Skeleton as Skeleton11, cn as cn50 } from "@ai-matrx/design-system";
|
|
31172
31281
|
import { Select as Select13 } from "@ai-matrx/design-system/controls";
|
|
31173
31282
|
import { jsx as jsx102, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
31174
31283
|
var NO_RULES_YET = "Nothing has to be true to get here yet.";
|
|
@@ -31290,13 +31399,13 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
31290
31399
|
if (!asked3) return /* @__PURE__ */ jsx102(Skeleton11, { className: "h-24 w-full" });
|
|
31291
31400
|
if (error && !pipeline) return /* @__PURE__ */ jsx102(RefusalNotice, { error });
|
|
31292
31401
|
if (!pipeline?.is_pipeline) {
|
|
31293
|
-
return /* @__PURE__ */ jsxs90("div", { className:
|
|
31402
|
+
return /* @__PURE__ */ jsxs90("div", { className: cn50("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
31294
31403
|
/* @__PURE__ */ jsx102("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx102("span", { className: "font-medium", children: "Rules for entering a stage" }) }),
|
|
31295
31404
|
/* @__PURE__ */ jsx102("p", { className: "text-muted-foreground", children: NO_STAGE_COLUMN })
|
|
31296
31405
|
] });
|
|
31297
31406
|
}
|
|
31298
31407
|
const canEdit = rights.structure;
|
|
31299
|
-
return /* @__PURE__ */ jsxs90("div", { className:
|
|
31408
|
+
return /* @__PURE__ */ jsxs90("div", { className: cn50("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
31300
31409
|
/* @__PURE__ */ jsxs90("div", { className: "flex items-center gap-2", children: [
|
|
31301
31410
|
/* @__PURE__ */ jsx102("span", { className: "font-medium", children: "Rules for entering" }),
|
|
31302
31411
|
/* @__PURE__ */ jsx102(
|
|
@@ -31683,7 +31792,7 @@ import {
|
|
|
31683
31792
|
useTableArchive,
|
|
31684
31793
|
tableShapeChanged as tableShapeChanged11
|
|
31685
31794
|
} from "@ai-matrx/records/react";
|
|
31686
|
-
import { Badge as Badge14, Button as Button67, Separator as Separator8, cn as
|
|
31795
|
+
import { Badge as Badge14, Button as Button67, Separator as Separator8, cn as cn53 } from "@ai-matrx/design-system";
|
|
31687
31796
|
|
|
31688
31797
|
// src/announceTableArchived.ts
|
|
31689
31798
|
var TableRestoreRefused = class extends Error {
|
|
@@ -31773,7 +31882,7 @@ function TableFoundationSwitch({ tableId, table }) {
|
|
|
31773
31882
|
// src/TableAccessLevel.tsx
|
|
31774
31883
|
import { useCallback as useCallback36, useEffect as useEffect67, useMemo as useMemo47, useState as useState85 } from "react";
|
|
31775
31884
|
import { tableShapeChanged as tableShapeChanged10, useRecordsClient as useRecordsClient58 } from "@ai-matrx/records/react";
|
|
31776
|
-
import { Badge as Badge12, Button as Button64, Textarea as Textarea5, cn as
|
|
31885
|
+
import { Badge as Badge12, Button as Button64, Textarea as Textarea5, cn as cn51 } from "@ai-matrx/design-system";
|
|
31777
31886
|
import { Fragment as Fragment37, jsx as jsx106, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
31778
31887
|
var PERSON_KERNEL_TABLE = "11111111-0000-4000-8000-000000000005";
|
|
31779
31888
|
var LEVEL_WORDS = { organization: "Organization", confidential: "Confidential" };
|
|
@@ -31859,7 +31968,7 @@ function TableAccessLevel({ tableId, fields }) {
|
|
|
31859
31968
|
variant: on ? "secondary" : "outline",
|
|
31860
31969
|
"aria-pressed": on,
|
|
31861
31970
|
disabled: busy,
|
|
31862
|
-
className:
|
|
31971
|
+
className: cn51(on && "ring-1 ring-primary"),
|
|
31863
31972
|
onClick: () => setPicked(on ? picked.filter((k) => k !== f.key) : [...picked, f.key]),
|
|
31864
31973
|
children: fieldName(f)
|
|
31865
31974
|
},
|
|
@@ -32073,7 +32182,7 @@ function RowShownTo({ recordId, tableId }) {
|
|
|
32073
32182
|
// src/ColumnsAtOnce.tsx
|
|
32074
32183
|
import { useEffect as useEffect69, useMemo as useMemo48, useState as useState87 } from "react";
|
|
32075
32184
|
import { useFieldMutation as useFieldMutation3 } from "@ai-matrx/records/react";
|
|
32076
|
-
import { Badge as Badge13, BasicInput as BasicInput19, Button as Button66, Checkbox as Checkbox12, cn as
|
|
32185
|
+
import { Badge as Badge13, BasicInput as BasicInput19, Button as Button66, Checkbox as Checkbox12, cn as cn52 } from "@ai-matrx/design-system";
|
|
32077
32186
|
import { jsx as jsx108, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
32078
32187
|
function columnsBatch(saved, draft) {
|
|
32079
32188
|
const byId = new Map(saved.map((f) => [f.id, f]));
|
|
@@ -32159,7 +32268,7 @@ function ColumnsAtOnce({
|
|
|
32159
32268
|
setDragging(index);
|
|
32160
32269
|
},
|
|
32161
32270
|
onDragEnd: () => setDragging(null),
|
|
32162
|
-
className:
|
|
32271
|
+
className: cn52("flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1.5", dragging === index && "bg-muted"),
|
|
32163
32272
|
children: [
|
|
32164
32273
|
/* @__PURE__ */ jsx108("span", { "aria-hidden": true, className: "cursor-grab select-none text-muted-foreground", children: "\u22EE\u22EE" }),
|
|
32165
32274
|
/* @__PURE__ */ jsx108(
|
|
@@ -32311,7 +32420,7 @@ function TableSettingsPanel({
|
|
|
32311
32420
|
if (fields.error) return /* @__PURE__ */ jsx109(RefusalNotice, { error: fields.error, className });
|
|
32312
32421
|
if (!rights.structure) {
|
|
32313
32422
|
if (tableIsLocked(table.data)) {
|
|
32314
|
-
return /* @__PURE__ */ jsxs97("div", { className:
|
|
32423
|
+
return /* @__PURE__ */ jsxs97("div", { className: cn53("flex flex-col items-start gap-2 text-xs text-muted-foreground", className), "data-table-locked": "", children: [
|
|
32315
32424
|
/* @__PURE__ */ jsx109("p", { children: DATABASE_LOCKED_REASON }),
|
|
32316
32425
|
/* @__PURE__ */ jsx109(
|
|
32317
32426
|
Button67,
|
|
@@ -32330,7 +32439,7 @@ function TableSettingsPanel({
|
|
|
32330
32439
|
)
|
|
32331
32440
|
] });
|
|
32332
32441
|
}
|
|
32333
|
-
return /* @__PURE__ */ jsx109("p", { className:
|
|
32442
|
+
return /* @__PURE__ */ jsx109("p", { className: cn53("text-xs text-muted-foreground", className), children: rights.why("structure") });
|
|
32334
32443
|
}
|
|
32335
32444
|
const rows = [...fields.data ?? []].sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0));
|
|
32336
32445
|
const remove = async (field2) => {
|
|
@@ -32401,7 +32510,7 @@ function TableSettingsPanel({
|
|
|
32401
32510
|
}
|
|
32402
32511
|
);
|
|
32403
32512
|
}
|
|
32404
|
-
return /* @__PURE__ */ jsxs97("div", { className:
|
|
32513
|
+
return /* @__PURE__ */ jsxs97("div", { className: cn53("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
32405
32514
|
deliberate && table.data ? /* @__PURE__ */ jsx109(
|
|
32406
32515
|
ArchiveDeliberatelyDialog,
|
|
32407
32516
|
{
|
|
@@ -32513,7 +32622,7 @@ import { AlchemyMenu as AlchemyMenu2 } from "@ai-matrx/alchemy/react";
|
|
|
32513
32622
|
// src/RecordChat.tsx
|
|
32514
32623
|
import { useEffect as useEffect71, useMemo as useMemo50, useState as useState89 } from "react";
|
|
32515
32624
|
import { useRecordsClient as useRecordsClient61 } from "@ai-matrx/records/react";
|
|
32516
|
-
import { Skeleton as Skeleton12, cn as
|
|
32625
|
+
import { Skeleton as Skeleton12, cn as cn54 } from "@ai-matrx/design-system";
|
|
32517
32626
|
import { jsx as jsx110, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
32518
32627
|
var NO_CHAT_REASON = "Chatting about this record is not switched on here yet, so this panel is empty rather than showing a box that goes nowhere. It is on our list, not yours.";
|
|
32519
32628
|
function RecordChat({ tableId, recordId, className }) {
|
|
@@ -32560,9 +32669,9 @@ function RecordChat({ tableId, recordId, className }) {
|
|
|
32560
32669
|
};
|
|
32561
32670
|
}, [scope, recordId, tableId]);
|
|
32562
32671
|
if (error) return /* @__PURE__ */ jsx110(RefusalNotice, { error, className });
|
|
32563
|
-
if (!context) return /* @__PURE__ */ jsx110(Skeleton12, { className:
|
|
32672
|
+
if (!context) return /* @__PURE__ */ jsx110(Skeleton12, { className: cn54("h-64 w-full", className) });
|
|
32564
32673
|
if (!host.chat) {
|
|
32565
|
-
return /* @__PURE__ */ jsxs98("section", { className:
|
|
32674
|
+
return /* @__PURE__ */ jsxs98("section", { className: cn54("flex min-h-0 flex-col gap-2", className), children: [
|
|
32566
32675
|
/* @__PURE__ */ jsxs98("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
32567
32676
|
/* @__PURE__ */ jsx110("span", { className: "font-medium text-foreground", children: context.title }),
|
|
32568
32677
|
/* @__PURE__ */ jsxs98("span", { children: [
|
|
@@ -32574,7 +32683,7 @@ function RecordChat({ tableId, recordId, className }) {
|
|
|
32574
32683
|
/* @__PURE__ */ jsx110(Withheld, { withheld: context.withheld })
|
|
32575
32684
|
] });
|
|
32576
32685
|
}
|
|
32577
|
-
return /* @__PURE__ */ jsxs98("section", { className:
|
|
32686
|
+
return /* @__PURE__ */ jsxs98("section", { className: cn54("flex min-h-0 flex-col gap-2", className), children: [
|
|
32578
32687
|
/* @__PURE__ */ jsxs98("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
32579
32688
|
/* @__PURE__ */ jsx110("span", { className: "font-medium text-foreground", children: context.title }),
|
|
32580
32689
|
/* @__PURE__ */ jsxs98("span", { children: [
|
|
@@ -32635,7 +32744,7 @@ function entriesFor(scope) {
|
|
|
32635
32744
|
}
|
|
32636
32745
|
|
|
32637
32746
|
// src/Peek.tsx
|
|
32638
|
-
import { Button as Button71, Separator as Separator9, Skeleton as Skeleton14, cn as
|
|
32747
|
+
import { Button as Button71, Separator as Separator9, Skeleton as Skeleton14, cn as cn56 } from "@ai-matrx/design-system";
|
|
32639
32748
|
|
|
32640
32749
|
// src/recordInPlace.tsx
|
|
32641
32750
|
import { useMemo as useMemo51, useRef as useRef43 } from "react";
|
|
@@ -32922,7 +33031,7 @@ function ShareForSomebodyElse({
|
|
|
32922
33031
|
|
|
32923
33032
|
// src/RecordBody.tsx
|
|
32924
33033
|
import { useEffect as useEffect73, useRef as useRef44, useState as useState92 } from "react";
|
|
32925
|
-
import { Button as Button70, cn as
|
|
33034
|
+
import { Button as Button70, cn as cn55 } from "@ai-matrx/design-system";
|
|
32926
33035
|
import { newerKindOf as newerKindOf6 } from "@ai-matrx/records";
|
|
32927
33036
|
import { tableShapeChanged as tableShapeChanged12, useFieldMutation as useFieldMutation5, useFields as useFields18, useRecord as useRecord2, useRecordsClient as useRecordsClient64, useTable as useTable18 } from "@ai-matrx/records/react";
|
|
32928
33037
|
import { Fragment as Fragment41, jsx as jsx114, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
@@ -32940,7 +33049,7 @@ function RecordBody({ tableId, recordId, className }) {
|
|
|
32940
33049
|
const fallback = /* @__PURE__ */ jsx114(DefaultRecordBody, { tableId, recordId, className });
|
|
32941
33050
|
const hostBody = host.renderRecordBody && hostRecord.data ? host.renderRecordBody({ tableId, recordId, record: hostRecord.data, readOnly: !hostMay.write, fallback }) : null;
|
|
32942
33051
|
if (hostBody !== null && hostBody !== void 0) {
|
|
32943
|
-
return /* @__PURE__ */ jsx114("section", { className:
|
|
33052
|
+
return /* @__PURE__ */ jsx114("section", { className: cn55("flex min-w-0 flex-col gap-1.5", className), "data-record-body": "host", children: hostBody });
|
|
32944
33053
|
}
|
|
32945
33054
|
return fallback;
|
|
32946
33055
|
}
|
|
@@ -32948,7 +33057,7 @@ function DefaultRecordBody({ tableId, recordId, className }) {
|
|
|
32948
33057
|
const fields = useFields18(tableId);
|
|
32949
33058
|
const field2 = bodyFieldOf(fields.data ?? []);
|
|
32950
33059
|
if (fields.loading && !fields.data) return null;
|
|
32951
|
-
return /* @__PURE__ */ jsx114("section", { className:
|
|
33060
|
+
return /* @__PURE__ */ jsx114("section", { className: cn55("flex min-w-0 flex-col gap-1.5", className), "data-record-body": field2?.key ?? "", children: field2 ? /* @__PURE__ */ jsx114(BodyEditor, { tableId, recordId, field: field2 }, `${recordId}:${field2.key}`) : /* @__PURE__ */ jsx114(AddBody, { tableId }) });
|
|
32952
33061
|
}
|
|
32953
33062
|
function BodyEditor({ tableId, recordId, field: field2 }) {
|
|
32954
33063
|
const host = useRecordsUi();
|
|
@@ -33055,7 +33164,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
33055
33164
|
if (document2 && isLockedStub({ document: document2, level: null })) {
|
|
33056
33165
|
const filed = document2["submitted_at"];
|
|
33057
33166
|
const when = typeof filed === "string" && !Number.isNaN(Date.parse(filed)) ? new Date(filed).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" }) : null;
|
|
33058
|
-
return /* @__PURE__ */ jsxs103("p", { className:
|
|
33167
|
+
return /* @__PURE__ */ jsxs103("p", { className: cn56("text-sm text-muted-foreground", className), "data-records-locked-record": "", children: [
|
|
33059
33168
|
"You can't open this record",
|
|
33060
33169
|
when ? `. Filed ${when}.` : "."
|
|
33061
33170
|
] });
|
|
@@ -33066,8 +33175,8 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
33066
33175
|
const shownFields = (fields.data ?? []).filter((field2) => !onPage || !drawnBelowOnPage(field2, bodyKey));
|
|
33067
33176
|
const askOpenBelow = onPage && !host.talkToRecord && Boolean(host.chat);
|
|
33068
33177
|
const href = host.hrefForRecord && table.data ? host.hrefForRecord({ table: table.data, recordId }) : void 0;
|
|
33069
|
-
return /* @__PURE__ */ jsxs103("div", { className:
|
|
33070
|
-
/* @__PURE__ */ jsx115("h3", { className:
|
|
33178
|
+
return /* @__PURE__ */ jsxs103("div", { className: cn56("flex min-w-0 flex-col gap-2 text-xs", className), children: [
|
|
33179
|
+
/* @__PURE__ */ jsx115("h3", { className: cn56("break-words font-medium leading-snug", onPage ? "text-2xl font-semibold" : "text-sm"), "data-records-peek-title": "", title, children: record.loading && !document2 ? /* @__PURE__ */ jsx115(Skeleton14, { className: "h-4 w-40" }) : title }),
|
|
33071
33180
|
/* @__PURE__ */ jsxs103("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
33072
33181
|
/* @__PURE__ */ jsx115(
|
|
33073
33182
|
AlchemyMenu2,
|
|
@@ -33125,14 +33234,14 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
33125
33234
|
canWrite: may.write,
|
|
33126
33235
|
whyNot: may.why("write") ?? void 0,
|
|
33127
33236
|
reload: () => record.reload(),
|
|
33128
|
-
className:
|
|
33237
|
+
className: cn56("grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-0.5", onPage && "text-sm"),
|
|
33129
33238
|
renderLabel: (field2) => /* @__PURE__ */ jsxs103(Fragment42, { children: [
|
|
33130
33239
|
fieldName(field2),
|
|
33131
33240
|
/* @__PURE__ */ jsx115(ProvenanceBadge, { document: document2, fieldKey: field2.key }),
|
|
33132
33241
|
/* @__PURE__ */ jsx115(ValueAlternates, { recordId, field: field2, document: document2, canWrite: may.write, onChosen: () => record.reload() })
|
|
33133
33242
|
] })
|
|
33134
33243
|
}
|
|
33135
|
-
) : /* @__PURE__ */ jsxs103("dl", { className:
|
|
33244
|
+
) : /* @__PURE__ */ jsxs103("dl", { className: cn56("grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-1.5", onPage && "text-sm"), children: [
|
|
33136
33245
|
fields.loading && !fields.data ? Array.from({ length: peekRowsWhileReading }, (_, i) => /* @__PURE__ */ jsxs103("div", { className: "contents", "data-records-skeleton-part": "field", children: [
|
|
33137
33246
|
/* @__PURE__ */ jsx115("dt", { className: "py-0.5", children: /* @__PURE__ */ jsx115(Skeleton14, { shape: "line", width: "2/3" }) }),
|
|
33138
33247
|
/* @__PURE__ */ jsx115("dd", { className: "py-0.5", children: /* @__PURE__ */ jsx115(Skeleton14, { shape: "line", width: i % 2 ? "1/2" : "3/4" }) })
|
|
@@ -33368,7 +33477,7 @@ function lookAfterReset(look) {
|
|
|
33368
33477
|
import { useEffect as useEffect87, useMemo as useMemo62, useState as useState106 } from "react";
|
|
33369
33478
|
import { mayDrag as mayDrag4, useFields as useFields21, useRecordPage as useRecordPage2, useRecordsClient as useRecordsClient71, useTable as useTable21 } from "@ai-matrx/records/react";
|
|
33370
33479
|
import { isButtonField as isButtonField5, newerKindOf as newerKindOf7, stableFilterKey as stableFilterKey4 } from "@ai-matrx/records";
|
|
33371
|
-
import { Button as Button77, Select as Select19, SelectContent as SelectContent17, SelectItem as SelectItem17, SelectTrigger as SelectTrigger17, SelectValue as SelectValue17, cn as
|
|
33480
|
+
import { Button as Button77, Select as Select19, SelectContent as SelectContent17, SelectItem as SelectItem17, SelectTrigger as SelectTrigger17, SelectValue as SelectValue17, cn as cn63 } from "@ai-matrx/design-system";
|
|
33372
33481
|
import {
|
|
33373
33482
|
CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS5,
|
|
33374
33483
|
EMPTY_TABLE_STYLE as EMPTY_TABLE_STYLE2,
|
|
@@ -33587,7 +33696,7 @@ import {
|
|
|
33587
33696
|
DropdownMenuItem as DropdownMenuItem6,
|
|
33588
33697
|
DropdownMenuTrigger as DropdownMenuTrigger7,
|
|
33589
33698
|
Skeleton as Skeleton15,
|
|
33590
|
-
cn as
|
|
33699
|
+
cn as cn57
|
|
33591
33700
|
} from "@ai-matrx/design-system";
|
|
33592
33701
|
import {
|
|
33593
33702
|
resolveRowColor,
|
|
@@ -33884,7 +33993,7 @@ function PipelineBoard({
|
|
|
33884
33993
|
return /* @__PURE__ */ jsxs106(
|
|
33885
33994
|
"div",
|
|
33886
33995
|
{
|
|
33887
|
-
className:
|
|
33996
|
+
className: cn57("flex min-h-0 flex-col gap-2", className),
|
|
33888
33997
|
onKeyDown: (e) => {
|
|
33889
33998
|
if (e.key === "Escape" && selected.size > 0) {
|
|
33890
33999
|
e.preventDefault();
|
|
@@ -33960,7 +34069,7 @@ function PipelineBoard({
|
|
|
33960
34069
|
const id = e.dataTransfer.getData("text/plain");
|
|
33961
34070
|
if (id) void drop(id, stage.key);
|
|
33962
34071
|
},
|
|
33963
|
-
className:
|
|
34072
|
+
className: cn57(
|
|
33964
34073
|
"flex w-64 shrink-0 flex-col rounded border bg-muted/30",
|
|
33965
34074
|
over === stage.key ? "ring-2 ring-primary" : "",
|
|
33966
34075
|
n?.over_limit ? "border-destructive" : ""
|
|
@@ -34218,7 +34327,7 @@ function PipelineCard({
|
|
|
34218
34327
|
"data-card-index": index,
|
|
34219
34328
|
"data-selected": selected ? "true" : void 0,
|
|
34220
34329
|
"aria-pressed": draggable ? selected : void 0,
|
|
34221
|
-
className:
|
|
34330
|
+
className: cn57(
|
|
34222
34331
|
"w-full truncate rounded border bg-background py-1 pl-2 pr-7 text-left text-xs hover:bg-muted",
|
|
34223
34332
|
draggable ? "cursor-grab active:cursor-grabbing" : "",
|
|
34224
34333
|
dragging ? "opacity-50" : "",
|
|
@@ -34380,7 +34489,7 @@ function CardFieldsInline({ row, fields }) {
|
|
|
34380
34489
|
// src/CalendarView.tsx
|
|
34381
34490
|
import { useEffect as useEffect79, useMemo as useMemo56, useRef as useRef47, useState as useState98 } from "react";
|
|
34382
34491
|
import { mayDrag as mayDrag2 } from "@ai-matrx/records/react";
|
|
34383
|
-
import { Button as Button74, Select as Select15, SelectContent as SelectContent13, SelectItem as SelectItem13, SelectTrigger as SelectTrigger13, SelectValue as SelectValue13, cn as
|
|
34492
|
+
import { Button as Button74, Select as Select15, SelectContent as SelectContent13, SelectItem as SelectItem13, SelectTrigger as SelectTrigger13, SelectValue as SelectValue13, cn as cn58 } from "@ai-matrx/design-system";
|
|
34384
34493
|
import { CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS3 } from "@ai-matrx/design-system/data-table";
|
|
34385
34494
|
|
|
34386
34495
|
// src/weekStart.ts
|
|
@@ -34972,7 +35081,7 @@ function CalendarView({
|
|
|
34972
35081
|
"button",
|
|
34973
35082
|
{
|
|
34974
35083
|
type: "button",
|
|
34975
|
-
className:
|
|
35084
|
+
className: cn58(
|
|
34976
35085
|
"flex w-full min-w-0 items-center gap-1 truncate rounded border px-1.5 py-0.5 text-left text-xs hover:brightness-95",
|
|
34977
35086
|
// The chip palette, not the faint row tint: a calendar is read by its colours at a glance.
|
|
34978
35087
|
color ? CHOICE_CHIP_CLASS3[color] : "bg-background",
|
|
@@ -35097,12 +35206,12 @@ function CalendarView({
|
|
|
35097
35206
|
})
|
|
35098
35207
|
);
|
|
35099
35208
|
const columns = `3.5rem repeat(${days.length}, minmax(0, 1fr))`;
|
|
35100
|
-
body = /* @__PURE__ */ jsx120("div", { className: "min-w-0 flex-1 overflow-x-auto", children: /* @__PURE__ */ jsxs108("div", { className:
|
|
35209
|
+
body = /* @__PURE__ */ jsx120("div", { className: "min-w-0 flex-1 overflow-x-auto", children: /* @__PURE__ */ jsxs108("div", { className: cn58("border-l border-t", days.length > 1 ? "min-w-[640px]" : ""), "data-calendar-week": "", "data-calendar-days": days.length, children: [
|
|
35101
35210
|
/* @__PURE__ */ jsxs108("div", { className: "grid", style: { gridTemplateColumns: columns }, children: [
|
|
35102
35211
|
/* @__PURE__ */ jsx120("div", { className: "border-b border-r" }),
|
|
35103
|
-
days.map((d) => /* @__PURE__ */ jsx120("div", { className:
|
|
35212
|
+
days.map((d) => /* @__PURE__ */ jsx120("div", { className: cn58("border-b border-r px-1 py-0.5 text-center text-xs", d === today ? "font-semibold text-primary" : "text-muted-foreground"), children: dayDate(d).toLocaleDateString(void 0, { weekday: "short", day: "numeric" }) }, `h${d}`)),
|
|
35104
35213
|
/* @__PURE__ */ jsx120("div", { className: "border-b border-r px-1 py-0.5 text-[10px] text-muted-foreground", children: "All day" }),
|
|
35105
|
-
days.map((d) => /* @__PURE__ */ jsx120("div", { "data-calendar-day": d, className:
|
|
35214
|
+
days.map((d) => /* @__PURE__ */ jsx120("div", { "data-calendar-day": d, className: cn58("min-h-8 border-b border-r p-0.5", ghost?.day === d && ghost.minute === null ? "bg-primary/10" : void 0), ...dayDrop(d), children: /* @__PURE__ */ jsx120("ul", { className: "flex flex-col gap-0.5", children: allDay(d).map((p) => listCard(p, `${p.row.id}:${d}`)) }) }, `a${d}`))
|
|
35106
35215
|
] }),
|
|
35107
35216
|
/* @__PURE__ */ jsx120(
|
|
35108
35217
|
WeekHours,
|
|
@@ -35148,7 +35257,7 @@ function CalendarView({
|
|
|
35148
35257
|
p.row,
|
|
35149
35258
|
tight ? null : /* @__PURE__ */ jsx120("span", { className: "shrink-0 tabular-nums text-[10px] opacity-75", "data-calendar-time": "", children: timeLabel(start) }),
|
|
35150
35259
|
// Taller blocks sharing the width stack the time over the name.
|
|
35151
|
-
|
|
35260
|
+
cn58("h-full items-start", !tight && end - start >= 45 && cols > 1 ? "flex-col gap-0" : void 0)
|
|
35152
35261
|
),
|
|
35153
35262
|
endField && !endWorkedOut && canMove(p.row) ? /* @__PURE__ */ jsx120(
|
|
35154
35263
|
"div",
|
|
@@ -35177,7 +35286,7 @@ function CalendarView({
|
|
|
35177
35286
|
for (const p of placed) for (let d = p.firstDay; d <= p.lastDay; d = addDays2(d, 1)) byDay.set(d, [...byDay.get(d) ?? [], p]);
|
|
35178
35287
|
const listed = [...byDay.entries()].sort((a, b) => a[0].localeCompare(b[0])).map(([d, cards]) => [d, [...cards].sort(byTime)]);
|
|
35179
35288
|
body = /* @__PURE__ */ jsx120("ol", { className: "flex min-h-0 min-w-0 flex-1 flex-col divide-y overflow-y-auto rounded border", "data-calendar-list": "", children: listed.map(([d, cards]) => /* @__PURE__ */ jsxs108("li", { className: "flex gap-3 p-2", "data-calendar-day": d, ...dayDrop(d), children: [
|
|
35180
|
-
/* @__PURE__ */ jsx120("span", { className:
|
|
35289
|
+
/* @__PURE__ */ jsx120("span", { className: cn58("w-24 shrink-0 text-xs font-medium tabular-nums", d === today ? "text-primary" : ""), children: calendarDayLabel(d) }),
|
|
35181
35290
|
/* @__PURE__ */ jsx120("ul", { className: "flex min-w-0 flex-1 flex-col gap-1", children: cards.map((p) => listCard(p, `${p.row.id}:${d}`)) })
|
|
35182
35291
|
] }, d)) });
|
|
35183
35292
|
}
|
|
@@ -35185,7 +35294,7 @@ function CalendarView({
|
|
|
35185
35294
|
"div",
|
|
35186
35295
|
{
|
|
35187
35296
|
ref: frame,
|
|
35188
|
-
className:
|
|
35297
|
+
className: cn58("relative flex min-h-0 flex-col gap-2", className),
|
|
35189
35298
|
"data-calendar-mode": mode,
|
|
35190
35299
|
onKeyDown: moves.onKeyDown,
|
|
35191
35300
|
onDragLeave: (e) => {
|
|
@@ -35249,7 +35358,7 @@ function MonthWeek({
|
|
|
35249
35358
|
role: "gridcell",
|
|
35250
35359
|
"aria-label": calendarDayLabel(d),
|
|
35251
35360
|
"data-calendar-day": d,
|
|
35252
|
-
className:
|
|
35361
|
+
className: cn58(
|
|
35253
35362
|
"group relative flex min-h-24 flex-col gap-0.5 border-b border-r p-0.5",
|
|
35254
35363
|
inMonth ? "" : "bg-muted/40",
|
|
35255
35364
|
ghostDay === d ? "bg-primary/10 ring-2 ring-inset ring-primary" : "",
|
|
@@ -35273,7 +35382,7 @@ function MonthWeek({
|
|
|
35273
35382
|
/* @__PURE__ */ jsx120(
|
|
35274
35383
|
"span",
|
|
35275
35384
|
{
|
|
35276
|
-
className:
|
|
35385
|
+
className: cn58(
|
|
35277
35386
|
"ml-auto rounded-full px-1.5 text-xs tabular-nums",
|
|
35278
35387
|
d === today ? "bg-primary text-primary-foreground" : inMonth ? "" : "text-muted-foreground"
|
|
35279
35388
|
),
|
|
@@ -35357,7 +35466,7 @@ function WeekHours({
|
|
|
35357
35466
|
days.map((d) => /* @__PURE__ */ jsxs108(
|
|
35358
35467
|
"div",
|
|
35359
35468
|
{
|
|
35360
|
-
className:
|
|
35469
|
+
className: cn58("relative border-r", onSlotPointerDown ? "cursor-cell" : void 0),
|
|
35361
35470
|
"data-calendar-column": d,
|
|
35362
35471
|
...timeDrop(d),
|
|
35363
35472
|
...onSlotPointerDown ? { onPointerDown: onSlotPointerDown(d) } : {},
|
|
@@ -35391,7 +35500,7 @@ function weekHeading(first) {
|
|
|
35391
35500
|
// src/TimelineView.tsx
|
|
35392
35501
|
import { useEffect as useEffect80, useMemo as useMemo57, useRef as useRef48, useState as useState99 } from "react";
|
|
35393
35502
|
import { mayDrag as mayDrag3 } from "@ai-matrx/records/react";
|
|
35394
|
-
import { DropdownMenu as DropdownMenu8, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem2, DropdownMenuContent as DropdownMenuContent8, DropdownMenuItem as DropdownMenuItem7, DropdownMenuRadioGroup as DropdownMenuRadioGroup2, DropdownMenuRadioItem as DropdownMenuRadioItem2, DropdownMenuSeparator as DropdownMenuSeparator4, DropdownMenuSub as DropdownMenuSub2, DropdownMenuSubContent as DropdownMenuSubContent2, DropdownMenuSubTrigger as DropdownMenuSubTrigger2, DropdownMenuTrigger as DropdownMenuTrigger8, Button as Button75, Select as Select16, SelectContent as SelectContent14, SelectItem as SelectItem14, SelectTrigger as SelectTrigger14, SelectValue as SelectValue14, cn as
|
|
35503
|
+
import { DropdownMenu as DropdownMenu8, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem2, DropdownMenuContent as DropdownMenuContent8, DropdownMenuItem as DropdownMenuItem7, DropdownMenuRadioGroup as DropdownMenuRadioGroup2, DropdownMenuRadioItem as DropdownMenuRadioItem2, DropdownMenuSeparator as DropdownMenuSeparator4, DropdownMenuSub as DropdownMenuSub2, DropdownMenuSubContent as DropdownMenuSubContent2, DropdownMenuSubTrigger as DropdownMenuSubTrigger2, DropdownMenuTrigger as DropdownMenuTrigger8, Button as Button75, Select as Select16, SelectContent as SelectContent14, SelectItem as SelectItem14, SelectTrigger as SelectTrigger14, SelectValue as SelectValue14, cn as cn59 } from "@ai-matrx/design-system";
|
|
35395
35504
|
import { CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS4 } from "@ai-matrx/design-system/data-table";
|
|
35396
35505
|
import { useOptionalRecordsClient as useOptionalRecordsClient15 } from "@ai-matrx/records/react";
|
|
35397
35506
|
|
|
@@ -36168,7 +36277,7 @@ function TimelineView({
|
|
|
36168
36277
|
"aria-label": `${title}, ${calendarDayLabel(first)}${last !== first ? ` to ${calendarDayLabel(last)}` : ""}`,
|
|
36169
36278
|
...may ? { "aria-keyshortcuts": "Alt+ArrowLeft Alt+ArrowRight Alt+Shift+ArrowLeft Alt+Shift+ArrowRight" } : {},
|
|
36170
36279
|
title: [why ?? (may ? `${title} \xB7 drag to move, or Alt + arrow keys` : title), slip !== null ? slipWords(slip) : "", percent !== null ? `${percent}% done` : ""].filter(Boolean).join(" \xB7 "),
|
|
36171
|
-
className:
|
|
36280
|
+
className: cn59(
|
|
36172
36281
|
"absolute flex select-none items-center gap-1 rounded border px-1.5 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
36173
36282
|
outside ? "overflow-visible" : "overflow-hidden",
|
|
36174
36283
|
milestone ? "border-transparent bg-transparent" : color ? CHOICE_CHIP_CLASS4[color] : "bg-muted",
|
|
@@ -36201,7 +36310,7 @@ function TimelineView({
|
|
|
36201
36310
|
percent !== null && !milestone ? /* @__PURE__ */ jsx121("span", { "aria-hidden": "true", "data-timeline-progress": percent, className: "pointer-events-none absolute inset-y-0 left-0 bg-foreground/20", style: { width: `${percent}%` } }) : null,
|
|
36202
36311
|
inset > 0 ? /* @__PURE__ */ jsx121("span", { "aria-hidden": "true", className: "shrink-0", style: { width: inset } }) : null,
|
|
36203
36312
|
may ? null : /* @__PURE__ */ jsx121(LockIcon2, {}),
|
|
36204
|
-
milestone ? /* @__PURE__ */ jsx121("span", { "aria-hidden": "true", className:
|
|
36313
|
+
milestone ? /* @__PURE__ */ jsx121("span", { "aria-hidden": "true", className: cn59("mx-auto h-3.5 w-3.5 shrink-0 rotate-45 rounded-[2px] border", onCritical ? "bg-amber-500" : "bg-foreground") }) : p.marker ? /* @__PURE__ */ jsx121("span", { "aria-hidden": "true", className: "h-2 w-2 shrink-0 rotate-45 rounded-[1px] bg-current opacity-70" }) : null,
|
|
36205
36314
|
outside ? (
|
|
36206
36315
|
// Too short for its words: they sit just after the bar, the way Airtable labels a short bar.
|
|
36207
36316
|
/* @__PURE__ */ jsxs109("span", { className: "pointer-events-none absolute left-full top-1/2 ml-1.5 -translate-y-1/2 whitespace-nowrap text-foreground", children: [
|
|
@@ -36283,7 +36392,7 @@ function TimelineView({
|
|
|
36283
36392
|
] })
|
|
36284
36393
|
] });
|
|
36285
36394
|
if (!startField) {
|
|
36286
|
-
return /* @__PURE__ */ jsx121("div", { className:
|
|
36395
|
+
return /* @__PURE__ */ jsx121("div", { className: cn59("flex min-w-0 flex-col gap-2", className), "data-timeline-needs": "", children: /* @__PURE__ */ jsxs109("div", { className: "flex flex-col gap-2 rounded border border-dashed p-4 text-xs text-muted-foreground", children: [
|
|
36287
36396
|
/* @__PURE__ */ jsx121("p", { children: dates.length > 0 ? VIEW_NEEDS.timeline?.pick : VIEW_NEEDS.timeline?.missing }),
|
|
36288
36397
|
dates.length > 0 ? /* @__PURE__ */ jsx121("div", { className: "flex flex-wrap gap-2", children: settings }) : null
|
|
36289
36398
|
] }) });
|
|
@@ -36399,7 +36508,7 @@ function TimelineView({
|
|
|
36399
36508
|
"button",
|
|
36400
36509
|
{
|
|
36401
36510
|
type: "button",
|
|
36402
|
-
className:
|
|
36511
|
+
className: cn59(
|
|
36403
36512
|
"flex w-full min-w-0 items-center gap-1 truncate rounded border px-1.5 py-0.5 text-left text-xs hover:brightness-95",
|
|
36404
36513
|
color ? CHOICE_CHIP_CLASS4[color] : "bg-background",
|
|
36405
36514
|
may ? "cursor-grab" : "cursor-default"
|
|
@@ -36423,7 +36532,7 @@ function TimelineView({
|
|
|
36423
36532
|
return [at.first, at.last];
|
|
36424
36533
|
}), Number(today.slice(0, 4)));
|
|
36425
36534
|
const listDayW = listYear ? "w-[3.75rem]" : "w-12";
|
|
36426
|
-
const LABEL_COLUMN =
|
|
36535
|
+
const LABEL_COLUMN = cn59("sticky left-0 z-30 shrink-0 border-r bg-background", ganttOn ? "w-64 sm:w-80" : "w-24 sm:w-36");
|
|
36427
36536
|
const todayLine = todayX !== null ? /* @__PURE__ */ jsx121(
|
|
36428
36537
|
"div",
|
|
36429
36538
|
{
|
|
@@ -36434,10 +36543,10 @@ function TimelineView({
|
|
|
36434
36543
|
}
|
|
36435
36544
|
) : null;
|
|
36436
36545
|
const headerRow = (segments, className2, key) => /* @__PURE__ */ jsxs109("div", { className: "flex", "data-timeline-scale": key, children: [
|
|
36437
|
-
hasLabel ? /* @__PURE__ */ jsx121("div", { className:
|
|
36546
|
+
hasLabel ? /* @__PURE__ */ jsx121("div", { className: cn59(LABEL_COLUMN, "border-b"), children: ganttOn && key === "bottom" ? /* @__PURE__ */ jsxs109("div", { className: "flex h-full items-center gap-1 px-1.5 text-[11px] text-muted-foreground", "data-timeline-list-head": "", children: [
|
|
36438
36547
|
/* @__PURE__ */ jsx121("span", { className: "min-w-0 flex-1 truncate", children: "Task" }),
|
|
36439
|
-
/* @__PURE__ */ jsx121("span", { className:
|
|
36440
|
-
/* @__PURE__ */ jsx121("span", { className:
|
|
36548
|
+
/* @__PURE__ */ jsx121("span", { className: cn59(listDayW, "shrink-0"), children: "Start" }),
|
|
36549
|
+
/* @__PURE__ */ jsx121("span", { className: cn59(listDayW, "shrink-0"), children: "End" }),
|
|
36441
36550
|
/* @__PURE__ */ jsx121("span", { className: "w-14 shrink-0 text-right", children: "Days" })
|
|
36442
36551
|
] }) : null }) : null,
|
|
36443
36552
|
/* @__PURE__ */ jsxs109("div", { className: "relative shrink-0", style: { width, height: 22 }, children: [
|
|
@@ -36448,7 +36557,7 @@ function TimelineView({
|
|
|
36448
36557
|
return /* @__PURE__ */ jsx121(
|
|
36449
36558
|
"div",
|
|
36450
36559
|
{
|
|
36451
|
-
className:
|
|
36560
|
+
className: cn59("absolute top-0 h-full truncate border-b border-l px-1 text-[11px] leading-[22px]", className2, s.day === today && key === "bottom" ? "font-semibold text-primary" : void 0),
|
|
36452
36561
|
style: { left, width: w, paddingLeft: 4 + inset },
|
|
36453
36562
|
children: w >= 14 ? s.label : ""
|
|
36454
36563
|
},
|
|
@@ -36464,24 +36573,24 @@ function TimelineView({
|
|
|
36464
36573
|
headerRow(scale.bottom, "text-muted-foreground", "bottom")
|
|
36465
36574
|
] }),
|
|
36466
36575
|
laneRows.map((lane) => /* @__PURE__ */ jsxs109("div", { className: "flex border-b", "data-timeline-lane": groupField ? lane.key : "", children: [
|
|
36467
|
-
ganttOn ? /* @__PURE__ */ jsx121("div", { className:
|
|
36576
|
+
ganttOn ? /* @__PURE__ */ jsx121("div", { className: cn59(LABEL_COLUMN), "data-timeline-label": "", "data-timeline-list": "", style: { paddingTop: LANE_PAD / 2 }, children: lane.packed.map((b) => {
|
|
36468
36577
|
const at = shown5(b.p);
|
|
36469
36578
|
const slip = slipDays(baselineOf(b.p.row)?.last ?? null, at.last);
|
|
36470
36579
|
return /* @__PURE__ */ jsxs109("div", { "data-timeline-list-row": b.p.row.id, className: "flex items-center gap-1 px-1.5 text-xs", style: { height: ROW_PX }, children: [
|
|
36471
36580
|
/* @__PURE__ */ jsx121("button", { type: "button", className: "min-w-0 flex-1 truncate text-left hover:underline", onClick: () => onOpenRecord?.(b.p.row.id), children: titleOf(b.p.row) }),
|
|
36472
|
-
/* @__PURE__ */ jsx121("span", { className:
|
|
36473
|
-
/* @__PURE__ */ jsx121("span", { className:
|
|
36581
|
+
/* @__PURE__ */ jsx121("span", { className: cn59(listDayW, "shrink-0 whitespace-nowrap tabular-nums text-muted-foreground"), children: taskListDay(at.first, listYear) }),
|
|
36582
|
+
/* @__PURE__ */ jsx121("span", { className: cn59(listDayW, "shrink-0 whitespace-nowrap tabular-nums text-muted-foreground"), children: taskListDay(at.last, listYear) }),
|
|
36474
36583
|
/* @__PURE__ */ jsxs109("span", { className: "w-14 shrink-0 whitespace-nowrap text-right tabular-nums", title: slip !== null ? slipWords(slip) : void 0, children: [
|
|
36475
36584
|
daysBetween(at.first, at.last) + 1,
|
|
36476
36585
|
"d",
|
|
36477
|
-
slip !== null && slip !== 0 ? /* @__PURE__ */ jsx121("span", { className:
|
|
36586
|
+
slip !== null && slip !== 0 ? /* @__PURE__ */ jsx121("span", { className: cn59("ml-1", slip > 0 ? "text-destructive" : "text-emerald-600"), children: slip > 0 ? `+${slip}` : slip }) : null
|
|
36478
36587
|
] })
|
|
36479
36588
|
] }, b.p.row.id);
|
|
36480
|
-
}) }) : grouped ? /* @__PURE__ */ jsxs109("div", { className:
|
|
36589
|
+
}) }) : grouped ? /* @__PURE__ */ jsxs109("div", { className: cn59(LABEL_COLUMN, "flex items-start p-1"), "data-timeline-label": "", children: [
|
|
36481
36590
|
/* @__PURE__ */ jsx121(
|
|
36482
36591
|
"span",
|
|
36483
36592
|
{
|
|
36484
|
-
className:
|
|
36593
|
+
className: cn59("max-w-full truncate rounded px-1.5 py-0.5 text-xs font-medium", lane.color ? CHOICE_CHIP_CLASS4[lane.color] : void 0),
|
|
36485
36594
|
title: laneLocked ?? lane.label,
|
|
36486
36595
|
...laneLocked ? { "data-timeline-lane-locked": "" } : {},
|
|
36487
36596
|
children: lane.label
|
|
@@ -36498,7 +36607,7 @@ function TimelineView({
|
|
|
36498
36607
|
] })
|
|
36499
36608
|
] }, lane.key))
|
|
36500
36609
|
] }) });
|
|
36501
|
-
return /* @__PURE__ */ jsxs109("div", { className:
|
|
36610
|
+
return /* @__PURE__ */ jsxs109("div", { className: cn59("relative flex min-h-0 min-w-0 max-w-full flex-col gap-2", className), "data-timeline": "", onKeyDown: moves.onKeyDown, children: [
|
|
36502
36611
|
note ? /* @__PURE__ */ jsx121("p", { className: "text-xs text-muted-foreground", children: note }) : null,
|
|
36503
36612
|
toolbar,
|
|
36504
36613
|
critical && critical.ids.length > 0 ? /* @__PURE__ */ jsxs109("p", { className: "text-xs text-muted-foreground", "data-timeline-critical-note": "", children: [
|
|
@@ -36892,7 +37001,7 @@ function BoardOptions({
|
|
|
36892
37001
|
|
|
36893
37002
|
// src/ListView.tsx
|
|
36894
37003
|
import { useMemo as useMemo58 } from "react";
|
|
36895
|
-
import { Select as Select17, SelectContent as SelectContent15, SelectItem as SelectItem15, SelectTrigger as SelectTrigger15, SelectValue as SelectValue15, cn as
|
|
37004
|
+
import { Select as Select17, SelectContent as SelectContent15, SelectItem as SelectItem15, SelectTrigger as SelectTrigger15, SelectValue as SelectValue15, cn as cn60 } from "@ai-matrx/design-system";
|
|
36896
37005
|
import { resolveRowColor as resolveRowColor3, ROW_TINT_CLASS as ROW_TINT_CLASS2 } from "@ai-matrx/design-system/data-table";
|
|
36897
37006
|
import { jsx as jsx125, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
36898
37007
|
var LIST_DEFAULT_FIELDS = 4;
|
|
@@ -37057,7 +37166,7 @@ function ListRow({
|
|
|
37057
37166
|
{
|
|
37058
37167
|
type: "button",
|
|
37059
37168
|
"data-records-list-row": row.id,
|
|
37060
|
-
className:
|
|
37169
|
+
className: cn60(
|
|
37061
37170
|
"flex w-full min-w-0 items-center gap-3 rounded px-1 py-1 pr-7 text-left text-xs hover:bg-muted",
|
|
37062
37171
|
color ? ROW_TINT_CLASS2[color] : void 0
|
|
37063
37172
|
),
|
|
@@ -37098,7 +37207,7 @@ import {
|
|
|
37098
37207
|
measureKey as measureKey3
|
|
37099
37208
|
} from "@ai-matrx/records";
|
|
37100
37209
|
import { mapPgError as mapPgError2 } from "@ai-matrx/records/core";
|
|
37101
|
-
import { cn as
|
|
37210
|
+
import { cn as cn62 } from "@ai-matrx/design-system";
|
|
37102
37211
|
import { formatCount as formatCount5 } from "@ai-matrx/kit/format";
|
|
37103
37212
|
|
|
37104
37213
|
// src/linkWords.ts
|
|
@@ -37402,7 +37511,7 @@ import {
|
|
|
37402
37511
|
useRef as useRef49,
|
|
37403
37512
|
useState as useState104
|
|
37404
37513
|
} from "react";
|
|
37405
|
-
import { cn as
|
|
37514
|
+
import { cn as cn61 } from "@ai-matrx/design-system";
|
|
37406
37515
|
import { jsx as jsx126, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
37407
37516
|
function useMeasuredWidth(fallback = 480) {
|
|
37408
37517
|
const ref = useRef49(null);
|
|
@@ -37444,7 +37553,7 @@ function ChartFrame({
|
|
|
37444
37553
|
ref,
|
|
37445
37554
|
"data-chart": chartId,
|
|
37446
37555
|
style: { height, ...chartVariables(config) },
|
|
37447
|
-
className:
|
|
37556
|
+
className: cn61(
|
|
37448
37557
|
"w-full min-w-0 overflow-hidden text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-layer]:outline-none [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
37449
37558
|
className
|
|
37450
37559
|
),
|
|
@@ -37463,7 +37572,7 @@ function ChartTooltipContent({
|
|
|
37463
37572
|
return /* @__PURE__ */ jsxs113(
|
|
37464
37573
|
"div",
|
|
37465
37574
|
{
|
|
37466
|
-
className:
|
|
37575
|
+
className: cn61(
|
|
37467
37576
|
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
|
37468
37577
|
className
|
|
37469
37578
|
),
|
|
@@ -37493,7 +37602,7 @@ function ChartLegendContent({
|
|
|
37493
37602
|
className
|
|
37494
37603
|
}) {
|
|
37495
37604
|
if (!payload || payload.length === 0) return null;
|
|
37496
|
-
return /* @__PURE__ */ jsx126("div", { className:
|
|
37605
|
+
return /* @__PURE__ */ jsx126("div", { className: cn61("flex flex-wrap items-center justify-center gap-3 pt-2", className), children: payload.map((entry, index) => {
|
|
37497
37606
|
const key = String(entry.dataKey ?? entry.value ?? index);
|
|
37498
37607
|
return /* @__PURE__ */ jsxs113("span", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
37499
37608
|
/* @__PURE__ */ jsx126(
|
|
@@ -37516,7 +37625,7 @@ function Trend({ pct, aimingUp, className }) {
|
|
|
37516
37625
|
const up = pct > 0;
|
|
37517
37626
|
const flat = pct === 0;
|
|
37518
37627
|
const tone = flat || !aimingUp ? "text-muted-foreground" : up ? "text-success" : "text-destructive";
|
|
37519
|
-
return /* @__PURE__ */ jsxs114("span", { className:
|
|
37628
|
+
return /* @__PURE__ */ jsxs114("span", { className: cn62("inline-flex items-center gap-0.5 tabular-nums", tone, className), children: [
|
|
37520
37629
|
flat ? null : /* @__PURE__ */ jsx127("svg", { viewBox: "0 0 10 10", "aria-hidden": "true", className: "h-2.5 w-2.5 fill-current", children: up ? /* @__PURE__ */ jsx127("path", { d: "M5 1 9 8H1z" }) : /* @__PURE__ */ jsx127("path", { d: "M5 9 1 2h8z" }) }),
|
|
37521
37630
|
/* @__PURE__ */ jsxs114("span", { children: [
|
|
37522
37631
|
up ? "+" : "",
|
|
@@ -37652,7 +37761,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
37652
37761
|
return /* @__PURE__ */ jsx127(
|
|
37653
37762
|
"figure",
|
|
37654
37763
|
{
|
|
37655
|
-
className:
|
|
37764
|
+
className: cn62("flex min-h-24 min-w-0 items-center justify-center rounded border border-dashed p-2", className),
|
|
37656
37765
|
"data-records-chart-not-shared": "",
|
|
37657
37766
|
children: /* @__PURE__ */ jsx127("figcaption", { className: "text-xs text-muted-foreground", children: "Not shared with you" })
|
|
37658
37767
|
}
|
|
@@ -37661,7 +37770,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
37661
37770
|
return /* @__PURE__ */ jsxs114(
|
|
37662
37771
|
"figure",
|
|
37663
37772
|
{
|
|
37664
|
-
className:
|
|
37773
|
+
className: cn62("flex min-w-0 flex-col gap-1.5", bare ? null : "rounded border p-2", className),
|
|
37665
37774
|
...bare ? { "aria-label": block.title || CHART_KIND_LABEL[kind2] } : {},
|
|
37666
37775
|
...typeof block.ms === "number" ? { "data-store-ms": pretty(block.ms) } : {},
|
|
37667
37776
|
children: [
|
|
@@ -38278,7 +38387,7 @@ function ViewSwitcherBody({
|
|
|
38278
38387
|
setLocal((held) => ({ ...held, ...patch }));
|
|
38279
38388
|
onViewChange?.(patch);
|
|
38280
38389
|
};
|
|
38281
|
-
return /* @__PURE__ */ jsxs116("div", { className:
|
|
38390
|
+
return /* @__PURE__ */ jsxs116("div", { className: cn63("flex min-h-0 flex-col gap-2", footer === "sticky" && "flex-1", className), children: [
|
|
38282
38391
|
chooser && !embedded ? /* @__PURE__ */ jsxs116("div", { className: "flex items-center gap-2", children: [
|
|
38283
38392
|
/* @__PURE__ */ jsx129("span", { className: "truncate text-sm font-medium", children: view.name }),
|
|
38284
38393
|
/* @__PURE__ */ jsx129("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Layout", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx129(
|
|
@@ -38959,7 +39068,7 @@ function Kanban({
|
|
|
38959
39068
|
const heading = (name) => /* @__PURE__ */ jsxs116(
|
|
38960
39069
|
"header",
|
|
38961
39070
|
{
|
|
38962
|
-
className:
|
|
39071
|
+
className: cn63("flex h-7 items-center gap-2 border-b px-2 text-xs font-medium", columnColor(name) ? CHOICE_CHIP_CLASS5[columnColor(name)] : void 0),
|
|
38963
39072
|
"data-board-heading": name,
|
|
38964
39073
|
...columnColor(name) ? { "data-column-color": columnColor(name) } : {},
|
|
38965
39074
|
children: [
|
|
@@ -38976,7 +39085,7 @@ function Kanban({
|
|
|
38976
39085
|
{
|
|
38977
39086
|
"data-board-column": name,
|
|
38978
39087
|
...laneName !== null ? { "data-board-lane": laneName } : {},
|
|
38979
|
-
className:
|
|
39088
|
+
className: cn63("flex shrink-0 flex-col rounded border bg-muted/30", size.column),
|
|
38980
39089
|
onDragOver: (e) => {
|
|
38981
39090
|
if (movable && e.dataTransfer.types.includes("application/x-records-card")) e.preventDefault();
|
|
38982
39091
|
},
|
|
@@ -39010,7 +39119,7 @@ function Kanban({
|
|
|
39010
39119
|
"li",
|
|
39011
39120
|
{
|
|
39012
39121
|
draggable,
|
|
39013
|
-
className:
|
|
39122
|
+
className: cn63("relative", choiceColor(name) ? "pl-1.5" : void 0, draggable ? "cursor-grab active:cursor-grabbing" : void 0),
|
|
39014
39123
|
...draggable ? { "aria-keyshortcuts": "Alt+ArrowLeft Alt+ArrowRight", title: "Drag to another column, or Alt + arrow keys" } : {},
|
|
39015
39124
|
onDragStart: (e) => {
|
|
39016
39125
|
if (!draggable) return;
|
|
@@ -39026,9 +39135,9 @@ function Kanban({
|
|
|
39026
39135
|
void move(card, { column: name, lane: laneName }, { column: to, lane: laneName });
|
|
39027
39136
|
},
|
|
39028
39137
|
children: [
|
|
39029
|
-
accent ? /* @__PURE__ */ jsx129("span", { "aria-hidden": "true", "data-card-accent": accent, className:
|
|
39138
|
+
accent ? /* @__PURE__ */ jsx129("span", { "aria-hidden": "true", "data-card-accent": accent, className: cn63("absolute inset-y-0.5 left-0 w-1 rounded", SWATCH_CLASS4[accent]) }) : null,
|
|
39030
39139
|
/* @__PURE__ */ jsx129(RecordActionMenu, { tableId, row: card, name: cardWords(card, titleField).text, onOpenRecord, onChanged, children: previewField ? /* @__PURE__ */ jsxs116("div", { className: "flex flex-col gap-1", children: [
|
|
39031
|
-
/* @__PURE__ */ jsx129("span", { className:
|
|
39140
|
+
/* @__PURE__ */ jsx129("span", { className: cn63("block w-full shrink-0 overflow-hidden rounded bg-muted/50", size.cover), "data-board-preview": previewField.key, children: /* @__PURE__ */ jsx129(GalleryCover, { field: previewField, value: cover }) }),
|
|
39032
39141
|
recordCard
|
|
39033
39142
|
] }) : recordCard }),
|
|
39034
39143
|
moves.refused?.recordId === card.id ? /* @__PURE__ */ jsx129(MoveRefusedBadge, { refused: moves.refused }) : null
|
|
@@ -39060,7 +39169,7 @@ function Kanban({
|
|
|
39060
39169
|
// is the same fixed width in every band and in the heading row, and a lane's strip is one
|
|
39061
39170
|
// fixed height — collapsing a lane moves only what is below it, never a column.
|
|
39062
39171
|
/* @__PURE__ */ jsx129("div", { className: "min-h-0 overflow-x-auto pb-2", children: /* @__PURE__ */ jsxs116("div", { className: "flex w-max flex-col gap-2", "data-board-lanes": "", children: [
|
|
39063
|
-
/* @__PURE__ */ jsx129("div", { className: "flex gap-2", "data-board-heads": "", children: columns.map((name) => /* @__PURE__ */ jsx129("div", { className:
|
|
39172
|
+
/* @__PURE__ */ jsx129("div", { className: "flex gap-2", "data-board-heads": "", children: columns.map((name) => /* @__PURE__ */ jsx129("div", { className: cn63("shrink-0 overflow-hidden rounded border bg-muted/30", size.column), children: heading(name) }, name)) }),
|
|
39064
39173
|
lanes.map((lane) => {
|
|
39065
39174
|
const open = !shut.has(lane.name);
|
|
39066
39175
|
return /* @__PURE__ */ jsxs116("div", { "data-board-lane-band": lane.name, className: "flex flex-col gap-1", children: [
|
|
@@ -39171,13 +39280,13 @@ function Gallery({
|
|
|
39171
39280
|
"button",
|
|
39172
39281
|
{
|
|
39173
39282
|
type: "button",
|
|
39174
|
-
className:
|
|
39283
|
+
className: cn63(
|
|
39175
39284
|
"flex h-full w-full flex-col gap-1 rounded border p-2 pr-7 text-left hover:bg-muted",
|
|
39176
39285
|
rowColor ? ROW_TINT_CLASS3[rowColor] : void 0
|
|
39177
39286
|
),
|
|
39178
39287
|
onClick: () => onOpenRecord?.(row.id),
|
|
39179
39288
|
children: [
|
|
39180
|
-
imageField ? /* @__PURE__ */ jsx129("span", { className:
|
|
39289
|
+
imageField ? /* @__PURE__ */ jsx129("span", { className: cn63(dims.cover, "w-full shrink-0 overflow-hidden rounded bg-muted/50"), "data-records-gallery-cover": imageField.key, children: /* @__PURE__ */ jsx129(GalleryCover, { field: imageField, value: image }) }) : null,
|
|
39181
39290
|
/* @__PURE__ */ jsx129("span", { className: "truncate text-sm font-medium", "data-records-gallery-title": "", children: recordNameIn({ title_field: titleKey ?? null }, doc) || "Untitled" }),
|
|
39182
39291
|
onCard.map((field2) => /* @__PURE__ */ jsxs116("span", { className: "flex h-5 min-w-0 items-center gap-1 overflow-hidden whitespace-nowrap text-xs", children: [
|
|
39183
39292
|
/* @__PURE__ */ jsx129("span", { className: "shrink-0 text-muted-foreground", children: fieldName(field2) }),
|
|
@@ -39255,7 +39364,7 @@ function RecordCard({
|
|
|
39255
39364
|
role: "button",
|
|
39256
39365
|
tabIndex: 0,
|
|
39257
39366
|
"data-records-card": record.id,
|
|
39258
|
-
className:
|
|
39367
|
+
className: cn63(
|
|
39259
39368
|
"w-full cursor-pointer truncate rounded border bg-background px-2 py-1 text-left text-xs hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
39260
39369
|
host.density === "spacious" ? "py-2" : "",
|
|
39261
39370
|
color ? ROW_TINT_CLASS3[color] : void 0
|
|
@@ -39307,7 +39416,7 @@ import {
|
|
|
39307
39416
|
emptyArchiveLine
|
|
39308
39417
|
} from "@ai-matrx/records";
|
|
39309
39418
|
import { tableShapeChanged as tableShapeChanged13, useFields as useFields22, useRecordsClient as useRecordsClient72, useTable as useTable22 } from "@ai-matrx/records/react";
|
|
39310
|
-
import { Button as Button78, Skeleton as Skeleton16, cn as
|
|
39419
|
+
import { Button as Button78, Skeleton as Skeleton16, cn as cn64 } from "@ai-matrx/design-system";
|
|
39311
39420
|
import { jsx as jsx130, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
39312
39421
|
var ARCHIVE_MEANS = "Archiving never destroys anything. A record you remove from the grid waits here until somebody brings it back.";
|
|
39313
39422
|
function mayNotRestoreLine(why) {
|
|
@@ -39373,7 +39482,7 @@ function ArchivedView({
|
|
|
39373
39482
|
const titleKey = table.data?.title_field ?? null;
|
|
39374
39483
|
const mayRestore = rights.organise;
|
|
39375
39484
|
const whyNot = mayRestore ? "" : mayNotRestoreLine(rights.why("organise"));
|
|
39376
|
-
return /* @__PURE__ */ jsxs117("div", { className:
|
|
39485
|
+
return /* @__PURE__ */ jsxs117("div", { className: cn64("flex min-h-0 flex-col gap-2", className), "data-testid": "archived-view", children: [
|
|
39377
39486
|
/* @__PURE__ */ jsxs117("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
39378
39487
|
/* @__PURE__ */ jsx130("span", { className: "text-sm font-medium", children: "Archived" }),
|
|
39379
39488
|
/* @__PURE__ */ jsx130("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Archived by", children: ARCHIVE_LANES.map((option) => /* @__PURE__ */ jsx130(
|
|
@@ -39503,7 +39612,7 @@ import {
|
|
|
39503
39612
|
portalTitleTypedBack
|
|
39504
39613
|
} from "@ai-matrx/records";
|
|
39505
39614
|
import { useRecordsClient as useRecordsClient73 } from "@ai-matrx/records/react";
|
|
39506
|
-
import { BasicInput as BasicInput21, Button as Button79, Skeleton as Skeleton17, cn as
|
|
39615
|
+
import { BasicInput as BasicInput21, Button as Button79, Skeleton as Skeleton17, cn as cn65 } from "@ai-matrx/design-system";
|
|
39507
39616
|
import { jsx as jsx131, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
39508
39617
|
var ARCHIVED_NEVER_DESTROYED = "Archiving never destroys anything. What you put away waits here until somebody brings it back.";
|
|
39509
39618
|
function ArchivedDisclosure({
|
|
@@ -39520,7 +39629,7 @@ function ArchivedDisclosure({
|
|
|
39520
39629
|
setOpen(next);
|
|
39521
39630
|
onOpenChange?.(next);
|
|
39522
39631
|
};
|
|
39523
|
-
return /* @__PURE__ */ jsxs118("div", { className:
|
|
39632
|
+
return /* @__PURE__ */ jsxs118("div", { className: cn65("flex flex-col gap-2", className), "data-testid": "archived-disclosure", children: [
|
|
39524
39633
|
/* @__PURE__ */ jsx131("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs118(
|
|
39525
39634
|
Button79,
|
|
39526
39635
|
{
|
|
@@ -39683,7 +39792,7 @@ function ArchivedPortals({
|
|
|
39683
39792
|
// src/ViewBar.tsx
|
|
39684
39793
|
import { useCallback as useCallback43, useEffect as useEffect90, useRef as useRef51, useState as useState109 } from "react";
|
|
39685
39794
|
import { useRecordsClient as useRecordsClient74 } from "@ai-matrx/records/react";
|
|
39686
|
-
import { Badge as Badge15, Button as Button80, Input as Input7, Popover as Popover16, PopoverContent as PopoverContent16, PopoverTrigger as PopoverTrigger16, Skeleton as Skeleton18, cn as
|
|
39795
|
+
import { Badge as Badge15, Button as Button80, Input as Input7, Popover as Popover16, PopoverContent as PopoverContent16, PopoverTrigger as PopoverTrigger16, Skeleton as Skeleton18, cn as cn66 } from "@ai-matrx/design-system";
|
|
39687
39796
|
import { Button as ControlButton, Switch as Switch5, Tile as Tile2 } from "@ai-matrx/design-system/controls";
|
|
39688
39797
|
import { DndContext, PointerSensor, closestCenter, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
39689
39798
|
import { SortableContext, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
@@ -39753,6 +39862,9 @@ function settingsToCopy(source, target) {
|
|
|
39753
39862
|
const same3 = source.layout === target.layout;
|
|
39754
39863
|
return {
|
|
39755
39864
|
where: source.where ?? null,
|
|
39865
|
+
// The flat filter map a view may carry instead of (or beside) `where`: every stored filter shape travels.
|
|
39866
|
+
filters: source.filters ?? null,
|
|
39867
|
+
// saveViewPatch sends null to the door, which clears it
|
|
39756
39868
|
sorts: source.sorts ?? [],
|
|
39757
39869
|
groupField: source.groupField ?? null,
|
|
39758
39870
|
presentation: look,
|
|
@@ -39770,7 +39882,7 @@ function seedIsSatisfied(seed, views) {
|
|
|
39770
39882
|
}
|
|
39771
39883
|
function SectionBox({ id, children, ...rest }) {
|
|
39772
39884
|
const { setNodeRef, isOver } = useDroppable({ id });
|
|
39773
|
-
return /* @__PURE__ */ jsx132("div", { ref: setNodeRef, className:
|
|
39885
|
+
return /* @__PURE__ */ jsx132("div", { ref: setNodeRef, className: cn66("rounded-sm", isOver && "bg-accent/40"), ...rest, children });
|
|
39774
39886
|
}
|
|
39775
39887
|
function SortableRow({ id, disabled, children }) {
|
|
39776
39888
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id, disabled });
|
|
@@ -39779,7 +39891,7 @@ function SortableRow({ id, disabled, children }) {
|
|
|
39779
39891
|
{
|
|
39780
39892
|
ref: setNodeRef,
|
|
39781
39893
|
style: { transform: CSS2.Transform.toString(transform), transition },
|
|
39782
|
-
className:
|
|
39894
|
+
className: cn66(isDragging && "relative z-10 opacity-80"),
|
|
39783
39895
|
"data-view-row": id,
|
|
39784
39896
|
...disabled ? {} : attributes,
|
|
39785
39897
|
...disabled ? {} : listeners,
|
|
@@ -39787,7 +39899,7 @@ function SortableRow({ id, disabled, children }) {
|
|
|
39787
39899
|
}
|
|
39788
39900
|
);
|
|
39789
39901
|
}
|
|
39790
|
-
function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews, initialViews, className }) {
|
|
39902
|
+
function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews, onSettingsCopied, initialViews, className }) {
|
|
39791
39903
|
const client = useRecordsClient74();
|
|
39792
39904
|
const claimSeed = useSeedGuard();
|
|
39793
39905
|
const table = useTable23(tableId);
|
|
@@ -39960,6 +40072,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
39960
40072
|
return;
|
|
39961
40073
|
}
|
|
39962
40074
|
setCopying(false);
|
|
40075
|
+
onSettingsCopied?.(into.id);
|
|
39963
40076
|
await load();
|
|
39964
40077
|
notify?.success(`Copied settings from \u201C${source.name}\u201D`);
|
|
39965
40078
|
}
|
|
@@ -40042,7 +40155,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40042
40155
|
return /* @__PURE__ */ jsx132(
|
|
40043
40156
|
"span",
|
|
40044
40157
|
{
|
|
40045
|
-
className:
|
|
40158
|
+
className: cn66("max-w-[16rem] shrink-0 truncate text-xs text-muted-foreground", className),
|
|
40046
40159
|
title: SAVED_VIEWS_UNAVAILABLE,
|
|
40047
40160
|
"data-saved-views-unavailable": "",
|
|
40048
40161
|
children: SAVED_VIEWS_UNAVAILABLE
|
|
@@ -40050,7 +40163,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40050
40163
|
);
|
|
40051
40164
|
}
|
|
40052
40165
|
if (error) return /* @__PURE__ */ jsx132(RefusalNotice, { error, className, actions: /* @__PURE__ */ jsx132(Button80, { size: "sm", variant: "ghost", onClick: () => void load(), children: "Try again" }) });
|
|
40053
|
-
if (views === null) return /* @__PURE__ */ jsx132(Skeleton18, { className:
|
|
40166
|
+
if (views === null) return /* @__PURE__ */ jsx132(Skeleton18, { className: cn66(VIEW_CHIP_BOX, className), "data-view-picker-reserved": "" });
|
|
40054
40167
|
const current = views.find((v) => v.id === active) ?? null;
|
|
40055
40168
|
return /* @__PURE__ */ jsxs119(Popover16, { open, onOpenChange: setOpen, children: [
|
|
40056
40169
|
/* @__PURE__ */ jsx132(PopoverTrigger16, { asChild: true, children: /* @__PURE__ */ jsxs119(
|
|
@@ -40058,7 +40171,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40058
40171
|
{
|
|
40059
40172
|
size: "sm",
|
|
40060
40173
|
variant: "subtle",
|
|
40061
|
-
className:
|
|
40174
|
+
className: cn66(VIEW_CHIP_BOX, "justify-between gap-1 px-2 text-xs", className),
|
|
40062
40175
|
title: current?.name ?? void 0,
|
|
40063
40176
|
"aria-label": `View: ${current?.name ?? "none yet"}. Change view`,
|
|
40064
40177
|
"data-view-picker": "",
|
|
@@ -40115,7 +40228,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40115
40228
|
"data-view-section-toggle": "",
|
|
40116
40229
|
onClick: () => toggleShut(group.name),
|
|
40117
40230
|
children: [
|
|
40118
|
-
/* @__PURE__ */ jsx132("svg", { viewBox: "0 0 24 24", className:
|
|
40231
|
+
/* @__PURE__ */ jsx132("svg", { viewBox: "0 0 24 24", className: cn66("h-3 w-3 shrink-0", shut.includes(group.name) && "-rotate-90"), fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx132("path", { d: "m6 9 6 6 6-6" }) }),
|
|
40119
40232
|
/* @__PURE__ */ jsx132("span", { className: "truncate", children: group.name }),
|
|
40120
40233
|
/* @__PURE__ */ jsx132("span", { className: "shrink-0 font-normal normal-case", children: group.views.length })
|
|
40121
40234
|
]
|
|
@@ -40131,7 +40244,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40131
40244
|
{
|
|
40132
40245
|
variant: "quiet",
|
|
40133
40246
|
selected: view.id === active,
|
|
40134
|
-
className:
|
|
40247
|
+
className: cn66(group.name !== null && "pl-4"),
|
|
40135
40248
|
onClick: () => {
|
|
40136
40249
|
if (justDragged.current) return;
|
|
40137
40250
|
setActive(view.id);
|
|
@@ -40278,7 +40391,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40278
40391
|
// src/ProposalRow.tsx
|
|
40279
40392
|
import { useEffect as useEffect91, useRef as useRef52, useState as useState110 } from "react";
|
|
40280
40393
|
import { useRecordsClient as useRecordsClient75 } from "@ai-matrx/records/react";
|
|
40281
|
-
import { Badge as Badge16, Button as Button81, cn as
|
|
40394
|
+
import { Badge as Badge16, Button as Button81, cn as cn67 } from "@ai-matrx/design-system";
|
|
40282
40395
|
import { jsx as jsx133, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
40283
40396
|
var ACT_WORD = PROPOSED_CHANGE_ACT_LABEL;
|
|
40284
40397
|
function ProposalRow({
|
|
@@ -40337,14 +40450,14 @@ function ProposalRow({
|
|
|
40337
40450
|
setSettled(result);
|
|
40338
40451
|
onSettled?.(result);
|
|
40339
40452
|
}
|
|
40340
|
-
return /* @__PURE__ */ jsxs120("div", { className:
|
|
40453
|
+
return /* @__PURE__ */ jsxs120("div", { className: cn67("flex flex-col gap-1 rounded border p-2", className), children: [
|
|
40341
40454
|
/* @__PURE__ */ jsxs120("div", { className: "flex items-baseline gap-2", children: [
|
|
40342
40455
|
/* @__PURE__ */ jsx133(Badge16, { variant: change.act === "remove" ? "destructive" : "secondary", className: "text-[10px]", children: ACT_WORD[change.act] }),
|
|
40343
40456
|
/* @__PURE__ */ jsx133("span", { className: "min-w-0 flex-1 truncate text-xs", title: change.label, children: change.label }),
|
|
40344
40457
|
settled ? /* @__PURE__ */ jsx133(
|
|
40345
40458
|
"span",
|
|
40346
40459
|
{
|
|
40347
|
-
className:
|
|
40460
|
+
className: cn67(
|
|
40348
40461
|
"shrink-0 text-xs",
|
|
40349
40462
|
settled.settled === "refused" ? "text-destructive" : "text-muted-foreground"
|
|
40350
40463
|
),
|
|
@@ -40386,14 +40499,14 @@ function ProposalRow({
|
|
|
40386
40499
|
// src/ActionInbox.tsx
|
|
40387
40500
|
import { useCallback as useCallback45, useEffect as useEffect93, useMemo as useMemo64, useRef as useRef53, useState as useState112 } from "react";
|
|
40388
40501
|
import { useRecordsClient as useRecordsClient77 } from "@ai-matrx/records/react";
|
|
40389
|
-
import { Badge as Badge18, Button as Button83, Checkbox as Checkbox13, Skeleton as Skeleton20, cn as
|
|
40502
|
+
import { Badge as Badge18, Button as Button83, Checkbox as Checkbox13, Skeleton as Skeleton20, cn as cn69 } from "@ai-matrx/design-system";
|
|
40390
40503
|
import { toggleSelection as toggleSelection2 } from "@ai-matrx/design-system/data-table";
|
|
40391
40504
|
import { formatAbsoluteDate, formatDurationMs } from "@ai-matrx/kit/format";
|
|
40392
40505
|
|
|
40393
40506
|
// src/ChecklistRunner.tsx
|
|
40394
40507
|
import { useCallback as useCallback44, useEffect as useEffect92, useMemo as useMemo63, useState as useState111 } from "react";
|
|
40395
40508
|
import { useRecordsClient as useRecordsClient76, useTable as useTable24 } from "@ai-matrx/records/react";
|
|
40396
|
-
import { Badge as Badge17, BasicInput as BasicInput22, BasicTextarea as BasicTextarea9, Button as Button82, Skeleton as Skeleton19, cn as
|
|
40509
|
+
import { Badge as Badge17, BasicInput as BasicInput22, BasicTextarea as BasicTextarea9, Button as Button82, Skeleton as Skeleton19, cn as cn68 } from "@ai-matrx/design-system";
|
|
40397
40510
|
import { Select as Select20 } from "@ai-matrx/design-system/controls";
|
|
40398
40511
|
import { humanizeIdentifier as humanizeIdentifier15 } from "@ai-matrx/kit/text-case";
|
|
40399
40512
|
import { Fragment as Fragment51, jsx as jsx134, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
@@ -40535,7 +40648,7 @@ function ChecklistRunner({
|
|
|
40535
40648
|
if (runs === null && steps === null && !runId) {
|
|
40536
40649
|
return /* @__PURE__ */ jsx134(Skeleton19, { shape: "block", height: "sm", className });
|
|
40537
40650
|
}
|
|
40538
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
40651
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("flex min-h-0 flex-col gap-2", className), "data-testid": "checklist-runner", children: [
|
|
40539
40652
|
/* @__PURE__ */ jsxs121("header", { className: "flex items-center gap-2 text-xs", children: [
|
|
40540
40653
|
/* @__PURE__ */ jsx134("h3", { className: "text-sm font-medium", children: "Checklists" }),
|
|
40541
40654
|
active ? /* @__PURE__ */ jsxs121("span", { className: "tabular-nums text-muted-foreground", children: [
|
|
@@ -40615,14 +40728,14 @@ function StepRow({
|
|
|
40615
40728
|
return /* @__PURE__ */ jsxs121(
|
|
40616
40729
|
"li",
|
|
40617
40730
|
{
|
|
40618
|
-
className:
|
|
40731
|
+
className: cn68("rounded border p-2", step2.finished && "opacity-70", className),
|
|
40619
40732
|
"data-testid": "checklist-step",
|
|
40620
40733
|
"data-step-ref": step2.ref,
|
|
40621
40734
|
"data-finished": step2.finished ? "true" : "false",
|
|
40622
40735
|
children: [
|
|
40623
40736
|
/* @__PURE__ */ jsxs121("div", { className: "flex items-center gap-2", children: [
|
|
40624
40737
|
/* @__PURE__ */ jsx134("span", { className: "w-5 shrink-0 text-right text-[11px] tabular-nums text-muted-foreground", children: step2.step_order }),
|
|
40625
|
-
/* @__PURE__ */ jsx134("span", { className:
|
|
40738
|
+
/* @__PURE__ */ jsx134("span", { className: cn68("min-w-0 flex-1 truncate text-xs", step2.finished && "line-through"), children: step2.title }),
|
|
40626
40739
|
step2.role ? /* @__PURE__ */ jsx134(Badge17, { variant: "outline", className: "text-[10px]", children: step2.assignee_name ?? humanizeIdentifier15(step2.role) }) : null,
|
|
40627
40740
|
step2.due_state && step2.due_state !== "undated" ? /* @__PURE__ */ jsx134(
|
|
40628
40741
|
Badge17,
|
|
@@ -40765,7 +40878,7 @@ function MyChecklistSteps({
|
|
|
40765
40878
|
);
|
|
40766
40879
|
if (loading && steps.length === 0) return null;
|
|
40767
40880
|
if (steps.length === 0 && !error) return null;
|
|
40768
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
40881
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("flex flex-col gap-1.5", className), "data-testid": "inbox-checklist-steps", children: [
|
|
40769
40882
|
/* @__PURE__ */ jsxs121("h4", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
40770
40883
|
"Your checklist steps ",
|
|
40771
40884
|
/* @__PURE__ */ jsx134("span", { className: "tabular-nums", children: steps.length })
|
|
@@ -40815,7 +40928,7 @@ function ChecklistsPanel({ tableId, onOpenRecord, className }) {
|
|
|
40815
40928
|
useEffect92(() => {
|
|
40816
40929
|
void load();
|
|
40817
40930
|
}, [load]);
|
|
40818
|
-
if (templates === null) return /* @__PURE__ */ jsx134(Skeleton19, { className:
|
|
40931
|
+
if (templates === null) return /* @__PURE__ */ jsx134(Skeleton19, { className: cn68("h-40 w-full", className) });
|
|
40819
40932
|
if (editing) {
|
|
40820
40933
|
return /* @__PURE__ */ jsx134(
|
|
40821
40934
|
ChecklistTemplateEditor,
|
|
@@ -40831,12 +40944,12 @@ function ChecklistsPanel({ tableId, onOpenRecord, className }) {
|
|
|
40831
40944
|
);
|
|
40832
40945
|
}
|
|
40833
40946
|
if (openRun) {
|
|
40834
|
-
return /* @__PURE__ */ jsxs121("div", { className:
|
|
40947
|
+
return /* @__PURE__ */ jsxs121("div", { className: cn68("flex flex-col gap-2", className), children: [
|
|
40835
40948
|
/* @__PURE__ */ jsx134(Button82, { size: "sm", variant: "ghost", className: "self-start", onClick: () => setOpenRun(null), children: "Back to checklists" }),
|
|
40836
40949
|
/* @__PURE__ */ jsx134(ChecklistRunner, { tableId, runId: openRun, offerToStart: false })
|
|
40837
40950
|
] });
|
|
40838
40951
|
}
|
|
40839
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
40952
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("flex flex-col gap-3", className), "data-testid": "checklists-panel", children: [
|
|
40840
40953
|
/* @__PURE__ */ jsxs121("header", { className: "flex items-center gap-2", children: [
|
|
40841
40954
|
/* @__PURE__ */ jsx134("h3", { className: "text-sm font-medium", children: "Checklists" }),
|
|
40842
40955
|
/* @__PURE__ */ jsx134("span", { className: "text-xs text-muted-foreground", children: templates.length === 0 ? "none yet" : `${templates.length}` }),
|
|
@@ -41049,8 +41162,8 @@ function ChecklistTemplateEditor({
|
|
|
41049
41162
|
onDone?.();
|
|
41050
41163
|
}, [client, onDone, onSaved, spec, savedId]);
|
|
41051
41164
|
const change = (index, patch) => setRows((held) => held.map((row, i) => i === index ? { ...row, ...patch } : row));
|
|
41052
|
-
if (loading) return /* @__PURE__ */ jsx134(Skeleton19, { className:
|
|
41053
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
41165
|
+
if (loading) return /* @__PURE__ */ jsx134(Skeleton19, { className: cn68("h-48 w-full", className) });
|
|
41166
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("flex flex-col gap-2", className), "data-testid": "checklist-editor", children: [
|
|
41054
41167
|
/* @__PURE__ */ jsxs121("header", { className: "flex items-center gap-2", children: [
|
|
41055
41168
|
/* @__PURE__ */ jsx134("h3", { className: "text-sm font-medium", children: templateId ? "Change this checklist" : "Write a checklist" }),
|
|
41056
41169
|
/* @__PURE__ */ jsx134(Button82, { size: "sm", variant: "ghost", className: "ml-auto", onClick: () => onDone?.(), children: "Cancel" })
|
|
@@ -41689,7 +41802,7 @@ function ActionInbox({
|
|
|
41689
41802
|
}
|
|
41690
41803
|
},
|
|
41691
41804
|
"data-selected": selected.has(item.item_id) ? "true" : void 0,
|
|
41692
|
-
className:
|
|
41805
|
+
className: cn69(
|
|
41693
41806
|
"flex flex-col gap-1 rounded border p-2",
|
|
41694
41807
|
index === cursor ? "border-primary bg-accent/40" : "border-border",
|
|
41695
41808
|
selected.has(item.item_id) ? "bg-primary/10" : "",
|
|
@@ -41716,7 +41829,7 @@ function ActionInbox({
|
|
|
41716
41829
|
item.due_state ? /* @__PURE__ */ jsx135(
|
|
41717
41830
|
"span",
|
|
41718
41831
|
{
|
|
41719
|
-
className:
|
|
41832
|
+
className: cn69(
|
|
41720
41833
|
"shrink-0 text-[11px]",
|
|
41721
41834
|
item.due_state === "overdue" ? "text-destructive" : "text-muted-foreground"
|
|
41722
41835
|
),
|
|
@@ -41840,11 +41953,11 @@ function ActionInbox({
|
|
|
41840
41953
|
item.item_id
|
|
41841
41954
|
);
|
|
41842
41955
|
};
|
|
41843
|
-
if (items === null) return /* @__PURE__ */ jsx135(Skeleton20, { className:
|
|
41956
|
+
if (items === null) return /* @__PURE__ */ jsx135(Skeleton20, { className: cn69("h-32 w-full", className) });
|
|
41844
41957
|
return /* @__PURE__ */ jsxs122(
|
|
41845
41958
|
"section",
|
|
41846
41959
|
{
|
|
41847
|
-
className:
|
|
41960
|
+
className: cn69("@container flex min-h-0 flex-col gap-2 outline-none", className),
|
|
41848
41961
|
tabIndex: 0,
|
|
41849
41962
|
onKeyDown,
|
|
41850
41963
|
"aria-label": "Inbox",
|
|
@@ -41865,7 +41978,7 @@ function ActionInbox({
|
|
|
41865
41978
|
setSelected(/* @__PURE__ */ new Set());
|
|
41866
41979
|
setSnoozing(null);
|
|
41867
41980
|
},
|
|
41868
|
-
className:
|
|
41981
|
+
className: cn69(
|
|
41869
41982
|
"flex items-baseline gap-1 whitespace-nowrap rounded px-1.5 py-0.5 text-xs",
|
|
41870
41983
|
view === v ? "bg-accent font-medium text-foreground" : "text-muted-foreground"
|
|
41871
41984
|
),
|
|
@@ -41890,7 +42003,7 @@ function ActionInbox({
|
|
|
41890
42003
|
type: "button",
|
|
41891
42004
|
"aria-pressed": groupBy === g,
|
|
41892
42005
|
onClick: () => setGroupBy(g),
|
|
41893
|
-
className:
|
|
42006
|
+
className: cn69(
|
|
41894
42007
|
"whitespace-nowrap rounded px-1.5 py-0.5 text-[11px]",
|
|
41895
42008
|
groupBy === g ? "bg-accent font-medium text-foreground" : "text-muted-foreground"
|
|
41896
42009
|
),
|
|
@@ -42072,14 +42185,14 @@ import {
|
|
|
42072
42185
|
useRecordsClient as useRecordsClient80,
|
|
42073
42186
|
useTable as useTable25
|
|
42074
42187
|
} from "@ai-matrx/records/react";
|
|
42075
|
-
import { Badge as Badge19, Button as Button86, Skeleton as Skeleton22, cn as
|
|
42188
|
+
import { Badge as Badge19, Button as Button86, Skeleton as Skeleton22, cn as cn72 } from "@ai-matrx/design-system";
|
|
42076
42189
|
import { formatRelativeTime as formatRelativeTime3 } from "@ai-matrx/kit/format";
|
|
42077
42190
|
|
|
42078
42191
|
// src/AsOfReading.tsx
|
|
42079
42192
|
import { useEffect as useEffect94, useMemo as useMemo65, useState as useState113 } from "react";
|
|
42080
42193
|
import { readTypedDate as readTypedDate3, typedDateText as typedDateText3 } from "@ai-matrx/records";
|
|
42081
42194
|
import { useRecordsClient as useRecordsClient78 } from "@ai-matrx/records/react";
|
|
42082
|
-
import { Button as Button84, Skeleton as Skeleton21, cn as
|
|
42195
|
+
import { Button as Button84, Skeleton as Skeleton21, cn as cn70 } from "@ai-matrx/design-system";
|
|
42083
42196
|
import { Button as ControlButton2, Field as ControlField } from "@ai-matrx/design-system/controls";
|
|
42084
42197
|
import { humanizeIdentifier as humanizeIdentifier16 } from "@ai-matrx/kit/text-case";
|
|
42085
42198
|
import { Fragment as Fragment53, jsx as jsx136, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
@@ -42119,7 +42232,7 @@ function AsOfControl({ value, onChange, className }) {
|
|
|
42119
42232
|
setText(typedDateText3(read.day));
|
|
42120
42233
|
onChange({ day: read.day, clock });
|
|
42121
42234
|
}
|
|
42122
|
-
return /* @__PURE__ */ jsxs123("div", { className:
|
|
42235
|
+
return /* @__PURE__ */ jsxs123("div", { className: cn70("flex h-6 items-center gap-1", className), "data-records-as-of": "", children: [
|
|
42123
42236
|
/* @__PURE__ */ jsx136(
|
|
42124
42237
|
ControlField,
|
|
42125
42238
|
{
|
|
@@ -42168,7 +42281,7 @@ function AsOfControl({ value, onChange, className }) {
|
|
|
42168
42281
|
{
|
|
42169
42282
|
size: "sm",
|
|
42170
42283
|
variant: "ghost",
|
|
42171
|
-
className:
|
|
42284
|
+
className: cn70("h-6 whitespace-nowrap px-1.5 text-[11px]", !value && "invisible"),
|
|
42172
42285
|
"aria-hidden": !value,
|
|
42173
42286
|
tabIndex: value ? 0 : -1,
|
|
42174
42287
|
onClick: () => {
|
|
@@ -42214,18 +42327,18 @@ function AsOfReading({
|
|
|
42214
42327
|
};
|
|
42215
42328
|
}, [client, key]);
|
|
42216
42329
|
const rows = useMemo65(() => answer && "doc" in answer && answer.doc ? asOfRows(fields, answer.doc, today) : [], [answer, fields, today]);
|
|
42217
|
-
const box =
|
|
42330
|
+
const box = cn70("h-[9.25rem] min-h-0 overflow-y-auto rounded border", className);
|
|
42218
42331
|
if (!answer || answer.key !== key) return /* @__PURE__ */ jsx136(Skeleton21, { shape: "block", className: box });
|
|
42219
42332
|
if ("error" in answer) return /* @__PURE__ */ jsx136(RefusalNotice, { error: answer.error, className });
|
|
42220
42333
|
if (answer.doc === null) {
|
|
42221
|
-
return /* @__PURE__ */ jsxs123("p", { className:
|
|
42334
|
+
return /* @__PURE__ */ jsxs123("p", { className: cn70(box, "p-2 text-xs text-muted-foreground"), "data-records-as-of-none": "", children: [
|
|
42222
42335
|
"Not there on ",
|
|
42223
42336
|
typedDateText3(asOf.day)
|
|
42224
42337
|
] });
|
|
42225
42338
|
}
|
|
42226
|
-
return /* @__PURE__ */ jsx136("dl", { className:
|
|
42339
|
+
return /* @__PURE__ */ jsx136("dl", { className: cn70(box, "grid grid-cols-[minmax(5rem,9rem)_1fr] content-start gap-x-3 gap-y-0.5 p-2 text-[11px]"), "data-records-as-of-reading": "", children: rows.map(({ field: field2, was, now, differs }) => /* @__PURE__ */ jsxs123("div", { className: "contents", "data-as-of-field": field2.key, "data-as-of-differs": differs ? "" : void 0, children: [
|
|
42227
42340
|
/* @__PURE__ */ jsx136("dt", { className: "truncate text-muted-foreground", title: fieldName(field2) || humanizeIdentifier16(field2.key), children: fieldName(field2) || humanizeIdentifier16(field2.key) }),
|
|
42228
|
-
/* @__PURE__ */ jsx136("dd", { className:
|
|
42341
|
+
/* @__PURE__ */ jsx136("dd", { className: cn70("min-w-0 truncate", differs && "rounded bg-amber-500/10 px-1"), children: differs ? /* @__PURE__ */ jsxs123(Fragment53, { children: [
|
|
42229
42342
|
/* @__PURE__ */ jsx136("span", { className: "font-medium", children: isEmpty2(was) ? "nothing" : scalarText(field2, was) }),
|
|
42230
42343
|
/* @__PURE__ */ jsx136("span", { className: "mx-1 text-muted-foreground", children: "\u2192" }),
|
|
42231
42344
|
/* @__PURE__ */ jsx136("span", { className: "text-muted-foreground", children: isEmpty2(now) ? "nothing" : scalarText(field2, now) }),
|
|
@@ -42240,7 +42353,7 @@ import { humanizeIdentifier as humanizeIdentifier18 } from "@ai-matrx/kit/text-c
|
|
|
42240
42353
|
// src/MigrationLog.tsx
|
|
42241
42354
|
import { useCallback as useCallback46, useEffect as useEffect95, useState as useState114 } from "react";
|
|
42242
42355
|
import { useRecordsClient as useRecordsClient79 } from "@ai-matrx/records/react";
|
|
42243
|
-
import { Button as Button85, cn as
|
|
42356
|
+
import { Button as Button85, cn as cn71 } from "@ai-matrx/design-system";
|
|
42244
42357
|
import { humanizeIdentifier as humanizeIdentifier17 } from "@ai-matrx/kit/text-case";
|
|
42245
42358
|
import { jsx as jsx137, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
42246
42359
|
var MAKES_A_RECORD = /* @__PURE__ */ new Set(["split", "extract_parent", "extract"]);
|
|
@@ -42292,7 +42405,7 @@ function MigrationLog({ entries, readError, canUndo, whyNotUndo, onUndone, class
|
|
|
42292
42405
|
const [busy, setBusy] = useState114(null);
|
|
42293
42406
|
const [error, setError] = useState114(null);
|
|
42294
42407
|
if (readError) {
|
|
42295
|
-
return /* @__PURE__ */ jsxs124("section", { "aria-label": "Migration log", className:
|
|
42408
|
+
return /* @__PURE__ */ jsxs124("section", { "aria-label": "Migration log", className: cn71("flex flex-col gap-1", className), children: [
|
|
42296
42409
|
/* @__PURE__ */ jsx137("h4", { className: "text-xs font-medium", children: "Migration log" }),
|
|
42297
42410
|
/* @__PURE__ */ jsx137(RefusalLine, { error: readError })
|
|
42298
42411
|
] });
|
|
@@ -42310,7 +42423,7 @@ function MigrationLog({ entries, readError, canUndo, whyNotUndo, onUndone, class
|
|
|
42310
42423
|
const removed = back.data.removed ? " The record it made is archived, so no copy is left behind." : "";
|
|
42311
42424
|
await onUndone(`${migrationWords(entry.verb)} undone.${removed}`);
|
|
42312
42425
|
}
|
|
42313
|
-
return /* @__PURE__ */ jsxs124("section", { "aria-label": "Migration log", className:
|
|
42426
|
+
return /* @__PURE__ */ jsxs124("section", { "aria-label": "Migration log", className: cn71("flex flex-col gap-1", className), "data-records-migration-log": "", children: [
|
|
42314
42427
|
/* @__PURE__ */ jsx137("h4", { className: "text-xs font-medium", children: "Migration log" }),
|
|
42315
42428
|
/* @__PURE__ */ jsx137("ul", { className: "flex flex-col divide-y rounded border text-xs", children: entries.map((entry) => /* @__PURE__ */ jsxs124("li", { "data-migration-id": entry.id, className: "flex items-center gap-2 px-2 py-1.5", children: [
|
|
42316
42429
|
/* @__PURE__ */ jsx137("span", { className: "shrink-0 font-medium", children: migrationWords(entry.verb) }),
|
|
@@ -42439,7 +42552,7 @@ function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
|
|
|
42439
42552
|
);
|
|
42440
42553
|
await load();
|
|
42441
42554
|
}
|
|
42442
|
-
return /* @__PURE__ */ jsxs125("section", { className:
|
|
42555
|
+
return /* @__PURE__ */ jsxs125("section", { className: cn72("flex min-h-0 flex-col gap-2", className), children: [
|
|
42443
42556
|
/* @__PURE__ */ jsxs125("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
42444
42557
|
/* @__PURE__ */ jsx138("h3", { className: "text-sm font-medium", children: "History" }),
|
|
42445
42558
|
/* @__PURE__ */ jsxs125("span", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -42788,7 +42901,7 @@ import {
|
|
|
42788
42901
|
useRecordsClient as useRecordsClient81,
|
|
42789
42902
|
useTable as useTable26
|
|
42790
42903
|
} from "@ai-matrx/records/react";
|
|
42791
|
-
import { Badge as Badge20, Button as Button87, Skeleton as Skeleton23, Textarea as Textarea6, cn as
|
|
42904
|
+
import { Badge as Badge20, Button as Button87, Skeleton as Skeleton23, Textarea as Textarea6, cn as cn73 } from "@ai-matrx/design-system";
|
|
42792
42905
|
import { humanizeIdentifier as humanizeIdentifier19 } from "@ai-matrx/kit/text-case";
|
|
42793
42906
|
import { jsx as jsx139, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
42794
42907
|
function CommentThread({ tableId, recordId, fieldKey, className }) {
|
|
@@ -42889,7 +43002,7 @@ function CommentThread({ tableId, recordId, fieldKey, className }) {
|
|
|
42889
43002
|
}
|
|
42890
43003
|
await load();
|
|
42891
43004
|
}
|
|
42892
|
-
return /* @__PURE__ */ jsxs126("section", { className:
|
|
43005
|
+
return /* @__PURE__ */ jsxs126("section", { className: cn73("flex min-h-0 flex-col gap-2", className), children: [
|
|
42893
43006
|
/* @__PURE__ */ jsxs126("div", { className: "flex items-baseline gap-2", children: [
|
|
42894
43007
|
/* @__PURE__ */ jsx139("h3", { className: "text-sm font-medium", children: fieldLabel ? `Comments on ${fieldLabel}` : "Comments" }),
|
|
42895
43008
|
/* @__PURE__ */ jsx139("span", { className: "text-xs text-muted-foreground", children: shown5.length }),
|
|
@@ -43032,7 +43145,7 @@ import {
|
|
|
43032
43145
|
useRecordsClient as useRecordsClient82,
|
|
43033
43146
|
useTable as useTable27
|
|
43034
43147
|
} from "@ai-matrx/records/react";
|
|
43035
|
-
import { Badge as Badge21, Button as Button88, Skeleton as Skeleton24, cn as
|
|
43148
|
+
import { Badge as Badge21, Button as Button88, Skeleton as Skeleton24, cn as cn74 } from "@ai-matrx/design-system";
|
|
43036
43149
|
import { humanizeIdentifier as humanizeIdentifier20 } from "@ai-matrx/kit/text-case";
|
|
43037
43150
|
import { Fragment as Fragment55, jsx as jsx140, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
43038
43151
|
function FieldHistoryPanel({
|
|
@@ -43068,7 +43181,7 @@ function FieldHistoryPanel({
|
|
|
43068
43181
|
}, [load]);
|
|
43069
43182
|
const label = (fields.data ?? []).find((f) => f.key === fieldKey)?.label || humanizeIdentifier20(fieldKey);
|
|
43070
43183
|
if (error) return /* @__PURE__ */ jsx140(RefusalNotice, { error, className });
|
|
43071
|
-
if (!rows || fields.loading && !fields.data || table.loading && !table.data) return /* @__PURE__ */ jsx140(Skeleton24, { className:
|
|
43184
|
+
if (!rows || fields.loading && !fields.data || table.loading && !table.data) return /* @__PURE__ */ jsx140(Skeleton24, { className: cn74("h-40 w-full", className) });
|
|
43072
43185
|
async function start(row, back = false) {
|
|
43073
43186
|
setSaid(null);
|
|
43074
43187
|
const target = back ? row.version - 1 : row.version;
|
|
@@ -43099,7 +43212,7 @@ function FieldHistoryPanel({
|
|
|
43099
43212
|
);
|
|
43100
43213
|
await load();
|
|
43101
43214
|
}
|
|
43102
|
-
return /* @__PURE__ */ jsxs127("section", { className:
|
|
43215
|
+
return /* @__PURE__ */ jsxs127("section", { className: cn74("flex min-h-0 flex-col gap-2", className), children: [
|
|
43103
43216
|
/* @__PURE__ */ jsxs127("div", { className: "flex items-baseline gap-2", children: [
|
|
43104
43217
|
/* @__PURE__ */ jsxs127("h3", { className: "text-sm font-medium", children: [
|
|
43105
43218
|
"Who changed ",
|
|
@@ -43200,7 +43313,7 @@ import { FORM_FLOWS as FORM_FLOWS2, FORM_EMBEDS as FORM_EMBEDS2, formDeclareArgs
|
|
|
43200
43313
|
// src/FormResultsPanel.tsx
|
|
43201
43314
|
import { useEffect as useEffect99, useMemo as useMemo67, useState as useState118 } from "react";
|
|
43202
43315
|
import { useFields as useFields26, useOptionalRecordsClient as useOptionalRecordsClient19 } from "@ai-matrx/records/react";
|
|
43203
|
-
import { Button as Button89, Skeleton as Skeleton25, cn as
|
|
43316
|
+
import { Button as Button89, Skeleton as Skeleton25, cn as cn75 } from "@ai-matrx/design-system";
|
|
43204
43317
|
import { jsx as jsx141, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
43205
43318
|
var CHARTED_KINDS = /* @__PURE__ */ new Set(["select", "multi_select", "checkbox", "number", "currency", "percent", "member", "relation"]);
|
|
43206
43319
|
function dropOffBlock(results, label) {
|
|
@@ -43257,9 +43370,9 @@ function FormResultsPanel({ form, className }) {
|
|
|
43257
43370
|
return (key) => asks.get(key)?.trim() || (byKey.get(key) ? fieldName(byKey.get(key)) : key);
|
|
43258
43371
|
}, [fields.data, form.questions]);
|
|
43259
43372
|
if (error) return /* @__PURE__ */ jsx141(RefusalNotice, { error, className });
|
|
43260
|
-
if (!results) return /* @__PURE__ */ jsx141(Skeleton25, { className:
|
|
43373
|
+
if (!results) return /* @__PURE__ */ jsx141(Skeleton25, { className: cn75("h-48 w-full", className) });
|
|
43261
43374
|
const endingTitle = (id) => id ? (form.endings ?? []).find((e) => e.id === id)?.title ?? id : form.thankYou?.title ?? "Thank you";
|
|
43262
|
-
return /* @__PURE__ */ jsxs128("section", { className:
|
|
43375
|
+
return /* @__PURE__ */ jsxs128("section", { className: cn75("flex flex-col gap-3", className), "aria-label": "Results", "data-records-form-results": "", children: [
|
|
43263
43376
|
/* @__PURE__ */ jsxs128("div", { className: "flex items-center gap-2", children: [
|
|
43264
43377
|
/* @__PURE__ */ jsx141("span", { className: "text-sm font-medium", children: "Results" }),
|
|
43265
43378
|
/* @__PURE__ */ jsx141(Button89, { size: "sm", variant: "ghost", className: "ml-auto", onClick: () => setRound((n) => n + 1), children: "Refresh" })
|
|
@@ -43327,7 +43440,7 @@ function FormResultsPanel({ form, className }) {
|
|
|
43327
43440
|
// src/PortalBuilder.tsx
|
|
43328
43441
|
import { useCallback as useCallback50, useEffect as useEffect100, useMemo as useMemo68, useRef as useRef57, useState as useState119 } from "react";
|
|
43329
43442
|
import { useRecordsClient as useRecordsClient83, useTables as useTables4 } from "@ai-matrx/records/react";
|
|
43330
|
-
import { BasicInput as BasicInput23, Button as Button90, Checkbox as Checkbox14, Label as Label20, Separator as Separator10, Skeleton as Skeleton26, cn as
|
|
43443
|
+
import { BasicInput as BasicInput23, Button as Button90, Checkbox as Checkbox14, Label as Label20, Separator as Separator10, Skeleton as Skeleton26, cn as cn76 } from "@ai-matrx/design-system";
|
|
43331
43444
|
import { Select as Select21 } from "@ai-matrx/design-system/controls";
|
|
43332
43445
|
import { Fragment as Fragment56, jsx as jsx142, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
43333
43446
|
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.";
|
|
@@ -43505,7 +43618,7 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
|
43505
43618
|
setInviteEmail("");
|
|
43506
43619
|
setInviteRecordId("");
|
|
43507
43620
|
}
|
|
43508
|
-
if (tables.loading || loading) return /* @__PURE__ */ jsx142(Skeleton26, { className:
|
|
43621
|
+
if (tables.loading || loading) return /* @__PURE__ */ jsx142(Skeleton26, { className: cn76("h-64 w-full", className) });
|
|
43509
43622
|
const all = tablePickerEntries(tables.data ?? []).entries.map((e) => e.table);
|
|
43510
43623
|
const missingTie = ticked.filter((e) => e.namesVia.trim() === "");
|
|
43511
43624
|
const ready = clientTableId !== null && ticked.length > 0 && missingTie.length === 0;
|
|
@@ -43513,7 +43626,7 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
|
|
|
43513
43626
|
const missingTieName = firstMissing ? all.find((t) => t.id === firstMissing.tableId)?.name : void 0;
|
|
43514
43627
|
const missingHasNoLink = firstMissing ? tiesTo(firstMissing.tableId).length === 0 : false;
|
|
43515
43628
|
const notReady = clientTableId === null ? "Pick the table that holds your clients" : ticked.length === 0 ? "Tick a table your clients can see" : missingTieName ? (missingHasNoLink ? `Add a link to your clients on ${missingTieName}` : `Pick whose row it is on ${missingTieName}`).slice(0, 60) : null;
|
|
43516
|
-
return /* @__PURE__ */ jsxs129("section", { className:
|
|
43629
|
+
return /* @__PURE__ */ jsxs129("section", { className: cn76("@container flex flex-col gap-3", className), children: [
|
|
43517
43630
|
/* @__PURE__ */ jsxs129("header", { className: "flex items-center gap-2", children: [
|
|
43518
43631
|
/* @__PURE__ */ jsx142("h3", { className: "text-sm font-medium", children: existing ? "Portal" : "New client portal" }),
|
|
43519
43632
|
/* @__PURE__ */ jsx142("div", { className: "flex-1" }),
|
|
@@ -43726,20 +43839,20 @@ import {
|
|
|
43726
43839
|
portalPath,
|
|
43727
43840
|
portalTitleTypedBack as portalTitleTypedBack2
|
|
43728
43841
|
} from "@ai-matrx/records";
|
|
43729
|
-
import { Badge as Badge22, BasicInput as BasicInput25, Button as Button92, Separator as Separator11, Skeleton as Skeleton27, cn as
|
|
43842
|
+
import { Badge as Badge22, BasicInput as BasicInput25, Button as Button92, Separator as Separator11, Skeleton as Skeleton27, cn as cn79 } from "@ai-matrx/design-system";
|
|
43730
43843
|
|
|
43731
43844
|
// src/PortalLookEditor.tsx
|
|
43732
43845
|
import { useEffect as useEffect101, useMemo as useMemo69, useState as useState120 } from "react";
|
|
43733
43846
|
import { useRecordsClient as useRecordsClient84 } from "@ai-matrx/records/react";
|
|
43734
|
-
import { BasicInput as BasicInput24, Button as Button91, cn as
|
|
43847
|
+
import { BasicInput as BasicInput24, Button as Button91, cn as cn78 } from "@ai-matrx/design-system";
|
|
43735
43848
|
|
|
43736
43849
|
// src/PublicPicturePicker.tsx
|
|
43737
|
-
import { cn as
|
|
43850
|
+
import { cn as cn77 } from "@ai-matrx/design-system";
|
|
43738
43851
|
import { jsx as jsx143, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
43739
43852
|
function PublicPicturePicker({ label, pictures, value, onChange, noneLabel, className }) {
|
|
43740
43853
|
const chosen = value ?? "";
|
|
43741
43854
|
const lost = chosen !== "" && !pictures.some((p) => p.file_id === chosen);
|
|
43742
|
-
return /* @__PURE__ */ jsxs130("div", { className:
|
|
43855
|
+
return /* @__PURE__ */ jsxs130("div", { className: cn77("flex flex-col gap-1", className), children: [
|
|
43743
43856
|
/* @__PURE__ */ jsxs130("div", { className: "flex max-h-40 flex-wrap gap-1.5 overflow-y-auto", role: "radiogroup", "aria-label": label, children: [
|
|
43744
43857
|
/* @__PURE__ */ jsx143(
|
|
43745
43858
|
"button",
|
|
@@ -43748,7 +43861,7 @@ function PublicPicturePicker({ label, pictures, value, onChange, noneLabel, clas
|
|
|
43748
43861
|
role: "radio",
|
|
43749
43862
|
"aria-checked": chosen === "" || lost,
|
|
43750
43863
|
onClick: () => onChange(""),
|
|
43751
|
-
className:
|
|
43864
|
+
className: cn77(
|
|
43752
43865
|
"h-12 rounded border px-2 text-xs",
|
|
43753
43866
|
chosen === "" ? "border-foreground" : "border-border text-muted-foreground"
|
|
43754
43867
|
),
|
|
@@ -43764,7 +43877,7 @@ function PublicPicturePicker({ label, pictures, value, onChange, noneLabel, clas
|
|
|
43764
43877
|
"aria-label": p.name,
|
|
43765
43878
|
title: p.name,
|
|
43766
43879
|
onClick: () => onChange(p.file_id),
|
|
43767
|
-
className:
|
|
43880
|
+
className: cn77(
|
|
43768
43881
|
"h-12 w-12 overflow-hidden rounded border-2 bg-muted",
|
|
43769
43882
|
chosen === p.file_id ? "border-foreground" : "border-transparent"
|
|
43770
43883
|
),
|
|
@@ -43889,7 +44002,7 @@ function PortalLookEditor({ card, onSaved, className }) {
|
|
|
43889
44002
|
setSaid("Saved. Clients see this the next time a portal page opens.");
|
|
43890
44003
|
onSaved();
|
|
43891
44004
|
}
|
|
43892
|
-
return /* @__PURE__ */ jsxs131("section", { className:
|
|
44005
|
+
return /* @__PURE__ */ jsxs131("section", { className: cn78("flex flex-col gap-2", className), "aria-label": "Look and forms", children: [
|
|
43893
44006
|
/* @__PURE__ */ jsx144("h4", { className: "text-xs font-medium", children: "How the portal looks" }),
|
|
43894
44007
|
/* @__PURE__ */ jsxs131("label", { className: "flex flex-col gap-1 text-xs", children: [
|
|
43895
44008
|
/* @__PURE__ */ jsx144("span", { children: "Business name clients see" }),
|
|
@@ -44088,7 +44201,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
|
|
|
44088
44201
|
useEffect102(() => {
|
|
44089
44202
|
void load();
|
|
44090
44203
|
}, [load]);
|
|
44091
|
-
if (portals === null) return /* @__PURE__ */ jsx145(Skeleton27, { className:
|
|
44204
|
+
if (portals === null) return /* @__PURE__ */ jsx145(Skeleton27, { className: cn79("h-32 w-full", className) });
|
|
44092
44205
|
const onATable = Boolean(tableId);
|
|
44093
44206
|
const holdingThis = new Set(
|
|
44094
44207
|
exposures.filter((e) => e.table_id === tableId).map((e) => e.portal_id)
|
|
@@ -44097,7 +44210,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
|
|
|
44097
44210
|
const couldTakeIt = onATable ? portals.filter((p) => !holdingThis.has(p.portal_id)) : [];
|
|
44098
44211
|
const elsewhere = couldTakeIt.length;
|
|
44099
44212
|
const origin = host.publicOrigin ?? (typeof window === "undefined" ? "" : window.location.origin);
|
|
44100
|
-
return /* @__PURE__ */ jsxs132("section", { className:
|
|
44213
|
+
return /* @__PURE__ */ jsxs132("section", { className: cn79("flex flex-col gap-3", className), children: [
|
|
44101
44214
|
/* @__PURE__ */ jsxs132("header", { className: "flex items-center gap-2", children: [
|
|
44102
44215
|
/* @__PURE__ */ jsx145("h3", { className: "text-sm font-medium", children: "Portals" }),
|
|
44103
44216
|
/* @__PURE__ */ jsx145("span", { className: "text-xs text-muted-foreground", children: shown5.length === 0 ? "none for this table" : `${shown5.length}` }),
|
|
@@ -44176,7 +44289,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
|
|
|
44176
44289
|
{
|
|
44177
44290
|
"data-linked": linked ? "true" : void 0,
|
|
44178
44291
|
ref: linked ? (el) => el?.scrollIntoView({ block: "nearest" }) : void 0,
|
|
44179
|
-
className:
|
|
44292
|
+
className: cn79(
|
|
44180
44293
|
"rounded-md border border-border bg-card p-2.5",
|
|
44181
44294
|
linked && "border-primary ring-1 ring-primary"
|
|
44182
44295
|
),
|
|
@@ -44431,7 +44544,7 @@ function PortalCardView({
|
|
|
44431
44544
|
origin,
|
|
44432
44545
|
className
|
|
44433
44546
|
}) {
|
|
44434
|
-
return /* @__PURE__ */ jsxs132("div", { className:
|
|
44547
|
+
return /* @__PURE__ */ jsxs132("div", { className: cn79("mt-2.5 flex flex-col gap-2.5 border-t border-border pt-2.5", className), children: [
|
|
44435
44548
|
card.external_lane_open ? null : /* @__PURE__ */ jsx145("p", { className: "rounded border border-destructive/40 px-2 py-1.5 text-xs text-destructive", children: "This organization's outside door is closed, so nobody in this portal can sign in yet \u2014 whatever their row below says. Re-stating the portal opens it." }),
|
|
44436
44549
|
/* @__PURE__ */ jsxs132("section", { className: "flex flex-col gap-1.5", children: [
|
|
44437
44550
|
/* @__PURE__ */ jsx145("h4", { className: "text-xs font-medium", children: "What they see" }),
|
|
@@ -44716,7 +44829,7 @@ function Invite({ card, onInvited }) {
|
|
|
44716
44829
|
}
|
|
44717
44830
|
|
|
44718
44831
|
// src/FormLookFrame.tsx
|
|
44719
|
-
import { cn as
|
|
44832
|
+
import { cn as cn80 } from "@ai-matrx/design-system";
|
|
44720
44833
|
import { SWATCH_CLASS as SWATCH_CLASS5 } from "@ai-matrx/design-system/data-table";
|
|
44721
44834
|
import { jsx as jsx146, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
44722
44835
|
var ACCENT_PRIMARY = {
|
|
@@ -44771,7 +44884,7 @@ function FormLookLogo({ view, size = "md" }) {
|
|
|
44771
44884
|
width: size === "sm" ? 36 : 48,
|
|
44772
44885
|
height: size === "sm" ? 36 : 48,
|
|
44773
44886
|
"data-records-form-logo": "",
|
|
44774
|
-
className:
|
|
44887
|
+
className: cn80(box, "shrink-0 rounded-lg border border-border bg-card object-contain")
|
|
44775
44888
|
}
|
|
44776
44889
|
);
|
|
44777
44890
|
}
|
|
@@ -44780,7 +44893,7 @@ function FormLookLogo({ view, size = "md" }) {
|
|
|
44780
44893
|
{
|
|
44781
44894
|
"aria-hidden": true,
|
|
44782
44895
|
"data-records-form-logo": "",
|
|
44783
|
-
className:
|
|
44896
|
+
className: cn80(box, "inline-flex shrink-0 items-center justify-center rounded-lg font-semibold", view.monogramClass),
|
|
44784
44897
|
children: monogram(view.name)
|
|
44785
44898
|
}
|
|
44786
44899
|
);
|
|
@@ -44791,14 +44904,14 @@ function FormLookFrame({ look, title, children, contained = false, showOwnerHead
|
|
|
44791
44904
|
"div",
|
|
44792
44905
|
{
|
|
44793
44906
|
"data-records-form-look": "",
|
|
44794
|
-
className:
|
|
44907
|
+
className: cn80("relative flex w-full flex-col gap-4", contained && "pt-2", className),
|
|
44795
44908
|
style: view.primaryVars ?? void 0,
|
|
44796
44909
|
children: [
|
|
44797
44910
|
view.bandClass ? /* @__PURE__ */ jsx146(
|
|
44798
44911
|
"div",
|
|
44799
44912
|
{
|
|
44800
44913
|
"aria-hidden": true,
|
|
44801
|
-
className:
|
|
44914
|
+
className: cn80(contained ? "absolute inset-x-0 top-0 h-1 rounded-t" : "fixed inset-x-0 top-0 z-10 h-1", view.bandClass)
|
|
44802
44915
|
}
|
|
44803
44916
|
) : null,
|
|
44804
44917
|
view.coverUrl ? /* @__PURE__ */ jsx146("div", { "data-records-form-cover": "", className: "aspect-[3/1] w-full overflow-hidden rounded-xl border border-border bg-muted", children: /* @__PURE__ */ jsx146("img", { src: view.coverUrl, alt: "", className: "h-full w-full object-cover" }) }) : null,
|
|
@@ -44828,7 +44941,7 @@ function FormLookFrame({ look, title, children, contained = false, showOwnerHead
|
|
|
44828
44941
|
import { useCallback as useCallback52, useEffect as useEffect103, useMemo as useMemo71, useState as useState122 } from "react";
|
|
44829
44942
|
import { useRecordsClient as useRecordsClient86, useTable as useTable28 } from "@ai-matrx/records/react";
|
|
44830
44943
|
import { hasQuietHours } from "@ai-matrx/records";
|
|
44831
|
-
import { BasicInput as BasicInput26, Button as Button93, Checkbox as Checkbox15, Label as Label21, Separator as Separator12, Skeleton as Skeleton28, cn as
|
|
44944
|
+
import { BasicInput as BasicInput26, Button as Button93, Checkbox as Checkbox15, Label as Label21, Separator as Separator12, Skeleton as Skeleton28, cn as cn81 } from "@ai-matrx/design-system";
|
|
44832
44945
|
import { Select as Select22 } from "@ai-matrx/design-system/controls";
|
|
44833
44946
|
|
|
44834
44947
|
// src/scheduleWords.ts
|
|
@@ -45011,8 +45124,8 @@ function DigestScheduler({
|
|
|
45011
45124
|
}
|
|
45012
45125
|
setPreview(answered.data);
|
|
45013
45126
|
}
|
|
45014
|
-
if (views === null && !error) return /* @__PURE__ */ jsx147(Skeleton28, { className:
|
|
45015
|
-
return /* @__PURE__ */ jsxs134("section", { className:
|
|
45127
|
+
if (views === null && !error) return /* @__PURE__ */ jsx147(Skeleton28, { className: cn81("h-56 w-full", className) });
|
|
45128
|
+
return /* @__PURE__ */ jsxs134("section", { className: cn81("@container flex flex-col gap-3", className), children: [
|
|
45016
45129
|
/* @__PURE__ */ jsxs134("header", { className: "flex items-center gap-2", children: [
|
|
45017
45130
|
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-medium", children: existing ? "Change this summary" : "Send this on a schedule" }),
|
|
45018
45131
|
/* @__PURE__ */ jsx147("div", { className: "flex-1" }),
|
|
@@ -45204,12 +45317,12 @@ function DigestScheduler({
|
|
|
45204
45317
|
import { useCallback as useCallback54, useEffect as useEffect105, useState as useState124 } from "react";
|
|
45205
45318
|
import { useRecordsClient as useRecordsClient88 } from "@ai-matrx/records/react";
|
|
45206
45319
|
import { hasQuietHours as hasQuietHours2 } from "@ai-matrx/records";
|
|
45207
|
-
import { Badge as Badge23, Button as Button95, Skeleton as Skeleton30, Switch as Switch6, cn as
|
|
45320
|
+
import { Badge as Badge23, Button as Button95, Skeleton as Skeleton30, Switch as Switch6, cn as cn83 } from "@ai-matrx/design-system";
|
|
45208
45321
|
|
|
45209
45322
|
// src/WebhooksPanel.tsx
|
|
45210
45323
|
import { useCallback as useCallback53, useEffect as useEffect104, useState as useState123 } from "react";
|
|
45211
45324
|
import { useRecordsClient as useRecordsClient87, useTable as useTable29 } from "@ai-matrx/records/react";
|
|
45212
|
-
import { BasicInput as BasicInput27, Button as Button94, Checkbox as Checkbox16, ConfirmDialog as ConfirmDialog7, Label as Label22, Skeleton as Skeleton29, cn as
|
|
45325
|
+
import { BasicInput as BasicInput27, Button as Button94, Checkbox as Checkbox16, ConfirmDialog as ConfirmDialog7, Label as Label22, Skeleton as Skeleton29, cn as cn82 } from "@ai-matrx/design-system";
|
|
45213
45326
|
import { jsx as jsx148, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
45214
45327
|
var WEBHOOK_EVENT_LABEL = {
|
|
45215
45328
|
"record.created": "A record is added",
|
|
@@ -45277,10 +45390,10 @@ function WebhooksPanel({ tableId, className }) {
|
|
|
45277
45390
|
setEvents(DEFAULT_EVENTS);
|
|
45278
45391
|
await load();
|
|
45279
45392
|
};
|
|
45280
|
-
if (hooks === null) return /* @__PURE__ */ jsx148(Skeleton29, { className:
|
|
45393
|
+
if (hooks === null) return /* @__PURE__ */ jsx148(Skeleton29, { className: cn82("h-16 w-full", className) });
|
|
45281
45394
|
const notHers = readRefused?.sqlstate === "42501" && rights.known && !rights.structure;
|
|
45282
45395
|
if (notHers) {
|
|
45283
|
-
return /* @__PURE__ */ jsxs135("section", { "data-records-webhooks": "", className:
|
|
45396
|
+
return /* @__PURE__ */ jsxs135("section", { "data-records-webhooks": "", className: cn82("flex flex-col gap-2 border-t pt-3", className), children: [
|
|
45284
45397
|
/* @__PURE__ */ jsx148("header", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx148("h3", { className: "text-sm font-medium", children: "Webhooks" }) }),
|
|
45285
45398
|
/* @__PURE__ */ jsxs135("p", { className: "text-xs text-muted-foreground", children: [
|
|
45286
45399
|
"Which other systems are told about these records is for this table's admins.",
|
|
@@ -45291,7 +45404,7 @@ function WebhooksPanel({ tableId, className }) {
|
|
|
45291
45404
|
}
|
|
45292
45405
|
const mayChange = rights.structure;
|
|
45293
45406
|
const live = hooks.filter((h) => h.is_active);
|
|
45294
|
-
return /* @__PURE__ */ jsxs135("section", { "data-records-webhooks": "", className:
|
|
45407
|
+
return /* @__PURE__ */ jsxs135("section", { "data-records-webhooks": "", className: cn82("flex flex-col gap-2 border-t pt-3", className), children: [
|
|
45295
45408
|
/* @__PURE__ */ jsxs135("header", { className: "flex items-center gap-2", children: [
|
|
45296
45409
|
/* @__PURE__ */ jsx148("h3", { className: "text-sm font-medium", children: "Webhooks" }),
|
|
45297
45410
|
/* @__PURE__ */ jsx148("span", { className: "text-xs text-muted-foreground", children: live.length === 0 ? "none" : `${live.length} sending` }),
|
|
@@ -45474,8 +45587,8 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
|
|
|
45474
45587
|
},
|
|
45475
45588
|
[client]
|
|
45476
45589
|
);
|
|
45477
|
-
if (rows === null) return /* @__PURE__ */ jsx149(Skeleton30, { className:
|
|
45478
|
-
return /* @__PURE__ */ jsxs136("section", { className:
|
|
45590
|
+
if (rows === null) return /* @__PURE__ */ jsx149(Skeleton30, { className: cn83("h-32 w-full", className) });
|
|
45591
|
+
return /* @__PURE__ */ jsxs136("section", { className: cn83("flex flex-col gap-3", className), children: [
|
|
45479
45592
|
/* @__PURE__ */ jsxs136("header", { className: "flex items-center gap-2", children: [
|
|
45480
45593
|
/* @__PURE__ */ jsx149("h3", { className: "text-sm font-medium", children: "Notifications" }),
|
|
45481
45594
|
/* @__PURE__ */ jsx149("span", { className: "text-xs text-muted-foreground", children: rows.length === 0 ? "none" : `${rows.filter((r) => !r.muted).length} on` }),
|
|
@@ -45532,7 +45645,7 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
|
|
|
45532
45645
|
{
|
|
45533
45646
|
"data-linked": subscription.rule_id === activeRuleId ? "true" : void 0,
|
|
45534
45647
|
ref: subscription.rule_id === activeRuleId ? (el) => el?.scrollIntoView({ block: "nearest" }) : void 0,
|
|
45535
|
-
className:
|
|
45648
|
+
className: cn83(
|
|
45536
45649
|
"rounded-md border p-2.5",
|
|
45537
45650
|
subscription.rule_id === activeRuleId && "border-primary ring-1 ring-primary"
|
|
45538
45651
|
),
|
|
@@ -45646,7 +45759,7 @@ import {
|
|
|
45646
45759
|
Checkbox as Checkbox17,
|
|
45647
45760
|
Label as Label25,
|
|
45648
45761
|
Skeleton as Skeleton32,
|
|
45649
|
-
cn as
|
|
45762
|
+
cn as cn85
|
|
45650
45763
|
} from "@ai-matrx/design-system";
|
|
45651
45764
|
|
|
45652
45765
|
// src/FormFlowEditor.tsx
|
|
@@ -45908,7 +46021,7 @@ function EmbedSnippets({ url, label }) {
|
|
|
45908
46021
|
// src/FormRunner.tsx
|
|
45909
46022
|
import { useCallback as useCallback55, useEffect as useEffect106, useMemo as useMemo72, useRef as useRef58, useState as useState126 } from "react";
|
|
45910
46023
|
import { useFields as useFields27, useOptionalRecordsClient as useOptionalRecordsClient20 } from "@ai-matrx/records/react";
|
|
45911
|
-
import { Button as Button97, Label as Label24, Progress, Skeleton as Skeleton31, cn as
|
|
46024
|
+
import { Button as Button97, Label as Label24, Progress, Skeleton as Skeleton31, cn as cn84, formThemeClasses } from "@ai-matrx/design-system";
|
|
45912
46025
|
import { answerRefusal, formRoutes, pipeAnswers, submissionStamp } from "@ai-matrx/records/forms";
|
|
45913
46026
|
import { humanizeIdentifier as humanizeIdentifier21 } from "@ai-matrx/kit/text-case";
|
|
45914
46027
|
import { Fragment as Fragment60, jsx as jsx151, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
@@ -45982,7 +46095,7 @@ function ConnectedFormRunner(props) {
|
|
|
45982
46095
|
[client, form.subject, form.questions, form.endings]
|
|
45983
46096
|
);
|
|
45984
46097
|
if (fields.error) return /* @__PURE__ */ jsx151(RefusalNotice, { error: fields.error, className });
|
|
45985
|
-
if (fields.loading && !fields.data) return /* @__PURE__ */ jsx151(Skeleton31, { className:
|
|
46098
|
+
if (fields.loading && !fields.data) return /* @__PURE__ */ jsx151(Skeleton31, { className: cn84("h-40 w-full", className) });
|
|
45986
46099
|
return /* @__PURE__ */ jsx151(
|
|
45987
46100
|
FormStage,
|
|
45988
46101
|
{
|
|
@@ -46307,7 +46420,7 @@ function FormStage({
|
|
|
46307
46420
|
ending: (form.endings ?? []).find((e) => e.id === ending) ?? null,
|
|
46308
46421
|
buttonClass: theme.buttonClass,
|
|
46309
46422
|
pipe,
|
|
46310
|
-
className:
|
|
46423
|
+
className: cn84("mx-auto max-w-xl py-10", centred && "text-center", className)
|
|
46311
46424
|
}
|
|
46312
46425
|
);
|
|
46313
46426
|
}
|
|
@@ -46318,7 +46431,7 @@ function FormStage({
|
|
|
46318
46431
|
return /* @__PURE__ */ jsxs138(
|
|
46319
46432
|
"section",
|
|
46320
46433
|
{
|
|
46321
|
-
className:
|
|
46434
|
+
className: cn84("mx-auto flex min-h-[min(70dvh,640px)] w-full max-w-2xl flex-col justify-center gap-4 py-8", theme.surface, theme.background !== "plain" && "rounded-lg px-5", centred && "items-center text-center", className),
|
|
46322
46435
|
style: theme.surfaceStyle,
|
|
46323
46436
|
"data-records-form-welcome": "",
|
|
46324
46437
|
children: [
|
|
@@ -46334,7 +46447,7 @@ function FormStage({
|
|
|
46334
46447
|
return /* @__PURE__ */ jsxs138(
|
|
46335
46448
|
"section",
|
|
46336
46449
|
{
|
|
46337
|
-
className:
|
|
46450
|
+
className: cn84(
|
|
46338
46451
|
"mx-auto flex w-full max-w-2xl flex-col gap-4 py-4",
|
|
46339
46452
|
// TYPEFORM'S SIZE (TYPEFORM-2): one question at a time fills the screen, centred in it.
|
|
46340
46453
|
oneAtATime && "min-h-[min(70dvh,640px)]",
|
|
@@ -46357,7 +46470,7 @@ function FormStage({
|
|
|
46357
46470
|
...routeKnown ? { "aria-valuetext": oneAtATime ? `${index + 1} of ${live.length}` : `${answered} of ${live.length}` } : {}
|
|
46358
46471
|
}
|
|
46359
46472
|
),
|
|
46360
|
-
/* @__PURE__ */ jsx151("span", { className:
|
|
46473
|
+
/* @__PURE__ */ jsx151("span", { className: cn84("min-w-[3.5rem] text-right tabular-nums", !routeKnown && "invisible"), "data-records-form-count": "", children: oneAtATime ? `${index + 1} of ${live.length}` : `${answered} of ${live.length}` })
|
|
46361
46474
|
] }),
|
|
46362
46475
|
signedInPublic ? /* @__PURE__ */ jsx151(
|
|
46363
46476
|
"p",
|
|
@@ -46440,7 +46553,7 @@ function FormStage({
|
|
|
46440
46553
|
}
|
|
46441
46554
|
)
|
|
46442
46555
|
] }) : null,
|
|
46443
|
-
/* @__PURE__ */ jsxs138("footer", { className:
|
|
46556
|
+
/* @__PURE__ */ jsxs138("footer", { className: cn84("flex flex-wrap items-center gap-3", centred && "justify-center"), children: [
|
|
46444
46557
|
oneAtATime && index > 0 ? /* @__PURE__ */ jsx151(Button97, { size: "lg", variant: "ghost", className: theme.buttonClass, onClick: retreat, children: "Back" }) : null,
|
|
46445
46558
|
oneAtATime && index < live.length - 1 ? /* @__PURE__ */ jsx151(Button97, { size: "lg", className: theme.buttonClass, onClick: () => void advance(), children: "Next" }) : /* @__PURE__ */ jsx151(Button97, { size: "lg", className: theme.buttonClass, disabled: writing, onClick: () => void (oneAtATime ? advance() : submit()), children: writing ? "Sending\u2026" : form.submitLabel ?? "Submit" }),
|
|
46446
46559
|
oneAtATime ? /* @__PURE__ */ jsxs138("span", { className: "hidden text-xs text-muted-foreground sm:inline", "data-records-form-enter-hint": "", children: [
|
|
@@ -46495,7 +46608,7 @@ function ThankYou({
|
|
|
46495
46608
|
{
|
|
46496
46609
|
href: redirect,
|
|
46497
46610
|
"data-records-form-next": "",
|
|
46498
|
-
className:
|
|
46611
|
+
className: cn84("inline-flex min-h-10 items-center rounded-md bg-primary px-4 font-medium text-primary-foreground", buttonClass),
|
|
46499
46612
|
children: ending?.buttonLabel || "Continue"
|
|
46500
46613
|
}
|
|
46501
46614
|
),
|
|
@@ -46528,7 +46641,7 @@ function Question({
|
|
|
46528
46641
|
return /* @__PURE__ */ jsxs138(
|
|
46529
46642
|
"div",
|
|
46530
46643
|
{
|
|
46531
|
-
className:
|
|
46644
|
+
className: cn84(
|
|
46532
46645
|
"flex flex-col",
|
|
46533
46646
|
large ? "gap-3 [&_input]:text-base [&_textarea]:text-base [&_input]:min-h-12" : "gap-1.5 [&_input]:text-base [&_textarea]:text-base"
|
|
46534
46647
|
),
|
|
@@ -46536,11 +46649,11 @@ function Question({
|
|
|
46536
46649
|
"aria-describedby": refused ? sayId : void 0,
|
|
46537
46650
|
children: [
|
|
46538
46651
|
/* @__PURE__ */ jsxs138("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
|
|
46539
|
-
/* @__PURE__ */ jsx151(Label24, { htmlFor: id, className:
|
|
46652
|
+
/* @__PURE__ */ jsx151(Label24, { htmlFor: id, className: cn84("font-medium leading-snug text-foreground", large ? "text-xl sm:text-2xl" : "text-base"), children: question.ask }),
|
|
46540
46653
|
question.required ? /* @__PURE__ */ jsx151("span", { className: "text-sm text-foreground/80", children: "required" }) : null,
|
|
46541
46654
|
field2.unit ? /* @__PURE__ */ jsx151("span", { className: "text-sm text-foreground/70", children: field2.unit }) : null
|
|
46542
46655
|
] }),
|
|
46543
|
-
question.help ? /* @__PURE__ */ jsx151("p", { className:
|
|
46656
|
+
question.help ? /* @__PURE__ */ jsx151("p", { className: cn84("text-muted-foreground", large ? "text-base" : "text-sm"), children: authored(host, question.help, "form-help") }) : null,
|
|
46544
46657
|
isAttachment && !upload ? /* @__PURE__ */ jsx151("p", { className: "w-fit rounded border border-dashed px-2 py-0.5 text-xs text-muted-foreground", title: NO_UPLOAD_REASON, children: "File upload unavailable here" }) : isAttachment ? /* @__PURE__ */ jsxs138(Fragment60, { children: [
|
|
46545
46658
|
/* @__PURE__ */ jsx151(
|
|
46546
46659
|
"input",
|
|
@@ -46904,17 +47017,17 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
|
|
|
46904
47017
|
}
|
|
46905
47018
|
);
|
|
46906
47019
|
}
|
|
46907
|
-
if (fields.loading || forms === null) return /* @__PURE__ */ jsx152(Skeleton32, { className:
|
|
47020
|
+
if (fields.loading || forms === null) return /* @__PURE__ */ jsx152(Skeleton32, { className: cn85("h-64 w-full", className) });
|
|
46908
47021
|
if (createOnMount && (makeOnMount === "waiting" || makeOnMount === "making") && !refused) {
|
|
46909
|
-
return /* @__PURE__ */ jsx152(Skeleton32, { className:
|
|
47022
|
+
return /* @__PURE__ */ jsx152(Skeleton32, { className: cn85("h-64 w-full", className) });
|
|
46910
47023
|
}
|
|
46911
47024
|
if (!rights.admin) {
|
|
46912
|
-
return /* @__PURE__ */ jsx152("p", { className:
|
|
47025
|
+
return /* @__PURE__ */ jsx152("p", { className: cn85("text-xs text-muted-foreground", className), children: rights.why("structure") });
|
|
46913
47026
|
}
|
|
46914
47027
|
return (
|
|
46915
47028
|
// THE CONTAINER IS THE PARENT (TYPEFORM-2): a container query asks an ANCESTOR, so `@3xl:` on the
|
|
46916
47029
|
// element that is itself `@container` never fired and the preview sat 3,000 px below the editor.
|
|
46917
|
-
/* @__PURE__ */ jsx152("div", { className:
|
|
47030
|
+
/* @__PURE__ */ jsx152("div", { className: cn85("@container min-h-0", className), children: /* @__PURE__ */ jsxs139("div", { className: "flex min-h-0 flex-col gap-3 @3xl:flex-row @3xl:items-start", children: [
|
|
46918
47031
|
/* @__PURE__ */ jsxs139("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
46919
47032
|
/* @__PURE__ */ jsxs139("div", { className: "flex items-center gap-1 overflow-x-auto", role: "group", "aria-label": "Forms", children: [
|
|
46920
47033
|
forms.map((form) => /* @__PURE__ */ jsx152(
|
|
@@ -47380,7 +47493,7 @@ function QuestionRow({
|
|
|
47380
47493
|
{
|
|
47381
47494
|
ref: sortable.setNodeRef,
|
|
47382
47495
|
style: { transform: CSS3.Transform.toString(sortable.transform), transition: sortable.transition },
|
|
47383
|
-
className:
|
|
47496
|
+
className: cn85("rounded border bg-background px-2 py-1.5", sortable.isDragging && "z-10 shadow-md"),
|
|
47384
47497
|
"data-records-form-question-row": question.field,
|
|
47385
47498
|
children: [
|
|
47386
47499
|
/* @__PURE__ */ jsxs139("div", { className: "flex items-center gap-2", children: [
|
|
@@ -47561,7 +47674,7 @@ function NotifyOnAnswer({
|
|
|
47561
47674
|
/* @__PURE__ */ jsxs139(
|
|
47562
47675
|
"label",
|
|
47563
47676
|
{
|
|
47564
|
-
className:
|
|
47677
|
+
className: cn85("flex items-center gap-2", !emailQuestion && "text-muted-foreground"),
|
|
47565
47678
|
title: emailQuestion ? "An email to the person who answered, in your ending's words." : "Add an email question first.",
|
|
47566
47679
|
children: [
|
|
47567
47680
|
/* @__PURE__ */ jsx152(
|
|
@@ -47606,7 +47719,7 @@ function NotifyOnAnswer({
|
|
|
47606
47719
|
// src/DocTemplate.tsx
|
|
47607
47720
|
import { useCallback as useCallback57, useEffect as useEffect108, useState as useState128 } from "react";
|
|
47608
47721
|
import { useFields as useFields29, useRecordsClient as useRecordsClient90, useTable as useTable31 } from "@ai-matrx/records/react";
|
|
47609
|
-
import { BasicInput as BasicInput30, BasicTextarea as BasicTextarea12, Button as Button99, Label as Label26, Skeleton as Skeleton33, cn as
|
|
47722
|
+
import { BasicInput as BasicInput30, BasicTextarea as BasicTextarea12, Button as Button99, Label as Label26, Skeleton as Skeleton33, cn as cn86 } from "@ai-matrx/design-system";
|
|
47610
47723
|
import { jsx as jsx153, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
47611
47724
|
function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, className }) {
|
|
47612
47725
|
const client = useRecordsClient90();
|
|
@@ -47704,11 +47817,11 @@ function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, classN
|
|
|
47704
47817
|
}
|
|
47705
47818
|
);
|
|
47706
47819
|
}
|
|
47707
|
-
if (templates === null || fields.loading && !fields.data) return /* @__PURE__ */ jsx153(Skeleton33, { className:
|
|
47820
|
+
if (templates === null || fields.loading && !fields.data) return /* @__PURE__ */ jsx153(Skeleton33, { className: cn86("h-64 w-full", className) });
|
|
47708
47821
|
if (!rights.admin) {
|
|
47709
|
-
return /* @__PURE__ */ jsx153("p", { className:
|
|
47822
|
+
return /* @__PURE__ */ jsx153("p", { className: cn86("text-xs text-muted-foreground", className), children: rights.why("structure") });
|
|
47710
47823
|
}
|
|
47711
|
-
return /* @__PURE__ */ jsxs140("div", { className:
|
|
47824
|
+
return /* @__PURE__ */ jsxs140("div", { className: cn86("flex flex-col gap-2", className), children: [
|
|
47712
47825
|
/* @__PURE__ */ jsxs140("div", { className: "flex items-center gap-1 overflow-x-auto", role: "group", "aria-label": "Templates", children: [
|
|
47713
47826
|
templates.map((t) => /* @__PURE__ */ jsxs140(
|
|
47714
47827
|
Button99,
|
|
@@ -47790,7 +47903,7 @@ function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, classN
|
|
|
47790
47903
|
// src/DocRender.tsx
|
|
47791
47904
|
import { useCallback as useCallback58, useEffect as useEffect109, useRef as useRef60, useState as useState129 } from "react";
|
|
47792
47905
|
import { useRecordsClient as useRecordsClient91 } from "@ai-matrx/records/react";
|
|
47793
|
-
import { Button as Button100, Skeleton as Skeleton34, cn as
|
|
47906
|
+
import { Button as Button100, Skeleton as Skeleton34, cn as cn87 } from "@ai-matrx/design-system";
|
|
47794
47907
|
import { jsx as jsx154, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
47795
47908
|
function DocRender({ templateId, recordId, filename, onRendered, className }) {
|
|
47796
47909
|
const client = useRecordsClient91();
|
|
@@ -47866,10 +47979,10 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
|
|
|
47866
47979
|
}
|
|
47867
47980
|
);
|
|
47868
47981
|
}
|
|
47869
|
-
if (preview === null || renders === null) return /* @__PURE__ */ jsx154(Skeleton34, { className:
|
|
47982
|
+
if (preview === null || renders === null) return /* @__PURE__ */ jsx154(Skeleton34, { className: cn87("h-64 w-full", className) });
|
|
47870
47983
|
const frozen = showing ? renders.find((r) => r.id === showing) ?? null : null;
|
|
47871
47984
|
const text = frozen ? frozen.body : preview;
|
|
47872
|
-
return /* @__PURE__ */ jsxs141("div", { className:
|
|
47985
|
+
return /* @__PURE__ */ jsxs141("div", { className: cn87("flex flex-col gap-2", className), children: [
|
|
47873
47986
|
/* @__PURE__ */ jsxs141("div", { className: "flex items-center gap-1 text-xs", children: [
|
|
47874
47987
|
/* @__PURE__ */ jsx154(
|
|
47875
47988
|
Button100,
|
|
@@ -47906,7 +48019,7 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
|
|
|
47906
48019
|
// src/SignBlock.tsx
|
|
47907
48020
|
import { useCallback as useCallback59, useEffect as useEffect110, useState as useState130 } from "react";
|
|
47908
48021
|
import { useFields as useFields30, useRecordsClient as useRecordsClient92 } from "@ai-matrx/records/react";
|
|
47909
|
-
import { BasicInput as BasicInput31, Button as Button101, Skeleton as Skeleton35, cn as
|
|
48022
|
+
import { BasicInput as BasicInput31, Button as Button101, Skeleton as Skeleton35, cn as cn88 } from "@ai-matrx/design-system";
|
|
47910
48023
|
import { useTable as useTable32 } from "@ai-matrx/records/react";
|
|
47911
48024
|
import { jsx as jsx155, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
47912
48025
|
function SignBlock({ tableId, recordId, render, className }) {
|
|
@@ -47965,9 +48078,9 @@ function SignBlock({ tableId, recordId, render, className }) {
|
|
|
47965
48078
|
}
|
|
47966
48079
|
);
|
|
47967
48080
|
}
|
|
47968
|
-
if (fields.loading || signatures === null) return /* @__PURE__ */ jsx155(Skeleton35, { className:
|
|
48081
|
+
if (fields.loading || signatures === null) return /* @__PURE__ */ jsx155(Skeleton35, { className: cn88("h-32 w-full", className) });
|
|
47969
48082
|
const signable = (fields.data ?? []).filter(isSignatureField);
|
|
47970
|
-
return /* @__PURE__ */ jsxs142("div", { className:
|
|
48083
|
+
return /* @__PURE__ */ jsxs142("div", { className: cn88("flex flex-col gap-2", className), children: [
|
|
47971
48084
|
/* @__PURE__ */ jsxs142("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
47972
48085
|
/* @__PURE__ */ jsx155("span", { className: "font-medium text-foreground", children: "Signatures" }),
|
|
47973
48086
|
/* @__PURE__ */ jsxs142("span", { children: [
|
|
@@ -48058,7 +48171,7 @@ function SignBlock({ tableId, recordId, render, className }) {
|
|
|
48058
48171
|
import { useCallback as useCallback60, useEffect as useEffect111, useState as useState131 } from "react";
|
|
48059
48172
|
import { useRecordsClient as useRecordsClient93, useTable as useTable33 } from "@ai-matrx/records/react";
|
|
48060
48173
|
import { hasQuietHours as hasQuietHours3 } from "@ai-matrx/records";
|
|
48061
|
-
import { Button as Button102, Skeleton as Skeleton36, cn as
|
|
48174
|
+
import { Button as Button102, Skeleton as Skeleton36, cn as cn89 } from "@ai-matrx/design-system";
|
|
48062
48175
|
import { Select as Select24 } from "@ai-matrx/design-system/controls";
|
|
48063
48176
|
import { jsx as jsx156, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
48064
48177
|
var CADENCE_WORDS2 = SUBSCRIPTION_CADENCE_LABEL;
|
|
@@ -48193,8 +48306,8 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
48193
48306
|
}
|
|
48194
48307
|
);
|
|
48195
48308
|
}
|
|
48196
|
-
if (subscriptions === null) return /* @__PURE__ */ jsx156(Skeleton36, { className:
|
|
48197
|
-
return /* @__PURE__ */ jsxs143("div", { className:
|
|
48309
|
+
if (subscriptions === null) return /* @__PURE__ */ jsx156(Skeleton36, { className: cn89("h-40 w-full", className) });
|
|
48310
|
+
return /* @__PURE__ */ jsxs143("div", { className: cn89("flex flex-col gap-2", className), children: [
|
|
48198
48311
|
/* @__PURE__ */ jsxs143("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
48199
48312
|
/* @__PURE__ */ jsx156("span", { className: "font-medium text-foreground", children: "Tell me when" }),
|
|
48200
48313
|
/* @__PURE__ */ jsxs143("span", { children: [
|
|
@@ -48235,7 +48348,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
48235
48348
|
children: "Use for this form"
|
|
48236
48349
|
}
|
|
48237
48350
|
) : null,
|
|
48238
|
-
rights.write && !(onChoose && held.rule_id === chosenRuleId) && stopping === held.rule_id ? /* @__PURE__ */ jsxs143("span", { className:
|
|
48351
|
+
rights.write && !(onChoose && held.rule_id === chosenRuleId) && stopping === held.rule_id ? /* @__PURE__ */ jsxs143("span", { className: cn89("flex flex-wrap items-center gap-2", onChoose ? void 0 : "ml-auto"), children: [
|
|
48239
48352
|
/* @__PURE__ */ jsx156("span", { className: "text-xs text-destructive", children: archiveConfirmSentence("this subscription") }),
|
|
48240
48353
|
/* @__PURE__ */ jsx156(Button102, { size: "sm", variant: "destructive", disabled: busy, onClick: () => void unsubscribe(held.rule_id), children: "Stop telling me" }),
|
|
48241
48354
|
/* @__PURE__ */ jsx156(Button102, { size: "sm", variant: "ghost", onClick: () => setStopping(null), children: "Keep it" })
|
|
@@ -48355,7 +48468,7 @@ import {
|
|
|
48355
48468
|
SelectTrigger as SelectTrigger19,
|
|
48356
48469
|
SelectValue as SelectValue19,
|
|
48357
48470
|
Skeleton as Skeleton37,
|
|
48358
|
-
cn as
|
|
48471
|
+
cn as cn91
|
|
48359
48472
|
} from "@ai-matrx/design-system";
|
|
48360
48473
|
|
|
48361
48474
|
// src/DashboardGrid.tsx
|
|
@@ -48374,7 +48487,7 @@ import {
|
|
|
48374
48487
|
useSortable as useSortable3
|
|
48375
48488
|
} from "@dnd-kit/sortable";
|
|
48376
48489
|
import { CSS as CSS4 } from "@dnd-kit/utilities";
|
|
48377
|
-
import { cn as
|
|
48490
|
+
import { cn as cn90 } from "@ai-matrx/design-system";
|
|
48378
48491
|
import { Select as Select25 } from "@ai-matrx/design-system/controls";
|
|
48379
48492
|
|
|
48380
48493
|
// src/dashboardLayout.ts
|
|
@@ -48466,7 +48579,7 @@ function GridCell2({
|
|
|
48466
48579
|
ref: sortable.setNodeRef,
|
|
48467
48580
|
style,
|
|
48468
48581
|
"data-testid": `dashboard-block-${index}`,
|
|
48469
|
-
className:
|
|
48582
|
+
className: cn90(
|
|
48470
48583
|
"group/block relative flex min-w-0 flex-col gap-1",
|
|
48471
48584
|
spanClass(item.span),
|
|
48472
48585
|
arranging && "rounded-md ring-1 ring-border",
|
|
@@ -48887,9 +49000,9 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
|
|
|
48887
49000
|
}
|
|
48888
49001
|
const spansTables = new Set((board?.blocks ?? []).map((b) => b.subject ?? tableId)).size > 1;
|
|
48889
49002
|
const rightsPending = !rights.known && (table.loading || !!table.data && !table.error);
|
|
48890
|
-
if (boards === null || rightsPending) return /* @__PURE__ */ jsx159(Skeleton37, { className:
|
|
49003
|
+
if (boards === null || rightsPending) return /* @__PURE__ */ jsx159(Skeleton37, { className: cn91("h-64 w-full", className) });
|
|
48891
49004
|
const PageLink = host.Link;
|
|
48892
|
-
return /* @__PURE__ */ jsxs146("div", { className:
|
|
49005
|
+
return /* @__PURE__ */ jsxs146("div", { className: cn91("flex min-h-0 flex-col gap-2", className), children: [
|
|
48893
49006
|
/* @__PURE__ */ jsxs146("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Dashboards", children: [
|
|
48894
49007
|
boards.map((d) => /* @__PURE__ */ jsx159(
|
|
48895
49008
|
Button104,
|
|
@@ -49351,7 +49464,7 @@ function TargetControl({
|
|
|
49351
49464
|
// src/QuestionPanel.tsx
|
|
49352
49465
|
import { copyText as copyText9 } from "@ai-matrx/kit/clipboard";
|
|
49353
49466
|
import { useEffect as useEffect113, useMemo as useMemo76, useRef as useRef61, useState as useState134 } from "react";
|
|
49354
|
-
import { Badge as Badge24, BasicInput as BasicInput33, Button as Button105, Checkbox as Checkbox18, Label as Label27, Skeleton as Skeleton38, cn as
|
|
49467
|
+
import { Badge as Badge24, BasicInput as BasicInput33, Button as Button105, Checkbox as Checkbox18, Label as Label27, Skeleton as Skeleton38, cn as cn92 } from "@ai-matrx/design-system";
|
|
49355
49468
|
import { useFields as useFields33, useRecordsClient as useRecordsClient96 } from "@ai-matrx/records/react";
|
|
49356
49469
|
|
|
49357
49470
|
// src/question.ts
|
|
@@ -49524,7 +49637,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
|
|
|
49524
49637
|
void copyText9(url.toString());
|
|
49525
49638
|
};
|
|
49526
49639
|
if (fields.loading || hidden === null) {
|
|
49527
|
-
return /* @__PURE__ */ jsxs147("div", { className:
|
|
49640
|
+
return /* @__PURE__ */ jsxs147("div", { className: cn92("flex flex-col gap-2 p-3", className), "data-testid": "question-panel", children: [
|
|
49528
49641
|
/* @__PURE__ */ jsx160(Skeleton38, { className: "h-8 w-full" }),
|
|
49529
49642
|
/* @__PURE__ */ jsx160(Skeleton38, { className: "h-32 w-full" })
|
|
49530
49643
|
] });
|
|
@@ -49533,7 +49646,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
|
|
|
49533
49646
|
{ value: "", label: "New question" },
|
|
49534
49647
|
...(saved ?? []).map((q) => ({ value: q.id, label: q.name, group: q.shared ? "Shared" : "Only me" }))
|
|
49535
49648
|
];
|
|
49536
|
-
return /* @__PURE__ */ jsxs147("div", { className:
|
|
49649
|
+
return /* @__PURE__ */ jsxs147("div", { className: cn92("flex min-h-0 flex-col gap-3 p-3 text-xs", className), "data-testid": "question-panel", children: [
|
|
49537
49650
|
/* @__PURE__ */ jsxs147("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
49538
49651
|
/* @__PURE__ */ jsx160(
|
|
49539
49652
|
PickOne,
|
|
@@ -49659,7 +49772,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
|
|
|
49659
49772
|
)) })
|
|
49660
49773
|
] }) : null
|
|
49661
49774
|
] }),
|
|
49662
|
-
/* @__PURE__ */ jsx160("div", { className:
|
|
49775
|
+
/* @__PURE__ */ jsx160("div", { className: cn92("min-h-24 rounded-md border p-2 transition-opacity", asking && "opacity-60"), "data-testid": "question-answer", "aria-busy": asking, children: answer === null ? /* @__PURE__ */ jsx160(Skeleton38, { className: "h-16 w-full" }) : !answer.ok ? /* @__PURE__ */ jsx160(RefusalNotice, { error: answer.error }) : /* @__PURE__ */ jsx160(QuestionAnswerView, { tableId, spec, answer: answer.data, fields: all, related }) })
|
|
49663
49776
|
] });
|
|
49664
49777
|
}
|
|
49665
49778
|
function Measures({ measures, fields, onChange }) {
|
|
@@ -50333,7 +50446,7 @@ import {
|
|
|
50333
50446
|
useRowActions as useRowActions2
|
|
50334
50447
|
} from "@ai-matrx/records/react";
|
|
50335
50448
|
import { onRecordChanged as onRecordChanged2 } from "@ai-matrx/records/core";
|
|
50336
|
-
import { BasicInput as BasicInput35, Button as Button107, Checkbox as Checkbox19, Skeleton as Skeleton40, cn as
|
|
50449
|
+
import { BasicInput as BasicInput35, Button as Button107, Checkbox as Checkbox19, Skeleton as Skeleton40, cn as cn93 } from "@ai-matrx/design-system";
|
|
50337
50450
|
import { formFromSummary as formFromSummary2 } from "@ai-matrx/records/forms";
|
|
50338
50451
|
import { Fragment as Fragment65, jsx as jsx162, jsxs as jsxs149 } from "react/jsx-runtime";
|
|
50339
50452
|
var EDIT_LEVELS = /* @__PURE__ */ new Set(["edit_content", "editor", "admin", "owner"]);
|
|
@@ -50473,9 +50586,9 @@ function PageScreen({
|
|
|
50473
50586
|
}, [client, page, onArchived]);
|
|
50474
50587
|
if (error) return /* @__PURE__ */ jsx162(RefusalNotice, { error, className });
|
|
50475
50588
|
if (missing) {
|
|
50476
|
-
return /* @__PURE__ */ jsx162("p", { className:
|
|
50589
|
+
return /* @__PURE__ */ jsx162("p", { className: cn93("p-4 text-sm text-muted-foreground", className), "data-records-page-missing": "", children: "This page is archived or not shared with you." });
|
|
50477
50590
|
}
|
|
50478
|
-
if (!page) return /* @__PURE__ */ jsx162(Skeleton40, { className:
|
|
50591
|
+
if (!page) return /* @__PURE__ */ jsx162(Skeleton40, { className: cn93("h-64 w-full", className) });
|
|
50479
50592
|
const filtersFor = (listId) => {
|
|
50480
50593
|
const out = {};
|
|
50481
50594
|
for (const b of blocks) {
|
|
@@ -50518,7 +50631,7 @@ function PageScreen({
|
|
|
50518
50631
|
) : null,
|
|
50519
50632
|
organizationId ? /* @__PURE__ */ jsx162(ShareControl, { kind: "record", organizationId, subjectId: page.id, name: page.name }) : null
|
|
50520
50633
|
] });
|
|
50521
|
-
return /* @__PURE__ */ jsxs149("div", { className:
|
|
50634
|
+
return /* @__PURE__ */ jsxs149("div", { className: cn93("flex min-h-0 flex-col gap-2", className), "data-records-page": page.id, children: [
|
|
50522
50635
|
header ? header({ name: page.name, actions }) : /* @__PURE__ */ jsxs149("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
50523
50636
|
/* @__PURE__ */ jsx162("h1", { className: "min-w-0 flex-1 truncate text-base font-medium", children: page.name }),
|
|
50524
50637
|
actions
|
|
@@ -50792,7 +50905,7 @@ function ListBlockView({
|
|
|
50792
50905
|
onSelect(row.id);
|
|
50793
50906
|
}
|
|
50794
50907
|
},
|
|
50795
|
-
className:
|
|
50908
|
+
className: cn93(
|
|
50796
50909
|
"cursor-pointer border-t hover:bg-muted/60",
|
|
50797
50910
|
row.id === selected && "bg-primary/10 hover:bg-primary/15"
|
|
50798
50911
|
),
|
|
@@ -51116,7 +51229,7 @@ import { copyText as copyText10 } from "@ai-matrx/kit/clipboard";
|
|
|
51116
51229
|
import { useCallback as useCallback63, useEffect as useEffect116, useState as useState137 } from "react";
|
|
51117
51230
|
import { useRecordsClient as useRecordsClient99, useTable as useTable37 } from "@ai-matrx/records/react";
|
|
51118
51231
|
import { publicFormPath as publicFormPath2 } from "@ai-matrx/records";
|
|
51119
|
-
import { Badge as Badge25, Button as Button108, Skeleton as Skeleton41, cn as
|
|
51232
|
+
import { Badge as Badge25, Button as Button108, Skeleton as Skeleton41, cn as cn94 } from "@ai-matrx/design-system";
|
|
51120
51233
|
import { FORM_STATE_WORDS as FORM_STATE_WORDS2 } from "@ai-matrx/records/forms";
|
|
51121
51234
|
import { Fragment as Fragment66, jsx as jsx163, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
51122
51235
|
var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
|
|
@@ -51179,9 +51292,9 @@ function FormsPanel({ tableId, activeFormId, className }) {
|
|
|
51179
51292
|
setShown(url);
|
|
51180
51293
|
}
|
|
51181
51294
|
}, []);
|
|
51182
|
-
if (forms === null) return /* @__PURE__ */ jsx163(Skeleton41, { className:
|
|
51295
|
+
if (forms === null) return /* @__PURE__ */ jsx163(Skeleton41, { className: cn94("h-32 w-full", className) });
|
|
51183
51296
|
const origin = host.publicOrigin ?? (typeof window === "undefined" ? "" : window.location.origin);
|
|
51184
|
-
return /* @__PURE__ */ jsxs150("section", { className:
|
|
51297
|
+
return /* @__PURE__ */ jsxs150("section", { className: cn94("flex flex-col gap-3", className), children: [
|
|
51185
51298
|
/* @__PURE__ */ jsxs150("header", { className: "flex items-center gap-2", children: [
|
|
51186
51299
|
/* @__PURE__ */ jsx163("h3", { className: "text-sm font-medium", children: "Forms" }),
|
|
51187
51300
|
/* @__PURE__ */ jsx163("span", { className: "text-xs text-muted-foreground", children: forms.length === 0 ? "none yet" : `${forms.length}` }),
|
|
@@ -51227,7 +51340,7 @@ function FormsPanel({ tableId, activeFormId, className }) {
|
|
|
51227
51340
|
{
|
|
51228
51341
|
"data-linked": form.form_id === activeFormId ? "true" : void 0,
|
|
51229
51342
|
ref: form.form_id === activeFormId ? (el) => el?.scrollIntoView({ block: "nearest" }) : void 0,
|
|
51230
|
-
className:
|
|
51343
|
+
className: cn94(
|
|
51231
51344
|
"rounded-md border p-2.5",
|
|
51232
51345
|
form.form_id === activeFormId && "border-primary ring-1 ring-primary"
|
|
51233
51346
|
),
|
|
@@ -51299,7 +51412,7 @@ function FormsPanel({ tableId, activeFormId, className }) {
|
|
|
51299
51412
|
// src/CaptureSheet.tsx
|
|
51300
51413
|
import { useCallback as useCallback65, useEffect as useEffect118, useRef as useRef63, useState as useState139 } from "react";
|
|
51301
51414
|
import { useFields as useFields36, useRecordsClient as useRecordsClient101, useTable as useTable38 } from "@ai-matrx/records/react";
|
|
51302
|
-
import { Button as Button110, Input as Input9, Skeleton as Skeleton43, Textarea as Textarea8, cn as
|
|
51415
|
+
import { Button as Button110, Input as Input9, Skeleton as Skeleton43, Textarea as Textarea8, cn as cn96 } from "@ai-matrx/design-system";
|
|
51303
51416
|
|
|
51304
51417
|
// src/CaptureRun.tsx
|
|
51305
51418
|
import { useCallback as useCallback64, useEffect as useEffect117, useMemo as useMemo78, useRef as useRef62, useState as useState138 } from "react";
|
|
@@ -51309,7 +51422,7 @@ import {
|
|
|
51309
51422
|
openCaptureQueue
|
|
51310
51423
|
} from "@ai-matrx/records";
|
|
51311
51424
|
import { useRecordsClient as useRecordsClient100 } from "@ai-matrx/records/react";
|
|
51312
|
-
import { Button as Button109, Input as Input8, Skeleton as Skeleton42, Textarea as Textarea7, cn as
|
|
51425
|
+
import { Button as Button109, Input as Input8, Skeleton as Skeleton42, Textarea as Textarea7, cn as cn95 } from "@ai-matrx/design-system";
|
|
51313
51426
|
import { jsx as jsx164, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
51314
51427
|
function controlFor(field2) {
|
|
51315
51428
|
if (!field2) return "text";
|
|
@@ -51487,13 +51600,13 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
51487
51600
|
if (online) await sync();
|
|
51488
51601
|
}
|
|
51489
51602
|
if (loadFailed) {
|
|
51490
|
-
return /* @__PURE__ */ jsx164("section", { className:
|
|
51603
|
+
return /* @__PURE__ */ jsx164("section", { className: cn95("mx-auto w-full max-w-sm p-4", className), children: /* @__PURE__ */ jsx164("div", { "data-testid": "capture-refusal", children: /* @__PURE__ */ jsx164(RefusalNotice, { error: loadFailed, className: "text-sm" }) }) });
|
|
51491
51604
|
}
|
|
51492
51605
|
if (face === void 0) {
|
|
51493
|
-
return /* @__PURE__ */ jsx164(Skeleton42, { className:
|
|
51606
|
+
return /* @__PURE__ */ jsx164(Skeleton42, { className: cn95("mx-auto h-64 w-full max-w-sm", className) });
|
|
51494
51607
|
}
|
|
51495
51608
|
if (face === null) {
|
|
51496
|
-
return /* @__PURE__ */ jsx164("section", { className:
|
|
51609
|
+
return /* @__PURE__ */ jsx164("section", { className: cn95("mx-auto w-full max-w-sm p-4", className), children: /* @__PURE__ */ jsx164("p", { className: "text-sm", "data-testid": "capture-refusal", children: "This capture sheet is not here, or it is not yours to open. If somebody sent you this link, ask them to check it." }) });
|
|
51497
51610
|
}
|
|
51498
51611
|
const waiting = counts.waiting + counts.sending;
|
|
51499
51612
|
const queueLine = /* @__PURE__ */ jsxs151("div", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", "data-testid": "capture-queue-line", children: [
|
|
@@ -51545,7 +51658,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
51545
51658
|
) : null
|
|
51546
51659
|
] }, i.client_key)) }) : null;
|
|
51547
51660
|
if (!face.may_capture) {
|
|
51548
|
-
return /* @__PURE__ */ jsxs151("section", { className:
|
|
51661
|
+
return /* @__PURE__ */ jsxs151("section", { className: cn95("mx-auto flex w-full max-w-sm flex-col gap-3 p-4", className), children: [
|
|
51549
51662
|
/* @__PURE__ */ jsx164("h1", { className: "text-lg font-medium", children: face.title }),
|
|
51550
51663
|
/* @__PURE__ */ jsx164("p", { className: "text-sm", "data-testid": "capture-refusal", children: face.message }),
|
|
51551
51664
|
queueLine,
|
|
@@ -51554,7 +51667,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
51554
51667
|
}
|
|
51555
51668
|
if (done) {
|
|
51556
51669
|
const thanks = face.presentation?.thank_you ?? {};
|
|
51557
|
-
return /* @__PURE__ */ jsxs151("section", { className:
|
|
51670
|
+
return /* @__PURE__ */ jsxs151("section", { className: cn95("mx-auto flex w-full max-w-sm flex-col gap-3 p-4", className), children: [
|
|
51558
51671
|
/* @__PURE__ */ jsx164("h2", { className: "text-lg font-medium", "data-testid": "capture-thankyou", children: thanks.title ?? "Logged" }),
|
|
51559
51672
|
/* @__PURE__ */ jsx164("p", { className: "text-sm text-muted-foreground", children: done.queued ? "There is no signal, so this one is on the phone and goes up the moment there is. Nothing is lost." : thanks.body ?? "Ready for the next one." }),
|
|
51560
51673
|
/* @__PURE__ */ jsx164(Button109, { className: "h-12", onClick: () => setDone(null), "data-testid": "capture-next", children: "Next one" }),
|
|
@@ -51566,7 +51679,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
51566
51679
|
const field2 = fieldOf2(q.field);
|
|
51567
51680
|
const control = controlFor(field2);
|
|
51568
51681
|
const last = at >= questions.length - 1;
|
|
51569
|
-
return /* @__PURE__ */ jsxs151("section", { className:
|
|
51682
|
+
return /* @__PURE__ */ jsxs151("section", { className: cn95("mx-auto flex w-full max-w-sm flex-col gap-3 p-4", className), children: [
|
|
51570
51683
|
/* @__PURE__ */ jsxs151("div", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
51571
51684
|
/* @__PURE__ */ jsxs151("span", { className: "tabular-nums", "data-testid": "capture-progress", children: [
|
|
51572
51685
|
at + 1,
|
|
@@ -51823,9 +51936,9 @@ function AdHocCaptureSheet({
|
|
|
51823
51936
|
}
|
|
51824
51937
|
if (table.error) return /* @__PURE__ */ jsx165(RefusalNotice, { error: table.error, className });
|
|
51825
51938
|
if (fields.error) return /* @__PURE__ */ jsx165(RefusalNotice, { error: fields.error, className });
|
|
51826
|
-
if (fields.loading || pending === null) return /* @__PURE__ */ jsx165(Skeleton43, { className:
|
|
51939
|
+
if (fields.loading || pending === null) return /* @__PURE__ */ jsx165(Skeleton43, { className: cn96("h-64 w-full", className) });
|
|
51827
51940
|
const keys = resolved();
|
|
51828
|
-
return /* @__PURE__ */ jsxs152("section", { className:
|
|
51941
|
+
return /* @__PURE__ */ jsxs152("section", { className: cn96("mx-auto flex w-full max-w-sm flex-col gap-2", className), children: [
|
|
51829
51942
|
/* @__PURE__ */ jsxs152("header", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
51830
51943
|
CAPTURE_MODES.map((m) => /* @__PURE__ */ jsx165(
|
|
51831
51944
|
Button110,
|
|
@@ -51930,7 +52043,7 @@ function AdHocCaptureSheet({
|
|
|
51930
52043
|
// src/PortalShell.tsx
|
|
51931
52044
|
import { useCallback as useCallback66, useEffect as useEffect119, useState as useState140 } from "react";
|
|
51932
52045
|
import { useRecordsClient as useRecordsClient102 } from "@ai-matrx/records/react";
|
|
51933
|
-
import { Button as Button111, Skeleton as Skeleton44, cn as
|
|
52046
|
+
import { Button as Button111, Skeleton as Skeleton44, cn as cn97 } from "@ai-matrx/design-system";
|
|
51934
52047
|
import { jsx as jsx166, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
51935
52048
|
function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
51936
52049
|
const client = useRecordsClient102();
|
|
@@ -51960,12 +52073,12 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
|
51960
52073
|
if (error) {
|
|
51961
52074
|
return /* @__PURE__ */ jsx166(RefusalNotice, { error, className });
|
|
51962
52075
|
}
|
|
51963
|
-
if (!card || reach === null) return /* @__PURE__ */ jsx166(Skeleton44, { className:
|
|
52076
|
+
if (!card || reach === null) return /* @__PURE__ */ jsx166(Skeleton44, { className: cn97("h-64 w-full", className) });
|
|
51964
52077
|
if (!card.external) {
|
|
51965
|
-
return /* @__PURE__ */ jsx166("p", { className:
|
|
52078
|
+
return /* @__PURE__ */ jsx166("p", { className: cn97("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: card.explanation || "You are a member of an organization here, so this portal is not yours \u2014 a portal is the scoped view an OUTSIDER gets. You have the full application instead." });
|
|
51966
52079
|
}
|
|
51967
52080
|
if (sending && form) {
|
|
51968
|
-
return /* @__PURE__ */ jsxs153("section", { className:
|
|
52081
|
+
return /* @__PURE__ */ jsxs153("section", { className: cn97("flex min-h-0 flex-col gap-2", className), children: [
|
|
51969
52082
|
/* @__PURE__ */ jsxs153("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
51970
52083
|
/* @__PURE__ */ jsx166("span", { className: "font-medium text-foreground", children: form.name }),
|
|
51971
52084
|
/* @__PURE__ */ jsx166(Button111, { size: "sm", variant: "ghost", className: "ml-auto h-6 px-2 text-[11px]", onClick: () => setSending(false), children: "Back" })
|
|
@@ -51983,9 +52096,9 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
|
51983
52096
|
] });
|
|
51984
52097
|
}
|
|
51985
52098
|
if (open) {
|
|
51986
|
-
return /* @__PURE__ */ jsx166("section", { className:
|
|
52099
|
+
return /* @__PURE__ */ jsx166("section", { className: cn97("flex min-h-0 flex-col gap-2", className), children: /* @__PURE__ */ jsx166(Peek, { tableId, recordId: open, onClose: () => setOpen(null) }) });
|
|
51987
52100
|
}
|
|
51988
|
-
return /* @__PURE__ */ jsxs153("section", { className:
|
|
52101
|
+
return /* @__PURE__ */ jsxs153("section", { className: cn97("flex min-h-0 flex-col gap-2", className), children: [
|
|
51989
52102
|
/* @__PURE__ */ jsxs153("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
51990
52103
|
/* @__PURE__ */ jsx166("span", { className: "font-medium text-foreground", children: "Shared with you" }),
|
|
51991
52104
|
/* @__PURE__ */ jsx166("span", { className: "tabular-nums", children: reach.length }),
|
|
@@ -52036,7 +52149,7 @@ function PortalRow({ tableId, recordId }) {
|
|
|
52036
52149
|
// src/PublicViewPage.tsx
|
|
52037
52150
|
import { useCallback as useCallback67, useEffect as useEffect120, useState as useState141 } from "react";
|
|
52038
52151
|
import { useRecordsClient as useRecordsClient103 } from "@ai-matrx/records/react";
|
|
52039
|
-
import { Skeleton as Skeleton45, cn as
|
|
52152
|
+
import { Skeleton as Skeleton45, cn as cn98 } from "@ai-matrx/design-system";
|
|
52040
52153
|
import { publicReadOf } from "@ai-matrx/records/forms";
|
|
52041
52154
|
import { jsx as jsx167, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
52042
52155
|
function PublicViewPage({ slug, className }) {
|
|
@@ -52101,15 +52214,15 @@ function PublicViewPage({ slug, className }) {
|
|
|
52101
52214
|
void load();
|
|
52102
52215
|
}, [load]);
|
|
52103
52216
|
if (error) return /* @__PURE__ */ jsx167(RefusalNotice, { error, className });
|
|
52104
|
-
if (binding === null) return /* @__PURE__ */ jsx167(Skeleton45, { className:
|
|
52217
|
+
if (binding === null) return /* @__PURE__ */ jsx167(Skeleton45, { className: cn98("h-64 w-full", className) });
|
|
52105
52218
|
if (binding === "none") {
|
|
52106
|
-
return /* @__PURE__ */ jsxs154("main", { className:
|
|
52219
|
+
return /* @__PURE__ */ jsxs154("main", { className: cn98("mx-auto max-w-2xl py-16 text-center", className), children: [
|
|
52107
52220
|
/* @__PURE__ */ jsx167("h1", { className: "text-lg font-medium", children: "Nothing here" }),
|
|
52108
52221
|
/* @__PURE__ */ jsx167("p", { className: "mt-1 text-sm text-muted-foreground", children: "There is no public page at this address." }),
|
|
52109
52222
|
gap ? /* @__PURE__ */ jsx167("p", { className: "mt-6 text-xs text-muted-foreground", children: gap }) : null
|
|
52110
52223
|
] });
|
|
52111
52224
|
}
|
|
52112
|
-
return /* @__PURE__ */ jsxs154("main", { className:
|
|
52225
|
+
return /* @__PURE__ */ jsxs154("main", { className: cn98("mx-auto flex max-w-2xl flex-col gap-3 py-8", className), children: [
|
|
52113
52226
|
/* @__PURE__ */ jsxs154("header", { className: "flex items-baseline gap-2 text-xs text-muted-foreground", children: [
|
|
52114
52227
|
/* @__PURE__ */ jsx167("span", { className: "font-medium text-foreground", children: binding.namespace ?? "Published" }),
|
|
52115
52228
|
/* @__PURE__ */ jsx167("span", { children: plan?.read === "table" || plan?.read === "view" ? `${rows?.length ?? 0} items` : "Shared publicly" })
|
|
@@ -52137,7 +52250,7 @@ function PublicRow({ row, fields }) {
|
|
|
52137
52250
|
import { copyText as copyText11 } from "@ai-matrx/kit/clipboard";
|
|
52138
52251
|
import { useCallback as useCallback68, useEffect as useEffect121, useState as useState142 } from "react";
|
|
52139
52252
|
import { useRecordsClient as useRecordsClient104 } from "@ai-matrx/records/react";
|
|
52140
|
-
import { Button as Button112, Input as Input10, Skeleton as Skeleton46, Textarea as Textarea9, cn as
|
|
52253
|
+
import { Button as Button112, Input as Input10, Skeleton as Skeleton46, Textarea as Textarea9, cn as cn99 } from "@ai-matrx/design-system";
|
|
52141
52254
|
import { useTable as useTable39 } from "@ai-matrx/records/react";
|
|
52142
52255
|
import { Fragment as Fragment68, jsx as jsx168, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
52143
52256
|
function EmbedFrame({
|
|
@@ -52191,15 +52304,15 @@ function EmbedFrame({
|
|
|
52191
52304
|
setTokenId(null);
|
|
52192
52305
|
}, [client, tokenId]);
|
|
52193
52306
|
if (table.error) return /* @__PURE__ */ jsx168(RefusalNotice, { error: table.error, className });
|
|
52194
|
-
if (table.loading && !table.data) return /* @__PURE__ */ jsx168(Skeleton46, { className:
|
|
52307
|
+
if (table.loading && !table.data) return /* @__PURE__ */ jsx168(Skeleton46, { className: cn99("h-48 w-full", className) });
|
|
52195
52308
|
if (!rights.admin) {
|
|
52196
|
-
return /* @__PURE__ */ jsxs155("p", { className:
|
|
52309
|
+
return /* @__PURE__ */ jsxs155("p", { className: cn99("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: [
|
|
52197
52310
|
rights.why("structure"),
|
|
52198
52311
|
" Issuing an embed opens a way in from somebody else's website, so the store asks for the admin level on this table before it will mint one."
|
|
52199
52312
|
] });
|
|
52200
52313
|
}
|
|
52201
52314
|
const snippet = secret ? `<iframe src="${embedUrl}#t=${secret}" style="width:100%;height:640px;border:0" loading="lazy"></iframe>` : null;
|
|
52202
|
-
return /* @__PURE__ */ jsxs155("section", { className:
|
|
52315
|
+
return /* @__PURE__ */ jsxs155("section", { className: cn99("flex min-h-0 flex-col gap-2", className), children: [
|
|
52203
52316
|
/* @__PURE__ */ jsxs155("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
52204
52317
|
/* @__PURE__ */ jsx168("span", { className: "font-medium text-foreground", children: "Embed" }),
|
|
52205
52318
|
/* @__PURE__ */ jsx168("span", { children: mode === "write" ? "a form people can send" : "a read-only view" })
|
|
@@ -52288,7 +52401,7 @@ import {
|
|
|
52288
52401
|
DropdownMenuTrigger as DropdownMenuTrigger10,
|
|
52289
52402
|
Input as Input12,
|
|
52290
52403
|
Skeleton as Skeleton47,
|
|
52291
|
-
cn as
|
|
52404
|
+
cn as cn101,
|
|
52292
52405
|
useIsMobile as useIsMobile2
|
|
52293
52406
|
} from "@ai-matrx/design-system";
|
|
52294
52407
|
import { humanizeIdentifier as humanizeIdentifier22 } from "@ai-matrx/kit/text-case";
|
|
@@ -53059,7 +53172,7 @@ function TableDuplicateDialog({ tableId, name, organizationId, open, onOpenChang
|
|
|
53059
53172
|
// src/ViewFilter.tsx
|
|
53060
53173
|
import { useEffect as useEffect123, useMemo as useMemo81, useState as useState149 } from "react";
|
|
53061
53174
|
import { Button as Button119, Popover as Popover19, PopoverContent as PopoverContent19, PopoverTrigger as PopoverTrigger19 } from "@ai-matrx/design-system";
|
|
53062
|
-
import { useFields as useFields38 } from "@ai-matrx/records/react";
|
|
53175
|
+
import { useFields as useFields38, useOptionalRecordsClient as useOptionalRecordsClient21 } from "@ai-matrx/records/react";
|
|
53063
53176
|
import { jsx as jsx176, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
53064
53177
|
function conditionCount(expr) {
|
|
53065
53178
|
if (!expr || typeof expr !== "object" || Array.isArray(expr)) return 0;
|
|
@@ -53078,10 +53191,39 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
53078
53191
|
useEffect123(() => {
|
|
53079
53192
|
setDraft(saved);
|
|
53080
53193
|
}, [view?.id, savedKey]);
|
|
53081
|
-
const
|
|
53082
|
-
|
|
53194
|
+
const client = useOptionalRecordsClient21();
|
|
53195
|
+
const relations = useMemo81(
|
|
53196
|
+
() => (fields.data ?? []).filter((f) => f.type === "relation" && !!f.relation_target),
|
|
53083
53197
|
[fields.data]
|
|
53084
53198
|
);
|
|
53199
|
+
const [linkedFields, setLinkedFields] = useState149({});
|
|
53200
|
+
useEffect123(() => {
|
|
53201
|
+
if (!open || !client) return;
|
|
53202
|
+
let cancelled = false;
|
|
53203
|
+
for (const rel of relations) {
|
|
53204
|
+
const target = String(rel.relation_target);
|
|
53205
|
+
void client.fields({ table_id: target }).then((got) => {
|
|
53206
|
+
if (cancelled || !got.ok) return;
|
|
53207
|
+
setLinkedFields((now) => ({ ...now, [rel.id]: got.data ?? [] }));
|
|
53208
|
+
});
|
|
53209
|
+
}
|
|
53210
|
+
return () => {
|
|
53211
|
+
cancelled = true;
|
|
53212
|
+
};
|
|
53213
|
+
}, [open, client, relations]);
|
|
53214
|
+
const conditionFields = useMemo81(() => {
|
|
53215
|
+
const own3 = (fields.data ?? []).map((f) => ({ id: f.id, key: f.key, label: f.label || f.key, field: f }));
|
|
53216
|
+
const reached = relations.flatMap(
|
|
53217
|
+
(rel) => (linkedFields[rel.id] ?? []).filter((inner2) => inner2.type !== "relation").map((inner2) => ({
|
|
53218
|
+
id: `${rel.id}>${inner2.id}`,
|
|
53219
|
+
key: `${rel.key}.${inner2.key}`,
|
|
53220
|
+
label: `${rel.label || rel.key} \u203A ${inner2.label || inner2.key}`,
|
|
53221
|
+
field: inner2,
|
|
53222
|
+
via: { id: rel.id, fieldId: inner2.id }
|
|
53223
|
+
}))
|
|
53224
|
+
);
|
|
53225
|
+
return [...own3, ...reached];
|
|
53226
|
+
}, [fields.data, relations, linkedFields]);
|
|
53085
53227
|
if (!view) return null;
|
|
53086
53228
|
const count = conditionCount(saved);
|
|
53087
53229
|
const changed2 = JSON.stringify(draft) !== savedKey;
|
|
@@ -53171,7 +53313,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
53171
53313
|
}
|
|
53172
53314
|
|
|
53173
53315
|
// src/PhoneTableActions.tsx
|
|
53174
|
-
import { DropdownMenu as DropdownMenu9, DropdownMenuContent as DropdownMenuContent9, DropdownMenuTrigger as DropdownMenuTrigger9, cn as
|
|
53316
|
+
import { DropdownMenu as DropdownMenu9, DropdownMenuContent as DropdownMenuContent9, DropdownMenuTrigger as DropdownMenuTrigger9, cn as cn100 } from "@ai-matrx/design-system";
|
|
53175
53317
|
import { jsx as jsx177, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
53176
53318
|
function PhoneActionRow({ action: action3, groupStart }) {
|
|
53177
53319
|
const disabled = action3.disabledReason !== void 0;
|
|
@@ -53185,7 +53327,7 @@ function PhoneActionRow({ action: action3, groupStart }) {
|
|
|
53185
53327
|
onClick: () => {
|
|
53186
53328
|
if (!disabled) void action3.run();
|
|
53187
53329
|
},
|
|
53188
|
-
className:
|
|
53330
|
+
className: cn100(
|
|
53189
53331
|
"flex min-h-11 w-full items-center gap-3 px-1 text-left text-base disabled:opacity-60",
|
|
53190
53332
|
groupStart && "border-t border-border pt-1",
|
|
53191
53333
|
action3.destructive && "text-destructive"
|
|
@@ -53569,7 +53711,7 @@ function TableNotHere({
|
|
|
53569
53711
|
if (archived.phase === "asking") return /* @__PURE__ */ jsx178(Skeleton47, { className: "h-40 w-full" });
|
|
53570
53712
|
const row = archived.phase === "answered" ? archived.row : null;
|
|
53571
53713
|
if (row) {
|
|
53572
|
-
return /* @__PURE__ */ jsxs165("div", { className:
|
|
53714
|
+
return /* @__PURE__ */ jsxs165("div", { className: cn101("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
53573
53715
|
/* @__PURE__ */ jsx178("p", { className: "text-sm font-medium", children: "This table is archived" }),
|
|
53574
53716
|
/* @__PURE__ */ jsx178("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
|
|
53575
53717
|
/* @__PURE__ */ jsx178("p", { className: "text-xs text-muted-foreground", children: archivedByLine2(row) }),
|
|
@@ -53598,7 +53740,7 @@ function TableNotHere({
|
|
|
53598
53740
|
] })
|
|
53599
53741
|
] });
|
|
53600
53742
|
}
|
|
53601
|
-
return /* @__PURE__ */ jsxs165("div", { className:
|
|
53743
|
+
return /* @__PURE__ */ jsxs165("div", { className: cn101("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
53602
53744
|
/* @__PURE__ */ jsx178("p", { className: "text-sm font-medium", children: "This table is not here" }),
|
|
53603
53745
|
/* @__PURE__ */ jsx178("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_NOT_REACHABLE }),
|
|
53604
53746
|
onLeave ? /* @__PURE__ */ jsx178(Button120, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
|
|
@@ -54482,7 +54624,7 @@ function TablePage({
|
|
|
54482
54624
|
rights.write && view && Object.keys(viewPatchDocument(saveToViewPlan(view, look ?? {}).patch)).length > 0
|
|
54483
54625
|
);
|
|
54484
54626
|
return /* @__PURE__ */ jsxs165(ViewAddressContext.Provider, { value: addressPort, children: [
|
|
54485
|
-
/* @__PURE__ */ jsxs165("div", { className:
|
|
54627
|
+
/* @__PURE__ */ jsxs165("div", { className: cn101("flex h-full min-h-0 gap-4", className), "data-table-footer": footer, children: [
|
|
54486
54628
|
headerNode,
|
|
54487
54629
|
/* @__PURE__ */ jsx178("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2", children: structure.hidden || !structure.settled ? (
|
|
54488
54630
|
/* THE TOOLBAR ROW'S HEIGHT IS KEPT (min-h-8), so the sentence lands exactly where the bar was. */
|
|
@@ -54517,6 +54659,14 @@ function TablePage({
|
|
|
54517
54659
|
}
|
|
54518
54660
|
},
|
|
54519
54661
|
onViews: setViews,
|
|
54662
|
+
onSettingsCopied: (copiedId) => {
|
|
54663
|
+
setAddressResetEpoch((n) => n + 1);
|
|
54664
|
+
setLooks((all) => {
|
|
54665
|
+
const { [copiedId]: _gone, ...rest } = all ?? {};
|
|
54666
|
+
return rest;
|
|
54667
|
+
});
|
|
54668
|
+
void keepLook(client, tableId, copiedId, null);
|
|
54669
|
+
},
|
|
54520
54670
|
...seededViews && viewsEpoch === 0 ? { initialViews: seededViews } : {},
|
|
54521
54671
|
seed: seedViews ?? [defaultView(tableId)],
|
|
54522
54672
|
settings: view && main === "records" && shownLayout === "grid" ? /* @__PURE__ */ jsxs165("div", { className: "flex flex-col gap-0.5 px-1 py-1", role: "radiogroup", "aria-label": FOOTER_WORDS.label, children: [
|
|
@@ -54528,7 +54678,7 @@ function TablePage({
|
|
|
54528
54678
|
role: "radio",
|
|
54529
54679
|
"aria-checked": footer === option,
|
|
54530
54680
|
"data-view-footer": option,
|
|
54531
|
-
className:
|
|
54681
|
+
className: cn101(
|
|
54532
54682
|
"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",
|
|
54533
54683
|
footer === option && "font-medium"
|
|
54534
54684
|
),
|
|
@@ -54538,7 +54688,7 @@ function TablePage({
|
|
|
54538
54688
|
"span",
|
|
54539
54689
|
{
|
|
54540
54690
|
"aria-hidden": "true",
|
|
54541
|
-
className:
|
|
54691
|
+
className: cn101("h-2 w-2 shrink-0 rounded-full border border-current", footer === option && "bg-current")
|
|
54542
54692
|
}
|
|
54543
54693
|
),
|
|
54544
54694
|
FOOTER_WORDS[option]
|
|
@@ -54647,7 +54797,7 @@ function TablePage({
|
|
|
54647
54797
|
"div",
|
|
54648
54798
|
{
|
|
54649
54799
|
ref: setToolbarSlot,
|
|
54650
|
-
className:
|
|
54800
|
+
className: cn101(
|
|
54651
54801
|
// `min-w-9`: never narrower than the layout toolbar's folded "…" (36 px) — a row too
|
|
54652
54802
|
// narrow for its pinned controls folds them behind that "…" (design-system
|
|
54653
54803
|
// `usePinnedFold`), and the "…" itself is never cut (merged-grid leftovers, 2026-09-28).
|
|
@@ -54739,7 +54889,7 @@ function TablePage({
|
|
|
54739
54889
|
) : /* @__PURE__ */ jsx178(TableToolbarSlotContext.Provider, { value: toolbarSlot, children: /* @__PURE__ */ jsx178(TableToolbarFoldContext.Provider, { value: toolbarFold2, children: /* @__PURE__ */ jsx178(TableToolbarSheetExtrasContext.Provider, { value: sheetExtras, children: /* @__PURE__ */ jsxs165(
|
|
54740
54890
|
"div",
|
|
54741
54891
|
{
|
|
54742
|
-
className:
|
|
54892
|
+
className: cn101(
|
|
54743
54893
|
"min-h-0 flex-1",
|
|
54744
54894
|
// Inline: a plain scrolling block, so nothing in it shrinks to the height — the
|
|
54745
54895
|
// layout is as tall as its rows and the footer follows the last one.
|
|
@@ -54952,7 +55102,7 @@ import { formatCount as formatCount8 } from "@ai-matrx/kit/format";
|
|
|
54952
55102
|
import { TapTargetSearchGroup as TapTargetSearchGroup2, TooltipProvider } from "@ai-matrx/design-system";
|
|
54953
55103
|
import { MatrxTableCardShowMore as MatrxTableCardShowMore3 } from "@ai-matrx/design-system/data-table";
|
|
54954
55104
|
import { useEffect as useEffect126, useMemo as useMemo83, useRef as useRef65, useState as useState152 } from "react";
|
|
54955
|
-
import { Button as Button121, ErrorBox as ErrorBox9, Input as Input13, cn as
|
|
55105
|
+
import { Button as Button121, ErrorBox as ErrorBox9, Input as Input13, cn as cn102 } from "@ai-matrx/design-system";
|
|
54956
55106
|
import { SEED_FRESH_MS, useRecordsClient as useRecordsClient107, useSeededAnswerAt } from "@ai-matrx/records/react";
|
|
54957
55107
|
import { Fragment as Fragment73, jsx as jsx179, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
54958
55108
|
var entityTitleColumn = entityNameColumn;
|
|
@@ -54990,14 +55140,14 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
54990
55140
|
const says = await entity.update(id, column, to);
|
|
54991
55141
|
if (says) setRefused({ to, says });
|
|
54992
55142
|
};
|
|
54993
|
-
return /* @__PURE__ */ jsx179("div", { className:
|
|
55143
|
+
return /* @__PURE__ */ jsx179("div", { className: cn102("flex min-h-40 gap-2 overflow-x-auto pb-1", className), "data-records-entity-board": column.key, children: lanes.map((lane) => {
|
|
54994
55144
|
const cards = rowsOf2(lane.key);
|
|
54995
55145
|
if (lane.key === "" && cards.length === 0) return null;
|
|
54996
55146
|
return /* @__PURE__ */ jsxs166(
|
|
54997
55147
|
"section",
|
|
54998
55148
|
{
|
|
54999
55149
|
"aria-label": lane.label,
|
|
55000
|
-
className:
|
|
55150
|
+
className: cn102("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"),
|
|
55001
55151
|
onDragOver: writable && lane.key ? (e) => {
|
|
55002
55152
|
e.preventDefault();
|
|
55003
55153
|
setOver(lane.key);
|
|
@@ -55018,7 +55168,7 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
55018
55168
|
e.dataTransfer.setData("text/x-entity-row", row._id);
|
|
55019
55169
|
e.dataTransfer.effectAllowed = "move";
|
|
55020
55170
|
},
|
|
55021
|
-
className:
|
|
55171
|
+
className: cn102("flex flex-col gap-0.5 rounded border bg-card px-2 py-1.5 text-xs shadow-sm", writable && "cursor-grab"),
|
|
55022
55172
|
"data-records-entity-card": row._id,
|
|
55023
55173
|
children: [
|
|
55024
55174
|
onOpenRecord ? /* @__PURE__ */ jsx179("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__ */ jsx179("span", { className: "truncate font-medium", children: (title ? entityValueText(title, entityCellValue(row, title)) : shown4(row._id)) || "Untitled" }),
|
|
@@ -55138,7 +55288,7 @@ function EntityTablePageBody({
|
|
|
55138
55288
|
rowNoun: (entity.label ?? "record").toLowerCase(),
|
|
55139
55289
|
enabled: layout === "grid"
|
|
55140
55290
|
});
|
|
55141
|
-
return /* @__PURE__ */ jsxs166("div", { className:
|
|
55291
|
+
return /* @__PURE__ */ jsxs166("div", { className: cn102("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
|
|
55142
55292
|
presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ jsxs166("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
55143
55293
|
presentation === "page" ? /* @__PURE__ */ jsx179("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
|
|
55144
55294
|
presentation === "page" ? /* @__PURE__ */ jsx179("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : formatCount8(entity.total) }) : null,
|
|
@@ -55237,7 +55387,7 @@ function TablePage2(props) {
|
|
|
55237
55387
|
import { useEffect as useEffect127, useMemo as useMemo84 } from "react";
|
|
55238
55388
|
import { isEntityReferenceConfig } from "@ai-matrx/records";
|
|
55239
55389
|
import { useFields as useFields40, useTable as useTable41 } from "@ai-matrx/records/react";
|
|
55240
|
-
import { BasicInput as BasicInput36, Button as Button122, CreatablePicker as CreatablePicker3, cn as
|
|
55390
|
+
import { BasicInput as BasicInput36, Button as Button122, CreatablePicker as CreatablePicker3, cn as cn103 } from "@ai-matrx/design-system";
|
|
55241
55391
|
import { jsx as jsx181, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
55242
55392
|
var DATA_BINDING_SHAPES = [
|
|
55243
55393
|
{ value: "collection", label: "The whole table" },
|
|
@@ -55413,7 +55563,7 @@ function BindingDetails({
|
|
|
55413
55563
|
/* @__PURE__ */ jsx181(
|
|
55414
55564
|
"textarea",
|
|
55415
55565
|
{
|
|
55416
|
-
className:
|
|
55566
|
+
className: cn103(
|
|
55417
55567
|
"min-h-[3.5rem] w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs"
|
|
55418
55568
|
),
|
|
55419
55569
|
"aria-label": "Each row reads as",
|