@ai-matrx/records-ui 0.116.76 → 0.116.77
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 +4 -8342
- package/dist/{chunk-D2FZEAYO.js → chunk-P7GVWT6U.js} +341 -325
- package/dist/chunk-P7GVWT6U.js.map +1 -0
- package/dist/index.cjs +50 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/pickers.cjs +43 -27
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-D2FZEAYO.js.map +0 -1
|
@@ -2037,7 +2037,7 @@ function ReferenceBuilder({
|
|
|
2037
2037
|
}
|
|
2038
2038
|
|
|
2039
2039
|
// src/ChoiceListEditor.tsx
|
|
2040
|
-
import { useEffect as useEffect23, useRef as
|
|
2040
|
+
import { useEffect as useEffect23, useRef as useRef18, useState as useState33 } from "react";
|
|
2041
2041
|
import { optionLabel as optionLabel2, recordsUseSentence, rehomeSentence } from "@ai-matrx/records";
|
|
2042
2042
|
import { useRecordsClient as useRecordsClient9 } from "@ai-matrx/records/react";
|
|
2043
2043
|
import {
|
|
@@ -2095,7 +2095,7 @@ function AddChoicesInline({ field: field2, onAdded, disabled = false }) {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
2097
2097
|
// src/editors.tsx
|
|
2098
|
-
import { useCallback as useCallback7, useEffect as useEffect22, useLayoutEffect as useLayoutEffect3, useRef as
|
|
2098
|
+
import { useCallback as useCallback7, useEffect as useEffect22, useLayoutEffect as useLayoutEffect3, useRef as useRef17, useState as useState32 } from "react";
|
|
2099
2099
|
import { isButtonField as isButtonField2, allowsOtherValues, choiceValuesOf, coerceTypedAnswer, newerKindOf as newerKindOf2, decideTypedChoice, isTheChosen, optionKey as optionKey4, rankTypedMatches as rankTypedMatches4, readTypedTime as readTypedTime2, typedDateText as typedDateText2, typedTimeText as typedTimeText2 } from "@ai-matrx/records";
|
|
2100
2100
|
import { useOptionalRecordsClient as useOptionalRecordsClient12 } from "@ai-matrx/records/react";
|
|
2101
2101
|
import {
|
|
@@ -2781,7 +2781,7 @@ function readableLink(raw) {
|
|
|
2781
2781
|
}
|
|
2782
2782
|
|
|
2783
2783
|
// src/buttonCell.tsx
|
|
2784
|
-
import { useContext as useContext3, useEffect as useEffect20, useRef as
|
|
2784
|
+
import { useContext as useContext3, useEffect as useEffect20, useRef as useRef14, useState as useState28 } from "react";
|
|
2785
2785
|
import { Button as Button16, Dialog as Dialog3, ErrorBox as ErrorBox2, DialogContent as DialogContent3, DialogDescription, DialogHeader as DialogHeader3, DialogTitle as DialogTitle3, Popover as Popover4, PopoverContent as PopoverContent4, PopoverTrigger as PopoverTrigger4, cn as cn18 } from "@ai-matrx/design-system";
|
|
2786
2786
|
import { CHOICE_CHIP_CLASS, NEUTRAL_CHIP_CLASS, isStyleColor } from "@ai-matrx/design-system/data-table";
|
|
2787
2787
|
import { buttonNeeds as buttonNeeds2, buttonOf as buttonOf2 } from "@ai-matrx/records";
|
|
@@ -2922,7 +2922,7 @@ function columnNameProblemLine(name, noun = "column") {
|
|
|
2922
2922
|
}
|
|
2923
2923
|
|
|
2924
2924
|
// src/FieldEditor.tsx
|
|
2925
|
-
import { useEffect as useEffect19, useMemo as
|
|
2925
|
+
import { useEffect as useEffect19, useMemo as useMemo11, useRef as useRef13, useState as useState27 } from "react";
|
|
2926
2926
|
import {
|
|
2927
2927
|
tableShapeChanged as tableShapeChanged3,
|
|
2928
2928
|
useEntityFieldMutation,
|
|
@@ -3588,23 +3588,47 @@ function WholeValueEditor({
|
|
|
3588
3588
|
import { formatPhone as formatPhone2 } from "@ai-matrx/design-system/field-formats";
|
|
3589
3589
|
|
|
3590
3590
|
// src/formattedValue.tsx
|
|
3591
|
-
import { useRef as
|
|
3591
|
+
import { useRef as useRef9 } from "react";
|
|
3592
3592
|
import { FormattedCell } from "@ai-matrx/design-system/data-table";
|
|
3593
3593
|
import { formatFieldValue as formatFieldValue2, formatPhone, getFieldFormat } from "@ai-matrx/design-system/field-formats";
|
|
3594
3594
|
import { cn as cn10 } from "@ai-matrx/design-system";
|
|
3595
3595
|
import { OutboundLink as OutboundLink3 } from "@ai-matrx/kit/outbound-react";
|
|
3596
3596
|
|
|
3597
3597
|
// src/LinkPreviewCard.tsx
|
|
3598
|
-
import { useEffect as useEffect10,
|
|
3599
|
-
import {
|
|
3600
|
-
import { Fragment as Fragment9, jsx as jsx19
|
|
3598
|
+
import { useEffect as useEffect10, useMemo as useMemo8, useState as useState15 } from "react";
|
|
3599
|
+
import { Peek, PeekHoverCard } from "@ai-matrx/design-system";
|
|
3600
|
+
import { Fragment as Fragment9, jsx as jsx19 } from "react/jsx-runtime";
|
|
3601
3601
|
var answers = /* @__PURE__ */ new Map();
|
|
3602
|
+
function hostOf(url) {
|
|
3603
|
+
try {
|
|
3604
|
+
return new URL(url).hostname.replace(/^www\./, "");
|
|
3605
|
+
} catch {
|
|
3606
|
+
return url;
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
function linkPreviewRecord(url, shown2) {
|
|
3610
|
+
const site = shown2.siteName?.trim() || hostOf(url);
|
|
3611
|
+
const title = shown2.title?.trim() || site;
|
|
3612
|
+
return {
|
|
3613
|
+
kind: "Link",
|
|
3614
|
+
id: url,
|
|
3615
|
+
showId: false,
|
|
3616
|
+
title,
|
|
3617
|
+
...shown2.siteName || shown2.title ? { subtitle: site } : {},
|
|
3618
|
+
avatar: { initials: site.slice(0, 1).toUpperCase(), ...shown2.faviconUrl ? { src: shown2.faviconUrl } : {} },
|
|
3619
|
+
...shown2.imageUrl ? { media: { alt: title, src: shown2.imageUrl, aspect: "16:9" } } : {},
|
|
3620
|
+
...shown2.description ? { body: [{ section: "Description", text: shown2.description, clamp: 3 }] } : {},
|
|
3621
|
+
href: url,
|
|
3622
|
+
copyData: { url, title: shown2.title, description: shown2.description, site: shown2.siteName }
|
|
3623
|
+
};
|
|
3624
|
+
}
|
|
3602
3625
|
function LinkPreviewCard({ url, children }) {
|
|
3603
3626
|
const port = useRecordsUi().linkPreview;
|
|
3604
3627
|
const [preview, setPreview] = useState15(void 0);
|
|
3605
3628
|
const [open, setOpen] = useState15(false);
|
|
3606
|
-
const
|
|
3607
|
-
|
|
3629
|
+
const shown2 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
3630
|
+
const record = useMemo8(() => shown2 ? linkPreviewRecord(url, shown2) : null, [url, shown2]);
|
|
3631
|
+
useEffect10(() => setPreview(void 0), [url]);
|
|
3608
3632
|
if (!port) return /* @__PURE__ */ jsx19(Fragment9, { children });
|
|
3609
3633
|
const ask = () => {
|
|
3610
3634
|
if (preview !== void 0) return;
|
|
@@ -3615,35 +3639,27 @@ function LinkPreviewCard({ url, children }) {
|
|
|
3615
3639
|
}
|
|
3616
3640
|
void pending.then((found) => setPreview(found));
|
|
3617
3641
|
};
|
|
3618
|
-
const
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5", children: [
|
|
3636
|
-
/* @__PURE__ */ jsx19(SiteIcon, { site: url, iconUrl: shown2.faviconUrl, className: "h-3.5 w-3.5" }),
|
|
3637
|
-
/* @__PURE__ */ jsx19("span", { className: "truncate text-muted-foreground", children: shown2.siteName ?? "" })
|
|
3638
|
-
] }),
|
|
3639
|
-
shown2.title ? /* @__PURE__ */ jsx19("div", { className: "line-clamp-2 font-medium", children: shown2.title }) : null,
|
|
3640
|
-
shown2.description ? /* @__PURE__ */ jsx19("div", { className: "line-clamp-3 text-muted-foreground", children: shown2.description }) : null
|
|
3641
|
-
] }) : null
|
|
3642
|
-
] });
|
|
3642
|
+
const chip = /* @__PURE__ */ jsx19("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: ask, onFocus: ask, children });
|
|
3643
|
+
return /* @__PURE__ */ jsx19(
|
|
3644
|
+
PeekHoverCard,
|
|
3645
|
+
{
|
|
3646
|
+
trigger: chip,
|
|
3647
|
+
label: record?.title ?? "Link",
|
|
3648
|
+
side: "bottom",
|
|
3649
|
+
align: "start",
|
|
3650
|
+
presentation: "float",
|
|
3651
|
+
open: open && record !== null,
|
|
3652
|
+
onOpenChange: (next) => {
|
|
3653
|
+
if (next) ask();
|
|
3654
|
+
setOpen(next);
|
|
3655
|
+
},
|
|
3656
|
+
children: record ? /* @__PURE__ */ jsx19(Peek, { record, size: "sm" }) : /* @__PURE__ */ jsx19(Fragment9, {})
|
|
3657
|
+
}
|
|
3658
|
+
);
|
|
3643
3659
|
}
|
|
3644
3660
|
|
|
3645
3661
|
// src/formattedValue.tsx
|
|
3646
|
-
import { jsx as jsx20, jsxs as
|
|
3662
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3647
3663
|
var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
|
|
3648
3664
|
var own2 = (event) => event.stopPropagation();
|
|
3649
3665
|
function numberOf3(value) {
|
|
@@ -3661,7 +3677,7 @@ function RatingStars({
|
|
|
3661
3677
|
label,
|
|
3662
3678
|
selectFirst
|
|
3663
3679
|
}) {
|
|
3664
|
-
const armed =
|
|
3680
|
+
const armed = useRef9(true);
|
|
3665
3681
|
const score = numberOf3(value) ?? 0;
|
|
3666
3682
|
const shown2 = Math.round(score);
|
|
3667
3683
|
const said2 = `${shown2} out of ${max}`;
|
|
@@ -3732,7 +3748,7 @@ function rich(id, text, raw, format) {
|
|
|
3732
3748
|
if (n === null) return void 0;
|
|
3733
3749
|
const pct = format.options?.percentScale === "fraction" ? n * 100 : n;
|
|
3734
3750
|
const clamped = Math.max(0, Math.min(100, pct));
|
|
3735
|
-
return /* @__PURE__ */
|
|
3751
|
+
return /* @__PURE__ */ jsxs16("span", { className: "inline-flex w-full min-w-0 items-center gap-2", title: text, children: [
|
|
3736
3752
|
/* @__PURE__ */ jsx20(
|
|
3737
3753
|
"span",
|
|
3738
3754
|
{
|
|
@@ -3748,7 +3764,7 @@ function rich(id, text, raw, format) {
|
|
|
3748
3764
|
] });
|
|
3749
3765
|
}
|
|
3750
3766
|
case "color":
|
|
3751
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
3752
3768
|
/* @__PURE__ */ jsx20("span", { className: "h-4 w-4 shrink-0 rounded border border-border", style: { backgroundColor: text } }),
|
|
3753
3769
|
/* @__PURE__ */ jsx20("code", { className: "font-mono text-xs", children: text })
|
|
3754
3770
|
] });
|
|
@@ -3796,11 +3812,11 @@ function linkChipText(raw) {
|
|
|
3796
3812
|
}
|
|
3797
3813
|
|
|
3798
3814
|
// src/gridAttachments.tsx
|
|
3799
|
-
import { useEffect as useEffect11, useRef as
|
|
3815
|
+
import { useEffect as useEffect11, useRef as useRef10, useState as useState16 } from "react";
|
|
3800
3816
|
import { useOptionalRecordsClient as useOptionalRecordsClient6 } from "@ai-matrx/records/react";
|
|
3801
3817
|
import { Badge as Badge3, Button as Button8, cn as cn11, Dialog, DialogContent, DialogHeader, DialogTitle } from "@ai-matrx/design-system";
|
|
3802
3818
|
import { OutboundLink as OutboundLink4 } from "@ai-matrx/kit/outbound-react";
|
|
3803
|
-
import { jsx as jsx21, jsxs as
|
|
3819
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3804
3820
|
function attachmentIdsOf(value) {
|
|
3805
3821
|
return idsOf(value);
|
|
3806
3822
|
}
|
|
@@ -3860,7 +3876,7 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
3860
3876
|
const href = read?.fileId ? host.hrefForFile?.({ fileId: read.fileId }) : void 0;
|
|
3861
3877
|
const title = onPreview ? `Preview ${words}` : href ? `Open ${words}` : read?.why ?? FILE_CHIP_NO_PAGE;
|
|
3862
3878
|
if (read?.fileId && read.mime?.startsWith("image/") && host.fileImage) {
|
|
3863
|
-
return /* @__PURE__ */
|
|
3879
|
+
return /* @__PURE__ */ jsxs17("span", { className: "relative inline-flex shrink-0", "data-records-file-thumb": id, children: [
|
|
3864
3880
|
/* @__PURE__ */ jsx21(
|
|
3865
3881
|
"button",
|
|
3866
3882
|
{
|
|
@@ -3896,7 +3912,7 @@ function AttachmentChip({ id, onRemove, onPreview }) {
|
|
|
3896
3912
|
) : null
|
|
3897
3913
|
] });
|
|
3898
3914
|
}
|
|
3899
|
-
return /* @__PURE__ */
|
|
3915
|
+
return /* @__PURE__ */ jsxs17(
|
|
3900
3916
|
Badge3,
|
|
3901
3917
|
{
|
|
3902
3918
|
variant: "secondary",
|
|
@@ -3960,7 +3976,7 @@ function AttachmentChips({ value, onRemove }) {
|
|
|
3960
3976
|
const [viewing, setViewing] = useState16(null);
|
|
3961
3977
|
if (ids.length === 0) return null;
|
|
3962
3978
|
const canPreview = Boolean(host.fileImage);
|
|
3963
|
-
return /* @__PURE__ */
|
|
3979
|
+
return /* @__PURE__ */ jsxs17("span", { className: "flex flex-wrap gap-1", "data-records-file-chips": "", children: [
|
|
3964
3980
|
ids.map((id, index) => /* @__PURE__ */ jsx21(
|
|
3965
3981
|
AttachmentChip,
|
|
3966
3982
|
{
|
|
@@ -3988,7 +4004,7 @@ function AttachmentViewer({
|
|
|
3988
4004
|
const name = read?.name ?? (read ? FILE_CHIP_UNREAD : "\u2026");
|
|
3989
4005
|
const href = read?.fileId ? host.hrefForFile?.({ fileId: read.fileId }) : void 0;
|
|
3990
4006
|
const go = (way) => onIndex(stepAttachment(index, ids.length, way));
|
|
3991
|
-
return /* @__PURE__ */ jsx21(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */
|
|
4007
|
+
return /* @__PURE__ */ jsx21(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs17(
|
|
3992
4008
|
DialogContent,
|
|
3993
4009
|
{
|
|
3994
4010
|
className: "sm:max-w-3xl",
|
|
@@ -4018,10 +4034,10 @@ function AttachmentViewer({
|
|
|
4018
4034
|
children: [
|
|
4019
4035
|
/* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { className: "truncate text-sm", children: name }) }),
|
|
4020
4036
|
/* @__PURE__ */ jsx21("div", { className: "relative h-[60vh] w-full overflow-hidden rounded-md bg-muted", "data-records-attachment-stage": "", children: read?.fileId ? host.fileImage?.({ fileId: read.fileId, alt: name }) : null }),
|
|
4021
|
-
/* @__PURE__ */
|
|
4037
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
4022
4038
|
/* @__PURE__ */ jsx21(Button8, { size: "sm", variant: "outline", "aria-label": "Previous file", disabled: index === 0, onClick: () => go(-1), "data-records-attachment-previous": "", children: "\u2190" }),
|
|
4023
4039
|
/* @__PURE__ */ jsx21(Button8, { size: "sm", variant: "outline", "aria-label": "Next file", disabled: index >= ids.length - 1, onClick: () => go(1), "data-records-attachment-next": "", children: "\u2192" }),
|
|
4024
|
-
/* @__PURE__ */
|
|
4040
|
+
/* @__PURE__ */ jsxs17("span", { className: "text-xs tabular-nums text-muted-foreground", "data-records-attachment-position": "", children: [
|
|
4025
4041
|
index + 1,
|
|
4026
4042
|
" of ",
|
|
4027
4043
|
ids.length
|
|
@@ -4047,7 +4063,7 @@ function AttachmentControl({
|
|
|
4047
4063
|
const host = useRecordsUi();
|
|
4048
4064
|
const [busy, setBusy] = useState16(false);
|
|
4049
4065
|
const [why, setWhy] = useState16(null);
|
|
4050
|
-
const latest =
|
|
4066
|
+
const latest = useRef10(value);
|
|
4051
4067
|
latest.current = value;
|
|
4052
4068
|
const multiple = Boolean(field2.multi);
|
|
4053
4069
|
const pick = async () => {
|
|
@@ -4068,7 +4084,7 @@ function AttachmentControl({
|
|
|
4068
4084
|
setBusy(false);
|
|
4069
4085
|
onClose?.();
|
|
4070
4086
|
};
|
|
4071
|
-
const opened =
|
|
4087
|
+
const opened = useRef10(false);
|
|
4072
4088
|
useEffect11(() => {
|
|
4073
4089
|
if (!autoOpen || opened.current || !host.pickFiles) return;
|
|
4074
4090
|
opened.current = true;
|
|
@@ -4077,7 +4093,7 @@ function AttachmentControl({
|
|
|
4077
4093
|
if (!hostTakesFiles(host)) {
|
|
4078
4094
|
return /* @__PURE__ */ jsx21("p", { id, className: "rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", "data-records-no-file-door": "", children: NO_UPLOAD_REASON });
|
|
4079
4095
|
}
|
|
4080
|
-
return /* @__PURE__ */
|
|
4096
|
+
return /* @__PURE__ */ jsxs17("span", { id, className: "flex flex-col gap-1", "data-records-attachment-editor": "", children: [
|
|
4081
4097
|
/* @__PURE__ */ jsx21(
|
|
4082
4098
|
AttachmentChips,
|
|
4083
4099
|
{
|
|
@@ -4085,7 +4101,7 @@ function AttachmentControl({
|
|
|
4085
4101
|
...disabled ? {} : { onRemove: (removed) => onChange(withoutAttached(field2, latest.current, removed)) }
|
|
4086
4102
|
}
|
|
4087
4103
|
),
|
|
4088
|
-
/* @__PURE__ */
|
|
4104
|
+
/* @__PURE__ */ jsxs17("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
4089
4105
|
host.pickFiles ? /* @__PURE__ */ jsx21(Button8, { size: "sm", variant: "outline", disabled: disabled || busy, onClick: () => void pick(), "data-records-attach-files": "", children: busy ? "Choosing\u2026" : attachmentIdsOf(value).length > 0 ? "Add files\u2026" : "Attach files\u2026" }) : null,
|
|
4090
4106
|
host.upload ? /* @__PURE__ */ jsx21(
|
|
4091
4107
|
FilePicker,
|
|
@@ -4114,7 +4130,7 @@ function AttachmentControl({
|
|
|
4114
4130
|
// src/ReferenceChips.tsx
|
|
4115
4131
|
import { entityRefsOf as entityRefsOf2 } from "@ai-matrx/records";
|
|
4116
4132
|
import { Badge as Badge4, Skeleton as Skeleton2, cn as cn12 } from "@ai-matrx/design-system";
|
|
4117
|
-
import { jsx as jsx22, jsxs as
|
|
4133
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4118
4134
|
function glyphOf(icon) {
|
|
4119
4135
|
const text = (icon ?? "").trim();
|
|
4120
4136
|
return text !== "" && text.length <= 8 && /[^\u0000-\u007f]/.test(text) ? text : null;
|
|
@@ -4147,7 +4163,7 @@ function referenceChipsOf(field2, value, kind, labels) {
|
|
|
4147
4163
|
var ARCHIVED_REFERENCE_WORD = "Archived";
|
|
4148
4164
|
var ARCHIVED_REFERENCE_TIP = "In the Archived view; restore it to use it again";
|
|
4149
4165
|
function PageGlyph() {
|
|
4150
|
-
return /* @__PURE__ */
|
|
4166
|
+
return /* @__PURE__ */ jsxs18("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: 14, height: 14, fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "data-records-page-glyph": "", children: [
|
|
4151
4167
|
/* @__PURE__ */ jsx22("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
4152
4168
|
/* @__PURE__ */ jsx22("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
4153
4169
|
/* @__PURE__ */ jsx22("path", { d: "M10 13H8" }),
|
|
@@ -4162,7 +4178,7 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
4162
4178
|
const words = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
|
|
4163
4179
|
const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words }) : null;
|
|
4164
4180
|
if (look?.plainRelation) {
|
|
4165
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsxs18(
|
|
4166
4182
|
"span",
|
|
4167
4183
|
{
|
|
4168
4184
|
className: cn12(
|
|
@@ -4181,7 +4197,7 @@ function ReferenceChip({ reference, waiting }) {
|
|
|
4181
4197
|
}
|
|
4182
4198
|
);
|
|
4183
4199
|
}
|
|
4184
|
-
return /* @__PURE__ */
|
|
4200
|
+
return /* @__PURE__ */ jsxs18(
|
|
4185
4201
|
Badge4,
|
|
4186
4202
|
{
|
|
4187
4203
|
variant: "secondary",
|
|
@@ -4217,9 +4233,9 @@ function KindValueCell({
|
|
|
4217
4233
|
}
|
|
4218
4234
|
|
|
4219
4235
|
// src/ClampedChips.tsx
|
|
4220
|
-
import { useCallback as useCallback5, useLayoutEffect, useRef as
|
|
4236
|
+
import { useCallback as useCallback5, useLayoutEffect, useRef as useRef11, useState as useState17 } from "react";
|
|
4221
4237
|
import { Popover as Popover2, PopoverContent as PopoverContent2, PopoverTrigger as PopoverTrigger2, cn as cn13 } from "@ai-matrx/design-system";
|
|
4222
|
-
import { jsx as jsx23, jsxs as
|
|
4238
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4223
4239
|
var GAP = 4;
|
|
4224
4240
|
var OVERFLOW_ROOM = 34;
|
|
4225
4241
|
function ClampedChips({
|
|
@@ -4229,7 +4245,7 @@ function ClampedChips({
|
|
|
4229
4245
|
className,
|
|
4230
4246
|
dataAttr
|
|
4231
4247
|
}) {
|
|
4232
|
-
const box =
|
|
4248
|
+
const box = useRef11(null);
|
|
4233
4249
|
const [fit, setFit] = useState17(null);
|
|
4234
4250
|
const [measuring, setMeasuring] = useState17(true);
|
|
4235
4251
|
const count = items.length;
|
|
@@ -4285,7 +4301,7 @@ function ClampedChips({
|
|
|
4285
4301
|
}, []);
|
|
4286
4302
|
const shown2 = measuring || fit === null ? items : items.slice(0, fit);
|
|
4287
4303
|
const hidden = stands - shown2.length;
|
|
4288
|
-
return /* @__PURE__ */
|
|
4304
|
+
return /* @__PURE__ */ jsxs19(
|
|
4289
4305
|
"span",
|
|
4290
4306
|
{
|
|
4291
4307
|
ref: box,
|
|
@@ -4293,8 +4309,8 @@ function ClampedChips({
|
|
|
4293
4309
|
"data-records-clamped": dataAttr ?? "",
|
|
4294
4310
|
children: [
|
|
4295
4311
|
shown2.map((item) => /* @__PURE__ */ jsx23("span", { "data-clamp-item": "", className: "inline-flex min-w-0 shrink-0 max-w-full", children: item.node }, item.key)),
|
|
4296
|
-
!measuring && hidden > 0 ? /* @__PURE__ */
|
|
4297
|
-
/* @__PURE__ */ jsx23(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */
|
|
4312
|
+
!measuring && hidden > 0 ? /* @__PURE__ */ jsxs19(Popover2, { children: [
|
|
4313
|
+
/* @__PURE__ */ jsx23(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs19(
|
|
4298
4314
|
"button",
|
|
4299
4315
|
{
|
|
4300
4316
|
type: "button",
|
|
@@ -4516,7 +4532,7 @@ import { Button as Button9 } from "@ai-matrx/design-system";
|
|
|
4516
4532
|
import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
|
|
4517
4533
|
|
|
4518
4534
|
// src/memberNames.ts
|
|
4519
|
-
import { useEffect as useEffect12, useMemo as
|
|
4535
|
+
import { useEffect as useEffect12, useMemo as useMemo9, useState as useState18 } from "react";
|
|
4520
4536
|
import { useOptionalRecordsClient as useOptionalRecordsClient7 } from "@ai-matrx/records/react";
|
|
4521
4537
|
import { isUuidShape as isUuidShape2 } from "@ai-matrx/kit/uuid";
|
|
4522
4538
|
function memberWords(member) {
|
|
@@ -4562,7 +4578,7 @@ async function resolveKeptPerson(client, id, roster) {
|
|
|
4562
4578
|
}
|
|
4563
4579
|
function useKeptPeople(value, roster) {
|
|
4564
4580
|
const client = useOptionalRecordsClient7();
|
|
4565
|
-
const ids =
|
|
4581
|
+
const ids = useMemo9(() => (Array.isArray(value) ? value : [value]).filter(isUuidShape2), [value]);
|
|
4566
4582
|
const key = ids.join(",");
|
|
4567
4583
|
const [people, setPeople] = useState18(null);
|
|
4568
4584
|
useEffect12(() => {
|
|
@@ -4577,7 +4593,7 @@ function useKeptPeople(value, roster) {
|
|
|
4577
4593
|
}
|
|
4578
4594
|
|
|
4579
4595
|
// src/RetiredValues.tsx
|
|
4580
|
-
import { jsx as jsx24, jsxs as
|
|
4596
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4581
4597
|
function same(a, b) {
|
|
4582
4598
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
4583
4599
|
}
|
|
@@ -4649,7 +4665,7 @@ function RetiredValues({
|
|
|
4649
4665
|
setSaid(`Put back as version ${done.data.version}.`);
|
|
4650
4666
|
onRestored?.();
|
|
4651
4667
|
};
|
|
4652
|
-
return /* @__PURE__ */
|
|
4668
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-1", "data-records-retired": "", children: [
|
|
4653
4669
|
/* @__PURE__ */ jsx24("span", { className: "font-medium", children: "Kept aside" }),
|
|
4654
4670
|
kept.map((entry, index) => {
|
|
4655
4671
|
const id = `${entry.key}-${index}`;
|
|
@@ -4657,15 +4673,15 @@ function RetiredValues({
|
|
|
4657
4673
|
const name = field2 ? fieldName(field2) : entry.label ?? entry.key;
|
|
4658
4674
|
const shown2 = field2 ? scalarText(field2, entry.value) : typeof entry.value === "string" ? entry.value : JSON.stringify(entry.value);
|
|
4659
4675
|
const holdsUserId = (Array.isArray(entry.value) ? entry.value : [entry.value]).some(isUuidShape3);
|
|
4660
|
-
return /* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-0.5", "data-records-retired-key": entry.key, children: [
|
|
4677
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-baseline gap-2", children: [
|
|
4662
4678
|
/* @__PURE__ */ jsx24("span", { className: "text-muted-foreground", children: name }),
|
|
4663
4679
|
holdsUserId ? /* @__PURE__ */ jsx24(KeptPeople, { value: entry.value, roster }) : /* @__PURE__ */ jsx24("span", { className: "min-w-0 break-words", children: shown2 }),
|
|
4664
4680
|
mayWrite ? /* @__PURE__ */ jsx24(Button9, { size: "sm", variant: "outline", className: "h-6 px-2 text-xs", disabled: busy !== null, onClick: () => void restore(entry, index), "data-records-retired-restore": "", children: busy === id ? "Restoring\u2026" : "Restore" }) : null
|
|
4665
4681
|
] }),
|
|
4666
4682
|
entry.reason ? /* @__PURE__ */ jsx24("p", { className: "text-[11px] text-muted-foreground", children: withoutInternalCodes(entry.reason) }) : null,
|
|
4667
4683
|
refusal?.key === id ? /* @__PURE__ */ jsx24(RefusalNotice, { error: refusal.error }) : null,
|
|
4668
|
-
missing === id ? /* @__PURE__ */
|
|
4684
|
+
missing === id ? /* @__PURE__ */ jsxs20("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
4669
4685
|
"No earlier version of ",
|
|
4670
4686
|
name,
|
|
4671
4687
|
" holds this value, so it cannot be put back from here."
|
|
@@ -4787,7 +4803,7 @@ import { AlchemyMenu } from "@ai-matrx/alchemy/react";
|
|
|
4787
4803
|
import { OutboundLink as OutboundLink5 } from "@ai-matrx/kit/outbound-react";
|
|
4788
4804
|
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
4789
4805
|
import { momentZoneOptions } from "@ai-matrx/design-system/field-formats";
|
|
4790
|
-
import { jsx as jsx26, jsxs as
|
|
4806
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4791
4807
|
var SaveToTable = lazy(() => import("./SaveToTable-HQREESNE.js").then((m) => ({ default: m.SaveToTable })));
|
|
4792
4808
|
var LONGEST_READ = 5e5;
|
|
4793
4809
|
var FENCE = /^```(?:json)?[ \t]*\r?\n([\s\S]*?)\r?\n?```$/;
|
|
@@ -4913,7 +4929,7 @@ function Thumb({ src, size }) {
|
|
|
4913
4929
|
) });
|
|
4914
4930
|
}
|
|
4915
4931
|
function LinkChip({ href, dense }) {
|
|
4916
|
-
return /* @__PURE__ */
|
|
4932
|
+
return /* @__PURE__ */ jsxs21(
|
|
4917
4933
|
OutboundLink5,
|
|
4918
4934
|
{
|
|
4919
4935
|
href,
|
|
@@ -4957,8 +4973,8 @@ function RecordsTable({ items }) {
|
|
|
4957
4973
|
const keys = keysOf(items).filter((k) => k !== "__kind");
|
|
4958
4974
|
const pictureFirst = [...keys].sort((a, b) => rank(a, items) - rank(b, items)).slice(0, TABLE_COLUMNS);
|
|
4959
4975
|
const shown2 = all ? items : items.slice(0, TABLE_ROWS);
|
|
4960
|
-
return /* @__PURE__ */
|
|
4961
|
-
/* @__PURE__ */ jsx26("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", "data-records-structured-table-frame": "", children: /* @__PURE__ */
|
|
4976
|
+
return /* @__PURE__ */ jsxs21("div", { className: "min-w-0", "data-records-structured": "table", children: [
|
|
4977
|
+
/* @__PURE__ */ jsx26("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", "data-records-structured-table-frame": "", children: /* @__PURE__ */ jsxs21("table", { className: "w-full border-collapse text-xs", children: [
|
|
4962
4978
|
/* @__PURE__ */ jsx26("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ jsx26("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ jsx26("th", { scope: "col", className: "px-2 py-1 font-medium text-muted-foreground [overflow-wrap:anywhere]", children: structuredKeyWords(k) }, k)) }) }),
|
|
4963
4979
|
/* @__PURE__ */ jsx26("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ jsx26("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx26("td", { className: "min-w-[2rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ jsx26(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
|
|
4964
4980
|
] }) }),
|
|
@@ -5030,8 +5046,8 @@ function StructuredValueView({ structured, label, className }) {
|
|
|
5030
5046
|
const ui = useRecordsUi();
|
|
5031
5047
|
const savable = shapeOfValue(structured.data) !== null;
|
|
5032
5048
|
const text = rawTextOf(structured);
|
|
5033
|
-
return /* @__PURE__ */
|
|
5034
|
-
/* @__PURE__ */
|
|
5049
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn14("flex min-w-0 flex-col gap-1.5 whitespace-normal", className), "data-records-structured-view": "", children: [
|
|
5050
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 items-center gap-1", onClick: stop, children: [
|
|
5035
5051
|
/* @__PURE__ */ jsx26("span", { className: "min-w-0 flex-1 truncate text-xs text-muted-foreground", children: recordsCount(structured.data) }),
|
|
5036
5052
|
savable ? /* @__PURE__ */ jsx26(Button10, { type: "button", variant: "ghost", size: "sm", className: "h-6 px-2 text-xs", onClick: () => setSaving(true), "data-records-structured-save": "", children: "Save as table" }) : null,
|
|
5037
5053
|
/* @__PURE__ */ jsx26(
|
|
@@ -5052,8 +5068,8 @@ function StructuredValueView({ structured, label, className }) {
|
|
|
5052
5068
|
raw ? /* @__PURE__ */ jsx26("pre", { className: "max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/60 p-2 font-mono text-xs", "data-records-structured-raw": "", children: structured.raw !== null ? prettyJsonText(structured.raw) : text }) : /* @__PURE__ */ jsx26(Shape, { data: structured.data }),
|
|
5053
5069
|
saving ? /* @__PURE__ */ jsx26(Dialog2, { open: true, onOpenChange: (open) => {
|
|
5054
5070
|
if (!open) setSaving(false);
|
|
5055
|
-
}, children: /* @__PURE__ */
|
|
5056
|
-
/* @__PURE__ */ jsx26(DialogHeader2, { children: /* @__PURE__ */
|
|
5071
|
+
}, children: /* @__PURE__ */ jsxs21(DialogContent2, { className: "max-h-[90vh] max-w-3xl overflow-y-auto", children: [
|
|
5072
|
+
/* @__PURE__ */ jsx26(DialogHeader2, { children: /* @__PURE__ */ jsxs21(DialogTitle2, { children: [
|
|
5057
5073
|
"Save ",
|
|
5058
5074
|
label,
|
|
5059
5075
|
" as a table"
|
|
@@ -5080,8 +5096,8 @@ function StructuredCell({ structured, label }) {
|
|
|
5080
5096
|
const summary = structuredSummary(structured.data);
|
|
5081
5097
|
const first = Array.isArray(structured.data) ? structured.data.find(isPlainObject) : structured.data;
|
|
5082
5098
|
const picture = isPlainObject(first) ? Object.entries(first).find(([k, v]) => isImageUrl(v, k))?.[1] : void 0;
|
|
5083
|
-
return /* @__PURE__ */
|
|
5084
|
-
/* @__PURE__ */ jsx26(PopoverTrigger3, { asChild: true, children: /* @__PURE__ */
|
|
5099
|
+
return /* @__PURE__ */ jsxs21(Popover3, { children: [
|
|
5100
|
+
/* @__PURE__ */ jsx26(PopoverTrigger3, { asChild: true, children: /* @__PURE__ */ jsxs21(
|
|
5085
5101
|
"button",
|
|
5086
5102
|
{
|
|
5087
5103
|
type: "button",
|
|
@@ -5110,7 +5126,7 @@ function StructuredCell({ structured, label }) {
|
|
|
5110
5126
|
}
|
|
5111
5127
|
|
|
5112
5128
|
// src/values.tsx
|
|
5113
|
-
import { Fragment as Fragment10, jsx as jsx27, jsxs as
|
|
5129
|
+
import { Fragment as Fragment10, jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5114
5130
|
function statusMark(field2, item, document2) {
|
|
5115
5131
|
const mark = statusMarkOf(field2, item, document2);
|
|
5116
5132
|
return mark ? /* @__PURE__ */ jsx27("span", { "aria-label": mark.words, title: mark.words, className: "mr-1", "data-records-status-group": mark.group, children: mark.mark }) : null;
|
|
@@ -5222,7 +5238,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look, ro
|
|
|
5222
5238
|
const items = Array.isArray(value) ? value : [value];
|
|
5223
5239
|
return /* @__PURE__ */ jsx27("span", { className: "flex flex-wrap gap-1", "data-records-choice-chips": "", children: items.map((item, i) => {
|
|
5224
5240
|
const chip = chipOf(item);
|
|
5225
|
-
return /* @__PURE__ */
|
|
5241
|
+
return /* @__PURE__ */ jsxs22(
|
|
5226
5242
|
Badge6,
|
|
5227
5243
|
{
|
|
5228
5244
|
variant: "outline",
|
|
@@ -5247,7 +5263,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look, ro
|
|
|
5247
5263
|
if (pictureAt) return /* @__PURE__ */ jsx27(ImageUrlValue, { url: pictureAt, alt: field2.label || field2.key, room });
|
|
5248
5264
|
if (kind === "url" && typeof value === "string") {
|
|
5249
5265
|
const href = value.includes("://") ? value : `https://${value}`;
|
|
5250
|
-
return /* @__PURE__ */ jsx27(LinkPreviewCard, { url: href, children: /* @__PURE__ */
|
|
5266
|
+
return /* @__PURE__ */ jsx27(LinkPreviewCard, { url: href, children: /* @__PURE__ */ jsxs22(
|
|
5251
5267
|
OutboundLink6,
|
|
5252
5268
|
{
|
|
5253
5269
|
className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent",
|
|
@@ -5471,7 +5487,7 @@ function cardWords(record, field2, labels) {
|
|
|
5471
5487
|
}
|
|
5472
5488
|
|
|
5473
5489
|
// src/SourceArchivedNotice.tsx
|
|
5474
|
-
import { jsx as jsx28, jsxs as
|
|
5490
|
+
import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5475
5491
|
function bringBackLabel(state) {
|
|
5476
5492
|
return state.label ? `Bring back ${state.label}` : "Bring it back";
|
|
5477
5493
|
}
|
|
@@ -5504,14 +5520,14 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
5504
5520
|
tableShapeChanged(tableId);
|
|
5505
5521
|
await read();
|
|
5506
5522
|
};
|
|
5507
|
-
return /* @__PURE__ */
|
|
5523
|
+
return /* @__PURE__ */ jsxs23(
|
|
5508
5524
|
"div",
|
|
5509
5525
|
{
|
|
5510
5526
|
className: "flex flex-wrap items-center gap-2 rounded-md border border-border px-3 py-2",
|
|
5511
5527
|
"data-testid": "source-archived-notice",
|
|
5512
5528
|
"data-field-id": state.field_id ?? "",
|
|
5513
5529
|
children: [
|
|
5514
|
-
/* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
5515
5531
|
/* @__PURE__ */ jsx28("span", { className: "text-sm", children: SOURCE_ARCHIVED_WORDS }),
|
|
5516
5532
|
/* @__PURE__ */ jsx28("span", { className: "truncate text-xs text-muted-foreground", children: sourceArchivedSentence(state) })
|
|
5517
5533
|
] }),
|
|
@@ -5527,7 +5543,7 @@ import { createContext as createContext3, useContext as useContext2, useEffect a
|
|
|
5527
5543
|
import { BasicInput as BasicInput6, Button as Button12 } from "@ai-matrx/design-system";
|
|
5528
5544
|
import { optionKey as optionKey2, optionLabel, rankTypedMatches as rankTypedMatches3 } from "@ai-matrx/records";
|
|
5529
5545
|
import { useOptionalRecordsClient as useOptionalRecordsClient8 } from "@ai-matrx/records/react";
|
|
5530
|
-
import { Fragment as Fragment11, jsx as jsx29, jsxs as
|
|
5546
|
+
import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5531
5547
|
var CONDITION_OPS = [
|
|
5532
5548
|
{ op: "eq", label: "is" },
|
|
5533
5549
|
{ op: "ne", label: "is not" },
|
|
@@ -5664,7 +5680,7 @@ function ChoiceValues({ field: field2, value, onChange }) {
|
|
|
5664
5680
|
}
|
|
5665
5681
|
);
|
|
5666
5682
|
}
|
|
5667
|
-
return /* @__PURE__ */
|
|
5683
|
+
return /* @__PURE__ */ jsxs24("span", { className: "inline-flex flex-wrap items-center gap-1", "data-records-condition-choices": "", "data-pick-values": value.join("|"), children: [
|
|
5668
5684
|
choices.map((c) => /* @__PURE__ */ jsx29(
|
|
5669
5685
|
Button12,
|
|
5670
5686
|
{
|
|
@@ -5886,7 +5902,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
5886
5902
|
VALUELESS_OPS.has(chosenOp) ? { op: chosenOp, args: [{ field: chosenField }] } : { op: chosenOp, args: [{ field: chosenField }, { const: chosenValue }] }
|
|
5887
5903
|
);
|
|
5888
5904
|
}
|
|
5889
|
-
return /* @__PURE__ */
|
|
5905
|
+
return /* @__PURE__ */ jsxs24("div", { className: className ?? "flex flex-wrap items-center gap-1 text-xs", children: [
|
|
5890
5906
|
/* @__PURE__ */ jsx29("span", { className: "text-muted-foreground", children: lead }),
|
|
5891
5907
|
/* @__PURE__ */ jsx29(
|
|
5892
5908
|
PickOne,
|
|
@@ -5899,7 +5915,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
5899
5915
|
attrs: { "data-condition": "field" }
|
|
5900
5916
|
}
|
|
5901
5917
|
),
|
|
5902
|
-
onField && !fields.some((f) => f.id === onField) && withheldFields.some((f) => f.id === onField) ? /* @__PURE__ */
|
|
5918
|
+
onField && !fields.some((f) => f.id === onField) && withheldFields.some((f) => f.id === onField) ? /* @__PURE__ */ jsxs24(
|
|
5903
5919
|
"span",
|
|
5904
5920
|
{
|
|
5905
5921
|
className: "rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",
|
|
@@ -5919,7 +5935,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
5919
5935
|
children: "Missing question"
|
|
5920
5936
|
}
|
|
5921
5937
|
) : null,
|
|
5922
|
-
onField ? /* @__PURE__ */
|
|
5938
|
+
onField ? /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
5923
5939
|
/* @__PURE__ */ jsx29(
|
|
5924
5940
|
PickOne,
|
|
5925
5941
|
{
|
|
@@ -6047,14 +6063,14 @@ function ConditionGroup({
|
|
|
6047
6063
|
const joinWord = (index) => index === 0 ? lead : joiner === "or" || joiner === "none" ? "or" : "and";
|
|
6048
6064
|
const showJoiner = nested || args.length > 1 || joiner === "none" || joiner === "notall";
|
|
6049
6065
|
const opposite = joiner === "or" || joiner === "none" ? "and" : "or";
|
|
6050
|
-
return /* @__PURE__ */
|
|
6066
|
+
return /* @__PURE__ */ jsxs24(
|
|
6051
6067
|
"div",
|
|
6052
6068
|
{
|
|
6053
6069
|
className: className ?? "flex flex-col gap-1 text-xs",
|
|
6054
6070
|
"data-testid": nested ? "condition-nested-group" : "condition-group",
|
|
6055
6071
|
"data-depth": depth,
|
|
6056
6072
|
children: [
|
|
6057
|
-
showJoiner ? /* @__PURE__ */
|
|
6073
|
+
showJoiner ? /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1", children: [
|
|
6058
6074
|
/* @__PURE__ */ jsx29("span", { className: "text-muted-foreground", children: nested ? "Group:" : lead }),
|
|
6059
6075
|
/* @__PURE__ */ jsx29(
|
|
6060
6076
|
PickOne,
|
|
@@ -6133,7 +6149,7 @@ function ConditionGroup({
|
|
|
6133
6149
|
}
|
|
6134
6150
|
}
|
|
6135
6151
|
) }) : null,
|
|
6136
|
-
args.length > 0 && !drafting ? /* @__PURE__ */
|
|
6152
|
+
args.length > 0 && !drafting ? /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1", children: [
|
|
6137
6153
|
/* @__PURE__ */ jsx29(
|
|
6138
6154
|
Button12,
|
|
6139
6155
|
{
|
|
@@ -6275,7 +6291,7 @@ async function forgetWrittenWords(client, tableId, key, written) {
|
|
|
6275
6291
|
|
|
6276
6292
|
// src/FieldRetype.tsx
|
|
6277
6293
|
import { formatCount } from "@ai-matrx/kit/format";
|
|
6278
|
-
import { jsx as jsx30, jsxs as
|
|
6294
|
+
import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6279
6295
|
var RETYPE_PREVIEW_DEBOUNCE_MS = 300;
|
|
6280
6296
|
function scheduleRetypePreview(ask, ms = RETYPE_PREVIEW_DEBOUNCE_MS) {
|
|
6281
6297
|
const timer = setTimeout(ask, ms);
|
|
@@ -6482,27 +6498,27 @@ function FieldRetype({ field: field2, tableId, onRetyped }) {
|
|
|
6482
6498
|
tableShapeChanged2(tableId);
|
|
6483
6499
|
onRetyped?.();
|
|
6484
6500
|
};
|
|
6485
|
-
return /* @__PURE__ */
|
|
6486
|
-
/* @__PURE__ */
|
|
6487
|
-
/* @__PURE__ */
|
|
6501
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-1.5", "data-records-retype": "", children: [
|
|
6502
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
6503
|
+
/* @__PURE__ */ jsxs25(Select3, { value: to?.id ?? "", onValueChange: (next) => setTo(targets.find((t) => t.id === next) ?? null), children: [
|
|
6488
6504
|
/* @__PURE__ */ jsx30(SelectTrigger3, { size: "sm", "aria-label": "Change what this column holds", className: "w-auto min-w-[12rem]", children: /* @__PURE__ */ jsx30(SelectValue3, { placeholder: "Change what this column holds" }) }),
|
|
6489
6505
|
/* @__PURE__ */ jsx30(SelectContent3, { children: targets.map((t) => /* @__PURE__ */ jsx30(SelectItem3, { value: t.id, children: t.label }, t.id)) })
|
|
6490
6506
|
] }),
|
|
6491
6507
|
to ? /* @__PURE__ */ jsx30(Button13, { size: "sm", disabled: busy || asking || preview === null, onClick: () => void change(), "data-records-retype-go": "", children: busy ? "Changing\u2026" : `Change to ${to.label}` }) : null,
|
|
6492
6508
|
to ? /* @__PURE__ */ jsx30(Button13, { size: "sm", variant: "ghost", onClick: () => setTo(null), disabled: busy, children: "Cancel" }) : null
|
|
6493
6509
|
] }),
|
|
6494
|
-
to && asking ? /* @__PURE__ */
|
|
6510
|
+
to && asking ? /* @__PURE__ */ jsxs25("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
6495
6511
|
"Counting ",
|
|
6496
6512
|
name,
|
|
6497
6513
|
"'s values\u2026"
|
|
6498
6514
|
] }) : null,
|
|
6499
|
-
to && preview && limitedHeld !== null ? /* @__PURE__ */
|
|
6515
|
+
to && preview && limitedHeld !== null ? /* @__PURE__ */ jsxs25("p", { className: "text-[11px] text-muted-foreground", "data-records-retype-preview": "", "data-records-retype-limited": "", children: [
|
|
6500
6516
|
"About ",
|
|
6501
6517
|
formatCount(limitedHeld),
|
|
6502
6518
|
" values to change to ",
|
|
6503
6519
|
to.label.toLowerCase(),
|
|
6504
6520
|
"; any that do not fit are kept aside with their records, with the reason \u2014 nothing is deleted."
|
|
6505
|
-
] }) : to && preview ? /* @__PURE__ */
|
|
6521
|
+
] }) : to && preview ? /* @__PURE__ */ jsxs25("p", { className: "text-[11px] text-muted-foreground", "data-records-retype-preview": "", children: [
|
|
6506
6522
|
preview.converts,
|
|
6507
6523
|
" ",
|
|
6508
6524
|
preview.converts === 1 ? "value converts" : "values convert",
|
|
@@ -6517,10 +6533,10 @@ function FieldRetype({ field: field2, tableId, onRetyped }) {
|
|
|
6517
6533
|
}
|
|
6518
6534
|
|
|
6519
6535
|
// src/FieldRulePreview.tsx
|
|
6520
|
-
import { useEffect as useEffect16, useMemo as
|
|
6536
|
+
import { useEffect as useEffect16, useMemo as useMemo10, useRef as useRef12, useState as useState24 } from "react";
|
|
6521
6537
|
import { previewRuleChange } from "@ai-matrx/records";
|
|
6522
6538
|
import { useRecordsClient as useRecordsClient7 } from "@ai-matrx/records/react";
|
|
6523
|
-
import { jsx as jsx31, jsxs as
|
|
6539
|
+
import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6524
6540
|
var PREVIEW_GROUPS = 1e3;
|
|
6525
6541
|
function ruleWords(rules) {
|
|
6526
6542
|
return rules.map((r) => JSON.stringify([r.kind, r.value === void 0 || r.value === "" ? null : String(r.value), r.min ?? null, r.example ?? null])).sort().join("|");
|
|
@@ -6540,8 +6556,8 @@ function FieldRulePreview({ field: field2, tableId, rules }) {
|
|
|
6540
6556
|
const client = useRecordsClient7();
|
|
6541
6557
|
const [preview, setPreview] = useState24(null);
|
|
6542
6558
|
const [refusal, setRefusal] = useState24(null);
|
|
6543
|
-
const key =
|
|
6544
|
-
const latest =
|
|
6559
|
+
const key = useMemo10(() => ruleWords(rules), [rules]);
|
|
6560
|
+
const latest = useRef12(rules);
|
|
6545
6561
|
latest.current = rules;
|
|
6546
6562
|
const name = fieldName(field2);
|
|
6547
6563
|
useEffect16(() => {
|
|
@@ -6577,14 +6593,14 @@ function FieldRulePreview({ field: field2, tableId, rules }) {
|
|
|
6577
6593
|
}, [client, tableId, field2.key, key]);
|
|
6578
6594
|
if (refusal) return /* @__PURE__ */ jsx31(RefusalNotice, { error: refusal });
|
|
6579
6595
|
if (!preview) {
|
|
6580
|
-
return /* @__PURE__ */
|
|
6596
|
+
return /* @__PURE__ */ jsxs26("p", { className: "text-[11px] text-muted-foreground", "data-records-rule-preview": "counting", children: [
|
|
6581
6597
|
"Counting ",
|
|
6582
6598
|
name,
|
|
6583
6599
|
"'s values\u2026"
|
|
6584
6600
|
] });
|
|
6585
6601
|
}
|
|
6586
6602
|
if (preview.keptAside === 0) {
|
|
6587
|
-
return /* @__PURE__ */
|
|
6603
|
+
return /* @__PURE__ */ jsxs26("p", { className: "text-[11px] text-muted-foreground", "data-records-rule-preview": "fits", children: [
|
|
6588
6604
|
"Every value already in ",
|
|
6589
6605
|
name,
|
|
6590
6606
|
" still fits",
|
|
@@ -6592,7 +6608,7 @@ function FieldRulePreview({ field: field2, tableId, rules }) {
|
|
|
6592
6608
|
"."
|
|
6593
6609
|
] });
|
|
6594
6610
|
}
|
|
6595
|
-
return /* @__PURE__ */
|
|
6611
|
+
return /* @__PURE__ */ jsxs26("p", { className: "text-[11px] text-amber-700 dark:text-amber-400", role: "status", "data-records-rule-preview": "sets-aside", children: [
|
|
6596
6612
|
preview.keptAside,
|
|
6597
6613
|
" ",
|
|
6598
6614
|
preview.keptAside === 1 ? "value no longer fits and will be" : "values no longer fit and will be",
|
|
@@ -6682,7 +6698,7 @@ import {
|
|
|
6682
6698
|
statusGroupOf as statusGroupOf2
|
|
6683
6699
|
} from "@ai-matrx/records";
|
|
6684
6700
|
import { Label as Label5, Select as Select4, SelectContent as SelectContent4, SelectItem as SelectItem4, SelectTrigger as SelectTrigger4, SelectValue as SelectValue4 } from "@ai-matrx/design-system";
|
|
6685
|
-
import { jsx as jsx32, jsxs as
|
|
6701
|
+
import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6686
6702
|
var STATUS_STARTING_CHOICES = [
|
|
6687
6703
|
{ words: "Not started", group: "todo" },
|
|
6688
6704
|
{ words: "In progress", group: "in_progress" },
|
|
@@ -6711,13 +6727,13 @@ function StatusGroupsQuestion({
|
|
|
6711
6727
|
onGroup
|
|
6712
6728
|
}) {
|
|
6713
6729
|
if (rows.length === 0) return null;
|
|
6714
|
-
return /* @__PURE__ */
|
|
6730
|
+
return /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1", "data-records-status-groups": "", children: [
|
|
6715
6731
|
/* @__PURE__ */ jsx32(Label5, { className: "text-xs", children: "Groups" }),
|
|
6716
|
-
rows.map((r) => /* @__PURE__ */
|
|
6732
|
+
rows.map((r) => /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
6717
6733
|
/* @__PURE__ */ jsx32("span", { className: "min-w-0 flex-1 truncate text-sm", children: r.words }),
|
|
6718
|
-
/* @__PURE__ */
|
|
6734
|
+
/* @__PURE__ */ jsxs27(Select4, { value: r.group, onValueChange: (next) => onGroup(r.ref, next), children: [
|
|
6719
6735
|
/* @__PURE__ */ jsx32(SelectTrigger4, { size: "sm", className: "w-36", "aria-label": `Group for ${r.words}`, children: /* @__PURE__ */ jsx32(SelectValue4, {}) }),
|
|
6720
|
-
/* @__PURE__ */ jsx32(SelectContent4, { children: STATUS_GROUPS.map((g) => /* @__PURE__ */
|
|
6736
|
+
/* @__PURE__ */ jsx32(SelectContent4, { children: STATUS_GROUPS.map((g) => /* @__PURE__ */ jsxs27(SelectItem4, { value: g, children: [
|
|
6721
6737
|
STATUS_GROUP_MARK[g],
|
|
6722
6738
|
" ",
|
|
6723
6739
|
STATUS_GROUP_WORDS2[g]
|
|
@@ -6727,11 +6743,11 @@ function StatusGroupsQuestion({
|
|
|
6727
6743
|
] });
|
|
6728
6744
|
}
|
|
6729
6745
|
function RatingMaxQuestion({ value, onChange }) {
|
|
6730
|
-
return /* @__PURE__ */
|
|
6746
|
+
return /* @__PURE__ */ jsxs27("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
6731
6747
|
/* @__PURE__ */ jsx32(Label5, { className: "text-xs", children: "Out of" }),
|
|
6732
|
-
/* @__PURE__ */
|
|
6748
|
+
/* @__PURE__ */ jsxs27(Select4, { value: String(value), onValueChange: (next) => onChange(Number(next)), children: [
|
|
6733
6749
|
/* @__PURE__ */ jsx32(SelectTrigger4, { size: "sm", "aria-label": "Out of", children: /* @__PURE__ */ jsx32(SelectValue4, {}) }),
|
|
6734
|
-
/* @__PURE__ */ jsx32(SelectContent4, { children: Array.from({ length: 10 }, (_, i) => i + 1).map((n) => /* @__PURE__ */
|
|
6750
|
+
/* @__PURE__ */ jsx32(SelectContent4, { children: Array.from({ length: 10 }, (_, i) => i + 1).map((n) => /* @__PURE__ */ jsxs27(SelectItem4, { value: String(n), children: [
|
|
6735
6751
|
n,
|
|
6736
6752
|
" ",
|
|
6737
6753
|
n === 1 ? "star" : "stars"
|
|
@@ -6752,11 +6768,11 @@ var SYMBOLOGY_WORDS = {
|
|
|
6752
6768
|
pdf417: "PDF417"
|
|
6753
6769
|
};
|
|
6754
6770
|
function BarcodeSymbologyQuestion({ value, onChange }) {
|
|
6755
|
-
return /* @__PURE__ */
|
|
6771
|
+
return /* @__PURE__ */ jsxs27("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
6756
6772
|
/* @__PURE__ */ jsx32(Label5, { className: "text-xs", children: "Code type" }),
|
|
6757
|
-
/* @__PURE__ */
|
|
6773
|
+
/* @__PURE__ */ jsxs27(Select4, { value: value === "" ? "any" : value, onValueChange: (next) => onChange(next === "any" ? "" : next), children: [
|
|
6758
6774
|
/* @__PURE__ */ jsx32(SelectTrigger4, { size: "sm", "aria-label": "Code type", children: /* @__PURE__ */ jsx32(SelectValue4, {}) }),
|
|
6759
|
-
/* @__PURE__ */
|
|
6775
|
+
/* @__PURE__ */ jsxs27(SelectContent4, { children: [
|
|
6760
6776
|
/* @__PURE__ */ jsx32(SelectItem4, { value: "any", children: "Any code" }),
|
|
6761
6777
|
BARCODE_SYMBOLOGIES.map((s) => /* @__PURE__ */ jsx32(SelectItem4, { value: s, children: SYMBOLOGY_WORDS[s] }, s))
|
|
6762
6778
|
] })
|
|
@@ -6771,7 +6787,7 @@ import {
|
|
|
6771
6787
|
getFieldFormat as getFieldFormat2,
|
|
6772
6788
|
groupedFormatsForBase
|
|
6773
6789
|
} from "@ai-matrx/design-system/field-formats";
|
|
6774
|
-
import { jsx as jsx33, jsxs as
|
|
6790
|
+
import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6775
6791
|
var KIND_WORD = {
|
|
6776
6792
|
choice: "select",
|
|
6777
6793
|
multi_choice: "multi_select",
|
|
@@ -6894,11 +6910,11 @@ function FieldFormatPicker({
|
|
|
6894
6910
|
else merged[key] = next;
|
|
6895
6911
|
onValue({ ...value, format: Object.keys(merged).length > 0 ? { id: value.format.id, options: merged } : { id: value.format.id } });
|
|
6896
6912
|
};
|
|
6897
|
-
const option = (key, label, control) => optionKeys.includes(key) ? /* @__PURE__ */
|
|
6913
|
+
const option = (key, label, control) => optionKeys.includes(key) ? /* @__PURE__ */ jsxs28("label", { className: "flex min-w-[6rem] flex-col gap-0.5 text-[11px] text-muted-foreground", children: [
|
|
6898
6914
|
label,
|
|
6899
6915
|
control
|
|
6900
6916
|
] }, key) : null;
|
|
6901
|
-
return /* @__PURE__ */
|
|
6917
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-1", "data-records-format-picker": "", children: [
|
|
6902
6918
|
/* @__PURE__ */ jsx33(Label6, { className: "text-xs", htmlFor: `records-shows-as-${field2.id}`, children: "Shows as" }),
|
|
6903
6919
|
/* @__PURE__ */ jsx33(
|
|
6904
6920
|
PickOne,
|
|
@@ -6927,7 +6943,7 @@ function FieldFormatPicker({
|
|
|
6927
6943
|
}
|
|
6928
6944
|
),
|
|
6929
6945
|
/* @__PURE__ */ jsx33("p", { className: "text-[11px] text-muted-foreground", children: retypedTo ? `This changes what the column holds, to ${storesWord(retypedTo.def)}. Each value that can convert does; you are told before anything that cannot is lost.` : active ? active.description : "How every value in this column is written, wherever it appears." }),
|
|
6930
|
-
optionKeys.length > 0 ? /* @__PURE__ */
|
|
6946
|
+
optionKeys.length > 0 ? /* @__PURE__ */ jsxs28("div", { className: "flex flex-wrap items-end gap-2", children: [
|
|
6931
6947
|
option(
|
|
6932
6948
|
"currency",
|
|
6933
6949
|
"Currency",
|
|
@@ -7043,7 +7059,7 @@ function FieldFormatPicker({
|
|
|
7043
7059
|
"Suffix",
|
|
7044
7060
|
/* @__PURE__ */ jsx33("input", { "data-records-format-option": "suffix", className: BOX, placeholder: "e.g. kg", value: options.suffix ?? "", onChange: (e) => setOption("suffix", e.target.value) })
|
|
7045
7061
|
),
|
|
7046
|
-
optionKeys.includes("useGrouping") ? /* @__PURE__ */
|
|
7062
|
+
optionKeys.includes("useGrouping") ? /* @__PURE__ */ jsxs28("label", { className: "flex items-center gap-1.5 pb-1 text-[11px] text-muted-foreground", children: [
|
|
7047
7063
|
/* @__PURE__ */ jsx33(
|
|
7048
7064
|
"input",
|
|
7049
7065
|
{
|
|
@@ -8085,9 +8101,9 @@ import { useOptionalRecordsClient as useOptionalRecordsClient10 } from "@ai-matr
|
|
|
8085
8101
|
import { PORTAL_ACCENTS } from "@ai-matrx/records";
|
|
8086
8102
|
import { cn as cn16 } from "@ai-matrx/design-system";
|
|
8087
8103
|
import { STYLE_COLOR_LABELS, SWATCH_CLASS as SWATCH_CLASS2 } from "@ai-matrx/design-system/data-table";
|
|
8088
|
-
import { jsx as jsx34, jsxs as
|
|
8104
|
+
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8089
8105
|
function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel = "App color" }) {
|
|
8090
|
-
return /* @__PURE__ */
|
|
8106
|
+
return /* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", "aria-label": "Color", children: [
|
|
8091
8107
|
/* @__PURE__ */ jsx34(
|
|
8092
8108
|
"button",
|
|
8093
8109
|
{
|
|
@@ -8122,7 +8138,7 @@ function AccentSwatches({ value, onChange, options = PORTAL_ACCENTS, noneLabel =
|
|
|
8122
8138
|
import { Label as Label7 } from "@ai-matrx/design-system";
|
|
8123
8139
|
import { useFields as useFields3, useOptionalRecordsClient as useOptionalRecordsClient9 } from "@ai-matrx/records/react";
|
|
8124
8140
|
import { useEffect as useEffect17, useState as useState25 } from "react";
|
|
8125
|
-
import { jsx as jsx35, jsxs as
|
|
8141
|
+
import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8126
8142
|
var THIS_ROW = "@row";
|
|
8127
8143
|
var NOTHING = "";
|
|
8128
8144
|
function prefillWith(prefill, key, from) {
|
|
@@ -8147,8 +8163,8 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
8147
8163
|
live = false;
|
|
8148
8164
|
};
|
|
8149
8165
|
}, [client, target]);
|
|
8150
|
-
return /* @__PURE__ */
|
|
8151
|
-
/* @__PURE__ */
|
|
8166
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-2", "data-records-button-add-row": "", children: [
|
|
8167
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-1", children: [
|
|
8152
8168
|
/* @__PURE__ */ jsx35(Label7, { className: "text-xs", children: "Adds to" }),
|
|
8153
8169
|
/* @__PURE__ */ jsx35(
|
|
8154
8170
|
PickOne,
|
|
@@ -8161,7 +8177,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
8161
8177
|
}
|
|
8162
8178
|
)
|
|
8163
8179
|
] }),
|
|
8164
|
-
templates.length || value.template_id ? /* @__PURE__ */
|
|
8180
|
+
templates.length || value.template_id ? /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-1", children: [
|
|
8165
8181
|
/* @__PURE__ */ jsx35(Label7, { className: "text-xs", children: "Starts from" }),
|
|
8166
8182
|
/* @__PURE__ */ jsx35(
|
|
8167
8183
|
PickOne,
|
|
@@ -8174,7 +8190,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
8174
8190
|
}
|
|
8175
8191
|
)
|
|
8176
8192
|
] }) : null,
|
|
8177
|
-
typed.length ? /* @__PURE__ */ jsx35("div", { className: "grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-1", children: typed.map((f) => /* @__PURE__ */
|
|
8193
|
+
typed.length ? /* @__PURE__ */ jsx35("div", { className: "grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-1", children: typed.map((f) => /* @__PURE__ */ jsxs30("div", { className: "contents", children: [
|
|
8178
8194
|
/* @__PURE__ */ jsx35("span", { className: "text-sm", children: f.label }),
|
|
8179
8195
|
/* @__PURE__ */ jsx35(
|
|
8180
8196
|
PickOne,
|
|
@@ -8191,7 +8207,7 @@ function AddRowSettings({ value, onChange, tableId, fields }) {
|
|
|
8191
8207
|
}
|
|
8192
8208
|
|
|
8193
8209
|
// src/ButtonSettings.tsx
|
|
8194
|
-
import { jsx as jsx36, jsxs as
|
|
8210
|
+
import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
8195
8211
|
var DOES_WORDS = {
|
|
8196
8212
|
none: "Nothing yet",
|
|
8197
8213
|
open_url: "Open a link",
|
|
@@ -8238,13 +8254,13 @@ function ButtonSettingsEditor({
|
|
|
8238
8254
|
}, [client, tableId, value.do, actions, automations]);
|
|
8239
8255
|
const set = (patch) => onChange({ ...value, ...patch });
|
|
8240
8256
|
const columns = fields.filter((f) => !(f.type === "text" && f.format === "button"));
|
|
8241
|
-
return /* @__PURE__ */
|
|
8242
|
-
/* @__PURE__ */
|
|
8243
|
-
/* @__PURE__ */
|
|
8257
|
+
return /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-2 rounded-md border p-2", "data-records-button-settings": "", children: [
|
|
8258
|
+
/* @__PURE__ */ jsxs31("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
8259
|
+
/* @__PURE__ */ jsxs31("label", { className: "flex flex-col gap-1", children: [
|
|
8244
8260
|
/* @__PURE__ */ jsx36(Label8, { className: "text-xs", children: "Button label" }),
|
|
8245
8261
|
/* @__PURE__ */ jsx36(BasicInput7, { className: "h-8 text-xs", value: value.label, "data-records-button-label": "", onChange: (e) => set({ label: e.target.value }) })
|
|
8246
8262
|
] }),
|
|
8247
|
-
/* @__PURE__ */
|
|
8263
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
|
|
8248
8264
|
/* @__PURE__ */ jsx36(Label8, { className: "text-xs", children: "Does" }),
|
|
8249
8265
|
/* @__PURE__ */ jsx36(
|
|
8250
8266
|
PickOne,
|
|
@@ -8258,7 +8274,7 @@ function ButtonSettingsEditor({
|
|
|
8258
8274
|
)
|
|
8259
8275
|
] })
|
|
8260
8276
|
] }),
|
|
8261
|
-
/* @__PURE__ */
|
|
8277
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
|
|
8262
8278
|
/* @__PURE__ */ jsx36(Label8, { className: "text-xs", children: "Color" }),
|
|
8263
8279
|
/* @__PURE__ */ jsx36(
|
|
8264
8280
|
AccentSwatches,
|
|
@@ -8270,9 +8286,9 @@ function ButtonSettingsEditor({
|
|
|
8270
8286
|
}
|
|
8271
8287
|
)
|
|
8272
8288
|
] }),
|
|
8273
|
-
value.do === "open_url" ? /* @__PURE__ */
|
|
8289
|
+
value.do === "open_url" ? /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
|
|
8274
8290
|
/* @__PURE__ */ jsx36(Label8, { className: "text-xs", children: "Link" }),
|
|
8275
|
-
/* @__PURE__ */
|
|
8291
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex gap-1", children: [
|
|
8276
8292
|
/* @__PURE__ */ jsx36(
|
|
8277
8293
|
BasicInput7,
|
|
8278
8294
|
{
|
|
@@ -8299,7 +8315,7 @@ function ButtonSettingsEditor({
|
|
|
8299
8315
|
value.url && buttonUrlPlaceholders(value.url).length > 0 ? /* @__PURE__ */ jsx36("p", { className: "truncate text-[11px] text-muted-foreground", "data-records-button-url-words": "", children: buttonUrlInWords(value.url, fields) }) : null
|
|
8300
8316
|
] }) : null,
|
|
8301
8317
|
value.do === "add_row" ? /* @__PURE__ */ jsx36(AddRowSettings, { value, onChange, tableId, fields }) : null,
|
|
8302
|
-
value.do === "run_action" ? !tableId ? /* @__PURE__ */ jsx36("p", { className: "text-xs text-muted-foreground", children: "Row actions belong to a table" }) : actionsRefused ? /* @__PURE__ */ jsx36(RefusalLine, { error: actionsRefused }) : /* @__PURE__ */
|
|
8318
|
+
value.do === "run_action" ? !tableId ? /* @__PURE__ */ jsx36("p", { className: "text-xs text-muted-foreground", children: "Row actions belong to a table" }) : actionsRefused ? /* @__PURE__ */ jsx36(RefusalLine, { error: actionsRefused }) : /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-2", "data-records-button-action": "", children: [
|
|
8303
8319
|
actions === null || actions.length > 0 ? /* @__PURE__ */ jsx36(
|
|
8304
8320
|
PickOne,
|
|
8305
8321
|
{
|
|
@@ -8380,9 +8396,9 @@ function NewRowAction({
|
|
|
8380
8396
|
if (!made?.id) return setRefused({ code: "internal", message: "The row action was saved but could not be read back.", hint: "Reopen this column's settings and pick it from the list." });
|
|
8381
8397
|
onMade(made.id, all);
|
|
8382
8398
|
};
|
|
8383
|
-
return /* @__PURE__ */
|
|
8399
|
+
return /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", "data-records-button-new-action": "", children: [
|
|
8384
8400
|
/* @__PURE__ */ jsx36(Label8, { className: "text-xs", children: "New row action" }),
|
|
8385
|
-
/* @__PURE__ */
|
|
8401
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
8386
8402
|
/* @__PURE__ */ jsx36(
|
|
8387
8403
|
PickOne,
|
|
8388
8404
|
{
|
|
@@ -8422,7 +8438,7 @@ var ADDABLE_TYPES = STANDARD_TABLE_FIELD_CHOICES.map((choice) => ({
|
|
|
8422
8438
|
}));
|
|
8423
8439
|
|
|
8424
8440
|
// src/FieldEditor.tsx
|
|
8425
|
-
import { Fragment as Fragment12, jsx as jsx37, jsxs as
|
|
8441
|
+
import { Fragment as Fragment12, jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8426
8442
|
var RULE_KINDS = FIELD_RULE_KIND_VALUES.map((kind) => ({ kind, label: FIELD_RULE_KIND_LABEL[kind] }));
|
|
8427
8443
|
var SENSITIVITIES = FIELD_SENSITIVITIES.map((value) => ({ value, label: FIELD_SENSITIVITY_LABEL[value] }));
|
|
8428
8444
|
var AGENT_VISIBILITY = CONTEXT_POLICIES.map((value) => ({ value, label: CONTEXT_POLICY_LABEL[value] }));
|
|
@@ -8541,22 +8557,22 @@ function FieldEditor(props) {
|
|
|
8541
8557
|
const [rules, setRules] = useState27(start?.rules ?? []);
|
|
8542
8558
|
const [startsWith, setStartsWith] = useState27(start?.default ?? null);
|
|
8543
8559
|
const [ratingMax, setRatingMax] = useState27(() => start ? ratingMaxOf(start) : 5);
|
|
8544
|
-
const savedRules =
|
|
8560
|
+
const savedRules = useMemo11(
|
|
8545
8561
|
() => field2 ? type === "rating" ? rulesWithTopStar(field2.rules ?? [], ratingMaxOf(field2)) : field2.rules ?? [] : [],
|
|
8546
8562
|
[field2, type]
|
|
8547
8563
|
);
|
|
8548
|
-
const editedRules =
|
|
8564
|
+
const editedRules = useMemo11(() => type === "rating" ? rulesWithTopStar(rules, ratingMax) : rules, [type, rules, ratingMax]);
|
|
8549
8565
|
const [statusGroups, setStatusGroups] = useState27({});
|
|
8550
8566
|
const [statusKeys, setStatusKeys] = useState27({});
|
|
8551
8567
|
const [symbology, setSymbology] = useState27(String(start?.config?.["symbology"] ?? ""));
|
|
8552
8568
|
const descriptionStart = String(start?.config?.["description"] ?? "");
|
|
8553
8569
|
const [description, setDescription] = useState27(descriptionStart);
|
|
8554
|
-
const buttonStart =
|
|
8570
|
+
const buttonStart = useMemo11(() => buttonOf(start) ?? { label: "" }, [start]);
|
|
8555
8571
|
const [buttonSettings, setButtonSettings] = useState27(buttonStart);
|
|
8556
8572
|
const prefixStart = autonumberPrefixOf3(start);
|
|
8557
8573
|
const [numberPrefix, setNumberPrefix] = useState27(prefixStart);
|
|
8558
8574
|
const dependencyStart = start?.config?.["dependency"] === true;
|
|
8559
|
-
const watchStart =
|
|
8575
|
+
const watchStart = useMemo11(() => watchedFieldsOf(start), [start]);
|
|
8560
8576
|
const [watchFields, setWatchFields] = useState27(watchStart);
|
|
8561
8577
|
const [dependency, setDependency] = useState27(dependencyStart);
|
|
8562
8578
|
const limitViewStart = typeof start?.config?.["limit_to_view"] === "string" ? String(start.config["limit_to_view"]) : "";
|
|
@@ -8665,7 +8681,7 @@ function FieldEditor(props) {
|
|
|
8665
8681
|
const [allowedTypes, setAllowedTypes] = useState27(() => entityReferenceKindsOf(start));
|
|
8666
8682
|
const startingFormulaText = start ? formulaTextNow(String(start.config?.["formula_text"] ?? ""), start.config?.["expr"] ?? start.expr, fields.data) : "";
|
|
8667
8683
|
const [formulaText, setFormulaText] = useState27(startingFormulaText);
|
|
8668
|
-
const shownFormula =
|
|
8684
|
+
const shownFormula = useRef13(startingFormulaText);
|
|
8669
8685
|
useEffect19(() => {
|
|
8670
8686
|
if (shownFormula.current === startingFormulaText) return;
|
|
8671
8687
|
setFormulaText((typed) => typed === shownFormula.current ? startingFormulaText : typed);
|
|
@@ -8680,7 +8696,7 @@ function FieldEditor(props) {
|
|
|
8680
8696
|
const [notLanded, setNotLanded] = useState27(false);
|
|
8681
8697
|
const liveField = field2 ? fields.data?.find((f) => f.id === field2.id) ?? field2 : void 0;
|
|
8682
8698
|
const heldAs = liveField ? JSON.stringify([liveField.type, liveField.config?.["kind"] ?? null, liveField.format ?? null, liveField.multi ?? false, liveField.unit ?? null]) : "";
|
|
8683
|
-
const seededAs =
|
|
8699
|
+
const seededAs = useRef13(heldAs);
|
|
8684
8700
|
useEffect19(() => {
|
|
8685
8701
|
if (!liveField || seededAs.current === heldAs) return;
|
|
8686
8702
|
seededAs.current = heldAs;
|
|
@@ -8690,14 +8706,14 @@ function FieldEditor(props) {
|
|
|
8690
8706
|
setUnit(liveField.unit ?? "$");
|
|
8691
8707
|
setWithTime(String(liveField.config?.["kind"] ?? "date") === "datetime");
|
|
8692
8708
|
}, [heldAs]);
|
|
8693
|
-
const others =
|
|
8709
|
+
const others = useMemo11(
|
|
8694
8710
|
() => (fields.data ?? []).filter((f) => f.id !== field2?.id),
|
|
8695
8711
|
[fields.data, field2?.id]
|
|
8696
8712
|
);
|
|
8697
|
-
const relations =
|
|
8713
|
+
const relations = useMemo11(() => others.filter((f) => sourceKindOf(f) !== null), [others]);
|
|
8698
8714
|
const reverse = useReverseColumns(onEntity ? null : tableId);
|
|
8699
|
-
const backLinks =
|
|
8700
|
-
const totalSources =
|
|
8715
|
+
const backLinks = useMemo11(() => (reverse.data ?? []).map(backLinkAsSource), [reverse.data]);
|
|
8716
|
+
const totalSources = useMemo11(() => [...relations, ...backLinks], [relations, backLinks]);
|
|
8701
8717
|
const sourcesFor = (kind) => kind === "rollup" || kind === "count" ? totalSources : relations;
|
|
8702
8718
|
const choice = fieldTypeChoice(type);
|
|
8703
8719
|
const editing = Boolean(field2);
|
|
@@ -8707,7 +8723,7 @@ function FieldEditor(props) {
|
|
|
8707
8723
|
const newDefault = !editing && !onEntity && newColumnTakesADefault(type) ? defaultToKeep(startsWith) : null;
|
|
8708
8724
|
const farFieldsOfLink = useFields4(field2 && sourceKindOf(field2) === "link" && !onEntity ? field2.relation_target ?? null : null);
|
|
8709
8725
|
const farTable = useTable2(field2 && sourceKindOf(field2) === "link" && !onEntity ? field2.relation_target ?? null : null);
|
|
8710
|
-
const linkReaders =
|
|
8726
|
+
const linkReaders = useMemo11(
|
|
8711
8727
|
() => field2 ? readingThroughLink(field2, farFieldsOfLink.data ?? []) : [],
|
|
8712
8728
|
[field2, farFieldsOfLink.data]
|
|
8713
8729
|
);
|
|
@@ -8938,13 +8954,13 @@ function FieldEditor(props) {
|
|
|
8938
8954
|
if (gone) (onRemoved ?? onSaved)?.();
|
|
8939
8955
|
else setAskingToRemove(false);
|
|
8940
8956
|
};
|
|
8941
|
-
return /* @__PURE__ */
|
|
8942
|
-
/* @__PURE__ */
|
|
8957
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn17("flex min-w-0 flex-col gap-3 text-xs", className), "data-records-field-editor": "", children: [
|
|
8958
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
|
|
8943
8959
|
/* @__PURE__ */ jsx37("span", { className: "font-medium", children: field2 ? `Field \xB7 ${fieldName(field2)}` : "New field" }),
|
|
8944
8960
|
/* @__PURE__ */ jsx37("span", { className: "ml-auto text-muted-foreground", children: tableLabel })
|
|
8945
8961
|
] }),
|
|
8946
|
-
/* @__PURE__ */
|
|
8947
|
-
/* @__PURE__ */
|
|
8962
|
+
/* @__PURE__ */ jsxs32("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
8963
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex flex-col gap-1", children: [
|
|
8948
8964
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Name" }),
|
|
8949
8965
|
/* @__PURE__ */ jsx37(
|
|
8950
8966
|
BasicInput8,
|
|
@@ -8973,7 +8989,7 @@ function FieldEditor(props) {
|
|
|
8973
8989
|
}
|
|
8974
8990
|
) : null
|
|
8975
8991
|
] }),
|
|
8976
|
-
field2 ? /* @__PURE__ */
|
|
8992
|
+
field2 ? /* @__PURE__ */ jsxs32("label", { className: "flex flex-col gap-1 sm:col-span-2", children: [
|
|
8977
8993
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Help text" }),
|
|
8978
8994
|
/* @__PURE__ */ jsx37(
|
|
8979
8995
|
BasicInput8,
|
|
@@ -8986,9 +9002,9 @@ function FieldEditor(props) {
|
|
|
8986
9002
|
}
|
|
8987
9003
|
)
|
|
8988
9004
|
] }) : null,
|
|
8989
|
-
/* @__PURE__ */
|
|
9005
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
8990
9006
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "What it holds" }),
|
|
8991
|
-
/* @__PURE__ */
|
|
9007
|
+
/* @__PURE__ */ jsxs32(
|
|
8992
9008
|
Select5,
|
|
8993
9009
|
{
|
|
8994
9010
|
value: type,
|
|
@@ -8996,7 +9012,7 @@ function FieldEditor(props) {
|
|
|
8996
9012
|
onValueChange: (next) => setType(next),
|
|
8997
9013
|
children: [
|
|
8998
9014
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "What this field holds", ...choice?.explanation ? { title: choice.explanation } : {}, children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
8999
|
-
/* @__PURE__ */ jsx37(SelectContent5, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */
|
|
9015
|
+
/* @__PURE__ */ jsx37(SelectContent5, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */ jsxs32(SelectGroup, { children: [
|
|
9000
9016
|
/* @__PURE__ */ jsx37(SelectLabel, { children: group }),
|
|
9001
9017
|
FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ jsx37(SelectItem5, { value: c.id, children: c.label }, c.id))
|
|
9002
9018
|
] }, group)) })
|
|
@@ -9006,8 +9022,8 @@ function FieldEditor(props) {
|
|
|
9006
9022
|
editing && field2 ? /* @__PURE__ */ jsx37(FieldRetype, { field: liveField ?? field2, tableId }) : null
|
|
9007
9023
|
] })
|
|
9008
9024
|
] }),
|
|
9009
|
-
type === "formula" && others.length > 0 ? /* @__PURE__ */
|
|
9010
|
-
editing ? startingFormulaText.trim() === "" ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: EDITING_A_WORKED_OUT_COLUMN }) : null : /* @__PURE__ */
|
|
9025
|
+
type === "formula" && others.length > 0 ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-2", children: [
|
|
9026
|
+
editing ? startingFormulaText.trim() === "" ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: EDITING_A_WORKED_OUT_COLUMN }) : null : /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-1", role: "group", "aria-label": "How to make this column", children: [
|
|
9011
9027
|
/* @__PURE__ */ jsx37(
|
|
9012
9028
|
Button15,
|
|
9013
9029
|
{
|
|
@@ -9100,58 +9116,58 @@ function FieldEditor(props) {
|
|
|
9100
9116
|
) : null,
|
|
9101
9117
|
type === "button" ? /* @__PURE__ */ jsx37(ButtonSettingsEditor, { value: buttonSettings, onChange: setButtonSettings, tableId: onEntity ? null : tableId, fields: others }) : null,
|
|
9102
9118
|
type === "modified_time" ? /* @__PURE__ */ jsx37(WatchFieldsPicker, { fields: others, value: watchFields, onChange: setWatchFields }) : null,
|
|
9103
|
-
type === "autonumber" ? /* @__PURE__ */
|
|
9119
|
+
type === "autonumber" ? /* @__PURE__ */ jsxs32("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
9104
9120
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Prefix" }),
|
|
9105
9121
|
/* @__PURE__ */ jsx37(BasicInput8, { className: "h-8 text-xs", placeholder: "TASK-", maxLength: 16, "data-records-autonumber-prefix": "", value: numberPrefix, onChange: (e) => setNumberPrefix(e.target.value) })
|
|
9106
9122
|
] }) : null,
|
|
9107
|
-
editing && field2?.type === "relation" && field2.relation_target && field2.relation_target === field2.entity_definition_id ? /* @__PURE__ */
|
|
9123
|
+
editing && field2?.type === "relation" && field2.relation_target && field2.relation_target === field2.entity_definition_id ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5 text-sm", title: "A timeline draws a line to each record this one waits on", children: [
|
|
9108
9124
|
/* @__PURE__ */ jsx37(Checkbox4, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
9109
9125
|
/* @__PURE__ */ jsx37("span", { children: "Waits on the linked records" })
|
|
9110
9126
|
] }) : null,
|
|
9111
|
-
editing && limitTarget ? /* @__PURE__ */
|
|
9127
|
+
editing && limitTarget ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", "data-records-limit-to-view": "", children: [
|
|
9112
9128
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Choices come from" }),
|
|
9113
|
-
/* @__PURE__ */
|
|
9129
|
+
/* @__PURE__ */ jsxs32(Select5, { value: limitView === "" ? "__all" : limitView, onValueChange: (next) => setLimitView(next === "__all" ? "" : next), disabled: targetViews === null, children: [
|
|
9114
9130
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "Limit the choices to a view", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9115
|
-
/* @__PURE__ */
|
|
9131
|
+
/* @__PURE__ */ jsxs32(SelectContent5, { children: [
|
|
9116
9132
|
/* @__PURE__ */ jsx37(SelectItem5, { value: "__all", children: "Every record" }),
|
|
9117
9133
|
(targetViews ?? []).map((v) => /* @__PURE__ */ jsx37(SelectItem5, { value: v.id, children: v.name }, v.id)),
|
|
9118
9134
|
limitView !== "" && targetViews !== null && !targetViews.some((v) => v.id === limitView) ? /* @__PURE__ */ jsx37(SelectItem5, { value: limitView, children: "A view that is gone" }) : null
|
|
9119
9135
|
] })
|
|
9120
9136
|
] })
|
|
9121
9137
|
] }) : null,
|
|
9122
|
-
editing && field2?.type === "relation" ? /* @__PURE__ */
|
|
9138
|
+
editing && field2?.type === "relation" ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", "data-records-link-binding": "", children: [
|
|
9123
9139
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "When a linked record changes" }),
|
|
9124
|
-
/* @__PURE__ */
|
|
9140
|
+
/* @__PURE__ */ jsxs32(Select5, { value: binding, onValueChange: (next) => setBinding(next === "snapshot" ? "snapshot" : "live"), children: [
|
|
9125
9141
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "When a linked record changes", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9126
|
-
/* @__PURE__ */
|
|
9142
|
+
/* @__PURE__ */ jsxs32(SelectContent5, { children: [
|
|
9127
9143
|
/* @__PURE__ */ jsx37(SelectItem5, { value: "live", children: "Show its changes" }),
|
|
9128
9144
|
/* @__PURE__ */ jsx37(SelectItem5, { value: "snapshot", children: "Keep it as it was when linked" })
|
|
9129
9145
|
] })
|
|
9130
9146
|
] })
|
|
9131
9147
|
] }) : null,
|
|
9132
|
-
editing && field2?.type === "relation" ? /* @__PURE__ */
|
|
9133
|
-
/* @__PURE__ */
|
|
9148
|
+
editing && field2?.type === "relation" ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1.5", "data-records-link-carries": "", children: [
|
|
9149
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5 text-sm", title: "Whoever can see a linked record can also see this one", children: [
|
|
9134
9150
|
/* @__PURE__ */ jsx37(Checkbox4, { checked: carries, "aria-label": "Carries access", onCheckedChange: (v) => setCarries(v === true) }),
|
|
9135
9151
|
/* @__PURE__ */ jsx37("span", { children: "Whoever sees a linked record sees this one" })
|
|
9136
9152
|
] }),
|
|
9137
|
-
carries ? /* @__PURE__ */
|
|
9153
|
+
carries ? /* @__PURE__ */ jsxs32(Select5, { value: carriesMax, onValueChange: (next) => setCarriesMax(next === "editor" ? "editor" : "viewer"), children: [
|
|
9138
9154
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "Carried access level", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9139
|
-
/* @__PURE__ */
|
|
9155
|
+
/* @__PURE__ */ jsxs32(SelectContent5, { children: [
|
|
9140
9156
|
/* @__PURE__ */ jsx37(SelectItem5, { value: "viewer", children: "Up to view" }),
|
|
9141
9157
|
/* @__PURE__ */ jsx37(SelectItem5, { value: "editor", children: "Up to edit" })
|
|
9142
9158
|
] })
|
|
9143
9159
|
] }) : null,
|
|
9144
|
-
field2.relation_target && field2.relation_target === field2.entity_definition_id ? /* @__PURE__ */
|
|
9160
|
+
field2.relation_target && field2.relation_target === field2.entity_definition_id ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5 text-sm", title: "Two records may point at each other along this link", children: [
|
|
9145
9161
|
/* @__PURE__ */ jsx37(Checkbox4, { checked: loops, "aria-label": "Two records can link each other", onCheckedChange: (v) => setLoops(v === true) }),
|
|
9146
9162
|
/* @__PURE__ */ jsx37("span", { children: "Two records can link each other" })
|
|
9147
9163
|
] }) : null,
|
|
9148
|
-
carries && loops ? /* @__PURE__ */
|
|
9164
|
+
carries && loops ? /* @__PURE__ */ jsxs32("p", { className: "text-xs text-muted-foreground", "data-records-loop-consequence": "", children: [
|
|
9149
9165
|
"Sharing one record shares the records it links to, and back again, ",
|
|
9150
9166
|
carriesMax === "editor" ? "up to edit" : "view only",
|
|
9151
9167
|
"."
|
|
9152
9168
|
] }) : null
|
|
9153
9169
|
] }) : null,
|
|
9154
|
-
personColumn ? /* @__PURE__ */
|
|
9170
|
+
personColumn ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5 text-sm", title: "Each person added to this column gets a notice", children: [
|
|
9155
9171
|
/* @__PURE__ */ jsx37(
|
|
9156
9172
|
Checkbox4,
|
|
9157
9173
|
{
|
|
@@ -9176,8 +9192,8 @@ function FieldEditor(props) {
|
|
|
9176
9192
|
}
|
|
9177
9193
|
) : null,
|
|
9178
9194
|
editing && field2 && !(type === "select" || type === "multi_select" || type === "status" || type === "autonumber") ? /* @__PURE__ */ jsx37(FieldFormatPicker, { field: field2, value: showsAs, onValue: setShowsAs }) : null,
|
|
9179
|
-
/* @__PURE__ */
|
|
9180
|
-
/* @__PURE__ */
|
|
9195
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap items-center gap-4", children: [
|
|
9196
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9181
9197
|
/* @__PURE__ */ jsx37(
|
|
9182
9198
|
Checkbox4,
|
|
9183
9199
|
{
|
|
@@ -9188,7 +9204,7 @@ function FieldEditor(props) {
|
|
|
9188
9204
|
),
|
|
9189
9205
|
/* @__PURE__ */ jsx37("span", { title: "Every record has to have one", children: "Required" })
|
|
9190
9206
|
] }),
|
|
9191
|
-
offersMany ? /* @__PURE__ */
|
|
9207
|
+
offersMany ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9192
9208
|
/* @__PURE__ */ jsx37(
|
|
9193
9209
|
Checkbox4,
|
|
9194
9210
|
{
|
|
@@ -9199,7 +9215,7 @@ function FieldEditor(props) {
|
|
|
9199
9215
|
),
|
|
9200
9216
|
"Can hold more than one"
|
|
9201
9217
|
] }) : null,
|
|
9202
|
-
/* @__PURE__ */
|
|
9218
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9203
9219
|
/* @__PURE__ */ jsx37(
|
|
9204
9220
|
Checkbox4,
|
|
9205
9221
|
{
|
|
@@ -9210,7 +9226,7 @@ function FieldEditor(props) {
|
|
|
9210
9226
|
),
|
|
9211
9227
|
"Each value has its own date"
|
|
9212
9228
|
] }),
|
|
9213
|
-
!field2 && type === "relation" && otherTable.data && otherTable.data.id !== tableId ? /* @__PURE__ */
|
|
9229
|
+
!field2 && type === "relation" && otherTable.data && otherTable.data.id !== tableId ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9214
9230
|
/* @__PURE__ */ jsx37(
|
|
9215
9231
|
Checkbox4,
|
|
9216
9232
|
{
|
|
@@ -9223,11 +9239,11 @@ function FieldEditor(props) {
|
|
|
9223
9239
|
"Show on ",
|
|
9224
9240
|
otherTable.data.name ?? "the other table"
|
|
9225
9241
|
] }) : null,
|
|
9226
|
-
!field2 && type === "relation" && relationTarget === tableId ? /* @__PURE__ */
|
|
9242
|
+
!field2 && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", title: "A timeline draws a line to each record this one waits on", children: [
|
|
9227
9243
|
/* @__PURE__ */ jsx37(Checkbox4, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
9228
9244
|
/* @__PURE__ */ jsx37("span", { children: "Waits on the linked records" })
|
|
9229
9245
|
] }) : null,
|
|
9230
|
-
!field2 && type === "relation" && relationTarget === tableId ? /* @__PURE__ */
|
|
9246
|
+
!field2 && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9231
9247
|
/* @__PURE__ */ jsx37(
|
|
9232
9248
|
Checkbox4,
|
|
9233
9249
|
{
|
|
@@ -9242,7 +9258,7 @@ function FieldEditor(props) {
|
|
|
9242
9258
|
),
|
|
9243
9259
|
/* @__PURE__ */ jsx37("span", { title: "Each record sits under the one this column names", children: "Sub-items" })
|
|
9244
9260
|
] }) : null,
|
|
9245
|
-
CHOICE_EDITOR_ADDS_WHAT_IS_TYPED && (type === "select" || type === "multi_select") ? /* @__PURE__ */
|
|
9261
|
+
CHOICE_EDITOR_ADDS_WHAT_IS_TYPED && (type === "select" || type === "multi_select") ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9246
9262
|
/* @__PURE__ */ jsx37(
|
|
9247
9263
|
Checkbox4,
|
|
9248
9264
|
{
|
|
@@ -9255,7 +9271,7 @@ function FieldEditor(props) {
|
|
|
9255
9271
|
] }) : null
|
|
9256
9272
|
] }),
|
|
9257
9273
|
!editing && !onEntity && newColumnTakesADefault(type) ? /* @__PURE__ */ jsx37(NewColumnDefault, { type, choices: options, value: startsWith, onChange: setStartsWith }) : null,
|
|
9258
|
-
editing && field2 && takesADefault(liveField ?? field2) ? /* @__PURE__ */
|
|
9274
|
+
editing && field2 && takesADefault(liveField ?? field2) ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", "data-records-field-default": "", children: [
|
|
9259
9275
|
/* @__PURE__ */ jsx37(Label9, { htmlFor: "records-field-default", className: "text-xs", children: DEFAULT_LABEL }),
|
|
9260
9276
|
/* @__PURE__ */ jsx37(
|
|
9261
9277
|
FieldControl,
|
|
@@ -9268,25 +9284,25 @@ function FieldEditor(props) {
|
|
|
9268
9284
|
)
|
|
9269
9285
|
] }) : null,
|
|
9270
9286
|
/* @__PURE__ */ jsx37(Separator, {}),
|
|
9271
|
-
/* @__PURE__ */
|
|
9272
|
-
/* @__PURE__ */
|
|
9287
|
+
/* @__PURE__ */ jsxs32("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
9288
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9273
9289
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Who can see what is in it" }),
|
|
9274
|
-
/* @__PURE__ */
|
|
9290
|
+
/* @__PURE__ */ jsxs32(Select5, { value: sensitivity, onValueChange: setSensitivity, children: [
|
|
9275
9291
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "Who can see what is in it", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9276
9292
|
/* @__PURE__ */ jsx37(SelectContent5, { children: sensitivities.map((row) => /* @__PURE__ */ jsx37(SelectItem5, { value: row.value, children: row.label }, row.value)) })
|
|
9277
9293
|
] })
|
|
9278
9294
|
] }),
|
|
9279
|
-
/* @__PURE__ */
|
|
9295
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9280
9296
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Can an assistant read it" }),
|
|
9281
|
-
/* @__PURE__ */
|
|
9297
|
+
/* @__PURE__ */ jsxs32(Select5, { value: contextPolicy, onValueChange: setContextPolicy, children: [
|
|
9282
9298
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "Can an assistant read it", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9283
9299
|
/* @__PURE__ */ jsx37(SelectContent5, { children: AGENT_VISIBILITY.map((row) => /* @__PURE__ */ jsx37(SelectItem5, { value: row.value, children: row.label }, row.value)) })
|
|
9284
9300
|
] })
|
|
9285
9301
|
] })
|
|
9286
9302
|
] }),
|
|
9287
9303
|
/* @__PURE__ */ jsx37(Separator, {}),
|
|
9288
|
-
/* @__PURE__ */
|
|
9289
|
-
/* @__PURE__ */
|
|
9304
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-2", children: [
|
|
9305
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
|
|
9290
9306
|
/* @__PURE__ */ jsx37("span", { className: "font-medium", children: "What counts as a good value" }),
|
|
9291
9307
|
/* @__PURE__ */ jsx37(
|
|
9292
9308
|
Button15,
|
|
@@ -9300,7 +9316,7 @@ function FieldEditor(props) {
|
|
|
9300
9316
|
}
|
|
9301
9317
|
)
|
|
9302
9318
|
] }),
|
|
9303
|
-
canBeUnique(type, multi) || rules.some((r) => r.kind === "unique") ? /* @__PURE__ */
|
|
9319
|
+
canBeUnique(type, multi) || rules.some((r) => r.kind === "unique") ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", "data-records-field-unique": "", children: [
|
|
9304
9320
|
/* @__PURE__ */ jsx37(
|
|
9305
9321
|
Checkbox4,
|
|
9306
9322
|
{
|
|
@@ -9312,8 +9328,8 @@ function FieldEditor(props) {
|
|
|
9312
9328
|
UNIQUE_LABEL
|
|
9313
9329
|
] }) : null,
|
|
9314
9330
|
rules.length === 0 ? /* @__PURE__ */ jsx37("p", { className: "text-muted-foreground", children: "No checks." }) : null,
|
|
9315
|
-
rules.map((rule, index) => rule.kind === "unique" ? null : /* @__PURE__ */
|
|
9316
|
-
/* @__PURE__ */
|
|
9331
|
+
rules.map((rule, index) => rule.kind === "unique" ? null : /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-1", children: [
|
|
9332
|
+
/* @__PURE__ */ jsxs32(
|
|
9317
9333
|
Select5,
|
|
9318
9334
|
{
|
|
9319
9335
|
value: rule.kind,
|
|
@@ -9381,7 +9397,7 @@ function FieldEditor(props) {
|
|
|
9381
9397
|
}
|
|
9382
9398
|
) : null,
|
|
9383
9399
|
rehomeRefused ? /* @__PURE__ */ jsx37(RefusalNotice, { error: rehomeRefused }) : null,
|
|
9384
|
-
rehomed ? /* @__PURE__ */
|
|
9400
|
+
rehomed ? /* @__PURE__ */ jsxs32("div", { "data-records-choice-rehomed": "", className: "flex flex-wrap items-center gap-2 text-[11px]", children: [
|
|
9385
9401
|
/* @__PURE__ */ jsx37("span", { children: rehomed.said }),
|
|
9386
9402
|
rehomed.undo ? /* @__PURE__ */ jsx37(
|
|
9387
9403
|
Button15,
|
|
@@ -9410,15 +9426,15 @@ function FieldEditor(props) {
|
|
|
9410
9426
|
) : null,
|
|
9411
9427
|
/* @__PURE__ */ jsx37(Button15, { type: "button", size: "sm", className: "h-6 px-2 text-xs", onClick: () => onSaved?.(), children: "Done" })
|
|
9412
9428
|
] }) : null,
|
|
9413
|
-
reverseRefused ? /* @__PURE__ */
|
|
9429
|
+
reverseRefused ? /* @__PURE__ */ jsxs32("div", { "data-records-reverse-field-refused": "", className: "flex flex-col gap-1", children: [
|
|
9414
9430
|
/* @__PURE__ */ jsx37("p", { className: "text-[11px]", children: "The link is made. Its column on the other table was not:" }),
|
|
9415
9431
|
/* @__PURE__ */ jsx37(RefusalNotice, { error: reverseRefused })
|
|
9416
9432
|
] }) : null,
|
|
9417
|
-
backfillError ? /* @__PURE__ */
|
|
9433
|
+
backfillError ? /* @__PURE__ */ jsxs32("div", { "data-records-autonumber-backfill-refused": "", className: "flex flex-col gap-1", children: [
|
|
9418
9434
|
/* @__PURE__ */ jsx37("p", { className: "text-[11px]", children: "The column is made. The records already in the table were not numbered:" }),
|
|
9419
9435
|
/* @__PURE__ */ jsx37(RefusalNotice, { error: backfillError })
|
|
9420
9436
|
] }) : null,
|
|
9421
|
-
/* @__PURE__ */
|
|
9437
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex min-w-0 flex-nowrap items-center gap-2", "data-field-editor-footer": "", children: [
|
|
9422
9438
|
/* @__PURE__ */ jsx37(
|
|
9423
9439
|
Button15,
|
|
9424
9440
|
{
|
|
@@ -9452,9 +9468,9 @@ function FieldEditor(props) {
|
|
|
9452
9468
|
footer is always as wide and as tall as its larger state: opening the confirm moved
|
|
9453
9469
|
the dialog card 0.2278 and closing it 0.1303. The consequence is the tooltip of
|
|
9454
9470
|
"Remove it" (interface-text: the slot holds a label, never a paragraph). */
|
|
9455
|
-
/* @__PURE__ */
|
|
9471
|
+
/* @__PURE__ */ jsxs32("div", { className: "ml-auto grid shrink-0 items-center", "data-field-editor-remove": askingToRemove ? "asking" : "idle", children: [
|
|
9456
9472
|
/* @__PURE__ */ jsx37("div", { className: cn17("col-start-1 row-start-1 flex items-center justify-end gap-2", askingToRemove && "invisible"), "aria-hidden": askingToRemove || void 0, children: /* @__PURE__ */ jsx37(Button15, { size: "sm", variant: "outline", tabIndex: askingToRemove ? -1 : void 0, onClick: () => setAskingToRemove(true), children: "Remove this field" }) }),
|
|
9457
|
-
/* @__PURE__ */
|
|
9473
|
+
/* @__PURE__ */ jsxs32("div", { className: cn17("col-start-1 row-start-1 flex items-center justify-end gap-2", !askingToRemove && "invisible"), "aria-hidden": !askingToRemove || void 0, children: [
|
|
9458
9474
|
/* @__PURE__ */ jsx37("span", { className: "whitespace-nowrap text-destructive", "data-field-editor-remove-ask": "", children: "Archive this field?" }),
|
|
9459
9475
|
/* @__PURE__ */ jsx37(
|
|
9460
9476
|
Button15,
|
|
@@ -9578,7 +9594,7 @@ function TypeQuestions(props) {
|
|
|
9578
9594
|
}
|
|
9579
9595
|
if (type === "rating" || type === "barcode") return /* @__PURE__ */ jsx37(Fragment12, { children: props.newer });
|
|
9580
9596
|
if (type === "status") {
|
|
9581
|
-
return /* @__PURE__ */
|
|
9597
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-3", children: [
|
|
9582
9598
|
props.choiceList,
|
|
9583
9599
|
props.newer
|
|
9584
9600
|
] });
|
|
@@ -9587,7 +9603,7 @@ function TypeQuestions(props) {
|
|
|
9587
9603
|
return /* @__PURE__ */ jsx37(Fragment12, { children: props.choiceList });
|
|
9588
9604
|
}
|
|
9589
9605
|
if (type === "currency") {
|
|
9590
|
-
return /* @__PURE__ */
|
|
9606
|
+
return /* @__PURE__ */ jsxs32("label", { className: "flex max-w-[16rem] flex-col gap-1", children: [
|
|
9591
9607
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "The currency" }),
|
|
9592
9608
|
/* @__PURE__ */ jsx37(
|
|
9593
9609
|
BasicInput8,
|
|
@@ -9601,7 +9617,7 @@ function TypeQuestions(props) {
|
|
|
9601
9617
|
] });
|
|
9602
9618
|
}
|
|
9603
9619
|
if (type === "datetime") {
|
|
9604
|
-
return /* @__PURE__ */
|
|
9620
|
+
return /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-1.5", children: [
|
|
9605
9621
|
/* @__PURE__ */ jsx37(
|
|
9606
9622
|
Checkbox4,
|
|
9607
9623
|
{
|
|
@@ -9618,12 +9634,12 @@ function TypeQuestions(props) {
|
|
|
9618
9634
|
if (usable.length === 0) {
|
|
9619
9635
|
return /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "No link, Person or File column yet." });
|
|
9620
9636
|
}
|
|
9621
|
-
return /* @__PURE__ */
|
|
9622
|
-
/* @__PURE__ */
|
|
9637
|
+
return /* @__PURE__ */ jsxs32("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
9638
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9623
9639
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: type !== "lookup" ? "Across the records in" : "Read it from" }),
|
|
9624
|
-
/* @__PURE__ */
|
|
9640
|
+
/* @__PURE__ */ jsxs32(Select5, { value: props.via, onValueChange: props.setVia, children: [
|
|
9625
9641
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": type !== "lookup" ? "Across the records in" : "Read it from", children: /* @__PURE__ */ jsx37(SelectValue5, { placeholder: "Choose a column" }) }),
|
|
9626
|
-
/* @__PURE__ */ jsx37(SelectContent5, { children: usable.map((f) => /* @__PURE__ */
|
|
9642
|
+
/* @__PURE__ */ jsx37(SelectContent5, { children: usable.map((f) => /* @__PURE__ */ jsxs32(SelectItem5, { value: f.key, children: [
|
|
9627
9643
|
fieldName(f),
|
|
9628
9644
|
isBackLinkSource(f) ? BACK_LINK_SOURCE_SUFFIX : "",
|
|
9629
9645
|
sourceKindOf(f) === "person" ? " \u2014 a person" : sourceKindOf(f) === "file" ? " \u2014 a file" : "",
|
|
@@ -9640,9 +9656,9 @@ function TypeQuestions(props) {
|
|
|
9640
9656
|
value: props.pick,
|
|
9641
9657
|
onChange: props.setPick
|
|
9642
9658
|
}
|
|
9643
|
-
) : type === "count" ? null : /* @__PURE__ */
|
|
9659
|
+
) : type === "count" ? null : /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9644
9660
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "What to work out" }),
|
|
9645
|
-
/* @__PURE__ */
|
|
9661
|
+
/* @__PURE__ */ jsxs32(Select5, { value: props.agg, onValueChange: (v) => props.setAgg(v), children: [
|
|
9646
9662
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": "What to work out", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9647
9663
|
/* @__PURE__ */ jsx37(SelectContent5, { children: ROLLUP_OPERATIONS.map((row) => /* @__PURE__ */ jsx37(SelectItem5, { value: row.value, children: row.label }, row.value)) })
|
|
9648
9664
|
] }),
|
|
@@ -9664,15 +9680,15 @@ function TypeQuestions(props) {
|
|
|
9664
9680
|
if (props.others.length === 0) {
|
|
9665
9681
|
return /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "No other columns yet." });
|
|
9666
9682
|
}
|
|
9667
|
-
return /* @__PURE__ */
|
|
9668
|
-
/* @__PURE__ */
|
|
9683
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-2", children: [
|
|
9684
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9669
9685
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "What to do" }),
|
|
9670
|
-
/* @__PURE__ */
|
|
9686
|
+
/* @__PURE__ */ jsxs32(Select5, { value: props.formulaOp, onValueChange: props.setFormulaOp, children: [
|
|
9671
9687
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", className: "max-w-[18rem]", "aria-label": "What to do", children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9672
9688
|
/* @__PURE__ */ jsx37(SelectContent5, { children: FORMULA_OPERATIONS.map((row) => /* @__PURE__ */ jsx37(SelectItem5, { value: row.value, children: row.label }, row.value)) })
|
|
9673
9689
|
] })
|
|
9674
9690
|
] }),
|
|
9675
|
-
/* @__PURE__ */
|
|
9691
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9676
9692
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: "Which columns" }),
|
|
9677
9693
|
/* @__PURE__ */ jsx37("div", { className: "flex flex-wrap gap-1", children: props.others.map((f) => {
|
|
9678
9694
|
const picked = props.formulaFields.includes(f.id);
|
|
@@ -9691,7 +9707,7 @@ function TypeQuestions(props) {
|
|
|
9691
9707
|
);
|
|
9692
9708
|
}) })
|
|
9693
9709
|
] }),
|
|
9694
|
-
props.formulaOp === "concat" ? /* @__PURE__ */
|
|
9710
|
+
props.formulaOp === "concat" ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9695
9711
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", children: FORMULA_SEPARATOR_LABEL }),
|
|
9696
9712
|
/* @__PURE__ */ jsx37(
|
|
9697
9713
|
BasicInput8,
|
|
@@ -9744,18 +9760,18 @@ function RollupFilterQuestion({
|
|
|
9744
9760
|
}) {
|
|
9745
9761
|
const far = relation?.relation_target ?? null;
|
|
9746
9762
|
const farFields = useFields4(far);
|
|
9747
|
-
const conditionFields =
|
|
9763
|
+
const conditionFields = useMemo11(
|
|
9748
9764
|
() => (farFields.data ?? []).filter((f) => f.type !== "formula").map((f) => ({ id: f.id, key: f.key, label: fieldName(f), field: f })),
|
|
9749
9765
|
[farFields.data]
|
|
9750
9766
|
);
|
|
9751
|
-
const lastFar =
|
|
9767
|
+
const lastFar = useRef13(far);
|
|
9752
9768
|
useEffect19(() => {
|
|
9753
9769
|
if (lastFar.current !== null && far !== lastFar.current && !editing) onChange(null);
|
|
9754
9770
|
lastFar.current = far;
|
|
9755
9771
|
}, [far, editing, onChange]);
|
|
9756
9772
|
if (!relation || !far) return null;
|
|
9757
|
-
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-1", "data-records-rollup-filter": "", children: !conditionIsDrawable(value) ? /* @__PURE__ */
|
|
9758
|
-
/* @__PURE__ */
|
|
9773
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-1", "data-records-rollup-filter": "", children: !conditionIsDrawable(value) ? /* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap items-center gap-2 text-[11px]", children: [
|
|
9774
|
+
/* @__PURE__ */ jsxs32("span", { className: "text-muted-foreground", children: [
|
|
9759
9775
|
rollupFilterLead(agg),
|
|
9760
9776
|
" ",
|
|
9761
9777
|
conditionInWords(value, conditionFields),
|
|
@@ -9788,12 +9804,12 @@ function ValueOnTheOtherSide({
|
|
|
9788
9804
|
const carried = sample.data?.rows[0]?.document ?? null;
|
|
9789
9805
|
const offered = declared.length > 0 ? declared.map((f) => ({ key: f.key, name: fieldName(f) })) : Object.keys(carried ?? {}).map((key) => ({ key, name: humanizeIdentifier2(key) }));
|
|
9790
9806
|
const stillAsking = columns.loading || declared.length === 0 && sample.loading;
|
|
9791
|
-
const body = !relation ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */
|
|
9807
|
+
const body = !relation ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ jsx37("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ jsxs32(Select5, { value, onValueChange: onChange, children: [
|
|
9792
9808
|
/* @__PURE__ */ jsx37(SelectTrigger5, { size: "sm", "aria-label": label, children: /* @__PURE__ */ jsx37(SelectValue5, { placeholder: "Choose a column" }) }),
|
|
9793
9809
|
/* @__PURE__ */ jsx37(SelectContent5, { children: offered.map((column) => /* @__PURE__ */ jsx37(SelectItem5, { value: column.key, children: column.name }, column.key)) })
|
|
9794
9810
|
] });
|
|
9795
9811
|
if (compact) return /* @__PURE__ */ jsx37("div", { className: "mt-1 flex flex-col gap-1", children: body });
|
|
9796
|
-
return /* @__PURE__ */
|
|
9812
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
9797
9813
|
/* @__PURE__ */ jsx37(Label9, { className: "text-xs", title: help, children: label }),
|
|
9798
9814
|
body
|
|
9799
9815
|
] });
|
|
@@ -9820,14 +9836,14 @@ function NewColumnDefault({
|
|
|
9820
9836
|
onChange
|
|
9821
9837
|
}) {
|
|
9822
9838
|
const none = "__none__";
|
|
9823
|
-
return /* @__PURE__ */
|
|
9839
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", "data-records-field-default": "", "data-records-new-field-default": "", children: [
|
|
9824
9840
|
/* @__PURE__ */ jsx37(Label9, { htmlFor: "records-new-field-default", className: "text-xs", children: DEFAULT_LABEL }),
|
|
9825
|
-
type === "checkbox" ? /* @__PURE__ */
|
|
9841
|
+
type === "checkbox" ? /* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-2", children: [
|
|
9826
9842
|
/* @__PURE__ */ jsx37(Checkbox4, { id: "records-new-field-default", "aria-label": DEFAULT_LABEL, checked: value === true, onCheckedChange: (on) => onChange(on === true ? true : null) }),
|
|
9827
9843
|
/* @__PURE__ */ jsx37("span", { children: "Ticked" })
|
|
9828
|
-
] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */
|
|
9844
|
+
] }) : type === "select" || type === "multi_select" || type === "status" ? /* @__PURE__ */ jsxs32(Select5, { value: typeof value === "string" && choices.includes(value) ? value : none, onValueChange: (v) => onChange(v === none ? null : v), children: [
|
|
9829
9845
|
/* @__PURE__ */ jsx37(SelectTrigger5, { id: "records-new-field-default", size: "sm", "aria-label": DEFAULT_LABEL, children: /* @__PURE__ */ jsx37(SelectValue5, {}) }),
|
|
9830
|
-
/* @__PURE__ */
|
|
9846
|
+
/* @__PURE__ */ jsxs32(SelectContent5, { children: [
|
|
9831
9847
|
/* @__PURE__ */ jsx37(SelectItem5, { value: none, children: "Nothing" }),
|
|
9832
9848
|
choices.map((c) => /* @__PURE__ */ jsx37(SelectItem5, { value: c, children: c }, c))
|
|
9833
9849
|
] })
|
|
@@ -9846,7 +9862,7 @@ function NewColumnDefault({
|
|
|
9846
9862
|
// src/buttonCell.tsx
|
|
9847
9863
|
import { OutboundLink as OutboundLink7 } from "@ai-matrx/kit/outbound-react";
|
|
9848
9864
|
import { openOutbound as openOutbound2 } from "@ai-matrx/kit/outbound";
|
|
9849
|
-
import { Fragment as Fragment13, jsx as jsx38, jsxs as
|
|
9865
|
+
import { Fragment as Fragment13, jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9850
9866
|
function buttonPressWords(label, pressed) {
|
|
9851
9867
|
if (pressed.do === "open_url") return `${label} opened ${readableLink(pressed.url)}`;
|
|
9852
9868
|
if (pressed.do === "add_row") return `${label}: a row was added.`;
|
|
@@ -9916,12 +9932,12 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
9916
9932
|
const here = useContext3(OpenRecordHereContext);
|
|
9917
9933
|
const host = useRecordsUi();
|
|
9918
9934
|
const addsTo = useTable3(b?.do === "add_row" ? b.table_id ?? field2.entity_definition_id : null);
|
|
9919
|
-
const waitingOn =
|
|
9935
|
+
const waitingOn = useRef14(0);
|
|
9920
9936
|
useEffect20(() => () => void (waitingOn.current += 1), []);
|
|
9921
9937
|
if (!b) return null;
|
|
9922
9938
|
const color = isStyleColor(b.color) ? CHOICE_CHIP_CLASS[b.color] : NEUTRAL_CHIP_CLASS;
|
|
9923
9939
|
if (beforeSave) {
|
|
9924
|
-
return /* @__PURE__ */
|
|
9940
|
+
return /* @__PURE__ */ jsxs33("span", { className: "inline-flex min-w-0 items-center gap-2", "data-records-button-before-save": field2.key, children: [
|
|
9925
9941
|
/* @__PURE__ */ jsx38(Button16, { type: "button", size: "xs", variant: "outline", disabled: true, "aria-describedby": `${field2.key}-before-save`, "data-records-button": field2.key, className: cn18("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color), children: /* @__PURE__ */ jsx38("span", { className: "truncate", children: b.label }) }),
|
|
9926
9942
|
/* @__PURE__ */ jsx38("span", { id: `${field2.key}-before-save`, className: "whitespace-nowrap text-xs text-muted-foreground", children: "Save the record first" })
|
|
9927
9943
|
] });
|
|
@@ -10019,8 +10035,8 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
10019
10035
|
}
|
|
10020
10036
|
setSaid({ kind: "ran", says: words });
|
|
10021
10037
|
};
|
|
10022
|
-
return /* @__PURE__ */
|
|
10023
|
-
/* @__PURE__ */
|
|
10038
|
+
return /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
10039
|
+
/* @__PURE__ */ jsxs33(
|
|
10024
10040
|
Popover4,
|
|
10025
10041
|
{
|
|
10026
10042
|
open: said2 !== null,
|
|
@@ -10053,20 +10069,20 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
10053
10069
|
children: /* @__PURE__ */ jsx38("span", { className: cn18("truncate", (busy || opening) && "matrx-shimmer"), children: b.label })
|
|
10054
10070
|
}
|
|
10055
10071
|
) }),
|
|
10056
|
-
/* @__PURE__ */
|
|
10072
|
+
/* @__PURE__ */ jsxs33(PopoverContent4, { className: "w-72 space-y-2 p-3 text-sm", onClick: stop2, onPointerDown: stop2, "data-records-button-said": said2?.kind, children: [
|
|
10057
10073
|
said2?.kind === "refused" ? /* @__PURE__ */ jsx38(RefusalLine, { error: said2.error }) : null,
|
|
10058
10074
|
said2?.kind === "waiting" ? /* @__PURE__ */ jsx38("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
|
|
10059
10075
|
said2?.kind === "failed" ? /* @__PURE__ */ jsx38(ErrorBox2, { as: "p", className: "break-words text-destructive", message: said2.says, origin: "records-ui/buttonCell", children: said2.says }) : null,
|
|
10060
10076
|
said2?.kind === "public" ? /* @__PURE__ */ jsx38("p", { children: "Buttons run for signed-in people." }) : null,
|
|
10061
|
-
said2?.kind === "ran" ? /* @__PURE__ */
|
|
10077
|
+
said2?.kind === "ran" ? /* @__PURE__ */ jsxs33("div", { className: "break-words", children: [
|
|
10062
10078
|
said2.value ? /* @__PURE__ */ jsx38(StructuredValueView, { structured: said2.value, label: b.label }) : null,
|
|
10063
10079
|
said2.says,
|
|
10064
10080
|
" ",
|
|
10065
10081
|
said2.link ? /* @__PURE__ */ jsx38(OutboundLink7, { href: said2.link, className: "text-primary underline", children: readableLink(said2.link) }) : null
|
|
10066
10082
|
] }) : null,
|
|
10067
|
-
said2?.kind === "needs" ? /* @__PURE__ */
|
|
10083
|
+
said2?.kind === "needs" ? /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
10068
10084
|
/* @__PURE__ */ jsx38("p", { children: said2.says }),
|
|
10069
|
-
tableId ? /* @__PURE__ */
|
|
10085
|
+
tableId ? /* @__PURE__ */ jsxs33(
|
|
10070
10086
|
Button16,
|
|
10071
10087
|
{
|
|
10072
10088
|
type: "button",
|
|
@@ -10087,8 +10103,8 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
10087
10103
|
]
|
|
10088
10104
|
}
|
|
10089
10105
|
),
|
|
10090
|
-
settingUp && tableId ? /* @__PURE__ */ jsx38(Dialog3, { open: true, onOpenChange: (open) => open ? null : setSettingUp(false), children: /* @__PURE__ */
|
|
10091
|
-
/* @__PURE__ */
|
|
10106
|
+
settingUp && tableId ? /* @__PURE__ */ jsx38(Dialog3, { open: true, onOpenChange: (open) => open ? null : setSettingUp(false), children: /* @__PURE__ */ jsxs33(DialogContent3, { className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl", onClick: stop2, onPointerDown: stop2, children: [
|
|
10107
|
+
/* @__PURE__ */ jsxs33(DialogHeader3, { children: [
|
|
10092
10108
|
/* @__PURE__ */ jsx38(DialogTitle3, { children: `Column settings \xB7 ${fieldName(field2)}` }),
|
|
10093
10109
|
/* @__PURE__ */ jsx38(DialogDescription, { className: "sr-only", children: "What the button does" })
|
|
10094
10110
|
] }),
|
|
@@ -10098,9 +10114,9 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
10098
10114
|
}
|
|
10099
10115
|
|
|
10100
10116
|
// src/FloatingRefusal.tsx
|
|
10101
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
10117
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef15, useState as useState29 } from "react";
|
|
10102
10118
|
import { createPortal } from "react-dom";
|
|
10103
|
-
import { Fragment as Fragment14, jsx as jsx39, jsxs as
|
|
10119
|
+
import { Fragment as Fragment14, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10104
10120
|
var GAP2 = 4;
|
|
10105
10121
|
function placeFor(anchor, note) {
|
|
10106
10122
|
const a = anchor.getBoundingClientRect();
|
|
@@ -10116,8 +10132,8 @@ function placeFor(anchor, note) {
|
|
|
10116
10132
|
return { position: "fixed", top: a.top + (a.height - height) / 2, left: Math.max(a.left, a.right - width - 8) };
|
|
10117
10133
|
}
|
|
10118
10134
|
function FloatingRefusal({ text, why }) {
|
|
10119
|
-
const spot =
|
|
10120
|
-
const note =
|
|
10135
|
+
const spot = useRef15(null);
|
|
10136
|
+
const note = useRef15(null);
|
|
10121
10137
|
const [style, setStyle] = useState29(null);
|
|
10122
10138
|
const [floating, setFloating] = useState29(false);
|
|
10123
10139
|
useLayoutEffect2(() => {
|
|
@@ -10140,7 +10156,7 @@ function FloatingRefusal({ text, why }) {
|
|
|
10140
10156
|
if (!floating) {
|
|
10141
10157
|
return /* @__PURE__ */ jsx39("span", { ref: spot, "data-records-typed-refusal": "", role: "status", title: why, className: "text-[11px] leading-snug text-amber-700 dark:text-amber-400", children: text });
|
|
10142
10158
|
}
|
|
10143
|
-
return /* @__PURE__ */
|
|
10159
|
+
return /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
10144
10160
|
/* @__PURE__ */ jsx39("span", { ref: spot, "data-records-refusal-anchor": "", hidden: true }),
|
|
10145
10161
|
typeof document === "undefined" ? null : createPortal(
|
|
10146
10162
|
/* @__PURE__ */ jsx39(
|
|
@@ -10162,10 +10178,10 @@ function FloatingRefusal({ text, why }) {
|
|
|
10162
10178
|
}
|
|
10163
10179
|
|
|
10164
10180
|
// src/formatControls.tsx
|
|
10165
|
-
import { useEffect as useEffect21, useRef as
|
|
10181
|
+
import { useEffect as useEffect21, useRef as useRef16, useState as useState30 } from "react";
|
|
10166
10182
|
import { BasicInput as BasicInput9, BasicTextarea as BasicTextarea4 } from "@ai-matrx/design-system";
|
|
10167
10183
|
import { getFieldFormat as getFieldFormat3, parseFieldInput } from "@ai-matrx/design-system/field-formats";
|
|
10168
|
-
import { jsx as jsx40, jsxs as
|
|
10184
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10169
10185
|
var TYPED_NUMBERS = /* @__PURE__ */ new Set(["currency", "percent", "progress", "decimal", "duration", "file_size", "integer"]);
|
|
10170
10186
|
function scaled(format) {
|
|
10171
10187
|
return (format.id === "percent" || format.id === "progress") && format.options?.percentScale === "fraction";
|
|
@@ -10183,7 +10199,7 @@ function keptValue(format, raw) {
|
|
|
10183
10199
|
}
|
|
10184
10200
|
function NumberInFormat({ format, value, onChange, disabled, id }) {
|
|
10185
10201
|
const [text, setText] = useState30(() => typedText(format, value));
|
|
10186
|
-
const lastSent =
|
|
10202
|
+
const lastSent = useRef16(void 0);
|
|
10187
10203
|
useEffect21(() => {
|
|
10188
10204
|
if (value === lastSent.current) return;
|
|
10189
10205
|
setText(typedText(format, value));
|
|
@@ -10240,7 +10256,7 @@ function formatControl(args) {
|
|
|
10240
10256
|
}
|
|
10241
10257
|
);
|
|
10242
10258
|
case "color":
|
|
10243
|
-
return /* @__PURE__ */
|
|
10259
|
+
return /* @__PURE__ */ jsxs35("span", { className: "flex items-center gap-2", children: [
|
|
10244
10260
|
/* @__PURE__ */ jsx40(
|
|
10245
10261
|
BasicInput9,
|
|
10246
10262
|
{
|
|
@@ -10266,7 +10282,7 @@ function formatControl(args) {
|
|
|
10266
10282
|
import { useState as useState31 } from "react";
|
|
10267
10283
|
import { Popover as Popover5, PopoverContent as PopoverContent5, PopoverTrigger as PopoverTrigger5, cn as cn19 } from "@ai-matrx/design-system";
|
|
10268
10284
|
import { readTypedDate, readTypedTime, typedDateText, typedTimeText, wallPartsInZone } from "@ai-matrx/records";
|
|
10269
|
-
import { jsx as jsx41, jsxs as
|
|
10285
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10270
10286
|
var WEEK = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
10271
10287
|
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
10272
10288
|
function pad(n) {
|
|
@@ -10295,13 +10311,13 @@ function wordsFor2(kind, day, time) {
|
|
|
10295
10311
|
}
|
|
10296
10312
|
var keepFocus = { onMouseDown: (e) => e.preventDefault(), tabIndex: -1 };
|
|
10297
10313
|
function CalendarGlyph() {
|
|
10298
|
-
return /* @__PURE__ */
|
|
10314
|
+
return /* @__PURE__ */ jsxs36("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
10299
10315
|
/* @__PURE__ */ jsx41("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
10300
10316
|
/* @__PURE__ */ jsx41("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
10301
10317
|
] });
|
|
10302
10318
|
}
|
|
10303
10319
|
function ClockGlyph() {
|
|
10304
|
-
return /* @__PURE__ */
|
|
10320
|
+
return /* @__PURE__ */ jsxs36("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
10305
10321
|
/* @__PURE__ */ jsx41("circle", { cx: "12", cy: "12", r: "10" }),
|
|
10306
10322
|
/* @__PURE__ */ jsx41("path", { d: "M12 6v6l4 2" })
|
|
10307
10323
|
] });
|
|
@@ -10344,7 +10360,7 @@ function TypedDateHelper({
|
|
|
10344
10360
|
const at = new Date(shown2.y, shown2.m + by, 1);
|
|
10345
10361
|
setMonth({ y: at.getFullYear(), m: at.getMonth() });
|
|
10346
10362
|
};
|
|
10347
|
-
return /* @__PURE__ */
|
|
10363
|
+
return /* @__PURE__ */ jsxs36(Popover5, { open, onOpenChange: setOpen, children: [
|
|
10348
10364
|
/* @__PURE__ */ jsx41(PopoverTrigger5, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10349
10365
|
"button",
|
|
10350
10366
|
{
|
|
@@ -10367,18 +10383,18 @@ function TypedDateHelper({
|
|
|
10367
10383
|
"data-records-date-helper-panel": "",
|
|
10368
10384
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
10369
10385
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
10370
|
-
children: /* @__PURE__ */
|
|
10371
|
-
kind === "time" ? null : /* @__PURE__ */
|
|
10372
|
-
/* @__PURE__ */
|
|
10386
|
+
children: /* @__PURE__ */ jsxs36("div", { className: "flex gap-2", children: [
|
|
10387
|
+
kind === "time" ? null : /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-1", role: "grid", "aria-label": `${MONTHS[shown2.m]} ${shown2.y}`, children: [
|
|
10388
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between text-xs font-medium", children: [
|
|
10373
10389
|
/* @__PURE__ */ jsx41("button", { type: "button", ...keepFocus, "aria-label": "Previous month", className: "rounded px-1.5 hover:bg-muted", onClick: () => turn(-1), children: "\u2039" }),
|
|
10374
|
-
/* @__PURE__ */
|
|
10390
|
+
/* @__PURE__ */ jsxs36("span", { children: [
|
|
10375
10391
|
MONTHS[shown2.m],
|
|
10376
10392
|
" ",
|
|
10377
10393
|
shown2.y
|
|
10378
10394
|
] }),
|
|
10379
10395
|
/* @__PURE__ */ jsx41("button", { type: "button", ...keepFocus, "aria-label": "Next month", className: "rounded px-1.5 hover:bg-muted", onClick: () => turn(1), children: "\u203A" })
|
|
10380
10396
|
] }),
|
|
10381
|
-
/* @__PURE__ */
|
|
10397
|
+
/* @__PURE__ */ jsxs36("div", { className: "grid grid-cols-7 gap-0.5 text-center text-[11px]", children: [
|
|
10382
10398
|
WEEK.map((w) => /* @__PURE__ */ jsx41("span", { className: "text-muted-foreground", children: w }, w)),
|
|
10383
10399
|
cells.map((d, i) => {
|
|
10384
10400
|
if (d === null) return /* @__PURE__ */ jsx41("span", {}, `blank-${i}`);
|
|
@@ -10424,7 +10440,7 @@ function TypedDateHelper({
|
|
|
10424
10440
|
}
|
|
10425
10441
|
|
|
10426
10442
|
// src/editors.tsx
|
|
10427
|
-
import { Fragment as Fragment15, jsx as jsx42, jsxs as
|
|
10443
|
+
import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10428
10444
|
var CHOICE_EDITOR_ADDS_WHAT_IS_TYPED = true;
|
|
10429
10445
|
function isChoiceAddition(value) {
|
|
10430
10446
|
return typeof value === "object" && value !== null && value.addingChoices === true;
|
|
@@ -10454,9 +10470,9 @@ function ChoiceAskButtons({
|
|
|
10454
10470
|
onCancel,
|
|
10455
10471
|
busy
|
|
10456
10472
|
}) {
|
|
10457
|
-
return /* @__PURE__ */
|
|
10473
|
+
return /* @__PURE__ */ jsxs37("span", { "data-records-choice-ask": "", "data-records-cell-note": "", role: "group", "aria-label": choiceAskSentence(field2, words), className: "flex flex-col gap-1", children: [
|
|
10458
10474
|
/* @__PURE__ */ jsx42("span", { className: "text-[11px] leading-snug", children: choiceAskSentence(field2, words) }),
|
|
10459
|
-
/* @__PURE__ */
|
|
10475
|
+
/* @__PURE__ */ jsxs37("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
10460
10476
|
/* @__PURE__ */ jsx42(Button17, { type: "button", size: "sm", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onAdd, children: "Add" }),
|
|
10461
10477
|
keepOffered ? /* @__PURE__ */ jsx42(Button17, { type: "button", size: "sm", variant: "outline", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onKeep, children: "Keep as typed" }) : null,
|
|
10462
10478
|
/* @__PURE__ */ jsx42(Button17, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", disabled: busy ?? false, onClick: onCancel, children: "Cancel" })
|
|
@@ -10465,7 +10481,7 @@ function ChoiceAskButtons({
|
|
|
10465
10481
|
}
|
|
10466
10482
|
var FORMAT_BLIND_KINDS = /* @__PURE__ */ new Set(["formula", "lookup", "rollup", "json", "checkbox", "select", "multi_select", "member", "entity_reference", "relation", "attachment", "datetime"]);
|
|
10467
10483
|
function FieldLabel({ field: field2, htmlFor, children }) {
|
|
10468
|
-
return /* @__PURE__ */
|
|
10484
|
+
return /* @__PURE__ */ jsxs37("div", { className: "flex items-baseline gap-1.5", children: [
|
|
10469
10485
|
/* @__PURE__ */ jsx42(Label10, { htmlFor, className: "text-xs font-medium", children: fieldName(field2) }),
|
|
10470
10486
|
field2.required ? /* @__PURE__ */ jsx42("span", { className: "text-xs text-destructive", children: "required" }) : null,
|
|
10471
10487
|
field2.unit && newerKindOf2(field2) !== "duration" ? /* @__PURE__ */ jsx42("span", { className: "text-xs text-muted-foreground", children: field2.unit }) : null,
|
|
@@ -10597,7 +10613,7 @@ function draftFromTyping(field2, seed) {
|
|
|
10597
10613
|
return { typedDraft: true, text: seed, judged: judgeTyped(field2, seed) };
|
|
10598
10614
|
}
|
|
10599
10615
|
function ReadsAsNote({ typed, always, children }) {
|
|
10600
|
-
const note =
|
|
10616
|
+
const note = useRef17(null);
|
|
10601
10617
|
const [repeats, setRepeats] = useState32(false);
|
|
10602
10618
|
useLayoutEffect3(() => {
|
|
10603
10619
|
if (always) return;
|
|
@@ -10647,12 +10663,12 @@ function TypedTextControl({ field: field2, value, onChange, disabled, id, onComm
|
|
|
10647
10663
|
onChange: (e) => retype(e.target.value)
|
|
10648
10664
|
}
|
|
10649
10665
|
);
|
|
10650
|
-
return /* @__PURE__ */
|
|
10651
|
-
helper && !disabled ? /* @__PURE__ */
|
|
10666
|
+
return /* @__PURE__ */ jsxs37("span", { className: "flex flex-col gap-0.5", children: [
|
|
10667
|
+
helper && !disabled ? /* @__PURE__ */ jsxs37("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
10652
10668
|
box,
|
|
10653
10669
|
/* @__PURE__ */ jsx42(TypedDateHelper, { kind: helper, text: value.text, onText: retype, label: fieldName(field2), onPicked: onCommit, startOpen: value.openedAs !== void 0 })
|
|
10654
10670
|
] }) : box,
|
|
10655
|
-
judged === null ? /* @__PURE__ */
|
|
10671
|
+
judged === null ? /* @__PURE__ */ jsxs37("span", { "data-records-cell-note": "", className: "text-[10px] text-muted-foreground", children: [
|
|
10656
10672
|
"Reading ",
|
|
10657
10673
|
fieldName(field2),
|
|
10658
10674
|
"'s choices\u2026"
|
|
@@ -10672,10 +10688,10 @@ function TypedTextControl({ field: field2, value, onChange, disabled, id, onComm
|
|
|
10672
10688
|
},
|
|
10673
10689
|
onCancel: () => onCancel?.()
|
|
10674
10690
|
}
|
|
10675
|
-
) : "refusal" in judged ? /* @__PURE__ */
|
|
10691
|
+
) : "refusal" in judged ? /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
10676
10692
|
/* @__PURE__ */ jsx42(FloatingRefusal, { text: judged.refusal, why: "why" in judged ? judged.why : void 0 }),
|
|
10677
10693
|
judged.cancelOnly && onCancel ? /* @__PURE__ */ jsx42("span", { "data-records-cell-note": "", "data-records-choice-ask": "", children: /* @__PURE__ */ jsx42(Button17, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => onCancel(), children: "Cancel" }) }) : null
|
|
10678
|
-
] }) : judged.value === null || judged.value === void 0 ? null : /* @__PURE__ */
|
|
10694
|
+
] }) : judged.value === null || judged.value === void 0 ? null : /* @__PURE__ */ jsxs37(ReadsAsNote, { typed: value.text, always: isChoiceAddition(judged.value), children: [
|
|
10679
10695
|
isChoiceAddition(judged.value) ? `Adds ${quoted(judged.value.add)} to the choices for ${fieldName(field2)}. ` : null,
|
|
10680
10696
|
"Reads as",
|
|
10681
10697
|
" ",
|
|
@@ -10718,9 +10734,9 @@ function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
10718
10734
|
case "formula":
|
|
10719
10735
|
case "lookup":
|
|
10720
10736
|
case "rollup":
|
|
10721
|
-
return /* @__PURE__ */
|
|
10737
|
+
return /* @__PURE__ */ jsxs37("div", { id: inputId, className: "rounded border border-dashed px-2 py-1.5 text-xs text-muted-foreground", children: [
|
|
10722
10738
|
value === null || value === void 0 ? "\u2014" : String(value),
|
|
10723
|
-
/* @__PURE__ */
|
|
10739
|
+
/* @__PURE__ */ jsxs37("span", { className: "ml-2 italic", children: [
|
|
10724
10740
|
fieldName(field2),
|
|
10725
10741
|
" is calculated, so it cannot be typed in"
|
|
10726
10742
|
] })
|
|
@@ -10825,7 +10841,7 @@ function TypedWordsControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
10825
10841
|
const [text, setText] = useState32(() => openingText(field2, value));
|
|
10826
10842
|
const [refusal, setRefusal] = useState32(null);
|
|
10827
10843
|
const [why, setWhy] = useState32(void 0);
|
|
10828
|
-
const sent =
|
|
10844
|
+
const sent = useRef17(value);
|
|
10829
10845
|
useEffect22(() => {
|
|
10830
10846
|
if (value === sent.current) return;
|
|
10831
10847
|
sent.current = value;
|
|
@@ -10845,8 +10861,8 @@ function TypedWordsControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
10845
10861
|
setWhy("why" in judged ? judged.why : void 0);
|
|
10846
10862
|
}
|
|
10847
10863
|
};
|
|
10848
|
-
return /* @__PURE__ */
|
|
10849
|
-
/* @__PURE__ */
|
|
10864
|
+
return /* @__PURE__ */ jsxs37("span", { className: "flex flex-col gap-0.5", children: [
|
|
10865
|
+
/* @__PURE__ */ jsxs37("span", { className: "flex min-w-0 items-center gap-0.5", children: [
|
|
10850
10866
|
/* @__PURE__ */ jsx42(
|
|
10851
10867
|
BasicInput10,
|
|
10852
10868
|
{
|
|
@@ -10877,7 +10893,7 @@ function typedDatePlaceholder(helper) {
|
|
|
10877
10893
|
}
|
|
10878
10894
|
function CheckboxControl({ field: field2, value, onChange, disabled, id }) {
|
|
10879
10895
|
const unanswered = value === null || value === void 0;
|
|
10880
|
-
return /* @__PURE__ */
|
|
10896
|
+
return /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2", children: [
|
|
10881
10897
|
/* @__PURE__ */ jsx42(
|
|
10882
10898
|
Checkbox5,
|
|
10883
10899
|
{
|
|
@@ -10888,7 +10904,7 @@ function CheckboxControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
10888
10904
|
onCheckedChange: (next) => onChange(next === true)
|
|
10889
10905
|
}
|
|
10890
10906
|
),
|
|
10891
|
-
unanswered ? /* @__PURE__ */ jsx42("span", { className: "text-xs italic text-muted-foreground", children: "not answered yet" }) : /* @__PURE__ */
|
|
10907
|
+
unanswered ? /* @__PURE__ */ jsx42("span", { className: "text-xs italic text-muted-foreground", children: "not answered yet" }) : /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
10892
10908
|
/* @__PURE__ */ jsx42("span", { className: "text-xs text-muted-foreground", children: value === true ? "Yes" : "No" }),
|
|
10893
10909
|
field2.required ? null : /* @__PURE__ */ jsx42(
|
|
10894
10910
|
Button17,
|
|
@@ -10907,7 +10923,7 @@ function CheckboxControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
10907
10923
|
function StructuredTextControl({ field: field2, value, onChange, disabled, id, rows }) {
|
|
10908
10924
|
const text = typeof value === "string" ? value : "";
|
|
10909
10925
|
const reads = structuredOf(text) !== null;
|
|
10910
|
-
return /* @__PURE__ */
|
|
10926
|
+
return /* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-1", "data-records-structured-editor": "", children: [
|
|
10911
10927
|
/* @__PURE__ */ jsx42(
|
|
10912
10928
|
BasicTextarea5,
|
|
10913
10929
|
{
|
|
@@ -10939,7 +10955,7 @@ function JsonControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
10939
10955
|
const initial = value === null || value === void 0 ? "" : typeof value === "string" ? value : JSON.stringify(value, null, 2);
|
|
10940
10956
|
const [text, setText] = useState32(initial);
|
|
10941
10957
|
const [broken, setBroken] = useState32(null);
|
|
10942
|
-
return /* @__PURE__ */
|
|
10958
|
+
return /* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-1", children: [
|
|
10943
10959
|
/* @__PURE__ */ jsx42(
|
|
10944
10960
|
BasicTextarea5,
|
|
10945
10961
|
{
|
|
@@ -11020,7 +11036,7 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
11020
11036
|
return /* @__PURE__ */ jsx42(ChoiceAnswer, { field: field2, choices: handed, value, onChange, disabled, id, onChosen });
|
|
11021
11037
|
}
|
|
11022
11038
|
if (!client) {
|
|
11023
|
-
return /* @__PURE__ */
|
|
11039
|
+
return /* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-1", children: [
|
|
11024
11040
|
/* @__PURE__ */ jsx42(
|
|
11025
11041
|
BasicInput10,
|
|
11026
11042
|
{
|
|
@@ -11067,7 +11083,7 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
11067
11083
|
}
|
|
11068
11084
|
) : null;
|
|
11069
11085
|
if (CHOICE_EDITOR_ADDS_WHAT_IS_TYPED) {
|
|
11070
|
-
return /* @__PURE__ */
|
|
11086
|
+
return /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
11071
11087
|
offerChoices,
|
|
11072
11088
|
/* @__PURE__ */ jsx42(
|
|
11073
11089
|
OpenChoicePicker,
|
|
@@ -11117,7 +11133,7 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
11117
11133
|
option.id
|
|
11118
11134
|
)) });
|
|
11119
11135
|
if (!autoOpen) return toggles;
|
|
11120
|
-
return /* @__PURE__ */
|
|
11136
|
+
return /* @__PURE__ */ jsxs37(
|
|
11121
11137
|
Popover6,
|
|
11122
11138
|
{
|
|
11123
11139
|
defaultOpen: true,
|
|
@@ -11132,7 +11148,7 @@ function OptionControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
11132
11148
|
);
|
|
11133
11149
|
}
|
|
11134
11150
|
const current = options.find((option) => isTheChosen(option, value));
|
|
11135
|
-
return /* @__PURE__ */
|
|
11151
|
+
return /* @__PURE__ */ jsxs37(
|
|
11136
11152
|
Select6,
|
|
11137
11153
|
{
|
|
11138
11154
|
value: current ? optionKey4(current) : "",
|
|
@@ -11170,7 +11186,7 @@ function OpenChoicePicker({
|
|
|
11170
11186
|
const client = useOptionalRecordsClient12();
|
|
11171
11187
|
const nudge = useChoiceNudge();
|
|
11172
11188
|
const [open, setOpenState] = useState32(autoOpen === true);
|
|
11173
|
-
const onCloseRef =
|
|
11189
|
+
const onCloseRef = useRef17(onClose);
|
|
11174
11190
|
onCloseRef.current = onClose;
|
|
11175
11191
|
const setOpen = useCallback7((next) => {
|
|
11176
11192
|
setOpenState(next);
|
|
@@ -11251,7 +11267,7 @@ function OpenChoicePicker({
|
|
|
11251
11267
|
};
|
|
11252
11268
|
});
|
|
11253
11269
|
const anchored = autoOpen === true;
|
|
11254
|
-
return /* @__PURE__ */
|
|
11270
|
+
return /* @__PURE__ */ jsxs37("div", { id, className: "flex flex-wrap items-center gap-1", children: [
|
|
11255
11271
|
anchored || disabled ? null : cellChips,
|
|
11256
11272
|
disabled ? cellChips : (
|
|
11257
11273
|
// THE ONE "PICK OR ADD" BUILDER (PickOrAdd.tsx) — the relation picker draws the same one.
|
|
@@ -11287,7 +11303,7 @@ function OpenChoicePicker({
|
|
|
11287
11303
|
foot,
|
|
11288
11304
|
footNote: addRefused ? /* @__PURE__ */ jsx42(RefusalLine, { error: addRefused }) : offList && decided.decision === "not_a_choice" ? (
|
|
11289
11305
|
// never_add on a column that takes only its choices: said, never a silent nothing.
|
|
11290
|
-
/* @__PURE__ */
|
|
11306
|
+
/* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
11291
11307
|
/* @__PURE__ */ jsx42("p", { "data-records-typed-refusal": "", className: "p-2 text-xs text-muted-foreground", children: notAChoiceSentence(field2, [q]) }),
|
|
11292
11308
|
autoOpen ? /* @__PURE__ */ jsx42("span", { "data-records-choice-ask": "", className: "px-2 pb-1", children: /* @__PURE__ */ jsx42(Button17, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-2 text-xs", onClick: () => setOpen(false), children: "Cancel" }) }) : null
|
|
11293
11309
|
] })
|
|
@@ -11309,7 +11325,7 @@ function RecordChip({
|
|
|
11309
11325
|
// name. So it caps at its container and ends in an ellipsis with the whole name in
|
|
11310
11326
|
// its tooltip, rather than being cut mid-word by whatever box it landed in
|
|
11311
11327
|
// (lane FIX-14, 2026-09-22).
|
|
11312
|
-
/* @__PURE__ */
|
|
11328
|
+
/* @__PURE__ */ jsxs37(Badge7, { variant: "secondary", className: cn20("max-w-full gap-1 text-[11px]", className), title, children: [
|
|
11313
11329
|
/* @__PURE__ */ jsx42("span", { className: "min-w-0 truncate", children: title }),
|
|
11314
11330
|
onRemove ? /* @__PURE__ */ jsx42("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${title}`, className: "shrink-0 opacity-60 hover:opacity-100", children: "\xD7" }) : null
|
|
11315
11331
|
] })
|
|
@@ -11353,7 +11369,7 @@ function ChoiceAnswer({
|
|
|
11353
11369
|
const option = (choice) => {
|
|
11354
11370
|
const chosen = on(choice);
|
|
11355
11371
|
const letter = lettered ? CHOICE_LETTERS[choices.indexOf(choice)] : null;
|
|
11356
|
-
return /* @__PURE__ */
|
|
11372
|
+
return /* @__PURE__ */ jsxs37(
|
|
11357
11373
|
"button",
|
|
11358
11374
|
{
|
|
11359
11375
|
type: "button",
|
|
@@ -11418,7 +11434,7 @@ function ChoiceAnswer({
|
|
|
11418
11434
|
}
|
|
11419
11435
|
const q = search.trim().toLowerCase();
|
|
11420
11436
|
const shown2 = q === "" ? choices : choices.filter((c) => c.label.toLowerCase().includes(q));
|
|
11421
|
-
return /* @__PURE__ */
|
|
11437
|
+
return /* @__PURE__ */ jsxs37("div", { id, className: "flex w-full flex-col gap-2", onKeyDown, children: [
|
|
11422
11438
|
/* @__PURE__ */ jsx42(
|
|
11423
11439
|
BasicInput10,
|
|
11424
11440
|
{
|
|
@@ -11430,7 +11446,7 @@ function ChoiceAnswer({
|
|
|
11430
11446
|
className: "h-11 text-base sm:h-9 sm:text-sm"
|
|
11431
11447
|
}
|
|
11432
11448
|
),
|
|
11433
|
-
/* @__PURE__ */
|
|
11449
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex max-h-80 w-full flex-col gap-2 overflow-y-auto", role: group.role, "aria-label": group["aria-label"], children: [
|
|
11434
11450
|
shown2.map(option),
|
|
11435
11451
|
shown2.length === 0 ? /* @__PURE__ */ jsx42("p", { className: "text-xs text-muted-foreground", children: "No match" }) : null
|
|
11436
11452
|
] })
|
|
@@ -11438,7 +11454,7 @@ function ChoiceAnswer({
|
|
|
11438
11454
|
}
|
|
11439
11455
|
|
|
11440
11456
|
// src/ChoiceListEditor.tsx
|
|
11441
|
-
import { Fragment as Fragment16, jsx as jsx43, jsxs as
|
|
11457
|
+
import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11442
11458
|
var rowSeed = 0;
|
|
11443
11459
|
var nextRow = () => `new-${rowSeed += 1}`;
|
|
11444
11460
|
function choiceRowsFrom(options, field2) {
|
|
@@ -11485,7 +11501,7 @@ function ChoiceListEditor({
|
|
|
11485
11501
|
const [usage, setUsage] = useState33(null);
|
|
11486
11502
|
const [asking, setAsking] = useState33(null);
|
|
11487
11503
|
const [moveTo, setMoveTo] = useState33("");
|
|
11488
|
-
const focusRow =
|
|
11504
|
+
const focusRow = useRef18(null);
|
|
11489
11505
|
const [removed, setRemoved] = useState33({});
|
|
11490
11506
|
const fieldId = field2?.id ?? null;
|
|
11491
11507
|
useEffect23(() => {
|
|
@@ -11519,7 +11535,7 @@ function ChoiceListEditor({
|
|
|
11519
11535
|
};
|
|
11520
11536
|
}, [client, fieldId, onRehome]);
|
|
11521
11537
|
if (refused) {
|
|
11522
|
-
return /* @__PURE__ */
|
|
11538
|
+
return /* @__PURE__ */ jsxs38("p", { className: "text-[11px] text-muted-foreground", "data-records-choice-list": "", children: [
|
|
11523
11539
|
"The choices could not be read, so they are left as they are: ",
|
|
11524
11540
|
refused
|
|
11525
11541
|
] });
|
|
@@ -11582,10 +11598,10 @@ function ChoiceListEditor({
|
|
|
11582
11598
|
};
|
|
11583
11599
|
const targets = rows.filter((r) => r.id && r.id !== asking?.id && r.words.trim() !== "");
|
|
11584
11600
|
const wordsOf = (id) => rows.find((r) => r.id === id)?.words.trim() ?? usage?.[id]?.words ?? "";
|
|
11585
|
-
return /* @__PURE__ */
|
|
11601
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex flex-col gap-1", "data-records-choice-list": "", children: [
|
|
11586
11602
|
/* @__PURE__ */ jsx43(Label11, { className: "text-xs", children: "The choices" }),
|
|
11587
11603
|
rows.length === 0 ? /* @__PURE__ */ jsx43("p", { className: "text-xs text-muted-foreground", "data-records-choice-list-empty": "", children: "No choices yet." }) : null,
|
|
11588
|
-
/* @__PURE__ */ jsx43("ul", { className: "flex flex-col gap-1", children: rows.map((r, i) => /* @__PURE__ */
|
|
11604
|
+
/* @__PURE__ */ jsx43("ul", { className: "flex flex-col gap-1", children: rows.map((r, i) => /* @__PURE__ */ jsxs38("li", { className: "flex items-center gap-1", "data-records-choice-row": "", children: [
|
|
11589
11605
|
/* @__PURE__ */ jsx43(ChoiceSwatch, { words: r.words.trim() === "" ? `choice ${i + 1}` : r.words.trim(), color: r.color ?? null, onColor: (c) => paint(i, c) }),
|
|
11590
11606
|
/* @__PURE__ */ jsx43(
|
|
11591
11607
|
BasicInput11,
|
|
@@ -11609,7 +11625,7 @@ function ChoiceListEditor({
|
|
|
11609
11625
|
] }, r.row)) }),
|
|
11610
11626
|
asking ? (
|
|
11611
11627
|
// THE QUESTION, Notion-style: where do the records that hold it go?
|
|
11612
|
-
/* @__PURE__ */
|
|
11628
|
+
/* @__PURE__ */ jsxs38(
|
|
11613
11629
|
"div",
|
|
11614
11630
|
{
|
|
11615
11631
|
role: "group",
|
|
@@ -11618,10 +11634,10 @@ function ChoiceListEditor({
|
|
|
11618
11634
|
className: "flex flex-col gap-1 rounded border bg-muted/40 p-2",
|
|
11619
11635
|
children: [
|
|
11620
11636
|
/* @__PURE__ */ jsx43("p", { className: "text-xs", children: recordsUseSentence(heldBy(asking), asking.words.trim()) }),
|
|
11621
|
-
/* @__PURE__ */
|
|
11622
|
-
targets.length > 0 ? /* @__PURE__ */
|
|
11637
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
11638
|
+
targets.length > 0 ? /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
11623
11639
|
/* @__PURE__ */ jsx43(Button18, { type: "button", size: "sm", className: "h-7 px-2 text-xs", disabled: moveTo === "", onClick: () => answer({ then: "move", to: moveTo }), children: "Move them to" }),
|
|
11624
|
-
/* @__PURE__ */
|
|
11640
|
+
/* @__PURE__ */ jsxs38(Select7, { value: moveTo, onValueChange: setMoveTo, children: [
|
|
11625
11641
|
/* @__PURE__ */ jsx43(SelectTrigger7, { size: "sm", className: "h-7 w-36 text-xs", "aria-label": "Another choice", children: /* @__PURE__ */ jsx43(SelectValue7, { placeholder: "Another choice" }) }),
|
|
11626
11642
|
/* @__PURE__ */ jsx43(SelectContent7, { children: targets.map((r) => /* @__PURE__ */ jsx43(SelectItem7, { value: r.id, children: r.words.trim() }, r.id)) })
|
|
11627
11643
|
] })
|
|
@@ -11635,7 +11651,7 @@ function ChoiceListEditor({
|
|
|
11635
11651
|
)
|
|
11636
11652
|
) : null,
|
|
11637
11653
|
Object.entries(rehome).map(
|
|
11638
|
-
([id, spec]) => removed[id] ? /* @__PURE__ */
|
|
11654
|
+
([id, spec]) => removed[id] ? /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between gap-2 text-[11px] text-muted-foreground", "data-records-choice-rehome": "", children: [
|
|
11639
11655
|
/* @__PURE__ */ jsx43("span", { children: rehomeSentence(usage?.[id]?.records ?? 0, removed[id].row.words.trim(), spec, spec.then === "move" ? wordsOf(spec.to) : void 0) }),
|
|
11640
11656
|
/* @__PURE__ */ jsx43(Button18, { type: "button", size: "sm", variant: "ghost", className: "h-6 px-1.5 text-[11px]", onClick: () => putBack(id), children: "Put it back" })
|
|
11641
11657
|
] }, id) : null
|
|
@@ -11650,7 +11666,7 @@ function ChoiceSwatch({ words, color, onColor }) {
|
|
|
11650
11666
|
onColor(next);
|
|
11651
11667
|
setOpen(false);
|
|
11652
11668
|
};
|
|
11653
|
-
return /* @__PURE__ */
|
|
11669
|
+
return /* @__PURE__ */ jsxs38(Popover7, { open, onOpenChange: setOpen, children: [
|
|
11654
11670
|
/* @__PURE__ */ jsx43(PopoverTrigger7, { asChild: true, children: /* @__PURE__ */ jsx43(
|
|
11655
11671
|
"button",
|
|
11656
11672
|
{
|
|
@@ -11664,7 +11680,7 @@ function ChoiceSwatch({ words, color, onColor }) {
|
|
|
11664
11680
|
)
|
|
11665
11681
|
}
|
|
11666
11682
|
) }),
|
|
11667
|
-
/* @__PURE__ */ jsx43(PopoverContent7, { sizing: "content", align: "start", className: "p-2", children: /* @__PURE__ */
|
|
11683
|
+
/* @__PURE__ */ jsx43(PopoverContent7, { sizing: "content", align: "start", className: "p-2", children: /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-1", role: "radiogroup", "aria-label": `Color for ${words}`, children: [
|
|
11668
11684
|
/* @__PURE__ */ jsx43(
|
|
11669
11685
|
"button",
|
|
11670
11686
|
{
|
|
@@ -11757,7 +11773,7 @@ async function hasSession(getSession) {
|
|
|
11757
11773
|
}
|
|
11758
11774
|
|
|
11759
11775
|
// src/RecordsMount.tsx
|
|
11760
|
-
import { useRef as
|
|
11776
|
+
import { useRef as useRef19 } from "react";
|
|
11761
11777
|
import { RecordsProvider } from "@ai-matrx/records/react";
|
|
11762
11778
|
|
|
11763
11779
|
// src/PersonNamesBridge.tsx
|
|
@@ -11785,7 +11801,7 @@ function PersonNamesBridge() {
|
|
|
11785
11801
|
}
|
|
11786
11802
|
|
|
11787
11803
|
// src/RecordsMount.tsx
|
|
11788
|
-
import { jsx as jsx44, jsxs as
|
|
11804
|
+
import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11789
11805
|
var STORE_DECIDES_REASON = "This host offers exactly what this person may do, so a control they cannot use is never drawn in the first place.";
|
|
11790
11806
|
function storeDecidesRights(_table) {
|
|
11791
11807
|
return NO_RIGHTS;
|
|
@@ -11798,13 +11814,13 @@ function RecordsMount({
|
|
|
11798
11814
|
}) {
|
|
11799
11815
|
const bound2 = useShallowStableHost(host);
|
|
11800
11816
|
void letTheStoreDecideRights;
|
|
11801
|
-
return /* @__PURE__ */ jsx44(RecordsProvider, { config, children: /* @__PURE__ */ jsx44(RecordsUiProvider, { value: bound2, children: /* @__PURE__ */
|
|
11817
|
+
return /* @__PURE__ */ jsx44(RecordsProvider, { config, children: /* @__PURE__ */ jsx44(RecordsUiProvider, { value: bound2, children: /* @__PURE__ */ jsxs39(RecordLabelProvider, { children: [
|
|
11802
11818
|
/* @__PURE__ */ jsx44(PersonNamesBridge, {}),
|
|
11803
11819
|
children
|
|
11804
11820
|
] }) }) });
|
|
11805
11821
|
}
|
|
11806
11822
|
function useShallowStableHost(host) {
|
|
11807
|
-
const held =
|
|
11823
|
+
const held = useRef19(null);
|
|
11808
11824
|
const next = host ?? {};
|
|
11809
11825
|
const previous = held.current;
|
|
11810
11826
|
if (previous !== null && sameParts(previous, next)) return previous;
|
|
@@ -11821,11 +11837,11 @@ function sameParts(a, b) {
|
|
|
11821
11837
|
}
|
|
11822
11838
|
|
|
11823
11839
|
// src/TablePickers.tsx
|
|
11824
|
-
import { useEffect as useEffect25, useMemo as
|
|
11840
|
+
import { useEffect as useEffect25, useMemo as useMemo12, useState as useState34 } from "react";
|
|
11825
11841
|
import { RecordsProvider as RecordsProvider2, useFields as useFields5, useRecords as useRecords3, useTable as useTable4 } from "@ai-matrx/records/react";
|
|
11826
11842
|
import { Button as Button19, CreatablePicker } from "@ai-matrx/design-system";
|
|
11827
11843
|
import { momentZoneOptions as momentZoneOptions2 } from "@ai-matrx/design-system/field-formats";
|
|
11828
|
-
import { Fragment as Fragment17, jsx as jsx45, jsxs as
|
|
11844
|
+
import { Fragment as Fragment17, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
11829
11845
|
var SHARED_FOR_MS = 5e3;
|
|
11830
11846
|
var sharedReads = /* @__PURE__ */ new WeakMap();
|
|
11831
11847
|
function readTablesAnywhere(dataSource) {
|
|
@@ -11895,7 +11911,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
|
|
|
11895
11911
|
hint: t.organization_name,
|
|
11896
11912
|
keywords: t.organization_name,
|
|
11897
11913
|
...twin && second ? {
|
|
11898
|
-
render: /* @__PURE__ */
|
|
11914
|
+
render: /* @__PURE__ */ jsxs40("span", { className: "flex min-w-0 flex-col", children: [
|
|
11899
11915
|
/* @__PURE__ */ jsx45("span", { className: "truncate", children: t.table_name }),
|
|
11900
11916
|
/* @__PURE__ */ jsx45("span", { className: "truncate text-[11px] text-muted-foreground", children: second })
|
|
11901
11917
|
] })
|
|
@@ -11903,7 +11919,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
|
|
|
11903
11919
|
};
|
|
11904
11920
|
});
|
|
11905
11921
|
const missing = Boolean(value) && !list.loading && !list.error && !list.rows.some((t) => t.table_id === value);
|
|
11906
|
-
return /* @__PURE__ */
|
|
11922
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex flex-col gap-1", children: [
|
|
11907
11923
|
/* @__PURE__ */ jsx45(
|
|
11908
11924
|
CreatablePicker,
|
|
11909
11925
|
{
|
|
@@ -11932,8 +11948,8 @@ function TableScope({ dataSource, userId, tableId, children, fallback = null, un
|
|
|
11932
11948
|
}
|
|
11933
11949
|
function ColumnValuesEditor({ tableId, value, onChange, disabled, addLabel }) {
|
|
11934
11950
|
const fields = useFields5(tableId);
|
|
11935
|
-
const all =
|
|
11936
|
-
const byKey =
|
|
11951
|
+
const all = useMemo12(() => fields.data ?? [], [fields.data]);
|
|
11952
|
+
const byKey = useMemo12(() => new Map(all.map((f) => [f.key, f])), [all]);
|
|
11937
11953
|
const keys = Object.keys(value);
|
|
11938
11954
|
const [adding, setAdding] = useState34(false);
|
|
11939
11955
|
const optionsFor = (current) => all.filter((f) => f.key === current || !(f.key in value)).map((f) => ({ value: f.key, label: fieldName(f) }));
|
|
@@ -11948,7 +11964,7 @@ function ColumnValuesEditor({ tableId, value, onChange, disabled, addLabel }) {
|
|
|
11948
11964
|
void _gone;
|
|
11949
11965
|
onChange(rest);
|
|
11950
11966
|
};
|
|
11951
|
-
return /* @__PURE__ */
|
|
11967
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex flex-col gap-2", children: [
|
|
11952
11968
|
fields.error && /* @__PURE__ */ jsx45(RefusalLine, { error: fields.error }),
|
|
11953
11969
|
keys.map((key) => {
|
|
11954
11970
|
const field2 = byKey.get(key);
|
|
@@ -12001,8 +12017,8 @@ function ColumnValueRow({
|
|
|
12001
12017
|
}) {
|
|
12002
12018
|
const orphan = columnKey !== null && !loading && field2 === void 0;
|
|
12003
12019
|
const shown2 = orphan ? [{ value: columnKey, label: columnKey, hint: "Not a column" }, ...options] : options;
|
|
12004
|
-
return /* @__PURE__ */
|
|
12005
|
-
/* @__PURE__ */
|
|
12020
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex flex-col gap-1 rounded-md border border-border/60 p-2", children: [
|
|
12021
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
|
|
12006
12022
|
/* @__PURE__ */ jsx45("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx45(
|
|
12007
12023
|
CreatablePicker,
|
|
12008
12024
|
{
|
|
@@ -12031,7 +12047,7 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
|
|
|
12031
12047
|
label: rowNameIn(table.data ?? null, row)
|
|
12032
12048
|
}));
|
|
12033
12049
|
const missing = Boolean(value) && !records.loading && !records.error && !rows.some((r) => r.id === value);
|
|
12034
|
-
return /* @__PURE__ */
|
|
12050
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex flex-col gap-1", children: [
|
|
12035
12051
|
/* @__PURE__ */ jsx45(
|
|
12036
12052
|
CreatablePicker,
|
|
12037
12053
|
{
|
|
@@ -12051,11 +12067,11 @@ function RecordPicker({ tableId, value, onChange, disabled }) {
|
|
|
12051
12067
|
}
|
|
12052
12068
|
|
|
12053
12069
|
// src/DataBindingPicker.tsx
|
|
12054
|
-
import { useEffect as useEffect26, useMemo as
|
|
12070
|
+
import { useEffect as useEffect26, useMemo as useMemo13 } from "react";
|
|
12055
12071
|
import { isEntityReferenceConfig } from "@ai-matrx/records";
|
|
12056
12072
|
import { useFields as useFields6, useTable as useTable5 } from "@ai-matrx/records/react";
|
|
12057
12073
|
import { BasicInput as BasicInput12, Button as Button20, CreatablePicker as CreatablePicker2, cn as cn22 } from "@ai-matrx/design-system";
|
|
12058
|
-
import { jsx as jsx46, jsxs as
|
|
12074
|
+
import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
12059
12075
|
var DATA_BINDING_SHAPES = [
|
|
12060
12076
|
{ value: "collection", label: "The whole table" },
|
|
12061
12077
|
{ value: "reference", label: "One record" },
|
|
@@ -12122,7 +12138,7 @@ function DataBindingPicker({ dataSource, userId, binding, onChange, disabled, de
|
|
|
12122
12138
|
...binding.semantic_type === "collection" && defaultRowLimit ? { limit: defaultRowLimit } : {}
|
|
12123
12139
|
});
|
|
12124
12140
|
};
|
|
12125
|
-
return /* @__PURE__ */
|
|
12141
|
+
return /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-2", children: [
|
|
12126
12142
|
/* @__PURE__ */ jsx46(TablePicker, { dataSource, value: tableId, onChange: selectTable, disabled: Boolean(disabled), tables }),
|
|
12127
12143
|
/* @__PURE__ */ jsx46(TableScope, { dataSource, userId, tableId, tables, children: tableId && /* @__PURE__ */ jsx46(
|
|
12128
12144
|
BindingDetails,
|
|
@@ -12145,7 +12161,7 @@ function BindingDetails({
|
|
|
12145
12161
|
}) {
|
|
12146
12162
|
const table = useTable5(tableId);
|
|
12147
12163
|
const fields = useFields6(tableId);
|
|
12148
|
-
const fieldList =
|
|
12164
|
+
const fieldList = useMemo13(() => fields.data ?? [], [fields.data]);
|
|
12149
12165
|
const shape = binding.semantic_type;
|
|
12150
12166
|
useEffect26(() => {
|
|
12151
12167
|
if (disabled || shape === "value" || binding.transform || fields.loading || fieldList.length === 0) return;
|
|
@@ -12188,7 +12204,7 @@ function BindingDetails({
|
|
|
12188
12204
|
const fieldOptions = fieldList.map((f) => ({ value: f.key, label: fieldName(f) }));
|
|
12189
12205
|
const template = binding.transform?.template ?? "";
|
|
12190
12206
|
const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
|
|
12191
|
-
return /* @__PURE__ */
|
|
12207
|
+
return /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-2", children: [
|
|
12192
12208
|
/* @__PURE__ */ jsx46("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ jsx46(
|
|
12193
12209
|
Button20,
|
|
12194
12210
|
{
|
|
@@ -12226,7 +12242,7 @@ function BindingDetails({
|
|
|
12226
12242
|
ariaLabel: "Column"
|
|
12227
12243
|
}
|
|
12228
12244
|
),
|
|
12229
|
-
shape !== "value" && /* @__PURE__ */
|
|
12245
|
+
shape !== "value" && /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-1", children: [
|
|
12230
12246
|
/* @__PURE__ */ jsx46(
|
|
12231
12247
|
"textarea",
|
|
12232
12248
|
{
|
|
@@ -12252,7 +12268,7 @@ function BindingDetails({
|
|
|
12252
12268
|
p.token
|
|
12253
12269
|
)) })
|
|
12254
12270
|
] }),
|
|
12255
|
-
shape === "collection" && /* @__PURE__ */
|
|
12271
|
+
shape === "collection" && /* @__PURE__ */ jsxs41("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
12256
12272
|
"Up to",
|
|
12257
12273
|
/* @__PURE__ */ jsx46(
|
|
12258
12274
|
BasicInput12,
|
|
@@ -12271,7 +12287,7 @@ function BindingDetails({
|
|
|
12271
12287
|
),
|
|
12272
12288
|
"rows"
|
|
12273
12289
|
] }),
|
|
12274
|
-
/* @__PURE__ */
|
|
12290
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
|
|
12275
12291
|
/* @__PURE__ */ jsx46("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
|
|
12276
12292
|
DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ jsx46(
|
|
12277
12293
|
Button20,
|
|
@@ -12293,7 +12309,7 @@ function BindingDetails({
|
|
|
12293
12309
|
|
|
12294
12310
|
// src/PickedSummaries.tsx
|
|
12295
12311
|
import { useFields as useFields7, useRecord, useTable as useTable6 } from "@ai-matrx/records/react";
|
|
12296
|
-
import { Fragment as Fragment18, jsx as jsx47, jsxs as
|
|
12312
|
+
import { Fragment as Fragment18, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12297
12313
|
function TableNameText({ dataSource, tableId }) {
|
|
12298
12314
|
const tables = useTablesAnywhere(dataSource);
|
|
12299
12315
|
if (!tableId) return /* @__PURE__ */ jsx47(Fragment18, { children: "\u2014" });
|
|
@@ -12331,7 +12347,7 @@ function ColumnValuesWords({ tableId, value }) {
|
|
|
12331
12347
|
const field2 = (fields.data ?? []).find((f) => f.key === key);
|
|
12332
12348
|
if (parts.length) parts.push(/* @__PURE__ */ jsx47("span", { children: ", " }, `${key}-sep`));
|
|
12333
12349
|
parts.push(
|
|
12334
|
-
/* @__PURE__ */
|
|
12350
|
+
/* @__PURE__ */ jsxs42("span", { children: [
|
|
12335
12351
|
field2 ? fieldName(field2) : "A removed column",
|
|
12336
12352
|
" is ",
|
|
12337
12353
|
field2 ? renderValue(field2, stored, void 0, labels) : "\u2014"
|
|
@@ -12372,7 +12388,7 @@ function RecordNameWords({ tableId, recordId }) {
|
|
|
12372
12388
|
import { useEffect as useEffect27, useState as useState35 } from "react";
|
|
12373
12389
|
import { RecordsProvider as RecordsProvider3, useRecordsClient as useRecordsClient10 } from "@ai-matrx/records/react";
|
|
12374
12390
|
import { Button as Button21 } from "@ai-matrx/design-system";
|
|
12375
|
-
import { jsx as jsx48, jsxs as
|
|
12391
|
+
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12376
12392
|
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
|
|
12377
12393
|
return /* @__PURE__ */ jsx48(RecordsProvider3, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ jsx48(Decision, { approvalId, onDecided, approveLabel: approveLabel ?? "Approve" }) });
|
|
12378
12394
|
}
|
|
@@ -12408,8 +12424,8 @@ function Decision({
|
|
|
12408
12424
|
else setError(res.error);
|
|
12409
12425
|
};
|
|
12410
12426
|
if (may === null) return /* @__PURE__ */ jsx48("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
|
|
12411
|
-
return /* @__PURE__ */
|
|
12412
|
-
may ? /* @__PURE__ */
|
|
12427
|
+
return /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1.5", children: [
|
|
12428
|
+
may ? /* @__PURE__ */ jsxs43("div", { className: "flex gap-2", children: [
|
|
12413
12429
|
/* @__PURE__ */ jsx48(Button21, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
|
|
12414
12430
|
/* @__PURE__ */ jsx48(Button21, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
|
|
12415
12431
|
] }) : !error && /* @__PURE__ */ jsx48("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
|
|
@@ -12607,4 +12623,4 @@ export {
|
|
|
12607
12623
|
RecordNameText,
|
|
12608
12624
|
HeldChangeDecision
|
|
12609
12625
|
};
|
|
12610
|
-
//# sourceMappingURL=chunk-
|
|
12626
|
+
//# sourceMappingURL=chunk-P7GVWT6U.js.map
|