@ai-matrx/records-ui 0.116.61 → 0.116.62
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 +10 -1
- package/dist/{chunk-2YK72GHL.js → chunk-NTOTMYVO.js} +76 -41
- package/dist/chunk-NTOTMYVO.js.map +1 -0
- package/dist/index.cjs +41 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +40 -5
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-2YK72GHL.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -40,11 +40,20 @@
|
|
|
40
40
|
- Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
|
|
41
41
|
- **New subpath `@ai-matrx/records-ui/data-source`:** `recordsDataSource`, `personActor` and the who-changed words (`whenWords`, `actorWords`, `actorBadge`, `lastChangeSentence`, `SOMEBODY`, `THE_SYSTEM`) alone. `/helpers` also carries the field-type words, the colour resolver and the table builders, which read `@ai-matrx/records/core`; this entry reaches `@ai-matrx/kit` only, and shares the one data-source cache with `/helpers` and the root. Additive. Consumer action: a shell-reachable service that only binds its supabase client or says when imports from `/data-source`.
|
|
42
42
|
|
|
43
|
-
## 0.116.
|
|
43
|
+
## 0.116.62
|
|
44
44
|
|
|
45
45
|
UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
|
|
46
46
|
Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
|
|
47
47
|
|
|
48
|
+
## 0.116.61
|
|
49
|
+
|
|
50
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
51
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
52
|
+
Diff: `git diff bf61b7f493 2c86ae638c -- apps/shared/records-ui/src`
|
|
53
|
+
|
|
54
|
+
Changed shipped source files (1):
|
|
55
|
+
- `apps/shared/records-ui/src/Grid.tsx`
|
|
56
|
+
|
|
48
57
|
## 0.116.60
|
|
49
58
|
|
|
50
59
|
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
recordName,
|
|
42
42
|
recordNameIn,
|
|
43
43
|
recordVersions_exports,
|
|
44
|
+
refusalForAPerson,
|
|
44
45
|
refusalIsMissingInput,
|
|
45
46
|
refusalSentence,
|
|
46
47
|
refusals_exports,
|
|
@@ -2036,7 +2037,7 @@ function ReferenceBuilder({
|
|
|
2036
2037
|
}
|
|
2037
2038
|
|
|
2038
2039
|
// src/ChoiceListEditor.tsx
|
|
2039
|
-
import { useEffect as useEffect23, useRef as
|
|
2040
|
+
import { useEffect as useEffect23, useRef as useRef19, useState as useState33 } from "react";
|
|
2040
2041
|
import { optionLabel as optionLabel2, recordsUseSentence, rehomeSentence } from "@ai-matrx/records";
|
|
2041
2042
|
import { useRecordsClient as useRecordsClient9 } from "@ai-matrx/records/react";
|
|
2042
2043
|
import {
|
|
@@ -2094,7 +2095,7 @@ function AddChoicesInline({ field: field2, onAdded, disabled = false }) {
|
|
|
2094
2095
|
}
|
|
2095
2096
|
|
|
2096
2097
|
// src/editors.tsx
|
|
2097
|
-
import { useCallback as
|
|
2098
|
+
import { useCallback as useCallback7, useEffect as useEffect22, useLayoutEffect as useLayoutEffect3, useRef as useRef18, useState as useState32 } from "react";
|
|
2098
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";
|
|
2099
2100
|
import { useOptionalRecordsClient as useOptionalRecordsClient12 } from "@ai-matrx/records/react";
|
|
2100
2101
|
import {
|
|
@@ -2767,7 +2768,7 @@ function readableLink(raw) {
|
|
|
2767
2768
|
}
|
|
2768
2769
|
|
|
2769
2770
|
// src/buttonCell.tsx
|
|
2770
|
-
import { useContext as useContext3, useEffect as useEffect20, useRef as
|
|
2771
|
+
import { useContext as useContext3, useEffect as useEffect20, useRef as useRef15, useState as useState28 } from "react";
|
|
2771
2772
|
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";
|
|
2772
2773
|
import { CHOICE_CHIP_CLASS, NEUTRAL_CHIP_CLASS, isStyleColor } from "@ai-matrx/design-system/data-table";
|
|
2773
2774
|
import { buttonNeeds as buttonNeeds2, buttonOf as buttonOf2 } from "@ai-matrx/records";
|
|
@@ -2908,7 +2909,7 @@ function columnNameProblemLine(name, noun = "column") {
|
|
|
2908
2909
|
}
|
|
2909
2910
|
|
|
2910
2911
|
// src/FieldEditor.tsx
|
|
2911
|
-
import { useEffect as useEffect19, useMemo as useMemo10, useRef as
|
|
2912
|
+
import { useEffect as useEffect19, useMemo as useMemo10, useRef as useRef14, useState as useState27 } from "react";
|
|
2912
2913
|
import {
|
|
2913
2914
|
tableShapeChanged as tableShapeChanged3,
|
|
2914
2915
|
useEntityFieldMutation,
|
|
@@ -3264,7 +3265,7 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
|
|
|
3264
3265
|
}
|
|
3265
3266
|
|
|
3266
3267
|
// src/SourceArchivedNotice.tsx
|
|
3267
|
-
import { useCallback as
|
|
3268
|
+
import { useCallback as useCallback6, useEffect as useEffect13, useState as useState21 } from "react";
|
|
3268
3269
|
import { Button as Button11 } from "@ai-matrx/design-system";
|
|
3269
3270
|
import { tableShapeChanged, useRecordsClient as useRecordsClient5 } from "@ai-matrx/records/react";
|
|
3270
3271
|
|
|
@@ -3279,7 +3280,7 @@ import { formatFieldValue as formatFieldValue3 } from "@ai-matrx/design-system/f
|
|
|
3279
3280
|
import { Badge as Badge6, cn as cn15 } from "@ai-matrx/design-system";
|
|
3280
3281
|
|
|
3281
3282
|
// src/EntityReferenceControl.tsx
|
|
3282
|
-
import { useMemo as useMemo7, useState as useState13 } from "react";
|
|
3283
|
+
import { useCallback as useCallback4, useMemo as useMemo7, useRef as useRef8, useState as useState13 } from "react";
|
|
3283
3284
|
import { entityRefsOf, entityRefsToWrite } from "@ai-matrx/records";
|
|
3284
3285
|
import { useEntityReferenceKinds as useEntityReferenceKinds2, useEntityReferenceSearch, useEntityReferenceWords, useOptionalRecordsClient as useOptionalRecordsClient5 } from "@ai-matrx/records/react";
|
|
3285
3286
|
import { Badge as Badge2, Button as Button7, cn as cn9 } from "@ai-matrx/design-system";
|
|
@@ -3315,6 +3316,15 @@ function WithWords(props) {
|
|
|
3315
3316
|
{
|
|
3316
3317
|
field: props.field,
|
|
3317
3318
|
refs: withKnown,
|
|
3319
|
+
autoOpen: props.autoOpen,
|
|
3320
|
+
onClose: props.onClose,
|
|
3321
|
+
onCancel: props.onCancel,
|
|
3322
|
+
initialSearch: props.initialSearch,
|
|
3323
|
+
onTakeOff: (ref) => {
|
|
3324
|
+
const rest = withKnown.filter((x) => !(x.token === ref.token && x.id === ref.id));
|
|
3325
|
+
props.onChange(entityRefsToWrite(rest, Boolean(props.field.multi)));
|
|
3326
|
+
},
|
|
3327
|
+
labelOf: (r) => r.label ?? words?.data?.find((w) => w.token === r.token && w.id === r.id)?.label ?? WITHHELD_ENTITY_LABEL,
|
|
3318
3328
|
onPick: (picked) => {
|
|
3319
3329
|
setKnown((k) => [...k.filter((x) => !(x.token === picked.token && x.id === picked.id)), picked]);
|
|
3320
3330
|
const multi = Boolean(props.field.multi);
|
|
@@ -3323,18 +3333,32 @@ function WithWords(props) {
|
|
|
3323
3333
|
}
|
|
3324
3334
|
}
|
|
3325
3335
|
);
|
|
3336
|
+
if (props.autoOpen && !props.disabled) return /* @__PURE__ */ jsx17("div", { id: props.id, className: cn9("flex min-w-0 max-w-full flex-wrap items-center gap-1", props.className), children: picker });
|
|
3326
3337
|
return /* @__PURE__ */ jsx17(Chips, { ...props, value: withKnown, words, picker });
|
|
3327
3338
|
}
|
|
3328
3339
|
function EntityReferencePicker({
|
|
3329
3340
|
field: field2,
|
|
3330
3341
|
refs,
|
|
3331
|
-
onPick
|
|
3342
|
+
onPick,
|
|
3343
|
+
autoOpen,
|
|
3344
|
+
onClose,
|
|
3345
|
+
onCancel,
|
|
3346
|
+
initialSearch,
|
|
3347
|
+
onTakeOff,
|
|
3348
|
+
labelOf
|
|
3332
3349
|
}) {
|
|
3333
3350
|
const allowed = allowedKindsOf(field2);
|
|
3334
3351
|
const kinds = useEntityReferenceKinds2();
|
|
3335
3352
|
const labelOfKind = (token) => kinds.data?.find((k) => k.token === token)?.label ?? token.replace(/_/g, " ");
|
|
3336
|
-
const [open,
|
|
3337
|
-
const
|
|
3353
|
+
const [open, setOpenState] = useState13(autoOpen === true);
|
|
3354
|
+
const onCloseRef = useRef8(onClose);
|
|
3355
|
+
onCloseRef.current = onClose;
|
|
3356
|
+
const setOpen = useCallback4((next) => {
|
|
3357
|
+
setOpenState(next);
|
|
3358
|
+
if (!next) onCloseRef.current?.();
|
|
3359
|
+
}, []);
|
|
3360
|
+
const anchored = autoOpen === true;
|
|
3361
|
+
const [search, setSearch] = useState13(initialSearch ?? "");
|
|
3338
3362
|
const [only, setOnly] = useState13(null);
|
|
3339
3363
|
const tokens = only ? [only] : allowed;
|
|
3340
3364
|
const found = useEntityReferenceSearch(tokens, search, open);
|
|
@@ -3377,6 +3401,10 @@ function EntityReferencePicker({
|
|
|
3377
3401
|
return /* @__PURE__ */ jsx17(
|
|
3378
3402
|
PickOrAdd,
|
|
3379
3403
|
{
|
|
3404
|
+
anchored,
|
|
3405
|
+
...anchored && onCancel ? { onEscape: onCancel } : {},
|
|
3406
|
+
multi,
|
|
3407
|
+
...anchored ? { chips: refs.map((r) => ({ id: `${r.token}:${r.id}`, label: labelOf(r), onRemove: () => onTakeOff(r) })) } : {},
|
|
3380
3408
|
triggerLabel: `Pick for ${field2.label}`,
|
|
3381
3409
|
triggerText: refs.length > 0 && !multi ? "Change" : "Pick",
|
|
3382
3410
|
open,
|
|
@@ -3547,14 +3575,14 @@ function WholeValueEditor({
|
|
|
3547
3575
|
import { formatPhone as formatPhone2 } from "@ai-matrx/design-system/field-formats";
|
|
3548
3576
|
|
|
3549
3577
|
// src/formattedValue.tsx
|
|
3550
|
-
import { useRef as
|
|
3578
|
+
import { useRef as useRef10 } from "react";
|
|
3551
3579
|
import { FormattedCell } from "@ai-matrx/design-system/data-table";
|
|
3552
3580
|
import { formatFieldValue as formatFieldValue2, formatPhone, getFieldFormat } from "@ai-matrx/design-system/field-formats";
|
|
3553
3581
|
import { cn as cn10 } from "@ai-matrx/design-system";
|
|
3554
3582
|
import { OutboundLink as OutboundLink3 } from "@ai-matrx/kit/outbound-react";
|
|
3555
3583
|
|
|
3556
3584
|
// src/LinkPreviewCard.tsx
|
|
3557
|
-
import { useEffect as useEffect10, useRef as
|
|
3585
|
+
import { useEffect as useEffect10, useRef as useRef9, useState as useState15 } from "react";
|
|
3558
3586
|
import { HoverCard, HoverCardContent, HoverCardTrigger, SiteIcon } from "@ai-matrx/design-system";
|
|
3559
3587
|
import { Fragment as Fragment9, jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3560
3588
|
var answers = /* @__PURE__ */ new Map();
|
|
@@ -3562,7 +3590,7 @@ function LinkPreviewCard({ url, children }) {
|
|
|
3562
3590
|
const port = useRecordsUi().linkPreview;
|
|
3563
3591
|
const [preview, setPreview] = useState15(void 0);
|
|
3564
3592
|
const [open, setOpen] = useState15(false);
|
|
3565
|
-
const timer =
|
|
3593
|
+
const timer = useRef9(null);
|
|
3566
3594
|
useEffect10(() => () => void (timer.current && clearTimeout(timer.current)), []);
|
|
3567
3595
|
if (!port) return /* @__PURE__ */ jsx19(Fragment9, { children });
|
|
3568
3596
|
const ask = () => {
|
|
@@ -3620,7 +3648,7 @@ function RatingStars({
|
|
|
3620
3648
|
label,
|
|
3621
3649
|
selectFirst
|
|
3622
3650
|
}) {
|
|
3623
|
-
const armed =
|
|
3651
|
+
const armed = useRef10(true);
|
|
3624
3652
|
const score = numberOf3(value) ?? 0;
|
|
3625
3653
|
const shown2 = Math.round(score);
|
|
3626
3654
|
const said2 = `${shown2} out of ${max}`;
|
|
@@ -3755,7 +3783,7 @@ function linkChipText(raw) {
|
|
|
3755
3783
|
}
|
|
3756
3784
|
|
|
3757
3785
|
// src/gridAttachments.tsx
|
|
3758
|
-
import { useEffect as useEffect11, useRef as
|
|
3786
|
+
import { useEffect as useEffect11, useRef as useRef11, useState as useState16 } from "react";
|
|
3759
3787
|
import { useOptionalRecordsClient as useOptionalRecordsClient6 } from "@ai-matrx/records/react";
|
|
3760
3788
|
import { Badge as Badge3, Button as Button8, cn as cn11, Dialog, DialogContent, DialogHeader, DialogTitle } from "@ai-matrx/design-system";
|
|
3761
3789
|
import { OutboundLink as OutboundLink4 } from "@ai-matrx/kit/outbound-react";
|
|
@@ -4006,7 +4034,7 @@ function AttachmentControl({
|
|
|
4006
4034
|
const host = useRecordsUi();
|
|
4007
4035
|
const [busy, setBusy] = useState16(false);
|
|
4008
4036
|
const [why, setWhy] = useState16(null);
|
|
4009
|
-
const latest =
|
|
4037
|
+
const latest = useRef11(value);
|
|
4010
4038
|
latest.current = value;
|
|
4011
4039
|
const multiple = Boolean(field2.multi);
|
|
4012
4040
|
const pick = async () => {
|
|
@@ -4027,7 +4055,7 @@ function AttachmentControl({
|
|
|
4027
4055
|
setBusy(false);
|
|
4028
4056
|
onClose?.();
|
|
4029
4057
|
};
|
|
4030
|
-
const opened =
|
|
4058
|
+
const opened = useRef11(false);
|
|
4031
4059
|
useEffect11(() => {
|
|
4032
4060
|
if (!autoOpen || opened.current || !host.pickFiles) return;
|
|
4033
4061
|
opened.current = true;
|
|
@@ -4176,7 +4204,7 @@ function KindValueCell({
|
|
|
4176
4204
|
}
|
|
4177
4205
|
|
|
4178
4206
|
// src/ClampedChips.tsx
|
|
4179
|
-
import { useCallback as
|
|
4207
|
+
import { useCallback as useCallback5, useLayoutEffect, useRef as useRef12, useState as useState17 } from "react";
|
|
4180
4208
|
import { Popover as Popover2, PopoverContent as PopoverContent2, PopoverTrigger as PopoverTrigger2, cn as cn13 } from "@ai-matrx/design-system";
|
|
4181
4209
|
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4182
4210
|
var GAP = 4;
|
|
@@ -4188,12 +4216,12 @@ function ClampedChips({
|
|
|
4188
4216
|
className,
|
|
4189
4217
|
dataAttr
|
|
4190
4218
|
}) {
|
|
4191
|
-
const box =
|
|
4219
|
+
const box = useRef12(null);
|
|
4192
4220
|
const [fit, setFit] = useState17(null);
|
|
4193
4221
|
const [measuring, setMeasuring] = useState17(true);
|
|
4194
4222
|
const count = items.length;
|
|
4195
4223
|
const stands = Math.max(total ?? count, count);
|
|
4196
|
-
const measure =
|
|
4224
|
+
const measure = useCallback5(() => {
|
|
4197
4225
|
const el = box.current;
|
|
4198
4226
|
if (!el) return;
|
|
4199
4227
|
const lines = el.closest("[data-matrx-cell-lines]")?.getAttribute("data-matrx-cell-lines");
|
|
@@ -5439,7 +5467,7 @@ function SourceArchivedNotice({ fieldId, tableId }) {
|
|
|
5439
5467
|
const [state, setState] = useState21(null);
|
|
5440
5468
|
const [busy, setBusy] = useState21(false);
|
|
5441
5469
|
const [refused, setRefused] = useState21(null);
|
|
5442
|
-
const read =
|
|
5470
|
+
const read = useCallback6(async () => {
|
|
5443
5471
|
const answer = await client.fieldSourceArchived({ field_id: fieldId });
|
|
5444
5472
|
if (answer.ok) setState(answer.data);
|
|
5445
5473
|
else setRefused(answer.error);
|
|
@@ -6458,7 +6486,7 @@ function FieldRetype({ field: field2, tableId, onRetyped }) {
|
|
|
6458
6486
|
}
|
|
6459
6487
|
|
|
6460
6488
|
// src/FieldRulePreview.tsx
|
|
6461
|
-
import { useEffect as useEffect16, useMemo as useMemo9, useRef as
|
|
6489
|
+
import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef13, useState as useState24 } from "react";
|
|
6462
6490
|
import { previewRuleChange } from "@ai-matrx/records";
|
|
6463
6491
|
import { useRecordsClient as useRecordsClient7 } from "@ai-matrx/records/react";
|
|
6464
6492
|
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
@@ -6482,7 +6510,7 @@ function FieldRulePreview({ field: field2, tableId, rules }) {
|
|
|
6482
6510
|
const [preview, setPreview] = useState24(null);
|
|
6483
6511
|
const [refusal, setRefusal] = useState24(null);
|
|
6484
6512
|
const key = useMemo9(() => ruleWords(rules), [rules]);
|
|
6485
|
-
const latest =
|
|
6513
|
+
const latest = useRef13(rules);
|
|
6486
6514
|
latest.current = rules;
|
|
6487
6515
|
const name = fieldName(field2);
|
|
6488
6516
|
useEffect16(() => {
|
|
@@ -6493,7 +6521,14 @@ function FieldRulePreview({ field: field2, tableId, rules }) {
|
|
|
6493
6521
|
void client.recordAggregate({ table_id: tableId, groupBy: [field2.key], measures: [{ op: "count" }], limit: PREVIEW_GROUPS }).then((answer) => {
|
|
6494
6522
|
if (cancelled) return;
|
|
6495
6523
|
if (!answer.ok) {
|
|
6496
|
-
setRefusal(
|
|
6524
|
+
setRefusal(
|
|
6525
|
+
answer.error.code === "unreachable" ? (0, refusals_exports.refusal)(
|
|
6526
|
+
"unreachable",
|
|
6527
|
+
`${name}'s values could not be counted.`,
|
|
6528
|
+
"The check still applies when you save.",
|
|
6529
|
+
refusalForAPerson(answer.error).forEngineers
|
|
6530
|
+
) : answer.error
|
|
6531
|
+
);
|
|
6497
6532
|
return;
|
|
6498
6533
|
}
|
|
6499
6534
|
const numbers = holdsNumbers(field2);
|
|
@@ -8517,7 +8552,7 @@ function FieldEditor(props) {
|
|
|
8517
8552
|
const [allowedTypes, setAllowedTypes] = useState27(() => entityReferenceKindsOf(start));
|
|
8518
8553
|
const startingFormulaText = start ? formulaTextNow(String(start.config?.["formula_text"] ?? ""), start.config?.["expr"] ?? start.expr, fields.data) : "";
|
|
8519
8554
|
const [formulaText, setFormulaText] = useState27(startingFormulaText);
|
|
8520
|
-
const shownFormula =
|
|
8555
|
+
const shownFormula = useRef14(startingFormulaText);
|
|
8521
8556
|
useEffect19(() => {
|
|
8522
8557
|
if (shownFormula.current === startingFormulaText) return;
|
|
8523
8558
|
setFormulaText((typed) => typed === shownFormula.current ? startingFormulaText : typed);
|
|
@@ -8532,7 +8567,7 @@ function FieldEditor(props) {
|
|
|
8532
8567
|
const [notLanded, setNotLanded] = useState27(false);
|
|
8533
8568
|
const liveField = field2 ? fields.data?.find((f) => f.id === field2.id) ?? field2 : void 0;
|
|
8534
8569
|
const heldAs = liveField ? JSON.stringify([liveField.type, liveField.config?.["kind"] ?? null, liveField.format ?? null, liveField.multi ?? false, liveField.unit ?? null]) : "";
|
|
8535
|
-
const seededAs =
|
|
8570
|
+
const seededAs = useRef14(heldAs);
|
|
8536
8571
|
useEffect19(() => {
|
|
8537
8572
|
if (!liveField || seededAs.current === heldAs) return;
|
|
8538
8573
|
seededAs.current = heldAs;
|
|
@@ -9552,7 +9587,7 @@ function RollupFilterQuestion({
|
|
|
9552
9587
|
() => (farFields.data ?? []).filter((f) => f.type !== "formula").map((f) => ({ id: f.id, key: f.key, label: fieldName(f), field: f })),
|
|
9553
9588
|
[farFields.data]
|
|
9554
9589
|
);
|
|
9555
|
-
const lastFar =
|
|
9590
|
+
const lastFar = useRef14(far);
|
|
9556
9591
|
useEffect19(() => {
|
|
9557
9592
|
if (lastFar.current !== null && far !== lastFar.current && !editing) onChange(null);
|
|
9558
9593
|
lastFar.current = far;
|
|
@@ -9720,7 +9755,7 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
9720
9755
|
const here = useContext3(OpenRecordHereContext);
|
|
9721
9756
|
const host = useRecordsUi();
|
|
9722
9757
|
const addsTo = useTable3(b?.do === "add_row" ? b.table_id ?? field2.entity_definition_id : null);
|
|
9723
|
-
const waitingOn =
|
|
9758
|
+
const waitingOn = useRef15(0);
|
|
9724
9759
|
useEffect20(() => () => void (waitingOn.current += 1), []);
|
|
9725
9760
|
if (!b) return null;
|
|
9726
9761
|
const color = isStyleColor(b.color) ? CHOICE_CHIP_CLASS[b.color] : NEUTRAL_CHIP_CLASS;
|
|
@@ -9902,7 +9937,7 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
|
|
|
9902
9937
|
}
|
|
9903
9938
|
|
|
9904
9939
|
// src/FloatingRefusal.tsx
|
|
9905
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
9940
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef16, useState as useState29 } from "react";
|
|
9906
9941
|
import { createPortal } from "react-dom";
|
|
9907
9942
|
import { Fragment as Fragment14, jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9908
9943
|
var GAP2 = 4;
|
|
@@ -9920,8 +9955,8 @@ function placeFor(anchor, note) {
|
|
|
9920
9955
|
return { position: "fixed", top: a.top + (a.height - height) / 2, left: Math.max(a.left, a.right - width - 8) };
|
|
9921
9956
|
}
|
|
9922
9957
|
function FloatingRefusal({ text, why }) {
|
|
9923
|
-
const spot =
|
|
9924
|
-
const note =
|
|
9958
|
+
const spot = useRef16(null);
|
|
9959
|
+
const note = useRef16(null);
|
|
9925
9960
|
const [style, setStyle] = useState29(null);
|
|
9926
9961
|
const [floating, setFloating] = useState29(false);
|
|
9927
9962
|
useLayoutEffect2(() => {
|
|
@@ -9966,7 +10001,7 @@ function FloatingRefusal({ text, why }) {
|
|
|
9966
10001
|
}
|
|
9967
10002
|
|
|
9968
10003
|
// src/formatControls.tsx
|
|
9969
|
-
import { useEffect as useEffect21, useRef as
|
|
10004
|
+
import { useEffect as useEffect21, useRef as useRef17, useState as useState30 } from "react";
|
|
9970
10005
|
import { BasicInput as BasicInput9, BasicTextarea as BasicTextarea4 } from "@ai-matrx/design-system";
|
|
9971
10006
|
import { getFieldFormat as getFieldFormat3, parseFieldInput } from "@ai-matrx/design-system/field-formats";
|
|
9972
10007
|
import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
@@ -9987,7 +10022,7 @@ function keptValue(format, raw) {
|
|
|
9987
10022
|
}
|
|
9988
10023
|
function NumberInFormat({ format, value, onChange, disabled, id }) {
|
|
9989
10024
|
const [text, setText] = useState30(() => typedText(format, value));
|
|
9990
|
-
const lastSent =
|
|
10025
|
+
const lastSent = useRef17(void 0);
|
|
9991
10026
|
useEffect21(() => {
|
|
9992
10027
|
if (value === lastSent.current) return;
|
|
9993
10028
|
setText(typedText(format, value));
|
|
@@ -10401,7 +10436,7 @@ function draftFromTyping(field2, seed) {
|
|
|
10401
10436
|
return { typedDraft: true, text: seed, judged: judgeTyped(field2, seed) };
|
|
10402
10437
|
}
|
|
10403
10438
|
function ReadsAsNote({ typed, always, children }) {
|
|
10404
|
-
const note =
|
|
10439
|
+
const note = useRef18(null);
|
|
10405
10440
|
const [repeats, setRepeats] = useState32(false);
|
|
10406
10441
|
useLayoutEffect3(() => {
|
|
10407
10442
|
if (always) return;
|
|
@@ -10593,7 +10628,7 @@ function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
10593
10628
|
case "member":
|
|
10594
10629
|
return /* @__PURE__ */ jsx42(PersonPicker, { field: field2, value, onChange, disabled, id: inputId, autoOpen, onClose, onCancel, initialSearch });
|
|
10595
10630
|
case "entity_reference":
|
|
10596
|
-
return /* @__PURE__ */ jsx42(EntityReferenceControl, { field: field2, value, onChange, disabled, id: inputId });
|
|
10631
|
+
return /* @__PURE__ */ jsx42(EntityReferenceControl, { field: field2, value, onChange, disabled, id: inputId, autoOpen, onClose, onCancel, initialSearch });
|
|
10597
10632
|
case "attachment":
|
|
10598
10633
|
if (hostTakesFiles(host)) {
|
|
10599
10634
|
return /* @__PURE__ */ jsx42(AttachmentControl, { field: field2, value, onChange, disabled, id: inputId, autoOpen, onClose });
|
|
@@ -10629,7 +10664,7 @@ function TypedWordsControl({ field: field2, value, onChange, disabled, id }) {
|
|
|
10629
10664
|
const [text, setText] = useState32(() => openingText(field2, value));
|
|
10630
10665
|
const [refusal, setRefusal] = useState32(null);
|
|
10631
10666
|
const [why, setWhy] = useState32(void 0);
|
|
10632
|
-
const sent =
|
|
10667
|
+
const sent = useRef18(value);
|
|
10633
10668
|
useEffect22(() => {
|
|
10634
10669
|
if (value === sent.current) return;
|
|
10635
10670
|
sent.current = value;
|
|
@@ -10974,9 +11009,9 @@ function OpenChoicePicker({
|
|
|
10974
11009
|
const client = useOptionalRecordsClient12();
|
|
10975
11010
|
const nudge = useChoiceNudge();
|
|
10976
11011
|
const [open, setOpenState] = useState32(autoOpen === true);
|
|
10977
|
-
const onCloseRef =
|
|
11012
|
+
const onCloseRef = useRef18(onClose);
|
|
10978
11013
|
onCloseRef.current = onClose;
|
|
10979
|
-
const setOpen =
|
|
11014
|
+
const setOpen = useCallback7((next) => {
|
|
10980
11015
|
setOpenState(next);
|
|
10981
11016
|
if (!next) onCloseRef.current?.();
|
|
10982
11017
|
}, []);
|
|
@@ -11289,7 +11324,7 @@ function ChoiceListEditor({
|
|
|
11289
11324
|
const [usage, setUsage] = useState33(null);
|
|
11290
11325
|
const [asking, setAsking] = useState33(null);
|
|
11291
11326
|
const [moveTo, setMoveTo] = useState33("");
|
|
11292
|
-
const focusRow =
|
|
11327
|
+
const focusRow = useRef19(null);
|
|
11293
11328
|
const [removed, setRemoved] = useState33({});
|
|
11294
11329
|
const fieldId = field2?.id ?? null;
|
|
11295
11330
|
useEffect23(() => {
|
|
@@ -11551,7 +11586,7 @@ async function hasSession(getSession) {
|
|
|
11551
11586
|
}
|
|
11552
11587
|
|
|
11553
11588
|
// src/RecordsMount.tsx
|
|
11554
|
-
import { useRef as
|
|
11589
|
+
import { useRef as useRef20 } from "react";
|
|
11555
11590
|
import { RecordsProvider } from "@ai-matrx/records/react";
|
|
11556
11591
|
|
|
11557
11592
|
// src/PersonNamesBridge.tsx
|
|
@@ -11598,7 +11633,7 @@ function RecordsMount({
|
|
|
11598
11633
|
] }) }) });
|
|
11599
11634
|
}
|
|
11600
11635
|
function useShallowStableHost(host) {
|
|
11601
|
-
const held =
|
|
11636
|
+
const held = useRef20(null);
|
|
11602
11637
|
const next = host ?? {};
|
|
11603
11638
|
const previous = held.current;
|
|
11604
11639
|
if (previous !== null && sameParts(previous, next)) return previous;
|
|
@@ -12395,4 +12430,4 @@ export {
|
|
|
12395
12430
|
RecordNameText,
|
|
12396
12431
|
HeldChangeDecision
|
|
12397
12432
|
};
|
|
12398
|
-
//# sourceMappingURL=chunk-
|
|
12433
|
+
//# sourceMappingURL=chunk-NTOTMYVO.js.map
|